PKX'Zp'BBflare-client-php/LICENSE.mdnuW+AThe MIT License (MIT) Copyright (c) Facade Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 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. PKX'Z Gflare-client-php/src/View.phpnuW+A */ protected array $data = []; /** * @param string $file * @param array $data */ public function __construct(string $file, array $data = []) { $this->file = $file; $this->data = $data; } /** * @param string $file * @param array $data * * @return self */ public static function create(string $file, array $data = []): self { return new self($file, $data); } protected function dumpViewData(mixed $variable): string { $cloner = new VarCloner(); $dumper = new HtmlDumper(); $dumper->setDumpHeader(''); $output = fopen('php://memory', 'r+b'); if (! $output) { return ''; } $dumper->dump($cloner->cloneVar($variable)->withMaxDepth(1), $output, [ 'maxDepth' => 1, 'maxStringLength' => 160, ]); return (string)stream_get_contents($output, -1, 0); } /** @return array */ public function toArray(): array { return [ 'file' => $this->file, 'data' => array_map([$this, 'dumpViewData'], $this->data), ]; } } PKX'Z(#flare-client-php/src/Glows/Glow.phpnuW+A */ protected array $metaData = []; protected string $messageLevel; protected float $microtime; /** * @param string $name * @param string $messageLevel * @param array $metaData * @param float|null $microtime */ public function __construct( string $name, string $messageLevel = MessageLevels::INFO, array $metaData = [], ?float $microtime = null ) { $this->name = $name; $this->messageLevel = $messageLevel; $this->metaData = $metaData; $this->microtime = $microtime ?? microtime(true); } /** * @return array{time: int, name: string, message_level: string, meta_data: array, microtime: float} */ public function toArray(): array { return [ 'time' => $this->getCurrentTime(), 'name' => $this->name, 'message_level' => $this->messageLevel, 'meta_data' => $this->metaData, 'microtime' => $this->microtime, ]; } } PKX'ZD >+flare-client-php/src/Glows/GlowRecorder.phpnuW+A */ protected array $glows = []; public function record(Glow $glow): void { $this->glows[] = $glow; $this->glows = array_slice($this->glows, static::GLOW_LIMIT * -1, static::GLOW_LIMIT); } /** @return array */ public function glows(): array { return $this->glows; } public function reset(): void { $this->glows = []; } } PKX'Z7*flare-client-php/src/Concerns/UsesTime.phpnuW+AgetCurrentTime(); } } PKX'ZC~AA,flare-client-php/src/Concerns/HasContext.phpnuW+A */ protected array $userProvidedContext = []; public function stage(?string $stage): self { $this->stage = $stage; return $this; } public function messageLevel(?string $messageLevel): self { $this->messageLevel = $messageLevel; return $this; } /** * @param string $groupName * @param mixed $default * * @return array */ public function getGroup(string $groupName = 'context', $default = []): array { return $this->userProvidedContext[$groupName] ?? $default; } public function context(string $key, mixed $value): self { return $this->group('context', [$key => $value]); } /** * @param string $groupName * @param array $properties * * @return $this */ public function group(string $groupName, array $properties): self { $group = $this->userProvidedContext[$groupName] ?? []; $this->userProvidedContext[$groupName] = array_merge_recursive_distinct( $group, $properties ); return $this; } } PKX'Z)?<flare-client-php/src/Support/PhpStackFrameArgumentsFixer.phpnuW+AisCurrentlyIgnoringStackFrameArguments()) { return; } ini_set('zend.exception_ignore_args', '0'); } protected function isCurrentlyIgnoringStackFrameArguments(): bool { return match (ini_get('zend.exception_ignore_args')) { '1' => true, '0' => false, default => false, }; } } PKX'Z Lii"flare-client-php/src/Time/Time.phpnuW+AgetTimestamp(); } } PKX'Z!/qFFflare-client-php/src/Api.phpnuW+A */ protected array $queue = []; public function __construct(Client $client) { $this->client = $client; register_shutdown_function([$this, 'sendQueuedReports']); } public function sendReportsImmediately(): self { $this->sendReportsImmediately = true; return $this; } public function report(Report $report): void { try { $this->sendReportsImmediately ? $this->sendReportToApi($report) : $this->addReportToQueue($report); } catch (Exception $e) { // } } public function sendTestReport(Report $report): self { $this->sendReportToApi($report); return $this; } protected function addReportToQueue(Report $report): self { $this->queue[] = $report; return $this; } public function sendQueuedReports(): void { try { foreach ($this->queue as $report) { $this->sendReportToApi($report); } } catch (Exception $e) { // } finally { $this->queue = []; } } protected function sendReportToApi(Report $report): void { $payload = $this->truncateReport($report->toArray()); $this->client->post('reports', $payload); } /** * @param array $payload * * @return array */ protected function truncateReport(array $payload): array { return (new ReportTrimmer())->trim($payload); } } PKX'Zڱ33flare-client-php/src/Flare.phpnuW+A> */ protected array $middleware = []; protected GlowRecorder $recorder; protected ?string $applicationPath = null; protected ContextProviderDetector $contextDetector; protected mixed $previousExceptionHandler = null; /** @var null|callable */ protected $previousErrorHandler = null; /** @var null|callable */ protected $determineVersionCallable = null; protected ?int $reportErrorLevels = null; /** @var null|callable */ protected $filterExceptionsCallable = null; /** @var null|callable */ protected $filterReportsCallable = null; protected ?string $stage = null; protected ?string $requestId = null; protected ?Container $container = null; /** @var array|ArgumentReducer>|ArgumentReducers|null */ protected null|array|ArgumentReducers $argumentReducers = null; protected bool $withStackFrameArguments = true; /** @var array */ protected array $overriddenGroupings = []; public static function make( ?string $apiKey = null, ?ContextProviderDetector $contextDetector = null ): self { $client = new Client($apiKey); return new self($client, $contextDetector); } public function setApiToken(string $apiToken): self { $this->client->setApiToken($apiToken); return $this; } public function apiTokenSet(): bool { return $this->client->apiTokenSet(); } public function setBaseUrl(string $baseUrl): self { $this->client->setBaseUrl($baseUrl); return $this; } public function setStage(?string $stage): self { $this->stage = $stage; return $this; } public function sendReportsImmediately(): self { $this->api->sendReportsImmediately(); return $this; } public function determineVersionUsing(callable $determineVersionCallable): self { $this->determineVersionCallable = $determineVersionCallable; return $this; } public function reportErrorLevels(int $reportErrorLevels): self { $this->reportErrorLevels = $reportErrorLevels; return $this; } public function filterExceptionsUsing(callable $filterExceptionsCallable): self { $this->filterExceptionsCallable = $filterExceptionsCallable; return $this; } public function filterReportsUsing(callable $filterReportsCallable): self { $this->filterReportsCallable = $filterReportsCallable; return $this; } /** @param array|ArgumentReducer>|ArgumentReducers|null $argumentReducers */ public function argumentReducers(null|array|ArgumentReducers $argumentReducers): self { $this->argumentReducers = $argumentReducers; return $this; } public function withStackFrameArguments( bool $withStackFrameArguments = true, bool $forcePHPIniSetting = false, ): self { $this->withStackFrameArguments = $withStackFrameArguments; if ($forcePHPIniSetting) { (new PhpStackFrameArgumentsFixer())->enable(); } return $this; } /** * @param class-string $exceptionClass */ public function overrideGrouping( string $exceptionClass, string $type = OverriddenGrouping::ExceptionMessageAndClass, ): self { $this->overriddenGroupings[$exceptionClass] = $type; return $this; } public function version(): ?string { if (! $this->determineVersionCallable) { return null; } return ($this->determineVersionCallable)(); } /** * @param \Spatie\FlareClient\Http\Client $client * @param \Spatie\FlareClient\Context\ContextProviderDetector|null $contextDetector * @param array $middleware */ public function __construct( Client $client, ?ContextProviderDetector $contextDetector = null, array $middleware = [], ) { $this->client = $client; $this->recorder = new GlowRecorder(); $this->contextDetector = $contextDetector ?? new BaseContextProviderDetector(); $this->middleware = $middleware; $this->api = new Api($this->client); $this->registerDefaultMiddleware(); } /** @return array> */ public function getMiddleware(): array { return $this->middleware; } public function setContextProviderDetector(ContextProviderDetector $contextDetector): self { $this->contextDetector = $contextDetector; return $this; } public function setContainer(Container $container): self { $this->container = $container; return $this; } public function registerFlareHandlers(): self { $this->registerExceptionHandler(); $this->registerErrorHandler(); return $this; } public function registerExceptionHandler(): self { $this->previousExceptionHandler = set_exception_handler([$this, 'handleException']); return $this; } public function registerErrorHandler(?int $errorLevels = null): self { $this->previousErrorHandler = $errorLevels ? set_error_handler([$this, 'handleError'], $errorLevels) : set_error_handler([$this, 'handleError']); return $this; } protected function registerDefaultMiddleware(): self { return $this->registerMiddleware([ new AddGlows($this->recorder), new AddEnvironmentInformation(), ]); } /** * @param FlareMiddleware|array|class-string|callable $middleware * * @return $this */ public function registerMiddleware($middleware): self { if (! is_array($middleware)) { $middleware = [$middleware]; } $this->middleware = array_merge($this->middleware, $middleware); return $this; } /** * @return array> */ public function getMiddlewares(): array { return $this->middleware; } /** * @param string $name * @param string $messageLevel * @param array $metaData * * @return $this */ public function glow( string $name, string $messageLevel = MessageLevels::INFO, array $metaData = [] ): self { $this->recorder->record(new Glow($name, $messageLevel, $metaData)); return $this; } public function handleException(Throwable $throwable): void { $this->report($throwable); if ($this->previousExceptionHandler && is_callable($this->previousExceptionHandler)) { call_user_func($this->previousExceptionHandler, $throwable); } } /** * @return mixed */ public function handleError(mixed $code, string $message, string $file = '', int $line = 0) { $exception = new ErrorException($message, 0, $code, $file, $line); $this->report($exception); if ($this->previousErrorHandler) { return call_user_func( $this->previousErrorHandler, $code, $message, $file, $line ); } } public function applicationPath(string $applicationPath): self { $this->applicationPath = $applicationPath; return $this; } public function report(Throwable $throwable, ?callable $callback = null, ?Report $report = null, ?bool $handled = null): ?Report { if (! $this->shouldSendReport($throwable)) { return null; } $report ??= $this->createReport($throwable); if ($handled) { $report->handled(); } if (! is_null($callback)) { call_user_func($callback, $report); } $this->recorder->reset(); $this->sendReportToApi($report); return $report; } public function reportHandled(Throwable $throwable): ?Report { return $this->report($throwable, null, null, true); } protected function shouldSendReport(Throwable $throwable): bool { if (isset($this->reportErrorLevels) && $throwable instanceof Error) { return (bool) ($this->reportErrorLevels & $throwable->getCode()); } if (isset($this->reportErrorLevels) && $throwable instanceof ErrorException) { return (bool) ($this->reportErrorLevels & $throwable->getSeverity()); } if ($this->filterExceptionsCallable && $throwable instanceof Exception) { return (bool) (call_user_func($this->filterExceptionsCallable, $throwable)); } return true; } public function reportMessage(string $message, string $logLevel, ?callable $callback = null): void { $report = $this->createReportFromMessage($message, $logLevel); if (! is_null($callback)) { call_user_func($callback, $report); } $this->sendReportToApi($report); } public function sendTestReport(Throwable $throwable): void { $this->api->sendTestReport($this->createReport($throwable)); } protected function sendReportToApi(Report $report): void { if ($this->filterReportsCallable) { if (! call_user_func($this->filterReportsCallable, $report)) { return; } } try { $this->api->report($report); } catch (Exception $exception) { } } public function reset(): void { $this->api->sendQueuedReports(); $this->userProvidedContext = []; $this->recorder->reset(); } protected function applyAdditionalParameters(Report $report): void { $report ->stage($this->stage) ->messageLevel($this->messageLevel) ->setApplicationPath($this->applicationPath) ->userProvidedContext($this->userProvidedContext); } public function anonymizeIp(): self { $this->registerMiddleware(new RemoveRequestIp()); return $this; } /** * @param array $fieldNames * * @return $this */ public function censorRequestBodyFields(array $fieldNames): self { $this->registerMiddleware(new CensorRequestBodyFields($fieldNames)); return $this; } public function createReport(Throwable $throwable): Report { $report = Report::createForThrowable( $throwable, $this->contextDetector->detectCurrentContext(), $this->applicationPath, $this->version(), $this->argumentReducers, $this->withStackFrameArguments, $this->overriddenGroupings, ); return $this->applyMiddlewareToReport($report); } public function createReportFromMessage(string $message, string $logLevel): Report { $report = Report::createForMessage( $message, $logLevel, $this->contextDetector->detectCurrentContext(), $this->applicationPath, $this->argumentReducers, $this->withStackFrameArguments ); return $this->applyMiddlewareToReport($report); } protected function applyMiddlewareToReport(Report $report): Report { $this->applyAdditionalParameters($report); $middleware = array_map(function ($singleMiddleware) { return is_string($singleMiddleware) ? new $singleMiddleware : $singleMiddleware; }, $this->middleware); $report = (new Pipeline()) ->send($report) ->through($middleware) ->then(fn ($report) => $report); return $report; } } PKX'ZaR flare-client-php/src/helpers.phpnuW+A $array1 * @param array $array2 * * @return array */ function array_merge_recursive_distinct(array &$array1, array &$array2): array { $merged = $array1; foreach ($array2 as $key => &$value) { if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { $merged[$key] = array_merge_recursive_distinct($merged[$key], $value); } else { $merged[$key] = $value; } } return $merged; } } PKX'Zs^=flare-client-php/src/FlareMiddleware/CensorRequestHeaders.phpnuW+Aheaders = $headers; } public function handle(Report $report, $next) { $context = $report->allContext(); foreach ($this->headers as $header) { $header = strtolower($header); if (isset($context['headers'][$header])) { $context['headers'][$header] = ''; } } $report->userProvidedContext($context); return $next($report); } } PKX'Z]ՆGG1flare-client-php/src/FlareMiddleware/AddGlows.phpnuW+Arecorder = $recorder; } public function handle(Report $report, Closure $next) { foreach ($this->recorder->glows() as $glow) { $report->addGlow($glow); } return $next($report); } } PKX'Zjf\8flare-client-php/src/FlareMiddleware/FlareMiddleware.phpnuW+AallContext(); $context['request']['ip'] = null; $report->userProvidedContext($context); return $next($report); } } PKX'Z<0CC>flare-client-php/src/FlareMiddleware/AddDocumentationLinks.phpnuW+AdocumentationLinkResolvers = $documentationLinkResolvers; } public function handle(Report $report, Closure $next) { if (! $throwable = $report->getThrowable()) { return $next($report); } $links = $this->getLinks($throwable); if (count($links)) { $report->addDocumentationLinks($links); } return $next($report); } /** @return array */ protected function getLinks(\Throwable $throwable): array { $allLinks = []; foreach ($this->documentationLinkResolvers as $resolver) { $resolvedLinks = $resolver($throwable); if (is_null($resolvedLinks)) { continue; } if (is_string($resolvedLinks)) { $resolvedLinks = [$resolvedLinks]; } foreach ($resolvedLinks as $link) { $allLinks[] = $link; } } return array_values(array_unique($allLinks)); } } PKX'ZL@flare-client-php/src/FlareMiddleware/CensorRequestBodyFields.phpnuW+AfieldNames = $fieldNames; } public function handle(Report $report, $next) { $context = $report->allContext(); foreach ($this->fieldNames as $fieldName) { if (isset($context['request_data']['body'][$fieldName])) { $context['request_data']['body'][$fieldName] = ''; } } $report->userProvidedContext($context); return $next($report); } } PKX'ZA;;:flare-client-php/src/FlareMiddleware/AddGitInformation.phpnuW+AbaseDir = $this->getGitBaseDirectory(); if (! $this->baseDir) { return $next($report); } $report->group('git', [ 'hash' => $this->hash(), 'message' => $this->message(), 'tag' => $this->tag(), 'remote' => $this->remote(), 'isDirty' => ! $this->isClean(), ]); } catch (Throwable) { } return $next($report); } protected function hash(): ?string { return $this->command("git log --pretty=format:'%H' -n 1") ?: null; } protected function message(): ?string { return $this->command("git log --pretty=format:'%s' -n 1") ?: null; } protected function tag(): ?string { return $this->command('git describe --tags --abbrev=0') ?: null; } protected function remote(): ?string { return $this->command('git config --get remote.origin.url') ?: null; } protected function isClean(): bool { return empty($this->command('git status -s')); } protected function getGitBaseDirectory(): ?string { /** @var Process $process */ $process = Process::fromShellCommandline("echo $(git rev-parse --show-toplevel)")->setTimeout(1); $process->run(); if (! $process->isSuccessful()) { return null; } $directory = trim($process->getOutput()); if (! file_exists($directory)) { return null; } return $directory; } protected function command($command) { $process = Process::fromShellCommandline($command, $this->baseDir)->setTimeout(1); $process->run(); return trim($process->getOutput()); } } PKX'ZT__Bflare-client-php/src/FlareMiddleware/AddEnvironmentInformation.phpnuW+Agroup('env', [ 'php_version' => phpversion(), ]); return $next($report); } } PKX'Z>QQ8flare-client-php/src/FlareMiddleware/AddNotifierName.phpnuW+AnotifierName(static::NOTIFIER_NAME); return $next($report); } } PKX'Zj5flare-client-php/src/FlareMiddleware/AddSolutions.phpnuW+AsolutionProviderRepository = $solutionProviderRepository; } public function handle(Report $report, Closure $next) { if ($throwable = $report->getThrowable()) { $solutions = $this->solutionProviderRepository->getSolutionsForThrowable($throwable); foreach ($solutions as $solution) { $report->addSolution($solution); } } return $next($report); } } PKX'Z&v<flare-client-php/src/Context/BaseContextProviderDetector.phpnuW+ArunningInConsole()) { return new ConsoleContextProvider($_SERVER['argv'] ?? []); } return new RequestContextProvider(); } protected function runningInConsole(): bool { if (isset($_ENV['APP_RUNNING_IN_CONSOLE'])) { return $_ENV['APP_RUNNING_IN_CONSOLE'] === 'true'; } if (isset($_ENV['FLARE_FAKE_WEB_REQUEST'])) { return false; } return in_array(php_sapi_name(), ['cli', 'phpdb']); } } PKX'ZV8flare-client-php/src/Context/ContextProviderDetector.phpnuW+A */ public function toArray(): array; } PKX'Z91[[7flare-client-php/src/Context/RequestContextProvider.phpnuW+Arequest = $request ?? Request::createFromGlobals(); } /** * @return array */ public function getRequest(): array { return [ 'url' => $this->request->getUri(), 'ip' => $this->request->getClientIp(), 'method' => $this->request->getMethod(), 'useragent' => $this->request->headers->get('User-Agent'), ]; } /** * @return array */ protected function getFiles(): array { if (is_null($this->request->files)) { return []; } return $this->mapFiles($this->request->files->all()); } /** * @param array $files * * @return array */ protected function mapFiles(array $files): array { return array_map(function ($file) { if (is_array($file)) { return $this->mapFiles($file); } if (! $file instanceof UploadedFile) { return; } try { $fileSize = $file->getSize(); } catch (RuntimeException $e) { $fileSize = 0; } try { $mimeType = $file->getMimeType(); } catch (InvalidArgumentException $e) { $mimeType = 'undefined'; } return [ 'pathname' => $file->getPathname(), 'size' => $fileSize, 'mimeType' => $mimeType, ]; }, $files); } /** * @return array */ public function getSession(): array { try { $session = $this->request->getSession(); } catch (Throwable $exception) { $session = []; } return $session ? $this->getValidSessionData($session) : []; } protected function getValidSessionData($session): array { if (! method_exists($session, 'all')) { return []; } try { json_encode($session->all()); } catch (Throwable $e) { return []; } return $session->all(); } /** * @return arrayrequest->cookies->all(); } /** * @return array */ public function getHeaders(): array { /** @var array> $headers */ $headers = $this->request->headers->all(); return array_filter( array_map( fn (array $header) => $header[0], $headers ) ); } /** * @return array */ public function getRequestData(): array { return [ 'queryString' => $this->request->query->all(), 'body' => $this->getInputBag()->all() + $this->request->query->all(), 'files' => $this->getFiles(), ]; } protected function getInputBag(): InputBag|ParameterBag { $contentType = $this->request->headers->get('CONTENT_TYPE', 'text/html'); $isJson = str_contains($contentType, '/json') || str_contains($contentType, '+json'); if ($isJson) { return new InputBag((array) json_decode($this->request->getContent(), true)); } return in_array($this->request->getMethod(), ['GET', 'HEAD']) ? $this->request->query : $this->request->request; } /** @return array */ public function toArray(): array { return [ 'request' => $this->getRequest(), 'request_data' => $this->getRequestData(), 'headers' => $this->getHeaders(), 'cookies' => $this->getCookies(), 'session' => $this->getSession(), ]; } } PKX'Z{tf7flare-client-php/src/Context/ConsoleContextProvider.phpnuW+A */ protected array $arguments = []; /** * @param array $arguments */ public function __construct(array $arguments = []) { $this->arguments = $arguments; } /** * @return array */ public function toArray(): array { return [ 'arguments' => $this->arguments, ]; } } PKX'Z v,flare-client-php/src/Enums/MessageLevels.phpnuW+A */ public function context(): array; } PKX'ZFSbb1flare-client-php/src/Solutions/ReportSolution.phpnuW+Asolution = $solution; } public static function fromSolution(Solution|IgnitionSolution $solution): self { return new self($solution); } /** * @return array */ public function toArray(): array { $isRunnable = ($this->solution instanceof RunnableSolution || $this->solution instanceof IgnitionRunnableSolution); return [ 'class' => get_class($this->solution), 'title' => $this->solution->getSolutionTitle(), 'description' => $this->solution->getSolutionDescription(), 'links' => $this->solution->getDocumentationLinks(), /** @phpstan-ignore-next-line */ 'action_description' => $isRunnable ? $this->solution->getSolutionActionDescription() : null, 'is_runnable' => $isRunnable, 'ai_generated' => $this->solution->aiGenerated ?? false, ]; } } PKX'Zflare-client-php/src/Frame.phpnuW+A $this->frame->file, 'line_number' => $this->frame->lineNumber, 'method' => $this->frame->method, 'class' => $this->frame->class, 'code_snippet' => $this->frame->getSnippet(30), 'arguments' => $this->frame->arguments, 'application_frame' => $this->frame->applicationFrame, ]; } } PKX'Z]]]&flare-client-php/src/Http/Response.phpnuW+Aheaders = $headers; $this->body = $body; $this->error = $error; } public function getHeaders(): mixed { return $this->headers; } public function getBody(): mixed { return $this->body; } public function hasBody(): bool { return $this->body != false; } public function getError(): mixed { return $this->error; } public function getHttpResponseCode(): ?int { if (! isset($this->headers['http_code'])) { return null; } return (int) $this->headers['http_code']; } } PKX'ZH˵$flare-client-php/src/Http/Client.phpnuW+AapiToken = $apiToken; if (! $baseUrl) { throw MissingParameter::create('baseUrl'); } $this->baseUrl = $baseUrl; if (! $timeout) { throw MissingParameter::create('timeout'); } $this->timeout = $timeout; } public function setApiToken(string $apiToken): self { $this->apiToken = $apiToken; return $this; } public function apiTokenSet(): bool { return ! empty($this->apiToken); } public function setBaseUrl(string $baseUrl): self { $this->baseUrl = $baseUrl; return $this; } /** * @param string $url * @param array $arguments * * @return array|false */ public function get(string $url, array $arguments = []) { return $this->makeRequest('get', $url, $arguments); } /** * @param string $url * @param array $arguments * * @return array|false */ public function post(string $url, array $arguments = []) { return $this->makeRequest('post', $url, $arguments); } /** * @param string $url * @param array $arguments * * @return array|false */ public function patch(string $url, array $arguments = []) { return $this->makeRequest('patch', $url, $arguments); } /** * @param string $url * @param array $arguments * * @return array|false */ public function put(string $url, array $arguments = []) { return $this->makeRequest('put', $url, $arguments); } /** * @param string $method * @param array $arguments * * @return array|false */ public function delete(string $method, array $arguments = []) { return $this->makeRequest('delete', $method, $arguments); } /** * @param string $httpVerb * @param string $url * @param array $arguments * * @return array */ protected function makeRequest(string $httpVerb, string $url, array $arguments = []) { $queryString = http_build_query([ 'key' => $this->apiToken, ]); $fullUrl = "{$this->baseUrl}/{$url}?{$queryString}"; $headers = [ 'x-api-token: '.$this->apiToken, ]; $response = $this->makeCurlRequest($httpVerb, $fullUrl, $headers, $arguments); if ($response->getHttpResponseCode() === 422) { throw InvalidData::createForResponse($response); } if ($response->getHttpResponseCode() === 404) { throw NotFound::createForResponse($response); } if ($response->getHttpResponseCode() !== 200 && $response->getHttpResponseCode() !== 204) { throw BadResponseCode::createForResponse($response); } return $response->getBody(); } public function makeCurlRequest(string $httpVerb, string $fullUrl, array $headers = [], array $arguments = []): Response { $curlHandle = $this->getCurlHandle($fullUrl, $headers); switch ($httpVerb) { case 'post': curl_setopt($curlHandle, CURLOPT_POST, true); $this->attachRequestPayload($curlHandle, $arguments); break; case 'get': curl_setopt($curlHandle, CURLOPT_URL, $fullUrl.'&'.http_build_query($arguments)); break; case 'delete': curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE'); break; case 'patch': curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'PATCH'); $this->attachRequestPayload($curlHandle, $arguments); break; case 'put': curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'PUT'); $this->attachRequestPayload($curlHandle, $arguments); break; } $body = json_decode(curl_exec($curlHandle), true); $headers = curl_getinfo($curlHandle); $error = curl_error($curlHandle); return new Response($headers, $body, $error); } protected function attachRequestPayload(&$curlHandle, array $data) { $encoded = json_encode($data); $this->lastRequest['body'] = $encoded; curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $encoded); } /** * @param string $fullUrl * @param array $headers * * @return resource */ protected function getCurlHandle(string $fullUrl, array $headers = []) { $curlHandle = curl_init(); curl_setopt($curlHandle, CURLOPT_URL, $fullUrl); curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array_merge([ 'Accept: application/json', 'Content-Type: application/json', ], $headers)); curl_setopt($curlHandle, CURLOPT_USERAGENT, 'Laravel/Flare API 1.0'); curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_TIMEOUT, $this->timeout); curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($curlHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); curl_setopt($curlHandle, CURLOPT_ENCODING, ''); curl_setopt($curlHandle, CURLINFO_HEADER_OUT, true); curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curlHandle, CURLOPT_MAXREDIRS, 1); return $curlHandle; } } PKX'Z_L4flare-client-php/src/Http/Exceptions/BadResponse.phpnuW+AgetError()}"); $exception->response = $response; return $exception; } } PKX'Z$ͬ1flare-client-php/src/Http/Exceptions/NotFound.phpnuW+A */ public array $errors = []; public static function createForResponse(Response $response): self { $exception = new self(static::getMessageForResponse($response)); $exception->response = $response; $bodyErrors = isset($response->getBody()['errors']) ? $response->getBody()['errors'] : []; $exception->errors = $bodyErrors; return $exception; } public static function getMessageForResponse(Response $response): string { return "Response code {$response->getHttpResponseCode()} returned"; } } PKX'Z8r  4flare-client-php/src/Http/Exceptions/InvalidData.phpnuW+A */ public static function thresholds(): array { return [1024, 512, 256]; } /** * @param array $payload * * @return array */ public function execute(array $payload): array { foreach (static::thresholds() as $threshold) { if (! $this->reportTrimmer->needsToBeTrimmed($payload)) { break; } $payload = $this->trimPayloadString($payload, $threshold); } return $payload; } /** * @param array $payload * @param int $threshold * * @return array */ protected function trimPayloadString(array $payload, int $threshold): array { array_walk_recursive($payload, function (&$value) use ($threshold) { if (is_string($value) && strlen($value) > $threshold) { $value = substr($value, 0, $threshold); } }); return $payload; } } PKX'Z"NYYCflare-client-php/src/Truncation/TrimStackFrameArgumentsStrategy.phpnuW+A */ public static function thresholds(): array { return [100, 50, 25, 10]; } /** * @param array $payload * * @return array */ public function execute(array $payload): array { foreach (static::thresholds() as $threshold) { if (! $this->reportTrimmer->needsToBeTrimmed($payload)) { break; } $payload['context'] = $this->iterateContextItems($payload['context'], $threshold); } return $payload; } /** * @param array $contextItems * @param int $threshold * * @return array */ protected function iterateContextItems(array $contextItems, int $threshold): array { array_walk($contextItems, [$this, 'trimContextItems'], $threshold); return $contextItems; } protected function trimContextItems(mixed &$value, mixed $key, int $threshold): mixed { if (is_array($value)) { if (count($value) > $threshold) { $value = array_slice($value, $threshold * -1, $threshold); } array_walk($value, [$this, 'trimContextItems'], $threshold); } return $value; } } PKX'Z^E|.##>flare-client-php/src/Truncation/AbstractTruncationStrategy.phpnuW+AreportTrimmer = $reportTrimmer; } } PKX'Z@,6flare-client-php/src/Truncation/TruncationStrategy.phpnuW+A $payload * * @return array */ public function execute(array $payload): array; } PKX'Z1flare-client-php/src/Truncation/ReportTrimmer.phpnuW+A> */ protected array $strategies = [ TrimStringsStrategy::class, TrimStackFrameArgumentsStrategy::class, TrimContextItemsStrategy::class, ]; /** * @param array $payload * * @return array */ public function trim(array $payload): array { foreach ($this->strategies as $strategy) { if (! $this->needsToBeTrimmed($payload)) { break; } $payload = (new $strategy($this))->execute($payload); } return $payload; } /** * @param array $payload * * @return bool */ public function needsToBeTrimmed(array $payload): bool { return strlen((string)json_encode($payload)) > self::getMaxPayloadSize(); } public static function getMaxPayloadSize(): int { return self::$maxPayloadSize; } public static function setMaxPayloadSize(int $maxPayloadSize): void { self::$maxPayloadSize = $maxPayloadSize; } } PKX'Z//flare-client-php/src/Report.phpnuW+A */ protected array $glows = []; /** @var array> */ protected array $solutions = []; /** @var array */ public array $documentationLinks = []; protected ContextProvider $context; protected ?string $applicationPath = null; protected ?string $applicationVersion = null; /** @var array */ protected array $userProvidedContext = []; /** @var array */ protected array $exceptionContext = []; protected ?Throwable $throwable = null; protected string $notifierName = 'Flare Client'; protected ?string $languageVersion = null; protected ?string $frameworkVersion = null; protected ?int $openFrameIndex = null; protected string $trackingUuid; protected ?View $view; public static ?string $fakeTrackingUuid = null; protected ?bool $handled = null; protected ?string $overriddenGrouping = null; /** * @param array|ArgumentReducer>|ArgumentReducers|null $argumentReducers * @param array $overriddenGroupings */ public static function createForThrowable( Throwable $throwable, ContextProvider $context, ?string $applicationPath = null, ?string $version = null, null|array|ArgumentReducers $argumentReducers = null, bool $withStackTraceArguments = true, array $overriddenGroupings = [], ): self { $stacktrace = Backtrace::createForThrowable($throwable) ->withArguments($withStackTraceArguments) ->reduceArguments($argumentReducers) ->applicationPath($applicationPath ?? ''); $exceptionClass = self::getClassForThrowable($throwable); $report = (new self()) ->setApplicationPath($applicationPath) ->throwable($throwable) ->useContext($context) ->exceptionClass($exceptionClass) ->message($throwable->getMessage()) ->stackTrace($stacktrace) ->exceptionContext($throwable) ->setApplicationVersion($version); if (array_key_exists($exceptionClass, $overriddenGroupings)) { $report->overriddenGrouping($overriddenGroupings[$exceptionClass]); } return $report; } protected static function getClassForThrowable(Throwable $throwable): string { /** @phpstan-ignore-next-line */ if ($throwable::class === IgnitionViewException::class || $throwable::class === ViewException::class) { /** @phpstan-ignore-next-line */ if ($previous = $throwable->getPrevious()) { return get_class($previous); } } return get_class($throwable); } /** @param array|ArgumentReducer>|ArgumentReducers|null $argumentReducers */ public static function createForMessage( string $message, string $logLevel, ContextProvider $context, ?string $applicationPath = null, null|array|ArgumentReducers $argumentReducers = null, bool $withStackTraceArguments = true, ): self { $stacktrace = Backtrace::create() ->withArguments($withStackTraceArguments) ->reduceArguments($argumentReducers) ->applicationPath($applicationPath ?? ''); return (new self()) ->setApplicationPath($applicationPath) ->message($message) ->useContext($context) ->exceptionClass($logLevel) ->stacktrace($stacktrace) ->openFrameIndex($stacktrace->firstApplicationFrameIndex()); } public function __construct() { $this->trackingUuid = self::$fakeTrackingUuid ?? $this->generateUuid(); } public function trackingUuid(): string { return $this->trackingUuid; } public function exceptionClass(string $exceptionClass): self { $this->exceptionClass = $exceptionClass; return $this; } public function getExceptionClass(): string { return $this->exceptionClass; } public function throwable(Throwable $throwable): self { $this->throwable = $throwable; return $this; } public function getThrowable(): ?Throwable { return $this->throwable; } public function message(string $message): self { $this->message = $message; return $this; } public function getMessage(): string { return $this->message; } public function stacktrace(Backtrace $stacktrace): self { $this->stacktrace = $stacktrace; return $this; } public function getStacktrace(): Backtrace { return $this->stacktrace; } public function notifierName(string $notifierName): self { $this->notifierName = $notifierName; return $this; } public function languageVersion(string $languageVersion): self { $this->languageVersion = $languageVersion; return $this; } public function frameworkVersion(string $frameworkVersion): self { $this->frameworkVersion = $frameworkVersion; return $this; } public function useContext(ContextProvider $request): self { $this->context = $request; return $this; } public function openFrameIndex(?int $index): self { $this->openFrameIndex = $index; return $this; } public function setApplicationPath(?string $applicationPath): self { $this->applicationPath = $applicationPath; return $this; } public function getApplicationPath(): ?string { return $this->applicationPath; } public function setApplicationVersion(?string $applicationVersion): self { $this->applicationVersion = $applicationVersion; return $this; } public function getApplicationVersion(): ?string { return $this->applicationVersion; } public function view(?View $view): self { $this->view = $view; return $this; } public function addGlow(Glow $glow): self { $this->glows[] = $glow->toArray(); return $this; } public function addSolution(Solution|IgnitionSolution $solution): self { $this->solutions[] = ReportSolution::fromSolution($solution)->toArray(); return $this; } /** * @param array $documentationLinks * * @return $this */ public function addDocumentationLinks(array $documentationLinks): self { $this->documentationLinks = $documentationLinks; return $this; } /** * @param array $userProvidedContext * * @return $this */ public function userProvidedContext(array $userProvidedContext): self { $this->userProvidedContext = $userProvidedContext; return $this; } /** * @return array */ public function allContext(): array { $context = $this->context->toArray(); $context = array_merge_recursive_distinct($context, $this->exceptionContext); return array_merge_recursive_distinct($context, $this->userProvidedContext); } public function handled(?bool $handled = true): self { $this->handled = $handled; return $this; } public function overriddenGrouping(?string $overriddenGrouping): self { $this->overriddenGrouping = $overriddenGrouping; return $this; } protected function exceptionContext(Throwable $throwable): self { if ($throwable instanceof ProvidesFlareContext) { $this->exceptionContext = $throwable->context(); } return $this; } /** * @return array */ protected function stracktraceAsArray(): array { return array_map( fn (SpatieFrame $frame) => Frame::fromSpatieFrame($frame)->toArray(), $this->cleanupStackTraceForError($this->stacktrace->frames()), ); } /** * @param array $frames * * @return array */ protected function cleanupStackTraceForError(array $frames): array { if ($this->throwable === null || get_class($this->throwable) !== ErrorException::class) { return $frames; } $firstErrorFrameIndex = null; $restructuredFrames = array_values(array_slice($frames, 1)); // remove the first frame where error was created foreach ($restructuredFrames as $index => $frame) { if ($frame->file === $this->throwable->getFile()) { $firstErrorFrameIndex = $index; break; } } if ($firstErrorFrameIndex === null) { return $frames; } $restructuredFrames[$firstErrorFrameIndex]->arguments = null; // Remove error arguments return array_values(array_slice($restructuredFrames, $firstErrorFrameIndex)); } /** * @return array */ public function toArray(): array { return [ 'notifier' => $this->notifierName ?? 'Flare Client', 'language' => 'PHP', 'framework_version' => $this->frameworkVersion, 'language_version' => $this->languageVersion ?? phpversion(), 'exception_class' => $this->exceptionClass, 'seen_at' => $this->getCurrentTime(), 'message' => $this->message, 'glows' => $this->glows, 'solutions' => $this->solutions, 'documentation_links' => $this->documentationLinks, 'stacktrace' => $this->stracktraceAsArray(), 'context' => $this->allContext(), 'stage' => $this->stage, 'message_level' => $this->messageLevel, 'open_frame_index' => $this->openFrameIndex, 'application_path' => $this->applicationPath, 'application_version' => $this->applicationVersion, 'tracking_uuid' => $this->trackingUuid, 'handled' => $this->handled, 'overridden_grouping' => $this->overriddenGrouping, ]; } /* * Found on https://stackoverflow.com/questions/2040240/php-function-to-generate-v4-uuid/15875555#15875555 */ protected function generateUuid(): string { // Generate 16 bytes (128 bits) of random data or use the data passed into the function. $data = random_bytes(16); // Set version to 0100 $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // Set bits 6-7 to 10 $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // Output the 36 character UUID. return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); } } PKX'ZE,'<<flare-client-php/README.mdnuW+A# Send PHP errors to Flare [![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/flare-client-php.svg?style=flat-square)](https://packagist.org/packages/spatie/flare-client-php) [![Run tests](https://github.com/spatie/flare-client-php/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/flare-client-php/actions/workflows/run-tests.yml) [![PHPStan](https://github.com/spatie/flare-client-php/actions/workflows/phpstan.yml/badge.svg)](https://github.com/spatie/flare-client-php/actions/workflows/phpstan.yml) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/flare-client-php.svg?style=flat-square)](https://packagist.org/packages/spatie/flare-client-php) This repository contains the PHP client to send errors and exceptions to [Flare](https://flareapp.io). The client can be installed using composer and works for PHP 8.0 and above. Using Laravel? You probably want to use [Ignition for Laravel](https://github.com/spatie/laravel-ignition). It comes with a beautiful error page and has the Flare client built in. ![Screenshot of error in Flare](https://facade.github.io/flare-client-php/screenshot.png) ## Documentation When creating a new project on Flare, we'll display installation instructions for your PHP app. Even though the default settings will work fine for all projects, we offer some customization options that you might like. ### Ignoring errors The Flare client will always send all exceptions to Flare, you can change this behaviour by filtering the exceptions with a callable: ```php // Where you registered your client... $flare = Flare::make('YOUR-FLARE-API-KEY') ->registerFlareHandlers(); $flare->filterExceptionsUsing( fn(Throwable $throwable) => !$throwable instanceof AuthorizationException ); ``` Additionally, you can provide a callable to the `Flare::filterReportsUsing` method to stop a report from being sent to Flare. Compared to `filterExceptionsCallable`, this can also prevent logs and errors from being sent. ```php use Spatie\FlareClient\Flare; $flare = Flare::make('YOUR-API-KEY') ->registerFlareHandlers(); Flare::filterReportsUsing(function(Report $report) { // return a boolean to control whether the report should be sent to Flare return true; }); ``` Finally, it is also possible to set the levels of errors reported to Flare as such: ```php $flare->reportErrorLevels(E_ALL & ~E_NOTICE); // Will send all errors except E_NOTICE errors ``` ### Controlling collected data Just like the Laravel configuration, the generic PHP client allows you to configure which information should be sent to Flare. #### Anonymizing IPs By default, the Flare client collects information about the IP address of your application users. If you want to disable this information, you can call the `anonymizeIp()` method on your Flare client instance. ```php // Where you registered your client... $flare = Flare::make('YOUR-FLARE-API-KEY') ->registerFlareHandlers(); $flare->anonymizeIp(); ``` #### Censoring request body fields When an exception occurs in a web request, the Flare client will pass on any request fields that are present in the body. In some cases, such as a login page, these request fields may contain a password that you don't want to send to Flare. To censor out values of certain fields, you can use call `censorRequestBodyFields`. You should pass it the names of the fields you wish to censor. ```php // Where you registered your client... $flare = Flare::make('YOUR-FLARE-API-KEY') ->registerFlareHandlers(); $flare->censorRequestBodyFields('password'); ``` This will replace the value of any sent fields named "password" with the value "". ### Identifying users When reporting an error to Flare, you can tell the Flare client, what information you have about the currently authenticated user. You can do this by providing a `user` group that holds all the information you want to share. ```php $user = YourAuthenticatedUserInstance(); $flare->group('user', [ 'email' => $user->email, 'name' => $user->name, 'additional_information' => $user->additional, ]); ``` ### Linking to errors When an error occurs in web request, your application will likely display a minimal error page when it's in production. If a user sees this page and wants to report this error to you, the user usually only reports the URL and the time the error was seen. To let your users pinpoint the exact error they saw, you can display the UUID of the error sent to Flare. You can do this by displaying the UUID returned by `Flare::sentReports()->latestUuid()` in your view. Optionally, you can use `Flare::sentReports()->latestUrl()` to get a link to the error in Flare. That link isn't publicly accessible, it is only visible to Flare users that have access to the project on Flare. In certain cases, multiple error can be reported to Flare in a single request. To get a hold of the UUIDs of all sent errors, you can call `Flare::sentReports()->uuids()`. You can get links to all sent errors with `Flare::sentReports()->urls()`. It is possible to search for certain errors in Flare using the UUID, you can find more information about that [here](http://flareapp.io/docs/flare/general/searching-errors). ### Adding custom context When you send an error to Flare within a non-Laravel application, we do not collect your application information - since we don't know about your specific application. In order to provide more information, you can add custom context to your application that will be sent along with every exception that happens in your application. This can be very useful if you want to provide key-value related information that furthermore helps you to debug a possible exception. The Flare client allows you to set custom context items like this: ```php // Get access to your registered Flare client instance $flare->context('Tenant', 'My-Tenant-Identifier'); ``` This could for example be set automatically in a Laravel service provider or an event. So the next time an exception happens, this value will be sent along to Flare and you can find it on the "Context" tab. #### Grouping multiple context items Sometimes you may want to group your context items by a key that you provide to have an easier visual differentiation when you look at your custom context items. The Flare client allows you to also provide your own custom context groups like this: ```php // Get access to your registered Flare client instance $flare->group('Custom information', [ 'key' => 'value', 'another key' => 'another value', ]); ``` ### Adding glows In addition to custom context items, you can also add "Glows" to your application. Glows allow you to add little pieces of information, that can later be found in a chronological order in the "Debug" tab of your application. You can think of glows as breadcrumbs that can help you track down which parts of your code an exception went through. The Flare PHP client allows you to add a glows to your application like this: ### Stacktrace arguments When an error occurs in your application, Flare will send the stacktrace of the error to Flare. This stacktrace contains the file and line number where the error occurred and the argument values passed to the function or method that caused the error. These argument values have been significantly reduced to make them easier to read and reduce the amount of data sent to Flare, which means that the arguments are not always complete. To see the full arguments, you can always use a glow to send the whole parameter to Flare. For example, let's say you have the following Carbon object: ```php new DateTime('2020-05-16 14:00:00', new DateTimeZone('Europe/Brussels')) ``` Flare will automatically reduce this to the following: ``` 16 May 2020 14:00:00 +02:00 ``` It is possible to configure how these arguments are reduced. You can even implement your own reducers! By default, the following reducers are used: - BaseTypeArgumentReducer - ArrayArgumentReducer - StdClassArgumentReducer - EnumArgumentReducer - ClosureArgumentReducer - DateTimeArgumentReducer - DateTimeZoneArgumentReducer - SymphonyRequestArgumentReducer - StringableArgumentReducer #### Implementing your reducer Each reducer implements `Spatie\FlareClient\Arguments\Reducers\ArgumentReducer`. This interface contains a single method, `execute` which provides the original argument value: ```php interface ArgumentReducer { public function execute(mixed $argument): ReducedArgumentContract; } ``` In the end, three types of values can be returned: When the reducer could not reduce this type of argument value: ```php return UnReducedArgument::create(); ``` When the reducer could reduce the argument value, but a part was truncated due to the size: ```php return new TruncatedReducedArgument( array_slice($argument, 0, 25), // The reduced value 'array' // The original type of the argument ); ``` When the reducer could reduce the full argument value: ```php return new TruncatedReducedArgument( $argument, // The reduced value 'array' // The original type of the argument ); ``` For example, the `DateTimeArgumentReducer` from the example above looks like this: ```php class DateTimeArgumentReducer implements ArgumentReducer { public function execute(mixed $argument): ReducedArgumentContract { if (! $argument instanceof \DateTimeInterface) { return UnReducedArgument::create(); } return new ReducedArgument( $argument->format('d M Y H:i:s p'), get_class($argument), ); } } ``` #### Configuring the reducers Reducers can be added as such: ```php // Where you registered your client... $flare = Flare::make('YOUR-FLARE-API-KEY') ->registerFlareHandlers(); $flare->argumentReducers([ BaseTypeArgumentReducer::class, ArrayArgumentReducer::class, StdClassArgumentReducer::class, EnumArgumentReducer::class, ClosureArgumentReducer::class, DateTimeArgumentReducer::class, DateTimeZoneArgumentReducer::class, SymphonyRequestArgumentReducer::class, StringableArgumentReducer::class, ]) ``` Reducers are executed from top to bottom. The first reducer which doesn't return an `UnReducedArgument` will be used. Always add the default reducers when you want to define your own reducer. Otherwise, a very rudimentary reduced argument value will be used. #### Disabling stack frame arguments If you don't want to send any arguments to Flare, you can turn off this behavior as such: ```php // Where you registered your client... $flare = Flare::make('YOUR-FLARE-API-KEY') ->registerFlareHandlers(); $flare->withStackFrameArguments(false); ``` #### Missing arguments? - Make sure you've got the latest version of Flare / Ignition - Check that `withStackFrameArguments` is not disabled - Check your ini file whether `zend.exception_ignore_args` is enabled, it should be `0` ```php use Spatie\FlareClient\Enums\MessageLevels; // Get access to your registered Flare client instance $flare->glow('This is a message from glow!', MessageLevels::DEBUG, func_get_args()); ``` ### Handling exceptions When an exception is thrown in an application, the application stops executing and the exception is reported to Flare. However, there are cases where you might want to handle the exception so that the application can continue running. And the user isn't presented with an error message. In such cases it might still be useful to report the exception to Flare, so you'll have a correct overview of what's going on within your application. We call such exceptions "handled exceptions". When you've caught an exception in PHP it can still be reported to Flare: ```php try { // Code that might throw an exception } catch (Exception $exception) { $flare->reportHandled($exception); } ``` In Flare, we'll show that the exception was handled, it is possible to filter these exceptions. You'll find more about filtering exceptions [here](https://flareapp.io/docs/flare/general/searching-errors). ### Writing custom middleware Before Flare receives the data that was collected from your local exception, we give you the ability to call custom middleware methods. These methods retrieve the report that should be sent to Flare and allow you to add custom information to that report. Just like with the Flare client itself, you can add custom context information to your report as well. This allows you to structure your code so that you have all context related changes in one place. You can register a custom middleware by using the `registerMiddleware` method on the `Spatie\FlareClient\Flare` class, like this: ```php use Spatie\FlareClient\Report; // Get access to your registered Flare client instance $flare->registerMiddleware(function (Report $report, $next) { // Add custom information to the report $report->context('key', 'value'); return $next($report); }); ``` To create a middleware that, for example, removes all the session data before your report gets sent to Flare, the middleware implementation might look like this: ```php use Spatie\FlareClient\Report; class FlareMiddleware { public function handle(Report $report, $next) { $context = $report->allContext(); $context['session'] = null; $report->userProvidedContext($context); return $next($report); } } ``` ### Identifying users When reporting an error to Flare, you can tell the Flare client, what information you have about the currently authenticated user. You can do this by providing a `user` group that holds all the information you want to share. ```php $user = YourAuthenticatedUserInstance(); $flare->group('user', [ 'email' => $user->email, 'name' => $user->name, 'additional_information' => $user->additional, ]); ``` ### Customizing error grouping Flare has a [special grouping](https://flareapp.io/docs/flare/general/error-grouping) algorithm that groups similar error occurrences into errors to make understanding what's going on in your application easier. While the default grouping algorithm works for 99% of the cases, there are some cases where you might want to customize the grouping. This can be done on an exception class base, you can tell Flare to group all exceptions of a specific class together: ```php use Spatie\FlareClient\Enums\OverriddenGrouping; $flare->overrideGrouping(SomeExceptionClass::class, OverriddenGrouping::ExceptionClass); ``` In this case every exception of the `SomeExceptionClass` will be grouped together no matter what the message or stack trace is. It is also possible to group exceptions of the same class together, but also take the message into account: ```php use Spatie\FlareClient\Enums\OverriddenGrouping; $flare->overrideGrouping(SomeExceptionClass::class, OverriddenGrouping::ExceptionMessageAndClass); ``` Be careful when grouping by class and message, since every occurrence might have a slightly different message, this could lead to a lot of different errors. ## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Testing ``` bash composer test ``` ## Contributing Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details. ## Security If you discover any security related issues, please email support@flareapp.io instead of using the issue tracker. ## License The MIT License (MIT). Please see [License File](LICENSE.md) for more information. PKX'Z..flare-client-php/composer.jsonnuW+A{ "name": "spatie/flare-client-php", "description": "Send PHP errors to Flare", "keywords": [ "spatie", "flare", "exception", "reporting" ], "homepage": "https://github.com/spatie/flare-client-php", "license": "MIT", "require": { "php": "^8.0", "illuminate/pipeline": "^8.0|^9.0|^10.0|^11.0|^12.0", "spatie/backtrace": "^1.6.1", "symfony/http-foundation": "^5.2|^6.0|^7.0", "symfony/mime": "^5.2|^6.0|^7.0", "symfony/process": "^5.2|^6.0|^7.0", "symfony/var-dumper": "^5.2|^6.0|^7.0" }, "require-dev": { "dms/phpunit-arraysubset-asserts": "^0.5.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "spatie/pest-plugin-snapshots": "^1.0|^2.0", "pestphp/pest": "^1.20|^2.0" }, "autoload": { "psr-4": { "Spatie\\FlareClient\\": "src" }, "files": [ "src/helpers.php" ] }, "autoload-dev": { "psr-4": { "Spatie\\FlareClient\\Tests\\": "tests" } }, "scripts": { "analyse": "vendor/bin/phpstan analyse", "baseline": "vendor/bin/phpstan analyse --generate-baseline", "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", "test": "vendor/bin/pest", "test-coverage": "vendor/bin/phpunit --coverage-html coverage" }, "config": { "sort-packages": true, "allow-plugins": { "pestphp/pest-plugin": true, "phpstan/extension-installer": true } }, "prefer-stable": true, "minimum-stability": "dev", "extra": { "branch-alias": { "dev-main": "1.3.x-dev" } } } PKX'ZY==ignition/LICENSE.mdnuW+AThe MIT License (MIT) Copyright (c) Spatie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 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. PKX'Z/1))ignition/src/Ignition.phpnuW+A */ protected array $middleware = []; protected IgnitionConfig $ignitionConfig; protected ContextProviderDetector $contextProviderDetector; protected SolutionProviderRepositoryContract $solutionProviderRepository; protected ?bool $inProductionEnvironment = null; protected ?string $solutionTransformerClass = null; /** @var ArrayObject */ protected ArrayObject $documentationLinkResolvers; protected string $customHtmlHead = ''; protected string $customHtmlBody = ''; public static function make(): self { return new self(); } public function __construct( ?Flare $flare = null, ) { $this->flare = $flare ?? Flare::make(); $this->ignitionConfig = IgnitionConfig::loadFromConfigFile(); $this->solutionProviderRepository = new SolutionProviderRepository($this->getDefaultSolutionProviders()); $this->documentationLinkResolvers = new ArrayObject(); $this->contextProviderDetector = new BaseContextProviderDetector(); $this->middleware[] = new AddSolutions($this->solutionProviderRepository); $this->middleware[] = new AddDocumentationLinks($this->documentationLinkResolvers); } public function setSolutionTransformerClass(string $solutionTransformerClass): self { $this->solutionTransformerClass = $solutionTransformerClass; return $this; } /** @param callable(Throwable): mixed $callable */ public function resolveDocumentationLink(callable $callable): self { $this->documentationLinkResolvers[] = $callable; return $this; } public function setConfig(IgnitionConfig $ignitionConfig): self { $this->ignitionConfig = $ignitionConfig; return $this; } public function runningInProductionEnvironment(bool $boolean = true): self { $this->inProductionEnvironment = $boolean; return $this; } public function getFlare(): Flare { return $this->flare; } public function setFlare(Flare $flare): self { $this->flare = $flare; return $this; } public function setSolutionProviderRepository(SolutionProviderRepositoryContract $solutionProviderRepository): self { $this->solutionProviderRepository = $solutionProviderRepository; return $this; } public function shouldDisplayException(bool $shouldDisplayException): self { $this->shouldDisplayException = $shouldDisplayException; return $this; } public function applicationPath(string $applicationPath): self { $this->applicationPath = $applicationPath; return $this; } /** * @param string $name * @param string $messageLevel * @param array $metaData * * @return $this */ public function glow( string $name, string $messageLevel = MessageLevels::INFO, array $metaData = [] ): self { $this->flare->glow($name, $messageLevel, $metaData); return $this; } /** * @param array> $solutionProviders * * @return $this */ public function addSolutionProviders(array $solutionProviders): self { $this->solutionProviderRepository->registerSolutionProviders($solutionProviders); return $this; } /** @deprecated Use `setTheme('dark')` instead */ public function useDarkMode(): self { return $this->setTheme('dark'); } /** @deprecated Use `setTheme($theme)` instead */ public function theme(string $theme): self { return $this->setTheme($theme); } public function setTheme(string $theme): self { $this->ignitionConfig->setOption('theme', $theme); return $this; } public function setEditor(string $editor): self { $this->ignitionConfig->setOption('editor', $editor); return $this; } public function sendToFlare(?string $apiKey): self { $this->flareApiKey = $apiKey ?? ''; return $this; } public function configureFlare(callable $callable): self { ($callable)($this->flare); return $this; } /** * @param FlareMiddleware|array $middleware * * @return $this */ public function registerMiddleware(array|FlareMiddleware $middleware): self { if (! is_array($middleware)) { $middleware = [$middleware]; } foreach ($middleware as $singleMiddleware) { $this->middleware = array_merge($this->middleware, $middleware); } return $this; } public function setContextProviderDetector(ContextProviderDetector $contextProviderDetector): self { $this->contextProviderDetector = $contextProviderDetector; return $this; } public function reset(): self { $this->flare->reset(); return $this; } public function register(?int $errorLevels = null): self { error_reporting($errorLevels ?? -1); $errorLevels ? set_error_handler([$this, 'renderError'], $errorLevels) : set_error_handler([$this, 'renderError']); set_exception_handler([$this, 'handleException']); return $this; } /** * @param int $level * @param string $message * @param string $file * @param int $line * @param array $context * * @return void * @throws \ErrorException */ public function renderError( int $level, string $message, string $file = '', int $line = 0, array $context = [] ): void { if(error_reporting() === (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE)) { // This happens when PHP version is >=8 and we caught an error that was suppressed with the "@" operator // See the first warning box in https://www.php.net/manual/en/language.operators.errorcontrol.php return; } throw new ErrorException($message, 0, $level, $file, $line); } /** * This is the main entry point for the framework agnostic Ignition package. * Displays the Ignition page and optionally sends a report to Flare. */ public function handleException(Throwable $throwable): Report { $this->setUpFlare(); $report = $this->createReport($throwable); if ($this->shouldDisplayException && $this->inProductionEnvironment !== true) { $this->renderException($throwable, $report); } if ($this->flare->apiTokenSet() && $this->inProductionEnvironment !== false) { $this->flare->report($throwable, report: $report); } return $report; } /** * This is the main entrypoint for laravel-ignition. It only renders the exception. * Sending the report to Flare is handled in the laravel-ignition log handler. */ public function renderException(Throwable $throwable, ?Report $report = null): void { $this->setUpFlare(); $report ??= $this->createReport($throwable); $viewModel = new ErrorPageViewModel( $throwable, $this->ignitionConfig, $report, $this->solutionProviderRepository->getSolutionsForThrowable($throwable), $this->solutionTransformerClass, $this->customHtmlHead, $this->customHtmlBody, ); (new Renderer())->render(['viewModel' => $viewModel], self::viewPath('errorPage')); } public static function viewPath(string $viewName): string { return __DIR__ . "/../resources/views/{$viewName}.php"; } /** * Add custom HTML which will be added to the head tag of the error page. */ public function addCustomHtmlToHead(string $html): self { $this->customHtmlHead .= $html; return $this; } /** * Add custom HTML which will be added to the body tag of the error page. */ public function addCustomHtmlToBody(string $html): self { $this->customHtmlBody .= $html; return $this; } protected function setUpFlare(): self { if (! $this->flare->apiTokenSet()) { $this->flare->setApiToken($this->flareApiKey ?? ''); } $this->flare->setContextProviderDetector($this->contextProviderDetector); foreach ($this->middleware as $singleMiddleware) { $this->flare->registerMiddleware($singleMiddleware); } if ($this->applicationPath !== '') { $this->flare->applicationPath($this->applicationPath); } return $this; } /** @return array> */ protected function getDefaultSolutionProviders(): array { return [ BadMethodCallSolutionProvider::class, MergeConflictSolutionProvider::class, UndefinedPropertySolutionProvider::class, ]; } protected function createReport(Throwable $throwable): Report { return $this->flare->createReport($throwable); } } PKX'Z#ignition/src/ErrorPage/Renderer.phpnuW+A $data * * @return void */ public function render(array $data, string $viewPath): void { $viewFile = $viewPath; extract($data, EXTR_OVERWRITE); include $viewFile; } public function renderAsString(array $date, string $viewPath): string { ob_start(); $this->render($date, $viewPath); return ob_get_clean(); } } PKX'ZԈ -ignition/src/ErrorPage/ErrorPageViewModel.phpnuW+A $solutions * @param string|null $solutionTransformerClass */ public function __construct( protected ?Throwable $throwable, protected IgnitionConfig $ignitionConfig, protected Report $report, protected array $solutions, protected ?string $solutionTransformerClass = null, protected string $customHtmlHead = '', protected string $customHtmlBody = '' ) { $this->solutionTransformerClass ??= SolutionTransformer::class; } public function throwableString(): string { if (! $this->throwable) { return ''; } $throwableString = sprintf( "%s: %s in file %s on line %d\n\n%s\n", get_class($this->throwable), $this->throwable->getMessage(), $this->throwable->getFile(), $this->throwable->getLine(), $this->report->getThrowable()?->getTraceAsString() ); return htmlspecialchars($throwableString); } public function title(): string { return htmlspecialchars($this->report->getMessage()); } /** * @return array */ public function config(): array { return $this->ignitionConfig->toArray(); } public function theme(): string { return $this->config()['theme'] ?? 'auto'; } /** * @return array */ public function solutions(): array { return array_map(function (Solution $solution) { /** @var class-string $transformerClass */ $transformerClass = $this->solutionTransformerClass; /** @var SolutionTransformer $transformer */ $transformer = new $transformerClass($solution); return ($transformer)->toArray(); }, $this->solutions); } /** * @return array */ public function report(): array { return $this->report->toArray(); } public function jsonEncode(mixed $data): string { $jsonOptions = JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT; return (string) json_encode($data, $jsonOptions); } public function getAssetContents(string $asset): string { $assetPath = __DIR__."/../../resources/compiled/{$asset}"; return (string) file_get_contents($assetPath); } /** * @return array */ public function shareableReport(): array { return (new ReportTrimmer())->trim($this->report()); } public function updateConfigEndpoint(): string { // TODO: Should be based on Ignition config return '/_ignition/update-config'; } public function customHtmlHead(): string { return $this->customHtmlHead; } public function customHtmlBody(): string { return $this->customHtmlBody; } } PKX'ZP RR3ignition/src/Contracts/HasSolutionsForThrowable.phpnuW+A */ public function getSolutions(Throwable $throwable): array; } PKX'ZıtNN(ignition/src/Contracts/ConfigManager.phpnuW+A */ public function load(): array; /** @param array $options */ public function save(array $options): bool; /** @return array */ public function getPersistentInfo(): array; } PKX'Z9p5ignition/src/Contracts/SolutionProviderRepository.phpnuW+A|HasSolutionsForThrowable $solutionProvider * * @return $this */ public function registerSolutionProvider(string $solutionProvider): self; /** * @param array|HasSolutionsForThrowable> $solutionProviders * * @return $this */ public function registerSolutionProviders(array $solutionProviders): self; /** * @param Throwable $throwable * * @return array */ public function getSolutionsForThrowable(Throwable $throwable): array; /** * @param class-string $solutionClass * * @return null|Solution */ public function getSolutionForClass(string $solutionClass): ?Solution; } PKX'ZVc+ignition/src/Contracts/RunnableSolution.phpnuW+A $parameters */ public function run(array $parameters = []): void; /** @return array */ public function getRunParameters(): array; } PKX'Z±Ns+ignition/src/Contracts/ProvidesSolution.phpnuW+A */ public function getDocumentationLinks(): array; } PKX'Z`onn'ignition/src/Contracts/BaseSolution.phpnuW+A */ protected array $links = []; public static function create(string $title = ''): static { // It's important to keep the return type as static because // the old Facade Ignition contracts extend from this method. /** @phpstan-ignore-next-line */ return new static($title); } public function __construct(string $title = '') { $this->title = $title; } public function getSolutionTitle(): string { return $this->title; } public function setSolutionTitle(string $title): self { $this->title = $title; return $this; } public function getSolutionDescription(): string { return $this->description; } public function setSolutionDescription(string $description): self { $this->description = $description; return $this; } /** @return array */ public function getDocumentationLinks(): array { return $this->links; } /** @param array $links */ public function setDocumentationLinks(array $links): self { $this->links = $links; return $this; } } PKX'Z  8ignition/src/Solutions/OpenAi/OpenAiSolutionProvider.phpnuW+Acache ??= new DummyCache(); } public function canSolve(Throwable $throwable): bool { return true; } public function getSolutions(Throwable $throwable): array { return [ new OpenAiSolution( $throwable, $this->openAiKey, $this->cache, $this->cacheTtlInSeconds, $this->applicationType, $this->applicationPath, ), ]; } public function applicationType(string $applicationType): self { $this->applicationType = $applicationType; return $this; } public function applicationPath(string $applicationPath): self { $this->applicationPath = $applicationPath; return $this; } public function useCache(CacheInterface $cache, int $cacheTtlInSeconds = 60 * 60): self { $this->cache = $cache; $this->cacheTtlInSeconds = $cacheTtlInSeconds; return $this; } } PKX'ZN 0ignition/src/Solutions/OpenAi/OpenAiSolution.phpnuW+Aprompt = $this->generatePrompt(); $this->openAiSolutionResponse = $this->getAiSolution(); } public function getSolutionTitle(): string { return 'AI Generated Solution'; } public function getSolutionDescription(): string { return $this->openAiSolutionResponse->description(); } public function getDocumentationLinks(): array { return $this->openAiSolutionResponse->links(); } public function getAiSolution(): ?OpenAiSolutionResponse { $solution = $this->cache->get($this->getCacheKey()); if ($solution) { return new OpenAiSolutionResponse($solution); } $solutionText = OpenAI::client($this->openAiKey) ->chat() ->create([ 'model' => $this->getModel(), 'messages' => [['role' => 'user', 'content' => $this->prompt]], 'max_tokens' => 1000, 'temperature' => 0, ])->choices[0]->message->content; $this->cache->set($this->getCacheKey(), $solutionText, $this->cacheTtlInSeconds); return new OpenAiSolutionResponse($solutionText); } protected function getCacheKey(): string { $hash = sha1($this->prompt); return "ignition-solution-{$hash}"; } protected function generatePrompt(): string { $viewPath = Ignition::viewPath('aiPrompt'); $viewModel = new OpenAiPromptViewModel( file: $this->throwable->getFile(), exceptionMessage: $this->throwable->getMessage(), exceptionClass: get_class($this->throwable), snippet: $this->getApplicationFrame($this->throwable)->getSnippetAsString(15), line: $this->throwable->getLine(), applicationType: $this->applicationType, ); return (new Renderer())->renderAsString( ['viewModel' => $viewModel], $viewPath, ); } protected function getModel(): string { return 'gpt-3.5-turbo'; } protected function getApplicationFrame(Throwable $throwable): ?Frame { $backtrace = Backtrace::createForThrowable($throwable); if ($this->applicationPath) { $backtrace->applicationPath($this->applicationPath); } $frames = $backtrace->frames(); return $frames[$backtrace->firstApplicationFrameIndex()] ?? null; } } PKX'Z, q7ignition/src/Solutions/OpenAi/OpenAiPromptViewModel.phpnuW+Afile; } public function line(): string { return $this->line; } public function snippet(): string { return $this->snippet; } public function exceptionMessage(): string { return $this->exceptionMessage; } public function exceptionClass(): string { return $this->exceptionClass; } public function applicationType(): string|null { return $this->applicationType; } } PKX'ZK"\,ignition/src/Solutions/OpenAi/DummyCache.phpnuW+ArawText = trim($rawText); } public function description(): string { return $this->between('FIX', 'ENDFIX', $this->rawText); } public function links(): array { $textLinks = $this->between('LINKS', 'ENDLINKS', $this->rawText); $textLinks = explode(PHP_EOL, $textLinks); $textLinks = array_map(function ($textLink) { $textLink = str_replace('\\', '\\\\', $textLink); $textLink = str_replace('\\\\\\', '\\\\', $textLink); return json_decode($textLink, true); }, $textLinks); array_filter($textLinks); $links = []; foreach ($textLinks as $textLink) { $links[$textLink['title']] = $textLink['url']; } return $links; } protected function between(string $start, string $end, string $text): string { $startPosition = strpos($text, $start); if ($startPosition === false) { return ""; } $startPosition += strlen($start); $endPosition = strpos($text, $end, $startPosition); if ($endPosition === false) { return ""; } return trim(substr($text, $startPosition, $endPosition - $startPosition)); } } PKX'Z˱~~=ignition/src/Solutions/SuggestCorrectVariableNameSolution.phpnuW+AvariableName = $variableName; $this->viewFile = $viewFile; $this->suggested = $suggested; } public function getSolutionTitle(): string { return 'Possible typo $'.$this->variableName; } public function getDocumentationLinks(): array { return []; } public function getSolutionDescription(): string { return "Did you mean `$$this->suggested`?"; } public function isRunnable(): bool { return false; } } PKX'Z'ٮg g Gignition/src/Solutions/SolutionProviders/SolutionProviderRepository.phpnuW+A|HasSolutionsForThrowable> */ protected Collection $solutionProviders; /** @param array|HasSolutionsForThrowable> $solutionProviders */ public function __construct(array $solutionProviders = []) { $this->solutionProviders = Collection::make($solutionProviders); } public function registerSolutionProvider(string|HasSolutionsForThrowable $solutionProvider): SolutionProviderRepositoryContract { $this->solutionProviders->push($solutionProvider); return $this; } public function registerSolutionProviders(array $solutionProviderClasses): SolutionProviderRepositoryContract { $this->solutionProviders = $this->solutionProviders->merge($solutionProviderClasses); return $this; } public function getSolutionsForThrowable(Throwable $throwable): array { $solutions = []; if ($throwable instanceof Solution) { $solutions[] = $throwable; } if ($throwable instanceof ProvidesSolution) { $solutions[] = $throwable->getSolution(); } $providedSolutions = $this ->initialiseSolutionProviderRepositories() ->filter(function (HasSolutionsForThrowable $solutionProvider) use ($throwable) { try { return $solutionProvider->canSolve($throwable); } catch (Throwable $exception) { return false; } }) ->map(function (HasSolutionsForThrowable $solutionProvider) use ($throwable) { try { return $solutionProvider->getSolutions($throwable); } catch (Throwable $exception) { return []; } }) ->flatten() ->toArray(); return array_merge($solutions, $providedSolutions); } public function getSolutionForClass(string $solutionClass): ?Solution { if (! class_exists($solutionClass)) { return null; } if (! in_array(Solution::class, class_implements($solutionClass) ?: [])) { return null; } if (! function_exists('app')) { return null; } return app($solutionClass); } /** @return Collection */ protected function initialiseSolutionProviderRepositories(): Collection { return $this->solutionProviders ->filter(fn (HasSolutionsForThrowable|string $provider) => in_array(HasSolutionsForThrowable::class, class_implements($provider) ?: [])) ->map(function (string|HasSolutionsForThrowable $provider): HasSolutionsForThrowable { if (is_string($provider)) { return new $provider; } return $provider; }); } } PKX'ZFT388Jignition/src/Solutions/SolutionProviders/MergeConflictSolutionProvider.phpnuW+AhasMergeConflictExceptionMessage($throwable)) { return false; } $file = (string)file_get_contents($throwable->getFile()); if (! str_contains($file, '=======')) { return false; } if (! str_contains($file, '>>>>>>>')) { return false; } return true; } public function getSolutions(Throwable $throwable): array { $file = (string)file_get_contents($throwable->getFile()); preg_match('/\>\>\>\>\>\>\> (.*?)\n/', $file, $matches); $source = $matches[1]; $target = $this->getCurrentBranch(basename($throwable->getFile())); return [ BaseSolution::create("Merge conflict from branch '$source' into $target") ->setSolutionDescription('You have a Git merge conflict. To undo your merge do `git reset --hard HEAD`'), ]; } protected function getCurrentBranch(string $directory): string { $branch = "'".trim((string)shell_exec("cd {$directory}; git branch | grep \\* | cut -d ' ' -f2"))."'"; if ($branch === "''") { $branch = 'current branch'; } return $branch; } protected function hasMergeConflictExceptionMessage(Throwable $throwable): bool { // For PHP 7.x and below if (Str::startsWith($throwable->getMessage(), 'syntax error, unexpected \'<<\'')) { return true; } // For PHP 8+ if (Str::startsWith($throwable->getMessage(), 'syntax error, unexpected token "<<"')) { return true; } return false; } } PKX'Z= Nignition/src/Solutions/SolutionProviders/UndefinedPropertySolutionProvider.phpnuW+AgetClassAndPropertyFromExceptionMessage($throwable->getMessage()))) { return false; } if (! $this->similarPropertyExists($throwable)) { return false; } return true; } public function getSolutions(Throwable $throwable): array { return [ BaseSolution::create('Unknown Property') ->setSolutionDescription($this->getSolutionDescription($throwable)), ]; } public function getSolutionDescription(Throwable $throwable): string { if (! $this->canSolve($throwable) || ! $this->similarPropertyExists($throwable)) { return ''; } extract( /** @phpstan-ignore-next-line */ $this->getClassAndPropertyFromExceptionMessage($throwable->getMessage()), EXTR_OVERWRITE, ); $possibleProperty = $this->findPossibleProperty($class ?? '', $property ?? ''); $class = $class ?? ''; return "Did you mean {$class}::\${$possibleProperty->name} ?"; } protected function similarPropertyExists(Throwable $throwable): bool { /** @phpstan-ignore-next-line */ extract($this->getClassAndPropertyFromExceptionMessage($throwable->getMessage()), EXTR_OVERWRITE); $possibleProperty = $this->findPossibleProperty($class ?? '', $property ?? ''); return $possibleProperty !== null; } /** * @param string $message * * @return null|array */ protected function getClassAndPropertyFromExceptionMessage(string $message): ?array { if (! preg_match(self::REGEX, $message, $matches)) { return null; } return [ 'class' => $matches[1], 'property' => $matches[2], ]; } /** * @param class-string $class * @param string $invalidPropertyName * * @return mixed */ protected function findPossibleProperty(string $class, string $invalidPropertyName): mixed { return $this->getAvailableProperties($class) ->sortByDesc(function (ReflectionProperty $property) use ($invalidPropertyName) { similar_text($invalidPropertyName, $property->name, $percentage); return $percentage; }) ->filter(function (ReflectionProperty $property) use ($invalidPropertyName) { similar_text($invalidPropertyName, $property->name, $percentage); return $percentage >= self::MINIMUM_SIMILARITY; })->first(); } /** * @param class-string $class * * @return Collection */ protected function getAvailableProperties(string $class): Collection { $class = new ReflectionClass($class); return Collection::make($class->getProperties()); } } PKX'Z\玛 Jignition/src/Solutions/SolutionProviders/BadMethodCallSolutionProvider.phpnuW+AgetClassAndMethodFromExceptionMessage($throwable->getMessage()))) { return false; } return true; } public function getSolutions(Throwable $throwable): array { return [ BaseSolution::create('Bad Method Call') ->setSolutionDescription($this->getSolutionDescription($throwable)), ]; } public function getSolutionDescription(Throwable $throwable): string { if (! $this->canSolve($throwable)) { return ''; } /** @phpstan-ignore-next-line */ extract($this->getClassAndMethodFromExceptionMessage($throwable->getMessage()), EXTR_OVERWRITE); $possibleMethod = $this->findPossibleMethod($class ?? '', $method ?? ''); $class ??= 'UnknownClass'; return "Did you mean {$class}::{$possibleMethod?->name}() ?"; } /** * @param string $message * * @return null|array */ protected function getClassAndMethodFromExceptionMessage(string $message): ?array { if (! preg_match(self::REGEX, $message, $matches)) { return null; } return [ 'class' => $matches[1], 'method' => $matches[2], ]; } /** * @param class-string $class * @param string $invalidMethodName * * @return \ReflectionMethod|null */ protected function findPossibleMethod(string $class, string $invalidMethodName): ?ReflectionMethod { return $this->getAvailableMethods($class) ->sortByDesc(function (ReflectionMethod $method) use ($invalidMethodName) { similar_text($invalidMethodName, $method->name, $percentage); return $percentage; })->first(); } /** * @param class-string $class * * @return \Illuminate\Support\Collection */ protected function getAvailableMethods(string $class): Collection { $class = new ReflectionClass($class); return Collection::make($class->getMethods()); } } PKX'ZT``0ignition/src/Solutions/SuggestImportSolution.phpnuW+Aclass = $class; } public function getSolutionTitle(): string { return 'A class import is missing'; } public function getSolutionDescription(): string { return 'You have a missing class import. Try importing this class: `'.$this->class.'`.'; } public function getDocumentationLinks(): array { return []; } } PKX'Z xx.ignition/src/Solutions/SolutionTransformer.phpnuW+A|string|false> */ class SolutionTransformer implements Arrayable { protected Solution $solution; public function __construct(Solution $solution) { $this->solution = $solution; } /** @return array|string|false> */ public function toArray(): array { return [ 'class' => get_class($this->solution), 'title' => $this->solution->getSolutionTitle(), 'links' => $this->solution->getDocumentationLinks(), 'description' => $this->solution->getSolutionDescription(), 'is_runnable' => false, 'ai_generated' => $this->solution->aiGenerated ?? false, ]; } } PKX'ZO )ignition/src/Config/FileConfigManager.phpnuW+Apath = $this->initPath($path); $this->file = $this->initFile(); } protected function initPath(string $path): string { $path = $this->retrievePath($path); if (! $this->isValidWritablePath($path)) { return ''; } return $this->preparePath($path); } protected function retrievePath(string $path): string { if ($path !== '') { return $path; } return $this->initPathFromEnvironment(); } protected function isValidWritablePath(string $path): bool { return @file_exists($path) && @is_writable($path); } protected function preparePath(string $path): string { return rtrim($path, DIRECTORY_SEPARATOR); } protected function initPathFromEnvironment(): string { if (! empty($_SERVER['HOMEDRIVE']) && ! empty($_SERVER['HOMEPATH'])) { return $_SERVER['HOMEDRIVE'] . $_SERVER['HOMEPATH']; } if (! empty(getenv('HOME'))) { return getenv('HOME'); } return ''; } protected function initFile(): string { return $this->path . DIRECTORY_SEPARATOR . self::SETTINGS_FILE_NAME; } /** {@inheritDoc} */ public function load(): array { return $this->readFromFile(); } /** @return array */ protected function readFromFile(): array { if (! $this->isValidFile()) { return []; } $content = (string)file_get_contents($this->file); $settings = json_decode($content, true) ?? []; return $settings; } protected function isValidFile(): bool { return $this->isValidPath() && @file_exists($this->file) && @is_writable($this->file); } protected function isValidPath(): bool { return trim($this->path) !== ''; } /** {@inheritDoc} */ public function save(array $options): bool { if (! $this->createFile()) { return false; } return $this->saveToFile($options); } protected function createFile(): bool { if (! $this->isValidPath()) { return false; } if (@file_exists($this->file)) { return true; } return (file_put_contents($this->file, '') !== false); } /** * @param array $options * * @return bool */ protected function saveToFile(array $options): bool { try { $content = json_encode($options, JSON_THROW_ON_ERROR); } catch (Throwable) { return false; } return $this->writeToFile($content); } protected function writeToFile(string $content): bool { if (! $this->isValidFile()) { return false; } return (file_put_contents($this->file, $content) !== false); } /** {@inheritDoc} */ public function getPersistentInfo(): array { return [ 'name' => self::SETTINGS_FILE_NAME, 'path' => $this->path, 'file' => $this->file, ]; } } PKX'ZT1f^^&ignition/src/Config/IgnitionConfig.phpnuW+A> */ class IgnitionConfig implements Arrayable { private ConfigManager $manager; public static function loadFromConfigFile(): self { return (new self())->loadConfigFile(); } /** * @param array $options */ public function __construct(protected array $options = []) { $defaultOptions = $this->getDefaultOptions(); $this->options = array_merge($defaultOptions, $options); $this->manager = $this->initConfigManager(); } public function setOption(string $name, string $value): self { $this->options[$name] = $value; return $this; } private function initConfigManager(): ConfigManager { try { /** @phpstan-ignore-next-line */ return app(ConfigManager::class); } catch (Throwable) { return new FileConfigManager(); } } /** @param array $options */ public function merge(array $options): self { $this->options = array_merge($this->options, $options); return $this; } public function loadConfigFile(): self { $this->merge($this->getConfigOptions()); return $this; } /** @return array */ public function getConfigOptions(): array { return $this->manager->load(); } /** * @param array $options * @return bool */ public function saveValues(array $options): bool { return $this->manager->save($options); } public function hideSolutions(): bool { return $this->options['hide_solutions'] ?? false; } public function editor(): ?string { return $this->options['editor'] ?? null; } /** * @return array $options */ public function editorOptions(): array { return $this->options['editor_options'] ?? []; } public function remoteSitesPath(): ?string { return $this->options['remote_sites_path'] ?? null; } public function localSitesPath(): ?string { return $this->options['local_sites_path'] ?? null; } public function theme(): ?string { return $this->options['theme'] ?? null; } public function shareButtonEnabled(): bool { return (bool)($this->options['enable_share_button'] ?? false); } public function shareEndpoint(): string { return $this->options['share_endpoint'] ?? $this->getDefaultOptions()['share_endpoint']; } public function runnableSolutionsEnabled(): bool { return (bool)($this->options['enable_runnable_solutions'] ?? false); } /** @return array> */ public function toArray(): array { return [ 'editor' => $this->editor(), 'theme' => $this->theme(), 'hideSolutions' => $this->hideSolutions(), 'remoteSitesPath' => $this->remoteSitesPath(), 'localSitesPath' => $this->localSitesPath(), 'enableShareButton' => $this->shareButtonEnabled(), 'enableRunnableSolutions' => $this->runnableSolutionsEnabled(), 'directorySeparator' => DIRECTORY_SEPARATOR, 'editorOptions' => $this->editorOptions(), 'shareEndpoint' => $this->shareEndpoint(), ]; } /** * @return array $options */ protected function getDefaultOptions(): array { return [ 'share_endpoint' => 'https://flareapp.io/api/public-reports', 'theme' => 'light', 'editor' => 'vscode', 'editor_options' => [ 'clipboard' => [ 'label' => 'Clipboard', 'url' => '%path:%line', 'clipboard' => true, ], 'sublime' => [ 'label' => 'Sublime', 'url' => 'subl://open?url=file://%path&line=%line', ], 'textmate' => [ 'label' => 'TextMate', 'url' => 'txmt://open?url=file://%path&line=%line', ], 'emacs' => [ 'label' => 'Emacs', 'url' => 'emacs://open?url=file://%path&line=%line', ], 'macvim' => [ 'label' => 'MacVim', 'url' => 'mvim://open/?url=file://%path&line=%line', ], 'phpstorm' => [ 'label' => 'PhpStorm', 'url' => 'phpstorm://open?file=%path&line=%line', ], 'phpstorm-remote' => [ 'label' => 'PHPStorm Remote', 'url' => 'javascript:r = new XMLHttpRequest;r.open("get", "http://localhost:63342/api/file/%path:%line");r.send()', ], 'idea' => [ 'label' => 'Idea', 'url' => 'idea://open?file=%path&line=%line', ], 'vscode' => [ 'label' => 'VS Code', 'url' => 'vscode://file/%path:%line', ], 'vscode-insiders' => [ 'label' => 'VS Code Insiders', 'url' => 'vscode-insiders://file/%path:%line', ], 'vscode-remote' => [ 'label' => 'VS Code Remote', 'url' => 'vscode://vscode-remote/%path:%line', ], 'vscode-insiders-remote' => [ 'label' => 'VS Code Insiders Remote', 'url' => 'vscode-insiders://vscode-remote/%path:%line', ], 'vscodium' => [ 'label' => 'VS Codium', 'url' => 'vscodium://file/%path:%line', ], 'cursor' => [ 'label' => 'Cursor', 'url' => 'cursor://file/%path:%line', ], 'atom' => [ 'label' => 'Atom', 'url' => 'atom://core/open/file?filename=%path&line=%line', ], 'nova' => [ 'label' => 'Nova', 'url' => 'nova://open?path=%path&line=%line', ], 'netbeans' => [ 'label' => 'NetBeans', 'url' => 'netbeans://open/?f=%path:%line', ], 'xdebug' => [ 'label' => 'Xdebug', 'url' => 'xdebug://%path@%line', ], ], ]; } } PKX'Z2J99ignition/README.mdnuW+A# Ignition: a beautiful error page for PHP apps [![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/ignition.svg?style=flat-square)](https://packagist.org/packages/spatie/ignition) [![Run tests](https://github.com/spatie/ignition/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/ignition/actions/workflows/run-tests.yml) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/ignition.svg?style=flat-square)](https://packagist.org/packages/spatie/ignition) [Ignition](https://flareapp.io/docs/ignition-for-laravel/introduction) is a beautiful and customizable error page for PHP applications Here's a minimal example on how to register ignition. ```php use Spatie\Ignition\Ignition; include 'vendor/autoload.php'; Ignition::make()->register(); ``` Let's now throw an exception during a web request. ```php throw new Exception('Bye world'); ``` This is what you'll see in the browser. ![Screenshot of ignition](https://spatie.github.io/ignition/ignition.png) There's also a beautiful dark mode. ![Screenshot of ignition in dark mode](https://spatie.github.io/ignition/ignition-dark.png) ## Are you a visual learner? In [this video on YouTube](https://youtu.be/LEY0N0Bteew?t=739), you'll see a demo of all of the features. Do know more about the design decisions we made, read [this blog post](https://freek.dev/2168-ignition-the-most-beautiful-error-page-for-laravel-and-php-got-a-major-redesign). ## Support us [](https://spatie.be/github-ad-click/ignition) We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards). ## Installation For Laravel apps, head over to [laravel-ignition](https://github.com/spatie/laravel-ignition). For Symfony apps, go to [symfony-ignition-bundle](https://github.com/spatie/symfony-ignition-bundle). For Drupal 10+ websites, use the [Ignition module](https://www.drupal.org/project/ignition). For OpenMage websites, use the [Ignition module](https://github.com/empiricompany/openmage_ignition). For all other PHP projects, install the package via composer: ```bash composer require spatie/ignition ``` ## Usage In order to display the Ignition error page when an error occurs in your project, you must add this code. Typically, this would be done in the bootstrap part of your application. ```php \Spatie\Ignition\Ignition::make()->register(); ``` ### Setting the application path When setting the application path, Ignition will trim the given value from all paths. This will make the error page look more cleaner. ```php \Spatie\Ignition\Ignition::make() ->applicationPath($basePathOfYourApplication) ->register(); ``` ### Using dark mode By default, Ignition uses a nice white based theme. If this is too bright for your eyes, you can use dark mode. ```php \Spatie\Ignition\Ignition::make() ->useDarkMode() ->register(); ``` ### Avoid rendering Ignition in a production environment You don't want to render the Ignition error page in a production environment, as it potentially can display sensitive information. To avoid rendering Ignition, you can call `shouldDisplayException` and pass it a falsy value. ```php \Spatie\Ignition\Ignition::make() ->shouldDisplayException($inLocalEnvironment) ->register(); ``` ### Displaying solutions In addition to displaying an exception, Ignition can display a solution as well. Out of the box, Ignition will display solutions for common errors such as bad methods calls, or using undefined properties. #### Adding a solution directly to an exception To add a solution text to your exception, let the exception implement the `Spatie\Ignition\Contracts\ProvidesSolution` interface. This interface requires you to implement one method, which is going to return the `Solution` that users will see when the exception gets thrown. ```php use Spatie\Ignition\Contracts\Solution; use Spatie\Ignition\Contracts\ProvidesSolution; class CustomException extends Exception implements ProvidesSolution { public function getSolution(): Solution { return new CustomSolution(); } } ``` ```php use Spatie\Ignition\Contracts\Solution; class CustomSolution implements Solution { public function getSolutionTitle(): string { return 'The solution title goes here'; } public function getSolutionDescription(): string { return 'This is a longer description of the solution that you want to show.'; } public function getDocumentationLinks(): array { return [ 'Your documentation' => 'https://your-project.com/relevant-docs-page', ]; } } ``` This is how the exception would be displayed if you were to throw it. ![Screenshot of solution](https://spatie.github.io/ignition/solution.png) #### Using solution providers Instead of adding solutions to exceptions directly, you can also create a solution provider. While exceptions that return a solution, provide the solution directly to Ignition, a solution provider allows you to figure out if an exception can be solved. For example, you could create a custom "Stack Overflow solution provider", that will look up if a solution can be found for a given throwable. Solution providers can be added by third party packages or within your own application. A solution provider is any class that implements the \Spatie\Ignition\Contracts\HasSolutionsForThrowable interface. This is how the interface looks like: ```php interface HasSolutionsForThrowable { public function canSolve(Throwable $throwable): bool; /** @return \Spatie\Ignition\Contracts\Solution[] */ public function getSolutions(Throwable $throwable): array; } ``` When an error occurs in your app, the class will receive the `Throwable` in the `canSolve` method. In that method you can decide if your solution provider is applicable to the `Throwable` passed. If you return `true`, `getSolutions` will get called. To register a solution provider to Ignition you must call the `addSolutionProviders` method. ```php \Spatie\Ignition\Ignition::make() ->addSolutionProviders([ YourSolutionProvider::class, AnotherSolutionProvider::class, ]) ->register(); ``` ### AI powered solutions Ignition can send your exception to Open AI that will attempt to automatically suggest a solution. In many cases, the suggested solutions is quite useful, but keep in mind that the solution may not be 100% correct for your context. To generate AI powered solutions, you must first install this optional dependency. ```bash composer require openai-php/client ``` To start sending your errors to OpenAI, you must instanciate the `OpenAiSolutionProvider`. The constructor expects a OpenAI API key to be passed, you should generate this key [at OpenAI](https://platform.openai.com). ```php use \Spatie\Ignition\Solutions\OpenAi\OpenAiSolutionProvider; $aiSolutionProvider = new OpenAiSolutionProvider($openAiKey); ``` To use the solution provider, you should pass it to `addSolutionProviders` when registering Ignition. ```php \Spatie\Ignition\Ignition::make() ->addSolutionProviders([ $aiSolutionProvider, // other solution providers... ]) ->register(); ``` By default, the solution provider will send these bits of info to Open AI: - the error message - the error class - the stack frame - other small bits of info of context surrounding your error It will not send the request payload or any environment variables to avoid sending sensitive data to OpenAI. #### Caching requests to AI By default, all errors will be sent to OpenAI. Optionally, you can add caching so similar errors will only get sent to OpenAI once. To cache errors, you can call `useCache` on `$aiSolutionProvider`. You should pass [a simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation). Here's the signature of the `useCache` method. ```php public function useCache(CacheInterface $cache, int $cacheTtlInSeconds = 60 * 60) ``` #### Hinting the application type To increase the quality of the suggested solutions, you can send along the application type (Symfony, Drupal, WordPress, ...) to the AI. To send the application type call `applicationType` on the solution provider. ```php $aiSolutionProvider->applicationType('WordPress 6.2') ``` ### Sending exceptions to Flare Ignition comes with the ability to send exceptions to [Flare](https://flareapp.io), an exception monitoring service. Flare can notify you when new exceptions are occurring in your production environment. To send exceptions to Flare, simply call the `sendToFlareMethod` and pass it the API key you got when creating a project on Flare. You probably want to combine this with calling `runningInProductionEnvironment`. That method will, when passed a truthy value, not display the Ignition error page, but only send the exception to Flare. ```php \Spatie\Ignition\Ignition::make() ->runningInProductionEnvironment($boolean) ->sendToFlare($yourApiKey) ->register(); ``` When you pass a falsy value to `runningInProductionEnvironment`, the Ignition error page will get shown, but no exceptions will be sent to Flare. ### Sending custom context to Flare When you send an error to Flare, you can add custom information that will be sent along with every exception that happens in your application. This can be very useful if you want to provide key-value related information that furthermore helps you to debug a possible exception. ```php use Spatie\FlareClient\Flare; \Spatie\Ignition\Ignition::make() ->runningInProductionEnvironment($boolean) ->sendToFlare($yourApiKey) ->configureFlare(function(Flare $flare) { $flare->context('Tenant', 'My-Tenant-Identifier'); }) ->register(); ``` Sometimes you may want to group your context items by a key that you provide to have an easier visual differentiation when you look at your custom context items. The Flare client allows you to also provide your own custom context groups like this: ```php use Spatie\FlareClient\Flare; \Spatie\Ignition\Ignition::make() ->runningInProductionEnvironment($boolean) ->sendToFlare($yourApiKey) ->configureFlare(function(Flare $flare) { $flare->group('Custom information', [ 'key' => 'value', 'another key' => 'another value', ]); }) ->register(); ``` ### Anonymize request to Flare By default, the Ignition collects information about the IP address of your application users. If you don't want to send this information to Flare, call `anonymizeIp()`. ```php use Spatie\FlareClient\Flare; \Spatie\Ignition\Ignition::make() ->runningInProductionEnvironment($boolean) ->sendToFlare($yourApiKey) ->configureFlare(function(Flare $flare) { $flare->anonymizeIp(); }) ->register(); ``` ### Censoring request body fields When an exception occurs in a web request, the Flare client will pass on any request fields that are present in the body. In some cases, such as a login page, these request fields may contain a password that you don't want to send to Flare. To censor out values of certain fields, you can use `censorRequestBodyFields`. You should pass it the names of the fields you wish to censor. ```php use Spatie\FlareClient\Flare; \Spatie\Ignition\Ignition::make() ->runningInProductionEnvironment($boolean) ->sendToFlare($yourApiKey) ->configureFlare(function(Flare $flare) { $flare->censorRequestBodyFields(['password']); }) ->register(); ``` This will replace the value of any sent fields named "password" with the value "". ### Using middleware to modify data sent to Flare Before Flare receives the data that was collected from your local exception, we give you the ability to call custom middleware methods. These methods retrieve the report that should be sent to Flare and allow you to add custom information to that report. A valid middleware is any class that implements `FlareMiddleware`. ```php use Spatie\FlareClient\Report; use Spatie\FlareClient\FlareMiddleware\FlareMiddleware; class MyMiddleware implements FlareMiddleware { public function handle(Report $report, Closure $next) { $report->message("{$report->getMessage()}, now modified"); return $next($report); } } ``` ```php use Spatie\FlareClient\Flare; \Spatie\Ignition\Ignition::make() ->runningInProductionEnvironment($boolean) ->sendToFlare($yourApiKey) ->configureFlare(function(Flare $flare) { $flare->registerMiddleware([ MyMiddleware::class, ]) }) ->register(); ``` ### Changelog Please see [CHANGELOG](CHANGELOG.md) for more information about what has changed recently. ## Contributing Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details. ## Dev setup Here are the steps you'll need to perform if you want to work on the UI of Ignition. - clone (or move) `spatie/ignition`, `spatie/ignition-ui`, `spatie/laravel-ignition`, `spatie/flare-client-php` and `spatie/ignition-test` into the same directory (e.g. `~/code/flare`) - create a new `package.json` file in `~/code/flare` directory: ```json { "private": true, "workspaces": [ "ignition-ui", "ignition" ] } ``` - run `yarn install` in the `~/code/flare` directory - in the `~/code/flare/ignition-test` directory - run `composer update` - run `cp .env.example .env` - run `php artisan key:generate` - run `yarn dev` in both the `ignition` and `ignition-ui` project - http://ignition-test.test/ should now work (= show the new UI). If you use valet, you might want to run `valet park` inside the `~/code/flare` directory. - http://ignition-test.test/ has a bit of everything - http://ignition-test.test/sql-error has a solution and SQL exception ## Security Vulnerabilities Please review [our security policy](../../security/policy) on how to report security vulnerabilities. ## Credits - [Spatie](https://spatie.be) - [All Contributors](../../contributors) ## License The MIT License (MIT). Please see [License File](LICENSE.md) for more information. PKX'Zx7 ignition/composer.jsonnuW+A{ "name" : "spatie/ignition", "description" : "A beautiful error page for PHP applications.", "keywords" : [ "error", "page", "laravel", "flare" ], "authors" : [ { "name" : "Spatie", "email" : "info@spatie.be", "role" : "Developer" } ], "homepage": "https://flareapp.io/ignition", "license": "MIT", "require": { "php": "^8.0", "ext-json": "*", "ext-mbstring": "*", "spatie/backtrace": "^1.5.3", "spatie/flare-client-php": "^1.4.0", "symfony/console": "^5.4|^6.0|^7.0", "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "require-dev" : { "illuminate/cache" : "^9.52|^10.0|^11.0", "mockery/mockery" : "^1.4", "pestphp/pest" : "^1.20|^2.0", "phpstan/extension-installer" : "^1.1", "phpstan/phpstan-deprecation-rules" : "^1.0", "phpstan/phpstan-phpunit" : "^1.0", "psr/simple-cache-implementation" : "*", "symfony/cache" : "^5.4|^6.0|^7.0", "symfony/process" : "^5.4|^6.0|^7.0", "vlucas/phpdotenv" : "^5.5" }, "suggest" : { "openai-php/client" : "Require get solutions from OpenAI", "simple-cache-implementation" : "To cache solutions from OpenAI" }, "config" : { "sort-packages" : true, "allow-plugins" : { "phpstan/extension-installer": true, "pestphp/pest-plugin": true, "php-http/discovery": false } }, "autoload" : { "psr-4" : { "Spatie\\Ignition\\" : "src" } }, "autoload-dev" : { "psr-4" : { "Spatie\\Ignition\\Tests\\" : "tests" } }, "minimum-stability" : "dev", "prefer-stable" : true, "scripts" : { "analyse" : "vendor/bin/phpstan analyse", "baseline" : "vendor/bin/phpstan analyse --generate-baseline", "format" : "vendor/bin/php-cs-fixer fix --allow-risky=yes", "test" : "vendor/bin/pest", "test-coverage" : "vendor/bin/phpunit --coverage-html coverage" }, "support" : { "issues" : "https://github.com/spatie/ignition/issues", "forum" : "https://twitter.com/flareappio", "source" : "https://github.com/spatie/ignition", "docs" : "https://flareapp.io/docs/ignition-for-laravel/introduction" }, "extra" : { "branch-alias" : { "dev-main" : "1.5.x-dev" } } } PKX'Z* ;RR&ignition/resources/views/errorPage.phpnuW+A <?= $viewModel->title() ?> customHtmlHead() ?>
customHtmlBody() ?> PKX'Z.\%ignition/resources/views/aiPrompt.phpnuW+A You are a very skilled PHP programmer. applicationType()) { ?> You are working on a applicationType() ?> application. Use the following context to find a possible fix for the exception message at the end. Limit your answer to 4 or 5 sentences. Also include a few links to documentation that might help. Use this format in your answer, make sure links are json: FIX insert the possible fix here ENDFIX LINKS {"title": "Title link 1", "url": "URL link 1"} {"title": "Title link 2", "url": "URL link 2"} ENDLINKS --- Here comes the context and the exception message: Line: line() ?> File: file() ?> Snippet including line numbers: snippet() ?> Exception class: exceptionClass() ?> Exception message: exceptionMessage() ?> PKX'ZnI))&ignition/resources/compiled/.gitignorenuW+A* !.gitignore !ignition.css !ignition.js PKX'Z˯(ignition/resources/compiled/ignition.cssnuW+A/* ! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com */*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,Helvetica Neue,Arial,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent}html{font-size:max(13px,min(1.3vw,16px));overflow-x:hidden;overflow-y:scroll;font-feature-settings:"calt" 0;-webkit-marquee-increment:1vw}:after,:before,:not(iframe){position:relative}:focus{outline:0!important}body{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,Helvetica Neue,Arial,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;width:100%;color:rgba(31,41,55,var(--tw-text-opacity))}.dark body,body{--tw-text-opacity:1}.dark body{color:rgba(229,231,235,var(--tw-text-opacity))}body{background-color:rgba(229,231,235,var(--tw-bg-opacity))}.dark body,body{--tw-bg-opacity:1}.dark body{background-color:rgba(17,24,39,var(--tw-bg-opacity))}@media (color-index:48){html.auto body{--tw-text-opacity:1;color:rgba(229,231,235,var(--tw-text-opacity));--tw-bg-opacity:1;background-color:rgba(17,24,39,var(--tw-bg-opacity))}}@media (color:48842621){html.auto body{--tw-text-opacity:1;color:rgba(229,231,235,var(--tw-text-opacity));--tw-bg-opacity:1;background-color:rgba(17,24,39,var(--tw-bg-opacity))}}@media (prefers-color-scheme:dark){html.auto body{--tw-text-opacity:1;color:rgba(229,231,235,var(--tw-text-opacity));--tw-bg-opacity:1;background-color:rgba(17,24,39,var(--tw-bg-opacity))}}.scroll-target:target{content:"";display:block;position:absolute;top:-6rem}pre.sf-dump{display:block;white-space:pre;padding:5px;overflow:visible!important;overflow:initial!important}pre.sf-dump:after{content:"";visibility:hidden;display:block;height:0;clear:both}pre.sf-dump span{display:inline}pre.sf-dump a{text-decoration:none;cursor:pointer;border:0;outline:none;color:inherit}pre.sf-dump img{max-width:50em;max-height:50em;margin:.5em 0 0;padding:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAHUlEQVQY02O8zAABilCaiQEN0EeA8QuUcX9g3QEAAjcC5piyhyEAAAAASUVORK5CYII=) #d3d3d3}pre.sf-dump .sf-dump-ellipsis{display:inline-block;overflow:visible;text-overflow:ellipsis;max-width:5em;white-space:nowrap;overflow:hidden;vertical-align:top}pre.sf-dump .sf-dump-ellipsis+.sf-dump-ellipsis{max-width:none}pre.sf-dump code{display:inline;padding:0;background:none}.sf-dump-key.sf-dump-highlight,.sf-dump-private.sf-dump-highlight,.sf-dump-protected.sf-dump-highlight,.sf-dump-public.sf-dump-highlight,.sf-dump-str.sf-dump-highlight{background:rgba(111,172,204,.3);border:1px solid #7da0b1;border-radius:3px}.sf-dump-key.sf-dump-highlight-active,.sf-dump-private.sf-dump-highlight-active,.sf-dump-protected.sf-dump-highlight-active,.sf-dump-public.sf-dump-highlight-active,.sf-dump-str.sf-dump-highlight-active{background:rgba(253,175,0,.4);border:1px solid orange;border-radius:3px}pre.sf-dump .sf-dump-search-hidden{display:none!important}pre.sf-dump .sf-dump-search-wrapper{font-size:0;white-space:nowrap;margin-bottom:5px;display:flex;position:-webkit-sticky;position:sticky;top:5px}pre.sf-dump .sf-dump-search-wrapper>*{vertical-align:top;box-sizing:border-box;height:21px;font-weight:400;border-radius:0;background:#fff;color:#757575;border:1px solid #bbb}pre.sf-dump .sf-dump-search-wrapper>input.sf-dump-search-input{padding:3px;height:21px;font-size:12px;border-right:none;border-top-left-radius:3px;border-bottom-left-radius:3px;color:#000;min-width:15px;width:100%}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-next,pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-previous{background:#f2f2f2;outline:none;border-left:none;font-size:0;line-height:0}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-next{border-top-right-radius:3px;border-bottom-right-radius:3px}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-next>svg,pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-previous>svg{pointer-events:none;width:12px;height:12px}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-count{display:inline-block;padding:0 5px;margin:0;border-left:none;line-height:21px;font-size:12px}.hljs-comment,.hljs-quote{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.dark .hljs-comment,.dark .hljs-quote{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}.hljs-comment.hljs-doctag{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.dark .hljs-comment.hljs-doctag{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.hljs-doctag,.hljs-formula,.hljs-keyword,.hljs-name{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.dark .hljs-doctag,.dark .hljs-formula,.dark .hljs-keyword,.dark .hljs-name{--tw-text-opacity:1;color:rgba(248,113,113,var(--tw-text-opacity))}.hljs-attr,.hljs-deletion,.hljs-function.hljs-keyword,.hljs-literal,.hljs-section,.hljs-selector-tag{--tw-text-opacity:1;color:rgba(139,92,246,var(--tw-text-opacity))}.hljs-addition,.hljs-attribute,.hljs-meta-string,.hljs-regexp,.hljs-string{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.dark .hljs-addition,.dark .hljs-attribute,.dark .hljs-meta-string,.dark .hljs-regexp,.dark .hljs-string{--tw-text-opacity:1;color:rgba(96,165,250,var(--tw-text-opacity))}.hljs-built_in,.hljs-class .hljs-title,.hljs-template-tag,.hljs-template-variable{--tw-text-opacity:1;color:rgba(249,115,22,var(--tw-text-opacity))}.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-string.hljs-subst,.hljs-type{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.dark .hljs-number,.dark .hljs-selector-attr,.dark .hljs-selector-class,.dark .hljs-selector-pseudo,.dark .hljs-string.hljs-subst,.dark .hljs-type{--tw-text-opacity:1;color:rgba(52,211,153,var(--tw-text-opacity))}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-operator,.hljs-selector-id,.hljs-symbol,.hljs-title,.hljs-variable{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.dark .hljs-bullet,.dark .hljs-link,.dark .hljs-meta,.dark .hljs-operator,.dark .hljs-selector-id,.dark .hljs-symbol,.dark .hljs-title,.dark .hljs-variable{--tw-text-opacity:1;color:rgba(129,140,248,var(--tw-text-opacity))}.hljs-strong,.hljs-title{font-weight:700}.hljs-emphasis{font-style:italic}.hljs-link{-webkit-text-decoration-line:underline;text-decoration-line:underline}.language-sql .hljs-keyword{text-transform:uppercase}.mask-fade-x{-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 1rem,#000 calc(100% - 3rem),transparent calc(100% - 1rem))}.mask-fade-r{-webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 3rem),transparent calc(100% - 1rem))}.mask-fade-y{-webkit-mask-image:linear-gradient(180deg,#000 calc(100% - 2.5rem),transparent)}.mask-fade-frames{-webkit-mask-image:linear-gradient(180deg,#000 calc(100% - 4rem),transparent)}.scrollbar::-webkit-scrollbar,.scrollbar::-webkit-scrollbar-corner{width:2px;height:2px}.scrollbar::-webkit-scrollbar-track{background-color:transparent}.scrollbar::-webkit-scrollbar-thumb{background-color:rgba(239,68,68,.9)}.scrollbar-lg::-webkit-scrollbar,.scrollbar-lg::-webkit-scrollbar-corner{width:4px;height:4px}.scrollbar-lg::-webkit-scrollbar-track{background-color:transparent}.scrollbar-lg::-webkit-scrollbar-thumb{background-color:rgba(239,68,68,.9)}.scrollbar-hidden-x{-ms-overflow-style:none;scrollbar-width:none;overflow-x:scroll}.scrollbar-hidden-x::-webkit-scrollbar{display:none}.scrollbar-hidden-y{-ms-overflow-style:none;scrollbar-width:none;overflow-y:scroll}.scrollbar-hidden-y::-webkit-scrollbar{display:none}main pre.sf-dump{display:block!important;z-index:0!important;padding:0!important;font-size:.875rem!important;line-height:1.25rem!important}.sf-dump-key.sf-dump-highlight,.sf-dump-private.sf-dump-highlight,.sf-dump-protected.sf-dump-highlight,.sf-dump-public.sf-dump-highlight,.sf-dump-str.sf-dump-highlight{background-color:rgba(139,92,246,.1)!important}.sf-dump-key.sf-dump-highlight-active,.sf-dump-private.sf-dump-highlight-active,.sf-dump-protected.sf-dump-highlight-active,.sf-dump-public.sf-dump-highlight-active,.sf-dump-str.sf-dump-highlight-active{background-color:rgba(245,158,11,.1)!important}pre.sf-dump .sf-dump-search-wrapper{align-items:center}pre.sf-dump .sf-dump-search-wrapper>*{border-width:0!important}pre.sf-dump .sf-dump-search-wrapper>input.sf-dump-search-input{font-size:.75rem!important;line-height:1rem!important;--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.dark pre.sf-dump .sf-dump-search-wrapper>input.sf-dump-search-input{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}pre.sf-dump .sf-dump-search-wrapper>input.sf-dump-search-input{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-search-wrapper>input.sf-dump-search-input{--tw-text-opacity:1;color:rgba(229,231,235,var(--tw-text-opacity))}pre.sf-dump .sf-dump-search-wrapper>input.sf-dump-search-input{height:2rem!important;padding-left:.5rem!important;padding-right:.5rem!important}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-next,pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-previous{background-color:transparent!important;--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-next,.dark pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-previous{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-next:hover,pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-previous:hover{--tw-text-opacity:1!important;color:rgba(99,102,241,var(--tw-text-opacity))!important}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-next,pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-input-previous{padding-left:.25rem;padding-right:.25rem}pre.sf-dump .sf-dump-search-wrapper svg path{fill:currentColor}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-count{font-size:.75rem!important;line-height:1rem!important;line-height:1.5!important;padding-left:1rem!important;padding-right:1rem!important;--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-count{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}pre.sf-dump .sf-dump-search-wrapper>.sf-dump-search-count{background-color:transparent!important}pre.sf-dump,pre.sf-dump .sf-dump-default{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace!important;background-color:transparent!important;--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.dark pre.sf-dump,.dark pre.sf-dump .sf-dump-default{--tw-text-opacity:1;color:rgba(229,231,235,var(--tw-text-opacity))}pre.sf-dump .sf-dump-num{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-num{--tw-text-opacity:1;color:rgba(52,211,153,var(--tw-text-opacity))}pre.sf-dump .sf-dump-const{font-weight:400!important;--tw-text-opacity:1!important;color:rgba(139,92,246,var(--tw-text-opacity))!important}pre.sf-dump .sf-dump-str{font-weight:400!important;--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-str{--tw-text-opacity:1;color:rgba(96,165,250,var(--tw-text-opacity))}pre.sf-dump .sf-dump-note{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-note{--tw-text-opacity:1;color:rgba(129,140,248,var(--tw-text-opacity))}pre.sf-dump .sf-dump-ref{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-ref{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}pre.sf-dump .sf-dump-private,pre.sf-dump .sf-dump-protected,pre.sf-dump .sf-dump-public{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-private,.dark pre.sf-dump .sf-dump-protected,.dark pre.sf-dump .sf-dump-public{--tw-text-opacity:1;color:rgba(248,113,113,var(--tw-text-opacity))}pre.sf-dump .sf-dump-meta{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-meta{--tw-text-opacity:1;color:rgba(129,140,248,var(--tw-text-opacity))}pre.sf-dump .sf-dump-key{--tw-text-opacity:1;color:rgba(124,58,237,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-key{--tw-text-opacity:1;color:rgba(167,139,250,var(--tw-text-opacity))}pre.sf-dump .sf-dump-index{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-index{--tw-text-opacity:1;color:rgba(52,211,153,var(--tw-text-opacity))}pre.sf-dump .sf-dump-ellipsis{--tw-text-opacity:1;color:rgba(124,58,237,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-ellipsis{--tw-text-opacity:1;color:rgba(167,139,250,var(--tw-text-opacity))}pre.sf-dump .sf-dump-toggle{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.dark pre.sf-dump .sf-dump-toggle{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}pre.sf-dump .sf-dump-toggle:hover{--tw-text-opacity:1!important;color:rgba(99,102,241,var(--tw-text-opacity))!important}pre.sf-dump .sf-dump-toggle span{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:1rem!important;height:1rem!important;font-size:9px;background-color:rgba(107,114,128,.05)}.dark pre.sf-dump .sf-dump-toggle span{background-color:rgba(0,0,0,.1)}pre.sf-dump .sf-dump-toggle span:hover{--tw-bg-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important}.dark pre.sf-dump .sf-dump-toggle span:hover{--tw-bg-opacity:1!important;background-color:rgba(17,24,39,var(--tw-bg-opacity))!important}pre.sf-dump .sf-dump-toggle span{border-radius:9999px;--tw-shadow:0 1px 2px 0 rgba(0,0,0,0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}pre.sf-dump .sf-dump-toggle span,pre.sf-dump .sf-dump-toggle span:hover{box-shadow:0 0 transparent,0 0 transparent,var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}pre.sf-dump .sf-dump-toggle span:hover{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px -1px rgba(0,0,0,0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);--tw-text-opacity:1!important;color:rgba(99,102,241,var(--tw-text-opacity))!important}pre.sf-dump .sf-dump-toggle span{top:-2px}pre.sf-dump .sf-dump-toggle:hover span{--tw-bg-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important}.dark pre.sf-dump .sf-dump-toggle:hover span{--tw-bg-opacity:1!important;background-color:rgba(17,24,39,var(--tw-bg-opacity))!important}.\~text-gray-500{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.dark .\~text-gray-500{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}.\~text-violet-500{--tw-text-opacity:1;color:rgba(139,92,246,var(--tw-text-opacity))}.dark .\~text-violet-500{--tw-text-opacity:1;color:rgba(167,139,250,var(--tw-text-opacity))}.\~text-gray-600{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.dark .\~text-gray-600{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.\~text-indigo-600{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.dark .\~text-indigo-600{--tw-text-opacity:1;color:rgba(129,140,248,var(--tw-text-opacity))}.hover\:\~text-indigo-600:hover{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}:is(.dark .hover\:\~text-indigo-600):hover{--tw-text-opacity:1;color:rgba(129,140,248,var(--tw-text-opacity))}.\~text-blue-600{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.dark .\~text-blue-600{--tw-text-opacity:1;color:rgba(96,165,250,var(--tw-text-opacity))}.\~text-violet-600{--tw-text-opacity:1;color:rgba(124,58,237,var(--tw-text-opacity))}.dark .\~text-violet-600{--tw-text-opacity:1;color:rgba(167,139,250,var(--tw-text-opacity))}.hover\:\~text-violet-600:hover{--tw-text-opacity:1;color:rgba(124,58,237,var(--tw-text-opacity))}:is(.dark .hover\:\~text-violet-600):hover{--tw-text-opacity:1;color:rgba(196,181,253,var(--tw-text-opacity))}.\~text-emerald-600{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.dark .\~text-emerald-600{--tw-text-opacity:1;color:rgba(52,211,153,var(--tw-text-opacity))}.\~text-red-600{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.dark .\~text-red-600{--tw-text-opacity:1;color:rgba(248,113,113,var(--tw-text-opacity))}.\~text-orange-600{--tw-text-opacity:1;color:rgba(234,88,12,var(--tw-text-opacity))}.dark .\~text-orange-600{--tw-text-opacity:1;color:rgba(251,146,60,var(--tw-text-opacity))}.\~text-gray-700{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.dark .\~text-gray-700{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.\~text-indigo-700{--tw-text-opacity:1;color:rgba(67,56,202,var(--tw-text-opacity))}.dark .\~text-indigo-700{--tw-text-opacity:1;color:rgba(199,210,254,var(--tw-text-opacity))}.\~text-blue-700{--tw-text-opacity:1;color:rgba(29,78,216,var(--tw-text-opacity))}.dark .\~text-blue-700{--tw-text-opacity:1;color:rgba(191,219,254,var(--tw-text-opacity))}.\~text-violet-700{--tw-text-opacity:1;color:rgba(109,40,217,var(--tw-text-opacity))}.dark .\~text-violet-700{--tw-text-opacity:1;color:rgba(221,214,254,var(--tw-text-opacity))}.\~text-emerald-700{--tw-text-opacity:1;color:rgba(4,120,87,var(--tw-text-opacity))}.dark .\~text-emerald-700{--tw-text-opacity:1;color:rgba(167,243,208,var(--tw-text-opacity))}.\~text-red-700{--tw-text-opacity:1;color:rgba(185,28,28,var(--tw-text-opacity))}.dark .\~text-red-700{--tw-text-opacity:1;color:rgba(254,202,202,var(--tw-text-opacity))}.\~text-orange-700{--tw-text-opacity:1;color:rgba(194,65,12,var(--tw-text-opacity))}.dark .\~text-orange-700{--tw-text-opacity:1;color:rgba(254,215,170,var(--tw-text-opacity))}.\~text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.dark .\~text-gray-800{--tw-text-opacity:1;color:rgba(229,231,235,var(--tw-text-opacity))}.\~bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.dark .\~bg-white{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}.\~bg-body{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.dark .\~bg-body{--tw-bg-opacity:1;background-color:rgba(17,24,39,var(--tw-bg-opacity))}.\~bg-gray-100{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.dark .\~bg-gray-100{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}.\~bg-gray-200\/50{background-color:rgba(229,231,235,.5)}.dark .\~bg-gray-200\/50{background-color:rgba(55,65,81,.1)}.\~bg-gray-500\/5{background-color:rgba(107,114,128,.05)}.dark .\~bg-gray-500\/5{background-color:rgba(0,0,0,.1)}.hover\:\~bg-gray-500\/5:hover{background-color:rgba(107,114,128,.05)}.dark .hover\:\~bg-gray-500\/5:hover{background-color:rgba(17,24,39,.2)}.\~bg-gray-500\/10{background-color:rgba(107,114,128,.1)}.dark .\~bg-gray-500\/10{background-color:rgba(17,24,39,.4)}.\~bg-red-500\/10{background-color:rgba(239,68,68,.1)}.dark .\~bg-red-500\/10{background-color:rgba(239,68,68,.2)}.hover\:\~bg-red-500\/10:hover{background-color:rgba(239,68,68,.1)}.\~bg-red-500\/20,.dark .hover\:\~bg-red-500\/10:hover{background-color:rgba(239,68,68,.2)}.dark .\~bg-red-500\/20{background-color:rgba(239,68,68,.4)}.\~bg-red-500\/30{background-color:rgba(239,68,68,.3)}.dark .\~bg-red-500\/30{background-color:rgba(239,68,68,.6)}.\~bg-dropdown{--tw-bg-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important}.dark .\~bg-dropdown{--tw-bg-opacity:1!important;background-color:rgba(55,65,81,var(--tw-bg-opacity))!important}.\~border-gray-200{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.dark .\~border-gray-200{border-color:rgba(107,114,128,.2)}.\~border-b-dropdown{--tw-border-opacity:1!important;border-bottom-color:rgba(255,255,255,var(--tw-border-opacity))!important}.dark .\~border-b-dropdown{--tw-border-opacity:1!important;border-bottom-color:rgba(55,65,81,var(--tw-border-opacity))!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.inset-0{right:0;left:0}.inset-0,.inset-y-0{top:0;bottom:0}.-bottom-3{bottom:-.75rem}.-right-3{right:-.75rem}.-top-3{top:-.75rem}.-top-\[\.1rem\]{top:-.1rem}.left-0{left:0}.left-0\.5{left:.125rem}.left-1\/2{left:50%}.left-10{left:2.5rem}.left-4{left:1rem}.right-0{right:0}.right-1\/2{right:50%}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-10{top:2.5rem}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-3{top:.75rem}.top-\[7\.5rem\]{top:7.5rem}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.-my-5{margin-top:-1.25rem;margin-bottom:-1.25rem}.-my-px{margin-top:-1px;margin-bottom:-1px}.mx-0{margin-left:0;margin-right:0}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-2{margin-bottom:-.5rem}.-ml-1{margin-left:-.25rem}.-ml-3{margin-left:-.75rem}.-ml-6{margin-left:-1.5rem}.-mr-3{margin-right:-.75rem}.-mt-1{margin-top:-.25rem}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-0{margin-right:0}.mr-0\.5{margin-right:.125rem}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-10{margin-right:2.5rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.mr-px{margin-right:1px}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-\[-4px\]{margin-top:-4px}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-none{overflow:visible;display:block;-webkit-box-orient:horizontal;-webkit-line-clamp:none}.block{display:block}.inline-block{display:inline-block}.\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0{height:0}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[\.9rem\]{height:.9rem}.h-\[4px\]{height:4px}.h-full{height:100%}.max-h-32{max-height:8rem}.max-h-\[33vh\]{max-height:33vh}.w-0{width:0}.w-2{width:.5rem}.w-3{width:.75rem}.w-4{width:1rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[2rem\]{width:2rem}.w-\[8rem\]{width:8rem}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\[1rem\]{min-width:1rem}.min-w-\[2rem\]{min-width:2rem}.min-w-\[8rem\]{min-width:8rem}.max-w-4xl{max-width:56rem}.max-w-max{max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.origin-bottom{transform-origin:bottom}.origin-top-right{transform-origin:top right}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.translate-x-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x:0px}.translate-x-6{--tw-translate-x:1.5rem}.translate-x-6,.translate-x-8{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-8{--tw-translate-x:2rem}.translate-x-full{--tw-translate-x:100%}.translate-x-full,.translate-y-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y:0px}.translate-y-10{--tw-translate-y:2.5rem}.translate-y-10,.translate-y-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%}.-rotate-180{--tw-rotate:-180deg}.-rotate-90,.-rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate:-90deg}.rotate-180{--tw-rotate:180deg}.rotate-90,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg}.scale-90{--tw-scale-x:.9;--tw-scale-y:.9}.scale-90,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-flow-col{grid-auto-flow:column}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-px{gap:1px}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-2{row-gap:.5rem}.space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1px*var(--tw-space-x-reverse));margin-left:calc(1px*(1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-hidden{overflow-y:hidden}.overflow-x-scroll{overflow-x:scroll}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-none{border-radius:0}.rounded-sm{border-radius:.125rem}.rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-bl-lg{border-bottom-left-radius:.5rem}.rounded-br-lg{border-bottom-right-radius:.5rem}.border{border-width:1px}.border-\[10px\]{border-width:10px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0}.border-emerald-500\/25{border-color:rgba(16,185,129,.25)}.border-emerald-500\/50{border-color:rgba(16,185,129,.5)}.border-gray-200{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.border-gray-500\/50{border-color:rgba(107,114,128,.5)}.border-gray-800\/20{border-color:rgba(31,41,55,.2)}.border-indigo-500\/50{border-color:rgba(99,102,241,.5)}.border-orange-500\/50{border-color:rgba(249,115,22,.5)}.border-red-500\/25{border-color:rgba(239,68,68,.25)}.border-red-500\/50{border-color:rgba(239,68,68,.5)}.border-transparent{border-color:transparent}.border-violet-500\/25{border-color:rgba(139,92,246,.25)}.border-violet-600\/50{border-color:rgba(124,58,237,.5)}.bg-emerald-300{--tw-bg-opacity:1;background-color:rgba(110,231,183,var(--tw-bg-opacity))}.bg-emerald-500{--tw-bg-opacity:1;background-color:rgba(16,185,129,var(--tw-bg-opacity))}.bg-emerald-500\/5{background-color:rgba(16,185,129,.05)}.bg-emerald-600{--tw-bg-opacity:1;background-color:rgba(5,150,105,var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.bg-gray-25{--tw-bg-opacity:1;background-color:rgba(252,252,253,var(--tw-bg-opacity))}.bg-gray-300\/50{background-color:rgba(209,213,219,.5)}.bg-gray-500\/5{background-color:rgba(107,114,128,.05)}.bg-gray-900\/30{background-color:rgba(17,24,39,.3)}.bg-indigo-500{--tw-bg-opacity:1;background-color:rgba(99,102,241,var(--tw-bg-opacity))}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgba(79,70,229,var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity:1;background-color:rgba(254,202,202,var(--tw-bg-opacity))}.bg-red-50{--tw-bg-opacity:1;background-color:rgba(254,242,242,var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgba(239,68,68,var(--tw-bg-opacity))}.bg-red-500\/10{background-color:rgba(239,68,68,.1)}.bg-red-500\/20{background-color:rgba(239,68,68,.2)}.bg-red-500\/30{background-color:rgba(239,68,68,.3)}.bg-red-600{--tw-bg-opacity:1;background-color:rgba(220,38,38,var(--tw-bg-opacity))}.bg-red-800\/5{background-color:rgba(153,27,27,.05)}.bg-violet-500{--tw-bg-opacity:1;background-color:rgba(139,92,246,var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-yellow-50{--tw-bg-opacity:1;background-color:rgba(254,252,232,var(--tw-bg-opacity))}.bg-opacity-20{--tw-bg-opacity:0.2}.bg-dots-darker{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='30' height='30' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.227 0c.687 0 1.227.54 1.227 1.227s-.54 1.227-1.227 1.227S0 1.914 0 1.227.54 0 1.227 0z' fill='rgba(0,0,0,0.07)'/%3E%3C/svg%3E")}.bg-gradient-to-bl{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))}.from-gray-700\/50{--tw-gradient-from:rgba(55,65,81,0.5) var(--tw-gradient-from-position);--tw-gradient-to:rgba(55,65,81,0) var(--tw-gradient-to-position)}.from-gray-700\/50,.from-white{--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-white{--tw-gradient-from:#fff var(--tw-gradient-from-position);--tw-gradient-to:hsla(0,0%,100%,0) var(--tw-gradient-to-position)}.via-transparent{--tw-gradient-to:transparent var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),transparent var(--tw-gradient-via-position),var(--tw-gradient-to)}.bg-center{background-position:50%}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-1\.5{padding-bottom:.375rem}.pb-10{padding-bottom:2.5rem}.pb-16{padding-bottom:4rem}.pl-4{padding-left:1rem}.pl-6{padding-left:1.5rem}.pl-px{padding-left:1px}.pr-10{padding-right:2.5rem}.pr-12{padding-right:3rem}.pr-8{padding-right:2rem}.pt-10{padding-top:2.5rem}.pt-2{padding-top:.5rem}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[8px\]{font-size:8px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-loose{line-height:2}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-wider{letter-spacing:.05em}.text-emerald-500{--tw-text-opacity:1;color:rgba(16,185,129,var(--tw-text-opacity))}.text-emerald-600{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.text-emerald-700{--tw-text-opacity:1;color:rgba(4,120,87,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.text-green-700{--tw-text-opacity:1;color:rgba(21,128,61,var(--tw-text-opacity))}.text-indigo-100{--tw-text-opacity:1;color:rgba(224,231,255,var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity:1;color:rgba(99,102,241,var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity:1;color:rgba(234,88,12,var(--tw-text-opacity))}.text-red-100{--tw-text-opacity:1;color:rgba(254,226,226,var(--tw-text-opacity))}.text-red-50{--tw-text-opacity:1;color:rgba(254,242,242,var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgba(239,68,68,var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.text-red-700{--tw-text-opacity:1;color:rgba(185,28,28,var(--tw-text-opacity))}.text-violet-500{--tw-text-opacity:1;color:rgba(139,92,246,var(--tw-text-opacity))}.text-violet-600{--tw-text-opacity:1;color:rgba(124,58,237,var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgba(234,179,8,var(--tw-text-opacity))}.text-opacity-75{--tw-text-opacity:0.75}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px -1px rgba(0,0,0,0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-2xl{box-shadow:0 0 transparent,0 0 transparent,var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,0.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 rgba(0,0,0,0.05);--tw-shadow-colored:inset 0 2px 4px 0 var(--tw-shadow-color)}.shadow-inner,.shadow-lg{box-shadow:0 0 transparent,0 0 transparent,var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -2px rgba(0,0,0,0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:0 0 transparent,0 0 transparent,var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.shadow-gray-500\/20{--tw-shadow-color:rgba(107,114,128,0.2);--tw-shadow:var(--tw-shadow-colored)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-animation{transition-property:transform,box-shadow,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,fill,stroke,-webkit-text-decoration-color;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,-webkit-text-decoration-color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-100{transition-delay:.1s}.duration-100{transition-duration:.1s}.duration-1000{transition-duration:1s}.duration-150{transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.\@container{container-type:inline-size}.first-letter\:uppercase:first-letter{text-transform:uppercase}.hover\:text-emerald-700:hover{--tw-text-opacity:1;color:rgba(4,120,87,var(--tw-text-opacity))}.hover\:text-emerald-800:hover{--tw-text-opacity:1;color:rgba(6,95,70,var(--tw-text-opacity))}.hover\:text-indigo-500:hover{--tw-text-opacity:1;color:rgba(99,102,241,var(--tw-text-opacity))}.hover\:text-purple-500:hover{--tw-text-opacity:1;color:rgba(168,85,247,var(--tw-text-opacity))}.hover\:text-red-500:hover{--tw-text-opacity:1;color:rgba(239,68,68,var(--tw-text-opacity))}.hover\:text-red-800:hover{--tw-text-opacity:1;color:rgba(153,27,27,var(--tw-text-opacity))}.hover\:text-violet-500:hover{--tw-text-opacity:1;color:rgba(139,92,246,var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.hover\:underline:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -4px rgba(0,0,0,0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.hover\:shadow-lg:hover,.hover\:shadow-md:hover{box-shadow:0 0 transparent,0 0 transparent,var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -2px rgba(0,0,0,0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.active\:translate-y-px:active{--tw-translate-y:1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:shadow-inner:active{--tw-shadow:inset 0 2px 4px 0 rgba(0,0,0,0.05);--tw-shadow-colored:inset 0 2px 4px 0 var(--tw-shadow-color)}.active\:shadow-inner:active,.active\:shadow-sm:active{box-shadow:0 0 transparent,0 0 transparent,var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.active\:shadow-sm:active{--tw-shadow:0 1px 2px 0 rgba(0,0,0,0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.group:hover .group-hover\:scale-100{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-amber-300{--tw-text-opacity:1;color:rgba(252,211,77,var(--tw-text-opacity))}.group:hover .group-hover\:text-amber-400{--tw-text-opacity:1;color:rgba(251,191,36,var(--tw-text-opacity))}.group:hover .group-hover\:text-indigo-500{--tw-text-opacity:1;color:rgba(99,102,241,var(--tw-text-opacity))}.group:hover .group-hover\:opacity-100{opacity:1}.group:hover .group-hover\:opacity-50{opacity:.5}.peer:checked~.peer-checked\:translate-x-2{--tw-translate-x:0.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:bg-emerald-300{--tw-bg-opacity:1;background-color:rgba(110,231,183,var(--tw-bg-opacity))}@container (min-width: 32rem){.\@lg\:px-10{padding-left:2.5rem;padding-right:2.5rem}}@container (min-width: 42rem){.\@2xl\:block{display:block}}@container (min-width: 56rem){.\@4xl\:absolute{position:absolute}.\@4xl\:col-span-2{grid-column:span 2/span 2}.\@4xl\:mr-20{margin-right:5rem}.\@4xl\:flex{display:flex}.\@4xl\:max-h-\[none\]{max-height:none}.\@4xl\:grid-cols-\[33\.33\%_66\.66\%\]{grid-template-columns:33.33% 66.66%}.\@4xl\:grid-rows-\[57rem\]{grid-template-rows:57rem}.\@4xl\:rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.\@4xl\:rounded-bl-none{border-bottom-left-radius:0}.\@4xl\:border-t-0{border-top-width:0}}.dark .dark\:bg-black\/10{background-color:rgba(0,0,0,.1)}.dark .dark\:bg-gray-800\/50{background-color:rgba(31,41,55,.5)}.dark .dark\:bg-red-500\/10{background-color:rgba(239,68,68,.1)}.dark .dark\:bg-yellow-500\/10{background-color:rgba(234,179,8,.1)}.dark .dark\:bg-dots-lighter{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='30' height='30' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.227 0c.687 0 1.227.54 1.227 1.227s-.54 1.227-1.227 1.227S0 1.914 0 1.227.54 0 1.227 0z' fill='rgba(255,255,255,0.07)'/%3E%3C/svg%3E")}.dark .dark\:bg-gradient-to-bl{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))}.dark .dark\:from-gray-700\/50{--tw-gradient-from:rgba(55,65,81,0.5) var(--tw-gradient-from-position);--tw-gradient-to:rgba(55,65,81,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.dark .dark\:shadow-none{--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;box-shadow:0 0 transparent,0 0 transparent,var(--tw-shadow);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.dark .dark\:ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),0 0 transparent;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.dark .dark\:ring-inset{--tw-ring-inset:inset}.dark .dark\:ring-white\/5{--tw-ring-color:hsla(0,0%,100%,0.05)}@media (min-width:640px){.sm\:-ml-5{margin-left:-1.25rem}.sm\:-mr-5{margin-right:-1.25rem}.sm\:inline-flex{display:inline-flex}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}}@media (min-width:1024px){.lg\:flex{display:flex}.lg\:w-1\/3{width:33.333333%}.lg\:w-2\/5{width:40%}.lg\:max-w-\[90rem\]{max-width:90rem}.lg\:px-10{padding-left:2.5rem;padding-right:2.5rem}}PKX'ZƄ\ \ 'ignition/resources/compiled/ignition.jsnuW+Afunction e(){return(e=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r1?t-1:0),r=1;r1){for(var u=Array(c),f=0;f1){for(var p=Array(d),m=0;m import('./MyComponent'))",t);var r=e;r._status=1,r._result=n}},function(t){if(0===e._status){var n=e;n._status=2,n._result=t}})}if(1===e._status)return e._result;throw e._result}function se(e){return"string"==typeof e||"function"==typeof e||e===t.Fragment||e===t.Profiler||e===m||e===t.StrictMode||e===t.Suspense||e===s||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===u||e.$$typeof===c||e.$$typeof===a||e.$$typeof===o||e.$$typeof===i||e.$$typeof===p||e.$$typeof===f||e[0]===d)}function ce(){var e=b.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");return e}var ue,fe,de,pe,me,he,ge,ye=0;function ve(){}ve.__reactDisabledLog=!0;var be,Ee=N.ReactCurrentDispatcher;function Te(e,t,n){if(void 0===be)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);be=r&&r[1]||""}return"\n"+be+e}var Se,we=!1,Ne="function"==typeof WeakMap?WeakMap:Map;function Re(t,n){if(!t||we)return"";var r,a=Se.get(t);if(void 0!==a)return a;we=!0;var o,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=Ee.current,Ee.current=null,function(){if(0===ye){ue=console.log,fe=console.info,de=console.warn,pe=console.error,me=console.group,he=console.groupCollapsed,ge=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ye++}();try{if(n){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(l,[])}catch(e){r=e}Reflect.construct(t,[],l)}else{try{l.call()}catch(e){r=e}t.call(l.prototype)}}else{try{throw Error()}catch(e){r=e}t()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var s=e.stack.split("\n"),c=r.stack.split("\n"),u=s.length-1,f=c.length-1;u>=1&&f>=0&&s[u]!==c[f];)f--;for(;u>=1&&f>=0;u--,f--)if(s[u]!==c[f]){if(1!==u||1!==f)do{if(u--,--f<0||s[u]!==c[f]){var d="\n"+s[u].replace(" at new "," at ");return"function"==typeof t&&Se.set(t,d),d}}while(u>=1&&f>=0);break}}}finally{we=!1,Ee.current=o,function(){if(0==--ye){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:e({},t,{value:ue}),info:e({},t,{value:fe}),warn:e({},t,{value:de}),error:e({},t,{value:pe}),group:e({},t,{value:me}),groupCollapsed:e({},t,{value:he}),groupEnd:e({},t,{value:ge})})}ye<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=i}var p=t?t.displayName||t.name:"",m=p?Te(p):"";return"function"==typeof t&&Se.set(t,m),m}function Oe(e,t,n){return Re(e,!1)}function xe(e,n,r){if(null==e)return"";if("function"==typeof e)return Re(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return Te(e);switch(e){case t.Suspense:return Te("Suspense");case s:return Te("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case i:return Oe(e.render);case c:return xe(e.type,n,r);case f:return Oe(e._render);case u:var a=e._payload,o=e._init;try{return xe(o(a),n,r)}catch(e){}}return""}Se=new Ne;var ke,Ae={},Ce=N.ReactDebugCurrentFrame;function Ie(e){if(e){var t=e._owner,n=xe(e.type,e._source,t?t.type:null);Ce.setExtraStackFrame(n)}else Ce.setExtraStackFrame(null)}function _e(e){if(e){var t=e._owner;w(xe(e.type,e._source,t?t.type:null))}else w(null)}function Le(){if(E.current){var e=z(E.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}function Pe(e){return null!=e?function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(e.__source):""}ke=!1;var De={};function Me(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=Le();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!De[n]){De[n]=!0;var r="";e&&e._owner&&e._owner!==E.current&&(r=" It was passed a child from "+z(e._owner.type)+"."),_e(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),_e(null)}}}function Ue(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",i=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,O("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,i)}var c=Q.apply(this,arguments);if(null==c)return c;if(o)for(var u=2;u is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||(r=!0,O("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}},displayName:{get:function(){return n.displayName},set:function(e){l||(R("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),l=!0)}}}),n.Consumer=s,n._currentRenderer=null,n._currentRenderer2=null,n},t.createElement=Ve,t.createFactory=function(e){var t=ze.bind(null,e);return t.type=e,Be||(Be=!0,R("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return R("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===c?O("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?O("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&O("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||O("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,n={$$typeof:i,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,null==e.displayName&&(e.displayName=n)}}),n},t.isValidElement=ee,t.lazy=function(e){var t,n,r={$$typeof:u,_payload:{_status:-1,_result:e},_init:le};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){O("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){O("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},t.memo=function(e,t){se(e)||O("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e);var n,r={$$typeof:c,type:e,compare:void 0===t?null:t};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,null==e.displayName&&(e.displayName=t)}}),r},t.useCallback=function(e,t){return ce().useCallback(e,t)},t.useContext=function(e,t){var n=ce();if(void 0!==t&&O("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?O("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&O("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},t.useDebugValue=function(e,t){return ce().useDebugValue(e,t)},t.useEffect=function(e,t){return ce().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return ce().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return ce().useLayoutEffect(e,t)},t.useMemo=function(e,t){return ce().useMemo(e,t)},t.useReducer=function(e,t,n){return ce().useReducer(e,t,n)},t.useRef=function(e){return ce().useRef(e)},t.useState=function(e){return ce().useState(e)},t.version="17.0.2"}()}),c=n(function(e){e.exports=s});n(function(e,t){var n,r,a,o;if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();t.unstable_now=function(){return l.now()-s}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,f=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(f,0),e}};n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(f,0))},r=function(e,t){u=setTimeout(e,t)},a=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var d=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var h=!1,g=null,y=-1,v=5,b=0;t.unstable_shouldYield=function(){return t.unstable_now()>=b},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,a=e[r];if(!(void 0!==a&&0R(i,n))void 0!==s&&0>R(s,i)?(e[r]=s,e[l]=n,r=l):(e[r]=i,e[o]=n,r=o);else{if(!(void 0!==s&&0>R(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function R(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],x=[],k=1,A=null,C=3,I=!1,_=!1,L=!1;function P(e){for(var t=w(x);null!==t;){if(null===t.callback)N(x);else{if(!(t.startTime<=e))break;N(x),t.sortIndex=t.expirationTime,S(O,t)}t=w(x)}}function D(e){if(L=!1,P(e),!_)if(null!==w(O))_=!0,n(M);else{var t=w(x);null!==t&&r(D,t.startTime-e)}}function M(e,n){_=!1,L&&(L=!1,a()),I=!0;var o=C;try{for(P(n),A=w(O);null!==A&&(!(A.expirationTime>n)||e&&!t.unstable_shouldYield());){var i=A.callback;if("function"==typeof i){A.callback=null,C=A.priorityLevel;var l=i(A.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?A.callback=l:A===w(O)&&N(O),P(n)}else N(O);A=w(O)}if(null!==A)var s=!0;else{var c=w(x);null!==c&&r(D,c.startTime-n),s=!1}return s}finally{A=null,C=o,I=!1}}var U=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){_||I||(_=!0,n(M))},t.unstable_getCurrentPriorityLevel=function(){return C},t.unstable_getFirstCallbackNode=function(){return w(O)},t.unstable_next=function(e){switch(C){case 1:case 2:case 3:var t=3;break;default:t=C}var n=C;C=t;try{return e()}finally{C=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=U,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=C;C=e;try{return t()}finally{C=n}},t.unstable_scheduleCallback=function(e,o,i){var l=t.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0l?(e.sortIndex=i,S(x,e),null===w(O)&&e===w(x)&&(L?a():L=!0,r(D,i-l))):(e.sortIndex=s,S(O,e),_||I||(_=!0,n(M))),e},t.unstable_wrapCallback=function(e){var t=C;return function(){var n=C;C=t;try{return e.apply(this,arguments)}finally{C=n}}}});var u=n(function(e,t){!function(){var e,n,r,a;if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();t.unstable_now=function(){return i.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,c=null,u=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(u,0),e}};e=function(t){null!==s?setTimeout(e,0,t):(s=t,setTimeout(u,0))},n=function(e,t){c=setTimeout(e,t)},r=function(){clearTimeout(c)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,d=window.clearTimeout;if("undefined"!=typeof console){var p=window.requestAnimationFrame,m=window.cancelAnimationFrame;"function"!=typeof p&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var h=!1,g=null,y=-1,v=5,b=0;t.unstable_shouldYield=function(){return t.unstable_now()>=b},a=function(){},t.unstable_forceFrameRate=function(e){e<0||e>125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=e>0?Math.floor(1e3/e):5};var E=new MessageChannel,T=E.port2;E.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();b=e+v;try{g(!0,e)?T.postMessage(null):(h=!1,g=null)}catch(e){throw T.postMessage(null),e}}else h=!1},e=function(e){g=e,h||(h=!0,T.postMessage(null))},n=function(e,n){y=f(function(){e(t.unstable_now())},n)},r=function(){d(y),y=-1}}function S(e,t){var n=e.length;e.push(t),function(e,t,n){for(var r=n;;){var a=r-1>>>1,o=e[a];if(!(void 0!==o&&R(o,t)>0))return;e[a]=t,e[r]=o,r=a}}(e,t,n)}function w(e){var t=e[0];return void 0===t?null:t}function N(e){var t=e[0];if(void 0!==t){var n=e.pop();return n!==t&&(e[0]=n,function(e,t,n){for(var r=0,a=e.length;ra)||e&&!t.unstable_shouldYield());){var o=A.callback;if("function"==typeof o){A.callback=null,C=A.priorityLevel;var i=o(A.expirationTime<=a);a=t.unstable_now(),"function"==typeof i?A.callback=i:A===w(O)&&N(O),P(a)}else N(O);A=w(O)}if(null!==A)return!0;var l=w(x);return null!==l&&n(D,l.startTime-a),!1}(e,a)}finally{A=null,C=o,I=!1}}var U=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){_||I||(_=!0,e(M))},t.unstable_getCurrentPriorityLevel=function(){return C},t.unstable_getFirstCallbackNode=function(){return w(O)},t.unstable_next=function(e){var t;switch(C){case 1:case 2:case 3:t=3;break;default:t=C}var n=C;C=t;try{return e()}finally{C=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=U,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=C;C=e;try{return t()}finally{C=n}},t.unstable_scheduleCallback=function(a,o,i){var l,s,c=t.unstable_now();if("object"==typeof i&&null!==i){var u=i.delay;l="number"==typeof u&&u>0?c+u:c}else l=c;switch(a){case 1:s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;case 3:default:s=5e3}var f=l+s,d={id:k++,callback:o,priorityLevel:a,startTime:l,expirationTime:f,sortIndex:-1};return l>c?(d.sortIndex=l,S(x,d),null===w(O)&&d===w(x)&&(L?r():L=!0,n(D,l-c))):(d.sortIndex=f,S(O,d),_||I||(_=!0,e(M))),d},t.unstable_wrapCallback=function(e){var t=C;return function(){var n=C;C=t;try{return e.apply(this,arguments)}finally{C=n}}}}()}),f=n(function(e){e.exports=u});function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n