From 358d1e0ca43159c135414eeed457c2b42ff772cb Mon Sep 17 00:00:00 2001 From: Raj Siva-Rajah <5361908+binaryfire@users.noreply.github.com> Date: Tue, 3 Nov 2026 18:27:45 +0000 Subject: [PATCH 01/16] Expose the raw HTTP response on embeddings, transcription, image and reranking responses These responses kept no reference to the provider's HTTP response, so provider-specific data such as OpenRouter's usage cost was out of reach. Each response now uses HasRawResponse, and every HTTP gateway for these operations attaches the response it parsed. Individually cached embeddings carry the fresh request's response. Bedrock (AWS SDK) and the fakes leave it null, as upstream does, and serialization still drops it. Ports laravel/ai#1181, laravel/ai#1180, laravel/ai#1179 and laravel/ai#1182 at c8495608a1. They share the gateways and ResponseSerializationTest. Their ai-sdk.md change lands with the later agent-run commit in this batch, which shares that page. Ported the OpenAI, OpenRouter, Cohere, Jina and Voyage AI raw-response tests, EmbeddingsCacheTest's raw-response test in both cache modes and the four serialization tests. tests/Ai passes. --- .../AzureOpenAi/AzureOpenAiGateway.php | 8 +- src/ai/src/Gateway/CohereGateway.php | 8 +- src/ai/src/Gateway/ElevenLabsGateway.php | 12 +-- src/ai/src/Gateway/Gemini/GeminiGateway.php | 16 ++-- src/ai/src/Gateway/Groq/GroqGateway.php | 4 +- src/ai/src/Gateway/JinaGateway.php | 8 +- src/ai/src/Gateway/Mistral/MistralGateway.php | 8 +- src/ai/src/Gateway/Ollama/OllamaGateway.php | 4 +- src/ai/src/Gateway/OpenAi/OpenAiGateway.php | 12 +-- .../OpenAiCompatibleGateway.php | 8 +- .../Gateway/OpenRouter/OpenRouterGateway.php | 16 ++-- .../VoyageAi/Concerns/MapsEmbeddingInputs.php | 10 ++- .../src/Gateway/VoyageAi/VoyageAiGateway.php | 20 +++-- src/ai/src/Gateway/Xai/XaiImageGateway.php | 8 +- .../PendingEmbeddingsGeneration.php | 3 +- src/ai/src/Responses/EmbeddingsResponse.php | 3 + src/ai/src/Responses/ImageResponse.php | 3 + src/ai/src/Responses/RerankingResponse.php | 3 + .../src/Responses/TranscriptionResponse.php | 3 + tests/Ai/Feature/EmbeddingsCacheTest.php | 14 +++ .../Providers/Cohere/RerankingTest.php | 3 + .../Feature/Providers/Jina/RerankingTest.php | 3 + .../Providers/OpenAi/EmbeddingTest.php | 11 +++ .../Providers/OpenAi/ImageGenerationTest.php | 11 +++ .../Providers/OpenAi/TranscriptionTest.php | 12 +++ .../Providers/OpenRouter/EmbeddingsTest.php | 13 +++ .../OpenRouter/ImageGenerationTest.php | 10 +++ .../Providers/OpenRouter/RerankingTest.php | 5 +- .../OpenRouter/TranscriptionTest.php | 9 ++ .../Providers/VoyageAi/RerankingTest.php | 3 + .../Ai/Feature/ResponseSerializationTest.php | 86 +++++++++++++++++++ 31 files changed, 267 insertions(+), 70 deletions(-) diff --git a/src/ai/src/Gateway/AzureOpenAi/AzureOpenAiGateway.php b/src/ai/src/Gateway/AzureOpenAi/AzureOpenAiGateway.php index 57c025d9eb..129fdb858b 100644 --- a/src/ai/src/Gateway/AzureOpenAi/AzureOpenAiGateway.php +++ b/src/ai/src/Gateway/AzureOpenAi/AzureOpenAiGateway.php @@ -81,11 +81,11 @@ public function generateEmbeddings( $data = $response->json(); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( $this->parseIndexedEmbeddings($data['data'] ?? [], count($inputs), $provider->name()), new Usage($data['usage']['prompt_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -122,14 +122,14 @@ public function generateImage( $data = $response->json(); - return new ImageResponse( + return (new ImageResponse( collect($data['data'] ?? [])->map(fn (array $image): GeneratedImage => new GeneratedImage( $image['b64_json'] ?? '', 'image/' . ($data['output_format'] ?? 'png'), )), $this->extractImageUsage($data), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/Gateway/CohereGateway.php b/src/ai/src/Gateway/CohereGateway.php index 9786fb93a1..a263421aef 100644 --- a/src/ai/src/Gateway/CohereGateway.php +++ b/src/ai/src/Gateway/CohereGateway.php @@ -138,11 +138,11 @@ public function generateEmbeddings( $data = $response->json(); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( $this->parseCohereEmbeddings($data['embeddings'] ?? []), new Usage($data['meta']['billed_units']['input_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -179,14 +179,14 @@ public function rerank( score: $result['relevance_score'], ))->all(); - return new RerankingResponse( + return (new RerankingResponse( $results, new RerankingUsage( inputTokens: $data['meta']['billed_units']['input_tokens'] ?? 0, searchUnits: $data['meta']['billed_units']['search_units'] ?? null, ), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/Gateway/ElevenLabsGateway.php b/src/ai/src/Gateway/ElevenLabsGateway.php index e1709d4fd2..3448551183 100644 --- a/src/ai/src/Gateway/ElevenLabsGateway.php +++ b/src/ai/src/Gateway/ElevenLabsGateway.php @@ -86,14 +86,14 @@ public function generateTranscription( 'diarize' => $diarize ? 'true' : 'false', ])))->throw()); - $response = $response->json(); + $data = $response->json(); $segments = $diarize - ? ($response['words'] ?? []) + ? ($data['words'] ?? []) : []; - return new TranscriptionResponse( - $response['text'], + return (new TranscriptionResponse( + $data['text'], (new Collection($segments))->map(function (array $segment): ?TranscriptionSegment { if ($segment['type'] !== 'word') { return null; @@ -106,9 +106,9 @@ public function generateTranscription( $segment['end'], ); })->filter()->values(), - new TranscriptionUsage(audioSeconds: $response['audio_duration_secs'] ?? null), + new TranscriptionUsage(audioSeconds: $data['audio_duration_secs'] ?? null), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/Gateway/Gemini/GeminiGateway.php b/src/ai/src/Gateway/Gemini/GeminiGateway.php index 8af465e21d..23dbc16cb3 100644 --- a/src/ai/src/Gateway/Gemini/GeminiGateway.php +++ b/src/ai/src/Gateway/Gemini/GeminiGateway.php @@ -165,11 +165,11 @@ public function generateImage( $block['mime_type'] ?? 'image/png', )); - return new ImageResponse( + return (new ImageResponse( $images, $this->extractImageUsage($data), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -213,11 +213,11 @@ public function generateEmbeddings( $data = $response->json(); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( (new Collection($data['embeddings'] ?? []))->pluck('values')->all(), new Usage($data['usageMetadata']['promptTokenCount'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -357,12 +357,12 @@ protected function transcribeWithConfig( $steps = $data['steps'] ?? []; - return new TranscriptionResponse( + return (new TranscriptionResponse( trim($this->extractText($steps)), $this->speakerSegments($steps), TranscriptionUsage::from($this->extractUsage($data)), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -504,12 +504,12 @@ protected function transcribeWithPrompt( $segments = new Collection; } - return new TranscriptionResponse( + return (new TranscriptionResponse( trim((string) $text), $segments, TranscriptionUsage::from($this->extractUsage($payload)), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/Gateway/Groq/GroqGateway.php b/src/ai/src/Gateway/Groq/GroqGateway.php index 61efb891ae..64e707d3f5 100644 --- a/src/ai/src/Gateway/Groq/GroqGateway.php +++ b/src/ai/src/Gateway/Groq/GroqGateway.php @@ -136,7 +136,7 @@ public function generateTranscription( $data = $response->json(); - return new TranscriptionResponse( + return (new TranscriptionResponse( $data['text'] ?? '', collect($data['segments'] ?? [])->map(fn (array $segment): TranscriptionSegment => new TranscriptionSegment( $segment['text'] ?? '', @@ -146,6 +146,6 @@ public function generateTranscription( )), new TranscriptionUsage(audioSeconds: $data['duration'] ?? null), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } } diff --git a/src/ai/src/Gateway/JinaGateway.php b/src/ai/src/Gateway/JinaGateway.php index 9eec2398a8..300c9acd31 100644 --- a/src/ai/src/Gateway/JinaGateway.php +++ b/src/ai/src/Gateway/JinaGateway.php @@ -55,11 +55,11 @@ public function generateEmbeddings( $embeddings = (new Collection($data['data']))->pluck('embedding')->all(); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( $embeddings, new Usage($data['usage']['total_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -95,11 +95,11 @@ public function rerank( score: $result['relevance_score'], ))->all(); - return new RerankingResponse( + return (new RerankingResponse( $results, new RerankingUsage($data['usage']['total_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/Gateway/Mistral/MistralGateway.php b/src/ai/src/Gateway/Mistral/MistralGateway.php index 96a628f1b6..a2361515d5 100644 --- a/src/ai/src/Gateway/Mistral/MistralGateway.php +++ b/src/ai/src/Gateway/Mistral/MistralGateway.php @@ -150,11 +150,11 @@ public function generateEmbeddings( $data = $response->json(); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( collect($data['data'] ?? [])->pluck('embedding')->all(), new Usage($data['usage']['prompt_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -190,7 +190,7 @@ public function generateTranscription( $data = $response->json(); - return new TranscriptionResponse( + return (new TranscriptionResponse( $data['text'] ?? '', collect($data['segments'] ?? [])->map(fn (array $segment): TranscriptionSegment => new TranscriptionSegment( $segment['text'] ?? '', @@ -204,7 +204,7 @@ public function generateTranscription( audioSeconds: $data['usage']['prompt_audio_seconds'] ?? null, ), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/Gateway/Ollama/OllamaGateway.php b/src/ai/src/Gateway/Ollama/OllamaGateway.php index 87ee02a117..f809e9f209 100644 --- a/src/ai/src/Gateway/Ollama/OllamaGateway.php +++ b/src/ai/src/Gateway/Ollama/OllamaGateway.php @@ -135,10 +135,10 @@ public function generateEmbeddings( )); } - return new EmbeddingsResponse( + return (new EmbeddingsResponse( $data['embeddings'] ?? [], new Usage($data['prompt_eval_count'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } } diff --git a/src/ai/src/Gateway/OpenAi/OpenAiGateway.php b/src/ai/src/Gateway/OpenAi/OpenAiGateway.php index ffb64b4e56..a836dd15ae 100644 --- a/src/ai/src/Gateway/OpenAi/OpenAiGateway.php +++ b/src/ai/src/Gateway/OpenAi/OpenAiGateway.php @@ -93,14 +93,14 @@ public function generateImage( $data = $response->json(); - return new ImageResponse( + return (new ImageResponse( collect($data['data'] ?? [])->map(fn (array $image): GeneratedImage => new GeneratedImage( $image['b64_json'] ?? '', 'image/' . ($data['output_format'] ?? 'png'), )), $this->extractImageUsage($data), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -248,7 +248,7 @@ public function generateTranscription( $data = $response->json(); - return new TranscriptionResponse( + return (new TranscriptionResponse( $data['text'] ?? '', collect($data['segments'] ?? [])->map(fn (array $segment): TranscriptionSegment => new TranscriptionSegment( $segment['text'] ?? '', @@ -262,7 +262,7 @@ public function generateTranscription( audioSeconds: Arr::get($data, 'usage.seconds') ?? Arr::get($data, 'duration'), ), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -288,10 +288,10 @@ public function generateEmbeddings( $data = $response->json(); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( $this->parseIndexedEmbeddings($data['data'] ?? [], count($inputs), $provider->name()), new Usage($data['usage']['prompt_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } } diff --git a/src/ai/src/Gateway/OpenAiCompatible/OpenAiCompatibleGateway.php b/src/ai/src/Gateway/OpenAiCompatible/OpenAiCompatibleGateway.php index 1802f28f1a..d32a165103 100644 --- a/src/ai/src/Gateway/OpenAiCompatible/OpenAiCompatibleGateway.php +++ b/src/ai/src/Gateway/OpenAiCompatible/OpenAiCompatibleGateway.php @@ -87,11 +87,11 @@ public function generateEmbeddings( $this->validateTextResponse($data); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( $this->parseEmbeddings($data, count($inputs)), new Usage($data['usage']['prompt_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -136,7 +136,7 @@ public function generateTranscription( $data = $response->json(); - return new TranscriptionResponse( + return (new TranscriptionResponse( $data['text'] ?? '', collect($data['segments'] ?? [])->map(fn (array $segment): TranscriptionSegment => new TranscriptionSegment( $segment['text'] ?? '', @@ -150,7 +150,7 @@ public function generateTranscription( audioSeconds: Arr::get($data, 'usage.seconds') ?? Arr::get($data, 'duration'), ), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/Gateway/OpenRouter/OpenRouterGateway.php b/src/ai/src/Gateway/OpenRouter/OpenRouterGateway.php index 59037ec89e..73ee6da82d 100644 --- a/src/ai/src/Gateway/OpenRouter/OpenRouterGateway.php +++ b/src/ai/src/Gateway/OpenRouter/OpenRouterGateway.php @@ -148,14 +148,14 @@ public function generateImage( $this->validateTextResponse($data); - return new ImageResponse( + return (new ImageResponse( collect($data['data'] ?? [])->map(fn (array $image): GeneratedImage => new GeneratedImage( $image['b64_json'] ?? '', $image['media_type'] ?? 'image/png', )), new ImageUsage($data['usage']['prompt_tokens'] ?? 0, $data['usage']['completion_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -291,7 +291,7 @@ public function generateTranscription( $data = $response->json(); - return new TranscriptionResponse( + return (new TranscriptionResponse( $data['text'] ?? '', collect(), new TranscriptionUsage( @@ -300,7 +300,7 @@ public function generateTranscription( audioSeconds: Arr::get($data, 'usage.seconds'), ), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -350,11 +350,11 @@ public function generateEmbeddings( $this->validateTextResponse($data); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( $this->parseIndexedEmbeddings($data['data'] ?? [], count($inputs), $provider->name()), new Usage($data['usage']['prompt_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -390,13 +390,13 @@ public function rerank( score: $result['relevance_score'], ))->all(); - return new RerankingResponse( + return (new RerankingResponse( $results, new RerankingUsage( inputTokens: $data['usage']['total_tokens'] ?? 0, searchUnits: $data['usage']['search_units'] ?? null, ), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } } diff --git a/src/ai/src/Gateway/VoyageAi/Concerns/MapsEmbeddingInputs.php b/src/ai/src/Gateway/VoyageAi/Concerns/MapsEmbeddingInputs.php index 154c79f72d..a40e4bbd23 100644 --- a/src/ai/src/Gateway/VoyageAi/Concerns/MapsEmbeddingInputs.php +++ b/src/ai/src/Gateway/VoyageAi/Concerns/MapsEmbeddingInputs.php @@ -51,7 +51,7 @@ protected function generateMultimodalEmbeddings( $this->validateMultimodalEmbeddingInputSources($inputs); - $data = $this->withErrorHandling( + $response = $this->withErrorHandling( $provider->name(), fn () => $this->client($provider, $timeout)->post('/multimodalembeddings', array_merge($providerOptions, [ 'model' => $model, @@ -59,13 +59,15 @@ protected function generateMultimodalEmbeddings( 'content' => [$this->mapMultimodalEmbeddingInput($input)], ], $inputs), ], $model === 'voyage-multimodal-3' ? [] : ['output_dimension' => $dimensions])), - )->json(); + ); + + $data = $response->json(); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( (new Collection($data['data'] ?? []))->pluck('embedding')->all(), new Usage($data['usage']['total_tokens'] ?? $data['total_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/Gateway/VoyageAi/VoyageAiGateway.php b/src/ai/src/Gateway/VoyageAi/VoyageAiGateway.php index b91f35dc8e..befcef3095 100644 --- a/src/ai/src/Gateway/VoyageAi/VoyageAiGateway.php +++ b/src/ai/src/Gateway/VoyageAi/VoyageAiGateway.php @@ -43,20 +43,22 @@ public function generateEmbeddings( return $this->generateMultimodalEmbeddings($provider, $model, $inputs, $dimensions, $timeout, $providerOptions); } - $data = $this->withErrorHandling( + $response = $this->withErrorHandling( $provider->name(), fn () => $this->client($provider, $timeout)->post('/embeddings', array_merge($providerOptions, [ 'model' => $model, 'input' => $inputs, 'output_dimension' => $dimensions, ])), - )->json(); + ); + + $data = $response->json(); - return new EmbeddingsResponse( + return (new EmbeddingsResponse( (new Collection($data['data']))->pluck('embedding')->all(), new Usage($data['usage']['total_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** @@ -75,7 +77,7 @@ public function rerank( array $providerOptions = [], ): RerankingResponse { /** @var Provider&RerankingProvider $provider */ - $data = $this->withErrorHandling( + $response = $this->withErrorHandling( $provider->name(), fn () => $this->client($provider, $timeout)->post('/rerank', array_merge($providerOptions, Arr::whereNotNull([ 'model' => $model, @@ -83,9 +85,11 @@ public function rerank( 'documents' => $documents, 'top_k' => $limit, ]))), - )->json(); + ); + + $data = $response->json(); - return new RerankingResponse( + return (new RerankingResponse( collect($data['data'])->map(fn (array $result): RankedDocument => new RankedDocument( index: $result['index'], document: $documents[$result['index']], @@ -93,6 +97,6 @@ public function rerank( ))->all(), new RerankingUsage($data['usage']['total_tokens'] ?? 0), new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } } diff --git a/src/ai/src/Gateway/Xai/XaiImageGateway.php b/src/ai/src/Gateway/Xai/XaiImageGateway.php index bc3c7d414f..ed3a13d5bd 100644 --- a/src/ai/src/Gateway/Xai/XaiImageGateway.php +++ b/src/ai/src/Gateway/Xai/XaiImageGateway.php @@ -66,16 +66,16 @@ public function generateImage( ->post($attachments === [] ? 'images/generations' : 'images/edits', $body) ); - $response = $response->json(); + $data = $response->json(); - return new ImageResponse( - collect($response['data'] ?? [])->map(fn (array $image): GeneratedImage => new GeneratedImage( + return (new ImageResponse( + collect($data['data'] ?? [])->map(fn (array $image): GeneratedImage => new GeneratedImage( $image['b64_json'] ?? '', $image['mime_type'] ?? 'image/jpeg', )), new ImageUsage, new Meta($provider->name(), $model), - ); + ))->withRawResponse($response); } /** diff --git a/src/ai/src/PendingResponses/PendingEmbeddingsGeneration.php b/src/ai/src/PendingResponses/PendingEmbeddingsGeneration.php index fb1bee7e87..580d50d075 100644 --- a/src/ai/src/PendingResponses/PendingEmbeddingsGeneration.php +++ b/src/ai/src/PendingResponses/PendingEmbeddingsGeneration.php @@ -236,7 +236,8 @@ protected function generateWithIndividualCaching(EmbeddingProvider $provider, st ksort($embeddings); - return new EmbeddingsResponse(array_values($embeddings), $response->usage, $response->meta); + return (new EmbeddingsResponse(array_values($embeddings), $response->usage, $response->meta)) + ->withRawResponse($response->raw); } /** diff --git a/src/ai/src/Responses/EmbeddingsResponse.php b/src/ai/src/Responses/EmbeddingsResponse.php index 6676be035e..42a8ab4745 100644 --- a/src/ai/src/Responses/EmbeddingsResponse.php +++ b/src/ai/src/Responses/EmbeddingsResponse.php @@ -5,6 +5,7 @@ namespace Hypervel\Ai\Responses; use Countable; +use Hypervel\Ai\Responses\Concerns\HasRawResponse; use Hypervel\Ai\Responses\Data\Meta; use Hypervel\Ai\Responses\Data\Usage; use Hypervel\Contracts\Support\Arrayable; @@ -14,6 +15,8 @@ class EmbeddingsResponse implements Arrayable, Countable, IteratorAggregate, JsonSerializable { + use HasRawResponse; + /** * Create a new embeddings response instance. * diff --git a/src/ai/src/Responses/ImageResponse.php b/src/ai/src/Responses/ImageResponse.php index 9cbf197879..4e31acba39 100644 --- a/src/ai/src/Responses/ImageResponse.php +++ b/src/ai/src/Responses/ImageResponse.php @@ -5,6 +5,7 @@ namespace Hypervel\Ai\Responses; use Countable; +use Hypervel\Ai\Responses\Concerns\HasRawResponse; use Hypervel\Ai\Responses\Data\GeneratedImage; use Hypervel\Ai\Responses\Data\ImageUsage; use Hypervel\Ai\Responses\Data\Meta; @@ -16,6 +17,8 @@ class ImageResponse implements Stringable, Countable, Htmlable { + use HasRawResponse; + /** * Create an image response. * diff --git a/src/ai/src/Responses/RerankingResponse.php b/src/ai/src/Responses/RerankingResponse.php index 8345d00732..1fddf54603 100644 --- a/src/ai/src/Responses/RerankingResponse.php +++ b/src/ai/src/Responses/RerankingResponse.php @@ -5,6 +5,7 @@ namespace Hypervel\Ai\Responses; use Countable; +use Hypervel\Ai\Responses\Concerns\HasRawResponse; use Hypervel\Ai\Responses\Data\Meta; use Hypervel\Ai\Responses\Data\RankedDocument; use Hypervel\Ai\Responses\Data\RerankingUsage; @@ -16,6 +17,8 @@ class RerankingResponse implements Arrayable, Countable, IteratorAggregate, JsonSerializable { + use HasRawResponse; + /** * Create a new reranking response instance. * diff --git a/src/ai/src/Responses/TranscriptionResponse.php b/src/ai/src/Responses/TranscriptionResponse.php index ef974f4ddb..093d5c21d9 100644 --- a/src/ai/src/Responses/TranscriptionResponse.php +++ b/src/ai/src/Responses/TranscriptionResponse.php @@ -4,6 +4,7 @@ namespace Hypervel\Ai\Responses; +use Hypervel\Ai\Responses\Concerns\HasRawResponse; use Hypervel\Ai\Responses\Data\Meta; use Hypervel\Ai\Responses\Data\TranscriptionSegment; use Hypervel\Ai\Responses\Data\TranscriptionUsage; @@ -12,6 +13,8 @@ class TranscriptionResponse implements Stringable { + use HasRawResponse; + public string $text; /** @var Collection */ diff --git a/tests/Ai/Feature/EmbeddingsCacheTest.php b/tests/Ai/Feature/EmbeddingsCacheTest.php index 0e2dc7de07..4f328f7b5f 100644 --- a/tests/Ai/Feature/EmbeddingsCacheTest.php +++ b/tests/Ai/Feature/EmbeddingsCacheTest.php @@ -20,6 +20,7 @@ use Hypervel\Context\CoroutineContext; use Hypervel\Contracts\Foundation\Application; use Hypervel\Http\Client\Request; +use Hypervel\Http\Client\Response; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\TestCase; use Mockery as m; @@ -68,6 +69,19 @@ public function testCacheIsUsedWhenEnabledExplicitly(): void $this->assertCount(1, Http::recorded()); } + #[DataProvider('cacheModes')] + public function testOnlyFreshlyGeneratedEmbeddingsExposeARawResponse(bool $individually): void + { + $fresh = Embeddings::for(['a'])->cache(3600, individually: $individually)->generate(provider: 'cohere', model: 'embed-v4.0'); + $partial = Embeddings::for(['b', 'a'])->cache(3600, individually: $individually)->generate(provider: 'cohere', model: 'embed-v4.0'); + $cached = Embeddings::for(['b', 'a'])->cache(3600, individually: $individually)->generate(provider: 'cohere', model: 'embed-v4.0'); + + $this->assertInstanceOf(Response::class, $fresh->raw); + $this->assertInstanceOf(Response::class, $partial->raw); + $this->assertSame($individually ? 1 : 2, $partial->raw->json('meta.billed_units.input_tokens')); + $this->assertNull($cached->raw); + } + public function testCacheIsUsedWhenEnabledGloballyViaConfig(): void { config(['ai.caching.embeddings.cache' => true]); diff --git a/tests/Ai/Feature/Providers/Cohere/RerankingTest.php b/tests/Ai/Feature/Providers/Cohere/RerankingTest.php index ad2345f2f7..977959cd4e 100644 --- a/tests/Ai/Feature/Providers/Cohere/RerankingTest.php +++ b/tests/Ai/Feature/Providers/Cohere/RerankingTest.php @@ -16,6 +16,7 @@ use Hypervel\Http\Client\PendingRequest; use Hypervel\Http\Client\Request; use Hypervel\Http\Client\RequestException; +use Hypervel\Http\Client\Response; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\TestCase; use PHPUnit\Framework\Attributes\DataProvider; @@ -82,6 +83,8 @@ public function testRerankingResponseIsCorrectlyParsedIntoRankedDocuments(): voi $this->assertSame(0.95, $response->first()->score); $this->assertSame('cohere', $response->meta->provider); $this->assertSame('rerank-v3.5', $response->meta->model); + $this->assertInstanceOf(Response::class, $response->raw); + $this->assertSame(0.95, $response->raw->json('results.0.relevance_score')); } public function testRerankingRequestSendsBearerToken(): void diff --git a/tests/Ai/Feature/Providers/Jina/RerankingTest.php b/tests/Ai/Feature/Providers/Jina/RerankingTest.php index f41291cde1..9f2af33d12 100644 --- a/tests/Ai/Feature/Providers/Jina/RerankingTest.php +++ b/tests/Ai/Feature/Providers/Jina/RerankingTest.php @@ -12,6 +12,7 @@ use Hypervel\Contracts\Foundation\Application; use Hypervel\Http\Client\Request; use Hypervel\Http\Client\RequestException; +use Hypervel\Http\Client\Response; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\TestCase; use PHPUnit\Framework\Attributes\DataProvider; @@ -78,6 +79,8 @@ public function testRerankingResponseIsCorrectlyParsedIntoRankedDocuments(): voi $this->assertSame(0.95, $response->first()->score); $this->assertSame('jina', $response->meta->provider); $this->assertSame('jina-reranker-v3', $response->meta->model); + $this->assertInstanceOf(Response::class, $response->raw); + $this->assertSame(25, $response->raw->json('usage.total_tokens')); } public function testRerankingRequestSendsBearerToken(): void diff --git a/tests/Ai/Feature/Providers/OpenAi/EmbeddingTest.php b/tests/Ai/Feature/Providers/OpenAi/EmbeddingTest.php index c1c6d2085e..54b93db1f0 100644 --- a/tests/Ai/Feature/Providers/OpenAi/EmbeddingTest.php +++ b/tests/Ai/Feature/Providers/OpenAi/EmbeddingTest.php @@ -11,6 +11,7 @@ use Hypervel\Contracts\Foundation\Application; use Hypervel\Http\Client\Request; use Hypervel\Http\Client\RequestException; +use Hypervel\Http\Client\Response; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\TestCase; @@ -53,6 +54,16 @@ public function testEmbeddingsResponseIsCorrectlyParsed(): void $this->assertSame('text-embedding-3-small', $response->meta->model); } + public function testEmbeddingsExposeTheRawHttpResponse(): void + { + Http::fake(['*' => $this->fakeOpenAiEmbeddingResponse()]); + + $response = Embeddings::for(['Hello world'])->generate(provider: 'openai', model: 'text-embedding-3-small'); + + $this->assertInstanceOf(Response::class, $response->raw); + $this->assertSame(10, $response->raw->json('usage.prompt_tokens')); + } + public function testMultipleInputsReturnMultipleEmbeddings(): void { Http::fake(['*' => Http::response([ diff --git a/tests/Ai/Feature/Providers/OpenAi/ImageGenerationTest.php b/tests/Ai/Feature/Providers/OpenAi/ImageGenerationTest.php index 62cb8ffc46..901162533e 100644 --- a/tests/Ai/Feature/Providers/OpenAi/ImageGenerationTest.php +++ b/tests/Ai/Feature/Providers/OpenAi/ImageGenerationTest.php @@ -11,6 +11,7 @@ use Hypervel\Contracts\Foundation\Application; use Hypervel\Http\Client\Request; use Hypervel\Http\Client\RequestException; +use Hypervel\Http\Client\Response; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\TestCase; @@ -24,6 +25,16 @@ protected function defineEnvironment(Application $app): void $app->make('config')->set('ai.providers.openai.key', 'test-key'); } + public function testTheRawHttpResponseIsExposedOnTheImageResponse(): void + { + Http::fake(['*' => fakeOpenAiImageResponse()]); + + $response = Image::of('A red apple')->generate(provider: 'openai', model: 'gpt-image-1'); + + $this->assertInstanceOf(Response::class, $response->raw); + $this->assertSame(base64_encode('fake-image'), $response->raw->json('data.0.b64_json')); + } + public function testImageRequestDoesNotIncludeQualityWhenNotSpecified(): void { Http::fake([ diff --git a/tests/Ai/Feature/Providers/OpenAi/TranscriptionTest.php b/tests/Ai/Feature/Providers/OpenAi/TranscriptionTest.php index 68f7435dff..67c50ebaed 100644 --- a/tests/Ai/Feature/Providers/OpenAi/TranscriptionTest.php +++ b/tests/Ai/Feature/Providers/OpenAi/TranscriptionTest.php @@ -11,6 +11,7 @@ use Hypervel\Contracts\Foundation\Application; use Hypervel\Http\Client\Request; use Hypervel\Http\Client\RequestException; +use Hypervel\Http\Client\Response; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\TestCase; use LogicException; @@ -112,6 +113,17 @@ public function testTranscriptionUsageIsCorrectlyParsed(): void $this->assertSame(50, $response->usage->outputTokens); } + public function testTheRawHttpResponseIsExposedOnTheTranscriptionResponse(): void + { + Http::fake(['*' => fakeOpenAiTranscriptionResponse()]); + + $response = Transcription::fromBase64(base64_encode('fake-audio'), 'audio/mp3') + ->generate(provider: 'openai'); + + $this->assertInstanceOf(Response::class, $response->raw); + $this->assertSame('Hello, world!', $response->raw->json('text')); + } + public function testTranscriptionSendsLanguageWhenProvided(): void { Http::fake(['*' => fakeOpenAiTranscriptionResponse()]); diff --git a/tests/Ai/Feature/Providers/OpenRouter/EmbeddingsTest.php b/tests/Ai/Feature/Providers/OpenRouter/EmbeddingsTest.php index c67effda97..1f90fc4a9e 100644 --- a/tests/Ai/Feature/Providers/OpenRouter/EmbeddingsTest.php +++ b/tests/Ai/Feature/Providers/OpenRouter/EmbeddingsTest.php @@ -69,6 +69,19 @@ public function testEmbeddingsResponseIsCorrectlyParsed(bool $shuffled): void $this->assertSame(10, $response->usage->inputTokens); } + public function testEmbeddingsExposeProviderSpecificUsageFromTheRawResponse(): void + { + Http::fake(['*' => Http::response([ + 'object' => 'list', + 'data' => [['object' => 'embedding', 'index' => 0, 'embedding' => [0.1]]], + 'usage' => ['prompt_tokens' => 1, 'cost' => 0.000013], + ])]); + + $response = Ai::instance('openrouter')->embeddings(['Hello']); + + $this->assertSame(0.000013, $response->raw->json('usage.cost')); + } + public function testEmbeddingsRequestSendsBearerToken(): void { Http::fake(['*' => Http::response([ diff --git a/tests/Ai/Feature/Providers/OpenRouter/ImageGenerationTest.php b/tests/Ai/Feature/Providers/OpenRouter/ImageGenerationTest.php index 6275c54fad..75c194d62e 100644 --- a/tests/Ai/Feature/Providers/OpenRouter/ImageGenerationTest.php +++ b/tests/Ai/Feature/Providers/OpenRouter/ImageGenerationTest.php @@ -41,10 +41,20 @@ protected function fakeOpenRouterImageResponse(string $mimeType = 'image/png', s 'usage' => [ 'prompt_tokens' => 10, 'completion_tokens' => 20, + 'cost' => 0.04, ], ]); } + public function testTheRawHttpResponseExposesProviderSpecificImageUsage(): void + { + Http::fake(['openrouter.ai/*' => $this->fakeOpenRouterImageResponse()]); + + $response = Image::of('A blue circle')->generate(provider: 'openrouter', model: 'black-forest-labs/flux.2-pro'); + + $this->assertSame(0.04, $response->raw->json('usage.cost')); + } + public function testImageRequestIsSentToTheImagesEndpointWithModelAndPrompt(): void { Http::fake(['openrouter.ai/*' => $this->fakeOpenRouterImageResponse()]); diff --git a/tests/Ai/Feature/Providers/OpenRouter/RerankingTest.php b/tests/Ai/Feature/Providers/OpenRouter/RerankingTest.php index 8fe6b65599..46397c6e4a 100644 --- a/tests/Ai/Feature/Providers/OpenRouter/RerankingTest.php +++ b/tests/Ai/Feature/Providers/OpenRouter/RerankingTest.php @@ -10,6 +10,7 @@ use Hypervel\Ai\Reranking; use Hypervel\Contracts\Foundation\Application; use Hypervel\Http\Client\Request; +use Hypervel\Http\Client\Response; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\TestCase; use PHPUnit\Framework\Attributes\DataProvider; @@ -131,12 +132,14 @@ public function testRerankingResponseReportsTheTotalTokensAndSearchUnits(): void { Http::fake(['*' => Http::response([ 'results' => [['index' => 0, 'relevance_score' => 0.95]], - 'usage' => ['total_tokens' => 320, 'search_units' => 1], + 'usage' => ['total_tokens' => 320, 'search_units' => 1, 'cost' => 0.001], ])]); $response = Reranking::of(['Doc A'])->rerank('query', provider: 'openrouter', model: 'cohere/rerank-v3.5'); $this->assertSame(320, $response->usage->inputTokens); $this->assertSame(1.0, $response->usage->searchUnits); + $this->assertInstanceOf(Response::class, $response->raw); + $this->assertSame(0.001, $response->raw->json('usage.cost')); } } diff --git a/tests/Ai/Feature/Providers/OpenRouter/TranscriptionTest.php b/tests/Ai/Feature/Providers/OpenRouter/TranscriptionTest.php index 059902ce1f..1d8ed247c9 100644 --- a/tests/Ai/Feature/Providers/OpenRouter/TranscriptionTest.php +++ b/tests/Ai/Feature/Providers/OpenRouter/TranscriptionTest.php @@ -192,6 +192,15 @@ public function testTranscriptionResponseTextIsCorrectlyParsed(): void $this->assertSame('openai/gpt-transcribe', $response->meta->model); } + public function testTheRawTranscriptionResponseExposesProviderSpecificUsage(): void + { + Http::fake(['*' => fakeOpenRouterTranscriptionResponse()]); + + $response = Transcription::fromBase64(base64_encode('fake-audio'), 'audio/mp3')->generate(provider: 'openrouter'); + + $this->assertSame(0.000100, $response->raw->json('usage.cost')); + } + public function testTranscriptionUsageIsCorrectlyParsed(): void { Http::fake(['*' => Http::response([ diff --git a/tests/Ai/Feature/Providers/VoyageAi/RerankingTest.php b/tests/Ai/Feature/Providers/VoyageAi/RerankingTest.php index 8397a657dd..cd868a0341 100644 --- a/tests/Ai/Feature/Providers/VoyageAi/RerankingTest.php +++ b/tests/Ai/Feature/Providers/VoyageAi/RerankingTest.php @@ -12,6 +12,7 @@ use Hypervel\Contracts\Foundation\Application; use Hypervel\Http\Client\Request; use Hypervel\Http\Client\RequestException; +use Hypervel\Http\Client\Response; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\TestCase; use PHPUnit\Framework\Attributes\DataProvider; @@ -78,6 +79,8 @@ public function testRerankingResponseIsCorrectlyParsedIntoRankedDocuments(): voi $this->assertSame(0.95, $response->first()->score); $this->assertSame('voyageai', $response->meta->provider); $this->assertSame('rerank-2.5-lite', $response->meta->model); + $this->assertInstanceOf(Response::class, $response->raw); + $this->assertSame(25, $response->raw->json('usage.total_tokens')); } public function testRerankingRequestSendsBearerToken(): void diff --git a/tests/Ai/Feature/ResponseSerializationTest.php b/tests/Ai/Feature/ResponseSerializationTest.php index a6b2cd0a70..4b591fda0a 100644 --- a/tests/Ai/Feature/ResponseSerializationTest.php +++ b/tests/Ai/Feature/ResponseSerializationTest.php @@ -8,8 +8,19 @@ use Hypervel\Ai\Responses\ClassificationResponse; use Hypervel\Ai\Responses\Data\BooleanAnswer; use Hypervel\Ai\Responses\Data\FinishReason; +use Hypervel\Ai\Responses\Data\GeneratedImage; +use Hypervel\Ai\Responses\Data\ImageUsage; use Hypervel\Ai\Responses\Data\Meta; +use Hypervel\Ai\Responses\Data\RankedDocument; +use Hypervel\Ai\Responses\Data\RerankingUsage; use Hypervel\Ai\Responses\Data\TextUsage; +use Hypervel\Ai\Responses\Data\TranscriptionSegment; +use Hypervel\Ai\Responses\Data\TranscriptionUsage; +use Hypervel\Ai\Responses\Data\Usage; +use Hypervel\Ai\Responses\EmbeddingsResponse; +use Hypervel\Ai\Responses\ImageResponse; +use Hypervel\Ai\Responses\RerankingResponse; +use Hypervel\Ai\Responses\TranscriptionResponse; use Hypervel\Http\Client\Response; use Hypervel\Tests\Ai\Fixtures\Responses\SubclassedStep; use Hypervel\Tests\Ai\Fixtures\Responses\SubclassedTextResponse; @@ -55,4 +66,79 @@ public function testSerializationPreservesClassificationAnswersAndDropsTheRawRes $this->assertSame('gpt-6-luna', $restored->meta->model); $this->assertNull($restored->raw); } + + public function testSerializationPreservesEmbeddingsAndDropsTheRawResponse(): void + { + $response = (new EmbeddingsResponse([[0.1, 0.2], [0.3, 0.4]], new Usage(10), new Meta('openai', 'text-embedding-3-small'))) + ->withRawResponse(new Response(new Psr7Response(200, [], '{}'))); + + $restored = unserialize(serialize($response)); + + $this->assertSame([[0.1, 0.2], [0.3, 0.4]], $restored->embeddings); + $this->assertSame(10, $restored->usage->inputTokens); + $this->assertSame('openai', $restored->meta->provider); + $this->assertSame('text-embedding-3-small', $restored->meta->model); + $this->assertNull($restored->raw); + } + + public function testSerializationPreservesTranscriptionDataAndDropsTheRawResponse(): void + { + $response = (new TranscriptionResponse( + 'Hello, world!', + collect([new TranscriptionSegment('Hello, world!', 'Speaker 1', 1.5, 3.25)]), + new TranscriptionUsage(10, 4, audioSeconds: 3.25), + new Meta('openai', 'gpt-4o-transcribe'), + ))->withRawResponse(new Response(new Psr7Response(200, [], '{}'))); + + $restored = unserialize(serialize($response)); + + $this->assertSame('Hello, world!', $restored->text); + $this->assertSame([ + ['text' => 'Hello, world!', 'speaker' => 'Speaker 1', 'start_seconds' => 1.5, 'end_seconds' => 3.25], + ], $restored->segments->toArray()); + $this->assertSame(10, $restored->usage->inputTokens); + $this->assertSame(4, $restored->usage->outputTokens); + $this->assertSame(3.25, $restored->usage->audioSeconds); + $this->assertSame('openai', $restored->meta->provider); + $this->assertSame('gpt-4o-transcribe', $restored->meta->model); + $this->assertNull($restored->raw); + } + + public function testSerializationPreservesImageDataAndDropsTheRawResponse(): void + { + $response = (new ImageResponse( + collect([new GeneratedImage(base64_encode('image-content'), 'image/webp')]), + new ImageUsage(41, 1024, imageOutputTokens: 1000), + new Meta('openai', 'gpt-image-1'), + ))->withRawResponse(new Response(new Psr7Response(200, [], '{}'))); + + $restored = unserialize(serialize($response)); + + $this->assertCount(1, $restored->images); + $this->assertSame('image-content', $restored->firstImage()->content()); + $this->assertSame('image/webp', $restored->firstImage()->mime()); + $this->assertSame(41, $restored->usage->inputTokens); + $this->assertSame(1024, $restored->usage->outputTokens); + $this->assertSame(1000, $restored->usage->imageOutputTokens); + $this->assertSame('openai', $restored->meta->provider); + $this->assertSame('gpt-image-1', $restored->meta->model); + $this->assertNull($restored->raw); + } + + public function testSerializationPreservesRerankingDataAndDropsTheRawResponse(): void + { + $response = (new RerankingResponse( + [new RankedDocument(1, 'Hypervel is a PHP framework', 0.95), new RankedDocument(0, 'React is a JS library', 0.12)], + new RerankingUsage(320, 2.0), + new Meta('cohere', 'rerank-v3.5'), + ))->withRawResponse(new Response(new Psr7Response(200, [], '{}'))); + + $restored = unserialize(serialize($response)); + + $this->assertInstanceOf(RerankingResponse::class, $restored); + $this->assertEquals($response->results, $restored->results); + $this->assertEquals(new RerankingUsage(320, 2.0), $restored->usage); + $this->assertEquals(new Meta('cohere', 'rerank-v3.5'), $restored->meta); + $this->assertNull($restored->raw); + } } From 5751a506c83120fa164afb1f076dde0991e5bee5 Mon Sep 17 00:00:00 2001 From: Raj Siva-Rajah <5361908+binaryfire@users.noreply.github.com> Date: Tue, 3 Nov 2026 18:27:54 +0000 Subject: [PATCH 02/16] Accept array criteria on boolean questions sent to OpenAI Boolean questions accept array instructions, but an array criterion was interpolated into the OpenAI decision prompt as "Array" with a conversion warning. predicateInstructions() now passes each criterion through toText(), so arrays are sent as JSON text, and the Boolean docblock allows array criteria. Port of laravel/ai#1202 at c8495608a1. Ported the OpenAI ClassificationTest array-criteria test and the integration testBooleanCriteriaMayBeGivenAsArrays cases. The docs already allow array criteria. The OpenAI ClassificationTest file passes. --- src/ai/src/Classification/Boolean.php | 2 +- .../OpenAi/OpenAiClassificationGateway.php | 2 +- .../Providers/OpenAi/ClassificationTest.php | 15 +++++++++++ tests/Integration/Ai/ClassificationTest.php | 25 +++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/ai/src/Classification/Boolean.php b/src/ai/src/Classification/Boolean.php index a3db06e989..f9024f02d2 100644 --- a/src/ai/src/Classification/Boolean.php +++ b/src/ai/src/Classification/Boolean.php @@ -13,7 +13,7 @@ * Create a new yes / no question whose answer is the probability of "true". * * @param array|string $instructions - * @param null|array{true?: string, false?: string} $criteria descriptions of what a yes and a no mean + * @param null|array{true?: array|string, false?: array|string} $criteria descriptions of what a yes and a no mean * * @throws InvalidArgumentException if the criteria describe anything but the true and false cases */ diff --git a/src/ai/src/Gateway/OpenAi/OpenAiClassificationGateway.php b/src/ai/src/Gateway/OpenAi/OpenAiClassificationGateway.php index 4748b47a2f..96745d4812 100644 --- a/src/ai/src/Gateway/OpenAi/OpenAiClassificationGateway.php +++ b/src/ai/src/Gateway/OpenAi/OpenAiClassificationGateway.php @@ -190,7 +190,7 @@ protected function predicateInstructions(Boolean $question): string $instructions = $this->toText($question->instructions); foreach ($question->criteria ?? [] as $case => $description) { - $instructions .= "\n\n" . ucfirst($case) . ": {$description}"; + $instructions .= "\n\n" . ucfirst($case) . ': ' . $this->toText($description); } return $instructions; diff --git a/tests/Ai/Feature/Providers/OpenAi/ClassificationTest.php b/tests/Ai/Feature/Providers/OpenAi/ClassificationTest.php index 541b45377b..3fccb2938d 100644 --- a/tests/Ai/Feature/Providers/OpenAi/ClassificationTest.php +++ b/tests/Ai/Feature/Providers/OpenAi/ClassificationTest.php @@ -68,6 +68,21 @@ public function testClassificationPostsQuestionsToTheDecisionsEndpointInTheOpenA }); } + public function testBooleanCriteriaGivenAsArraysAreSentAsJsonText(): void + { + Http::fake(['*' => Http::response($this->fakeOpenAiDecisionsResponse())]); + + Classification::of('I was charged twice for my order.') + ->question('is_urgent', new Boolean('Is this urgent?', [ + 'true' => ['Money was lost.', 'The customer is blocked.'], + 'false' => 'A question only.', + ])) + ->classify(provider: 'openai'); + + Http::assertSent(fn (Request $request): bool => json_decode($request->body(), true)['questions'][0]['instructions'] + === "Is this urgent?\n\nTrue: [\"Money was lost.\",\"The customer is blocked.\"]\n\nFalse: A question only."); + } + public function testTheRawDecisionsResponseIsExposedOnTheClassificationResponse(): void { Http::fake(['*' => Http::response($this->fakeOpenAiDecisionsResponse())]); diff --git a/tests/Integration/Ai/ClassificationTest.php b/tests/Integration/Ai/ClassificationTest.php index d852de196f..eb377d53fe 100644 --- a/tests/Integration/Ai/ClassificationTest.php +++ b/tests/Integration/Ai/ClassificationTest.php @@ -54,6 +54,31 @@ public function testStatesCanBeClassified(string $provider, string $apiKey): voi Event::assertDispatched(Classified::class); } + #[DataProvider('urgencyCases')] + public function testBooleanCriteriaMayBeGivenAsArrays(string $provider, string $apiKey, string $state, bool $urgent): void + { + requiresApiKey($apiKey); + + $response = Classification::of($state) + ->question('is_urgent', new Boolean('Is this urgent?', [ + 'true' => ['Money was lost.', 'The customer is blocked.'], + 'false' => ['A question only.', 'Nothing is broken.'], + ]))->classify(provider: $provider); + + $this->assertSame($urgent, $response['is_urgent']->isTrue()); + } + + /** + * Provide each classification service with an urgent and a non-urgent state. + */ + public static function urgencyCases(): iterable + { + foreach (Providers::classification() as $name => $provider) { + yield $name . '-urgent' => [...$provider, 'I was charged twice for my order and now I cannot check out at all.', true]; + yield $name . '-not-urgent' => [...$provider, 'Out of curiosity, do you offer gift wrapping?', false]; + } + } + #[DataProvider('imageProviders')] public function testImagesCanBeClassifiedAlongsideTheState(string $provider, string $apiKey, string $file, string $color): void { From e81bab513fb1fcf4cbd87da4001a7a64301a25b7 Mon Sep 17 00:00:00 2001 From: Raj Siva-Rajah <5361908+binaryfire@users.noreply.github.com> Date: Tue, 3 Nov 2026 18:28:18 +0000 Subject: [PATCH 03/16] Recover from tool failures, resume faked approvals and fix streamed turn text These upstream changes share the text generation loop, the Anthropic stream, the conversation store, src/docs/ai-sdk.md and their tests, so they land together. Ported from laravel/ai at c8495608a1. laravel/ai#1162: a streamed turn that paused for approval lost its pre-pause text on resume. Ported TextDelta::join(). Unlike upstream, resumePausedRow() joins the resumed text to the paused content instead of rejoining every stored step. Rejoining split a continuation without tools, such as a pause_turn, that the stream had shown as one paragraph. Prompted resumes are unchanged. Ported the prompted/streamed resume cases and the double-pause test, and added a regression test for a continued step. laravel/ai#1190: agent fakes can resume tool approvals, so approved tools run and rejected tools get a denied result before the next faked response. Ported pausedForApproval(), resumesApproval() and the upstream resumableApprovalFor()/approvalResultRecorderFor() signatures. Hypervel records approvals through the claiming store, so prepareRunContext() attaches it with RunContext::withApprovalStore() only for resumed approvals. runContextFor() keeps its upstream signature, and the store and conversation ID leave the RunContext constructor. Ported the six AgentFakeTest resume tests and their fixture. laravel/ai#1188: Anthropic messages that end with end_turn but contain tool calls now run those calls. Bedrock Converse can do the same, so its buffered and streamed paths get the same fix. Ported the Anthropic streaming and tool-loop tests and added the Bedrock equivalents. laravel/ai#1191: a tool that throws no longer fails the run. The exception is reported and the model receives a failed tool result; listener exceptions still fail the run. Unlike upstream, cancellation is not wrapped in ToolExecutionException, so it is never recovered as the tool's own failure. Ported ToolFailureRecoveryTest and the event, failed-turn, InvokesTools and integration test updates. laravel/ai#1186: streamed text joins across Anthropic pause_turn continuations, starting a new paragraph only after a step that ran tools. StreamedAgentResponse's single pass follows the same rule. Ported the pause_turn streaming tests and the TextDelta test updates. laravel/ai#1203: conversation title generation runs as its own agent run with the turn's parentInvocationId, so agent events report it. A failed title run still falls back to the prompt. Ported the five title-event tests and the step-attribution update. ai-sdk.md also gains the raw-response types from laravel/ai#1181, laravel/ai#1180, laravel/ai#1179 and laravel/ai#1182, and the concurrent-tools failure sentence is corrected. tests/Ai passes, and composer analyse is clean. --- .../src/Exceptions/ToolExecutionException.php | 21 ++ .../Gateway/Anthropic/AnthropicGateway.php | 1 + .../Concerns/HandlesTextStreaming.php | 35 ++++ .../Concerns/ParsesTextResponses.php | 5 + .../Gateway/Bedrock/BedrockTextGateway.php | 10 + src/ai/src/Gateway/Concerns/InvokesTools.php | 5 +- src/ai/src/Gateway/RunContext.php | 19 +- src/ai/src/Gateway/TextGenerationLoop.php | 63 ++++-- .../src/Middleware/RememberConversation.php | 25 ++- .../src/Providers/Concerns/GeneratesText.php | 45 +++-- .../Concerns/ResumesToolApprovals.php | 34 +++- src/ai/src/Providers/Concerns/StreamsText.php | 6 +- .../src/Responses/StreamedAgentResponse.php | 16 +- .../src/Storage/DatabaseConversationStore.php | 14 +- src/ai/src/Streaming/Events/TextDelta.php | 26 +-- src/docs/ai-sdk.md | 10 +- tests/Ai/ConcurrentToolsTest.php | 12 +- tests/Ai/Feature/AgentEventsTest.php | 132 ++++++++++++- tests/Ai/Feature/AgentFakeTest.php | 186 ++++++++++++++++++ tests/Ai/Feature/AgentPromptTest.php | 2 +- tests/Ai/Feature/FailedTurnRecordingTest.php | 6 + .../Providers/Anthropic/StreamingTest.php | 179 +++++++++++++++++ .../Providers/Anthropic/ToolCallLoopTest.php | 51 +++++ .../Providers/Bedrock/StreamingTest.php | 39 ++++ .../Providers/Bedrock/ToolCallLoopTest.php | 39 ++++ tests/Ai/Feature/RememberConversationTest.php | 12 +- .../Storage/DatabaseConversationStoreTest.php | 106 +++++++++- tests/Ai/Feature/ToolFailureRecoveryTest.php | 97 +++++++++ .../RememberingUngatedApprovableAgent.php | 34 ++++ .../Ai/Fixtures/Agents/ThrowingToolAgent.php | 31 +++ tests/Ai/PartitionStoreTest.php | 2 +- tests/Ai/Unit/Gateway/InvokesToolsTest.php | 8 +- .../Unit/Gateway/TextGenerationLoopTest.php | 6 +- .../Responses/StreamedAgentResponseTest.php | 18 ++ tests/Ai/Unit/Streaming/TextDeltaTest.php | 22 +++ tests/Integration/Ai/AgentTest.php | 17 +- 36 files changed, 1221 insertions(+), 113 deletions(-) create mode 100644 src/ai/src/Exceptions/ToolExecutionException.php create mode 100644 tests/Ai/Feature/ToolFailureRecoveryTest.php create mode 100644 tests/Ai/Fixtures/Agents/RememberingUngatedApprovableAgent.php create mode 100644 tests/Ai/Fixtures/Agents/ThrowingToolAgent.php diff --git a/src/ai/src/Exceptions/ToolExecutionException.php b/src/ai/src/Exceptions/ToolExecutionException.php new file mode 100644 index 0000000000..89966ab5a6 --- /dev/null +++ b/src/ai/src/Exceptions/ToolExecutionException.php @@ -0,0 +1,21 @@ +getMessage(), previous: $exception); + } +} diff --git a/src/ai/src/Gateway/Anthropic/AnthropicGateway.php b/src/ai/src/Gateway/Anthropic/AnthropicGateway.php index af2a990f06..2c417f4623 100644 --- a/src/ai/src/Gateway/Anthropic/AnthropicGateway.php +++ b/src/ai/src/Gateway/Anthropic/AnthropicGateway.php @@ -129,6 +129,7 @@ public function generateStreamStep( $provider, $model, $response->getBody(), + $this->pausedContent($messages), ); } diff --git a/src/ai/src/Gateway/Anthropic/Concerns/HandlesTextStreaming.php b/src/ai/src/Gateway/Anthropic/Concerns/HandlesTextStreaming.php index 74b1a903cf..4b7f7a7711 100644 --- a/src/ai/src/Gateway/Anthropic/Concerns/HandlesTextStreaming.php +++ b/src/ai/src/Gateway/Anthropic/Concerns/HandlesTextStreaming.php @@ -5,6 +5,8 @@ namespace Hypervel\Ai\Gateway\Anthropic\Concerns; use Generator; +use Hypervel\Ai\Messages\AssistantMessage; +use Hypervel\Ai\Messages\Message; use Hypervel\Ai\Providers\Provider; use Hypervel\Ai\Responses\Data\TextUsage; use Hypervel\Ai\Responses\Data\ToolCall; @@ -21,19 +23,40 @@ use Hypervel\Ai\Streaming\Events\TextEnd; use Hypervel\Ai\Streaming\Events\TextStart; use Hypervel\Ai\Streaming\Events\ToolCall as ToolCallEvent; +use Hypervel\Support\Collection; use Hypervel\Support\Str; use Psr\Http\Message\StreamInterface; trait HandlesTextStreaming { + /** + * Get the content of the paused steps the turn being continued is made of. + * + * @param array $messages + * @return array> + */ + protected function pausedContent(array $messages): array + { + /** @var Collection $paused */ + $paused = collect($messages) + ->reverse() + ->takeWhile(fn (Message $message): bool => $message instanceof AssistantMessage) + ->reverse(); + + return $paused->flatMap(fn (AssistantMessage $message): array => $message->replayBlocks)->all(); + } + /** * Process a single Anthropic streaming turn and yield Hypervel stream events. + * + * @param array> $pausedContent */ protected function processTextStream( string $invocationId, Provider $provider, string $model, StreamInterface $streamBody, + array $pausedContent = [], ): Generator { $messageId = $this->generateEventId(); $reasoningId = ''; @@ -53,6 +76,18 @@ protected function processTextStream( $afterTool = false; $lastTextDelta = ''; + // A turn resumed after pause_turn picks up where the paused content ended... + foreach ($pausedContent as $block) { + $blockType = $block['type'] ?? ''; + + if ($blockType === 'text' && ($block['text'] ?? '') !== '') { + $lastTextDelta = (string) $block['text']; + $afterTool = false; + } elseif ($this->isToolBlock($blockType)) { + $afterTool = true; + } + } + $messageUsage = []; $usage = null; $stopReason = ''; diff --git a/src/ai/src/Gateway/Anthropic/Concerns/ParsesTextResponses.php b/src/ai/src/Gateway/Anthropic/Concerns/ParsesTextResponses.php index 4e39170f33..245244d154 100644 --- a/src/ai/src/Gateway/Anthropic/Concerns/ParsesTextResponses.php +++ b/src/ai/src/Gateway/Anthropic/Concerns/ParsesTextResponses.php @@ -89,6 +89,11 @@ protected function buildStepResponse( $finishReason = FinishReason::Stop; } + // Claude can end a message holding tool_use blocks with end_turn, so the tool calls still need to run. + if ($finishReason === FinishReason::Stop && $realToolCalls !== []) { + $finishReason = FinishReason::ToolCalls; + } + return new StepResponse( text: $hasStructuredToolCall && ! empty($structuredData) ? (json_encode($structuredData) ?: '') : $text, toolCalls: $realToolCalls, diff --git a/src/ai/src/Gateway/Bedrock/BedrockTextGateway.php b/src/ai/src/Gateway/Bedrock/BedrockTextGateway.php index 1c174efa58..14037f6f41 100644 --- a/src/ai/src/Gateway/Bedrock/BedrockTextGateway.php +++ b/src/ai/src/Gateway/Bedrock/BedrockTextGateway.php @@ -260,6 +260,11 @@ protected function parseTextResponse(array $result, TextProvider $provider, stri $finishReason = FinishReason::Stop; } + // Like the Anthropic API, Converse can end a message holding toolUse blocks with end_turn, so the tool calls still need to run. + if ($finishReason === FinishReason::Stop && $toolCalls !== []) { + $finishReason = FinishReason::ToolCalls; + } + return new StepResponse( text: $structuredOutput ?? $output, toolCalls: $toolCalls, @@ -564,6 +569,11 @@ protected function processTextStream( $finishReason = FinishReason::Stop; } + // Like the Anthropic API, Converse can end a message holding toolUse blocks with end_turn, so the tool calls still need to run. + if ($finishReason === FinishReason::Stop && $toolCalls !== []) { + $finishReason = FinishReason::ToolCalls; + } + $replayBlocks = array_values($responseContent); if (! $hasReasoningBlocks) { diff --git a/src/ai/src/Gateway/Concerns/InvokesTools.php b/src/ai/src/Gateway/Concerns/InvokesTools.php index 65bdccf5a7..3566b13a56 100644 --- a/src/ai/src/Gateway/Concerns/InvokesTools.php +++ b/src/ai/src/Gateway/Concerns/InvokesTools.php @@ -5,11 +5,13 @@ namespace Hypervel\Ai\Gateway\Concerns; use Hypervel\Ai\Contracts\Tool; +use Hypervel\Ai\Exceptions\ToolExecutionException; use Hypervel\Ai\Gateway\ParentInvocation; use Hypervel\Ai\Gateway\RunContext; use Hypervel\Ai\Providers\Tools\ToolSearch; use Hypervel\Ai\Tools\Request; use Hypervel\Ai\Tools\ToolNameResolver; +use Hypervel\Coroutine\Coroutine; use Hypervel\Support\Str; use Hypervel\Validation\ValidationException; use Throwable; @@ -42,7 +44,8 @@ protected function executeTool(Tool $tool, array $arguments, ?string $toolCallId } catch (Throwable $exception) { // Keep the original exception, including cancellation, as previous if failure reporting throws. try { - throw $exception; + // Unlike upstream, cancellation is not wrapped, so the caller never recovers it as the tool's own failure. + throw Coroutine::causedByCancellation($exception) ? $exception : new ToolExecutionException($exception); } finally { $context?->toolFailed($tool, $arguments, $exception, $toolInvocationId, $this->elapsedMilliseconds($startedAt)); } diff --git a/src/ai/src/Gateway/RunContext.php b/src/ai/src/Gateway/RunContext.php index 645ff734fe..e51a22e127 100644 --- a/src/ai/src/Gateway/RunContext.php +++ b/src/ai/src/Gateway/RunContext.php @@ -32,6 +32,10 @@ class RunContext /** @var array */ protected array $steps = []; + protected ?ClaimsPendingApprovals $approvalStore = null; + + protected ?string $conversationId = null; + protected ?ApprovalClaim $approvalClaim = null; protected bool $toolWasInvoked = false; @@ -48,8 +52,6 @@ public function __construct( public readonly string $model, protected readonly Dispatcher $events, protected readonly ?Closure $contextRunner = null, - protected readonly ?ClaimsPendingApprovals $approvalStore = null, - protected readonly ?string $conversationId = null, ) { } @@ -65,6 +67,17 @@ public function contextRunner(): ?Closure return $this->contextRunner; } + /** + * Claim and record the approvals this run resumes through the given conversation's store. + */ + public function withApprovalStore(ClaimsPendingApprovals $store, string $conversationId): static + { + $this->approvalStore = $store; + $this->conversationId = $conversationId; + + return $this; + } + /** * Claim the stored pause before any of its tools execute. * @@ -76,7 +89,7 @@ public function claimPendingApprovals(array $toolCallIds): void return; } - /** @var string $conversationId The provider supplies both the store and its conversation ID. */ + /** @var string $conversationId withApprovalStore() sets the store and its conversation ID together. */ $conversationId = $this->conversationId; $this->approvalClaim = $this->approvalStore->claimPendingApprovals($conversationId, $toolCallIds) diff --git a/src/ai/src/Gateway/TextGenerationLoop.php b/src/ai/src/Gateway/TextGenerationLoop.php index 52270d4ead..10a80d71fd 100644 --- a/src/ai/src/Gateway/TextGenerationLoop.php +++ b/src/ai/src/Gateway/TextGenerationLoop.php @@ -27,6 +27,7 @@ use Hypervel\Ai\Exceptions\ApprovalMismatchException; use Hypervel\Ai\Exceptions\NoSuchToolException; use Hypervel\Ai\Exceptions\StreamErrorException; +use Hypervel\Ai\Exceptions\ToolExecutionException; use Hypervel\Ai\Gateway\Concerns\HandlesToolApprovals; use Hypervel\Ai\Gateway\Concerns\InvokesTools; use Hypervel\Ai\Messages\AssistantMessage; @@ -1012,15 +1013,25 @@ private function concurrentToolResults(array $resolved, int $max, Closure $execu */ protected function resolvedToolResult(ToolCall $toolCall, ?Tool $tool, bool $isFinalStep, array $tools = [], ?RunContext $context = null): ToolResult { - return $this->recordedToolResult($this->toolResult( - $toolCall, - match (true) { - ! $tool instanceof Tool && CoroutineContext::get(self::REPAIR_TOOL_CALLS_CONTEXT_KEY, false) => "Tool '{$toolCall->name}' does not exist. Available tools: {$this->availableToolNames($tools)}.", - $isFinalStep => 'The agent reached its maximum number of steps without running this tool call.', - default => $this->executeTool($tool, $toolCall->arguments, $toolCall->id, $context), - }, - failed: ! $tool instanceof Tool || $isFinalStep, - ), $context); + return $this->recordedToolResult(match (true) { + ! $tool instanceof Tool && CoroutineContext::get(self::REPAIR_TOOL_CALLS_CONTEXT_KEY, false) => $this->toolResult($toolCall, "Tool '{$toolCall->name}' does not exist. Available tools: {$this->availableToolNames($tools)}.", failed: true), + $isFinalStep => $this->toolResult($toolCall, 'The agent reached its maximum number of steps without running this tool call.', failed: true), + default => $this->executedToolResult($toolCall, $tool, $context), + }, $context); + } + + /** + * Execute the tool for the given call, returning a failure to the model instead of ending the run. + */ + protected function executedToolResult(ToolCall $toolCall, Tool $tool, ?RunContext $context = null): ToolResult + { + try { + return $this->toolResult($toolCall, $this->executeTool($tool, $toolCall->arguments, $toolCall->id, $context)); + } catch (ToolExecutionException $exception) { + report($exception->exception); + + return $this->toolResult($toolCall, 'The tool call failed: ' . $exception->exception->getMessage(), failed: true); + } } /** @@ -1203,6 +1214,36 @@ protected function resolveApprovalResults(array $approval, array $messages, arra return [$toolResults, ! $hasBareRejection]; } + /** + * Determine whether the history ends in a pause a real run could have left: every pending call is for a tool the agent still has, and at least one of them asks for approval. + * + * @param Message[] $messages + * @param array $tools + */ + public function pausedForApproval(array $messages, array $tools): bool + { + [$pendingToolCalls] = $this->pendingToolCalls($messages); + + $pendingTools = $this->toolsForPendingCalls($pendingToolCalls, $tools); + + return ! $pendingTools->containsStrict(null) + && $pendingToolCalls->contains(fn (ToolCall $toolCall): bool => $this->approvalForTool($pendingTools[$toolCall->id], $toolCall) instanceof Approval); + } + + /** + * Find the tool each pending call is for, keyed by the call's id. + * + * @param Collection $pendingToolCalls + * @param array $tools + * @return Collection + */ + protected function toolsForPendingCalls(Collection $pendingToolCalls, array $tools): Collection + { + return $pendingToolCalls->mapWithKeys(fn (ToolCall $toolCall): array => [ + $toolCall->id => $this->findTool($toolCall->name, $tools), + ]); + } + /** * Validate the approval's decisions against the pending tool calls, throwing on any mismatch. * @@ -1221,9 +1262,7 @@ public function validateApproval(array $approval, array $messages, array $tools) fn (int|string $id): bool => $id === '*', ); - $resolvedTools = $pendingToolCalls->mapWithKeys(fn (ToolCall $toolCall): array => [ - $toolCall->id => $this->findTool($toolCall->name, $tools), - ]); + $resolvedTools = $this->toolsForPendingCalls($pendingToolCalls, $tools); $approvals = $pendingToolCalls->mapWithKeys(fn (ToolCall $toolCall): array => [ $toolCall->id => $this->approvalForTool($resolvedTools[$toolCall->id], $toolCall), diff --git a/src/ai/src/Middleware/RememberConversation.php b/src/ai/src/Middleware/RememberConversation.php index e448c6da2e..0b1cb91e34 100644 --- a/src/ai/src/Middleware/RememberConversation.php +++ b/src/ai/src/Middleware/RememberConversation.php @@ -7,6 +7,7 @@ use Closure; use Generator; use Hypervel\Ai\Ai; +use Hypervel\Ai\AnonymousAgent; use Hypervel\Ai\Concerns\RemembersConversations as RemembersConversationsTrait; use Hypervel\Ai\Contracts\Agent; use Hypervel\Ai\Contracts\ConversationStore; @@ -216,7 +217,7 @@ protected function rememberTurn(AgentPrompt $prompt, AgentResponse $response, ?s if ($newConversation) { if (($exception === null || ! Coroutine::causedByCancellation($exception)) && ! $exception instanceof StreamAbandonedException) { try { - $title = $prompt->pendingConversationTitle()?->value() ?? $this->generateTitle($prompt->prompt); + $title = $prompt->pendingConversationTitle()?->value() ?? $this->generateTitle($prompt); } catch (ChildCancellationException) { // An independently canceled title must not discard the caller's completed turn. } catch (Throwable $caught) { @@ -360,7 +361,7 @@ protected function startConcurrentTitle(AgentPrompt $prompt): ?PendingConversati DB::releaseIdleConnections(); return new PendingConversationTitle( - fn (): string => $this->generateTitle($prompt->prompt), + fn (): string => $this->generateTitle($prompt), $prompt->contextRunner() ?? Ai::captureContext(), ); } @@ -368,19 +369,25 @@ protected function startConcurrentTitle(AgentPrompt $prompt): ?PendingConversati /** * Generate a title for the conversation. */ - protected function generateTitle(string $prompt): string + protected function generateTitle(AgentPrompt $prompt): string { if (! config()->boolean('ai.conversations.generate_title', true)) { - return Str::limit($prompt, 50, preserveWords: true); + return Str::limit($prompt->prompt, 50, preserveWords: true); } try { - $response = $this->provider->textGenerationLoop()->generate( + $response = $this->provider->prompt(new AgentPrompt( + new AnonymousAgent( + 'Generate a concise 3-5 word title for a conversation that starts with the following message. Use the same language as the message. Respond with only the title, no quotes or punctuation.', + [], + [], + ), + Str::limit($prompt->prompt, 500), + [], $this->provider, $this->provider->cheapestTextModel(), - 'Generate a concise 3-5 word title for a conversation that starts with the following message. Use the same language as the message. Respond with only the title, no quotes or punctuation.', - [new UserMessage(Str::limit($prompt, 500))], - ); + parentInvocationId: $prompt->invocationId, + )); return Str::limit($response->text, 100); } catch (Throwable $exception) { @@ -388,7 +395,7 @@ protected function generateTitle(string $prompt): string throw $exception; } - return Str::limit($prompt, 100, preserveWords: true); + return Str::limit($prompt->prompt, 100, preserveWords: true); } } } diff --git a/src/ai/src/Providers/Concerns/GeneratesText.php b/src/ai/src/Providers/Concerns/GeneratesText.php index 2ea0713471..9074b8f6d6 100644 --- a/src/ai/src/Providers/Concerns/GeneratesText.php +++ b/src/ai/src/Providers/Concerns/GeneratesText.php @@ -6,6 +6,7 @@ use Closure; use Hypervel\Ai\Ai; +use Hypervel\Ai\Approvals\Decision; use Hypervel\Ai\Contracts\Agent; use Hypervel\Ai\Contracts\ClaimsPendingApprovals; use Hypervel\Ai\Contracts\Conversational; @@ -80,6 +81,7 @@ public function prompt(AgentPrompt $prompt): AgentResponse $schema = $agent instanceof HasStructuredOutput ? $agent->schema(new JsonSchemaTypeFactory) : null; $instructions = (string) $agent->instructions(); $tools = $this->resolveTools($prompt); + $approval = $this->resumableApprovalFor($prompt, $messages, $tools); $options = TextGenerationOptions::forAgent($agent); if ($prompt->middleware !== []) { @@ -95,9 +97,9 @@ public function prompt(AgentPrompt $prompt): AgentResponse $schema, $options, $prompt->timeout, - $this->resumableApprovalFor($prompt), - $this->approvalResultRecorderFor($prompt, $resolvedApprovalResults), - $this->runContextFor($invocationId, $prompt), + $approval, + $this->approvalResultRecorderFor($prompt, $approval, $resolvedApprovalResults), + $this->prepareRunContext($invocationId, $prompt, $approval), ); if ($response->hasPendingApprovals()) { @@ -224,27 +226,38 @@ protected function resolveTool(mixed $tool): mixed } /** - * Build the context that identifies this run and reports its step and tool events. + * Build the run's context, letting a remembered conversation claim and record the approval decisions the run resumes. + * + * @param null|array $approval */ - protected function runContextFor(string $invocationId, AgentPrompt $prompt): RunContext + protected function prepareRunContext(string $invocationId, AgentPrompt $prompt, ?array $approval): RunContext { - $store = null; - $conversationId = null; + $conversationId = $approval !== null && RememberConversation::appliesTo($prompt->agent) + ? $prompt->conversationSelection()?->conversationId + : null; - if ($this->resumesAgainstRealGateway($prompt) && RememberConversation::appliesTo($prompt->agent)) { - $conversationId = $prompt->conversationSelection()?->conversationId; + if ($conversationId === null) { + return $this->runContextFor($invocationId, $prompt); + } - if ($conversationId !== null) { - $store = resolve(ConversationStore::class); + $store = resolve(ConversationStore::class); - if (! $store instanceof ClaimsPendingApprovals) { - throw new LogicException('Conversation store [' . $store::class . '] must implement [' . ClaimsPendingApprovals::class . '] to resume stored tool approvals.'); - } - } + // Checked before the context is published, so an unsupported store fails like any other pre-run error. + if (! $store instanceof ClaimsPendingApprovals) { + throw new LogicException('Conversation store [' . $store::class . '] must implement [' . ClaimsPendingApprovals::class . '] to resume stored tool approvals.'); } + // Unlike upstream, the resumed approvals are claimed through the store instead of a separate result recorder. + return $this->runContextFor($invocationId, $prompt)->withApprovalStore($store, $conversationId); + } + + /** + * Build the context that identifies this run and reports its step and tool events. + */ + protected function runContextFor(string $invocationId, AgentPrompt $prompt): RunContext + { return tap( - new RunContext($invocationId, $prompt->agent, $this, $prompt->model, $this->events, $prompt->contextRunner(), $store, $conversationId), + new RunContext($invocationId, $prompt->agent, $this, $prompt->model, $this->events, $prompt->contextRunner()), fn (RunContext $context) => $prompt->setRunContext($context), ); } diff --git a/src/ai/src/Providers/Concerns/ResumesToolApprovals.php b/src/ai/src/Providers/Concerns/ResumesToolApprovals.php index 9898aa4fbb..b2a9169146 100644 --- a/src/ai/src/Providers/Concerns/ResumesToolApprovals.php +++ b/src/ai/src/Providers/Concerns/ResumesToolApprovals.php @@ -7,21 +7,25 @@ use Closure; use Hypervel\Ai\Ai; use Hypervel\Ai\Approvals\Decision; +use Hypervel\Ai\Contracts\Tool; use Hypervel\Ai\Messages\AssistantMessage; use Hypervel\Ai\Messages\Message; use Hypervel\Ai\Prompts\AgentPrompt; +use Hypervel\Ai\Providers\Tools\ProviderTool; use Hypervel\Support\Collection; trait ResumesToolApprovals { /** - * Get the tool approval to resume with, unless the agent's gateway is faked. + * Get the tool approval to resume with, unless a faked agent has no paused approval to resume. * + * @param array $messages + * @param array $tools * @return null|array */ - protected function resumableApprovalFor(AgentPrompt $prompt): ?array + protected function resumableApprovalFor(AgentPrompt $prompt, array $messages, array $tools): ?array { - return $this->resumesAgainstRealGateway($prompt) ? $prompt->approvalDecisions->all() : null; + return $this->resumesApproval($prompt, $messages, $tools) ? $prompt->approvalDecisions->all() : null; } /** @@ -45,19 +49,33 @@ protected function withoutForeignReplayBlocks(array $messages): array } /** - * Determine whether the prompt is a resume that runs tools against the real (non-faked) gateway. + * Determine whether the prompt is a resume that runs the approved tools. + * + * @param array $messages + * @param array $tools */ - protected function resumesAgainstRealGateway(AgentPrompt $prompt): bool + protected function resumesApproval(AgentPrompt $prompt, array $messages, array $tools): bool { - return $prompt->hasApprovalDecisions() && ! Ai::hasFakeGatewayFor($prompt->agent::class); + if (! $prompt->hasApprovalDecisions()) { + return false; + } + + if (! Ai::hasFakeGatewayFor($prompt->agent::class)) { + return true; + } + + // A faked agent resumes like the real gateway once it actually paused for approval, but decisions sent to a fake with nothing paused still just take its next response... + return $this->textGenerationLoop()->pausedForApproval($messages, $tools); } /** * Get a callback that captures a resume's resolved approval results for its completion event. + * + * @param null|array $approval */ - protected function approvalResultRecorderFor(AgentPrompt $prompt, ?Collection &$resolvedApprovalResults): ?Closure + protected function approvalResultRecorderFor(AgentPrompt $prompt, ?array $approval, ?Collection &$resolvedApprovalResults): ?Closure { - if (! $this->resumesAgainstRealGateway($prompt)) { + if ($approval === null) { return null; } diff --git a/src/ai/src/Providers/Concerns/StreamsText.php b/src/ai/src/Providers/Concerns/StreamsText.php index c0d6f8c252..3c10955b35 100644 --- a/src/ai/src/Providers/Concerns/StreamsText.php +++ b/src/ai/src/Providers/Concerns/StreamsText.php @@ -68,15 +68,15 @@ public function stream(AgentPrompt $prompt): StreamableAgentResponse } $tools = $this->resolveTools($prompt); - $approval = $this->resumableApprovalFor($prompt); - $recordApprovalResults = $this->approvalResultRecorderFor($prompt, $resolvedApprovalResults); + $approval = $this->resumableApprovalFor($prompt, $messages, $tools); + $recordApprovalResults = $this->approvalResultRecorderFor($prompt, $approval, $resolvedApprovalResults); // Validate eagerly so a mismatch throws before the stream begins, then thread the result into stream() so it isn't re-validated there... $validatedApproval = $approval !== null ? $this->textGenerationLoop()->validateApproval($approval, $messages, $tools) : null; - $context = $this->runContextFor($invocationId, $prompt); + $context = $this->prepareRunContext($invocationId, $prompt, $approval); $streamable = new StreamableAgentResponse( $invocationId, diff --git a/src/ai/src/Responses/StreamedAgentResponse.php b/src/ai/src/Responses/StreamedAgentResponse.php index dd529424d4..0f41c1bc53 100644 --- a/src/ai/src/Responses/StreamedAgentResponse.php +++ b/src/ai/src/Responses/StreamedAgentResponse.php @@ -34,6 +34,7 @@ public function __construct(string $invocationId, Collection $events, Meta $meta { $textParts = []; $stepText = ''; + $stepRanTools = false; $reasoningBlocks = []; $usage = new TextUsage; $toolCalls = []; @@ -46,12 +47,15 @@ public function __construct(string $invocationId, Collection $events, Meta $meta // Citation::combine() and StreamEnd::combineUsage() when syncing upstream changes. foreach ($events as $event) { if ($event instanceof StreamStart) { - // Content-block message IDs may change mid-sentence; only a new step separates text. - if (trim($stepText) !== '') { - $textParts[] = $stepText; + // Content-block message IDs may change mid-sentence; only a new step after tools ran separates text. + if ($stepRanTools) { + if (trim($stepText) !== '') { + $textParts[] = $stepText; + } + + $stepText = ''; + $stepRanTools = false; } - - $stepText = ''; } elseif ($event instanceof TextDelta) { $stepText .= $event->delta; } elseif ($event instanceof ReasoningDelta) { @@ -63,6 +67,8 @@ public function __construct(string $invocationId, Collection $events, Meta $meta } elseif ($event instanceof ToolCall) { $toolCalls[] = $event->toolCall; } elseif ($event instanceof ToolResult) { + $stepRanTools = true; + if (! $event->preliminary) { $toolResults[] = $event->toolResult; } diff --git a/src/ai/src/Storage/DatabaseConversationStore.php b/src/ai/src/Storage/DatabaseConversationStore.php index 15fe455b1a..2a5b279496 100644 --- a/src/ai/src/Storage/DatabaseConversationStore.php +++ b/src/ai/src/Storage/DatabaseConversationStore.php @@ -29,6 +29,8 @@ use Hypervel\Ai\Responses\Data\TextUsage; use Hypervel\Ai\Responses\Data\ToolCall; use Hypervel\Ai\Responses\Data\ToolResult; +use Hypervel\Ai\Responses\StreamedAgentResponse; +use Hypervel\Ai\Streaming\Events\TextDelta; use Hypervel\Ai\Support\ConversationPartition; use Hypervel\Context\CoroutineContext; use Hypervel\Contracts\Pagination\CursorPaginator; @@ -334,10 +336,20 @@ protected function resumePausedRow(string $conversationId, object $paused, Agent $steps = $this->withoutReplayBlocks($steps); } + // Unlike upstream, a streamed resume appends its text to the paused content instead of rejoining every + // step, which would split a continuation the stream displayed as one paragraph, such as a pause_turn. + $content = $response instanceof StreamedAgentResponse + ? TextDelta::join([$paused->content, $response->text]) + : $response->text; + + if (blank($content)) { + $content = $paused->content; + } + $now = now(); $this->table($this->messagesTable())->where('id', $paused->id)->update([ - 'content' => blank($response->text) ? $paused->content : $response->text, + 'content' => $content, 'steps' => $steps->toJson(), 'usage' => json_encode(TextUsage::fromArray($this->decoded($paused->usage))->add($response->usage)), 'meta' => json_encode($this->mergedMeta($paused, $response, $exception)), diff --git a/src/ai/src/Streaming/Events/TextDelta.php b/src/ai/src/Streaming/Events/TextDelta.php index 7027224b72..02494b87ef 100644 --- a/src/ai/src/Streaming/Events/TextDelta.php +++ b/src/ai/src/Streaming/Events/TextDelta.php @@ -20,23 +20,27 @@ public function __construct( } /** - * Combine the text deltas in the given collection of events into a single string. - * - * Each step of a multi-step generation is a self-contained utterance - * (typically narration around a tool call), so steps are joined with a blank - * line instead of being run together mid-sentence. The boundary is the step's - * own `StreamStart` rather than a change of message ID, which Anthropic rotates - * per content block — web search splits one answer across several, mid-sentence. + * Combine the text deltas, starting a new paragraph only after a step that ran tools. */ public static function combine(Collection|array $events): string { - return Collection::wrap($events) - ->chunkWhile(fn (StreamEvent $event): bool => ! $event instanceof StreamStart) + return static::join(Collection::wrap($events) + ->chunkWhile(fn (StreamEvent $event, int|string $key, Collection $step): bool => ! $event instanceof StreamStart + || $step->doesntContain(fn (StreamEvent $previous): bool => $previous instanceof ToolResult)) ->map(fn (Collection $step): string => $step->whereInstanceOf(TextDelta::class) ->map(fn (TextDelta $event): string => $event->delta) - ->join('')) + ->join(''))); + } + + /** + * Join the text of each step, separating the steps with a blank line. + * + * @param array|Collection $texts + */ + public static function join(Collection|array $texts): string + { + return Collection::wrap($texts) ->filter(fn (string $text): bool => trim($text) !== '') - ->values() ->join("\n\n"); } diff --git a/src/docs/ai-sdk.md b/src/docs/ai-sdk.md index 3122d43082..e5076c939a 100644 --- a/src/docs/ai-sdk.md +++ b/src/docs/ai-sdk.md @@ -536,7 +536,7 @@ foreach ($response->steps as $step) { } ``` -[Classification](#classification) responses also expose the provider's raw HTTP response through their `raw` property. +[Image](#images), [transcription](#transcription), [embeddings](#embeddings), [reranking](#reranking), and [classification](#classification) responses also expose the provider's raw HTTP response through their `raw` property. Embeddings served entirely from the [cache](#caching-embeddings) have no raw response. > **Note:** The `raw` property is `null` when streaming a response, when using the Bedrock provider, and on faked responses unless one is provided explicitly via `withRawResponse`. @@ -677,6 +677,8 @@ The store uses your default database connection unless `ai.conversations.connect The SDK generates a title when it creates a conversation. To use the opening message as the title instead, set `conversations.generate_title` to `false` in your `config/ai.php` configuration file. +Title generation runs as its own agent run using the turn's provider and its cheapest model, so [agent events](#events) such as `AgentPrompted` and `AgentFailed` also report it. Its prompt's `parentInvocationId` identifies the turn that triggered it. If the title request fails, the SDK uses the start of the opening message without failing the turn. + If the opening turn is canceled or abandoned, such as when the client disconnects, the SDK saves the work already done without starting or waiting for a title. It keeps a title that has already finished or uses the start of the opening message, and the title isn't generated later. Enabling concurrent titles makes a generated title more likely in this case. A turn that fails with an error is titled as usual. By default, title generation runs after the agent responds. You may generate titles alongside the agent's response by enabling `conversations.concurrent_title`: @@ -1495,7 +1497,7 @@ class ResearchAgent implements Agent, HasTools } ``` -The limit applies to each group of tool calls within a generation step. Results retain the model's original call order, while sub-agent output can arrive as each sub-agent produces it. If a tool fails or the stream is abandoned, the remaining tool executions are canceled and awaited before the run ends. +The limit applies to each group of tool calls within a generation step. Results retain the model's original call order, while sub-agent output can arrive as each sub-agent produces it. If the run ends while tools are executing, for example because the stream is abandoned, the remaining tool executions are canceled and awaited first. Concurrent tools use separate coroutines and database connections; they do not share the caller's database transaction. Each tool must be safe to run alongside the others. Resuming approved tool calls remains sequential so each outcome is stored before the next approved tool executes. @@ -1520,6 +1522,8 @@ public function handle(Request $request): Stringable|string When validation fails, the validation messages are returned to the model as the tool's result, allowing it to correct the arguments and call the tool again. +Likewise, when a tool throws an exception, the run continues. The exception is reported to your application's exception handler, and the model receives "The tool call failed:" followed by the exception message as the tool's result, so it can explain the failure or try another approach. + #### Repairing Tool Calls @@ -3730,6 +3734,8 @@ $response = (new FileAssistant)->prompt('Delete the invoice.'); $response->hasPendingApprovals(); // true ``` +When you resume a faked pause with [approval decisions](#human-tool-approval), approved tools run and rejected tools receive a denied result before the fake returns its next response, just as they would against a real provider. + In addition, you can fake a response that includes reasoning. The fake emits reasoning events, so the reasoning is reported on streamed runs as well: ```php diff --git a/tests/Ai/ConcurrentToolsTest.php b/tests/Ai/ConcurrentToolsTest.php index b2da4596ee..365c2a2878 100644 --- a/tests/Ai/ConcurrentToolsTest.php +++ b/tests/Ai/ConcurrentToolsTest.php @@ -15,6 +15,8 @@ use Hypervel\Ai\Contracts\Gateway\StepTextGateway; use Hypervel\Ai\Contracts\Providers\TextProvider; use Hypervel\Ai\Contracts\Tool; +use Hypervel\Ai\Events\ToolFailed; +use Hypervel\Ai\Gateway\RunContext; use Hypervel\Ai\Gateway\StepResponse; use Hypervel\Ai\Gateway\TextGenerationLoop; use Hypervel\Ai\Gateway\TextGenerationOptions; @@ -140,12 +142,18 @@ public function testInvalidConcurrencyFailsClearlyThroughTheLoop(): void (new TextGenerationLoop($gateway))->generate($provider, 'model', '', options: new TextGenerationOptions(agent: new InvalidConcurrentToolsTestAgent('', [], []))); } - #[TestWith([false, false], 'ordinary tool failure')] + #[TestWith([false, false], 'rethrown tool failure')] #[TestWith([true, false], 'direct child cancellation')] #[TestWith([true, true], 'wrapped child cancellation')] public function testToolFailureCancelsAndJoinsTheOtherTools(bool $canceled, bool $cleanupThrows): void { $failure = $canceled ? new CanceledException : new RuntimeException('The tool failed.'); + $events = $this->app->make(Dispatcher::class); + + // An ordinary tool failure is returned to the model, so only a listener rethrowing it ends the run. + if (! $canceled) { + $events->listen(ToolFailed::class, fn (ToolFailed $event) => throw $event->exception); + } if ($cleanupThrows) { $failure = new RuntimeException('Tool cleanup failed.', previous: $failure); @@ -180,7 +188,7 @@ public function testToolFailureCancelsAndJoinsTheOtherTools(bool $canceled, bool $caught = null; try { - (new TextGenerationLoop($gateway))->generate($provider, 'model', '', tools: [$tool], options: new TextGenerationOptions(agent: new ConcurrentToolsTestAgent('', [], []))); + (new TextGenerationLoop($gateway))->generate($provider, 'model', '', tools: [$tool], options: new TextGenerationOptions(agent: new ConcurrentToolsTestAgent('', [], [])), context: new RunContext('invocation', m::mock(Agent::class), $provider, 'model', $events)); } catch (Throwable $exception) { $caught = $exception; } diff --git a/tests/Ai/Feature/AgentEventsTest.php b/tests/Ai/Feature/AgentEventsTest.php index 236375204e..6a3ace8d28 100644 --- a/tests/Ai/Feature/AgentEventsTest.php +++ b/tests/Ai/Feature/AgentEventsTest.php @@ -5,7 +5,7 @@ namespace Hypervel\Tests\Ai\Feature; use Closure; -use Exception; +use Hypervel\Ai\AnonymousAgent; use Hypervel\Ai\Approvals\Decisions; use Hypervel\Ai\Contracts\Conversational; use Hypervel\Ai\Contracts\ConversationStore; @@ -40,6 +40,7 @@ use Hypervel\Ai\Tools\AgentTool; use Hypervel\Coroutine\Coroutine; use Hypervel\Foundation\Testing\RefreshDatabase; +use Hypervel\Http\Client\RequestException; use Hypervel\Http\IterableStreamedResponse; use Hypervel\Support\Facades\Context; use Hypervel\Support\Facades\DB; @@ -54,8 +55,10 @@ use Hypervel\Tests\Ai\Fixtures\Agents\RateLimitedToolAgent; use Hypervel\Tests\Ai\Fixtures\Agents\RememberingAssistantAgent; use Hypervel\Tests\Ai\Fixtures\Agents\RememberingThrowingApprovableAgent; +use Hypervel\Tests\Ai\Fixtures\Agents\RememberingToolUsingAgent; use Hypervel\Tests\Ai\Fixtures\Agents\ResearchAgent; use Hypervel\Tests\Ai\Fixtures\Agents\ToolUsingAgent; +use Hypervel\Tests\Ai\Fixtures\ConversationStores\InMemoryConversationStore; use Hypervel\Tests\Ai\Fixtures\FakeConversationStore; use Hypervel\Tests\Ai\Fixtures\Tools\FixedNumberGenerator; use Hypervel\Tests\Ai\Fixtures\Tools\NamedTool; @@ -323,12 +326,119 @@ public function testConversationTitleGenerationDoesNotReportStepsAgainstTheRunTh $response = (new RememberingAssistantAgent)->forUser($user)->prompt('Test prompt'); - // Title generation runs its own loop on the same provider, and must not be attributed to this run... - Event::assertDispatchedTimes(StartingStep::class, 1); - Event::assertDispatchedTimes(StepCompleted::class, 1); + $this->assertCount(1, Event::dispatched(StartingStep::class, fn (StartingStep $event): bool => $event->invocationId === $response->invocationId)); + $this->assertCount(1, Event::dispatched(StepCompleted::class, fn (StepCompleted $event): bool => $event->invocationId === $response->invocationId)); + } - Event::assertDispatched(StartingStep::class, fn (StartingStep $event): bool => $event->invocationId === $response->invocationId - && $event->stepNumber === 0); + public function testConversationTitleGenerationIsReportedAsItsOwnAgentRun(): void + { + $this->prepareConversationTitleRun(); + + Event::fake(); + + Http::fakeSequence() + ->pushResponse(fakeGroqResponse('Hello there.')) + ->pushResponse(fakeGroqResponse('Greeting Conversation')); + + $response = (new RememberingAssistantAgent)->forUser((object) ['id' => 1])->prompt('Hello', provider: 'groq'); + + $title = Event::dispatched(AgentPrompted::class, fn (AgentPrompted $event): bool => $event->prompt->parentInvocationId === $response->invocationId)->sole()[0]; + + $this->assertNotSame($response->invocationId, $title->invocationId); + $this->assertSame('groq', $title->prompt->provider->name()); + $this->assertSame('openai/gpt-oss-20b', $title->prompt->model); + $this->assertSame('Hello', $title->prompt->prompt); + $this->assertSame('Greeting Conversation', $title->response->text); + + Event::assertDispatched(StepCompleted::class, fn (StepCompleted $event): bool => $event->invocationId === $title->invocationId); + } + + public function testAFailedConversationTitleRunFallsBackToThePromptWithoutFailingTheTurn(): void + { + $store = $this->prepareConversationTitleRun(); + + Event::fake(); + + Http::fakeSequence() + ->pushResponse(fakeGroqResponse('Hello there.')) + ->pushStatus(500); + + $response = (new RememberingAssistantAgent)->forUser((object) ['id' => 1])->prompt('Hello', provider: 'groq'); + + $this->assertSame('Hello there.', $response->text); + $this->assertSame('Hello', $store->conversations[$response->conversationId]['title']); + + $failed = Event::dispatched(AgentFailed::class)->sole()[0]; + + $this->assertInstanceOf(AnonymousAgent::class, $failed->prompt->agent); + $this->assertSame($response->invocationId, $failed->prompt->parentInvocationId); + $this->assertInstanceOf(RequestException::class, $failed->exception); + } + + public function testATurnThatFailsAfterAStepReportsItsTitleRunAgainstTheFailedRun(): void + { + $this->prepareConversationTitleRun(); + + Event::fake(); + + Http::fakeSequence() + ->pushResponse(fakeGroqToolCallResponse()) + ->pushStatus(500) + ->pushResponse(fakeGroqResponse('Number Report')); + + $this->assertThrows(fn (): AgentResponse => (new RememberingToolUsingAgent)->forUser((object) ['id' => 1])->prompt('Generate a number', provider: 'groq'), RequestException::class); + + $failedRun = Event::dispatched(AgentFailed::class)->sole()[0]; + + Event::assertDispatched(AgentPrompted::class, fn (AgentPrompted $event): bool => $event->prompt->parentInvocationId === $failedRun->invocationId + && $event->response->text === 'Number Report'); + } + + public function testAThrowingListenerOnTheTitleRunDoesNotFailTheTurn(): void + { + $store = $this->prepareConversationTitleRun(); + + Http::fakeSequence() + ->pushResponse(fakeGroqResponse('Hello there.')) + ->pushResponse(fakeGroqResponse('Greeting Conversation')); + + Event::listen(AgentPrompted::class, function (AgentPrompted $event): void { + if ($event->prompt->parentInvocationId !== null) { + throw new RuntimeException('observability backend is down'); + } + }); + + $response = (new RememberingAssistantAgent)->forUser((object) ['id' => 1])->prompt('Hello', provider: 'groq'); + + $this->assertSame('Hello there.', $response->text); + $this->assertSame('Hello', $store->conversations[$response->conversationId]['title']); + } + + public function testDisabledConversationTitleGenerationMakesNoTitleCall(): void + { + $this->prepareConversationTitleRun(); + + config(['ai.conversations.generate_title' => false]); + + Http::fakeSequence()->pushResponse(fakeGroqResponse('Hello there.')); + + (new RememberingAssistantAgent)->forUser((object) ['id' => 1])->prompt('Hello', provider: 'groq'); + + Http::assertSentCount(1); + } + + /** + * Remember conversations in memory against a Groq provider that must not send unexpected requests. + */ + protected function prepareConversationTitleRun(): InMemoryConversationStore + { + $this->app->instance(ConversationStore::class, $store = new InMemoryConversationStore); + + config(['ai.providers.groq' => [...config('ai.providers.groq'), 'key' => 'test-key']]); + + Http::preventStrayRequests(); + + return $store; } public function testStepEventsAreDispatchedOnTheStreamingPath(): void @@ -415,7 +525,7 @@ public function testEveryStepEventNamesTheProviderAndModelTheStepRanAgainst(): v $this->assertSame($starting->agent, $completed->agent); } - public function testAThrowingToolDispatchesToolFailedAndStillPropagatesTheException(): void + public function testAThrowingToolDispatchesToolFailedAndTheRunContinues(): void { Event::fake(); @@ -424,14 +534,14 @@ public function testAThrowingToolDispatchesToolFailedAndStillPropagatesTheExcept ['number' => 5], ]); - $this->assertThrows(fn (): AgentResponse => (new ToolUsingAgent(fixed: true, toolThrowsException: true))->prompt('Generate'), Exception::class, 'Forced to throw exception.'); + (new ToolUsingAgent(fixed: true, toolThrowsException: true))->prompt('Generate'); Event::assertDispatched(ToolFailed::class, fn (ToolFailed $event): bool => $event->tool instanceof FixedNumberGenerator && $event->exception->getMessage() === 'Forced to throw exception.'); Event::assertNotDispatched(ToolInvoked::class); - Event::assertDispatched(AgentFailed::class); + Event::assertNotDispatched(AgentFailed::class); $invoking = Event::dispatched(InvokingTool::class)->first()[0]; $failed = Event::dispatched(ToolFailed::class)->first()[0]; @@ -1061,7 +1171,9 @@ public function testAProviderErrorInsideTheStreamClosesTheStepItOpened(): void public function testAStreamedFailureAfterTheStreamStartedReportsTheRunAsFailed(): void { - Event::fake(); + Event::fakeExcept([ToolFailed::class]); + + Event::listen(ToolFailed::class, fn (ToolFailed $event) => throw $event->exception); config([ 'ai.providers.primary' => ['driver' => 'groq', 'key' => 'test-key'], diff --git a/tests/Ai/Feature/AgentFakeTest.php b/tests/Ai/Feature/AgentFakeTest.php index bfc5474f8e..121e6aa9a5 100644 --- a/tests/Ai/Feature/AgentFakeTest.php +++ b/tests/Ai/Feature/AgentFakeTest.php @@ -11,6 +11,8 @@ use Hypervel\Ai\Approvals\Decisions; use Hypervel\Ai\Approvals\PendingApproval; use Hypervel\Ai\Enums\Lab; +use Hypervel\Ai\Events\ToolApprovalResolved; +use Hypervel\Ai\Exceptions\ApprovalMismatchException; use Hypervel\Ai\Jobs\InvokeAgent; use Hypervel\Ai\Prompts\AgentPrompt; use Hypervel\Ai\QueuedAgentPrompt; @@ -32,13 +34,17 @@ use Hypervel\Ai\Streaming\Events\ToolCall as ToolCallEvent; use Hypervel\Ai\Streaming\Events\ToolResult as ToolResultEvent; use Hypervel\Http\Client\Response; +use Hypervel\Support\Facades\DB; +use Hypervel\Support\Facades\Event; use Hypervel\Support\Facades\Queue; use Hypervel\Tests\Ai\Fixtures\Agents\AssistantAgent; use Hypervel\Tests\Ai\Fixtures\Agents\ConversationalAgent; use Hypervel\Tests\Ai\Fixtures\Agents\EmptySchemaStructuredAgent; use Hypervel\Tests\Ai\Fixtures\Agents\MultiStepToolAgent; use Hypervel\Tests\Ai\Fixtures\Agents\RememberingApprovableAgent; +use Hypervel\Tests\Ai\Fixtures\Agents\RememberingUngatedApprovableAgent; use Hypervel\Tests\Ai\Fixtures\Agents\StructuredAgent; +use Hypervel\Tests\Ai\Fixtures\Tools\ApprovableNumberGenerator; use Hypervel\Tests\Ai\TestCase; use PHPUnit\Framework\AssertionFailedError; use RuntimeException; @@ -378,6 +384,186 @@ public function testFakedPausedApprovalResponsesEmitAToolCallEventBeforeTheAppro ); } + public function testAFakedAgentRunsAnApprovedToolWhenResumingItsPausedToolCall(): void + { + $this->prepareApprovalResume(); + + RememberingApprovableAgent::fake([ + new ToolCall('call-1', 'ApprovableNumberGenerator', []), + 'Done.', + ]); + + $user = (object) ['id' => 1]; + + $paused = (new RememberingApprovableAgent)->forUser($user)->stream('Generate a number'); + $paused->each(fn (): true => true); + + $resumed = (new RememberingApprovableAgent) + ->continue($paused->conversationId, as: $user) + ->stream(Decisions::from(['call-1' => Decision::approve()])); + $resumed->each(fn (): true => true); + + $result = $resumed->events->whereInstanceOf(ToolResultEvent::class)->sole(); + + $this->assertSame('72019', $result->toolResult->result); + $this->assertSame(1, ApprovableNumberGenerator::$invocations); + $this->assertSame('Done.', $resumed->text); + $this->assertStoredApprovalResult($paused->conversationId); + } + + public function testAFakedAgentResumesAPauseFakedWithPendingApprovals(): void + { + $this->prepareApprovalResume(); + + RememberingApprovableAgent::fake([ + AgentResponse::fakeWithPendingApprovals([ + new PendingApproval('call-1', 'ApprovableNumberGenerator', [], 'Needs approval'), + ]), + 'Done.', + ]); + + $user = (object) ['id' => 1]; + + $paused = (new RememberingApprovableAgent)->forUser($user)->stream('Generate a number'); + $paused->each(fn (): true => true); + + $resumed = (new RememberingApprovableAgent) + ->continue($paused->conversationId, as: $user) + ->stream(Decisions::from(['call-1' => Decision::approve()])); + $resumed->each(fn (): true => true); + + $result = $resumed->events->whereInstanceOf(ToolResultEvent::class)->sole(); + + $this->assertSame('72019', $result->toolResult->result); + $this->assertSame(1, ApprovableNumberGenerator::$invocations); + $this->assertSame('Done.', $resumed->text); + } + + public function testAFakedAgentRunsAnApprovedToolWhenResumingWithPrompt(): void + { + $this->prepareApprovalResume(); + + Event::fake([ToolApprovalResolved::class]); + + RememberingApprovableAgent::fake([ + new ToolCall('call-1', 'ApprovableNumberGenerator', []), + 'Done.', + ]); + + $user = (object) ['id' => 1]; + + $paused = (new RememberingApprovableAgent)->forUser($user)->prompt('Generate a number'); + + $resumed = (new RememberingApprovableAgent) + ->continue($paused->conversationId, as: $user) + ->prompt(Decisions::from(['call-1' => Decision::approve()])); + + $this->assertSame('72019', $resumed->toolResults->sole()->result); + $this->assertSame(1, ApprovableNumberGenerator::$invocations); + $this->assertSame('Done.', $resumed->text); + + Event::assertDispatched(ToolApprovalResolved::class, fn (ToolApprovalResolved $event): bool => $event->conversationId === $paused->conversationId + && $event->toolResults->sole()->result === '72019'); + + $this->assertStoredApprovalResult($paused->conversationId); + } + + public function testAFakedAgentRejectsDecisionsThatDoNotMatchItsPausedToolCallLikeTheRealGateway(): void + { + $this->prepareApprovalResume(); + + RememberingApprovableAgent::fake([ + new ToolCall('call-1', 'ApprovableNumberGenerator', []), + 'Done.', + ]); + + $user = (object) ['id' => 1]; + + $paused = (new RememberingApprovableAgent)->forUser($user)->prompt('Generate a number'); + + $this->expectException(ApprovalMismatchException::class); + + (new RememberingApprovableAgent) + ->continue($paused->conversationId, as: $user) + ->prompt(Decisions::from(['call-9' => Decision::approve()])); + } + + public function testAFakedAgentKeepsAnsweringAWildcardOverAPauseThatIncludesAToolItDoesNotHave(): void + { + $this->prepareApprovalResume(); + + RememberingApprovableAgent::fake([ + AgentResponse::fakeWithPendingApprovals([ + new PendingApproval('call-1', 'ApprovableNumberGenerator', [], 'Needs approval'), + new PendingApproval('call-2', 'DeleteFile', ['path' => 'config/app.php'], 'Deletes a file'), + ]), + 'Resumed', + ]); + + $user = (object) ['id' => 1]; + + $paused = (new RememberingApprovableAgent)->forUser($user)->prompt('Generate a number and delete config/app.php'); + + $resumed = (new RememberingApprovableAgent) + ->continue($paused->conversationId, as: $user) + ->prompt(Decisions::from(['*' => true])); + + $this->assertEmpty($resumed->toolResults); + $this->assertSame(0, ApprovableNumberGenerator::$invocations); + $this->assertSame('Resumed', $resumed->text); + } + + public function testAFakedAgentKeepsAnsweringAPauseForAnApprovableToolThatDoesNotRequireApproval(): void + { + $this->prepareApprovalResume(); + + RememberingUngatedApprovableAgent::fake([ + AgentResponse::fakeWithPendingApprovals([ + new PendingApproval('call-1', 'ApprovableNumberGenerator', [], 'Needs approval'), + ]), + 'Resumed', + ]); + + $user = (object) ['id' => 1]; + + $paused = (new RememberingUngatedApprovableAgent)->forUser($user)->prompt('Generate a number'); + + $resumed = (new RememberingUngatedApprovableAgent) + ->continue($paused->conversationId, as: $user) + ->prompt(Decisions::from(['call-1' => true])); + + $this->assertEmpty($resumed->toolResults); + $this->assertSame(0, ApprovableNumberGenerator::$invocations); + $this->assertSame('Resumed', $resumed->text); + } + + /** + * Keep title generation from consuming faked responses and reset the approvable tool's invocation count. + */ + protected function prepareApprovalResume(): void + { + config(['ai.conversations.generate_title' => false]); + + ApprovableNumberGenerator::$invocations = 0; + } + + /** + * Assert that the resumed turn stored the approved tool's result on its paused tool call. + */ + protected function assertStoredApprovalResult(string $conversationId): void + { + $assistantRow = DB::table('agent_conversation_messages') + ->where('conversation_id', $conversationId) + ->where('role', 'assistant') + ->sole(); + + $toolCalls = json_decode($assistantRow->steps, true)[0]['tool_calls']; + + $this->assertCount(1, $toolCalls); + $this->assertSame('call-1', $toolCalls[0]['id']); + $this->assertSame('72019', $toolCalls[0]['result']); + } + public function testQueuedAgentsCanBeFaked(): void { AssistantAgent::fake(); diff --git a/tests/Ai/Feature/AgentPromptTest.php b/tests/Ai/Feature/AgentPromptTest.php index 0ce6d28cfe..236f60dcbc 100644 --- a/tests/Ai/Feature/AgentPromptTest.php +++ b/tests/Ai/Feature/AgentPromptTest.php @@ -46,7 +46,7 @@ public function testQueuedListenersReceivePromptDataWithoutLiveExecutionState(): $prompt = new AgentPrompt($agent, 'Summarize this', [], $provider, 'test-model', contextRunner: $runner, conversationSelection: $selection, conversationMessages: $history); $claim = new ApprovalClaim('message', 'token'); $store = self::createConfiguredStub(ClaimsPendingApprovals::class, ['claimPendingApprovals' => $claim]); - $context = new RunContext('invocation', $agent, $provider, 'test-model', $this->app->make('events'), $runner, $store, 'conversation'); + $context = (new RunContext('invocation', $agent, $provider, 'test-model', $this->app->make('events'), $runner))->withApprovalStore($store, 'conversation'); $context->claimPendingApprovals(['call']); $prompt->setRunContext($context); $prompt->setPendingConversationTitle($title = new PendingConversationTitle(fn (): string => 'Conversation title', $runner)); diff --git a/tests/Ai/Feature/FailedTurnRecordingTest.php b/tests/Ai/Feature/FailedTurnRecordingTest.php index 0e7911a720..cef32adaa4 100644 --- a/tests/Ai/Feature/FailedTurnRecordingTest.php +++ b/tests/Ai/Feature/FailedTurnRecordingTest.php @@ -6,12 +6,14 @@ use Exception; use Hypervel\Ai\Enums\MessageStatus; +use Hypervel\Ai\Events\ToolFailed; use Hypervel\Ai\Messages\AssistantMessage; use Hypervel\Ai\Messages\ToolResultMessage; use Hypervel\Ai\Storage\DatabaseConversationStore; use Hypervel\Foundation\Testing\RefreshDatabase; use Hypervel\Http\Client\RequestException; use Hypervel\Support\Facades\DB; +use Hypervel\Support\Facades\Event; use Hypervel\Support\Facades\Http; use Hypervel\Testbench\Attributes\WithConfig; use Hypervel\Tests\Ai\Fixtures\Agents\RememberingAssistantAgent; @@ -244,6 +246,8 @@ public function testAStepThatDiesOnItsSecondCallKeepsTheResultOfTheFirst(): void 'usage' => ['input_tokens' => 10, 'output_tokens' => 5], ])]); + Event::listen(ToolFailed::class, fn (ToolFailed $event) => throw $event->exception); + $agent = (new RememberingFailingToolAgent)->forUser((object) ['id' => 1]); $this->assertThrows(fn () => $agent->prompt('Go', provider: 'anthropic'), Exception::class, 'Forced to throw exception.'); @@ -317,6 +321,8 @@ public function testAReplayedInterruptedCallKeepsTheCallIdTheResponsesApiPairsIt ]), ]); + Event::listen(ToolFailed::class, fn (ToolFailed $event) => throw $event->exception); + $agent = (new RememberingFailingToolAgent)->forUser((object) ['id' => 1]); $this->assertThrows(fn () => $agent->prompt('Go', provider: $provider), Exception::class, 'Forced to throw exception.'); diff --git a/tests/Ai/Feature/Providers/Anthropic/StreamingTest.php b/tests/Ai/Feature/Providers/Anthropic/StreamingTest.php index 0f4e5835f5..1af2ca6ced 100644 --- a/tests/Ai/Feature/Providers/Anthropic/StreamingTest.php +++ b/tests/Ai/Feature/Providers/Anthropic/StreamingTest.php @@ -18,6 +18,7 @@ use Hypervel\Ai\Streaming\Events\TextEnd; use Hypervel\Ai\Streaming\Events\TextStart; use Hypervel\Ai\Streaming\Events\ToolCall as ToolCallEvent; +use Hypervel\Ai\Streaming\Events\ToolResult as ToolResultEvent; use Hypervel\Support\Facades\Http; use Hypervel\Tests\Ai\Fixtures\Agents\ProviderOptionsWithToolsAgent; use Hypervel\Tests\Ai\Fixtures\AnthropicHelpers; @@ -181,6 +182,55 @@ public function testStreamingHandlesToolCalls(): void $this->assertSame('The number is 72019', TextDelta::combine($events)); } + public function testStreamingRunsToolCallsWhenTheMessageEndsWithEndTurn(): void + { + Http::fake([ + 'api.anthropic.com/*' => Http::sequence([ + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(0, ['type' => 'text_delta', 'text' => 'Let me generate two numbers.']), + $this->contentBlockStop(0), + $this->contentBlockStart(1, ['type' => 'tool_use', 'id' => 'toolu_1', 'name' => 'FixedNumberGenerator', 'input' => '']), + $this->contentBlockDelta(1, ['type' => 'input_json_delta', 'partial_json' => '{}']), + $this->contentBlockStop(1), + $this->contentBlockStart(2, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(2, ['type' => 'text_delta', 'text' => 'And another one.']), + $this->contentBlockStop(2), + $this->contentBlockStart(3, ['type' => 'tool_use', 'id' => 'toolu_2', 'name' => 'FixedNumberGenerator', 'input' => '']), + $this->contentBlockDelta(3, ['type' => 'input_json_delta', 'partial_json' => '{}']), + $this->contentBlockStop(3), + $this->messageDelta('end_turn', 5), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(0, ['type' => 'text_delta', 'text' => 'Both numbers are 72019']), + $this->contentBlockStop(0), + $this->messageDelta('end_turn', 10), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + ]), + ]); + + $events = $this->collectStreamEvents(agent: new ProviderOptionsWithToolsAgent); + + $toolResultEvents = array_values(array_filter($events, fn ($e): bool => $e instanceof ToolResultEvent)); + + $this->assertCount(2, Http::recorded()); + $this->assertCount(2, $toolResultEvents); + $this->assertSame('toolu_1', $toolResultEvents[0]->toolResult->id); + $this->assertSame('toolu_2', $toolResultEvents[1]->toolResult->id); + $this->assertStringEndsWith('Both numbers are 72019', TextDelta::combine($events)); + } + public function testStreamingHandlesThinkingBlocks(): void { Http::fake([ @@ -380,6 +430,135 @@ public function testStreamingDoesNotSeparateTextAfterAServerToolWhenTheModelAlre $this->assertSame(["First\n", 'Second'], array_map(fn (TextDelta $e): string => $e->delta, $textDeltas)); } + public function testStreamingContinuesAPausedStepThatRanNoToolsWithoutASeparator(): void + { + Http::fake([ + 'api.anthropic.com/*' => Http::sequence([ + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(0, ['type' => 'text_delta', 'text' => 'The latest figures show that']), + $this->contentBlockStop(0), + $this->messageDelta('pause_turn', 5), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(0, ['type' => 'text_delta', 'text' => ' revenue grew.']), + $this->contentBlockStop(0), + $this->messageDelta('end_turn', 5), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + ]), + ]); + + $events = $this->collectStreamEvents(); + + $textDeltas = array_values(array_filter($events, fn ($e): bool => $e instanceof TextDelta)); + + $this->assertSame('The latest figures show that revenue grew.', implode('', array_map(fn (TextDelta $e): string => $e->delta, $textDeltas))); + $this->assertSame('The latest figures show that revenue grew.', TextDelta::combine($events)); + } + + public function testStreamingSeparatesTextResumedAfterAPausedServerTool(): void + { + Http::fake([ + 'api.anthropic.com/*' => Http::sequence([ + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(0, ['type' => 'text_delta', 'text' => 'Let me check.']), + $this->contentBlockStop(0), + $this->contentBlockStart(1, ['type' => 'server_tool_use', 'id' => 'srvtoolu_1', 'name' => 'web_search']), + $this->contentBlockStop(1), + $this->messageDelta('pause_turn', 5), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(0, ['type' => 'text_delta', 'text' => 'Revenue grew.']), + $this->contentBlockStop(0), + $this->messageDelta('end_turn', 5), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + ]), + ]); + + $events = $this->collectStreamEvents(); + + $textDeltas = array_values(array_filter($events, fn ($e): bool => $e instanceof TextDelta)); + + $this->assertSame("Let me check.\n\nRevenue grew.", implode('', array_map(fn (TextDelta $e): string => $e->delta, $textDeltas))); + $this->assertSame("Let me check.\n\nRevenue grew.", TextDelta::combine($events)); + } + + public function testStreamingSeparatesTextResumedAfterATurnPausedTwice(): void + { + Http::fake([ + 'api.anthropic.com/*' => Http::sequence([ + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(0, ['type' => 'text_delta', 'text' => 'Let me check.']), + $this->contentBlockStop(0), + $this->contentBlockStart(1, ['type' => 'server_tool_use', 'id' => 'srvtoolu_1', 'name' => 'web_search']), + $this->contentBlockStop(1), + $this->messageDelta('pause_turn', 5), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'web_search_tool_result', 'tool_use_id' => 'srvtoolu_1', 'content' => []]), + $this->contentBlockStop(0), + $this->contentBlockStart(1, ['type' => 'server_tool_use', 'id' => 'srvtoolu_2', 'name' => 'web_search']), + $this->contentBlockStop(1), + $this->messageDelta('pause_turn', 5), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + Http::response( + body: $this->ssePayload([ + $this->messageStart(), + $this->contentBlockStart(0, ['type' => 'web_search_tool_result', 'tool_use_id' => 'srvtoolu_2', 'content' => []]), + $this->contentBlockStop(0), + $this->contentBlockStart(1, ['type' => 'text', 'text' => '']), + $this->contentBlockDelta(1, ['type' => 'text_delta', 'text' => 'Revenue grew.']), + $this->contentBlockStop(1), + $this->messageDelta('end_turn', 5), + ]), + status: 200, + headers: ['Content-Type' => 'text/event-stream'], + ), + ]), + ]); + + $events = $this->collectStreamEvents(); + + $textDeltas = array_values(array_filter($events, fn ($e): bool => $e instanceof TextDelta)); + + $this->assertSame("Let me check.\n\nRevenue grew.", implode('', array_map(fn (TextDelta $e): string => $e->delta, $textDeltas))); + $this->assertSame("Let me check.\n\nRevenue grew.", TextDelta::combine($events)); + } + public function testStreamingErrorEventStopsStream(): void { Http::fake([ diff --git a/tests/Ai/Feature/Providers/Anthropic/ToolCallLoopTest.php b/tests/Ai/Feature/Providers/Anthropic/ToolCallLoopTest.php index 27c1645b52..201bf6220d 100644 --- a/tests/Ai/Feature/Providers/Anthropic/ToolCallLoopTest.php +++ b/tests/Ai/Feature/Providers/Anthropic/ToolCallLoopTest.php @@ -91,6 +91,57 @@ public function testToolCallsTriggerFollowUpRequest(): void $this->assertTrue($hasToolResult, 'Follow-up request should include user message with tool_result block'); } + public function testToolCallsRunWhenTheMessageEndsWithEndTurn(): void + { + Http::fake([ + 'api.anthropic.com/*' => Http::sequence([ + Http::response([ + 'id' => 'msg_tool_123', + 'type' => 'message', + 'role' => 'assistant', + 'model' => 'claude-sonnet-4-6', + 'content' => [ + ['type' => 'text', 'text' => 'Let me generate a number.'], + ['type' => 'tool_use', 'id' => 'toolu_123', 'name' => 'FixedNumberGenerator', 'input' => new stdClass], + ], + 'stop_reason' => 'end_turn', + 'usage' => ['input_tokens' => 10, 'output_tokens' => 5], + ]), + $this->fakeTextResponse('The number is 72019'), + ]), + ]); + + $response = (new ToolUsingAgent(fixed: true))->prompt( + 'Generate a random number', + provider: 'anthropic', + ); + + $this->assertCount(2, Http::recorded()); + $this->assertSame('The number is 72019', $response->text); + } + + public function testToolCallsDoNotRunWhenTheMessageEndsWithMaxTokens(): void + { + Http::fake([ + 'api.anthropic.com/*' => Http::response([ + 'id' => 'msg_tool_123', + 'type' => 'message', + 'role' => 'assistant', + 'model' => 'claude-sonnet-4-6', + 'content' => [ + ['type' => 'text', 'text' => 'Let me generate a number.'], + ['type' => 'tool_use', 'id' => 'toolu_123', 'name' => 'FixedNumberGenerator', 'input' => new stdClass], + ], + 'stop_reason' => 'max_tokens', + 'usage' => ['input_tokens' => 10, 'output_tokens' => 5], + ]), + ]); + + (new ToolUsingAgent(fixed: true))->prompt('Generate a random number', provider: 'anthropic'); + + $this->assertCount(1, Http::recorded()); + } + public function testServerToolUseInputIsSerializedAsObjectOnFollowUpReplay(): void { Http::fake([ diff --git a/tests/Ai/Feature/Providers/Bedrock/StreamingTest.php b/tests/Ai/Feature/Providers/Bedrock/StreamingTest.php index ada4612d2a..dcf44b4e1b 100644 --- a/tests/Ai/Feature/Providers/Bedrock/StreamingTest.php +++ b/tests/Ai/Feature/Providers/Bedrock/StreamingTest.php @@ -21,6 +21,7 @@ use Hypervel\Ai\Streaming\Events\TextDelta; use Hypervel\Ai\Streaming\Events\TextEnd; use Hypervel\Ai\Streaming\Events\TextStart; +use Hypervel\Ai\Streaming\Events\ToolResult as ToolResultEvent; use Hypervel\JsonSchema\JsonSchema; use Hypervel\Tests\Ai\Fixtures\BedrockHelpers; use Hypervel\Tests\Ai\Fixtures\Tools\FixedNumberGenerator; @@ -147,6 +148,44 @@ public function testStreamingRoundTripsReasoningBlockOnFollowUpToolStep(): void $this->assertSame('FixedNumberGenerator', $assistantTurn['content'][1]['toolUse']['name']); } + public function testStreamingRunsToolCallsWhenTheMessageEndsWithEndTurn(): void + { + $mock = new MockHandler([ + new Result(['stream' => [ + $this->contentBlockStart(0), + $this->contentBlockDelta(0, ['text' => 'Let me generate a number.']), + $this->contentBlockStop(0), + $this->contentBlockStart(1, ['toolUse' => ['toolUseId' => 't1', 'name' => 'FixedNumberGenerator']]), + $this->contentBlockDelta(1, ['toolUse' => ['input' => '{}']]), + $this->contentBlockStop(1), + $this->messageStop('end_turn'), + ]]), + new Result(['stream' => [ + $this->contentBlockStart(0), + $this->contentBlockDelta(0, ['text' => 'The number is 72019']), + $this->contentBlockStop(0), + $this->messageStop('end_turn'), + ]]), + ]); + + $events = iterator_to_array( + (new TextGenerationLoop($this->gatewayWithClient($this->bedrockClient($mock))))->stream( + 'inv-1', + $this->bedrockProvider(), + 'anthropic.claude-opus-4-7-v1:0', + null, + tools: [new FixedNumberGenerator], + ), + preserve_keys: false, + ); + + $toolResults = array_values(array_filter($events, fn (StreamEvent $event): bool => $event instanceof ToolResultEvent)); + + $this->assertCount(1, $toolResults); + $this->assertSame('t1', $toolResults[0]->toolResult->id); + $this->assertStringEndsWith('The number is 72019', TextDelta::combine($events)); + } + public function testStreamingDoesNotRoundTripEmptyTextBlockOnFollowUpToolStep(): void { $mock = new MockHandler([ diff --git a/tests/Ai/Feature/Providers/Bedrock/ToolCallLoopTest.php b/tests/Ai/Feature/Providers/Bedrock/ToolCallLoopTest.php index 97c83f1d86..9f067efa1c 100644 --- a/tests/Ai/Feature/Providers/Bedrock/ToolCallLoopTest.php +++ b/tests/Ai/Feature/Providers/Bedrock/ToolCallLoopTest.php @@ -94,6 +94,45 @@ public function testMaxStepsLimitsToolCallDepth(): void $this->assertCount(2, $response->steps); } + public function testToolCallsRunWhenTheMessageEndsWithEndTurn(): void + { + $client = $this->fakeBedrockConverseSequence([ + ['stopReason' => 'end_turn'] + bedrockToolCallResponse('t1'), + bedrockTextResponse('The number is 72019'), + ]); + + $response = (new TextGenerationLoop($this->gatewayWithClient($client)))->generate( + $this->bedrockProvider(), + 'anthropic.claude-opus-4-7-v1:0', + null, + messages: [new UserMessage('Generate a number')], + tools: [new FixedNumberGenerator], + options: new TextGenerationOptions(maxSteps: 5), + ); + + $this->assertSame('The number is 72019', (string) $response); + $this->assertCount(1, $response->toolResults); + } + + public function testToolCallsDoNotRunWhenTheMessageEndsWithMaxTokens(): void + { + $client = $this->fakeBedrockConverseSequence([ + ['stopReason' => 'max_tokens'] + bedrockToolCallResponse('t1'), + ]); + + $response = (new TextGenerationLoop($this->gatewayWithClient($client)))->generate( + $this->bedrockProvider(), + 'anthropic.claude-opus-4-7-v1:0', + null, + messages: [new UserMessage('Generate a number')], + tools: [new FixedNumberGenerator], + options: new TextGenerationOptions(maxSteps: 5), + ); + + $this->assertCount(1, $response->steps); + $this->assertCount(0, $response->toolResults); + } + public function testUnknownToolCallThrowsNoSuchToolException(): void { $client = $this->fakeBedrockConverse([ diff --git a/tests/Ai/Feature/RememberConversationTest.php b/tests/Ai/Feature/RememberConversationTest.php index 3c3058c5d1..034f5b2fe5 100644 --- a/tests/Ai/Feature/RememberConversationTest.php +++ b/tests/Ai/Feature/RememberConversationTest.php @@ -937,9 +937,7 @@ public function testTitleCancellationSavesTheCompletedTurnBeforeRethrowing(bool if ($cleanupThrows) { $failure = new RuntimeException('Title cleanup failed.', previous: $failure); } - $loop = m::mock(TextGenerationLoop::class); - $loop->shouldReceive('generate')->once()->andThrow($failure); - $prompt->provider()->shouldReceive('textGenerationLoop')->once()->andReturn($loop); + $prompt->provider()->shouldReceive('prompt')->once()->andThrow($failure); $prompt->provider()->shouldReceive('cheapestTextModel')->once()->andReturn('title-model'); $response = $this->response(); @@ -957,9 +955,7 @@ public function testStorageFailurePreservesTitleCancellation(): void $prompt = $this->prompt(); $cancellation = new CanceledException('Title request canceled.'); $storageFailure = new RuntimeException('Conversation storage failed.'); - $loop = m::mock(TextGenerationLoop::class); - $loop->shouldReceive('generate')->once()->andThrow($cancellation); - $prompt->provider()->shouldReceive('textGenerationLoop')->once()->andReturn($loop); + $prompt->provider()->shouldReceive('prompt')->once()->andThrow($cancellation); $prompt->provider()->shouldReceive('cheapestTextModel')->once()->andReturn('title-model'); $store = m::mock(DatabaseConversationStore::class); $store->shouldReceive('storeTurn')->once()->andThrow($storageFailure); @@ -993,7 +989,9 @@ private function prompt(?Decisions $decisions = null): AgentPrompt */ private function context(AgentPrompt $prompt, ?DatabaseConversationStore $store = null, ?string $conversationId = null): RunContext { - return new RunContext('invocation', $prompt->agent, $prompt->provider(), 'model', $this->app->make(Dispatcher::class), approvalStore: $store, conversationId: $conversationId); + $context = new RunContext('invocation', $prompt->agent, $prompt->provider(), 'model', $this->app->make(Dispatcher::class)); + + return $store === null ? $context : $context->withApprovalStore($store, $conversationId); } /** diff --git a/tests/Ai/Feature/Storage/DatabaseConversationStoreTest.php b/tests/Ai/Feature/Storage/DatabaseConversationStoreTest.php index ffc1d9d029..47ce68ac4e 100644 --- a/tests/Ai/Feature/Storage/DatabaseConversationStoreTest.php +++ b/tests/Ai/Feature/Storage/DatabaseConversationStoreTest.php @@ -601,12 +601,13 @@ public function testABareRejectionResumeDoesNotPersistABlankAssistantRow(): void $this->assertSame(1, DB::table('agent_conversation_messages')->where('role', 'assistant')->count()); } - public function testAResumeFoldsItsStepsTextAndUsageIntoThePausedRow(): void + #[DataProvider('resumeStreamingModes')] + public function testAResumeFoldsItsStepsTextAndUsageIntoThePausedRow(bool $streamed, string $content): void { $store = new DatabaseConversationStore; $conversationId = $store->storeConversation('user', 1, 'Approval conversation'); - insertAssistantTurn($conversationId, 'paused-1', '', [ + insertAssistantTurn($conversationId, 'paused-1', 'Let me check.', [ assistantStep( [['id' => 'call-1', 'name' => 'DeleteFile', 'arguments' => []]], [['id' => 'call-1', 'name' => 'DeleteFile', 'arguments' => [], 'result' => 'Deleted', 'result_id' => null]], @@ -624,15 +625,24 @@ public function testAResumeFoldsItsStepsTextAndUsageIntoThePausedRow(): void approvalDecisions: Decisions::from(['call-1' => true]), ); - $response = new AgentResponse('invocation-id', 'Done.', new TextUsage(20, 7), new Meta('openai', 'gpt-5')); - $response->steps = collect([new Step('Done.', [], [], FinishReason::Stop, new TextUsage(20, 7), new Meta, '', [])]); + $step = new Step('Done.', [], [], FinishReason::Stop, new TextUsage(20, 7), new Meta, '', []); + + if ($streamed) { + $response = new StreamedAgentResponse('invocation-id', collect([ + new TextDelta('event-1', 'message-1', 'Done.', 0), + new StreamEnd('event-2', 'stop', new TextUsage(20, 7), 0, collect([$step])), + ]), new Meta('openai', 'gpt-5')); + } else { + $response = new AgentResponse('invocation-id', 'Done.', new TextUsage(20, 7), new Meta('openai', 'gpt-5')); + $response->steps = collect([$step]); + } $messageId = $store->storeAssistantMessage($conversationId, 'user', 1, $prompt, $response); $row = DB::table('agent_conversation_messages')->where('role', 'assistant')->sole(); $this->assertSame('paused-1', $messageId); - $this->assertSame('Done.', $row->content); + $this->assertSame($content, $row->content); $steps = json_decode($row->steps, true); $this->assertCount(2, $steps); $this->assertSame('Done.', $steps[1]['content']); @@ -642,6 +652,88 @@ public function testAResumeFoldsItsStepsTextAndUsageIntoThePausedRow(): void $this->assertSame('gpt-5', json_decode($row->meta, true)['model']); } + /** + * Provide the prompted and streamed resume modes with the content each stores. + */ + public static function resumeStreamingModes(): array + { + return [ + 'prompted' => [false, 'Done.'], + 'streamed' => [true, "Let me check.\n\nDone."], + ]; + } + + public function testAStreamedTurnThatPausesTwiceKeepsTheTextOfEveryStep(): void + { + $store = new DatabaseConversationStore; + $conversationId = $store->storeConversation('user', 1, 'Approval conversation'); + + insertAssistantTurn($conversationId, 'paused-1', 'Let me check.', [ + assistantStep([['id' => 'call-1', 'name' => 'DeleteFile', 'arguments' => []]]), + ], ['call-1' => 'Deletes a file']); + + $resume = fn (string $callId): AgentPrompt => new AgentPrompt( + new ToolUsingAgent, + '', + [], + m::mock(TextProvider::class), + 'test-model', + approvalDecisions: Decisions::from([$callId => true]), + ); + + $store->storeAssistantMessage($conversationId, 'user', 1, $resume('call-1'), new StreamedAgentResponse('invocation-1', collect([ + new TextDelta('event-1', 'message-1', 'Deleting.', 0), + new ToolApprovalRequest('event-2', collect([new PendingApproval('call-2', 'DeleteFile', [], 'Deletes a file')]), 0, collect([ + new Step('Deleting.', [new ToolCall('call-2', 'DeleteFile', [])], [], FinishReason::ToolCalls, new TextUsage, new Meta, '', []), + ])), + ]), new Meta('openai', 'gpt-5'))); + + $store->storeAssistantMessage($conversationId, 'user', 1, $resume('call-2'), new StreamedAgentResponse('invocation-2', collect([ + new TextDelta('event-3', 'message-2', 'Done.', 0), + new StreamEnd('event-4', 'stop', new TextUsage, 0, collect([ + new Step('Done.', [], [], FinishReason::Stop, new TextUsage, new Meta, '', []), + ])), + ]), new Meta('openai', 'gpt-5'))); + + $row = DB::table('agent_conversation_messages')->where('role', 'assistant')->sole(); + + $this->assertSame("Let me check.\n\nDeleting.\n\nDone.", $row->content); + $this->assertSame('completed', $row->status); + } + + public function testAStreamedResumeKeepsAContinuedStepInOneParagraph(): void + { + $store = new DatabaseConversationStore; + $conversationId = $store->storeConversation('user', 1, 'Approval conversation'); + + // The stream displayed a continuation without tools, such as a pause_turn, as one paragraph. + insertAssistantTurn($conversationId, 'paused-1', 'Hello', [ + assistantStep(content: 'Hel'), + assistantStep([['id' => 'call-1', 'name' => 'DeleteFile', 'arguments' => []]], content: 'lo'), + ], ['call-1' => 'Deletes a file']); + + $prompt = new AgentPrompt( + new ToolUsingAgent, + '', + [], + m::mock(TextProvider::class), + 'test-model', + approvalDecisions: Decisions::from(['call-1' => true]), + ); + + $store->storeAssistantMessage($conversationId, 'user', 1, $prompt, new StreamedAgentResponse('invocation-id', collect([ + new TextDelta('event-1', 'message-1', 'Done.', 0), + new StreamEnd('event-2', 'stop', new TextUsage, 0, collect([ + new Step('Done.', [], [], FinishReason::Stop, new TextUsage, new Meta, '', []), + ])), + ]), new Meta('openai', 'gpt-5'))); + + $row = DB::table('agent_conversation_messages')->where('role', 'assistant')->sole(); + + $this->assertSame("Hello\n\nDone.", $row->content); + $this->assertCount(3, json_decode($row->steps, true)); + } + public function testAResumeKeepsTheCitationsThePausedHalfOfTheTurnCollected(): void { $store = new DatabaseConversationStore; @@ -2078,7 +2170,7 @@ public function testAnUnclaimedRunCannotModifyThePausedTurn(): void $store = new DatabaseConversationStore; [$conversationId, $messageId] = $this->pause($store); $prompt = $this->prompt(Decisions::from(['call-1' => true])); - $prompt->setRunContext(new RunContext('invocation', $prompt->agent, $prompt->provider(), 'model', $this->app->make(Dispatcher::class), approvalStore: $store, conversationId: $conversationId)); + $prompt->setRunContext((new RunContext('invocation', $prompt->agent, $prompt->provider(), 'model', $this->app->make(Dispatcher::class)))->withApprovalStore($store, $conversationId)); $before = DB::table('agent_conversation_messages')->where('id', $messageId)->first(); try { @@ -2259,7 +2351,7 @@ private function pause(DatabaseConversationStore $store): array private function claimedPrompt(DatabaseConversationStore $store, string $conversationId): AgentPrompt { $prompt = $this->prompt(Decisions::from(['call-1' => true])); - $context = new RunContext('invocation', $prompt->agent, $prompt->provider(), 'model', $this->app->make(Dispatcher::class), approvalStore: $store, conversationId: $conversationId); + $context = (new RunContext('invocation', $prompt->agent, $prompt->provider(), 'model', $this->app->make(Dispatcher::class)))->withApprovalStore($store, $conversationId); $context->claimPendingApprovals(['call-1']); $prompt->setRunContext($context); diff --git a/tests/Ai/Feature/ToolFailureRecoveryTest.php b/tests/Ai/Feature/ToolFailureRecoveryTest.php new file mode 100644 index 0000000000..ff7a79070f --- /dev/null +++ b/tests/Ai/Feature/ToolFailureRecoveryTest.php @@ -0,0 +1,97 @@ +prompt('Generate'); + + $this->assertSame('The tool could not run.', $response->text); + $this->assertCount(1, $response->toolResults); + $this->assertFalse($response->toolResults[0]->successful()); + $this->assertSame('The tool call failed: Forced to throw exception.', $response->toolResults[0]->error()); + + Exceptions::assertReported(fn (Exception $exception): bool => $exception->getMessage() === 'Forced to throw exception.'); + } + + public function testAThrowingToolStreamsAFailedResult(): void + { + Exceptions::fake(); + + ThrowingToolAgent::fake([ + new ToolCall('call_1', 'FixedNumberGenerator', []), + 'The tool could not run.', + ]); + + $events = iterator_to_array((new ThrowingToolAgent)->stream('Generate'), false); + + $toolResults = array_values(array_filter($events, fn ($event): bool => $event instanceof ToolResult)); + + $this->assertCount(1, $toolResults); + $this->assertFalse($toolResults[0]->successful); + $this->assertSame('The tool call failed: Forced to throw exception.', $toolResults[0]->error); + $this->assertSame('The tool could not run.', TextDelta::combine(array_filter($events, fn ($event): bool => $event instanceof TextDelta))); + + Exceptions::assertReported(fn (Exception $exception): bool => $exception->getMessage() === 'Forced to throw exception.'); + } + + public function testAnExceptionFromAToolEventListenerStillFailsTheRun(): void + { + Exceptions::fake(); + + Event::listen(InvokingTool::class, fn () => throw new RuntimeException('Listener failed.')); + + ThrowingToolAgent::fake([ + new ToolCall('call_1', 'FixedNumberGenerator', []), + 'Never reached.', + ]); + + $this->assertThrows(fn (): mixed => (new ThrowingToolAgent)->prompt('Generate'), RuntimeException::class, 'Listener failed.'); + + Exceptions::assertNothingReported(); + } + + public function testAToolFailedListenerThatRethrowsFailsTheRunWithTheToolException(): void + { + Exceptions::fake(); + + Event::listen(ToolFailed::class, fn (ToolFailed $event) => throw $event->exception); + + ThrowingToolAgent::fake([ + new ToolCall('call_1', 'FixedNumberGenerator', []), + 'Never reached.', + ]); + + $this->assertThrows( + fn (): mixed => (new ThrowingToolAgent)->prompt('Generate'), + fn (Exception $exception): bool => ! $exception instanceof ToolExecutionException + && $exception->getMessage() === 'Forced to throw exception.', + ); + + Exceptions::assertNothingReported(); + } +} diff --git a/tests/Ai/Fixtures/Agents/RememberingUngatedApprovableAgent.php b/tests/Ai/Fixtures/Agents/RememberingUngatedApprovableAgent.php new file mode 100644 index 0000000000..877ec58558 --- /dev/null +++ b/tests/Ai/Fixtures/Agents/RememberingUngatedApprovableAgent.php @@ -0,0 +1,34 @@ +withoutApproval()]; + } +} diff --git a/tests/Ai/Fixtures/Agents/ThrowingToolAgent.php b/tests/Ai/Fixtures/Agents/ThrowingToolAgent.php new file mode 100644 index 0000000000..bdafd9098a --- /dev/null +++ b/tests/Ai/Fixtures/Agents/ThrowingToolAgent.php @@ -0,0 +1,31 @@ +prompt(Decisions::from(['call-1' => true])); - $context = new RunContext('invocation', $prompt->agent, $prompt->provider(), 'model', $this->app->make(Dispatcher::class), approvalStore: $store, conversationId: $conversationId); + $context = (new RunContext('invocation', $prompt->agent, $prompt->provider(), 'model', $this->app->make(Dispatcher::class)))->withApprovalStore($store, $conversationId); $context->claimPendingApprovals(['call-1']); $prompt->setRunContext($context); $before = DB::table('agent_conversation_messages')->where('id', $messageId)->first(); diff --git a/tests/Ai/Unit/Gateway/InvokesToolsTest.php b/tests/Ai/Unit/Gateway/InvokesToolsTest.php index 583a34c778..90795d5c3d 100644 --- a/tests/Ai/Unit/Gateway/InvokesToolsTest.php +++ b/tests/Ai/Unit/Gateway/InvokesToolsTest.php @@ -11,6 +11,7 @@ use Hypervel\Ai\Events\InvokingTool; use Hypervel\Ai\Events\ToolFailed; use Hypervel\Ai\Events\ToolInvoked; +use Hypervel\Ai\Exceptions\ToolExecutionException; use Hypervel\Ai\Gateway\Concerns\InvokesTools; use Hypervel\Ai\Gateway\RunContext; use Hypervel\Ai\Tools\Request; @@ -219,7 +220,7 @@ public function testAListenerThatThrowsIsNotReportedAsAToolFailure(): void $this->assertSame(0, $failed); } - public function testAFailingToolHandlerIsReportedAsAToolFailureAndRethrown(): void + public function testAFailingToolHandlerIsReportedAsAToolFailureAndRethrownWrappedSoTheLoopCanRecognizeIt(): void { $failure = null; @@ -236,8 +237,9 @@ public function testAFailingToolHandlerIsReportedAsAToolFailureAndRethrown(): vo try { toolInvokingGateway()->invoke($tool, ['a' => 1], stubRunContext($events)); $this->fail('Expected the tool handler to fail.'); - } catch (RuntimeException $caught) { - $this->assertSame($exception, $caught); + } catch (ToolExecutionException $caught) { + $this->assertSame($exception, $caught->exception); + $this->assertSame('Handler exploded.', $caught->exception->getMessage()); } $this->assertInstanceOf(ToolFailed::class, $failure); diff --git a/tests/Ai/Unit/Gateway/TextGenerationLoopTest.php b/tests/Ai/Unit/Gateway/TextGenerationLoopTest.php index 1503b9f9d8..fe4101fa7c 100644 --- a/tests/Ai/Unit/Gateway/TextGenerationLoopTest.php +++ b/tests/Ai/Unit/Gateway/TextGenerationLoopTest.php @@ -1605,7 +1605,7 @@ public function testEachResultIsPersistedBeforeTheNextToolRuns(): void }); $gateway = m::mock(StepTextGateway::class); $gateway->shouldReceive('generateTextStep')->once()->andReturn(new StepResponse('Finished', [], FinishReason::Stop, new TextUsage, new Meta)); - $context = new RunContext('invocation', m::mock(Agent::class), $provider, 'model', new Dispatcher, approvalStore: $store, conversationId: 'conversation'); + $context = (new RunContext('invocation', m::mock(Agent::class), $provider, 'model', new Dispatcher))->withApprovalStore($store, 'conversation'); (new TextGenerationLoop($gateway))->generate( $provider, @@ -1638,7 +1638,7 @@ public function testAnUnavailableClaimPreventsToolExecution(): void $store->shouldNotReceive('recordApprovalResult'); $tool = $this->approvalTool(); $tool->shouldNotReceive('handle'); - $context = new RunContext('invocation', m::mock(Agent::class), $provider, 'model', new Dispatcher, approvalStore: $store, conversationId: 'conversation'); + $context = (new RunContext('invocation', m::mock(Agent::class), $provider, 'model', new Dispatcher))->withApprovalStore($store, 'conversation'); $this->expectException(ApprovalMismatchException::class); @@ -1670,7 +1670,7 @@ public function testCancellationIsNotRecordedAsACompletedToolFailure(bool $clean } $tool = $this->approvalTool(); $tool->shouldReceive('handle')->once()->andThrow($exception); - $context = new RunContext('invocation', m::mock(Agent::class), $provider, 'model', new Dispatcher, approvalStore: $store, conversationId: 'conversation'); + $context = (new RunContext('invocation', m::mock(Agent::class), $provider, 'model', new Dispatcher))->withApprovalStore($store, 'conversation'); try { (new TextGenerationLoop($gateway))->generate( diff --git a/tests/Ai/Unit/Responses/StreamedAgentResponseTest.php b/tests/Ai/Unit/Responses/StreamedAgentResponseTest.php index c5dc745bf9..fab9d9204c 100644 --- a/tests/Ai/Unit/Responses/StreamedAgentResponseTest.php +++ b/tests/Ai/Unit/Responses/StreamedAgentResponseTest.php @@ -58,9 +58,11 @@ public function testAggregationPreservesStepTextReasoningAndUsage(): void new ReasoningDelta('reasoning-2', 'second', 'Second block.', 1), new ReasoningDelta('reasoning-3', 'first', 'block.', 1), new StreamEnd('end-1', 'tool_calls', new TextUsage(10, 4, 3, null, 1), 1), + new ToolResult('result-1', new ToolResultData('call-1', 'lookup', [], 'Found.'), true, null, 1), new StreamStart('start-2', 'openai', 'model', 2), new TextDelta('text-3', 'blank', " \n", 2), new ReasoningDelta('reasoning-4', 'blank', ' ', 2), + new ToolResult('result-2', new ToolResultData('call-2', 'lookup', [], 'Found.'), true, null, 2), new StreamStart('start-3', 'openai', 'model', 3), new TextDelta('text-4', 'block-3', 'Done.', 3), new StreamEnd('end-3', 'stop', new TextUsage(8, 2, null, null, 0), 3), @@ -69,11 +71,27 @@ public function testAggregationPreservesStepTextReasoningAndUsage(): void $response = new StreamedAgentResponse('invocation-id', $events, new Meta); $this->assertSame("Hello world.\n\nDone.", $response->text); + $this->assertSame(TextDelta::combine($events), $response->text); $this->assertSame("First block.\n\nSecond block.", $response->reasoning); $this->assertEquals(new TextUsage(18, 6, 3, null, 1), $response->usage); $this->assertSame($events, $response->events); } + public function testAggregationContinuesAStepThatRanNoToolsWithoutASeparator(): void + { + $events = collect([ + new StreamStart('start-1', 'anthropic', 'model', 1), + new TextDelta('text-1', 'block-1', 'The latest figures show that', 1), + new StreamStart('start-2', 'anthropic', 'model', 2), + new TextDelta('text-2', 'block-2', ' revenue grew.', 2), + ]); + + $response = new StreamedAgentResponse('invocation-id', $events, new Meta); + + $this->assertSame('The latest figures show that revenue grew.', $response->text); + $this->assertSame(TextDelta::combine($events), $response->text); + } + public function testAggregationRetainsSettledToolsCitationsAndTheLatestSteps(): void { $call = new ToolCallData('call-1', 'research', []); diff --git a/tests/Ai/Unit/Streaming/TextDeltaTest.php b/tests/Ai/Unit/Streaming/TextDeltaTest.php index 771ebad2d6..a6552dfabf 100644 --- a/tests/Ai/Unit/Streaming/TextDeltaTest.php +++ b/tests/Ai/Unit/Streaming/TextDeltaTest.php @@ -61,8 +61,10 @@ public function testCombineDropsAStepThatProducedOnlyWhitespace(): void $events = [ $this->stepStart(), $this->textDelta('message-1', 'First.'), + $this->toolResult('call-1'), $this->stepStart(), $this->textDelta('message-2', "\n"), + $this->toolResult('call-2'), $this->stepStart(), $this->textDelta('message-3', 'Second.'), ]; @@ -70,6 +72,18 @@ public function testCombineDropsAStepThatProducedOnlyWhitespace(): void $this->assertSame("First.\n\nSecond.", TextDelta::combine($events)); } + public function testCombineContinuesAStepThatRanNoToolsWithoutASeparator(): void + { + $events = [ + $this->stepStart(), + $this->textDelta('message-1', 'The latest figures show that'), + $this->stepStart(), + $this->textDelta('message-2', ' revenue grew.'), + ]; + + $this->assertSame('The latest figures show that revenue grew.', TextDelta::combine($events)); + } + public function testCombineIgnoresEventsThatAreNotTextDeltas(): void { $events = [ @@ -113,4 +127,12 @@ protected function stepStart(): StreamStart { return new StreamStart(uniqid(), 'fake', 'fake-model', time()); } + + /** + * Create the result event of a tool the step ran. + */ + protected function toolResult(string $callId): ToolResult + { + return new ToolResult(uniqid(), new ToolResultData($callId, 'get_weather', [], '12°C'), true, null, time()); + } } diff --git a/tests/Integration/Ai/AgentTest.php b/tests/Integration/Ai/AgentTest.php index 85d97eb4aa..831015133e 100644 --- a/tests/Integration/Ai/AgentTest.php +++ b/tests/Integration/Ai/AgentTest.php @@ -5,7 +5,6 @@ namespace Hypervel\Tests\Integration\Ai; use Closure; -use Exception; use Hypervel\Ai\Contracts\Agent; use Hypervel\Ai\Contracts\Conversational; use Hypervel\Ai\Contracts\HasProviderOptions; @@ -16,6 +15,7 @@ use Hypervel\Ai\Events\InvokingTool; use Hypervel\Ai\Events\PromptingAgent; use Hypervel\Ai\Events\StreamingAgent; +use Hypervel\Ai\Events\ToolFailed; use Hypervel\Ai\Events\ToolInvoked; use Hypervel\Ai\Files; use Hypervel\Ai\Files\LocalImage; @@ -472,22 +472,23 @@ public static function imageProviders(): iterable } #[DataProviderExternal(Providers::class, 'agents')] - public function testAgentToolExceptionHandlingIsNotMagical(string $provider, string $apiKey, string $model): void + public function testAThrowingToolReturnsItsFailureToTheModel(string $provider, string $apiKey, string $model): void { requiresApiKey($apiKey); Event::fake(); - $agent = new ToolUsingAgent(toolThrowsException: true); - - $this->expectException(Exception::class); - $this->expectExceptionMessageMatches('/^Forced to throw exception\.$/'); - - $agent->prompt( + $response = (new ToolUsingAgent(toolThrowsException: true))->prompt( 'Can I have a random number between 1 and 1000?', provider: $provider, model: $model, ); + + $this->assertNotEmpty($response->toolResults); + $this->assertSame('The tool call failed: Forced to throw exception.', $response->toolResults[0]->error()); + $this->assertNotEmpty($response->text); + + Event::assertDispatched(ToolFailed::class); } public function testOpenAiReplaysEchoedOutputBlocksOnAStoreFalseToolCallContinuation(): void From 63203b7880f72d0e5210d771289b0f0bf564cf7c Mon Sep 17 00:00:00 2001 From: Raj Siva-Rajah <5361908+binaryfire@users.noreply.github.com> Date: Tue, 3 Nov 2026 19:10:10 +0000 Subject: [PATCH 04/16] Report the size of empty file uploads in Telescope client requests A multipart upload of an empty file was recorded with a null size, because the size check treated 0 as missing. It now checks for null, as upstream does, so an empty attachment reports 0KB. Port of laravel/telescope#1782 at a5e100fd5c. Hypervel already reads the size of attached resources through their streams. Added ClientRequestWatcherTest::testClientRequestWatcherReportsTheSizeOfAnEmptyResourceFileUpload. Upstream's ViewWatcherTest realpath() change does not apply: the Hypervel test uses a temp directory path with no relative segments. The Telescope suite passes. --- src/telescope/src/Watchers/ClientRequestWatcher.php | 2 +- .../Telescope/Watchers/ClientRequestWatcherTest.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/telescope/src/Watchers/ClientRequestWatcher.php b/src/telescope/src/Watchers/ClientRequestWatcher.php index 3ef69d4472..43f88d87bd 100644 --- a/src/telescope/src/Watchers/ClientRequestWatcher.php +++ b/src/telescope/src/Watchers/ClientRequestWatcher.php @@ -178,7 +178,7 @@ protected function formatMultipartData(array $data): array $value = [ 'name' => $part['filename'] ?? null, - 'size' => $size ? ($size / 1000) . 'KB' : null, + 'size' => $size !== null ? ($size / 1000) . 'KB' : null, 'headers' => $part['headers'] ?? [], ]; } elseif (json_encode($part['contents']) === false) { diff --git a/tests/Telescope/Watchers/ClientRequestWatcherTest.php b/tests/Telescope/Watchers/ClientRequestWatcherTest.php index cc790e2605..240795e54f 100644 --- a/tests/Telescope/Watchers/ClientRequestWatcherTest.php +++ b/tests/Telescope/Watchers/ClientRequestWatcherTest.php @@ -806,6 +806,19 @@ public function testClientRequestWatcherHandlesResourceFileUploadWithFilenameAnd $this->assertSame(['foo' => 'bar'], $entry->content['payload']['image']['headers']); } + public function testClientRequestWatcherReportsTheSizeOfAnEmptyResourceFileUpload(): void + { + Http::fake([ + '*' => Http::response(null, 204), + ]); + + $file = UploadedFile::fake()->create('empty.txt', 0); + + Http::attach('file', $file->tempFile)->post('https://hypervel.org/fake-upload-file-route'); + + $this->assertSame('0KB', $this->loadTelescopeEntries()->first()->content['payload']['file']['size']); + } + public function testItStoresAndDisplaysArrayOfRequestHeaders(): void { Http::fake(['*' => '']); From eaff9e213217bc2c21be41405e7c1d59af70b3d4 Mon Sep 17 00:00:00 2001 From: Raj Siva-Rajah <5361908+binaryfire@users.noreply.github.com> Date: Tue, 3 Nov 2026 19:10:17 +0000 Subject: [PATCH 05/16] Sandbox the Telescope mail preview and keep the selected tab on back navigation These upstream changes share the rebuilt dashboard bundle, so they land together. Ported from laravel/telescope at a5e100fd5c. laravel/telescope#1781: the HTML mail preview ran the email's scripts in the dashboard's origin. MailHtmlController now returns the HTML with a sandbox Content-Security-Policy, an explicit text/html content type and nosniff, and the preview iframe gets the matching sandbox attribute. MailEmlController's return type is corrected from mixed to Response. Ported Http/RouteTest::testMailPreviewIsSandboxed. laravel/telescope#1783: Hypervel's dashboard already runs on Vue 3, Vue Router 4 and Bootstrap 5, but upstream's back-navigation fix was missing. RelatedEntries::activateTab() replaced the URL hash outside the router, so the router's stored location lost the hash and going back to an entry reopened its first tab. It now uses $router.replace({ hash }). Templates use {{ title }} as upstream. Ported the RelatedEntries "restores the selected tab when going back to the entry" test, the four routes.test.js tests and the queries preview stub's optional default slot. The overflow-tab test now mounts a router and checks the router-managed history state, and the Hypervel route test keeps only its per-section named-route coverage. Dist is rebuilt. The Telescope PHPUnit suite and the Telescope Vitest project pass, and vp check is clean. --- src/telescope/dist/app.css | 2 +- src/telescope/dist/app.js | 4 +- .../resources/js/components/IndexScreen.vue | 2 +- .../resources/js/components/PreviewScreen.vue | 2 +- .../js/components/RelatedEntries.test.js | 69 ++++++++++-- .../js/components/RelatedEntries.vue | 2 +- src/telescope/resources/js/routes.test.js | 100 +++++++++++++----- .../resources/js/screens/mail/preview.vue | 1 + .../js/screens/queries/preview.test.js | 2 +- .../Http/Controllers/MailEmlController.php | 3 +- .../Http/Controllers/MailHtmlController.php | 9 +- tests/Telescope/Http/RouteTest.php | 15 +++ 12 files changed, 166 insertions(+), 45 deletions(-) diff --git a/src/telescope/dist/app.css b/src/telescope/dist/app.css index bb5302e651..fbc7e05b77 100644 --- a/src/telescope/dist/app.css +++ b/src/telescope/dist/app.css @@ -1 +1 @@ -iframe[data-v-c5d02ac1]{border:none}.highlight[data-v-02fbbecb]{background-color:#ff647a}pre.sf-dump,pre.sf-dump .sf-dump-default{background:0 0!important}pre.sf-dump{margin-bottom:0!important;padding-left:0!important}.entryPointDescription a{color:#fff;font:12px Menlo,Monaco,Consolas,monospace;text-decoration:underline}.vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg)scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%)scale(1)}.vjs-check-controller .vjs-check-controller-inner{vertical-align:middle;box-sizing:border-box;z-index:1;cursor:pointer;background-color:#fff;border:1px solid #bfcbd9;border-radius:2px;width:16px;height:16px;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);display:inline-block;position:relative}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";transform-origin:50%;border:2px solid #fff;border-top:0;border-left:0;width:4px;height:8px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) 50ms;position:absolute;top:1px;left:4px;transform:rotate(45deg)scaleY(0)}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{background-color:#fff;border-radius:100%;height:4px;top:50%;left:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;z-index:-1;outline:none;margin:0;position:absolute;inset:0}.vjs-carets{cursor:pointer;position:absolute;right:0}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{line-height:20px;display:flex;position:relative}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff;border-radius:4px}.vjs-tree-node.is-highlight .vjs-tree-node-actions,.vjs-tree-node:hover .vjs-tree-node-actions{display:block}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node .vjs-tree-node-actions{background-color:#e6f7ff;border-radius:4px;padding:0 4px;display:none;position:absolute;top:0;right:0}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item{cursor:pointer}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item:hover{color:#1890ff}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark .vjs-tree-node-actions,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{-webkit-user-select:none;user-select:none;margin-right:4px;position:absolute;right:100%}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-key{white-space:nowrap}.vjs-value{word-break:break-word}.vjs-tree-node.dynamic-height .vjs-value{white-space:pre-wrap}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{text-align:left;font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}td[data-v-84a87f2a]{vertical-align:middle!important}#alertModal{z-index:99999;background:#00000080} +iframe[data-v-8cea1829]{border:none}.highlight[data-v-02fbbecb]{background-color:#ff647a}pre.sf-dump,pre.sf-dump .sf-dump-default{background:0 0!important}pre.sf-dump{margin-bottom:0!important;padding-left:0!important}.entryPointDescription a{color:#fff;font:12px Menlo,Monaco,Consolas,monospace;text-decoration:underline}.vjs-tree-brackets{cursor:pointer}.vjs-tree-brackets:hover{color:#1890ff}.vjs-check-controller{position:absolute;left:0}.vjs-check-controller.is-checked .vjs-check-controller-inner{background-color:#1890ff;border-color:#0076e4}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-checkbox:after{transform:rotate(45deg)scaleY(1)}.vjs-check-controller.is-checked .vjs-check-controller-inner.is-radio:after{transform:translate(-50%,-50%)scale(1)}.vjs-check-controller .vjs-check-controller-inner{vertical-align:middle;box-sizing:border-box;z-index:1;cursor:pointer;background-color:#fff;border:1px solid #bfcbd9;border-radius:2px;width:16px;height:16px;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);display:inline-block;position:relative}.vjs-check-controller .vjs-check-controller-inner:after{box-sizing:content-box;content:"";transform-origin:50%;border:2px solid #fff;border-top:0;border-left:0;width:4px;height:8px;transition:transform .15s cubic-bezier(.71,-.46,.88,.6) 50ms;position:absolute;top:1px;left:4px;transform:rotate(45deg)scaleY(0)}.vjs-check-controller .vjs-check-controller-inner.is-radio{border-radius:100%}.vjs-check-controller .vjs-check-controller-inner.is-radio:after{background-color:#fff;border-radius:100%;height:4px;top:50%;left:50%}.vjs-check-controller .vjs-check-controller-original{opacity:0;z-index:-1;outline:none;margin:0;position:absolute;inset:0}.vjs-carets{cursor:pointer;position:absolute;right:0}.vjs-carets svg{transition:transform .3s}.vjs-carets:hover{color:#1890ff}.vjs-carets-close{transform:rotate(-90deg)}.vjs-tree-node{line-height:20px;display:flex;position:relative}.vjs-tree-node.has-carets{padding-left:15px}.vjs-tree-node.has-carets.has-selector,.vjs-tree-node.has-selector{padding-left:30px}.vjs-tree-node.is-highlight,.vjs-tree-node:hover{background-color:#e6f7ff;border-radius:4px}.vjs-tree-node.is-highlight .vjs-tree-node-actions,.vjs-tree-node:hover .vjs-tree-node-actions{display:block}.vjs-tree-node .vjs-indent{display:flex;position:relative}.vjs-tree-node .vjs-indent-unit.has-line{border-left:1px dashed #bfcbd9}.vjs-tree-node .vjs-tree-node-actions{background-color:#e6f7ff;border-radius:4px;padding:0 4px;display:none;position:absolute;top:0;right:0}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item{cursor:pointer}.vjs-tree-node .vjs-tree-node-actions .vjs-tree-node-actions-item:hover{color:#1890ff}.vjs-tree-node.dark.is-highlight,.vjs-tree-node.dark .vjs-tree-node-actions,.vjs-tree-node.dark:hover{background-color:#2e4558}.vjs-node-index{-webkit-user-select:none;user-select:none;margin-right:4px;position:absolute;right:100%}.vjs-colon{white-space:pre}.vjs-comment{color:#bfcbd9}.vjs-key{white-space:nowrap}.vjs-value{word-break:break-word}.vjs-tree-node.dynamic-height .vjs-value{white-space:pre-wrap}.vjs-value-null,.vjs-value-undefined{color:#d55fde}.vjs-value-boolean,.vjs-value-number{color:#1d8ce0}.vjs-value-string{color:#13ce66}.vjs-tree{text-align:left;font-family:Monaco,Menlo,Consolas,Bitstream Vera Sans Mono,monospace;font-size:14px}.vjs-tree.is-virtual{overflow:auto}.vjs-tree.is-virtual .vjs-tree-node{white-space:nowrap}td[data-v-4281b226]{vertical-align:middle!important}#alertModal{z-index:99999;background:#00000080} diff --git a/src/telescope/dist/app.js b/src/telescope/dist/app.js index d923a48504..a9aeb8cec9 100644 --- a/src/telescope/dist/app.js +++ b/src/telescope/dist/app.js @@ -38,7 +38,7 @@ Arguments: `+Array.prototype.slice.call(r).join(``)+` `);r=e===-1?``:n.slice(e+1)}if(!e.stack)e.stack=r;else if(r){let t=r.indexOf(` `),n=t===-1?-1:r.indexOf(` `,t+1),i=n===-1?``:r.slice(n+1);String(e.stack).endsWith(i)||(e.stack+=` -`+r)}}catch{}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=wE(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&fD.assertOptions(n,{silentJSONParsing:pD.transitional(pD.boolean),forcedJSONParsing:pD.transitional(pD.boolean),clarifyTimeoutError:pD.transitional(pD.boolean),legacyInterceptorReqResOrdering:pD.transitional(pD.boolean),advertiseZstdAcceptEncoding:pD.transitional(pD.boolean),validateStatusUndefinedResolves:pD.transitional(pD.boolean)},!1),r!=null&&(K.isFunction(r)?t.paramsSerializer={serialize:r}:fD.assertOptions(r,{encode:pD.function,serialize:pD.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),fD.assertOptions(t,{baseUrl:pD.spelling(`baseURL`),withXsrfToken:pD.spelling(`withXSRFToken`)},!0),t.method=(K.getSafeProp(t,`method`)||K.getSafeProp(this.defaults,`method`)||`get`).toLowerCase();let a=i&&K.merge(i.common,i[t.method]);i&&K.forEach(ZT.concat(`common`),e=>{delete i[e]}),t.headers=mT.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||IT;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[cD.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);ucD.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=cD.call(this,f)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new rE(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function gD(e){return function(t){return e.apply(null,t)}}function _D(e){return K.isObject(e)&&e.isAxiosError===!0}var vD={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vD).forEach(([e,t])=>{vD[t]===void 0&&(vD[t]=e)});function yD(e){let t=new mD(e),n=EC(mD.prototype.request,t);return K.extend(n,mD.prototype,t,{allOwnKeys:!0}),K.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return yD(wE(e,t))},n}var bD=yD(eE);bD.Axios=mD,bD.CanceledError=rE,bD.CancelToken=hD,bD.isCancel=nE,bD.VERSION=GE,bD.toFormData=TT,bD.AxiosError=q,bD.Cancel=bD.CanceledError,bD.all=function(e){return Promise.all(e)},bD.spread=gD,bD.isAxiosError=_D,bD.mergeConfig=wE,bD.AxiosHeaders=mT,bD.formToJSON=e=>XT(K.isHTMLForm(e)?new FormData(e):e),bD.getAdapter=oD.getAdapter,bD.HttpStatusCode=vD,bD.default=bD;var xD=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},SD={methods:{recipientsCount(e){return CC.default.union(e.content.to?Object.keys(e.content.to):[],e.content.cc?Object.keys(e.content.cc):[],e.content.bcc?Object.keys(e.content.bcc):[],e.content.replyTo?Object.keys(e.content.replyTo):[]).length}}},CD=[`title`],wD={key:0,class:`badge badge-secondary ms-2`},TD=[`title`],ED={class:`table-fit text-end text-muted`},DD=[`data-timeago`,`title`],OD={class:`table-fit`};function kD(e,t,n,r,i,a){let o=I(`router-link`),s=I(`index-screen`);return L(),Us(s,{title:`Mail`,resource:`mail`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Mailable`),z(`th`,{scope:`col`,class:`text-end`},`Recipients`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(n=>[z(`td`,null,[z(`span`,{title:n.entry.content.mailable},N(e.truncate(n.entry.content.mailable||`-`,70)),9,CD),n.entry.content.queued?(L(),R(`span`,wD,` Queued `)):V(``,!0),t[1]||=z(`br`,null,null,-1),z(`small`,{class:`text-muted`,title:n.entry.content.subject},` Subject: `+N(e.truncate(n.entry.content.subject,90)),9,TD)]),z(`td`,ED,N(a.recipientsCount(n.entry)),1),z(`td`,{class:`table-fit text-muted`,"data-timeago":n.entry.created_at,title:n.entry.created_at},N(e.timeAgo(n.entry.created_at)),9,DD),z(`td`,OD,[B(o,{to:{name:`mail-preview`,params:{id:n.entry.id}},class:`control-action`},{default:F(()=>[...t[2]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var AD=xD(SD,[[`render`,kD]]),jD={methods:{hasAddresses(e){return!CC.default.isEmpty(e)},formatAddresses(e){return CC.default.chain(e).map((e,t)=>(e?`<`+e+`> `:``)+t).join(`, `).value()}},data(){return{entry:null,batch:[]}}},MD={key:0,class:`badge badge-secondary ms-2`},ND={key:0},PD={key:1},FD={key:2},ID=[`href`],LD={class:`card mt-5`},RD=[`src`];function zD(e,t,n,r,i,a){let o=I(`preview-screen`);return L(),Us(o,{title:`Mail Details`,resource:`mail`,id:e.$route.params.id},{"table-parameters":F(n=>[z(`tr`,null,[t[0]||=z(`td`,{class:`table-fit text-muted`},`Mailable`,-1),z(`td`,null,[Qs(N(n.entry.content.mailable)+` `,1),n.entry.content.queued?(L(),R(`span`,MD,` Queued `)):V(``,!0)])]),z(`tr`,null,[t[1]||=z(`td`,{class:`table-fit text-muted`},`From`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.from)),1)]),z(`tr`,null,[t[2]||=z(`td`,{class:`table-fit text-muted`},`To`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.to)),1)]),a.hasAddresses(n.entry.content.replyTo)?(L(),R(`tr`,ND,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Reply-To`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.replyTo)),1)])):V(``,!0),a.hasAddresses(n.entry.content.cc)?(L(),R(`tr`,PD,[t[4]||=z(`td`,{class:`table-fit text-muted`},`CC`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.cc)),1)])):V(``,!0),a.hasAddresses(n.entry.content.bcc)?(L(),R(`tr`,FD,[t[5]||=z(`td`,{class:`table-fit text-muted`},`BCC`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.bcc)),1)])):V(``,!0),z(`tr`,null,[t[6]||=z(`td`,{class:`table-fit text-muted`},`Subject`,-1),z(`td`,null,N(n.entry.content.subject),1)]),z(`tr`,null,[t[7]||=z(`td`,{class:`table-fit text-muted`},`Download`,-1),z(`td`,null,[z(`a`,{href:e.Telescope.basePath+`/telescope-api/mail/`+e.$route.params.id+`/download`},`Download .eml file`,8,ID)])])]),"after-attributes-card":F(()=>[z(`div`,LD,[z(`iframe`,{src:e.Telescope.basePath+`/telescope-api/mail/`+e.$route.params.id+`/preview`,width:`100%`,height:`400`},null,8,RD)])]),_:1},8,[`id`])}var BD=xD(jD,[[`render`,zD],[`__scopeId`,`data-v-c5d02ac1`]]),VD={},HD={key:0,scope:`col`},UD={key:1,scope:`col`,class:`text-end`},WD={key:2,scope:`col`},GD=[`title`],KD={class:`text-muted`},qD={key:1,class:`table-fit text-end text-muted`},JD=[`title`],YD={class:`text-muted`},XD={key:0},ZD={key:1},QD=[`data-timeago`,`title`],$D={class:`table-fit`},eO=[`data-timeago`,`title`],tO={key:1,class:`control-action text-center`},nO={class:`table-fit`};function rO(e,t){let n=I(`router-link`),r=I(`index-screen`);return L(),Us(r,{title:`Exceptions`,resource:`exceptions`},{"table-header":F(()=>[z(`tr`,null,[e.$route.query.family_hash?V(``,!0):(L(),R(`th`,HD,`Type`)),!e.$route.query.family_hash&&!e.$route.query.tag?(L(),R(`th`,UD,`#`)):V(``,!0),e.$route.query.family_hash?(L(),R(`th`,WD,`Message`)):V(``,!0),t[0]||=z(`th`,{scope:`col`,class:`text-end`},`Happened`,-1),t[1]||=z(`th`,{scope:`col`},`Resolved`,-1),t[2]||=z(`th`,{scope:`col`},null,-1)])]),row:F(r=>[e.$route.query.family_hash?V(``,!0):(L(),R(`td`,{key:0,title:r.entry.content.class},[Qs(N(e.truncate(r.entry.content.class,70)),1),t[3]||=z(`br`,null,null,-1),z(`small`,KD,N(e.truncate(r.entry.content.message,100)),1)],8,GD)),!e.$route.query.family_hash&&!e.$route.query.tag?(L(),R(`td`,qD,[z(`span`,null,N(r.entry.content.occurrences),1)])):V(``,!0),e.$route.query.family_hash?(L(),R(`td`,{key:2,title:r.entry.content.message},[Qs(N(e.truncate(r.entry.content.message,80)),1),t[4]||=z(`br`,null,null,-1),z(`small`,YD,[r.entry.content.user&&r.entry.content.user.email?(L(),R(`span`,XD,` User: `+N(r.entry.content.user.email)+` (`+N(r.entry.content.user.id)+`) `,1)):(L(),R(`span`,ZD,` User: N/A `))])],8,JD)):V(``,!0),z(`td`,{class:`table-fit text-end text-muted`,"data-timeago":r.entry.created_at,title:r.entry.created_at},N(e.timeAgo(r.entry.created_at)),9,QD),z(`td`,$D,[r.entry.content.resolved_at?(L(),R(`div`,{key:0,"data-timeago":r.entry.content.resolved_at,title:r.entry.content.resolved_at},N(e.timeAgo(r.entry.content.resolved_at)),9,eO)):V(``,!0),r.entry.content.resolved_at?V(``,!0):(L(),R(`div`,tO,[...t[5]||=[z(`svg`,{viewBox:`0 0 20 20`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`},[z(`path`,{fill:`#ef5753`,d:`M2.92893219,17.0710678 C6.83417511,20.9763107 13.1658249,20.9763107 17.0710678,17.0710678 C20.9763107,13.1658249 20.9763107,6.83417511 17.0710678,2.92893219 C13.1658249,-0.976310729 6.83417511,-0.976310729 2.92893219,2.92893219 C-0.976310729,6.83417511 -0.976310729,13.1658249 2.92893219,17.0710678 Z M9,5 L11,5 L11,11 L9,11 L9,5 Z M9,13 L11,13 L11,15 L9,15 L9,13 Z`,id:`Combined-Shape`})],-1)]]))]),z(`td`,nO,[B(n,{to:{name:`exception-preview`,params:{id:r.entry.id}},class:`control-action`},{default:F(()=>[...t[6]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var iO=xD(VD,[[`render`,rO]]),aO=u(s(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;i!==`object`&&i!==`function`||Object.isFrozen(r)||n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=``,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=``}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=new RegExp(y(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],(e[0]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,ee=`[a-zA-Z]\\w*`,T=`[a-zA-Z_]\\w*`,E=`\\b\\d+(\\.\\d+)?`,te=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,D=`\\b(0b[01]+)`,O=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,k=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},A={begin:`\\\\[\\s\\S]`,relevance:0},ne={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[A]},re={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[A]},ie={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ae=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},oe=ae(`//`,`$`),se=ae(`/\\*`,`\\*/`),ce=ae(`#`,`$`),le=Object.freeze({__proto__:null,APOS_STRING_MODE:ne,BACKSLASH_ESCAPE:A,BINARY_NUMBER_MODE:{scope:`number`,begin:D,relevance:0},BINARY_NUMBER_RE:D,COMMENT:ae,C_BLOCK_COMMENT_MODE:se,C_LINE_COMMENT_MODE:oe,C_NUMBER_MODE:{scope:`number`,begin:te,relevance:0},C_NUMBER_RE:te,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ce,IDENT_RE:ee,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:E,relevance:0},NUMBER_RE:E,PHRASAL_WORDS_MODE:ie,QUOTE_STRING_MODE:re,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[A,{begin:/\[/,end:/\]/,relevance:0,contains:[A]}]},RE_STARTERS_RE:O,SHEBANG:k,TITLE_MODE:{scope:`title`,begin:ee,relevance:0},UNDERSCORE_IDENT_RE:T,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:T,relevance:0}});function ue(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function de(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function j(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ue,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function fe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function pe(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function me(e,t){e.relevance===void 0&&(e.relevance=1)}var he=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ge=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],_e=`keyword`;function ve(e,t,n=_e){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ve(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,ye(n[0],n[1])]})}}function ye(e,t){return t?Number(t):+!be(e)}function be(e){return ge.includes(e.toLowerCase())}var xe={},Se=e=>{console.error(e)},Ce=(e,...t)=>{console.log(`WARN: ${e}`,...t)},we=(e,t)=>{xe[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),xe[`${e}/${t}`]=!0)},Te=Error();function Ee(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function De(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Se(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Te;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Se(`beginScope must be object`),Te;Ee(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Oe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Se(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Te;if(typeof e.endScope!=`object`||e.endScope===null)throw Se(`endScope must be object`),Te;Ee(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function ke(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function M(e){ke(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),De(e),Oe(e)}function Ae(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[de,pe,M,he].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[j,fe,me].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ve(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Me(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function je(e){return e?e.endsWithParent||je(e.starts):!1}function Me(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:je(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Ne=`11.12.0`,Pe=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Fe=i,Ie=a,Le=Symbol(`nomatch`),Re=7,ze=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=ne(n[1]);return t||(Ce(s.replace(`{}`,n[1])),Ce(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||ne(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(we(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),we(`10.7.0`,`Please use highlight(code, options) instead. +`+r)}}catch{}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=wE(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&fD.assertOptions(n,{silentJSONParsing:pD.transitional(pD.boolean),forcedJSONParsing:pD.transitional(pD.boolean),clarifyTimeoutError:pD.transitional(pD.boolean),legacyInterceptorReqResOrdering:pD.transitional(pD.boolean),advertiseZstdAcceptEncoding:pD.transitional(pD.boolean),validateStatusUndefinedResolves:pD.transitional(pD.boolean)},!1),r!=null&&(K.isFunction(r)?t.paramsSerializer={serialize:r}:fD.assertOptions(r,{encode:pD.function,serialize:pD.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),fD.assertOptions(t,{baseUrl:pD.spelling(`baseURL`),withXsrfToken:pD.spelling(`withXSRFToken`)},!0),t.method=(K.getSafeProp(t,`method`)||K.getSafeProp(this.defaults,`method`)||`get`).toLowerCase();let a=i&&K.merge(i.common,i[t.method]);i&&K.forEach(ZT.concat(`common`),e=>{delete i[e]}),t.headers=mT.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||IT;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[cD.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);ucD.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=cD.call(this,f)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new rE(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function gD(e){return function(t){return e.apply(null,t)}}function _D(e){return K.isObject(e)&&e.isAxiosError===!0}var vD={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vD).forEach(([e,t])=>{vD[t]===void 0&&(vD[t]=e)});function yD(e){let t=new mD(e),n=EC(mD.prototype.request,t);return K.extend(n,mD.prototype,t,{allOwnKeys:!0}),K.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return yD(wE(e,t))},n}var bD=yD(eE);bD.Axios=mD,bD.CanceledError=rE,bD.CancelToken=hD,bD.isCancel=nE,bD.VERSION=GE,bD.toFormData=TT,bD.AxiosError=q,bD.Cancel=bD.CanceledError,bD.all=function(e){return Promise.all(e)},bD.spread=gD,bD.isAxiosError=_D,bD.mergeConfig=wE,bD.AxiosHeaders=mT,bD.formToJSON=e=>XT(K.isHTMLForm(e)?new FormData(e):e),bD.getAdapter=oD.getAdapter,bD.HttpStatusCode=vD,bD.default=bD;var xD=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},SD={methods:{recipientsCount(e){return CC.default.union(e.content.to?Object.keys(e.content.to):[],e.content.cc?Object.keys(e.content.cc):[],e.content.bcc?Object.keys(e.content.bcc):[],e.content.replyTo?Object.keys(e.content.replyTo):[]).length}}},CD=[`title`],wD={key:0,class:`badge badge-secondary ms-2`},TD=[`title`],ED={class:`table-fit text-end text-muted`},DD=[`data-timeago`,`title`],OD={class:`table-fit`};function kD(e,t,n,r,i,a){let o=I(`router-link`),s=I(`index-screen`);return L(),Us(s,{title:`Mail`,resource:`mail`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Mailable`),z(`th`,{scope:`col`,class:`text-end`},`Recipients`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(n=>[z(`td`,null,[z(`span`,{title:n.entry.content.mailable},N(e.truncate(n.entry.content.mailable||`-`,70)),9,CD),n.entry.content.queued?(L(),R(`span`,wD,` Queued `)):V(``,!0),t[1]||=z(`br`,null,null,-1),z(`small`,{class:`text-muted`,title:n.entry.content.subject},` Subject: `+N(e.truncate(n.entry.content.subject,90)),9,TD)]),z(`td`,ED,N(a.recipientsCount(n.entry)),1),z(`td`,{class:`table-fit text-muted`,"data-timeago":n.entry.created_at,title:n.entry.created_at},N(e.timeAgo(n.entry.created_at)),9,DD),z(`td`,OD,[B(o,{to:{name:`mail-preview`,params:{id:n.entry.id}},class:`control-action`},{default:F(()=>[...t[2]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var AD=xD(SD,[[`render`,kD]]),jD={methods:{hasAddresses(e){return!CC.default.isEmpty(e)},formatAddresses(e){return CC.default.chain(e).map((e,t)=>(e?`<`+e+`> `:``)+t).join(`, `).value()}},data(){return{entry:null,batch:[]}}},MD={key:0,class:`badge badge-secondary ms-2`},ND={key:0},PD={key:1},FD={key:2},ID=[`href`],LD={class:`card mt-5`},RD=[`src`];function zD(e,t,n,r,i,a){let o=I(`preview-screen`);return L(),Us(o,{title:`Mail Details`,resource:`mail`,id:e.$route.params.id},{"table-parameters":F(n=>[z(`tr`,null,[t[0]||=z(`td`,{class:`table-fit text-muted`},`Mailable`,-1),z(`td`,null,[Qs(N(n.entry.content.mailable)+` `,1),n.entry.content.queued?(L(),R(`span`,MD,` Queued `)):V(``,!0)])]),z(`tr`,null,[t[1]||=z(`td`,{class:`table-fit text-muted`},`From`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.from)),1)]),z(`tr`,null,[t[2]||=z(`td`,{class:`table-fit text-muted`},`To`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.to)),1)]),a.hasAddresses(n.entry.content.replyTo)?(L(),R(`tr`,ND,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Reply-To`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.replyTo)),1)])):V(``,!0),a.hasAddresses(n.entry.content.cc)?(L(),R(`tr`,PD,[t[4]||=z(`td`,{class:`table-fit text-muted`},`CC`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.cc)),1)])):V(``,!0),a.hasAddresses(n.entry.content.bcc)?(L(),R(`tr`,FD,[t[5]||=z(`td`,{class:`table-fit text-muted`},`BCC`,-1),z(`td`,null,N(a.formatAddresses(n.entry.content.bcc)),1)])):V(``,!0),z(`tr`,null,[t[6]||=z(`td`,{class:`table-fit text-muted`},`Subject`,-1),z(`td`,null,N(n.entry.content.subject),1)]),z(`tr`,null,[t[7]||=z(`td`,{class:`table-fit text-muted`},`Download`,-1),z(`td`,null,[z(`a`,{href:e.Telescope.basePath+`/telescope-api/mail/`+e.$route.params.id+`/download`},`Download .eml file`,8,ID)])])]),"after-attributes-card":F(()=>[z(`div`,LD,[z(`iframe`,{src:e.Telescope.basePath+`/telescope-api/mail/`+e.$route.params.id+`/preview`,sandbox:`allow-popups allow-popups-to-escape-sandbox`,width:`100%`,height:`400`},null,8,RD)])]),_:1},8,[`id`])}var BD=xD(jD,[[`render`,zD],[`__scopeId`,`data-v-8cea1829`]]),VD={},HD={key:0,scope:`col`},UD={key:1,scope:`col`,class:`text-end`},WD={key:2,scope:`col`},GD=[`title`],KD={class:`text-muted`},qD={key:1,class:`table-fit text-end text-muted`},JD=[`title`],YD={class:`text-muted`},XD={key:0},ZD={key:1},QD=[`data-timeago`,`title`],$D={class:`table-fit`},eO=[`data-timeago`,`title`],tO={key:1,class:`control-action text-center`},nO={class:`table-fit`};function rO(e,t){let n=I(`router-link`),r=I(`index-screen`);return L(),Us(r,{title:`Exceptions`,resource:`exceptions`},{"table-header":F(()=>[z(`tr`,null,[e.$route.query.family_hash?V(``,!0):(L(),R(`th`,HD,`Type`)),!e.$route.query.family_hash&&!e.$route.query.tag?(L(),R(`th`,UD,`#`)):V(``,!0),e.$route.query.family_hash?(L(),R(`th`,WD,`Message`)):V(``,!0),t[0]||=z(`th`,{scope:`col`,class:`text-end`},`Happened`,-1),t[1]||=z(`th`,{scope:`col`},`Resolved`,-1),t[2]||=z(`th`,{scope:`col`},null,-1)])]),row:F(r=>[e.$route.query.family_hash?V(``,!0):(L(),R(`td`,{key:0,title:r.entry.content.class},[Qs(N(e.truncate(r.entry.content.class,70)),1),t[3]||=z(`br`,null,null,-1),z(`small`,KD,N(e.truncate(r.entry.content.message,100)),1)],8,GD)),!e.$route.query.family_hash&&!e.$route.query.tag?(L(),R(`td`,qD,[z(`span`,null,N(r.entry.content.occurrences),1)])):V(``,!0),e.$route.query.family_hash?(L(),R(`td`,{key:2,title:r.entry.content.message},[Qs(N(e.truncate(r.entry.content.message,80)),1),t[4]||=z(`br`,null,null,-1),z(`small`,YD,[r.entry.content.user&&r.entry.content.user.email?(L(),R(`span`,XD,` User: `+N(r.entry.content.user.email)+` (`+N(r.entry.content.user.id)+`) `,1)):(L(),R(`span`,ZD,` User: N/A `))])],8,JD)):V(``,!0),z(`td`,{class:`table-fit text-end text-muted`,"data-timeago":r.entry.created_at,title:r.entry.created_at},N(e.timeAgo(r.entry.created_at)),9,QD),z(`td`,$D,[r.entry.content.resolved_at?(L(),R(`div`,{key:0,"data-timeago":r.entry.content.resolved_at,title:r.entry.content.resolved_at},N(e.timeAgo(r.entry.content.resolved_at)),9,eO)):V(``,!0),r.entry.content.resolved_at?V(``,!0):(L(),R(`div`,tO,[...t[5]||=[z(`svg`,{viewBox:`0 0 20 20`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`},[z(`path`,{fill:`#ef5753`,d:`M2.92893219,17.0710678 C6.83417511,20.9763107 13.1658249,20.9763107 17.0710678,17.0710678 C20.9763107,13.1658249 20.9763107,6.83417511 17.0710678,2.92893219 C13.1658249,-0.976310729 6.83417511,-0.976310729 2.92893219,2.92893219 C-0.976310729,6.83417511 -0.976310729,13.1658249 2.92893219,17.0710678 Z M9,5 L11,5 L11,11 L9,11 L9,5 Z M9,13 L11,13 L11,15 L9,15 L9,13 Z`,id:`Combined-Shape`})],-1)]]))]),z(`td`,nO,[B(n,{to:{name:`exception-preview`,params:{id:r.entry.id}},class:`control-action`},{default:F(()=>[...t[6]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var iO=xD(VD,[[`render`,rO]]),aO=u(s(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;i!==`object`&&i!==`function`||Object.isFrozen(r)||n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=``,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=``}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=new RegExp(y(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],(e[0]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,ee=`[a-zA-Z]\\w*`,T=`[a-zA-Z_]\\w*`,E=`\\b\\d+(\\.\\d+)?`,te=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,D=`\\b(0b[01]+)`,O=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,k=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},A={begin:`\\\\[\\s\\S]`,relevance:0},ne={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[A]},re={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[A]},ie={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ae=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},oe=ae(`//`,`$`),se=ae(`/\\*`,`\\*/`),ce=ae(`#`,`$`),le=Object.freeze({__proto__:null,APOS_STRING_MODE:ne,BACKSLASH_ESCAPE:A,BINARY_NUMBER_MODE:{scope:`number`,begin:D,relevance:0},BINARY_NUMBER_RE:D,COMMENT:ae,C_BLOCK_COMMENT_MODE:se,C_LINE_COMMENT_MODE:oe,C_NUMBER_MODE:{scope:`number`,begin:te,relevance:0},C_NUMBER_RE:te,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ce,IDENT_RE:ee,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:E,relevance:0},NUMBER_RE:E,PHRASAL_WORDS_MODE:ie,QUOTE_STRING_MODE:re,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[A,{begin:/\[/,end:/\]/,relevance:0,contains:[A]}]},RE_STARTERS_RE:O,SHEBANG:k,TITLE_MODE:{scope:`title`,begin:ee,relevance:0},UNDERSCORE_IDENT_RE:T,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:T,relevance:0}});function ue(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function de(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function j(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ue,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function fe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function pe(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function me(e,t){e.relevance===void 0&&(e.relevance=1)}var he=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ge=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],_e=`keyword`;function ve(e,t,n=_e){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ve(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,ye(n[0],n[1])]})}}function ye(e,t){return t?Number(t):+!be(e)}function be(e){return ge.includes(e.toLowerCase())}var xe={},Se=e=>{console.error(e)},Ce=(e,...t)=>{console.log(`WARN: ${e}`,...t)},we=(e,t)=>{xe[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),xe[`${e}/${t}`]=!0)},Te=Error();function Ee(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function De(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Se(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Te;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Se(`beginScope must be object`),Te;Ee(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Oe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Se(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Te;if(typeof e.endScope!=`object`||e.endScope===null)throw Se(`endScope must be object`),Te;Ee(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function ke(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function M(e){ke(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),De(e),Oe(e)}function Ae(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[de,pe,M,he].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[j,fe,me].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=ve(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Me(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function je(e){return e?e.endsWithParent||je(e.starts):!1}function Me(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:je(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Ne=`11.12.0`,Pe=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Fe=i,Ie=a,Le=Symbol(`nomatch`),Re=7,ze=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=ne(n[1]);return t||(Ce(s.replace(`{}`,n[1])),Ce(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||ne(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(we(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),we(`10.7.0`,`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ce(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ce(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!O.keywords){A.addText(re);return}let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(re),n=``;for(;t;){n+=re.substring(e,t.index);let r=E.case_insensitive?t[0].toLowerCase():t[0],i=u(O,r);if(i){let[e,a]=i;if(A.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Re&&(ie+=a),e.startsWith(`_`))n+=t[0];else{let n=E.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(re)}n+=re.substring(e),A.addText(n)}function f(){if(re===``)return;let e=null;if(typeof O.subLanguage==`string`){if(!t[O.subLanguage]){A.addText(re);return}e=v(O.subLanguage,re,!0,k[O.subLanguage]),k[O.subLanguage]=e._top}else e=S(re,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(ie+=e.relevance),A.__addSublanguage(e._emitter,e.language)}function p(){O.subLanguage==null?d():f(),re=``}function m(e,t){e!==``&&(A.startScope(t),A.addText(e),A.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=E.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(re=i,d(),re=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&A.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(re,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),re=``):e.beginScope._multi&&(h(e.beginScope,t),re=``)),O=Object.create(e,{parent:{value:O}}),O}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return O.matcher.regexIndex===0?(re+=e[0],1):(se=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?re+=t:(n.excludeBegin&&(re+=t),p(),!n.returnBegin&&!n.excludeBegin&&(re=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(O,e,r);if(!i)return Le;let a=O;O.endScope&&O.endScope._wrap?(p(),m(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(p(),h(O.endScope,e)):a.skip?re+=t:(a.returnEnd||a.excludeEnd||(re+=t),p(),a.excludeEnd&&(re=t));do O.scope&&A.closeNode(),!O.skip&&!O.subLanguage&&(ie+=O.relevance),O=O.parent;while(O!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=O;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>A.openNode(e))}let ee={};function T(t,r){let a=r&&r[0];if(re+=t,a==null)return p(),0;if(ee.type===`begin`&&r.type===`end`&&ee.index===r.index&&a===``){if(re+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=ee.rule,t}return 1}if(ee=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(O.scope||``)+`"`);throw e.mode=O,e}if(r.type===`end`){let e=C(r);if(e!==Le)return e}if(r.type===`illegal`&&a===``)return r.index===n.length||(re+=` `),1;if(oe>1e5&&oe>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return re+=a,a.length}let E=ne(e);if(!E)throw Se(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let te=Ae(E),D=``,O=a||te,k={},A=new l.__emitter(l);w();let re=``,ie=0,ae=0,oe=0,se=!1;try{if(E.__emitTokens)E.__emitTokens(n,A);else{for(O.matcher.considerAll();;){oe++,se?se=!1:O.matcher.considerAll(),O.matcher.lastIndex=ae;let e=O.matcher.exec(n);if(!e)break;let t=T(n.substring(ae,e.index),e);ae=e.index+t}T(n.substring(ae))}return A.finalize(),D=A.toHTML(),{language:e,value:D,relevance:ie,illegal:!1,_emitter:A,_top:O}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Fe(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:ae,context:n.slice(ae-100,ae+100),mode:t.mode,resultSoFar:D},_emitter:A};if(o)return{language:e,value:Fe(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:O};throw t}}function b(e){let t={value:Fe(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(ne).filter(ie).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(ne(e.language).supersetOf===t.language)return 1;if(ne(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ce(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Pe(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ce(`after:highlightElement`,{el:e,result:i,text:r})}function ee(e){l=Ie(l,e)}let T=()=>{D(),we(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function E(){D(),we(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let te=!1;function D(){function e(){D()}document.readyState===`loading`?(te||window.addEventListener(`DOMContentLoaded`,e,!1),te=!0):document.querySelectorAll(l.cssSelector).forEach(w)}function O(n,r){let i=null;try{i=r(e)}catch(e){if(Se(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Se(e);else throw e;i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&re(i.aliases,{languageName:n})}function k(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function A(){return Object.keys(t)}function ne(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function re(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function ie(e){let t=ne(e);return t&&!t.disableAutodetect}function ae(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function oe(e){ae(e),a.push(e)}function se(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ce(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ue(e){return we(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),we(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:D,highlightElement:w,highlightBlock:ue,configure:ee,initHighlighting:T,initHighlightingOnLoad:E,registerLanguage:O,unregisterLanguage:k,listLanguages:A,getLanguage:ne,registerAliases:re,autoDetection:ie,inherit:Ie,addPlugin:oe,removePlugin:se}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Ne,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in le)typeof le[e]==`object`&&n(le[e]);return Object.assign(e,le),e},Be=ze({});Be.newInstance=()=>ze({}),t.exports=Be,Be.HighlightJS=Be,Be.default=Be}))()).default;function oO(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ ]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},ee={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,h,x]},T={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[ee]};ee.contains.push(T);let E=[w,C,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,h,x],te={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...E]},...E,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[te,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,T,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,te,o,C,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}aO.registerLanguage(`php`,oO);var sO={props:[`lines`,`highlightedLine`],methods:{highlight(e){return aO.highlight(e,{language:`php`}).value}}},cO={class:`code-bg px-4 mb-0 text-white`},lO={class:`me-4`},uO={key:0},dO=[`innerHTML`];function fO(e,t,n,r,i,a){return L(),R(`pre`,cO,[t[1]||=Qs(` `,-1),(L(!0),R(Ns,null,za(n.lines,(e,r)=>(L(),R(`p`,{key:r,class:M([`mb-0`,{highlight:r==n.highlightedLine}])},[z(`span`,lO,N(r),1),t[0]||=Qs(),r==n.highlightedLine?(L(),R(`span`,uO,N(e),1)):(L(),R(`span`,{key:1,innerHTML:a.highlight(e)},null,8,dO))],2))),128)),t[2]||=Qs(` @@ -68,4 +68,4 @@ If possible, please select a more specific dialect (like sqlite, postgresql, etc `;case Z.SINGLE_INDENT:return this.indentation.getSingleIndent();default:return e}}},hL=e=>e===Z.SPACE||e===Z.SINGLE_INDENT,gL=e=>e===Z.SPACE||e===Z.SINGLE_INDENT||e===Z.NEWLINE;function _L(e,t){if(t===`standard`)return e;let n=[];return e.length>=10&&e.includes(` `)&&([e,...n]=e.split(` `)),e=t===`tabularLeft`?e.padEnd(9,` `):e.padStart(9,` `),e+[``,...n].join(` `)}function vL(e){return Cj(e)||e===Y.RESERVED_CLAUSE||e===Y.RESERVED_SELECT||e===Y.RESERVED_SET_OPERATION||e===Y.RESERVED_JOIN||e===Y.LIMIT}var yL=`top-level`,bL=`block-level`,xL=class{constructor(e){this.indent=e,this.indentTypes=[]}getSingleIndent(){return this.indent}getLevel(){return this.indentTypes.length}increaseTopLevel(){this.indentTypes.push(yL)}increaseBlockLevel(){this.indentTypes.push(bL)}decreaseTopLevel(){this.indentTypes.length>0&&nI(this.indentTypes)===yL&&this.indentTypes.pop()}decreaseBlockLevel(){for(;this.indentTypes.length>0&&this.indentTypes.pop()===yL;);}},SL=class extends mL{constructor(e){super(new xL(``)),this.expressionWidth=e,this.length=0,this.trailingSpace=!1}add(...e){if(e.forEach(e=>this.addToLength(e)),this.length>this.expressionWidth)throw new CL;super.add(...e)}addToLength(e){if(typeof e==`string`)this.length+=e.length,this.trailingSpace=!1;else if(e===Z.MANDATORY_NEWLINE||e===Z.NEWLINE)throw new CL;else e===Z.INDENT||e===Z.SINGLE_INDENT||e===Z.SPACE?this.trailingSpace||=(this.length++,!0):(e===Z.NO_NEWLINE||e===Z.NO_SPACE)&&this.trailingSpace&&(this.trailingSpace=!1,this.length--)}},CL=class extends Error{},wL=class e{constructor({cfg:e,dialectCfg:t,params:n,layout:r,inline:i=!1,enclosingParenthesis:a}){this.inline=!1,this.nodes=[],this.index=-1,this.cfg=e,this.dialectCfg=t,this.inline=i,this.params=n,this.layout=r,this.enclosingParenthesis=a}format(e){for(this.nodes=e,this.index=0;this.index{this.layout.add(this.showFunctionKw(e.nameKw))}),this.formatNode(e.parenthesis)}formatParameterizedDataType(e){this.withComments(e.dataType,()=>{this.layout.add(this.showDataType(e.dataType))}),this.formatNode(e.parenthesis)}formatArraySubscript(e){let t;switch(e.array.type){case X.data_type:t=this.showDataType(e.array);break;case X.keyword:t=this.showKw(e.array);break;default:t=this.showIdentifier(e.array)}this.withComments(e.array,()=>{this.layout.add(t)}),this.formatNode(e.parenthesis)}formatPropertyAccess(e){this.formatNode(e.object),this.layout.add(Z.NO_SPACE,e.operator),this.formatNode(e.property)}formatParenthesis(e){let t=this.formatInlineExpression(e.children,e.openParen);t?(this.layout.add(e.openParen),this.layout.add(...t.getLayoutItems()),this.layout.add(Z.NO_SPACE,e.closeParen,Z.SPACE)):(this.layout.add(e.openParen,Z.NEWLINE),RI(this.cfg)?(this.layout.add(Z.INDENT),this.layout=this.formatSubExpression(e.children,e.openParen)):(this.layout.indentation.increaseBlockLevel(),this.layout.add(Z.INDENT),this.layout=this.formatSubExpression(e.children,e.openParen),this.layout.indentation.decreaseBlockLevel()),this.layout.add(Z.NEWLINE,Z.INDENT,e.closeParen,Z.SPACE))}formatBetweenPredicate(e){this.layout.add(this.showKw(e.betweenKw),Z.SPACE),this.layout=this.formatSubExpression(e.expr1),this.layout.add(Z.NO_SPACE,Z.SPACE,this.showNonTabularKw(e.andKw),Z.SPACE),this.layout=this.formatSubExpression(e.expr2),this.layout.add(Z.NO_SPACE,Z.SPACE)}formatCaseExpression(e){this.formatNode(e.caseKw),this.layout.indentation.increaseBlockLevel(),this.layout=this.formatSubExpression(e.expr),this.layout=this.formatSubExpression(e.clauses),this.layout.indentation.decreaseBlockLevel(),this.layout.add(Z.NEWLINE,Z.INDENT),this.formatNode(e.endKw)}formatCaseWhen(e){this.layout.add(Z.NEWLINE,Z.INDENT),this.formatNode(e.whenKw),this.layout=this.formatSubExpression(e.condition),this.formatNode(e.thenKw),this.layout=this.formatSubExpression(e.result)}formatCaseElse(e){this.layout.add(Z.NEWLINE,Z.INDENT),this.formatNode(e.elseKw),this.layout=this.formatSubExpression(e.result)}formatClause(e){this.isOnelineClause(e)?this.formatClauseInOnelineStyle(e):RI(this.cfg)?this.formatClauseInTabularStyle(e):this.formatClauseInIndentedStyle(e)}isOnelineClause(e){return RI(this.cfg)?this.dialectCfg.tabularOnelineClauses[e.nameKw.text]:this.dialectCfg.onelineClauses[e.nameKw.text]}formatClauseInIndentedStyle(e){this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e.nameKw),Z.NEWLINE),this.layout.indentation.increaseTopLevel(),this.layout.add(Z.INDENT),this.layout=this.formatSubExpression(e.children),this.layout.indentation.decreaseTopLevel()}formatClauseInOnelineStyle(e){this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e.nameKw),Z.SPACE),this.layout=this.formatSubExpression(e.children)}formatClauseInTabularStyle(e){this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e.nameKw),Z.SPACE),this.layout.indentation.increaseTopLevel(),this.layout=this.formatSubExpression(e.children),this.layout.indentation.decreaseTopLevel()}formatSetOperation(e){this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e.nameKw),Z.NEWLINE),this.layout.add(Z.INDENT),this.layout=this.formatSubExpression(e.children)}formatLimitClause(e){this.withComments(e.limitKw,()=>{this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e.limitKw))}),this.layout.indentation.increaseTopLevel(),RI(this.cfg)?this.layout.add(Z.SPACE):this.layout.add(Z.NEWLINE,Z.INDENT),e.offset&&(this.layout=this.formatSubExpression(e.offset),this.layout.add(Z.NO_SPACE,`,`,Z.SPACE)),this.layout=this.formatSubExpression(e.count),this.layout.indentation.decreaseTopLevel()}formatAllColumnsAsterisk(e){this.layout.add(`*`,Z.SPACE)}formatLiteral(e){this.layout.add(e.text,Z.SPACE)}formatIdentifier(e){this.layout.add(this.showIdentifier(e),Z.SPACE)}formatParameter(e){this.layout.add(this.params.get(e),Z.SPACE)}formatOperator({text:e}){e===`-`&&this.dialectCfg.identifierDashes||/^OPERATOR\s*\(/iu.test(e)?this.layout.add(e,Z.SPACE):this.cfg.denseOperators||this.dialectCfg.alwaysDenseOperators.includes(e)||e===`:`&&this.enclosingParenthesis===`[`?this.layout.add(Z.NO_SPACE,e):e===`:`?this.layout.add(Z.NO_SPACE,e,Z.SPACE):this.layout.add(e,Z.SPACE)}formatComma(e){this.inline?this.layout.add(Z.NO_SPACE,`,`,Z.SPACE):this.layout.add(Z.NO_SPACE,`,`,Z.NEWLINE,Z.INDENT)}withComments(e,t){this.formatComments(e.leadingComments),t(),this.formatComments(e.trailingComments)}formatComments(e){e&&e.forEach(e=>{e.type===X.line_comment?this.formatLineComment(e):this.formatBlockComment(e)})}formatLineComment(e){aI(e.precedingWhitespace||``)?this.layout.add(Z.NEWLINE,Z.INDENT,e.text,Z.MANDATORY_NEWLINE,Z.INDENT):this.layout.getLayoutItems().length>0?this.layout.add(Z.NO_NEWLINE,Z.SPACE,e.text,Z.MANDATORY_NEWLINE,Z.INDENT):this.layout.add(e.text,Z.MANDATORY_NEWLINE,Z.INDENT)}formatBlockComment(e){e.type===X.block_comment&&this.isStandaloneBlockComment(e)?(this.splitBlockComment(e.text).forEach(e=>{this.layout.add(Z.NEWLINE,Z.INDENT,e)}),this.layout.add(Z.NEWLINE,Z.INDENT)):this.layout.add(e.text,Z.SPACE)}isStandaloneBlockComment(e){return aI(e.text)||aI(e.precedingWhitespace||``)||this.layout.isAtStartOfLine()}isDocComment(e){let t=e.split(/\n/);return/^\/\*\*?$/.test(t[0])&&t.slice(1,t.length-1).every(e=>/^\s*\*/.test(e))&&/^\s*\*\/$/.test(nI(t))}splitBlockComment(e){return this.isDocComment(e)?e.split(/\n/).map(e=>/^\s*\*/.test(e)?` `+e.replace(/^\s*/,``):e):e.split(/\n/).map(e=>e.replace(/^\s*/,``))}formatSubExpression(t,n=this.enclosingParenthesis){return new e({cfg:this.cfg,dialectCfg:this.dialectCfg,params:this.params,layout:this.layout,inline:this.inline,enclosingParenthesis:n}).format(t)}formatInlineExpression(t,n=this.enclosingParenthesis){let r=this.params.getPositionalParameterIndex();try{return new e({cfg:this.cfg,dialectCfg:this.dialectCfg,params:this.params,layout:new SL(this.cfg.expressionWidth),inline:!0,enclosingParenthesis:n}).format(t)}catch(e){if(e instanceof CL){this.params.setPositionalParameterIndex(r);return}throw e}}formatKeywordNode(e){switch(e.tokenType){case Y.RESERVED_JOIN:return this.formatJoin(e);case Y.AND:case Y.OR:case Y.XOR:return this.formatLogicalOperator(e);default:return this.formatKeyword(e)}}formatJoin(e){RI(this.cfg)?(this.layout.indentation.decreaseTopLevel(),this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e),Z.SPACE),this.layout.indentation.increaseTopLevel()):this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e),Z.SPACE)}formatKeyword(e){this.layout.add(this.showKw(e),Z.SPACE)}formatLogicalOperator(e){this.cfg.logicalOperatorNewline===`before`?RI(this.cfg)?(this.layout.indentation.decreaseTopLevel(),this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e),Z.SPACE),this.layout.indentation.increaseTopLevel()):this.layout.add(Z.NEWLINE,Z.INDENT,this.showKw(e),Z.SPACE):this.layout.add(this.showKw(e),Z.NEWLINE,Z.INDENT)}formatDataType(e){this.layout.add(this.showDataType(e),Z.SPACE)}showKw(e){return vL(e.tokenType)?_L(this.showNonTabularKw(e),this.cfg.indentStyle):this.showNonTabularKw(e)}showNonTabularKw(e){switch(this.cfg.keywordCase){case`preserve`:return iI(e.raw);case`upper`:return e.text;case`lower`:return e.text.toLowerCase()}}showFunctionKw(e){return vL(e.tokenType)?_L(this.showNonTabularFunctionKw(e),this.cfg.indentStyle):this.showNonTabularFunctionKw(e)}showNonTabularFunctionKw(e){switch(this.cfg.functionCase){case`preserve`:return iI(e.raw);case`upper`:return e.text;case`lower`:return e.text.toLowerCase()}}showIdentifier(e){if(e.quoted)return e.text;switch(this.cfg.identifierCase){case`preserve`:return e.text;case`upper`:return e.text.toUpperCase();case`lower`:return e.text.toLowerCase()}}showDataType(e){switch(this.cfg.dataTypeCase){case`preserve`:return iI(e.raw);case`upper`:return e.text;case`lower`:return e.text.toLowerCase()}}},TL=class{constructor(e,t){this.dialect=e,this.cfg=t,this.params=new zI(this.cfg.params)}format(e){let t=this.parse(e);return this.formatAst(t).trimEnd()}parse(e){return pL(this.dialect.tokenizer).parse(e,this.cfg.paramTypes||{})}formatAst(e){return e.map(e=>this.formatStatement(e)).join(` `.repeat(this.cfg.linesBetweenQueries+1))}formatStatement(e){let t=new wL({cfg:this.cfg,dialectCfg:this.dialect.formatOptions,params:this.params,layout:new mL(new xL(LI(this.cfg)))}).format(e.children);return e.hasSemicolon&&(this.cfg.newlineBeforeSemicolon?t.add(Z.NEWLINE,`;`):t.add(Z.NO_NEWLINE,`;`)),t.toString()}},EL=class extends Error{};function DL(e){for(let t of[`multilineLists`,`newlineBeforeOpenParen`,`newlineBeforeCloseParen`,`aliasAs`,`commaPosition`,`tabulateAlias`])if(t in e)throw new EL(`${t} config is no more supported.`);if(e.expressionWidth<=0)throw new EL(`expressionWidth config must be positive number. Received ${e.expressionWidth} instead.`);if(e.params&&!OL(e.params)&&console.warn(`WARNING: All "params" option values should be strings.`),e.paramTypes&&!kL(e.paramTypes))throw new EL(`Empty regex given in custom paramTypes. That would result in matching infinite amount of parameters.`);return e}function OL(e){return(e instanceof Array?e:Object.values(e)).every(e=>typeof e==`string`)}function kL(e){return e.custom&&Array.isArray(e.custom)?e.custom.every(e=>e.regex!==``):!0}var AL=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i{if(typeof t.language==`string`&&!ML.includes(t.language))throw new EL(`Unsupported SQL dialect: ${t.language}`);let n=jL[t.language||`sql`];return FL(e,Object.assign(Object.assign({},t),{dialect:tI[n]}))},FL=(e,t)=>{var{dialect:n}=t,r=AL(t,[`dialect`]);if(typeof e!=`string`)throw Error(`Invalid query argument. Expected string, instead got `+typeof e);let i=DL(Object.assign(Object.assign({},NL),r));return new TL(PI(n),i).format(e)};aO.registerLanguage(`sql`,sj);var IL={pgsql:`postgresql`,sqlsrv:`transactsql`},LL={methods:{highlightQuery(){this.$nextTick(()=>{this.$refs.querycode&&aO.highlightElement(this.$refs.querycode)})},formatQuery(e,t){t=IL[t]||t;let n=this.sqlDialect(t);return n?PL(e,{language:n}):e},sqlDialect(e){return e?ML.includes(e)?e:null:`sql`}}},RL={key:0},zL={key:0,class:`badge badge-danger`},BL={key:1},VL={class:`card mt-5 overflow-hidden`},HL={class:`code-bg p-4 mb-0 text-white`};function UL(e,t,n,r,i,a){let o=I(`copy-clipboard`),s=I(`preview-screen`);return L(),Us(s,{title:`Query Details`,resource:`queries`,id:e.$route.params.id,onReady:t[0]||=e=>a.highlightQuery()},{"table-parameters":F(e=>[z(`tr`,null,[t[1]||=z(`td`,{class:`table-fit text-muted`},`Connection`,-1),z(`td`,null,N(e.entry.content.connection),1)]),e.entry.content.file?(L(),R(`tr`,RL,[t[2]||=z(`td`,{class:`table-fit text-muted`},`Location`,-1),z(`td`,null,N(e.entry.content.file)+`:`+N(e.entry.content.line),1)])):V(``,!0),z(`tr`,null,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Duration`,-1),z(`td`,null,[e.entry.content.slow?(L(),R(`span`,zL,N(e.entry.content.time)+`ms `,1)):(L(),R(`span`,BL,N(e.entry.content.time)+`ms `,1))])])]),"after-attributes-card":F(e=>[z(`div`,VL,[t[4]||=z(`ul`,{class:`nav nav-pills`},[z(`li`,{class:`nav-item`},[z(`a`,{class:`nav-link active`},`Query`)])],-1),z(`div`,HL,[B(o,{data:a.formatQuery(e.entry.content.sql,e.entry.content.driver)},{default:F(()=>[z(`pre`,{class:`code-bg text-white language-sql`,ref:`querycode`},N(a.formatQuery(e.entry.content.sql,e.entry.content.driver)),513)]),_:2},1032,[`data`])])])]),_:1},8,[`id`])}var WL=xD(LL,[[`render`,UL]]),GL={mixins:[ek]},KL={class:`table-fit`},qL=[`data-timeago`,`title`],JL={class:`table-fit`};function YL(e,t,n,r,i,a){let o=I(`router-link`),s=I(`index-screen`);return L(),Us(s,{title:`Models`,resource:`models`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Model`),z(`th`,{scope:`col`},`Action`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(n=>[z(`td`,null,N(e.truncate(n.entry.content.model,70)),1),z(`td`,KL,[z(`span`,{class:M([`badge`,`badge-`+e.modelActionClass(n.entry.content.action)])},N(n.entry.content.action),3)]),z(`td`,{class:`table-fit text-muted`,"data-timeago":n.entry.created_at,title:n.entry.created_at},N(e.timeAgo(n.entry.created_at)),9,qL),z(`td`,JL,[B(o,{to:{name:`model-preview`,params:{id:n.entry.id}},class:`control-action`},{default:F(()=>[...t[1]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var XL=xD(GL,[[`render`,YL]]),ZL={mixins:[ek],data(){return{entry:null,batch:[]}}},QL={key:0},$L={key:0,class:`card mt-5 overflow-hidden`},eR={class:`code-bg p-4 mb-0 text-white`};function tR(e,t,n,r,i,a){let o=I(`vue-json-pretty`),s=I(`copy-clipboard`),c=I(`preview-screen`);return L(),Us(c,{title:`Model Action`,resource:`models`,id:e.$route.params.id},{"table-parameters":F(n=>[z(`tr`,null,[t[0]||=z(`td`,{class:`table-fit text-muted`},`Model`,-1),z(`td`,null,N(n.entry.content.model),1)]),z(`tr`,null,[t[1]||=z(`td`,{class:`table-fit text-muted`},`Action`,-1),z(`td`,null,[z(`span`,{class:M([`badge`,`badge-`+e.modelActionClass(n.entry.content.action)])},N(n.entry.content.action),3)])]),n.entry.content.count?(L(),R(`tr`,QL,[t[2]||=z(`td`,{class:`table-fit text-muted`},`Hydrated`,-1),z(`td`,null,N(n.entry.content.count),1)])):V(``,!0)]),"after-attributes-card":F(e=>[e.entry.content.action!=`deleted`&&e.entry.content.changes?(L(),R(`div`,$L,[t[3]||=z(`ul`,{class:`nav nav-pills`},[z(`li`,{class:`nav-item`},[z(`a`,{class:`nav-link active`},`Changes`)])],-1),z(`div`,eR,[B(s,{data:e.entry.content.changes},{default:F(()=>[B(o,{data:e.entry.content.changes},null,8,[`data`])]),_:2},1032,[`data`])])])):V(``,!0)]),_:1},8,[`id`])}var nR=xD(ZL,[[`render`,tR]]),rR={mixins:[ek]},iR={class:`table-fit pe-0`},aR=[`title`],oR={class:`table-fit text-center`},sR={class:`table-fit text-end text-muted`},cR={key:0},lR={key:1},uR=[`data-timeago`,`title`],dR={class:`table-fit`};function fR(e,t,n,r,i,a){let o=I(`router-link`),s=I(`index-screen`);return L(),Us(s,{title:`Requests`,resource:`requests`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Verb`),z(`th`,{scope:`col`},`Path`),z(`th`,{scope:`col`,class:`text-center`},`Status`),z(`th`,{scope:`col`,class:`text-end`},`Duration`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(n=>[z(`td`,iR,[z(`span`,{class:M([`badge`,`badge-`+e.requestMethodClass(n.entry.content.method)])},N(n.entry.content.method),3)]),z(`td`,{title:n.entry.content.uri},N(e.truncate(n.entry.content.uri,50)),9,aR),z(`td`,oR,[z(`span`,{class:M([`badge`,`badge-`+e.requestStatusClass(n.entry.content.response_status)])},N(n.entry.content.response_status),3)]),z(`td`,sR,[n.entry.content.duration?(L(),R(`span`,cR,N(n.entry.content.duration)+`ms`,1)):(L(),R(`span`,lR,`-`))]),z(`td`,{class:`table-fit text-muted`,"data-timeago":n.entry.created_at,title:n.entry.created_at},N(e.timeAgo(n.entry.created_at)),9,uR),z(`td`,dR,[B(o,{to:{name:`request-preview`,params:{id:n.entry.id}},class:`control-action`},{default:F(()=>[...t[1]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var pR=xD(rR,[[`render`,fR]]),mR={mixins:[ek],data(){return{entry:null,batch:[],currentRequestTab:`payload`,currentResponseTab:`response`}}},hR={key:0},gR={class:`card mt-5 overflow-hidden`},_R={class:`nav nav-pills`},vR={class:`nav-item`},yR={class:`nav-item`},bR={class:`code-bg p-4 mb-0 text-white`},xR={class:`card mt-5`},SR={class:`nav nav-pills`},CR={class:`nav-item`},wR={class:`nav-item`},TR={class:`nav-item`},ER={key:0,class:`nav-item`},DR={class:`nav-item`},kR={class:`code-bg p-4 mb-0 text-white`};function AR(e,t,n,r,i,a){let o=I(`vue-json-pretty`),s=I(`copy-clipboard`),c=I(`related-entries`),l=I(`preview-screen`);return L(),Us(l,{title:`Request Details`,resource:`requests`,id:e.$route.params.id,"entry-point":`true`},{"table-parameters":F(n=>[z(`tr`,null,[t[7]||=z(`td`,{class:`table-fit text-muted`},`Method`,-1),z(`td`,null,[z(`span`,{class:M([`badge`,`badge-`+e.requestMethodClass(n.entry.content.method)])},N(n.entry.content.method),3)])]),z(`tr`,null,[t[8]||=z(`td`,{class:`table-fit text-muted`},`Controller Action`,-1),z(`td`,null,N(n.entry.content.controller_action),1)]),n.entry.content.middleware?(L(),R(`tr`,hR,[t[9]||=z(`td`,{class:`table-fit text-muted`},`Middleware`,-1),z(`td`,null,N(n.entry.content.middleware.join(`, `)),1)])):V(``,!0),z(`tr`,null,[t[10]||=z(`td`,{class:`table-fit text-muted`},`Path`,-1),z(`td`,null,N(n.entry.content.uri),1)]),z(`tr`,null,[t[11]||=z(`td`,{class:`table-fit text-muted`},`Status`,-1),z(`td`,null,[z(`span`,{class:M([`badge`,`badge-`+e.requestStatusClass(n.entry.content.response_status)])},N(n.entry.content.response_status),3)])]),z(`tr`,null,[t[12]||=z(`td`,{class:`table-fit text-muted`},`Duration`,-1),z(`td`,null,N(n.entry.content.duration||`-`)+` ms`,1)]),z(`tr`,null,[t[13]||=z(`td`,{class:`table-fit text-muted`},`IP Address`,-1),z(`td`,null,N(n.entry.content.ip_address||`-`),1)]),z(`tr`,null,[t[14]||=z(`td`,{class:`table-fit text-muted`},`Worker memory peak`,-1),z(`td`,null,N(n.entry.content.memory||`-`)+` MB`,1)])]),"after-attributes-card":F(e=>[z(`div`,gR,[z(`ul`,_R,[z(`li`,vR,[z(`a`,{class:M([`nav-link`,{active:i.currentRequestTab==`payload`}]),href:`#`,onClick:t[0]||=H(e=>i.currentRequestTab=`payload`,[`prevent`])},`Payload`,2)]),z(`li`,yR,[z(`a`,{class:M([`nav-link`,{active:i.currentRequestTab==`headers`}]),href:`#`,onClick:t[1]||=H(e=>i.currentRequestTab=`headers`,[`prevent`])},`Headers`,2)])]),z(`div`,bR,[B(s,{data:e.entry.content[i.currentRequestTab]},{default:F(()=>[B(o,{data:e.entry.content[i.currentRequestTab]},null,8,[`data`])]),_:2},1032,[`data`])])]),z(`div`,xR,[z(`ul`,SR,[z(`li`,CR,[z(`a`,{class:M([`nav-link`,{active:i.currentResponseTab==`response`}]),href:`#`,onClick:t[2]||=H(e=>i.currentResponseTab=`response`,[`prevent`])},`Response`,2)]),z(`li`,wR,[z(`a`,{class:M([`nav-link`,{active:i.currentResponseTab==`response_headers`}]),href:`#`,onClick:t[3]||=H(e=>i.currentResponseTab=`response_headers`,[`prevent`])},`Headers`,2)]),z(`li`,TR,[z(`a`,{class:M([`nav-link`,{active:i.currentResponseTab==`session`}]),href:`#`,onClick:t[4]||=H(e=>i.currentResponseTab=`session`,[`prevent`])},`Session`,2)]),e.entry.content.context?(L(),R(`li`,ER,[z(`a`,{class:M([`nav-link`,{active:i.currentResponseTab==`context`}]),href:`#`,onClick:t[5]||=H(e=>i.currentResponseTab=`context`,[`prevent`])},`Context`,2)])):V(``,!0),z(`li`,DR,[z(`a`,{class:M([`nav-link`,{active:i.currentResponseTab==`coroutine_context`}]),href:`#`,onClick:t[6]||=H(e=>i.currentResponseTab=`coroutine_context`,[`prevent`])},`Coroutine Context`,2)])]),z(`div`,kR,[B(s,{data:e.entry.content[i.currentResponseTab]},{default:F(()=>[B(o,{data:e.entry.content[i.currentResponseTab]},null,8,[`data`])]),_:2},1032,[`data`])])]),B(c,{entry:i.entry,batch:i.batch},null,8,[`entry`,`batch`])]),_:1},8,[`id`])}var jR=xD(mR,[[`render`,AR]]),MR={},NR=[`title`],PR={class:`table-fit text-center text-muted`},FR=[`data-timeago`,`title`],IR={class:`table-fit`};function LR(e,t){let n=I(`router-link`),r=I(`index-screen`);return L(),Us(r,{title:`Commands`,resource:`commands`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Command`),z(`th`,{scope:`col`,class:`table-fit`},`Exit Code`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(r=>[z(`td`,{title:r.entry.content.command},[z(`code`,null,N(e.truncate(r.entry.content.command,90)),1)],8,NR),z(`td`,PR,N(r.entry.content.exit_code),1),z(`td`,{class:`table-fit text-muted`,"data-timeago":r.entry.created_at,title:r.entry.created_at},N(e.timeAgo(r.entry.created_at)),9,FR),z(`td`,IR,[B(n,{to:{name:`command-preview`,params:{id:r.entry.id}},class:`control-action`},{default:F(()=>[...t[1]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var RR=xD(MR,[[`render`,LR]]),zR={data(){return{entry:null,batch:[],currentTab:`arguments`}}},BR={class:`card mt-5 overflow-hidden`},VR={class:`nav nav-pills`},HR={class:`nav-item`},UR={class:`nav-item`},WR={class:`code-bg p-4 mb-0 text-white`};function GR(e,t,n,r,i,a){let o=I(`vue-json-pretty`),s=I(`copy-clipboard`),c=I(`related-entries`),l=I(`preview-screen`);return L(),Us(l,{title:`Command Details`,resource:`commands`,id:e.$route.params.id,"entry-point":`true`},{"table-parameters":F(e=>[z(`tr`,null,[t[2]||=z(`td`,{class:`table-fit text-muted`},`Command`,-1),z(`td`,null,[z(`code`,null,N(e.entry.content.command),1)])]),z(`tr`,null,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Exit Code`,-1),z(`td`,null,N(e.entry.content.exit_code),1)])]),"after-attributes-card":F(e=>[z(`div`,BR,[z(`ul`,VR,[z(`li`,HR,[z(`a`,{class:M([`nav-link`,{active:i.currentTab==`arguments`}]),href:`#`,onClick:t[0]||=H(e=>i.currentTab=`arguments`,[`prevent`])},`Arguments`,2)]),z(`li`,UR,[z(`a`,{class:M([`nav-link`,{active:i.currentTab==`options`}]),href:`#`,onClick:t[1]||=H(e=>i.currentTab=`options`,[`prevent`])},`Options`,2)])]),z(`div`,null,[z(`div`,WR,[B(s,{data:e.entry.content[i.currentTab]},{default:F(()=>[B(o,{data:e.entry.content[i.currentTab]},null,8,[`data`])]),_:2},1032,[`data`])])])]),B(c,{entry:i.entry,batch:i.batch},null,8,[`entry`,`batch`])]),_:1},8,[`id`])}var KR=xD(zR,[[`render`,GR]]),qR={},JR={class:`table-fit text-muted`},YR={class:`table-fit`},XR=[`data-timeago`,`title`],ZR={class:`table-fit`};function QR(e,t){let n=I(`router-link`),r=I(`index-screen`);return L(),Us(r,{title:`Schedule`,resource:`schedule`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Command`),z(`th`,{scope:`col`},`Expression`),z(`th`,{scope:`col`},`Status`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(r=>[z(`td`,null,[z(`code`,null,N(e.truncate(r.entry.content.description,85)||e.truncate(r.entry.content.command,85)),1)]),z(`td`,JR,N(r.entry.content.expression),1),z(`td`,YR,[z(`span`,{class:M([`badge`,r.entry.content.status===`finished`?`badge-success`:`badge-danger`])},N(r.entry.content.status),3)]),z(`td`,{class:`table-fit text-muted`,"data-timeago":r.entry.created_at,title:r.entry.created_at},N(e.timeAgo(r.entry.created_at)),9,XR),z(`td`,ZR,[B(n,{to:{name:`schedule-preview`,params:{id:r.entry.id}},class:`control-action`},{default:F(()=>[...t[1]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var $R=xD(qR,[[`render`,QR]]),ez={data(){return{entry:null,batch:[]}}},tz={key:0},nz={key:1},rz={key:0,class:`card mt-5 overflow-hidden`},iz={class:`code-bg p-4 mb-0 text-white`};function az(e,t,n,r,i,a){let o=I(`copy-clipboard`),s=I(`preview-screen`);return L(),Us(s,{title:`Scheduled Command Details`,resource:`schedule`,id:e.$route.params.id},{"table-parameters":F(e=>[z(`tr`,null,[t[0]||=z(`td`,{class:`table-fit text-muted`},`Description`,-1),z(`td`,null,N(e.entry.content.description||`-`),1)]),z(`tr`,null,[t[1]||=z(`td`,{class:`table-fit text-muted`},`Task`,-1),z(`td`,null,[z(`code`,null,N(e.entry.content.command||`-`),1)])]),z(`tr`,null,[t[2]||=z(`td`,{class:`table-fit text-muted`},`Expression`,-1),z(`td`,null,N(e.entry.content.expression),1)]),z(`tr`,null,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Timezone`,-1),z(`td`,null,N(e.entry.content.timezone||`-`),1)]),z(`tr`,null,[t[4]||=z(`td`,{class:`table-fit text-muted`},`Status`,-1),z(`td`,null,[z(`span`,{class:M([`badge`,e.entry.content.status===`finished`?`badge-success`:`badge-danger`])},N(e.entry.content.status),3)])]),z(`tr`,null,[t[5]||=z(`td`,{class:`table-fit text-muted`},`Exit Code`,-1),z(`td`,null,N(e.entry.content.exit_code===void 0||e.entry.content.exit_code===null?`-`:e.entry.content.exit_code),1)]),e.entry.content.exception?(L(),R(`tr`,tz,[t[6]||=z(`td`,{class:`table-fit text-muted`},`Exception`,-1),z(`td`,null,[z(`code`,null,N(e.entry.content.exception.class),1)])])):V(``,!0),e.entry.content.exception?(L(),R(`tr`,nz,[t[7]||=z(`td`,{class:`table-fit text-muted`},`Exception Message`,-1),z(`td`,null,N(e.entry.content.exception.message),1)])):V(``,!0)]),"after-attributes-card":F(e=>[e.entry.content.output?(L(),R(`div`,rz,[t[8]||=z(`ul`,{class:`nav nav-pills`},[z(`li`,{class:`nav-item`},[z(`a`,{class:`nav-link active`},`Output`)])],-1),B(o,{data:e.entry.content.output},{default:F(()=>[z(`pre`,iz,N(e.entry.content.output),1)]),_:2},1032,[`data`])])):V(``,!0)]),_:1},8,[`id`])}var oz=xD(ez,[[`render`,az]]),sz={},cz={class:`table-fit text-end text-muted`},lz=[`data-timeago`,`title`],uz={class:`table-fit`};function dz(e,t){let n=I(`router-link`),r=I(`index-screen`);return L(),Us(r,{title:`Redis`,resource:`redis`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Command`),z(`th`,{scope:`col`,class:`text-end`},`Duration`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(r=>[z(`td`,null,[z(`code`,null,N(e.truncate(r.entry.content.command,80)),1)]),z(`td`,cz,N(r.entry.content.time)+`ms`,1),z(`td`,{class:`table-fit text-muted`,"data-timeago":r.entry.created_at,title:r.entry.created_at},N(e.timeAgo(r.entry.created_at)),9,lz),z(`td`,uz,[B(n,{to:{name:`redis-preview`,params:{id:r.entry.id}},class:`control-action`},{default:F(()=>[...t[1]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var fz=xD(sz,[[`render`,dz]]),pz={data(){return{entry:null,batch:[]}}},mz={class:`card mt-5 overflow-hidden`},hz={class:`code-bg p-4 mb-0 text-white`};function gz(e,t,n,r,i,a){let o=I(`preview-screen`);return L(),Us(o,{title:`Redis Command Details`,resource:`redis`,id:e.$route.params.id},{"table-parameters":F(e=>[z(`tr`,null,[t[0]||=z(`td`,{class:`table-fit text-muted`},`Connection`,-1),z(`td`,null,N(e.entry.content.connection),1)]),z(`tr`,null,[t[1]||=z(`td`,{class:`table-fit text-muted`},`Duration`,-1),z(`td`,null,N(e.entry.content.time)+`ms`,1)])]),"after-attributes-card":F(e=>[z(`div`,mz,[t[2]||=z(`ul`,{class:`nav nav-pills`},[z(`li`,{class:`nav-item`},[z(`a`,{class:`nav-link active`},`Command`)])],-1),z(`pre`,hz,N(e.entry.content.command),1)])]),_:1},8,[`id`])}var _z=xD(pz,[[`render`,gz]]),vz=`bottom`,yz=`right`,bz=`left`,xz=`auto`,Sz=[`top`,vz,yz,bz],Cz=`start`,wz=`clippingParents`,Tz=`viewport`,Ez=`popper`,Dz=`reference`,Oz=Sz.reduce(function(e,t){return e.concat([t+`-`+Cz,t+`-end`])},[]),kz=[].concat(Sz,[xz]).reduce(function(e,t){return e.concat([t,t+`-`+Cz,t+`-end`])},[]),Az=`beforeRead`,jz=`read`,Mz=`afterRead`,Nz=`beforeMain`,Pz=`main`,Fz=`afterMain`,Iz=`beforeWrite`,Lz=`write`,Rz=`afterWrite`,zz=[Az,jz,Mz,Nz,Pz,Fz,Iz,Lz,Rz];function Bz(e){return e?(e.nodeName||``).toLowerCase():null}function Vz(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Hz(e){return e instanceof Vz(e).Element||e instanceof Element}function Uz(e){return e instanceof Vz(e).HTMLElement||e instanceof HTMLElement}function Wz(e){return typeof ShadowRoot>`u`?!1:e instanceof Vz(e).ShadowRoot||e instanceof ShadowRoot}function Gz(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Uz(i)&&Bz(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function Kz(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});Uz(r)&&Bz(r)&&(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var qz={name:`applyStyles`,enabled:!0,phase:`write`,fn:Gz,effect:Kz,requires:[`computeStyles`]};function Jz(e){return e.split(`-`)[0]}var Yz=Math.max,Xz=Math.min,Zz=Math.round;function Qz(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function $z(){return!/^((?!chrome|android).)*safari/i.test(Qz())}function eB(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&Uz(e)&&(i=e.offsetWidth>0&&Zz(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Zz(r.height)/e.offsetHeight||1);var o=(Hz(e)?Vz(e):window).visualViewport,s=!$z()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function tB(e){var t=eB(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function nB(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Wz(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function rB(e){return Vz(e).getComputedStyle(e)}function iB(e){return[`table`,`td`,`th`].indexOf(Bz(e))>=0}function aB(e){return((Hz(e)?e.ownerDocument:e.document)||window.document).documentElement}function oB(e){return Bz(e)===`html`?e:e.assignedSlot||e.parentNode||(Wz(e)?e.host:null)||aB(e)}function sB(e){return!Uz(e)||rB(e).position===`fixed`?null:e.offsetParent}function cB(e){var t=/firefox/i.test(Qz());if(/Trident/i.test(Qz())&&Uz(e)&&rB(e).position===`fixed`)return null;var n=oB(e);for(Wz(n)&&(n=n.host);Uz(n)&&[`html`,`body`].indexOf(Bz(n))<0;){var r=rB(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function lB(e){for(var t=Vz(e),n=sB(e);n&&iB(n)&&rB(n).position===`static`;)n=sB(n);return n&&(Bz(n)===`html`||Bz(n)===`body`&&rB(n).position===`static`)?t:n||cB(e)||t}function uB(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function dB(e,t,n){return Yz(e,Xz(t,n))}function fB(e,t,n){var r=dB(e,t,n);return r>n?n:r}function pB(){return{top:0,right:0,bottom:0,left:0}}function mB(e){return Object.assign({},pB(),e)}function hB(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var gB=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,mB(typeof e==`number`?hB(e,Sz):e)};function _B(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=Jz(n.placement),c=uB(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(a&&o){var u=gB(i.padding,n),d=tB(a),f=c===`y`?`top`:bz,p=c===`y`?vz:yz,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=lB(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=dB(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function vB(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||nB(t.elements.popper,r)&&(t.elements.arrow=r))}var yB={name:`arrow`,enabled:!0,phase:`main`,fn:_B,effect:vB,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function bB(e){return e.split(`-`)[1]}var xB={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function SB(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Zz(n*i)/i||0,y:Zz(r*i)/i||0}}function CB(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=bz,b=`top`,x=window;if(l){var S=lB(n),C=`clientHeight`,w=`clientWidth`;if(S===Vz(n)&&(S=aB(n),rB(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=vz;var ee=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=ee-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=yz;var T=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=T-r.width,p*=c?1:-1}}var E=Object.assign({position:s},l&&xB),te=u===!0?SB({x:p,y:h},Vz(n)):{x:p,y:h};if(p=te.x,h=te.y,c){var D;return Object.assign({},E,(D={},D[b]=v?`0`:``,D[y]=_?`0`:``,D.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,D))}return Object.assign({},E,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function wB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:Jz(t.placement),variation:bB(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,CB(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,CB(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var TB={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:wB,data:{}},EB={passive:!0};function DB(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=Vz(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,EB)}),s&&c.addEventListener(`resize`,n.update,EB),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,EB)}),s&&c.removeEventListener(`resize`,n.update,EB)}}var OB={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:DB,data:{}},kB={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function AB(e){return e.replace(/left|right|bottom|top/g,function(e){return kB[e]})}var jB={start:`end`,end:`start`};function MB(e){return e.replace(/start|end/g,function(e){return jB[e]})}function NB(e){var t=Vz(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function PB(e){return eB(aB(e)).left+NB(e).scrollLeft}function FB(e,t){var n=Vz(e),r=aB(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=$z();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+PB(e),y:c}}function IB(e){var t=aB(e),n=NB(e),r=e.ownerDocument?.body,i=Yz(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Yz(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+PB(e),s=-n.scrollTop;return rB(r||t).direction===`rtl`&&(o+=Yz(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function LB(e){var t=rB(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function RB(e){return[`html`,`body`,`#document`].indexOf(Bz(e))>=0?e.ownerDocument.body:Uz(e)&&LB(e)?e:RB(oB(e))}function zB(e,t){t===void 0&&(t=[]);var n=RB(e),r=n===e.ownerDocument?.body,i=Vz(n),a=r?[i].concat(i.visualViewport||[],LB(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(zB(oB(a)))}function BB(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function VB(e,t){var n=eB(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function HB(e,t,n){return t===`viewport`?BB(FB(e,n)):Hz(t)?VB(t,n):BB(IB(aB(e)))}function UB(e){var t=zB(oB(e)),n=[`absolute`,`fixed`].indexOf(rB(e).position)>=0&&Uz(e)?lB(e):e;return Hz(n)?t.filter(function(e){return Hz(e)&&nB(e,n)&&Bz(e)!==`body`}):[]}function WB(e,t,n,r){var i=t===`clippingParents`?UB(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=HB(e,n,r);return t.top=Yz(i.top,t.top),t.right=Xz(i.right,t.right),t.bottom=Xz(i.bottom,t.bottom),t.left=Yz(i.left,t.left),t},HB(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function GB(e){var t=e.reference,n=e.element,r=e.placement,i=r?Jz(r):null,a=r?bB(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case vz:c={x:o,y:t.y+t.height};break;case yz:c={x:t.x+t.width,y:s};break;case bz:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?uB(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case Cz:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2)}}return c}function KB(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?wz:s,l=n.rootBoundary,u=l===void 0?Tz:l,d=n.elementContext,f=d===void 0?Ez:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=mB(typeof g==`number`?hB(g,Sz):g),v=f===`popper`?Dz:Ez,y=e.rects.popper,b=e.elements[m?v:f],x=WB(Hz(b)?b:b.contextElement||aB(e.elements.popper),c,u,o),S=eB(e.elements.reference),C=GB({reference:S,element:y,strategy:`absolute`,placement:i}),w=BB(Object.assign({},y,C)),ee=f===`popper`?w:S,T={top:x.top-ee.top+_.top,bottom:ee.bottom-x.bottom+_.bottom,left:x.left-ee.left+_.left,right:ee.right-x.right+_.right},E=e.modifiersData.offset;if(f===`popper`&&E){var te=E[i];Object.keys(T).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;T[e]+=te[n]*t})}return T}function qB(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?kz:c,u=bB(r),d=u?s?Oz:Oz.filter(function(e){return bB(e)===u}):Sz,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=KB(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[Jz(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function JB(e){if(Jz(e)===`auto`)return[];var t=AB(e);return[MB(e),t,MB(t)]}function YB(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=Jz(g)===g,v=c||(_||!m?[AB(g)]:JB(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(Jz(n)===`auto`?qB(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],ee=0;ee=0,O=D?`width`:`height`,k=KB(t,{placement:T,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),A=D?te?yz:bz:te?vz:`top`;b[O]>x[O]&&(A=AB(A));var ne=AB(A),re=[];if(a&&re.push(k[E]<=0),s&&re.push(k[A]<=0,k[ne]<=0),re.every(function(e){return e})){w=T,C=!1;break}S.set(T,re)}if(C)for(var ie=m?3:1,ae=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},oe=ie;oe>0&&ae(oe)!==`break`;oe--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var XB={name:`flip`,enabled:!0,phase:`main`,fn:YB,requiresIfExists:[`offset`],data:{_skip:!1}};function ZB(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function QB(e){return[`top`,yz,vz,bz].some(function(t){return e[t]>=0})}function $B(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=KB(t,{elementContext:`reference`}),s=KB(t,{altBoundary:!0}),c=ZB(o,r),l=ZB(s,i,a),u=QB(c),d=QB(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var eV={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:$B};function tV(e,t,n){var r=Jz(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function nV(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=kz.reduce(function(e,n){return e[n]=tV(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var rV={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:nV};function iV(e){var t=e.state,n=e.name;t.modifiersData[n]=GB({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var aV={name:`popperOffsets`,enabled:!0,phase:`read`,fn:iV,data:{}};function oV(e){return e===`x`?`y`:`x`}function sV(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=KB(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=Jz(t.placement),v=bB(t.placement),y=!v,b=uB(_),x=oV(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,ee=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,T=typeof ee==`number`?{mainAxis:ee,altAxis:ee}:Object.assign({mainAxis:0,altAxis:0},ee),E=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,te={x:0,y:0};if(S){if(a){var D=b===`y`?`top`:bz,O=b===`y`?vz:yz,k=b===`y`?`height`:`width`,A=S[b],ne=A+g[D],re=A-g[O],ie=p?-w[k]/2:0,ae=v===`start`?C[k]:w[k],oe=v===`start`?-w[k]:-C[k],se=t.elements.arrow,ce=p&&se?tB(se):{width:0,height:0},le=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:pB(),ue=le[D],de=le[O],j=dB(0,C[k],ce[k]),fe=y?C[k]/2-ie-j-ue-T.mainAxis:ae-j-ue-T.mainAxis,pe=y?-C[k]/2+ie+j+de+T.mainAxis:oe+j+de+T.mainAxis,me=t.elements.arrow&&lB(t.elements.arrow),he=me?b===`y`?me.clientTop||0:me.clientLeft||0:0,ge=E?.[b]??0,_e=A+fe-ge-he,ve=A+pe-ge,ye=dB(p?Xz(ne,_e):ne,A,p?Yz(re,ve):re);S[b]=ye,te[b]=ye-A}if(s){var be=b===`x`?`top`:bz,xe=b===`x`?vz:yz,Se=S[x],Ce=x===`y`?`height`:`width`,we=Se+g[be],Te=Se-g[xe],Ee=[`top`,bz].indexOf(_)!==-1,De=E?.[x]??0,Oe=Ee?we:Se-C[Ce]-w[Ce]-De+T.altAxis,ke=Ee?Se+C[Ce]+w[Ce]-De-T.altAxis:Te,M=p&&Ee?fB(Oe,Se,ke):dB(p?Oe:we,Se,p?ke:Te);S[x]=M,te[x]=M-Se}t.modifiersData[r]=te}}var cV={name:`preventOverflow`,enabled:!0,phase:`main`,fn:sV,requiresIfExists:[`offset`]};function lV(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function uV(e){return e===Vz(e)||!Uz(e)?NB(e):lV(e)}function dV(e){var t=e.getBoundingClientRect(),n=Zz(t.width)/e.offsetWidth||1,r=Zz(t.height)/e.offsetHeight||1;return n!==1||r!==1}function fV(e,t,n){n===void 0&&(n=!1);var r=Uz(t),i=Uz(t)&&dV(t),a=aB(t),o=eB(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Bz(t)!==`body`||LB(a))&&(s=uV(t)),Uz(t)?(c=eB(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=PB(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function pV(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function mV(e){var t=pV(e);return zz.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function hV(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function gV(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var _V={placement:`bottom`,modifiers:[],strategy:`absolute`};function vV(){return![...arguments].some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function yV(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?_V:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},_V,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:Hz(e)?zB(e):e.contextElement?zB(e.contextElement):[],popper:zB(t)};var s=mV(gV([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(vV(t,n)){i.rects={reference:fV(t,lB(n),i.options.strategy===`fixed`),popper:tB(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;rFz,afterRead:()=>Mz,afterWrite:()=>Rz,applyStyles:()=>qz,arrow:()=>yB,auto:()=>xz,basePlacements:()=>Sz,beforeMain:()=>Nz,beforeRead:()=>Az,beforeWrite:()=>Iz,bottom:()=>vz,clippingParents:()=>wz,computeStyles:()=>TB,createPopper:()=>SV,createPopperBase:()=>bV,createPopperLite:()=>xV,detectOverflow:()=>KB,end:()=>`end`,eventListeners:()=>OB,flip:()=>XB,hide:()=>eV,left:()=>bz,main:()=>Pz,modifierPhases:()=>zz,offset:()=>rV,placements:()=>kz,popper:()=>Ez,popperGenerator:()=>yV,popperOffsets:()=>aV,preventOverflow:()=>cV,read:()=>jz,reference:()=>Dz,right:()=>yz,start:()=>Cz,top:()=>`top`,variationPlacements:()=>Oz,viewport:()=>Tz,write:()=>Lz}),wV=new Map,TV={set(e,t,n){wV.has(e)||wV.set(e,new Map);let r=wV.get(e);!r.has(t)&&r.size!==0?console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(r.keys())[0]}.`):r.set(t,n)},get(e,t){return wV.has(e)&&wV.get(e).get(t)||null},remove(e,t){if(!wV.has(e))return;let n=wV.get(e);n.delete(t),n.size===0&&wV.delete(e)}},EV=1e6,DV=1e3,OV=`transitionend`,kV=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),AV=e=>e==null?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),jV=e=>{do e+=Math.floor(Math.random()*EV);while(document.getElementById(e));return e},MV=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);return!Number.parseFloat(t)&&!Number.parseFloat(n)?0:(t=t.split(`,`)[0],n=n.split(`,`)[0],(Number.parseFloat(t)+Number.parseFloat(n))*DV)},NV=e=>{e.dispatchEvent(new Event(OV))},PV=e=>!e||typeof e!=`object`?!1:(e.jquery!==void 0&&(e=e[0]),e.nodeType!==void 0),FV=e=>PV(e)?e.jquery?e[0]:e:typeof e==`string`&&e.length>0?document.querySelector(kV(e)):null,IV=e=>{if(!PV(e)||e.getClientRects().length===0)return!1;let t=getComputedStyle(e).getPropertyValue(`visibility`)===`visible`,n=e.closest(`details:not([open])`);if(!n)return t;if(n!==e){let t=e.closest(`summary`);if(t&&t.parentNode!==n||t===null)return!1}return t},LV=e=>!e||e.nodeType!==Node.ELEMENT_NODE||e.classList.contains(`disabled`)?!0:e.disabled===void 0?e.hasAttribute(`disabled`)&&e.getAttribute(`disabled`)!==`false`:e.disabled,RV=e=>{if(!document.documentElement.attachShadow)return null;if(typeof e.getRootNode==`function`){let t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?RV(e.parentNode):null},zV=()=>{},BV=e=>{e.offsetHeight},VV=()=>window.jQuery&&!document.body.hasAttribute(`data-bs-no-jquery`)?window.jQuery:null,HV=[],UV=e=>{document.readyState===`loading`?(HV.length||document.addEventListener(`DOMContentLoaded`,()=>{for(let e of HV)e()}),HV.push(e)):e()},WV=()=>document.documentElement.dir===`rtl`,GV=e=>{UV(()=>{let t=VV();if(t){let n=e.NAME,r=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=()=>(t.fn[n]=r,e.jQueryInterface)}})},KV=(e,t=[],n=e)=>typeof e==`function`?e.call(...t):n,qV=(e,t,n=!0)=>{if(!n){KV(e);return}let r=MV(t)+5,i=!1,a=({target:n})=>{n===t&&(i=!0,t.removeEventListener(OV,a),KV(e))};t.addEventListener(OV,a),setTimeout(()=>{i||NV(t)},r)},JV=(e,t,n,r)=>{let i=e.length,a=e.indexOf(t);return a===-1?!n&&r?e[i-1]:e[0]:(a+=n?1:-1,r&&(a=(a+i)%i),e[Math.max(0,Math.min(a,i-1))])},YV=/[^.]*(?=\..*)\.|.*/,XV=/\..*/,ZV=/::\d+$/,QV={},$V=1,eH={mouseenter:`mouseover`,mouseleave:`mouseout`},tH=new Set(`click.dblclick.mouseup.mousedown.contextmenu.mousewheel.DOMMouseScroll.mouseover.mouseout.mousemove.selectstart.selectend.keydown.keypress.keyup.orientationchange.touchstart.touchmove.touchend.touchcancel.pointerdown.pointermove.pointerup.pointerleave.pointercancel.gesturestart.gesturechange.gestureend.focus.blur.change.reset.select.submit.focusin.focusout.load.unload.beforeunload.resize.move.DOMContentLoaded.readystatechange.error.abort.scroll`.split(`.`));function nH(e,t){return t&&`${t}::${$V++}`||e.uidEvent||$V++}function rH(e){let t=nH(e);return e.uidEvent=t,QV[t]=QV[t]||{},QV[t]}function iH(e,t){return function n(r){return fH(r,{delegateTarget:e}),n.oneOff&&Q.off(e,r.type,t),t.apply(e,[r])}}function aH(e,t,n){return function r(i){let a=e.querySelectorAll(t);for(let{target:o}=i;o&&o!==this;o=o.parentNode)for(let s of a)if(s===o)return fH(i,{delegateTarget:o}),r.oneOff&&Q.off(e,i.type,t,n),n.apply(o,[i])}}function oH(e,t,n=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===n)}function sH(e,t,n){let r=typeof t==`string`,i=r?n:t||n,a=dH(e);return tH.has(a)||(a=e),[r,i,a]}function cH(e,t,n,r,i){if(typeof t!=`string`||!e)return;let[a,o,s]=sH(t,n,r);t in eH&&(o=(e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)})(o));let c=rH(e),l=c[s]||(c[s]={}),u=oH(l,o,a?n:null);if(u){u.oneOff=u.oneOff&&i;return}let d=nH(o,t.replace(YV,``)),f=a?aH(e,n,o):iH(e,o);f.delegationSelector=a?n:null,f.callable=o,f.oneOff=i,f.uidEvent=d,l[d]=f,e.addEventListener(s,f,a)}function lH(e,t,n,r,i){let a=oH(t[n],r,i);a&&(e.removeEventListener(n,a,!!i),delete t[n][a.uidEvent])}function uH(e,t,n,r){let i=t[n]||{};for(let[a,o]of Object.entries(i))a.includes(r)&&lH(e,t,n,o.callable,o.delegationSelector)}function dH(e){return e=e.replace(XV,``),eH[e]||e}var Q={on(e,t,n,r){cH(e,t,n,r,!1)},one(e,t,n,r){cH(e,t,n,r,!0)},off(e,t,n,r){if(typeof t!=`string`||!e)return;let[i,a,o]=sH(t,n,r),s=o!==t,c=rH(e),l=c[o]||{},u=t.startsWith(`.`);if(a!==void 0){if(!Object.keys(l).length)return;lH(e,c,o,a,i?n:null)}else{if(u)for(let n of Object.keys(c))uH(e,c,n,t.slice(1));for(let[n,r]of Object.entries(l)){let i=n.replace(ZV,``);(!s||t.includes(i))&&lH(e,c,o,r.callable,r.delegationSelector)}}},trigger(e,t,n){if(typeof t!=`string`||!e)return null;let r=VV(),i=t!==dH(t),a=null,o=!0,s=!0,c=!1;i&&r&&(a=r.Event(t,n),r(e).trigger(a),o=!a.isPropagationStopped(),s=!a.isImmediatePropagationStopped(),c=a.isDefaultPrevented());let l=fH(new Event(t,{bubbles:o,cancelable:!0}),n);return c&&l.preventDefault(),s&&e.dispatchEvent(l),l.defaultPrevented&&a&&a.preventDefault(),l}};function fH(e,t={}){for(let[n,r]of Object.entries(t))try{e[n]=r}catch{Object.defineProperty(e,n,{configurable:!0,get(){return r}})}return e}function pH(e){if(e===`true`)return!0;if(e===`false`)return!1;if(e===Number(e).toString())return Number(e);if(e===``||e===`null`)return null;if(typeof e!=`string`)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function mH(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var hH={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${mH(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${mH(t)}`)},getDataAttributes(e){if(!e)return{};let t={},n=Object.keys(e.dataset).filter(e=>e.startsWith(`bs`)&&!e.startsWith(`bsConfig`));for(let r of n){let n=r.replace(/^bs/,``);n=n.charAt(0).toLowerCase()+n.slice(1),t[n]=pH(e.dataset[r])}return t},getDataAttribute(e,t){return pH(e.getAttribute(`data-bs-${mH(t)}`))}},gH=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw Error(`You have to implement the static method "NAME", for each component!`)}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){let n=PV(t)?hH.getDataAttribute(t,`config`):{};return{...this.constructor.Default,...typeof n==`object`?n:{},...PV(t)?hH.getDataAttributes(t):{},...typeof e==`object`?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(let[n,r]of Object.entries(t)){let t=e[n],i=PV(t)?`element`:AV(t);if(!new RegExp(r).test(i))throw TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${i}" but expected type "${r}".`)}}},_H=`5.3.8`,vH=class extends gH{constructor(e,t){super(),e=FV(e),e&&(this._element=e,this._config=this._getConfig(t),TV.set(this._element,this.constructor.DATA_KEY,this))}dispose(){TV.remove(this._element,this.constructor.DATA_KEY),Q.off(this._element,this.constructor.EVENT_KEY);for(let e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){qV(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return TV.get(FV(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t==`object`?t:null)}static get VERSION(){return _H}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}},yH=e=>{let t=e.getAttribute(`data-bs-target`);if(!t||t===`#`){let n=e.getAttribute(`href`);if(!n||!n.includes(`#`)&&!n.startsWith(`.`))return null;n.includes(`#`)&&!n.startsWith(`#`)&&(n=`#${n.split(`#`)[1]}`),t=n&&n!==`#`?n.trim():null}return t?t.split(`,`).map(e=>kV(e)).join(`,`):null},bH={find(e,t=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(t,e))},findOne(e,t=document.documentElement){return Element.prototype.querySelector.call(t,e)},children(e,t){return[].concat(...e.children).filter(e=>e.matches(t))},parents(e,t){let n=[],r=e.parentNode.closest(t);for(;r;)n.push(r),r=r.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){let t=[`a`,`button`,`input`,`textarea`,`select`,`details`,`[tabindex]`,`[contenteditable="true"]`].map(e=>`${e}:not([tabindex^="-"])`).join(`,`);return this.find(t,e).filter(e=>!LV(e)&&IV(e))},getSelectorFromElement(e){let t=yH(e);return t&&bH.findOne(t)?t:null},getElementFromSelector(e){let t=yH(e);return t?bH.findOne(t):null},getMultipleElementsFromSelector(e){let t=yH(e);return t?bH.find(t):[]}},xH=(e,t=`hide`)=>{let n=`click.dismiss${e.EVENT_KEY}`,r=e.NAME;Q.on(document,n,`[data-bs-dismiss="${r}"]`,function(n){if([`A`,`AREA`].includes(this.tagName)&&n.preventDefault(),LV(this))return;let i=bH.getElementFromSelector(this)||this.closest(`.${r}`);e.getOrCreateInstance(i)[t]()})},SH=`alert`,CH=`.bs.alert`,wH=`close${CH}`,TH=`closed${CH}`,EH=`fade`,DH=`show`,OH=class e extends vH{static get NAME(){return SH}close(){if(Q.trigger(this._element,wH).defaultPrevented)return;this._element.classList.remove(DH);let e=this._element.classList.contains(EH);this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),Q.trigger(this._element,TH),this.dispose()}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this);if(typeof t==`string`){if(n[t]===void 0||t.startsWith(`_`)||t===`constructor`)throw TypeError(`No method named "${t}"`);n[t](this)}})}};xH(OH,`close`),GV(OH);var kH=`button`,AH=`.bs.button`,jH=`.data-api`,MH=`active`,NH=`[data-bs-toggle="button"]`,PH=`click${AH}${jH}`,FH=class e extends vH{static get NAME(){return kH}toggle(){this._element.setAttribute(`aria-pressed`,this._element.classList.toggle(MH))}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this);t===`toggle`&&n[t]()})}};Q.on(document,PH,NH,e=>{e.preventDefault();let t=e.target.closest(NH);FH.getOrCreateInstance(t).toggle()}),GV(FH);var IH=`swipe`,LH=`.bs.swipe`,RH=`touchstart${LH}`,zH=`touchmove${LH}`,BH=`touchend${LH}`,VH=`pointerdown${LH}`,HH=`pointerup${LH}`,UH=`touch`,WH=`pen`,GH=`pointer-event`,KH=40,qH={endCallback:null,leftCallback:null,rightCallback:null},JH={endCallback:`(function|null)`,leftCallback:`(function|null)`,rightCallback:`(function|null)`},YH=class e extends gH{constructor(t,n){super(),this._element=t,t&&e.isSupported()&&(this._config=this._getConfig(n),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return qH}static get DefaultType(){return JH}static get NAME(){return IH}dispose(){Q.off(this._element,LH)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),KV(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){let e=Math.abs(this._deltaX);if(e<=KH)return;let t=e/this._deltaX;this._deltaX=0,t&&KV(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Q.on(this._element,VH,e=>this._start(e)),Q.on(this._element,HH,e=>this._end(e)),this._element.classList.add(GH)):(Q.on(this._element,RH,e=>this._start(e)),Q.on(this._element,zH,e=>this._move(e)),Q.on(this._element,BH,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===WH||e.pointerType===UH)}static isSupported(){return`ontouchstart`in document.documentElement||navigator.maxTouchPoints>0}},XH=`carousel`,ZH=`.bs.carousel`,QH=`.data-api`,$H=`ArrowLeft`,eU=`ArrowRight`,tU=500,nU=`next`,rU=`prev`,iU=`left`,aU=`right`,oU=`slide${ZH}`,sU=`slid${ZH}`,cU=`keydown${ZH}`,lU=`mouseenter${ZH}`,uU=`mouseleave${ZH}`,dU=`dragstart${ZH}`,fU=`load${ZH}${QH}`,pU=`click${ZH}${QH}`,mU=`carousel`,hU=`active`,gU=`slide`,_U=`carousel-item-end`,vU=`carousel-item-start`,yU=`carousel-item-next`,bU=`carousel-item-prev`,xU=`.active`,SU=`.carousel-item`,CU=`.active.carousel-item`,wU=`.carousel-item img`,TU=`.carousel-indicators`,EU=`[data-bs-slide], [data-bs-slide-to]`,DU=`[data-bs-ride="carousel"]`,OU={[$H]:aU,[eU]:iU},kU={interval:5e3,keyboard:!0,pause:`hover`,ride:!1,touch:!0,wrap:!0},AU={interval:`(number|boolean)`,keyboard:`boolean`,pause:`(string|boolean)`,ride:`(boolean|string)`,touch:`boolean`,wrap:`boolean`},jU=class e extends vH{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=bH.findOne(TU,this._element),this._addEventListeners(),this._config.ride===mU&&this.cycle()}static get Default(){return kU}static get DefaultType(){return AU}static get NAME(){return XH}next(){this._slide(nU)}nextWhenVisible(){!document.hidden&&IV(this._element)&&this.next()}prev(){this._slide(rU)}pause(){this._isSliding&&NV(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?Q.one(this._element,sU,()=>this.cycle()):this.cycle())}to(e){let t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){Q.one(this._element,sU,()=>this.to(e));return}let n=this._getItemIndex(this._getActive());if(n===e)return;let r=e>n?nU:rU;this._slide(r,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&Q.on(this._element,cU,e=>this._keydown(e)),this._config.pause===`hover`&&(Q.on(this._element,lU,()=>this.pause()),Q.on(this._element,uU,()=>this._maybeEnableCycle())),this._config.touch&&YH.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let e of bH.find(wU,this._element))Q.on(e,dU,e=>e.preventDefault());let e={leftCallback:()=>this._slide(this._directionToOrder(iU)),rightCallback:()=>this._slide(this._directionToOrder(aU)),endCallback:()=>{this._config.pause===`hover`&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),tU+this._config.interval))}};this._swipeHelper=new YH(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;let t=OU[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;let t=bH.findOne(xU,this._indicatorsElement);t.classList.remove(hU),t.removeAttribute(`aria-current`);let n=bH.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add(hU),n.setAttribute(`aria-current`,`true`))}_updateInterval(){let e=this._activeElement||this._getActive();if(!e)return;let t=Number.parseInt(e.getAttribute(`data-bs-interval`),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;let n=this._getActive(),r=e===nU,i=t||JV(this._getItems(),n,r,this._config.wrap);if(i===n)return;let a=this._getItemIndex(i),o=t=>Q.trigger(this._element,t,{relatedTarget:i,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:a});if(o(oU).defaultPrevented||!n||!i)return;let s=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=i;let c=r?vU:_U,l=r?yU:bU;i.classList.add(l),BV(i),n.classList.add(c),i.classList.add(c),this._queueCallback(()=>{i.classList.remove(c,l),i.classList.add(hU),n.classList.remove(hU,l,c),this._isSliding=!1,o(sU)},n,this._isAnimated()),s&&this.cycle()}_isAnimated(){return this._element.classList.contains(gU)}_getActive(){return bH.findOne(CU,this._element)}_getItems(){return bH.find(SU,this._element)}_clearInterval(){this._interval&&=(clearInterval(this._interval),null)}_directionToOrder(e){return WV()?e===iU?rU:nU:e===iU?nU:rU}_orderToDirection(e){return WV()?e===rU?iU:aU:e===rU?aU:iU}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this,t);if(typeof t==`number`)n.to(t);else if(typeof t==`string`){if(n[t]===void 0||t.startsWith(`_`)||t===`constructor`)throw TypeError(`No method named "${t}"`);n[t]()}})}};Q.on(document,pU,EU,function(e){let t=bH.getElementFromSelector(this);if(!t||!t.classList.contains(mU))return;e.preventDefault();let n=jU.getOrCreateInstance(t),r=this.getAttribute(`data-bs-slide-to`);r?(n.to(r),n._maybeEnableCycle()):hH.getDataAttribute(this,`slide`)===`next`?(n.next(),n._maybeEnableCycle()):(n.prev(),n._maybeEnableCycle())}),Q.on(window,fU,()=>{let e=bH.find(DU);for(let t of e)jU.getOrCreateInstance(t)}),GV(jU);var MU=`collapse`,NU=`.bs.collapse`,PU=`.data-api`,FU=`show${NU}`,IU=`shown${NU}`,LU=`hide${NU}`,RU=`hidden${NU}`,zU=`click${NU}${PU}`,BU=`show`,VU=`collapse`,HU=`collapsing`,UU=`collapsed`,WU=`:scope .${VU} .${VU}`,GU=`collapse-horizontal`,KU=`width`,qU=`height`,JU=`.collapse.show, .collapse.collapsing`,YU=`[data-bs-toggle="collapse"]`,XU={parent:null,toggle:!0},ZU={parent:`(null|element)`,toggle:`boolean`},QU=class e extends vH{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];let n=bH.find(YU);for(let e of n){let t=bH.getSelectorFromElement(e),n=bH.find(t).filter(e=>e===this._element);t!==null&&n.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return XU}static get DefaultType(){return ZU}static get NAME(){return MU}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(JU).filter(e=>e!==this._element).map(t=>e.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning||Q.trigger(this._element,FU).defaultPrevented)return;for(let e of t)e.hide();let n=this._getDimension();this._element.classList.remove(VU),this._element.classList.add(HU),this._element.style[n]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let r=()=>{this._isTransitioning=!1,this._element.classList.remove(HU),this._element.classList.add(VU,BU),this._element.style[n]=``,Q.trigger(this._element,IU)},i=`scroll${n[0].toUpperCase()+n.slice(1)}`;this._queueCallback(r,this._element,!0),this._element.style[n]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown()||Q.trigger(this._element,LU).defaultPrevented)return;let e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,BV(this._element),this._element.classList.add(HU),this._element.classList.remove(VU,BU);for(let e of this._triggerArray){let t=bH.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;let t=()=>{this._isTransitioning=!1,this._element.classList.remove(HU),this._element.classList.add(VU),Q.trigger(this._element,RU)};this._element.style[e]=``,this._queueCallback(t,this._element,!0)}_isShown(e=this._element){return e.classList.contains(BU)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=FV(e.parent),e}_getDimension(){return this._element.classList.contains(GU)?KU:qU}_initializeChildren(){if(!this._config.parent)return;let e=this._getFirstLevelChildren(YU);for(let t of e){let e=bH.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){let t=bH.find(WU,this._config.parent);return bH.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(let n of e)n.classList.toggle(UU,!t),n.setAttribute(`aria-expanded`,t)}static jQueryInterface(t){let n={};return typeof t==`string`&&/show|hide/.test(t)&&(n.toggle=!1),this.each(function(){let r=e.getOrCreateInstance(this,n);if(typeof t==`string`){if(r[t]===void 0)throw TypeError(`No method named "${t}"`);r[t]()}})}};Q.on(document,zU,YU,function(e){(e.target.tagName===`A`||e.delegateTarget&&e.delegateTarget.tagName===`A`)&&e.preventDefault();for(let e of bH.getMultipleElementsFromSelector(this))QU.getOrCreateInstance(e,{toggle:!1}).toggle()}),GV(QU);var $U=`dropdown`,eW=`.bs.dropdown`,tW=`.data-api`,nW=`Escape`,rW=`Tab`,iW=`ArrowUp`,aW=`ArrowDown`,oW=2,sW=`hide${eW}`,cW=`hidden${eW}`,lW=`show${eW}`,uW=`shown${eW}`,dW=`click${eW}${tW}`,fW=`keydown${eW}${tW}`,pW=`keyup${eW}${tW}`,mW=`show`,hW=`dropup`,gW=`dropend`,_W=`dropstart`,vW=`dropup-center`,yW=`dropdown-center`,bW=`[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)`,xW=`${bW}.${mW}`,SW=`.dropdown-menu`,CW=`.navbar`,wW=`.navbar-nav`,TW=`.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)`,EW=WV()?`top-end`:`top-start`,DW=WV()?`top-start`:`top-end`,OW=WV()?`bottom-end`:`bottom-start`,kW=WV()?`bottom-start`:`bottom-end`,AW=WV()?`left-start`:`right-start`,jW=WV()?`right-start`:`left-start`,MW=`top`,NW=`bottom`,PW={autoClose:!0,boundary:`clippingParents`,display:`dynamic`,offset:[0,2],popperConfig:null,reference:`toggle`},FW={autoClose:`(boolean|string)`,boundary:`(string|element)`,display:`string`,offset:`(array|string|function)`,popperConfig:`(null|object|function)`,reference:`(string|element|object)`},IW=class e extends vH{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=bH.next(this._element,SW)[0]||bH.prev(this._element,SW)[0]||bH.findOne(SW,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return PW}static get DefaultType(){return FW}static get NAME(){return $U}toggle(){return this._isShown()?this.hide():this.show()}show(){if(LV(this._element)||this._isShown())return;let e={relatedTarget:this._element};if(!Q.trigger(this._element,lW,e).defaultPrevented){if(this._createPopper(),`ontouchstart`in document.documentElement&&!this._parent.closest(wW))for(let e of[].concat(...document.body.children))Q.on(e,`mouseover`,zV);this._element.focus(),this._element.setAttribute(`aria-expanded`,!0),this._menu.classList.add(mW),this._element.classList.add(mW),Q.trigger(this._element,uW,e)}}hide(){if(LV(this._element)||!this._isShown())return;let e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!Q.trigger(this._element,sW,e).defaultPrevented){if(`ontouchstart`in document.documentElement)for(let e of[].concat(...document.body.children))Q.off(e,`mouseover`,zV);this._popper&&this._popper.destroy(),this._menu.classList.remove(mW),this._element.classList.remove(mW),this._element.setAttribute(`aria-expanded`,`false`),hH.removeDataAttribute(this._menu,`popper`),Q.trigger(this._element,cW,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference==`object`&&!PV(e.reference)&&typeof e.reference.getBoundingClientRect!=`function`)throw TypeError(`${$U.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(CV===void 0)throw TypeError(`Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)`);let e=this._element;this._config.reference===`parent`?e=this._parent:PV(this._config.reference)?e=FV(this._config.reference):typeof this._config.reference==`object`&&(e=this._config.reference);let t=this._getPopperConfig();this._popper=SV(e,this._menu,t)}_isShown(){return this._menu.classList.contains(mW)}_getPlacement(){let e=this._parent;if(e.classList.contains(gW))return AW;if(e.classList.contains(_W))return jW;if(e.classList.contains(vW))return MW;if(e.classList.contains(yW))return NW;let t=getComputedStyle(this._menu).getPropertyValue(`--bs-position`).trim()===`end`;return e.classList.contains(hW)?t?DW:EW:t?kW:OW}_detectNavbar(){return this._element.closest(CW)!==null}_getOffset(){let{offset:e}=this._config;return typeof e==`string`?e.split(`,`).map(e=>Number.parseInt(e,10)):typeof e==`function`?t=>e(t,this._element):e}_getPopperConfig(){let e={placement:this._getPlacement(),modifiers:[{name:`preventOverflow`,options:{boundary:this._config.boundary}},{name:`offset`,options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display===`static`)&&(hH.setDataAttribute(this._menu,`popper`,`static`),e.modifiers=[{name:`applyStyles`,enabled:!1}]),{...e,...KV(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){let n=bH.find(TW,this._menu).filter(e=>IV(e));n.length&&JV(n,t,e===aW,!n.includes(t)).focus()}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this,t);if(typeof t==`string`){if(n[t]===void 0)throw TypeError(`No method named "${t}"`);n[t]()}})}static clearMenus(t){if(t.button===oW||t.type===`keyup`&&t.key!==rW)return;let n=bH.find(xW);for(let r of n){let n=e.getInstance(r);if(!n||n._config.autoClose===!1)continue;let i=t.composedPath(),a=i.includes(n._menu);if(i.includes(n._element)||n._config.autoClose===`inside`&&!a||n._config.autoClose===`outside`&&a||n._menu.contains(t.target)&&(t.type===`keyup`&&t.key===rW||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;let o={relatedTarget:n._element};t.type===`click`&&(o.clickEvent=t),n._completeHide(o)}}static dataApiKeydownHandler(t){let n=/input|textarea/i.test(t.target.tagName),r=t.key===nW,i=[iW,aW].includes(t.key);if(!i&&!r||n&&!r)return;t.preventDefault();let a=this.matches(bW)?this:bH.prev(this,bW)[0]||bH.next(this,bW)[0]||bH.findOne(bW,t.delegateTarget.parentNode),o=e.getOrCreateInstance(a);i?(t.stopPropagation(),o.show(),o._selectMenuItem(t)):o._isShown()&&(t.stopPropagation(),o.hide(),a.focus())}};Q.on(document,fW,bW,IW.dataApiKeydownHandler),Q.on(document,fW,SW,IW.dataApiKeydownHandler),Q.on(document,dW,IW.clearMenus),Q.on(document,pW,IW.clearMenus),Q.on(document,dW,bW,function(e){e.preventDefault(),IW.getOrCreateInstance(this).toggle()}),GV(IW);var LW=`backdrop`,RW=`fade`,zW=`show`,BW=`mousedown.bs.${LW}`,VW={className:`modal-backdrop`,clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:`body`},HW={className:`string`,clickCallback:`(function|null)`,isAnimated:`boolean`,isVisible:`boolean`,rootElement:`(element|string)`},UW=class extends gH{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return VW}static get DefaultType(){return HW}static get NAME(){return LW}show(e){if(!this._config.isVisible){KV(e);return}this._append();let t=this._getElement();this._config.isAnimated&&BV(t),t.classList.add(zW),this._emulateAnimation(()=>{KV(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(zW),this._emulateAnimation(()=>{this.dispose(),KV(e)})):KV(e)}dispose(){this._isAppended&&=(Q.off(this._element,BW),this._element.remove(),!1)}_getElement(){if(!this._element){let e=document.createElement(`div`);e.className=this._config.className,this._config.isAnimated&&e.classList.add(RW),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=FV(e.rootElement),e}_append(){if(this._isAppended)return;let e=this._getElement();this._config.rootElement.append(e),Q.on(e,BW,()=>{KV(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){qV(e,this._getElement(),this._config.isAnimated)}},WW=`focustrap`,GW=`.bs.focustrap`,KW=`focusin${GW}`,qW=`keydown.tab${GW}`,JW=`Tab`,YW=`forward`,XW=`backward`,ZW={autofocus:!0,trapElement:null},QW={autofocus:`boolean`,trapElement:`element`},$W=class extends gH{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ZW}static get DefaultType(){return QW}static get NAME(){return WW}activate(){this._isActive||=(this._config.autofocus&&this._config.trapElement.focus(),Q.off(document,GW),Q.on(document,KW,e=>this._handleFocusin(e)),Q.on(document,qW,e=>this._handleKeydown(e)),!0)}deactivate(){this._isActive&&(this._isActive=!1,Q.off(document,GW))}_handleFocusin(e){let{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;let n=bH.focusableChildren(t);n.length===0?t.focus():this._lastTabNavDirection===XW?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){e.key===JW&&(this._lastTabNavDirection=e.shiftKey?XW:YW)}},eG=`.fixed-top, .fixed-bottom, .is-fixed, .sticky-top`,tG=`.sticky-top`,nG=`padding-right`,rG=`margin-right`,iG=class{constructor(){this._element=document.body}getWidth(){let e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){let e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,nG,t=>t+e),this._setElementAttributes(eG,nG,t=>t+e),this._setElementAttributes(tG,rG,t=>t-e)}reset(){this._resetElementAttributes(this._element,`overflow`),this._resetElementAttributes(this._element,nG),this._resetElementAttributes(eG,nG),this._resetElementAttributes(tG,rG)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,`overflow`),this._element.style.overflow=`hidden`}_setElementAttributes(e,t,n){let r=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+r)return;this._saveInitialAttribute(e,t);let i=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${n(Number.parseFloat(i))}px`)})}_saveInitialAttribute(e,t){let n=e.style.getPropertyValue(t);n&&hH.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{let n=hH.getDataAttribute(e,t);n===null?e.style.removeProperty(t):(hH.removeDataAttribute(e,t),e.style.setProperty(t,n))})}_applyManipulationCallback(e,t){if(PV(e))t(e);else for(let n of bH.find(e,this._element))t(n)}},aG=`modal`,oG=`.bs.modal`,sG=`.data-api`,cG=`Escape`,lG=`hide${oG}`,uG=`hidePrevented${oG}`,dG=`hidden${oG}`,fG=`show${oG}`,pG=`shown${oG}`,mG=`resize${oG}`,hG=`click.dismiss${oG}`,gG=`mousedown.dismiss${oG}`,_G=`keydown.dismiss${oG}`,vG=`click${oG}${sG}`,yG=`modal-open`,bG=`fade`,xG=`show`,SG=`modal-static`,CG=`.modal.show`,wG=`.modal-dialog`,TG=`.modal-body`,EG=`[data-bs-toggle="modal"]`,DG={backdrop:!0,focus:!0,keyboard:!0},OG={backdrop:`(boolean|string)`,focus:`boolean`,keyboard:`boolean`},kG=class e extends vH{constructor(e,t){super(e,t),this._dialog=bH.findOne(wG,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new iG,this._addEventListeners()}static get Default(){return DG}static get DefaultType(){return OG}static get NAME(){return aG}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||Q.trigger(this._element,fG,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(yG),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){this._isShown&&!this._isTransitioning&&(Q.trigger(this._element,lG).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(xG),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){Q.off(window,oG),Q.off(this._dialog,oG),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new UW({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new $W({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display=`block`,this._element.removeAttribute(`aria-hidden`),this._element.setAttribute(`aria-modal`,!0),this._element.setAttribute(`role`,`dialog`),this._element.scrollTop=0;let t=bH.findOne(TG,this._dialog);t&&(t.scrollTop=0),BV(this._element),this._element.classList.add(xG),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Q.trigger(this._element,pG,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){Q.on(this._element,_G,e=>{e.key===cG&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),Q.on(window,mG,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Q.on(this._element,gG,e=>{Q.one(this._element,hG,t=>{this._element===e.target&&this._element===t.target&&(this._config.backdrop===`static`?this._triggerBackdropTransition():this._config.backdrop&&this.hide())})})}_hideModal(){this._element.style.display=`none`,this._element.setAttribute(`aria-hidden`,!0),this._element.removeAttribute(`aria-modal`),this._element.removeAttribute(`role`),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(yG),this._resetAdjustments(),this._scrollBar.reset(),Q.trigger(this._element,dG)})}_isAnimated(){return this._element.classList.contains(bG)}_triggerBackdropTransition(){if(Q.trigger(this._element,uG).defaultPrevented)return;let e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;t===`hidden`||this._element.classList.contains(SG)||(e||(this._element.style.overflowY=`hidden`),this._element.classList.add(SG),this._queueCallback(()=>{this._element.classList.remove(SG),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){let e=WV()?`paddingLeft`:`paddingRight`;this._element.style[e]=`${t}px`}if(!n&&e){let e=WV()?`paddingRight`:`paddingLeft`;this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft=``,this._element.style.paddingRight=``}static jQueryInterface(t,n){return this.each(function(){let r=e.getOrCreateInstance(this,t);if(typeof t==`string`){if(r[t]===void 0)throw TypeError(`No method named "${t}"`);r[t](n)}})}};Q.on(document,vG,EG,function(e){let t=bH.getElementFromSelector(this);[`A`,`AREA`].includes(this.tagName)&&e.preventDefault(),Q.one(t,fG,e=>{e.defaultPrevented||Q.one(t,dG,()=>{IV(this)&&this.focus()})});let n=bH.findOne(CG);n&&kG.getInstance(n).hide(),kG.getOrCreateInstance(t).toggle(this)}),xH(kG),GV(kG);var AG=`offcanvas`,jG=`.bs.offcanvas`,MG=`.data-api`,NG=`load${jG}${MG}`,PG=`Escape`,FG=`show`,IG=`showing`,LG=`hiding`,RG=`offcanvas-backdrop`,zG=`.offcanvas.show`,BG=`show${jG}`,VG=`shown${jG}`,HG=`hide${jG}`,UG=`hidePrevented${jG}`,WG=`hidden${jG}`,GG=`resize${jG}`,KG=`click${jG}${MG}`,qG=`keydown.dismiss${jG}`,JG=`[data-bs-toggle="offcanvas"]`,YG={backdrop:!0,keyboard:!0,scroll:!1},XG={backdrop:`(boolean|string)`,keyboard:`boolean`,scroll:`boolean`},ZG=class e extends vH{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return YG}static get DefaultType(){return XG}static get NAME(){return AG}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||Q.trigger(this._element,BG,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||new iG().hide(),this._element.setAttribute(`aria-modal`,!0),this._element.setAttribute(`role`,`dialog`),this._element.classList.add(IG),this._queueCallback(()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(FG),this._element.classList.remove(IG),Q.trigger(this._element,VG,{relatedTarget:e})},this._element,!0))}hide(){this._isShown&&!Q.trigger(this._element,HG).defaultPrevented&&(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(LG),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(FG,LG),this._element.removeAttribute(`aria-modal`),this._element.removeAttribute(`role`),this._config.scroll||new iG().reset(),Q.trigger(this._element,WG)},this._element,!0))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let e=()=>{this._config.backdrop===`static`?Q.trigger(this._element,UG):this.hide()},t=!!this._config.backdrop;return new UW({className:RG,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new $W({trapElement:this._element})}_addEventListeners(){Q.on(this._element,qG,e=>{e.key===PG&&(this._config.keyboard?this.hide():Q.trigger(this._element,UG))})}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this,t);if(typeof t==`string`){if(n[t]===void 0||t.startsWith(`_`)||t===`constructor`)throw TypeError(`No method named "${t}"`);n[t](this)}})}};Q.on(document,KG,JG,function(e){let t=bH.getElementFromSelector(this);if([`A`,`AREA`].includes(this.tagName)&&e.preventDefault(),LV(this))return;Q.one(t,WG,()=>{IV(this)&&this.focus()});let n=bH.findOne(zG);n&&n!==t&&ZG.getInstance(n).hide(),ZG.getOrCreateInstance(t).toggle(this)}),Q.on(window,NG,()=>{for(let e of bH.find(zG))ZG.getOrCreateInstance(e).show()}),Q.on(window,GG,()=>{for(let e of bH.find(`[aria-modal][class*=show][class*=offcanvas-]`))getComputedStyle(e).position!==`fixed`&&ZG.getOrCreateInstance(e).hide()}),xH(ZG),GV(ZG);var QG={"*":[`class`,`dir`,`id`,`lang`,`role`,/^aria-[\w-]*$/i],a:[`target`,`href`,`title`,`rel`],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:[`src`,`srcset`,`alt`,`title`,`width`,`height`],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},$G=new Set([`background`,`cite`,`href`,`itemtype`,`longdesc`,`poster`,`src`,`xlink:href`]),eK=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,tK=(e,t)=>{let n=e.nodeName.toLowerCase();return t.includes(n)?!$G.has(n)||!!eK.test(e.nodeValue):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))};function nK(e,t,n){if(!e.length)return e;if(n&&typeof n==`function`)return n(e);let r=new window.DOMParser().parseFromString(e,`text/html`),i=[].concat(...r.body.querySelectorAll(`*`));for(let e of i){let n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}let r=[].concat(...e.attributes),i=[].concat(t[`*`]||[],t[n]||[]);for(let t of r)tK(t,i)||e.removeAttribute(t.nodeName)}return r.body.innerHTML}var rK=`TemplateFactory`,iK={allowList:QG,content:{},extraClass:``,html:!1,sanitize:!0,sanitizeFn:null,template:`
`},aK={allowList:`object`,content:`object`,extraClass:`(string|function)`,html:`boolean`,sanitize:`boolean`,sanitizeFn:`(null|function)`,template:`string`},oK={entry:`(string|element|function|null)`,selector:`(string|element)`},sK=class extends gH{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return iK}static get DefaultType(){return aK}static get NAME(){return rK}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){let e=document.createElement(`div`);e.innerHTML=this._maybeSanitize(this._config.template);for(let[t,n]of Object.entries(this._config.content))this._setContent(e,n,t);let t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(` `)),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(let[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},oK)}_setContent(e,t,n){let r=bH.findOne(n,e);r&&(t=this._resolvePossibleFunction(t),t?PV(t)?this._putElementInTemplate(FV(t),r):this._config.html?r.innerHTML=this._maybeSanitize(t):r.textContent=t:r.remove())}_maybeSanitize(e){return this._config.sanitize?nK(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return KV(e,[void 0,this])}_putElementInTemplate(e,t){this._config.html?(t.innerHTML=``,t.append(e)):t.textContent=e.textContent}},cK=`tooltip`,lK=new Set([`sanitize`,`allowList`,`sanitizeFn`]),uK=`fade`,dK=`modal`,fK=`show`,pK=`.tooltip-inner`,mK=`.${dK}`,hK=`hide.bs.modal`,gK=`hover`,_K=`focus`,vK=`click`,yK=`manual`,bK=`hide`,xK=`hidden`,SK=`show`,CK=`shown`,wK=`inserted`,TK=`click`,EK=`focusin`,DK=`focusout`,OK=`mouseenter`,kK=`mouseleave`,AK={AUTO:`auto`,TOP:`top`,RIGHT:WV()?`left`:`right`,BOTTOM:`bottom`,LEFT:WV()?`right`:`left`},jK={allowList:QG,animation:!0,boundary:`clippingParents`,container:!1,customClass:``,delay:0,fallbackPlacements:[`top`,`right`,`bottom`,`left`],html:!1,offset:[0,6],placement:`top`,popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:``,title:``,trigger:`hover focus`},MK={allowList:`object`,animation:`boolean`,boundary:`(string|element)`,container:`(string|element|boolean)`,customClass:`(string|function)`,delay:`(number|object)`,fallbackPlacements:`array`,html:`boolean`,offset:`(array|string|function)`,placement:`(string|function)`,popperConfig:`(null|object|function)`,sanitize:`boolean`,sanitizeFn:`(null|function)`,selector:`(string|boolean)`,template:`string`,title:`(string|element|function)`,trigger:`string`},NK=class e extends vH{constructor(e,t){if(CV===void 0)throw TypeError(`Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)`);super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return jK}static get DefaultType(){return MK}static get NAME(){return cK}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),Q.off(this._element.closest(mK),hK,this._hideModalHandler),this._element.getAttribute(`data-bs-original-title`)&&this._element.setAttribute(`title`,this._element.getAttribute(`data-bs-original-title`)),this._disposePopper(),super.dispose()}show(){if(this._element.style.display===`none`)throw Error(`Please use show on visible elements`);if(!(this._isWithContent()&&this._isEnabled))return;let e=Q.trigger(this._element,this.constructor.eventName(SK)),t=(RV(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();let n=this._getTipElement();this._element.setAttribute(`aria-describedby`,n.getAttribute(`id`));let{container:r}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(n),Q.trigger(this._element,this.constructor.eventName(wK))),this._popper=this._createPopper(n),n.classList.add(fK),`ontouchstart`in document.documentElement)for(let e of[].concat(...document.body.children))Q.on(e,`mouseover`,zV);this._queueCallback(()=>{Q.trigger(this._element,this.constructor.eventName(CK)),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!Q.trigger(this._element,this.constructor.eventName(bK)).defaultPrevented){if(this._getTipElement().classList.remove(fK),`ontouchstart`in document.documentElement)for(let e of[].concat(...document.body.children))Q.off(e,`mouseover`,zV);this._activeTrigger[vK]=!1,this._activeTrigger[_K]=!1,this._activeTrigger[gK]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute(`aria-describedby`),Q.trigger(this._element,this.constructor.eventName(xK)))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||=this._createTipElement(this._newContent||this._getContentForTemplate()),this.tip}_createTipElement(e){let t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(uK,fK),t.classList.add(`bs-${this.constructor.NAME}-auto`);let n=jV(this.constructor.NAME).toString();return t.setAttribute(`id`,n),this._isAnimated()&&t.classList.add(uK),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new sK({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[pK]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute(`data-bs-original-title`)}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(uK)}_isShown(){return this.tip&&this.tip.classList.contains(fK)}_createPopper(e){let t=AK[KV(this._config.placement,[this,e,this._element]).toUpperCase()];return SV(this._element,e,this._getPopperConfig(t))}_getOffset(){let{offset:e}=this._config;return typeof e==`string`?e.split(`,`).map(e=>Number.parseInt(e,10)):typeof e==`function`?t=>e(t,this._element):e}_resolvePossibleFunction(e){return KV(e,[this._element,this._element])}_getPopperConfig(e){let t={placement:e,modifiers:[{name:`flip`,options:{fallbackPlacements:this._config.fallbackPlacements}},{name:`offset`,options:{offset:this._getOffset()}},{name:`preventOverflow`,options:{boundary:this._config.boundary}},{name:`arrow`,options:{element:`.${this.constructor.NAME}-arrow`}},{name:`preSetPlacement`,enabled:!0,phase:`beforeMain`,fn:e=>{this._getTipElement().setAttribute(`data-popper-placement`,e.state.placement)}}]};return{...t,...KV(this._config.popperConfig,[void 0,t])}}_setListeners(){let e=this._config.trigger.split(` `);for(let t of e)if(t===`click`)Q.on(this._element,this.constructor.eventName(TK),this._config.selector,e=>{let t=this._initializeOnDelegatedTarget(e);t._activeTrigger[vK]=!(t._isShown()&&t._activeTrigger[vK]),t.toggle()});else if(t!==yK){let e=t===gK?this.constructor.eventName(OK):this.constructor.eventName(EK),n=t===gK?this.constructor.eventName(kK):this.constructor.eventName(DK);Q.on(this._element,e,this._config.selector,e=>{let t=this._initializeOnDelegatedTarget(e);t._activeTrigger[e.type===`focusin`?_K:gK]=!0,t._enter()}),Q.on(this._element,n,this._config.selector,e=>{let t=this._initializeOnDelegatedTarget(e);t._activeTrigger[e.type===`focusout`?_K:gK]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Q.on(this._element.closest(mK),hK,this._hideModalHandler)}_fixTitle(){let e=this._element.getAttribute(`title`);e&&(!this._element.getAttribute(`aria-label`)&&!this._element.textContent.trim()&&this._element.setAttribute(`aria-label`,e),this._element.setAttribute(`data-bs-original-title`,e),this._element.removeAttribute(`title`))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){let t=hH.getDataAttributes(this._element);for(let e of Object.keys(t))lK.has(e)&&delete t[e];return e={...t,...typeof e==`object`&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:FV(e.container),typeof e.delay==`number`&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title==`number`&&(e.title=e.title.toString()),typeof e.content==`number`&&(e.content=e.content.toString()),e}_getDelegateConfig(){let e={};for(let[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger=`manual`,e}_disposePopper(){this._popper&&=(this._popper.destroy(),null),this.tip&&=(this.tip.remove(),null)}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this,t);if(typeof t==`string`){if(n[t]===void 0)throw TypeError(`No method named "${t}"`);n[t]()}})}};GV(NK);var PK=`popover`,FK=`.popover-header`,IK=`.popover-body`,LK={...NK.Default,content:``,offset:[0,8],placement:`right`,template:``,trigger:`click`},RK={...NK.DefaultType,content:`(null|string|element|function)`};GV(class e extends NK{static get Default(){return LK}static get DefaultType(){return RK}static get NAME(){return PK}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[FK]:this._getTitle(),[IK]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this,t);if(typeof t==`string`){if(n[t]===void 0)throw TypeError(`No method named "${t}"`);n[t]()}})}});var zK=`scrollspy`,BK=`.bs.scrollspy`,VK=`.data-api`,HK=`activate${BK}`,UK=`click${BK}`,WK=`load${BK}${VK}`,GK=`dropdown-item`,KK=`active`,qK=`[data-bs-spy="scroll"]`,JK=`[href]`,YK=`.nav, .list-group`,XK=`.nav-link`,ZK=`${XK}, .nav-item > ${XK}, .list-group-item`,QK=`.dropdown`,$K=`.dropdown-toggle`,eq={offset:null,rootMargin:`0px 0px -25%`,smoothScroll:!1,target:null,threshold:[.1,.5,1]},tq={offset:`(number|null)`,rootMargin:`string`,smoothScroll:`boolean`,target:`element`,threshold:`array`},nq=class e extends vH{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY===`visible`?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return eq}static get DefaultType(){return tq}static get NAME(){return zK}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(let e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=FV(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold==`string`&&(e.threshold=e.threshold.split(`,`).map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Q.off(this._config.target,UK),Q.on(this._config.target,UK,JK,e=>{let t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();let n=this._rootElement||window,r=t.offsetTop-this._element.offsetTop;if(n.scrollTo){n.scrollTo({top:r,behavior:`smooth`});return}n.scrollTop=r}}))}_getNewObserver(){let e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){let t=e=>this._targetLinks.get(`#${e.target.id}`),n=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},r=(this._rootElement||document.documentElement).scrollTop,i=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;for(let a of e){if(!a.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(a));continue}let e=a.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(i&&e){if(n(a),!r)return}else!i&&!e&&n(a)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;let e=bH.find(JK,this._config.target);for(let t of e){if(!t.hash||LV(t))continue;let e=bH.findOne(decodeURI(t.hash),this._element);IV(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(KK),this._activateParents(e),Q.trigger(this._element,HK,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(GK))bH.findOne($K,e.closest(QK)).classList.add(KK);else for(let t of bH.parents(e,YK))for(let e of bH.prev(t,ZK))e.classList.add(KK)}_clearActiveClass(e){e.classList.remove(KK);let t=bH.find(`${JK}.${KK}`,e);for(let e of t)e.classList.remove(KK)}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this,t);if(typeof t==`string`){if(n[t]===void 0||t.startsWith(`_`)||t===`constructor`)throw TypeError(`No method named "${t}"`);n[t]()}})}};Q.on(window,WK,()=>{for(let e of bH.find(qK))nq.getOrCreateInstance(e)}),GV(nq);var rq=`tab`,iq=`.bs.tab`,aq=`hide${iq}`,oq=`hidden${iq}`,sq=`show${iq}`,cq=`shown${iq}`,lq=`click${iq}`,uq=`keydown${iq}`,dq=`load${iq}`,fq=`ArrowLeft`,pq=`ArrowRight`,mq=`ArrowUp`,hq=`ArrowDown`,gq=`Home`,_q=`End`,vq=`active`,yq=`fade`,bq=`show`,xq=`dropdown`,Sq=`.dropdown-toggle`,Cq=`.dropdown-menu`,wq=`:not(${Sq})`,Tq=`.list-group, .nav, [role="tablist"]`,Eq=`.nav-item, .list-group-item`,Dq=`.nav-link${wq}, .list-group-item${wq}, [role="tab"]${wq}`,Oq=`[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]`,kq=`${Dq}, ${Oq}`,Aq=`.${vq}[data-bs-toggle="tab"], .${vq}[data-bs-toggle="pill"], .${vq}[data-bs-toggle="list"]`,jq=class e extends vH{constructor(e){super(e),this._parent=this._element.closest(Tq),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Q.on(this._element,uq,e=>this._keydown(e)))}static get NAME(){return rq}show(){let e=this._element;if(this._elemIsActive(e))return;let t=this._getActiveElem(),n=t?Q.trigger(t,aq,{relatedTarget:e}):null;Q.trigger(e,sq,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add(vq),this._activate(bH.getElementFromSelector(e)),this._queueCallback(()=>{e.getAttribute(`role`)===`tab`?(e.removeAttribute(`tabindex`),e.setAttribute(`aria-selected`,!0),this._toggleDropDown(e,!0),Q.trigger(e,cq,{relatedTarget:t})):e.classList.add(bq)},e,e.classList.contains(yq)))}_deactivate(e,t){e&&(e.classList.remove(vq),e.blur(),this._deactivate(bH.getElementFromSelector(e)),this._queueCallback(()=>{e.getAttribute(`role`)===`tab`?(e.setAttribute(`aria-selected`,!1),e.setAttribute(`tabindex`,`-1`),this._toggleDropDown(e,!1),Q.trigger(e,oq,{relatedTarget:t})):e.classList.remove(bq)},e,e.classList.contains(yq)))}_keydown(t){if(![fq,pq,mq,hq,gq,_q].includes(t.key))return;t.stopPropagation(),t.preventDefault();let n=this._getChildren().filter(e=>!LV(e)),r;if([gq,_q].includes(t.key))r=n[t.key===gq?0:n.length-1];else{let e=[pq,hq].includes(t.key);r=JV(n,t.target,e,!0)}r&&(r.focus({preventScroll:!0}),e.getOrCreateInstance(r).show())}_getChildren(){return bH.find(kq,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,`role`,`tablist`);for(let e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);let t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute(`aria-selected`,t),n!==e&&this._setAttributeIfNotExists(n,`role`,`presentation`),t||e.setAttribute(`tabindex`,`-1`),this._setAttributeIfNotExists(e,`role`,`tab`),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){let t=bH.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,`role`,`tabpanel`),e.id&&this._setAttributeIfNotExists(t,`aria-labelledby`,`${e.id}`))}_toggleDropDown(e,t){let n=this._getOuterElement(e);if(!n.classList.contains(xq))return;let r=(e,r)=>{let i=bH.findOne(e,n);i&&i.classList.toggle(r,t)};r(Sq,vq),r(Cq,bq),n.setAttribute(`aria-expanded`,t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(vq)}_getInnerElement(e){return e.matches(kq)?e:bH.findOne(kq,e)}_getOuterElement(e){return e.closest(Eq)||e}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this);if(typeof t==`string`){if(n[t]===void 0||t.startsWith(`_`)||t===`constructor`)throw TypeError(`No method named "${t}"`);n[t]()}})}};Q.on(document,lq,Oq,function(e){[`A`,`AREA`].includes(this.tagName)&&e.preventDefault(),!LV(this)&&jq.getOrCreateInstance(this).show()}),Q.on(window,dq,()=>{for(let e of bH.find(Aq))jq.getOrCreateInstance(e)}),GV(jq);var Mq=`toast`,Nq=`.bs.toast`,Pq=`mouseover${Nq}`,Fq=`mouseout${Nq}`,Iq=`focusin${Nq}`,Lq=`focusout${Nq}`,Rq=`hide${Nq}`,zq=`hidden${Nq}`,Bq=`show${Nq}`,Vq=`shown${Nq}`,Hq=`fade`,Uq=`hide`,Wq=`show`,Gq=`showing`,Kq={animation:`boolean`,autohide:`boolean`,delay:`number`},qq={animation:!0,autohide:!0,delay:5e3},Jq=class e extends vH{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return qq}static get DefaultType(){return Kq}static get NAME(){return Mq}show(){Q.trigger(this._element,Bq).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add(Hq),this._element.classList.remove(Uq),BV(this._element),this._element.classList.add(Wq,Gq),this._queueCallback(()=>{this._element.classList.remove(Gq),Q.trigger(this._element,Vq),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&!Q.trigger(this._element,Rq).defaultPrevented&&(this._element.classList.add(Gq),this._queueCallback(()=>{this._element.classList.add(Uq),this._element.classList.remove(Gq,Wq),Q.trigger(this._element,zq)},this._element,this._config.animation))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Wq),super.dispose()}isShown(){return this._element.classList.contains(Wq)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case`mouseover`:case`mouseout`:this._hasMouseInteraction=t;break;case`focusin`:case`focusout`:this._hasKeyboardInteraction=t}if(t){this._clearTimeout();return}let n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){Q.on(this._element,Pq,e=>this._onInteraction(e,!0)),Q.on(this._element,Fq,e=>this._onInteraction(e,!1)),Q.on(this._element,Iq,e=>this._onInteraction(e,!0)),Q.on(this._element,Lq,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){let n=e.getOrCreateInstance(this,t);if(typeof t==`string`){if(n[t]===void 0)throw TypeError(`No method named "${t}"`);n[t](this)}})}};xH(Jq),GV(Jq);var Yq={data(){return{tags:[],ready:!1,newTag:``,newTagModal:null,requestController:new AbortController}},mounted(){document.title=`Monitoring - Telescope`,this.newTagModal=kG.getOrCreateInstance(this.$refs.addTagModal,{backdrop:`static`});let{signal:e}=this.requestController;bD.get(Telescope.basePath+`/telescope-api/monitored-tags`,{signal:e}).then(t=>{e.aborted||(this.tags=t.data.tags,this.ready=!0)}).catch(t=>{if(!e.aborted)throw t})},beforeUnmount(){this.requestController.abort(),this.newTagModal.hide(),this.newTagModal.dispose()},methods:{removeTag(e){this.alertConfirm(`Are you sure you want to remove this tag?`,()=>bD.post(Telescope.basePath+`/telescope-api/monitored-tags/delete`,{tag:e}).then(()=>{this.tags=CC.default.reject(this.tags,t=>t===e)}).catch(()=>{this.alertError(`Telescope could not confirm the monitoring change. Reload the page to check the current tags.`)}))},openNewTagModal(){this.newTagModal.show(),this.$refs.newTagInput.focus()},monitorNewTag(){let e=this.newTag;if(!e.length||this.tags.includes(e))this.cancelNewTag();else return bD.post(Telescope.basePath+`/telescope-api/monitored-tags`,{tag:e}).then(()=>{this.tags.includes(e)||this.tags.push(e),this.newTag===e&&(this.newTagModal.hide(),this.newTag=``)}).catch(()=>{this.alertError(`Telescope could not confirm the monitoring change. Reload the page to check the current tags.`)})},cancelNewTag(){this.newTagModal.hide(),this.newTag=``}}},Xq={class:`card`},Zq={class:`card-header d-flex align-items-center justify-content-between`},Qq=[`disabled`],$q={key:0,class:`d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},eJ={key:1,class:`d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},tJ={key:2,class:`table table-hover mb-0`},nJ={class:`table-fit`},rJ=[`onClick`],iJ={class:`modal`,id:`addTagModel`,ref:`addTagModal`,tabindex:`-1`,role:`dialog`,"aria-labelledby":`addTagModalLabel`,"aria-hidden":`true`},aJ={class:`modal-dialog`,role:`document`},oJ={class:`modal-content`},sJ={class:`modal-body`},cJ={class:`modal-footer justify-content-start flex-row-reverse`};function lJ(e,t,n,r,i,a){return L(),R(`div`,Xq,[z(`div`,Zq,[t[5]||=z(`h2`,{class:`h6 m-0`},`Monitoring`,-1),z(`button`,{class:`btn btn-primary`,disabled:!i.ready,onClick:t[0]||=H((...e)=>a.openNewTagModal&&a.openNewTagModal(...e),[`prevent`])},`Monitor`,8,Qq)]),i.ready?V(``,!0):(L(),R(`div`,$q,[...t[6]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,class:`icon spin me-2 fill-text-color`},[z(`path`,{d:`M12 10a2 2 0 0 1-3.41 1.41A2 2 0 0 1 10 8V0a9.97 9.97 0 0 1 10 10h-8zm7.9 1.41A10 10 0 1 1 8.59.1v2.03a8 8 0 1 0 9.29 9.29h2.02zm-4.07 0a6 6 0 1 1-7.25-7.25v2.1a3.99 3.99 0 0 0-1.4 6.57 4 4 0 0 0 6.56-1.42h2.1z`})],-1),z(`span`,null,`Scanning...`,-1)]])),i.ready&&i.tags.length==0?(L(),R(`div`,eJ,[...t[7]||=[z(`span`,null,`No tags are currently being monitored.`,-1)]])):V(``,!0),i.ready&&i.tags.length>0?(L(),R(`table`,tJ,[t[9]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Tag`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(i.tags,n=>(L(),R(`tr`,{key:n},[z(`td`,null,N(e.truncate(n,140)),1),z(`td`,nJ,[z(`a`,{href:`#`,class:`control-action`,onClick:H(e=>a.removeTag(n),[`prevent`])},[...t[8]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{d:`M6 2l2-2h4l2 2h4v2H2V2h4zM3 6h14l-1 14H4L3 6zm5 2v10h1V8H8zm3 0v10h1V8h-1z`})],-1)]],8,rJ)])]))),128))])])):V(``,!0),z(`div`,iJ,[z(`div`,aJ,[z(`div`,oJ,[t[10]||=z(`div`,{class:`modal-header`,id:`addTagModalLabel`},`Monitor New Tag`,-1),z(`div`,sJ,[Vr(z(`input`,{type:`text`,class:`form-control`,placeholder:`Project:6352`,onKeyup:t[1]||=Uu((...e)=>a.monitorNewTag&&a.monitorNewTag(...e),[`enter`]),"onUpdate:modelValue":t[2]||=e=>i.newTag=e,id:`newTagInput`,ref:`newTagInput`},null,544),[[Du,i.newTag]])]),z(`div`,cJ,[z(`button`,{class:`btn btn-primary`,onClick:t[3]||=(...e)=>a.monitorNewTag&&a.monitorNewTag(...e)},`Monitor`),z(`button`,{class:`btn`,onClick:t[4]||=(...e)=>a.cancelNewTag&&a.cancelNewTag(...e)},`Cancel`)])])])],512)])}var uJ=xD(Yq,[[`render`,lJ]]),dJ={mixins:[ek]},fJ={class:`table-fit`},pJ={class:`table-fit`},mJ=[`data-timeago`,`title`],hJ={class:`table-fit`};function gJ(e,t,n,r,i,a){let o=I(`router-link`),s=I(`index-screen`);return L(),Us(s,{title:`Gates`,resource:`gates`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Ability`),z(`th`,{scope:`col`},`Result`),z(`th`,{scope:`col`},`Message`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(n=>[z(`td`,null,N(e.truncate(n.entry.content.ability,80)),1),z(`td`,fJ,[z(`span`,{class:M([`badge`,`badge-`+e.gateResultClass(n.entry.content.result)])},N(n.entry.content.result),3)]),z(`td`,pJ,N(e.truncate(n.entry.content.message,30)),1),z(`td`,{class:`table-fit text-muted`,"data-timeago":n.entry.created_at,title:n.entry.created_at},N(e.timeAgo(n.entry.created_at)),9,mJ),z(`td`,hJ,[B(o,{to:{name:`gate-preview`,params:{id:n.entry.id}},class:`control-action`},{default:F(()=>[...t[1]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var _J=xD(dJ,[[`render`,gJ]]),vJ={mixins:[ek],data(){return{entry:null,batch:[]}}},yJ={key:0},bJ={class:`card mt-5 overflow-hidden`},xJ={class:`code-bg p-4 mb-0 text-white`};function SJ(e,t,n,r,i,a){let o=I(`vue-json-pretty`),s=I(`copy-clipboard`),c=I(`preview-screen`);return L(),Us(c,{title:`Gate Details`,resource:`gates`,id:e.$route.params.id},{"table-parameters":F(n=>[z(`tr`,null,[t[0]||=z(`td`,{class:`table-fit text-muted`},`Ability`,-1),z(`td`,null,N(n.entry.content.ability),1)]),z(`tr`,null,[t[1]||=z(`td`,{class:`table-fit text-muted`},`Result`,-1),z(`td`,null,[z(`span`,{class:M([`badge`,`badge-`+e.gateResultClass(n.entry.content.result)])},N(n.entry.content.result),3)])]),z(`tr`,null,[t[2]||=z(`td`,{class:`table-fit text-muted`},`Message`,-1),z(`td`,null,N(n.entry.content.message),1)]),n.entry.content.file?(L(),R(`tr`,yJ,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Location`,-1),z(`td`,null,N(n.entry.content.file)+`:`+N(n.entry.content.line),1)])):V(``,!0)]),"after-attributes-card":F(e=>[z(`div`,bJ,[t[4]||=z(`ul`,{class:`nav nav-pills`},[z(`li`,{class:`nav-item`},[z(`a`,{class:`nav-link active`},`Arguments`)])],-1),z(`div`,xJ,[B(s,{data:e.entry.content.arguments},{default:F(()=>[B(o,{data:e.entry.content.arguments},null,8,[`data`])]),_:2},1032,[`data`])])])]),_:1},8,[`id`])}var CJ=xD(vJ,[[`render`,SJ]]),wJ={},TJ={class:`text-muted`},EJ={class:`table-fit text-end text-muted`},DJ=[`data-timeago`],OJ={class:`table-fit`};function kJ(e,t){let n=I(`router-link`),r=I(`index-screen`);return L(),Us(r,{title:`Views`,resource:`views`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Name`),z(`th`,{scope:`col`,class:`text-end`},`Composers`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(r=>[z(`td`,null,[Qs(N(r.entry.content.name)+` `,1),t[1]||=z(`br`,null,null,-1),z(`small`,TJ,N(e.truncate(r.entry.content.path,100)),1)]),z(`td`,EJ,N(r.entry.content.composers?r.entry.content.composers.length:0),1),z(`td`,{class:`table-fit text-muted`,"data-timeago":r.entry.created_at},N(e.timeAgo(r.entry.created_at)),9,DJ),z(`td`,OJ,[B(n,{to:{name:`view-preview`,params:{id:r.entry.id}},class:`control-action`},{default:F(()=>[...t[2]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var AJ=xD(wJ,[[`render`,kJ]]),jJ={mixins:[ek],data(){return{entry:null,batch:[],currentTab:`data`}}},MJ={key:0,class:`card mt-5`},NJ={class:`nav nav-pills`},PJ={class:`nav-item`},FJ={key:0,class:`nav-item`},IJ={class:`code-bg p-4 mb-0 text-white`},LJ={class:`table table-hover mb-0`},RJ=[`title`],zJ={class:`table-fit`};function BJ(e,t,n,r,i,a){let o=I(`vue-json-pretty`),s=I(`copy-clipboard`),c=I(`preview-screen`);return L(),Us(c,{title:`View Action`,resource:`views`,id:e.$route.params.id},{"table-parameters":F(e=>[z(`tr`,null,[t[2]||=z(`td`,{class:`table-fit text-muted`},`View`,-1),z(`td`,null,N(e.entry.content.name),1)]),z(`tr`,null,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Path`,-1),z(`td`,null,N(e.entry.content.path),1)])]),"after-attributes-card":F(n=>[n.entry.content.data?(L(),R(`div`,MJ,[z(`ul`,NJ,[z(`li`,PJ,[z(`a`,{class:M([`nav-link`,{active:i.currentTab==`data`}]),href:`#`,onClick:t[0]||=H(e=>i.currentTab=`data`,[`prevent`])},`Data`,2)]),n.entry.content.composers?(L(),R(`li`,FJ,[z(`a`,{class:M([`nav-link`,{active:i.currentTab==`composers`}]),href:`#`,onClick:t[1]||=H(e=>i.currentTab=`composers`,[`prevent`])},`Composers`,2)])):V(``,!0)]),z(`div`,null,[Vr(z(`div`,IJ,[B(s,{data:n.entry.content.data},{default:F(()=>[B(o,{data:n.entry.content.data},null,8,[`data`])]),_:2},1032,[`data`])],512),[[yl,i.currentTab==`data`]]),Vr(z(`table`,LJ,[t[4]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Composer`),z(`th`,null,`Type`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(n.entry.content.composers,(t,n)=>(L(),R(`tr`,{key:n},[z(`td`,{title:t.name},N(t.name),9,RJ),z(`td`,zJ,[z(`span`,{class:M([`badge`,`badge-`+e.composerTypeClass(t.type)])},N(t.type),3)])]))),128))])],512),[[yl,i.currentTab==`composers`]])])])):V(``,!0)]),_:1},8,[`id`])}var VJ=xD(jJ,[[`render`,BJ]]),HJ={mixins:[ek]},UJ={class:`table-fit pe-0`},WJ=[`title`],GJ={class:`table-fit`},KJ={class:`table-fit text-end text-muted`},qJ={key:0},JJ={key:1},YJ=[`data-timeago`,`title`],XJ={class:`table-fit`};function ZJ(e,t,n,r,i,a){let o=I(`router-link`),s=I(`index-screen`);return L(),Us(s,{title:`HTTP Client`,resource:`client-requests`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Verb`),z(`th`,{scope:`col`},`URI`),z(`th`,{scope:`col`},`Status`),z(`th`,{scope:`col`,class:`text-end`},`Duration`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(n=>[z(`td`,UJ,[z(`span`,{class:M([`badge`,`badge-`+e.requestMethodClass(n.entry.content.method)])},N(n.entry.content.method),3)]),z(`td`,{title:n.entry.content.uri},N(e.truncate(n.entry.content.uri,60)),9,WJ),z(`td`,GJ,[z(`span`,{class:M([`badge`,`badge-`+e.requestStatusClass(n.entry.content.response_status===void 0?null:n.entry.content.response_status)])},N(n.entry.content.response_status===void 0?`N/A`:n.entry.content.response_status),3)]),z(`td`,KJ,[n.entry.content.duration?(L(),R(`span`,qJ,N(n.entry.content.duration)+`ms`,1)):(L(),R(`span`,JJ,`-`))]),z(`td`,{class:`table-fit text-muted`,"data-timeago":n.entry.created_at,title:n.entry.created_at},N(e.timeAgo(n.entry.created_at)),9,YJ),z(`td`,XJ,[B(o,{to:{name:`client-request-preview`,params:{id:n.entry.id}},class:`control-action`},{default:F(()=>[...t[1]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var QJ=xD(HJ,[[`render`,ZJ]]),$J={mixins:[ek],data(){return{entry:null,batch:[],currentRequestTab:`payload`,currentResponseTab:`response`}}},eY={class:`card mt-5 overflow-hidden`},tY={class:`nav nav-pills`},nY={class:`nav-item`},rY={class:`nav-item`},iY={class:`code-bg p-4 mb-0 text-white`},aY={key:0,class:`card mt-5 overflow-hidden`},oY={class:`nav nav-pills`},sY={class:`nav-item`},cY={class:`nav-item`},lY={class:`code-bg p-4 mb-0 text-white`};function uY(e,t,n,r,i,a){let o=I(`vue-json-pretty`),s=I(`copy-clipboard`),c=I(`preview-screen`);return L(),Us(c,{title:`HTTP Client Request Details`,resource:`client-requests`,id:e.$route.params.id},{"table-parameters":F(n=>[z(`tr`,null,[t[4]||=z(`td`,{class:`table-fit text-muted`},`Method`,-1),z(`td`,null,[z(`span`,{class:M([`badge`,`badge-`+e.requestMethodClass(n.entry.content.method)])},N(n.entry.content.method),3)])]),z(`tr`,null,[t[5]||=z(`td`,{class:`table-fit text-muted`},`URI`,-1),z(`td`,null,N(n.entry.content.uri),1)]),z(`tr`,null,[t[6]||=z(`td`,{class:`table-fit text-muted`},`Status`,-1),z(`td`,null,[z(`span`,{class:M([`badge`,`badge-`+e.requestStatusClass(n.entry.content.response_status===void 0?null:n.entry.content.response_status)])},N(n.entry.content.response_status===void 0?`N/A`:n.entry.content.response_status),3)])]),z(`tr`,null,[t[7]||=z(`td`,{class:`table-fit text-muted`},`Duration`,-1),z(`td`,null,N(n.entry.content.duration||`-`)+`ms`,1)])]),"after-attributes-card":F(e=>[z(`div`,eY,[z(`ul`,tY,[z(`li`,nY,[z(`a`,{class:M([`nav-link`,{active:i.currentRequestTab==`payload`}]),href:`#`,onClick:t[0]||=H(e=>i.currentRequestTab=`payload`,[`prevent`])},`Payload`,2)]),z(`li`,rY,[z(`a`,{class:M([`nav-link`,{active:i.currentRequestTab==`headers`}]),href:`#`,onClick:t[1]||=H(e=>i.currentRequestTab=`headers`,[`prevent`])},`Headers`,2)])]),z(`div`,iY,[B(s,{data:e.entry.content[i.currentRequestTab]},{default:F(()=>[B(o,{data:e.entry.content[i.currentRequestTab]},null,8,[`data`])]),_:2},1032,[`data`])])]),e.entry.content.response_status?(L(),R(`div`,aY,[z(`ul`,oY,[z(`li`,sY,[z(`a`,{class:M([`nav-link`,{active:i.currentResponseTab==`response`}]),href:`#`,onClick:t[2]||=H(e=>i.currentResponseTab=`response`,[`prevent`])},`Response`,2)]),z(`li`,cY,[z(`a`,{class:M([`nav-link`,{active:i.currentResponseTab==`headers`}]),href:`#`,onClick:t[3]||=H(e=>i.currentResponseTab=`headers`,[`prevent`])},`Headers`,2)])]),z(`div`,lY,[i.currentResponseTab==`response`?(L(),Us(s,{key:0,data:e.entry.content.response},{default:F(()=>[B(o,{data:e.entry.content.response},null,8,[`data`])]),_:2},1032,[`data`])):V(``,!0),i.currentResponseTab==`headers`?(L(),Us(s,{key:1,data:e.entry.content.response_headers},{default:F(()=>[B(o,{data:e.entry.content.response_headers},null,8,[`data`])]),_:2},1032,[`data`])):V(``,!0)])])):V(``,!0)]),_:1},8,[`id`])}var dY=xD($J,[[`render`,uY]]),fY={},pY={class:`table-fit`},mY={class:`badge badge-info`},hY={key:0},gY={key:1},_Y=[`data-timeago`,`title`],vY={class:`table-fit`};function yY(e,t){let n=I(`router-link`),r=I(`index-screen`);return L(),Us(r,{title:`Reverb`,resource:`reverb`},{"table-header":F(()=>[...t[0]||=[z(`tr`,null,[z(`th`,{scope:`col`},`Event`),z(`th`,{scope:`col`},`Details`),z(`th`,{scope:`col`},`Happened`),z(`th`,{scope:`col`})],-1)]]),row:F(r=>[z(`td`,pY,[z(`span`,mY,N(r.entry.content.event),1)]),z(`td`,null,[r.entry.content.channel?(L(),R(`span`,hY,N(r.entry.content.channel),1)):r.entry.content.socket_id?(L(),R(`span`,gY,N(r.entry.content.socket_id),1)):V(``,!0)]),z(`td`,{class:`table-fit text-muted`,"data-timeago":r.entry.created_at,title:r.entry.created_at},N(e.timeAgo(r.entry.created_at)),9,_Y),z(`td`,vY,[B(n,{to:{name:`reverb-preview`,params:{id:r.entry.id}},class:`control-action`},{default:F(()=>[...t[1]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]),_:1})}var bY=xD(fY,[[`render`,yY]]),xY={data(){return{entry:null,batch:[]}}},SY={class:`badge badge-info`},CY={key:0},wY={key:1},TY={key:2},EY={key:3},DY={key:0,class:`card mt-5 overflow-hidden`},OY={class:`code-bg p-4 mb-0 text-white`};function kY(e,t,n,r,i,a){let o=I(`preview-screen`);return L(),Us(o,{title:`Reverb Event Details`,resource:`reverb`,id:e.$route.params.id},{"table-parameters":F(e=>[z(`tr`,null,[t[0]||=z(`td`,{class:`table-fit text-muted`},`Event`,-1),z(`td`,null,[z(`span`,SY,N(e.entry.content.event),1)])]),e.entry.content.socket_id?(L(),R(`tr`,CY,[t[1]||=z(`td`,{class:`table-fit text-muted`},`Socket ID`,-1),z(`td`,null,N(e.entry.content.socket_id),1)])):V(``,!0),e.entry.content.app_id?(L(),R(`tr`,wY,[t[2]||=z(`td`,{class:`table-fit text-muted`},`App ID`,-1),z(`td`,null,N(e.entry.content.app_id),1)])):V(``,!0),e.entry.content.channel?(L(),R(`tr`,TY,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Channel`,-1),z(`td`,null,N(e.entry.content.channel),1)])):V(``,!0),e.entry.content.origin?(L(),R(`tr`,EY,[t[4]||=z(`td`,{class:`table-fit text-muted`},`Origin`,-1),z(`td`,null,N(e.entry.content.origin),1)])):V(``,!0)]),"after-attributes-card":F(e=>[e.entry.content.message?(L(),R(`div`,DY,[t[5]||=z(`ul`,{class:`nav nav-pills`},[z(`li`,{class:`nav-item`},[z(`a`,{class:`nav-link active`},`Message`)])],-1),z(`pre`,OY,N(e.entry.content.message),1)])):V(``,!0)]),_:1},8,[`id`])}var AY=[{path:`/`,redirect:`/requests`},{path:`/mail`,children:[{path:``,name:`mail`,component:AD},{path:`:id`,name:`mail-preview`,component:BD}]},{path:`/exceptions`,children:[{path:``,name:`exceptions`,component:iO},{path:`:id`,name:`exception-preview`,component:PO}]},{path:`/dumps`,name:`dumps`,component:$O},{path:`/logs`,children:[{path:``,name:`logs`,component:sk},{path:`:id`,name:`log-preview`,component:vk}]},{path:`/notifications`,children:[{path:``,name:`notifications`,component:Dk},{path:`:id`,name:`notification-preview`,component:jk}]},{path:`/jobs`,children:[{path:``,name:`jobs`,component:zk},{path:`:id`,name:`job-preview`,component:Qk}]},{path:`/batches`,children:[{path:``,name:`batches`,component:uA},{path:`:id`,name:`batch-preview`,component:vA}]},{path:`/events`,children:[{path:``,name:`events`,component:EA},{path:`:id`,name:`event-preview`,component:zA}]},{path:`/cache`,children:[{path:``,name:`cache`,component:GA},{path:`:id`,name:`cache-preview`,component:ZA}]},{path:`/queries`,children:[{path:``,name:`queries`,component:oj},{path:`:id`,name:`query-preview`,component:WL}]},{path:`/models`,children:[{path:``,name:`models`,component:XL},{path:`:id`,name:`model-preview`,component:nR}]},{path:`/requests`,children:[{path:``,name:`requests`,component:pR},{path:`:id`,name:`request-preview`,component:jR}]},{path:`/commands`,children:[{path:``,name:`commands`,component:RR},{path:`:id`,name:`command-preview`,component:KR}]},{path:`/schedule`,children:[{path:``,name:`schedule`,component:$R},{path:`:id`,name:`schedule-preview`,component:oz}]},{path:`/redis`,children:[{path:``,name:`redis`,component:fz},{path:`:id`,name:`redis-preview`,component:_z}]},{path:`/monitored-tags`,name:`monitored-tags`,component:uJ},{path:`/gates`,children:[{path:``,name:`gates`,component:_J},{path:`:id`,name:`gate-preview`,component:CJ}]},{path:`/views`,children:[{path:``,name:`views`,component:AJ},{path:`:id`,name:`view-preview`,component:VJ}]},{path:`/client-requests`,children:[{path:``,name:`client-requests`,component:QJ},{path:`:id`,name:`client-request-preview`,component:dY}]},{path:`/reverb`,children:[{path:``,name:`reverb`,component:bY},{path:`:id`,name:`reverb-preview`,component:xD(xY,[[`render`,kY]])}]}],jY=typeof document<`u`;function MY(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function NY(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&MY(e.default)}var PY=Object.assign;function FY(e,t){let n={};for(let r in t){let i=t[r];n[r]=LY(i)?i.map(e):e(i)}return n}var IY=()=>{},LY=Array.isArray;function RY(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var zY=/#/g,BY=/&/g,VY=/\//g,HY=/=/g,UY=/\?/g,WY=/\+/g,GY=/%5B/g,KY=/%5D/g,qY=/%5E/g,JY=/%60/g,YY=/%7B/g,XY=/%7C/g,ZY=/%7D/g,QY=/%20/g;function $Y(e){return e==null?``:encodeURI(``+e).replace(XY,`|`).replace(GY,`[`).replace(KY,`]`)}function eX(e){return $Y(e).replace(YY,`{`).replace(ZY,`}`).replace(qY,`^`)}function tX(e){return $Y(e).replace(WY,`%2B`).replace(QY,`+`).replace(zY,`%23`).replace(BY,`%26`).replace(JY,"`").replace(YY,`{`).replace(ZY,`}`).replace(qY,`^`)}function nX(e){return tX(e).replace(HY,`%3D`)}function rX(e){return $Y(e).replace(zY,`%23`).replace(UY,`%3F`)}function iX(e){return rX(e).replace(VY,`%2F`)}function aX(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var oX=/\/$/,sX=e=>e.replace(oX,``);function cX(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=gX(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:aX(o)}}function lX(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function uX(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function dX(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&fX(t.matched[r],n.matched[i])&&pX(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function fX(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function pX(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!mX(e[n],t[n]))return!1;return!0}function mX(e,t){return LY(e)?hX(e,t):LY(t)?hX(t,e):e?.valueOf()===t?.valueOf()}function hX(e,t){return LY(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function gX(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o1&&a--;else break}return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var _X={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},vX=function(e){return e.pop=`pop`,e.push=`push`,e}({}),yX=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function bX(e){if(!e){if(jY){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`}return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),sX(e)}var xX=/^[^#]+#/;function SX(e,t){return e.replace(xX,`#`)+t}function CX(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var wX=()=>({left:window.scrollX,top:window.scrollY});function TX(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=CX(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function EX(e,t){return(history.state?history.state.position-t:-1)+e}var DX=new Map;function OX(e,t){DX.set(e,t)}function kX(e){let t=DX.get(e);return DX.delete(e),t}function AX(e){return typeof e==`string`||e&&typeof e==`object`}function jX(e){return typeof e==`string`||typeof e==`symbol`}var MX=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),NX=Symbol(``);MX.MATCHER_NOT_FOUND,MX.NAVIGATION_GUARD_REDIRECT,MX.NAVIGATION_ABORTED,MX.NAVIGATION_CANCELLED,MX.NAVIGATION_DUPLICATED;function PX(e,t){return PY(Error(),{type:e,[NX]:!0},t)}function FX(e,t){return e instanceof Error&&NX in e&&(t==null||!!(e.type&t))}function IX(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;ee&&tX(e)):[r&&tX(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function RX(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=LY(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}var zX=Symbol(``),BX=Symbol(``),VX=Symbol(``),HX=Symbol(``),UX=Symbol(``);function WX(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function GX(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(PX(MX.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):AX(e)?c(PX(MX.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function KX(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(t===`beforeRouteEnter`||o.instances[e]){if(MY(s)){let c=(s.__vccOpts||s)[t];c&&a.push(GX(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=NY(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&GX(c,n,r,o,e,i)()}))}}}return a}function qX(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;ofX(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>fX(e,s))||i.push(s))}return[n,r,i]}var JX=()=>location.protocol+`//`+location.host;function YX(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),uX(n,``)}return uX(n,e)+r+i}function XX(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=YX(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:vX.pop,direction:u?u>0?yX.forward:yX.back:yX.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(PY({},e.state,{scroll:wX()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function ZX(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?wX():null}}function QX(e){let{history:t,location:n}=window,r={value:YX(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:JX()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,PY({},t.state,ZX(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=PY({},i.value,t.state,{forward:e,scroll:wX()});a(o.current,o,!0),a(e,PY({},ZX(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function $X(e){e=bX(e);let t=QX(e),n=XX(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=PY({location:``,base:e,go:r,createHref:SX.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var eZ=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),tZ=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(tZ||{}),nZ={type:eZ.Static,value:``},rZ=/[a-zA-Z0-9_]/;function iZ(e){if(!e)return[[]];if(e===`/`)return[[nZ]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=tZ.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===tZ.Static?a.push({type:eZ.Static,value:l}):n===tZ.Param||n===tZ.ParamRegExp||n===tZ.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:eZ.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;st.length?t.length===1&&t[0]===sZ.Static+sZ.Segment?1:-1:0}function dZ(e,t){let n=0,r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}var pZ={strict:!1,end:!0,sensitive:!1};function mZ(e,t,n){let r=PY(lZ(iZ(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function hZ(e,t){let n=[],r=new Map;t=RY(pZ,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=_Z(e);s.aliasOf=r&&r.record;let l=RY(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(_Z(PY({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=mZ(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!yZ(d)&&o(e.name)),CZ(d)&&c(d),s.children){let e=s.children;for(let t=0;t{o(f)}:IY}function o(e){if(jX(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=xZ(e,n);n.splice(t,0,e),e.record.name&&!yZ(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw PX(MX.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=PY(gZ(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&gZ(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw PX(MX.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=PY({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:bZ(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function gZ(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function _Z(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:vZ(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function vZ(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function yZ(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function bZ(e){return e.reduce((e,t)=>PY(e,t.meta),{})}function xZ(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;dZ(e,t[i])<0?r=i:n=i+1}let i=SZ(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function SZ(e){let t=e;for(;t=t.parent;)if(CZ(t)&&dZ(e,t)===0)return t}function CZ({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function wZ(e){let t=Wr(VX),n=Wr(HX),r=Ac(()=>{let n=Ln(e.to);return t.resolve(n)}),i=Ac(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(fX.bind(null,i));if(o>-1)return o;let s=kZ(e[t-2]);return t>1&&kZ(i)===s&&a[a.length-1].path!==s?a.findIndex(fX.bind(null,e[t-2])):o}),a=Ac(()=>i.value>-1&&OZ(n.params,r.value.params)),o=Ac(()=>i.value>-1&&i.value===n.matched.length-1&&pX(n.params,r.value.params));function s(n={}){if(DZ(n)){let n=t[Ln(e.replace)?`replace`:`push`](Ln(e.to)).catch(IY);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:Ac(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function TZ(e){return e.length===1?e[0]:e}var EZ=Ai({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:wZ,setup(e,{slots:t}){let n=vn(wZ(e)),{options:r}=Wr(VX),i=Ac(()=>({[AZ(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[AZ(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&TZ(t.default(n));return e.custom?r:jc(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function DZ(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(e.button===void 0||e.button===0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function OZ(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!LY(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function kZ(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var AZ=(e,t,n)=>e??t??n,jZ=Ai({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=Wr(UX),i=Ac(()=>e.route||r.value),a=Wr(BX,0),o=Ac(()=>{let e=Ln(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=Ac(()=>i.value.matched[o.value]);Ur(BX,Ac(()=>o.value+1)),Ur(zX,s),Ur(UX,i);let c=Mn();return Zr(()=>[c.value,s.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),!e||!t||i&&fX(t,i)&&r||(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=s.value,l=o&&o.components[a];if(!l)return MZ(n.default,{Component:l,route:r});let u=o.props[a],d=jc(l,PY({},u?u===!0?r.params:typeof u==`function`?u(r):u:null,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[a]=null)},ref:c}));return MZ(n.default,{Component:d,route:r})||d}}});function MZ(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var NZ=jZ;function PZ(e){let t=hZ(e.routes,e),n=e.parseQuery||IX,r=e.stringifyQuery||LX,i=e.history,a=WX(),o=WX(),s=WX(),c=Nn(_X),l=_X;jY&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let u=FY.bind(null,e=>``+e),d=FY.bind(null,iX),f=FY.bind(null,aX);function p(e,n){let r,i;return jX(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function m(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function h(){return t.getRoutes().map(e=>e.record)}function g(e){return!!t.getRecordMatcher(e)}function _(e,a){if(a=PY({},a||c.value),typeof e==`string`){let r=cX(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return PY(r,o,{params:f(o.params),hash:aX(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=PY({},e,{path:cX(n,e.path,a.path).path});else{let t=PY({},e.params);for(let e in t)t[e]??delete t[e];o=PY({},e,{params:d(t)}),a.params=d(a.params)}let s=t.resolve(o,a),l=e.hash||``;s.params=u(f(s.params));let p=lX(r,PY({},e,{hash:eX(l),path:s.path})),m=i.createHref(p);return PY({fullPath:p,hash:l,query:r===LX?RX(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function v(e){return typeof e==`string`?cX(n,e,c.value.path):PY({},e)}function y(e,t){if(l!==e)return PX(MX.NAVIGATION_CANCELLED,{from:t,to:e})}function b(e){return C(e)}function x(e){return b(PY(v(e),{replace:!0}))}function S(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=v(i):{path:i},i.params={}),PY({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function C(e,t){let n=l=_(e),i=c.value,a=e.state,o=e.force,s=e.replace===!0,u=S(n,i);if(u)return C(PY(v(u),{state:typeof u==`object`?PY({},a,u.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&dX(r,i,n)&&(f=PX(MX.NAVIGATION_DUPLICATED,{to:d,from:i}),oe(i,i,!0,!1)),(f?Promise.resolve(f):T(d,i)).catch(e=>FX(e)?FX(e,MX.NAVIGATION_GUARD_REDIRECT)?e:ae(e):re(e,d,i)).then(e=>{if(e){if(FX(e,MX.NAVIGATION_GUARD_REDIRECT))return C(PY({replace:s},v(e.to),{state:typeof e.to==`object`?PY({},a,e.to.state):a,force:o}),t||d)}else e=te(d,i,!0,s,a);return E(d,i,e),e})}function w(e,t){let n=y(e,t);return n?Promise.reject(n):Promise.resolve()}function ee(e){let t=le.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function T(e,t){let n,[r,i,s]=qX(e,t);n=KX(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(GX(r,e,t))});let c=w.bind(null,e,t);return n.push(c),de(n).then(()=>{n=[];for(let r of a.list())n.push(GX(r,e,t));return n.push(c),de(n)}).then(()=>{n=KX(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(GX(r,e,t))});return n.push(c),de(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter){if(LY(r.beforeEnter))for(let i of r.beforeEnter)n.push(GX(i,e,t));else n.push(GX(r.beforeEnter,e,t))}return n.push(c),de(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=KX(s,`beforeRouteEnter`,e,t,ee),n.push(c),de(n))).then(()=>{n=[];for(let r of o.list())n.push(GX(r,e,t));return n.push(c),de(n)}).catch(e=>FX(e,MX.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function E(e,t,n){s.list().forEach(r=>ee(()=>r(e,t,n)))}function te(e,t,n,r,a){let o=y(e,t);if(o)return o;let s=t===_X,l=jY?history.state:{};n&&(r||s?i.replace(e.fullPath,PY({scroll:s&&l&&l.scroll},a)):i.push(e.fullPath,a)),c.value=e,oe(e,t,n,s),ae()}let D;function O(){D||=i.listen((e,t,n)=>{if(!ue.listening)return;let r=_(e),a=S(r,ue.currentRoute.value);if(a){C(PY(a,{replace:!0,force:!0}),r).catch(IY);return}l=r;let o=c.value;jY&&OX(EX(o.fullPath,n.delta),wX()),T(r,o).catch(e=>FX(e,MX.NAVIGATION_ABORTED|MX.NAVIGATION_CANCELLED)?e:FX(e,MX.NAVIGATION_GUARD_REDIRECT)?(C(PY(v(e.to),{force:!0}),r).then(e=>{FX(e,MX.NAVIGATION_ABORTED|MX.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===vX.pop&&i.go(-1,!1)}).catch(IY),Promise.reject()):(n.delta&&i.go(-n.delta,!1),re(e,r,o))).then(e=>{e||=te(r,o,!1),e&&(n.delta&&!FX(e,MX.NAVIGATION_CANCELLED)?i.go(-n.delta,!1):n.type===vX.pop&&FX(e,MX.NAVIGATION_ABORTED|MX.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),E(r,o,e)}).catch(IY)})}let k=WX(),A=WX(),ne;function re(e,t,n){ae(e);let r=A.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function ie(){return ne&&c.value!==_X?Promise.resolve():new Promise((e,t)=>{k.add([e,t])})}function ae(e){return ne||(ne=!e,O(),k.list().forEach(([t,n])=>e?n(e):t()),k.reset()),e}function oe(t,n,r,i){let{scrollBehavior:a}=e;if(!jY||!a)return Promise.resolve();let o=!r&&kX(EX(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return Sr().then(()=>a(t,n,o)).then(e=>e&&TX(e)).catch(e=>re(e,t,n))}let se=e=>i.go(e),ce,le=new Set,ue={currentRoute:c,listening:!0,addRoute:p,removeRoute:m,clearRoutes:t.clearRoutes,hasRoute:g,getRoutes:h,resolve:_,options:e,push:b,replace:x,go:se,back:()=>se(-1),forward:()=>se(1),beforeEach:a.add,beforeResolve:o.add,afterEach:s.add,onError:A.add,isReady:ie,install(e){e.component(`RouterLink`,EZ),e.component(`RouterView`,NZ),e.config.globalProperties.$router=ue,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>Ln(c)}),jY&&!ce&&c.value===_X&&(ce=!0,b(i.location).catch(e=>{}));let t={};for(let e in _X)Object.defineProperty(t,e,{get:()=>c.value[e],enumerable:!0});e.provide(VX,ue),e.provide(HX,yn(t)),e.provide(UX,c);let n=e.unmount;le.add(e),e.unmount=function(){le.delete(e),le.size<1&&(l=_X,D&&D(),D=null,c.value=_X,ce=!1,ne=!1),n()}}};function de(e){return e.reduce((e,t)=>e.then(()=>ee(t)),Promise.resolve())}return ue}var FZ={207:(e,t,n)=>{e.exports=n(452)},452:e=>{var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,i=typeof Symbol==`function`?Symbol:{},a=i.iterator||`@@iterator`,o=i.asyncIterator||`@@asyncIterator`,s=i.toStringTag||`@@toStringTag`;function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},``)}catch{c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===p)throw Error(`Generator is already running`);if(r===m){if(i===`throw`)throw a;return O()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=ee(o,n);if(s){if(s===h)continue;return s}}if(n.method===`next`)n.sent=n._sent=n.arg;else if(n.method===`throw`){if(r===d)throw r=m,n.arg;n.dispatchException(n.arg)}else n.method===`return`&&n.abrupt(`return`,n.arg);r=p;var c=u(e,t,n);if(c.type===`normal`){if(r=n.done?m:f,c.arg===h)continue;return{value:c.arg,done:n.done}}c.type===`throw`&&(r=m,n.method=`throw`,n.arg=c.arg)}}}(e,n,new te(r||[])),a}function u(e,t,n){try{return{type:`normal`,arg:e.call(t,n)}}catch(e){return{type:`throw`,arg:e}}}e.wrap=l;var d=`suspendedStart`,f=`suspendedYield`,p=`executing`,m=`completed`,h={};function g(){}function _(){}function v(){}var y={};c(y,a,(function(){return this}));var b=Object.getPrototypeOf,x=b&&b(b(D([])));x&&x!==n&&r.call(x,a)&&(y=x);var S=v.prototype=g.prototype=Object.create(y);function C(e){[`next`,`throw`,`return`].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(i,a,o,s){var c=u(e[i],e,a);if(c.type!==`throw`){var l=c.arg,d=l.value;return d&&typeof d==`object`&&r.call(d,`__await`)?t.resolve(d.__await).then((function(e){n(`next`,e,o,s)}),(function(e){n(`throw`,e,o,s)})):t.resolve(d).then((function(e){l.value=e,o(l)}),(function(e){return n(`throw`,e,o,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function ee(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,n.method===`throw`){if(e.iterator.return&&(n.method=`return`,n.arg=t,ee(e,n),n.method===`throw`))return h;n.method=`throw`,n.arg=TypeError(`The iterator does not provide a 'throw' method`)}return h}var i=u(r,e.iterator,n.arg);if(i.type===`throw`)return n.method=`throw`,n.arg=i.arg,n.delegate=null,h;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,n.method!==`return`&&(n.method=`next`,n.arg=t),n.delegate=null,h):a:(n.method=`throw`,n.arg=TypeError(`iterator result is not an object`),n.delegate=null,h)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type=`normal`,delete t.arg,e.completion=t}function te(e){this.tryEntries=[{tryLoc:`root`}],e.forEach(T,this),this.reset(!0)}function D(e){if(e){var n=e[a];if(n)return n.call(e);if(typeof e.next==`function`)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i=0;--a){var o=this.tryEntries[a],s=o.completion;if(o.tryLoc===`root`)return i(`end`);if(o.tryLoc<=this.prev){var c=r.call(o,`catchLoc`),l=r.call(o,`finallyLoc`);if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,`finallyLoc`)&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;E(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},this.method===`next`&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch{typeof globalThis==`object`?globalThis.regeneratorRuntime=t:Function(`r`,`regeneratorRuntime = r`)(t)}}},IZ={};function LZ(e){var t=IZ[e];if(t!==void 0)return t.exports;var n=IZ[e]={exports:{}};return FZ[e](n,n.exports,LZ),n.exports}LZ.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return LZ.d(t,{a:t}),t},LZ.d=(e,t)=>{for(var n in t)LZ.o(t,n)&&!LZ.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},LZ.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var RZ={};function zZ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ncQ});var $=(KZ={Fragment:()=>Ns,computed:()=>Ac,createTextVNode:()=>Qs,createVNode:()=>B,defineComponent:()=>Ai,nextTick:()=>Sr,reactive:()=>vn,ref:()=>Mn,watch:()=>Zr,watchEffect:()=>Jr},qZ={},LZ.d(qZ,KZ),qZ),UZ=(0,$.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var e=this.data,t=this.onClick;return(0,$.createVNode)(`span`,{class:`vjs-tree-brackets`,onClick:t},[e])}}),WZ=(0,$.defineComponent)({emits:[`change`,`update:modelValue`],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(e,t){var n=t.emit;return{uiType:(0,$.computed)((function(){return e.isMultiple?`checkbox`:`radio`})),model:(0,$.computed)({get:function(){return e.checked},set:function(e){return n(`update:modelValue`,e)}})}},render:function(){var e=this.uiType,t=this.model,n=this.$emit;return(0,$.createVNode)(`label`,{class:[`vjs-check-controller`,t?`is-checked`:``],onClick:function(e){return e.stopPropagation()}},[(0,$.createVNode)(`span`,{class:`vjs-check-controller-inner is-${e}`},null),(0,$.createVNode)(`input`,{checked:t,class:`vjs-check-controller-original is-${e}`,type:e,onChange:function(){return n(`change`,t)}},null)])}}),GZ=(0,$.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var e=this.nodeType,t=this.onClick,n=e===`objectStart`||e===`arrayStart`;return n||e===`objectCollapsed`||e===`arrayCollapsed`?(0,$.createVNode)(`span`,{class:`vjs-carets vjs-carets-${n?`open`:`close`}`,onClick:t},[(0,$.createVNode)(`svg`,{viewBox:`0 0 1024 1024`,focusable:`false`,"data-icon":`caret-down`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`},[(0,$.createVNode)(`path`,{d:`M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z`},null)])]):null}}),KZ,qZ;function JZ(e){return JZ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},JZ(e)}function YZ(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function XZ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`root`,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=(arguments.length>3?arguments[3]:void 0)||{},i=r.key,a=r.index,o=r.type,s=o===void 0?`content`:o,c=r.showComma,l=c!==void 0&&c,u=r.length,d=u===void 0?1:u,f=YZ(e);if(f===`array`){var p=ZZ(e.map((function(e,r,i){return XZ(e,`${t}[${r}]`,n+1,{index:r,showComma:r!==i.length-1,length:d,type:s})})));return[XZ(`[`,t,n,{showComma:!1,key:i,length:e.length,type:`arrayStart`})[0]].concat(p,XZ(`]`,t,n,{showComma:l,length:e.length,type:`arrayEnd`})[0])}if(f===`object`){var m=Object.keys(e),h=ZZ(m.map((function(r,i,a){return XZ(e[r],/^[a-zA-Z_]\w*$/.test(r)?`${t}.${r}`:`${t}["${r}"]`,n+1,{key:r,showComma:i!==a.length-1,length:d,type:s})})));return[XZ(`{`,t,n,{showComma:!1,key:i,index:a,length:m.length,type:`objectStart`})[0]].concat(h,XZ(`}`,t,n,{showComma:l,length:m.length,type:`objectEnd`})[0])}return[{content:e,level:n,key:i,index:a,path:t,showComma:l,length:d,type:s}]}function ZZ(e){if(typeof Array.prototype.flat==`function`)return e.flat();for(var t=VZ(e),n=[];t.length;){var r=t.shift();Array.isArray(r)?t.unshift.apply(t,VZ(r)):n.push(r)}return n}function QZ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e==null)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(JZ(e)!==`object`)return e;if(t.get(e))return t.get(e);if(Array.isArray(e)){var n=e.map((function(e){return QZ(e,t)}));return t.set(e,n),n}var r={};for(var i in e)r[i]=QZ(e[i],t);return t.set(e,r),r}function $Z(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}var eQ=LZ(207),tQ=LZ.n(eQ);function nQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rQ(e){for(var t=1;t=t||i.length>=n,o=e.pathCollapsible?.call(e,i);return i.type!==`objectStart`&&i.type!==`arrayStart`||!a&&!o?r:sQ(sQ({},r),{},HZ({},i.path,1))}),{})},s=(0,$.reactive)({translateY:0,visibleData:null,hiddenPaths:o(e.deep,e.collapsedNodeLength),startIndex:0,endIndex:0}),c=[],l=[],u=0,d={},f=function(t){c=Array(t).fill(0).map((function(){return e.itemHeight||20})),(l=Array(t+1))[0]=0;for(var n=0;nt&&(e=t);for(var n=e;n>>1;e[i]n.length?n.length-_:v;y<0&&(y=0);var b=y+_;s.translateY=y*e.itemHeight,s.startIndex=y,s.endIndex=b,s.visibleData=n.slice(y,b)}}else s.translateY=0,s.startIndex=0,s.endIndex=n.length,s.visibleData=n}},b=null,x=function(){b&&cancelAnimationFrame(b),b=requestAnimationFrame((function(){y()}))},S=function(t){var r,i,a=t.path,o=e.selectableType;if(o===`multiple`){var s=g.value.findIndex((function(e){return e===a})),c=VZ(g.value);s===-1?c.push(a):c.splice(s,1),n(`update:selectedValue`,c),n(`selectedChange`,c,VZ(g.value))}else if(o===`single`&&g.value[0]!==a){var l=(r=g.value,i=1,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||n.return==null||n.return()}finally{if(s)throw i}}return a}}(r,i)||BZ(r,i)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],u=a;n(`update:selectedValue`,u),n(`selectedChange`,u,l)}},C=function(e){n(`nodeClick`,e)},w=function(e){n(`nodeMouseover`,e)},ee=function(e,t){if(e)s.hiddenPaths=sQ(sQ({},s.hiddenPaths),{},HZ({},t,1));else{var n=sQ({},s.hiddenPaths);delete n[t],s.hiddenPaths=n}},T=function(t,r){e.collapsedOnClickBrackets&&ee(t,r.path),n(`bracketsClick`,t,r)},E=function(e,t){ee(e,t.path),n(`iconClick`,e,t)},te=function(t,r){var i=QZ(e.data),a=e.rootPath;Function(`data`,`val`,`data${r.slice(a.length)}=val`)(i,t),n(`update:data`,i)};return(0,$.watchEffect)((function(){_.value&&function(e){throw Error(`[VueJSONPretty] ${e}`)}(_.value)})),(0,$.watchEffect)((function(){h.value&&(e.virtual&&e.dynamicHeight&&c.length!==h.value.length&&f(h.value.length),y())})),(0,$.watch)((function(){return[e.dynamicHeight,e.itemHeight,a.value.length]}),(function(){e.virtual&&e.dynamicHeight&&(f(h.value.length),(0,$.nextTick)(y))})),(0,$.watch)((function(){return e.deep}),(function(t){t&&(s.hiddenPaths=o(t,e.collapsedNodeLength))})),(0,$.watch)((function(){return e.collapsedNodeLength}),(function(t){t&&(s.hiddenPaths=o(e.deep,t))})),function(){var t,n=e.renderNodeKey??r.renderNodeKey,o=e.renderNodeValue??r.renderNodeValue,c=(t=e.renderNodeActions??r.renderNodeActions)!=null&&t,l=s.visibleData?.map((function(t,r){var i=s.startIndex+r;return(0,$.createVNode)(`div`,{key:t.id,ref:function(e){return function(e,t){t?d[e]=t:delete d[e]}(i,e||null)}},[(0,$.createVNode)(aQ,{data:e.data,rootPath:e.rootPath,indent:e.indent,node:t,collapsed:!!s.hiddenPaths[t.path],theme:e.theme,showDoubleQuotes:e.showDoubleQuotes,showLength:e.showLength,checked:g.value.includes(t.path),selectableType:e.selectableType,showLine:e.showLine,showLineNumber:e.showLineNumber,showSelectController:e.showSelectController,selectOnClickNode:e.selectOnClickNode,nodeSelectable:e.nodeSelectable,highlightSelectedNode:e.highlightSelectedNode,editable:e.editable,editableTrigger:e.editableTrigger,showIcon:e.showIcon,showKeyValueSpace:e.showKeyValueSpace,renderNodeKey:n,renderNodeValue:o,renderNodeActions:c,onNodeClick:C,onNodeMouseover:w,onBracketsClick:T,onIconClick:E,onSelectedChange:S,onValueChange:te,class:e.dynamicHeight?`dynamic-height`:void 0,style:e.dynamicHeight?{}:e.itemHeight&&e.itemHeight!==20?{lineHeight:`${e.itemHeight}px`}:{}},null)])}));return(0,$.createVNode)(`div`,{ref:i,class:{"vjs-tree":!0,"is-virtual":e.virtual,dark:e.theme===`dark`},onScroll:e.virtual?x:void 0,style:e.showLineNumber?sQ({paddingLeft:`${12*Number(a.value.length.toString().length)}px`},e.style):e.style},[e.virtual?(0,$.createVNode)(`div`,{class:`vjs-tree-list`,style:{height:`${e.height}px`}},[(0,$.createVNode)(`div`,{class:`vjs-tree-list-holder`,style:{height:`${v.value}px`}},[(0,$.createVNode)(`div`,{class:`vjs-tree-list-holder-inner`,style:{transform:`translateY(${s.translateY}px)`}},[l])])]):l])}}}),lQ=RZ.A,uQ={props:[`entry`,`batch`],directives:{dropdown:{mounted(e){IW.getOrCreateInstance(e)},beforeUnmount(e){IW.getInstance(e).dispose()}}},mixins:[ek],data(){return{currentTab:`exceptions`}},mounted(){this.activateFirstTab()},watch:{entry(){this.activateFirstTab()}},methods:{activateFirstTab(){window.location.hash?this.currentTab=window.location.hash.substring(1):this.exceptions.length?this.currentTab=`exceptions`:this.logs.length?this.currentTab=`logs`:this.views.length?this.currentTab=`views`:this.queries.length?this.currentTab=`queries`:this.models.length?this.currentTab=`models`:this.jobs.length?this.currentTab=`jobs`:this.mails.length?this.currentTab=`mails`:this.notifications.length?this.currentTab=`notifications`:this.events.length?this.currentTab=`events`:this.cache.length?this.currentTab=`cache`:this.gates.length?this.currentTab=`gates`:this.redis.length?this.currentTab=`redis`:this.clientRequests.length&&(this.currentTab=`client_requests`)},activateTab(e){this.currentTab=e,window.history.replaceState(window.history.state,``,`#`+this.currentTab)}},computed:{hasRelatedEntries(){return!!CC.default.reject(this.batch,e=>CC.default.includes([`request`,`command`],e.type)).length},exceptions(){return CC.default.filter(this.batch,{type:`exception`})},gates(){return CC.default.filter(this.batch,{type:`gate`})},logs(){return CC.default.filter(this.batch,{type:`log`})},queries(){return CC.default.filter(this.batch,{type:`query`})},models(){return CC.default.filter(this.batch,{type:`model`})},jobs(){return CC.default.filter(this.batch,{type:`job`})},events(){return CC.default.filter(this.batch,{type:`event`})},cache(){return CC.default.filter(this.batch,{type:`cache`})},redis(){return CC.default.filter(this.batch,{type:`redis`})},mails(){return CC.default.filter(this.batch,{type:`mail`})},notifications(){return CC.default.filter(this.batch,{type:`notification`})},views(){return CC.default.filter(this.batch,{type:`view`})},clientRequests(){return CC.default.filter(this.batch,{type:`client_request`})},queriesSummary(){return{time:CC.default.reduce(this.queries,(e,t)=>e+parseFloat(t.content.time),0).toFixed(2),duplicated:this.queries.length-CC.default.size(CC.default.groupBy(this.queries,e=>`${e.content.hash}-${e.content.connection}`))}},tabs(){return CC.default.filter([{title:`Exceptions`,type:`exceptions`,count:this.exceptions.length},{title:`Logs`,type:`logs`,count:this.logs.length},{title:`Views`,type:`views`,count:this.views.length},{title:`Queries`,type:`queries`,count:this.queries.length},{title:`Models`,type:`models`,count:this.models.length},{title:`Gates`,type:`gates`,count:this.gates.length},{title:`Jobs`,type:`jobs`,count:this.jobs.length},{title:`Mail`,type:`mails`,count:this.mails.length},{title:`Notifications`,type:`notifications`,count:this.notifications.length},{title:`Events`,type:`events`,count:this.events.length},{title:`Cache`,type:`cache`,count:this.cache.length},{title:`Redis`,type:`redis`,count:this.redis.length},{title:`HTTP Client`,type:`client_requests`,count:this.clientRequests.length}],e=>e.count>0)},separateTabs(){return CC.default.slice(this.tabs,0,7)},dropdownTabs(){return CC.default.slice(this.tabs,7)},dropdownTabSelected(){return CC.default.includes(CC.default.map(this.dropdownTabs,`type`),this.currentTab)}}},dQ={key:0,class:`card overflow-hidden mt-5`},fQ={class:`nav nav-pills`},pQ=[`onClick`],mQ={key:0,class:`nav-item dropdown`},hQ={class:`dropdown-menu`},gQ=[`onClick`],_Q={class:`table table-hover mb-0`},vQ=[`title`],yQ={class:`text-muted text-break`},bQ={class:`table-fit`},xQ={class:`table table-hover mb-0`},SQ=[`title`],CQ={class:`table-fit`},wQ={class:`table-fit`},TQ={class:`table table-hover mb-0`},EQ={class:`text-end`},DQ=[`title`],OQ={class:`table-fit text-end`},kQ={key:0,class:`badge badge-danger`},AQ={key:1,class:`text-muted`},jQ={class:`table-fit`},MQ={class:`table table-hover mb-0`},NQ=[`title`],PQ={class:`table-fit`},FQ={class:`table-fit`},IQ={class:`table table-hover mb-0`},LQ=[`title`],RQ={class:`table-fit`},zQ={class:`table-fit`},BQ={class:`table table-hover mb-0`},VQ=[`title`],HQ={class:`text-muted`},UQ={class:`table-fit`},WQ={class:`table-fit`},GQ={class:`table table-hover mb-0`},KQ=[`title`],qQ={key:0,class:`badge badge-info ms-2`},JQ={class:`table-fit text-end text-muted`},YQ={class:`table-fit`},XQ={class:`table table-hover mb-0`},ZQ=[`title`],QQ={class:`table-fit`},$Q={class:`table-fit`},e$={class:`table table-hover mb-0`},t$=[`title`],n$={class:`table-fit text-end text-muted`},r$={class:`table-fit`},i$={class:`table table-hover mb-0`},a$=[`title`],o$={key:0,class:`badge badge-secondary ms-2`},s$=[`title`],c$={class:`table-fit`},l$={class:`table table-hover mb-0`},u$=[`title`],d$={key:0,class:`badge badge-secondary ms-2`},f$=[`title`],p$={class:`table-fit text-muted`},m$={class:`table-fit`},h$={class:`table table-hover mb-0`},g$={class:`text-muted`},_$={class:`table-fit text-end text-muted`},v$={class:`table-fit`},y$={class:`table table-hover mb-0`},b$={class:`table-fit pe-0`},x$=[`title`],S$={class:`table-fit`},C$={class:`table-fit text-end text-muted`},w$={key:0},T$={key:1},E$=[`data-timeago`,`title`],D$={class:`table-fit`};function O$(e,t,n,r,i,a){let o=I(`router-link`),s=Ia(`dropdown`);return a.hasRelatedEntries?(L(),R(`div`,dQ,[z(`ul`,fQ,[(L(!0),R(Ns,null,za(a.separateTabs,e=>(L(),R(`li`,{class:`nav-item`,key:e.type},[z(`a`,{class:M([`nav-link`,{active:i.currentTab==e.type}]),href:`#`,onClick:H(t=>a.activateTab(e.type),[`prevent`])},N(e.title)+` (`+N(e.count)+`) `,11,pQ)]))),128)),a.dropdownTabs.length?(L(),R(`li`,mQ,[Vr((L(),R(`a`,{class:M([`nav-link dropdown-toggle`,{active:a.dropdownTabSelected}]),"data-bs-toggle":`dropdown`,href:`#`,role:`button`,"aria-haspopup":`true`,"aria-expanded":`false`},[...t[0]||=[Qs(`More`,-1)]],2)),[[s]]),z(`div`,hQ,[(L(!0),R(Ns,null,za(a.dropdownTabs,e=>(L(),R(`a`,{class:M([`dropdown-item`,{active:i.currentTab==e.type}]),href:`#`,key:e.type,onClick:H(t=>a.activateTab(e.type),[`prevent`])},N(e.title)+` (`+N(e.count)+`)`,11,gQ))),128))])])):V(``,!0)]),z(`div`,null,[Vr(z(`table`,_Q,[t[3]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Message`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.exceptions,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.class},[Qs(N(e.truncate(n.content.class,70)),1),t[1]||=z(`br`,null,null,-1),z(`small`,yQ,N(e.truncate(n.content.message,200)),1)],8,vQ),z(`td`,bQ,[B(o,{to:{name:`exception-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[2]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`exceptions`&&a.exceptions.length]]),Vr(z(`table`,xQ,[t[5]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Message`),z(`th`,{scope:`col`},`Level`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.logs,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.message},N(e.truncate(n.content.message,90)),9,SQ),z(`td`,CQ,[z(`span`,{class:M([`badge`,`badge-`+e.logLevelClass(n.content.level)])},N(n.content.level),3)]),z(`td`,wQ,[B(o,{to:{name:`log-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[4]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`logs`&&a.logs.length]]),Vr(z(`table`,TQ,[z(`thead`,null,[z(`tr`,null,[z(`th`,null,[t[6]||=Qs(` Query`,-1),t[7]||=z(`br`,null,null,-1),z(`small`,null,N(a.queries.length)+` queries, `+N(a.queriesSummary.duplicated)+` of which are duplicated.`,1)]),z(`th`,EQ,[t[8]||=Qs(` Duration`,-1),t[9]||=z(`br`,null,null,-1),z(`small`,null,N(a.queriesSummary.time)+`ms`,1)]),t[10]||=z(`th`,null,null,-1)])]),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.queries,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.sql},[z(`code`,null,N(e.truncate(n.content.sql,110)),1)],8,DQ),z(`td`,OQ,[n.content.slow?(L(),R(`span`,kQ,N(n.content.time)+`ms `,1)):(L(),R(`span`,AQ,N(n.content.time)+`ms `,1))]),z(`td`,jQ,[B(o,{to:{name:`query-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[11]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`queries`&&a.queries.length]]),Vr(z(`table`,MQ,[t[13]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Model`),z(`th`,null,`Hydrated`),z(`th`,null,`Action`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.models,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.model},N(e.truncate(n.content.model,100)),9,NQ),z(`td`,null,N(n.content?.count),1),z(`td`,PQ,[z(`span`,{class:M([`badge`,`badge-`+e.modelActionClass(n.content.action)])},N(n.content.action),3)]),z(`td`,FQ,[B(o,{to:{name:`model-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[12]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`models`&&a.models.length]]),Vr(z(`table`,IQ,[t[15]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Ability`),z(`th`,null,`Result`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.gates,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.ability},N(e.truncate(n.content.ability,80)),9,LQ),z(`td`,RQ,[z(`span`,{class:M([`badge`,`badge-`+e.gateResultClass(n.content.result)])},N(n.content.result),3)]),z(`td`,zQ,[B(o,{to:{name:`gate-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[14]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`gates`&&a.gates.length]]),Vr(z(`table`,BQ,[t[18]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Job`),z(`th`,{scope:`col`},`Status`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.jobs,n=>(L(),R(`tr`,null,[z(`td`,null,[z(`span`,{title:n.content.name},N(e.truncate(n.content.name,68)),9,VQ),t[16]||=z(`br`,null,null,-1),z(`small`,HQ,` Connection: `+N(n.content.connection)+` | Queue: `+N(n.content.queue),1)]),z(`td`,UQ,[z(`span`,{class:M([`badge`,`badge-`+e.jobStatusClass(n.content.status)])},N(n.content.status),3)]),z(`td`,WQ,[B(o,{to:{name:`job-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[17]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`jobs`&&a.jobs.length]]),Vr(z(`table`,GQ,[t[20]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Name`),z(`th`,{class:`text-end`},`Listeners`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.events,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.name},[Qs(N(e.truncate(n.content.name,80))+` `,1),n.content.broadcast?(L(),R(`span`,qQ,` Broadcast `)):V(``,!0)],8,KQ),z(`td`,JQ,N(n.content.listeners.length),1),z(`td`,YQ,[B(o,{to:{name:`event-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[19]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`events`&&a.events.length]]),Vr(z(`table`,XQ,[t[22]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Key`),z(`th`,null,`Action`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.cache,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.key},N(e.truncate(n.content.key,100)),9,ZQ),z(`td`,QQ,[z(`span`,{class:M([`badge`,`badge-`+e.cacheActionTypeClass(n.content.type)])},N(n.content.type),3)]),z(`td`,$Q,[B(o,{to:{name:`cache-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[21]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`cache`&&a.cache.length]]),Vr(z(`table`,e$,[t[24]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Command`),z(`th`,{class:`text-end`},`Duration`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.redis,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.command},N(e.truncate(n.content.command,100)),9,t$),z(`td`,n$,N(n.content.time)+`ms`,1),z(`td`,r$,[B(o,{to:{name:`redis-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[23]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`redis`&&a.redis.length]]),Vr(z(`table`,i$,[t[27]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Mailable`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.mails,n=>(L(),R(`tr`,null,[z(`td`,null,[z(`span`,{title:n.content.mailable},N(e.truncate(n.content.mailable||`-`,70)),9,a$),n.content.queued?(L(),R(`span`,o$,` Queued `)):V(``,!0),t[25]||=z(`br`,null,null,-1),z(`small`,{class:`text-muted`,title:n.content.subject},` Subject: `+N(e.truncate(n.content.subject,90)),9,s$)]),z(`td`,c$,[B(o,{to:{name:`mail-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[26]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`mails`&&a.mails.length]]),Vr(z(`table`,l$,[t[30]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Notification`),z(`th`,null,`Channel`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.notifications,n=>(L(),R(`tr`,null,[z(`td`,null,[z(`span`,{title:n.content.notification},N(e.truncate(n.content.notification||`-`,70)),9,u$),n.content.queued?(L(),R(`span`,d$,` Queued `)):V(``,!0),t[28]||=z(`br`,null,null,-1),z(`small`,{class:`text-muted`,title:n.content.notifiable},` Recipient: `+N(e.truncate(n.content.notifiable,90)),9,f$)]),z(`td`,p$,N(e.truncate(n.content.channel,20)),1),z(`td`,m$,[B(o,{to:{name:`notification-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[29]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`notifications`&&a.notifications.length]]),Vr(z(`table`,h$,[t[33]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Name`),z(`th`,{class:`text-end`},`Composers`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.views,n=>(L(),R(`tr`,null,[z(`td`,null,[Qs(N(n.content.name)+` `,1),t[31]||=z(`br`,null,null,-1),z(`small`,g$,N(e.truncate(n.content.path,100)),1)]),z(`td`,_$,N(n.content.composers?n.content.composers.length:0),1),z(`td`,v$,[B(o,{to:{name:`view-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[32]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`views`&&a.views.length]]),Vr(z(`table`,y$,[t[35]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Verb`),z(`th`,null,`URI`),z(`th`,null,`Status`),z(`th`,{class:`text-end`},`Duration`),z(`th`,{class:`text-end`},`Happened`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.clientRequests,n=>(L(),R(`tr`,null,[z(`td`,b$,[z(`span`,{class:M([`badge`,`badge-`+e.requestMethodClass(n.content.method)])},N(n.content.method),3)]),z(`td`,{title:n.content.uri},N(e.truncate(n.content.uri,60)),9,x$),z(`td`,S$,[z(`span`,{class:M([`badge`,`badge-`+e.requestStatusClass(n.content.response_status===void 0?null:n.content.response_status)])},N(n.content.response_status===void 0?`N/A`:n.content.response_status),3)]),z(`td`,C$,[n.content.duration?(L(),R(`span`,w$,N(n.content.duration)+`ms`,1)):(L(),R(`span`,T$,`-`))]),z(`td`,{class:`table-fit text-end text-muted`,"data-timeago":n.created_at,title:n.created_at},N(e.timeAgo(n.created_at)),9,E$),z(`td`,D$,[B(o,{to:{name:`client-request-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[34]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`client_requests`&&a.clientRequests.length]])])])):V(``,!0)}var k$=xD(uQ,[[`render`,O$],[`__scopeId`,`data-v-84a87f2a`]]),A$={props:[`resource`,`title`,`showAllFamily`,`hideSearch`],data(){return{tag:``,familyHash:``,entries:[],ready:!1,requestController:new AbortController,recordingStatus:`enabled`,lastEntryIndex:``,hasMoreEntries:!0,hasNewEntries:!1,entriesPerRequest:50,loadingNewEntries:!1,loadingMoreEntries:!1,updateTimeAgoTimeout:null,newEntriesTimeout:null,newEntriesTimer:2500,updateEntriesTimeout:null,updateEntriesTimer:2500}},created(){this.debouncer=CC.default.debounce(e=>e(),500)},mounted(){document.title=this.title+` - Telescope`,this.familyHash=this.$route.query.family_hash||``,this.tag=this.$route.query.tag||``,this.loadEntries(e=>{this.entries=e,this.checkForNewEntries(),this.ready=!0}),this.updateEntries(),this.updateTimeAgo(),document.addEventListener(`keyup`,this.focusOnSearch)},beforeUnmount(){this.requestController.abort(),clearTimeout(this.newEntriesTimeout),clearTimeout(this.updateEntriesTimeout),clearTimeout(this.updateTimeAgoTimeout),this.debouncer.cancel(),document.removeEventListener(`keyup`,this.focusOnSearch)},watch:{"$route.query":function(){this.requestController.abort(),this.requestController=new AbortController,clearTimeout(this.newEntriesTimeout),clearTimeout(this.updateEntriesTimeout),this.hasNewEntries=!1,this.lastEntryIndex=``,this.loadingNewEntries=!1,this.loadingMoreEntries=!1,this.familyHash=this.$route.query.family_hash||``,this.tag=this.$route.query.tag||``,this.ready=!1,this.loadEntries(e=>{this.entries=e,this.checkForNewEntries(),this.updateEntries(),this.ready=!0})}},methods:{loadEntries(e){let{signal:t}=this.requestController;return bD.post(Telescope.basePath+`/telescope-api/`+this.resource,null,{signal:t,params:{tag:this.tag,exact_tag:this.$route.query.exact_tag,before:this.lastEntryIndex,take:this.entriesPerRequest,family_hash:this.familyHash}}).then(n=>{t.aborted||(this.lastEntryIndex=n.data.entries.length?CC.default.last(n.data.entries).sequence:this.lastEntryIndex,this.hasMoreEntries=n.data.entries.length>=this.entriesPerRequest,this.recordingStatus=n.data.status,CC.default.isFunction(e)&&e(this.familyHash||this.showAllFamily?n.data.entries:CC.default.uniqBy(n.data.entries,e=>e.family_hash||CC.default.uniqueId())))}).catch(e=>{t.aborted||(this.ready=!0,this.loadingNewEntries=!1,this.loadingMoreEntries=!1,this.mayRetry(e,t)&&(this.checkForNewEntries(),this.updateEntries()))})},checkForNewEntries(){let{signal:e}=this.requestController;clearTimeout(this.newEntriesTimeout),this.newEntriesTimeout=setTimeout(()=>{bD.post(Telescope.basePath+`/telescope-api/`+this.resource,null,{signal:e,params:{tag:this.tag,exact_tag:this.$route.query.exact_tag,take:1,family_hash:this.familyHash}}).then(t=>{e.aborted||(this.recordingStatus=t.data.status,t.data.entries.length&&!this.entries.length?this.loadNewEntries():t.data.entries.length&&CC.default.first(t.data.entries).id!==CC.default.first(this.entries).id?this.$root.autoLoadsNewEntries?this.loadNewEntries():this.hasNewEntries=!0:this.checkForNewEntries())}).catch(t=>{this.mayRetry(t,e)&&this.checkForNewEntries()})},this.newEntriesTimer)},updateTimeAgo(){this.updateTimeAgoTimeout=setTimeout(()=>{this.$el.querySelectorAll(`[data-timeago]`).forEach(e=>{e.textContent=this.timeAgo(e.dataset.timeago)}),this.updateTimeAgo()},6e4)},search(){this.debouncer(()=>(this.hasNewEntries=!1,this.lastEntryIndex=``,this.$router.push({query:CC.default.assign({},this.$route.query,{tag:this.tag,exact_tag:void 0})})))},loadOlderEntries(){this.loadingMoreEntries=!0,this.loadEntries(e=>{this.entries.push(...e),this.loadingMoreEntries=!1})},loadNewEntries(){this.hasMoreEntries=!0,this.hasNewEntries=!1,this.lastEntryIndex=``,this.loadingNewEntries=!0,clearTimeout(this.newEntriesTimeout),this.loadEntries(e=>{this.entries=e,this.loadingNewEntries=!1,this.checkForNewEntries()})},updateEntries(){let{signal:e}=this.requestController;this.resource===`jobs`&&(clearTimeout(this.updateEntriesTimeout),this.updateEntriesTimeout=setTimeout(()=>{let t=CC.default.chain(this.entries).filter(e=>e.content.status===`pending`).map(`id`).value();if(!t.length)return this.updateEntries();bD.post(Telescope.basePath+`/telescope-api/`+this.resource,{uuids:t},{signal:e}).then(n=>{e.aborted||(this.recordingStatus=n.data.status,this.entries=CC.default.map(this.entries,e=>CC.default.includes(t,e.id)&&CC.default.find(n.data.entries,{id:e.id})||e),this.updateEntries())}).catch(t=>{this.mayRetry(t,e)&&this.updateEntries()})},this.updateEntriesTimer))},focusOnSearch(e){if(e.key===`/`){let e=this.$el.querySelector(`#searchInput`);e&&e.focus()}}}},j$={class:`card overflow-hidden`},M$={class:`card-header d-flex align-items-center justify-content-between`},N$={class:`h6 m-0`},P$={key:0,class:`form-control-with-icon w-25`},F$={key:0,class:`mt-0 mb-0 disabled-watcher d-flex align-items-center`},I$={key:0,class:`ms-1`},L$={key:1,class:`ms-1`},R$={key:2,class:`ms-1`},z$={key:1,class:`d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},B$={key:2,class:`d-flex flex-column align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},V$={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 60 60`,class:`fill-text-color`,style:{width:`200px`}},H$={key:3,id:`indexScreen`,class:`table table-hover mb-0 penultimate-column-right`},U$={key:`newEntries`,class:`dontanimate`},W$={colspan:`100`,class:`text-center card-bg-secondary py-2`},G$={key:0},K$={key:`olderEntries`,class:`dontanimate`},q$={colspan:`100`,class:`text-center card-bg-secondary py-2`},J$={key:0};function Y$(e,t,n,r,i,a){return L(),R(`div`,j$,[z(`div`,M$,[z(`h2`,N$,N(this.title),1),!n.hideSearch&&(i.tag||i.entries.length>0)?(L(),R(`div`,P$,[t[4]||=z(`div`,{class:`icon-wrapper`},[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,class:`icon`},[z(`path`,{"fill-rule":`evenodd`,d:`M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z`,"clip-rule":`evenodd`})])],-1),Vr(z(`input`,{type:`text`,class:`form-control w-100`,id:`searchInput`,placeholder:`Search Tag`,"onUpdate:modelValue":t[0]||=e=>i.tag=e,onInput:t[1]||=H((...e)=>a.search&&a.search(...e),[`stop`])},null,544),[[Du,i.tag]])])):V(``,!0)]),i.recordingStatus===`enabled`?V(``,!0):(L(),R(`p`,F$,[t[5]||=z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,x:`0px`,y:`0px`,width:`20px`,height:`20px`,viewBox:`0 0 90 90`,class:`me-2`},[z(`path`,{fill:`#FFFFFF`,d:`M45 0C20.1 0 0 20.1 0 45s20.1 45 45 45 45-20.1 45-45S69.9 0 45 0zM45 74.5c-3.6 0-6.5-2.9-6.5-6.5s2.9-6.5 6.5-6.5 6.5 2.9 6.5 6.5S48.6 74.5 45 74.5zM52.1 23.9l-2.5 29.6c0 2.5-2.1 4.6-4.6 4.6 -2.5 0-4.6-2.1-4.6-4.6l-2.5-29.6c-0.1-0.4-0.1-0.7-0.1-1.1 0-4 3.2-7.2 7.2-7.2 4 0 7.2 3.2 7.2 7.2C52.2 23.1 52.2 23.5 52.1 23.9z`})],-1),i.recordingStatus==`disabled`?(L(),R(`span`,I$,`Telescope is currently disabled.`)):V(``,!0),i.recordingStatus==`paused`?(L(),R(`span`,L$,`Telescope recording is paused.`)):V(``,!0),i.recordingStatus==`off`?(L(),R(`span`,R$,`This watcher is turned off.`)):V(``,!0)])),i.ready?V(``,!0):(L(),R(`div`,z$,[...t[6]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,class:`icon spin me-2 fill-text-color`},[z(`path`,{d:`M12 10a2 2 0 0 1-3.41 1.41A2 2 0 0 1 10 8V0a9.97 9.97 0 0 1 10 10h-8zm7.9 1.41A10 10 0 1 1 8.59.1v2.03a8 8 0 1 0 9.29 9.29h2.02zm-4.07 0a6 6 0 1 1-7.25-7.25v2.1a3.99 3.99 0 0 0-1.4 6.57 4 4 0 0 0 6.56-1.42h2.1z`})],-1),z(`span`,null,`Scanning...`,-1)]])),i.ready&&i.entries.length==0?(L(),R(`div`,B$,[(L(),R(`svg`,V$,[...t[7]||=[z(`path`,{"fill-rule":`evenodd`,d:`M7 10h41a11 11 0 0 1 0 22h-8a3 3 0 0 0 0 6h6a6 6 0 1 1 0 12H10a4 4 0 1 1 0-8h2a2 2 0 1 0 0-4H7a5 5 0 0 1 0-10h3a3 3 0 0 0 0-6H7a6 6 0 1 1 0-12zm14 19a1 1 0 0 1-1-1 1 1 0 0 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0 0 2 1 1 0 0 1 1 1 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 0-2zm-5.5-11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm24 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm1 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-14-3a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm22-23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM33 18a1 1 0 0 1-1-1v-1a1 1 0 0 0-2 0v1a1 1 0 0 1-1 1h-1a1 1 0 0 0 0 2h1a1 1 0 0 1 1 1v1a1 1 0 0 0 2 0v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 0-2h-1z`},null,-1)]])),t[8]||=z(`span`,null,`We didn't find anything - just empty space.`,-1)])):V(``,!0),i.ready&&i.entries.length>0?(L(),R(`table`,H$,[z(`thead`,null,[Va(e.$slots,`table-header`)]),B(du,{tag:`tbody`,name:`list`},{default:F(()=>[i.hasNewEntries?(L(),R(`tr`,U$,[z(`td`,W$,[z(`small`,null,[i.loadingNewEntries?V(``,!0):(L(),R(`a`,{key:0,href:`#`,onClick:t[2]||=H((...e)=>a.loadNewEntries&&a.loadNewEntries(...e),[`prevent`])},`Load New Entries`))]),i.loadingNewEntries?(L(),R(`small`,G$,`Loading...`)):V(``,!0)])])):V(``,!0),(L(!0),R(Ns,null,za(i.entries,t=>(L(),R(`tr`,{key:t.id},[Va(e.$slots,`row`,{entry:t})]))),128)),i.hasMoreEntries?(L(),R(`tr`,K$,[z(`td`,q$,[z(`small`,null,[i.loadingMoreEntries?V(``,!0):(L(),R(`a`,{key:0,href:`#`,onClick:t[3]||=H((...e)=>a.loadOlderEntries&&a.loadOlderEntries(...e),[`prevent`])},`Load Older Entries`))]),i.loadingMoreEntries?(L(),R(`small`,J$,`Loading...`)):V(``,!0)])])):V(``,!0)]),_:3})])):V(``,!0)])}var X$=xD(A$,[[`render`,Y$]]),Z$={props:{resource:{required:!0},title:{required:!0},id:{required:!0},entryPoint:{default:!1}},emits:[`ready`],data(){return{entry:null,batch:null,ready:!1,requestController:new AbortController,unwatchReady:null,updateEntryTimeout:null,updateEntryTimer:2500}},watch:{id(){this.prepareEntry()}},mounted(){this.prepareEntry()},beforeUnmount(){this.requestController.abort(),clearTimeout(this.updateEntryTimeout)},computed:{job(){return CC.default.find(this.batch,{type:`job`})},request(){return CC.default.find(this.batch,{type:`request`})},command(){return CC.default.find(this.batch,{type:`command`})}},methods:{prepareEntry(){this.requestController.abort(),this.requestController=new AbortController,clearTimeout(this.updateEntryTimeout),document.title=this.title+` - Telescope`,this.ready=!1,this.entry=null,this.batch=null,this.$parent.entry=null,this.$parent.batch=[],this.unwatchReady&&this.unwatchReady();let e=this.unwatchReady=this.$watch(`ready`,t=>{t&&(this.$emit(`ready`),e())});this.loadEntry(e=>{this.entry=e.data.entry,this.batch=e.data.batch,this.$parent.entry=e.data.entry,this.$parent.batch=e.data.batch,this.ready=!0,this.updateEntry()})},loadEntry(e,t=!1){let{signal:n}=this.requestController;return bD.get(Telescope.basePath+`/telescope-api/`+this.resource+`/`+this.id,{signal:n}).then(t=>{n.aborted||CC.default.isFunction(e)&&e(t)}).catch(e=>{n.aborted||(this.ready=!0,t&&this.mayRetry(e,n)&&this.updateEntry())})},updateEntry(){this.resource==`jobs`&&this.entry&&this.entry.content.status===`pending`&&(this.updateEntryTimeout=setTimeout(()=>{this.loadEntry(e=>{this.entry=e.data.entry,this.batch=e.data.batch,this.$parent.entry=e.data.entry,this.$parent.batch=e.data.batch,this.ready=!0,this.updateEntry()},!0)},this.updateEntryTimer))}}},Q$={class:`card overflow-hidden`},$$={class:`card-header d-flex align-items-center justify-content-between`},e1={class:`h6 m-0`},t1={key:0,class:`d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},n1={key:1,class:`d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},r1={class:`table-responsive border-top`},i1={key:0,class:`table mb-0 card-bg-secondary table-borderless`},a1={key:0},o1={key:1},s1={key:2},c1={key:3},l1={key:0,class:`card mt-5`},u1={class:`table mb-0 card-bg-secondary table-borderless`},d1={key:0},f1={class:`align-middle`},p1=[`src`,`alt`],m1={key:1};function h1(e,t,n,r,i,a){let o=I(`router-link`);return L(),R(`div`,null,[z(`div`,Q$,[z(`div`,$$,[z(`h2`,e1,N(this.title),1)]),i.ready?V(``,!0):(L(),R(`div`,t1,[...t[0]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,class:`icon spin me-2`},[z(`path`,{d:`M12 10a2 2 0 0 1-3.41 1.41A2 2 0 0 1 10 8V0a9.97 9.97 0 0 1 10 10h-8zm7.9 1.41A10 10 0 1 1 8.59.1v2.03a8 8 0 1 0 9.29 9.29h2.02zm-4.07 0a6 6 0 1 1-7.25-7.25v2.1a3.99 3.99 0 0 0-1.4 6.57 4 4 0 0 0 6.56-1.42h2.1z`})],-1),z(`span`,null,`Fetching...`,-1)]])),i.ready&&!i.entry?(L(),R(`div`,n1,[...t[1]||=[z(`span`,null,`No entry found.`,-1)]])):V(``,!0),z(`div`,r1,[i.ready&&i.entry?(L(),R(`table`,i1,[z(`tbody`,null,[z(`tr`,null,[t[2]||=z(`td`,{class:`table-fit text-muted`},`Time`,-1),z(`td`,null,N(e.localTime(i.entry.created_at))+` (`+N(e.timeAgo(i.entry.created_at))+`)`,1)]),z(`tr`,null,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Hostname`,-1),z(`td`,null,N(i.entry.content.hostname),1)]),Va(e.$slots,`table-parameters`,{entry:i.entry}),!n.entryPoint&&a.job?(L(),R(`tr`,a1,[t[5]||=z(`td`,{class:`table-fit text-muted`},`Job`,-1),z(`td`,null,[B(o,{to:{name:`job-preview`,params:{id:a.job.id}},class:`control-action`},{default:F(()=>[...t[4]||=[Qs(` View Job `,-1)]]),_:1},8,[`to`])])])):V(``,!0),!n.entryPoint&&a.request?(L(),R(`tr`,o1,[t[7]||=z(`td`,{class:`table-fit text-muted`},`Request`,-1),z(`td`,null,[B(o,{to:{name:`request-preview`,params:{id:a.request.id}},class:`control-action`},{default:F(()=>[...t[6]||=[Qs(` View Request `,-1)]]),_:1},8,[`to`])])])):V(``,!0),!n.entryPoint&&a.command?(L(),R(`tr`,s1,[t[9]||=z(`td`,{class:`table-fit text-muted`},`Command`,-1),z(`td`,null,[B(o,{to:{name:`command-preview`,params:{id:a.command.id}},class:`control-action`},{default:F(()=>[...t[8]||=[Qs(` View Command `,-1)]]),_:1},8,[`to`])])])):V(``,!0),i.entry.tags.length?(L(),R(`tr`,c1,[t[10]||=z(`td`,{class:`table-fit text-muted`},`Tags`,-1),z(`td`,null,[(L(!0),R(Ns,null,za(i.entry.tags,e=>(L(),Us(o,{key:e,to:{name:n.resource,query:{tag:e,exact_tag:1}},class:`badge badge-info me-1`},{default:F(()=>[Qs(N(e),1)]),_:2},1032,[`to`]))),128))])])):V(``,!0)])])):V(``,!0)]),i.ready&&i.entry?Va(e.$slots,`below-table`,{entry:i.entry},void 0,void 0,2):V(``,!0)]),i.ready&&i.entry&&i.entry.content.user&&i.entry.content.user.id?(L(),R(`div`,l1,[t[14]||=z(`div`,{class:`card-header d-flex align-items-center justify-content-between`},[z(`h5`,null,`Authenticated User`)],-1),z(`table`,u1,[z(`tbody`,null,[z(`tr`,null,[t[11]||=z(`td`,{class:`table-fit text-muted`},`ID`,-1),z(`td`,null,N(i.entry.content.user.id),1)]),i.entry.content.user.name?(L(),R(`tr`,d1,[t[12]||=z(`td`,{class:`table-fit text-muted align-middle`},`Name`,-1),z(`td`,f1,[i.entry.content.user.avatar?(L(),R(`img`,{key:0,src:i.entry.content.user.avatar,alt:i.entry.content.user.name,class:`me-2 rounded-circle`,height:`40`,width:`40`},null,8,p1)):V(``,!0),Qs(` `+N(i.entry.content.user.name),1)])])):V(``,!0),i.entry.content.user.email?(L(),R(`tr`,m1,[t[13]||=z(`td`,{class:`table-fit text-muted`},`Email Address`,-1),z(`td`,null,N(i.entry.content.user.email),1)])):V(``,!0)])])])):V(``,!0),i.ready&&i.entry?Va(e.$slots,`after-attributes-card`,{entry:i.entry},void 0,void 0,1):V(``,!0)])}var g1=xD(Z$,[[`render`,h1]]),_1={props:[`type`,`message`,`autoClose`,`confirmationProceed`,`confirmationCancel`],data(){return{timeout:null,alertModal:null,anotherModalOpened:document.body.classList.contains(`modal-open`)}},mounted(){this.alertModal=kG.getOrCreateInstance(this.$el,{backdrop:`static`}),this.$el.addEventListener(`hidden.bs.modal`,this.hidden),this.alertModal.show(),this.autoClose&&(this.timeout=setTimeout(()=>{this.close()},this.autoClose))},beforeUnmount(){clearTimeout(this.timeout),this.alertModal.hide(),this.$el.removeEventListener(`hidden.bs.modal`,this.hidden),this.alertModal.dispose()},methods:{hidden(){this.$root.alert.type=null,this.$root.alert.autoClose=!1,this.$root.alert.message=``,this.$root.alert.confirmationProceed=null,this.$root.alert.confirmationCancel=null,this.anotherModalOpened&&document.body.classList.add(`modal-open`)},close(){clearTimeout(this.timeout),this.alertModal.hide()},confirm(){this.confirmationProceed(),this.close()},cancel(){this.confirmationCancel&&this.confirmationCancel(),this.close()}}},v1={class:`modal`,id:`alertModal`,tabindex:`-1`,role:`dialog`,"aria-labelledby":`alertModalLabel`,"aria-hidden":`true`},y1={class:`modal-dialog`,role:`document`},b1={class:`modal-content`},x1={class:`modal-body`},S1={class:`m-0 py-4`,id:`alertModalLabel`},C1={class:`modal-footer justify-content-start flex-row-reverse`};function w1(e,t,n,r,i,a){return L(),R(`div`,v1,[z(`div`,y1,[z(`div`,b1,[z(`div`,x1,[z(`p`,S1,N(n.message),1)]),z(`div`,C1,[n.type==`error`?(L(),R(`button`,{key:0,class:`btn btn-primary`,onClick:t[0]||=(...e)=>a.close&&a.close(...e)},`Close`)):V(``,!0),n.type==`success`?(L(),R(`button`,{key:1,class:`btn btn-primary`,onClick:t[1]||=(...e)=>a.close&&a.close(...e)},`Okay`)):V(``,!0),n.type==`confirmation`?(L(),R(`button`,{key:2,class:`btn btn-danger`,onClick:t[2]||=(...e)=>a.confirm&&a.confirm(...e)},`Yes`)):V(``,!0),n.type==`confirmation`?(L(),R(`button`,{key:3,class:`btn`,onClick:t[3]||=(...e)=>a.cancel&&a.cancel(...e)},`Cancel`)):V(``,!0)])])])])}var T1=xD(_1,[[`render`,w1]]),E1=s(((e,t)=>{t.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r{var n=E1(),r={"text/plain":`Text`,"text/html":`Url`,default:`Text`},i=`Copy to clipboard: #{key}, Enter`;function a(e){var t=(/mac os x/i.test(navigator.userAgent)?`⌘`:`Ctrl`)+`+C`;return e.replace(/#{\s*key\s*}/g,t)}function o(e,t){var o,s,c,l,u,d,f=!1;t||={},o=t.debug||!1;try{if(c=n(),l=document.createRange(),u=document.getSelection(),d=document.createElement(`span`),d.textContent=e,d.ariaHidden=`true`,d.style.all=`unset`,d.style.position=`fixed`,d.style.top=0,d.style.clip=`rect(0, 0, 0, 0)`,d.style.whiteSpace=`pre`,d.style.webkitUserSelect=`text`,d.style.MozUserSelect=`text`,d.style.msUserSelect=`text`,d.style.userSelect=`text`,d.addEventListener(`copy`,function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),n.clipboardData===void 0){o&&console.warn(`unable to use e.clipboardData`),o&&console.warn(`trying IE specific stuff`),window.clipboardData.clearData();var i=r[t.format]||r.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),l.selectNodeContents(d),u.addRange(l),!document.execCommand(`copy`))throw Error(`copy command was unsuccessful`);f=!0}catch(n){o&&console.error(`unable to copy using execCommand: `,n),o&&console.warn(`trying IE specific stuff`);try{window.clipboardData.setData(t.format||`text`,e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(n){o&&console.error(`unable to copy using clipboardData: `,n),o&&console.error(`falling back to prompt`),s=a(`message`in t?t.message:i),window.prompt(s,e)}}finally{u&&(typeof u.removeRange==`function`?u.removeRange(l):u.removeAllRanges()),d&&document.body.removeChild(d),c()}return f}t.exports=o}))()),O1={props:[`data`],data(){return{copying:!1}},methods:{handleCopy(){(0,D1.default)(this.copyText)&&(this.copying=!0,setTimeout(()=>this.copying=!1,1e3))}},computed:{copyText(){return typeof this.data==`string`?this.data:JSON.stringify(this.data,null,` `)}}},k1={class:`position-relative`},A1={class:`copy-to-clipboard`},j1={key:0,style:{color:`#ffffff`}},M1={fill:`currentColor`,viewBox:`0 0 20 20`,style:{width:`1.25rem`,height:`1.25rem`}},N1={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,style:{width:`1.25rem`,height:`1.25rem`}};function P1(e,t,n,r,i,a){return L(),R(`div`,k1,[z(`div`,A1,[i.copying?(L(),R(`span`,j1,[(L(),R(`svg`,M1,[...t[1]||=[z(`path`,{d:`M9 2a1 1 0 000 2h2a1 1 0 100-2H9z`},null,-1),z(`path`,{"fill-rule":`evenodd`,d:`M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`},null,-1)]]))])):(L(),R(`a`,{key:1,href:`#`,onClick:t[0]||=H((...e)=>a.handleCopy&&a.handleCopy(...e),[`prevent`])},[(L(),R(`svg`,N1,[...t[2]||=[z(`path`,{d:`M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z`},null,-1),z(`path`,{d:`M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z`},null,-1)]]))]))]),Va(e.$slots,`default`)])}var F1=xD(O1,[[`render`,P1]]),I1=`telescopeAutoLoadsNewEntries`,L1=document.head.querySelector(`meta[name="csrf-token"]`);L1&&(bD.defaults.headers.common[`X-CSRF-TOKEN`]=L1.content),wC.default.tz.setDefault(Telescope.timezone);var R1=Zu({data(){return{alert:{type:null,autoClose:0,message:``,confirmationProceed:null,confirmationCancel:null},autoLoadsNewEntries:localStorage[I1]===`1`,recording:Telescope.recording,recordingPending:!1}},created(){window.addEventListener(`keydown`,this.keydownListener)},beforeUnmount(){window.removeEventListener(`keydown`,this.keydownListener)},methods:{autoLoadNewEntries(){this.autoLoadsNewEntries=!this.autoLoadsNewEntries,localStorage[I1]=Number(this.autoLoadsNewEntries)},toggleRecording(){if(!this.recordingPending)return this.recordingPending=!0,bD.post(Telescope.basePath+`/telescope-api/toggle-recording`).then(()=>{this.recording=!this.recording}).catch(()=>{this.alertError(`Telescope could not confirm the recording change. Reload the page to see the current status.`)}).finally(()=>{this.recordingPending=!1})},clearEntries(e=!0){if(!e||confirm(`Are you sure you want to delete all Telescope data?`))return bD.delete(Telescope.basePath+`/telescope-api/entries`).then(()=>location.reload()).catch(()=>this.alertError(`Telescope could not confirm that entries were cleared. Reload the page to check.`))},keydownListener(e){e.metaKey&&e.key===`k`&&this.clearEntries(!1)}}});window.Telescope.basePath=`/`+window.Telescope.path;var z1=window.Telescope.basePath+`/`;(window.Telescope.path===``||window.Telescope.path===`/`)&&(z1=`/`,window.Telescope.basePath=``);var B1=PZ({history:$X(z1),routes:AY});R1.use(B1),R1.component(`vue-json-pretty`,lQ),R1.component(`related-entries`,k$),R1.component(`index-screen`,X$),R1.component(`preview-screen`,g1),R1.component(`alert`,T1),R1.component(`copy-clipboard`,F1),R1.mixin(TC),R1.mount(`#telescope`); \ No newline at end of file +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],u=a;n(`update:selectedValue`,u),n(`selectedChange`,u,l)}},C=function(e){n(`nodeClick`,e)},w=function(e){n(`nodeMouseover`,e)},ee=function(e,t){if(e)s.hiddenPaths=sQ(sQ({},s.hiddenPaths),{},HZ({},t,1));else{var n=sQ({},s.hiddenPaths);delete n[t],s.hiddenPaths=n}},T=function(t,r){e.collapsedOnClickBrackets&&ee(t,r.path),n(`bracketsClick`,t,r)},E=function(e,t){ee(e,t.path),n(`iconClick`,e,t)},te=function(t,r){var i=QZ(e.data),a=e.rootPath;Function(`data`,`val`,`data${r.slice(a.length)}=val`)(i,t),n(`update:data`,i)};return(0,$.watchEffect)((function(){_.value&&function(e){throw Error(`[VueJSONPretty] ${e}`)}(_.value)})),(0,$.watchEffect)((function(){h.value&&(e.virtual&&e.dynamicHeight&&c.length!==h.value.length&&f(h.value.length),y())})),(0,$.watch)((function(){return[e.dynamicHeight,e.itemHeight,a.value.length]}),(function(){e.virtual&&e.dynamicHeight&&(f(h.value.length),(0,$.nextTick)(y))})),(0,$.watch)((function(){return e.deep}),(function(t){t&&(s.hiddenPaths=o(t,e.collapsedNodeLength))})),(0,$.watch)((function(){return e.collapsedNodeLength}),(function(t){t&&(s.hiddenPaths=o(e.deep,t))})),function(){var t,n=e.renderNodeKey??r.renderNodeKey,o=e.renderNodeValue??r.renderNodeValue,c=(t=e.renderNodeActions??r.renderNodeActions)!=null&&t,l=s.visibleData?.map((function(t,r){var i=s.startIndex+r;return(0,$.createVNode)(`div`,{key:t.id,ref:function(e){return function(e,t){t?d[e]=t:delete d[e]}(i,e||null)}},[(0,$.createVNode)(aQ,{data:e.data,rootPath:e.rootPath,indent:e.indent,node:t,collapsed:!!s.hiddenPaths[t.path],theme:e.theme,showDoubleQuotes:e.showDoubleQuotes,showLength:e.showLength,checked:g.value.includes(t.path),selectableType:e.selectableType,showLine:e.showLine,showLineNumber:e.showLineNumber,showSelectController:e.showSelectController,selectOnClickNode:e.selectOnClickNode,nodeSelectable:e.nodeSelectable,highlightSelectedNode:e.highlightSelectedNode,editable:e.editable,editableTrigger:e.editableTrigger,showIcon:e.showIcon,showKeyValueSpace:e.showKeyValueSpace,renderNodeKey:n,renderNodeValue:o,renderNodeActions:c,onNodeClick:C,onNodeMouseover:w,onBracketsClick:T,onIconClick:E,onSelectedChange:S,onValueChange:te,class:e.dynamicHeight?`dynamic-height`:void 0,style:e.dynamicHeight?{}:e.itemHeight&&e.itemHeight!==20?{lineHeight:`${e.itemHeight}px`}:{}},null)])}));return(0,$.createVNode)(`div`,{ref:i,class:{"vjs-tree":!0,"is-virtual":e.virtual,dark:e.theme===`dark`},onScroll:e.virtual?x:void 0,style:e.showLineNumber?sQ({paddingLeft:`${12*Number(a.value.length.toString().length)}px`},e.style):e.style},[e.virtual?(0,$.createVNode)(`div`,{class:`vjs-tree-list`,style:{height:`${e.height}px`}},[(0,$.createVNode)(`div`,{class:`vjs-tree-list-holder`,style:{height:`${v.value}px`}},[(0,$.createVNode)(`div`,{class:`vjs-tree-list-holder-inner`,style:{transform:`translateY(${s.translateY}px)`}},[l])])]):l])}}}),lQ=RZ.A,uQ={props:[`entry`,`batch`],directives:{dropdown:{mounted(e){IW.getOrCreateInstance(e)},beforeUnmount(e){IW.getInstance(e).dispose()}}},mixins:[ek],data(){return{currentTab:`exceptions`}},mounted(){this.activateFirstTab()},watch:{entry(){this.activateFirstTab()}},methods:{activateFirstTab(){window.location.hash?this.currentTab=window.location.hash.substring(1):this.exceptions.length?this.currentTab=`exceptions`:this.logs.length?this.currentTab=`logs`:this.views.length?this.currentTab=`views`:this.queries.length?this.currentTab=`queries`:this.models.length?this.currentTab=`models`:this.jobs.length?this.currentTab=`jobs`:this.mails.length?this.currentTab=`mails`:this.notifications.length?this.currentTab=`notifications`:this.events.length?this.currentTab=`events`:this.cache.length?this.currentTab=`cache`:this.gates.length?this.currentTab=`gates`:this.redis.length?this.currentTab=`redis`:this.clientRequests.length&&(this.currentTab=`client_requests`)},activateTab(e){this.currentTab=e,this.$router.replace({hash:`#`+this.currentTab})}},computed:{hasRelatedEntries(){return!!CC.default.reject(this.batch,e=>CC.default.includes([`request`,`command`],e.type)).length},exceptions(){return CC.default.filter(this.batch,{type:`exception`})},gates(){return CC.default.filter(this.batch,{type:`gate`})},logs(){return CC.default.filter(this.batch,{type:`log`})},queries(){return CC.default.filter(this.batch,{type:`query`})},models(){return CC.default.filter(this.batch,{type:`model`})},jobs(){return CC.default.filter(this.batch,{type:`job`})},events(){return CC.default.filter(this.batch,{type:`event`})},cache(){return CC.default.filter(this.batch,{type:`cache`})},redis(){return CC.default.filter(this.batch,{type:`redis`})},mails(){return CC.default.filter(this.batch,{type:`mail`})},notifications(){return CC.default.filter(this.batch,{type:`notification`})},views(){return CC.default.filter(this.batch,{type:`view`})},clientRequests(){return CC.default.filter(this.batch,{type:`client_request`})},queriesSummary(){return{time:CC.default.reduce(this.queries,(e,t)=>e+parseFloat(t.content.time),0).toFixed(2),duplicated:this.queries.length-CC.default.size(CC.default.groupBy(this.queries,e=>`${e.content.hash}-${e.content.connection}`))}},tabs(){return CC.default.filter([{title:`Exceptions`,type:`exceptions`,count:this.exceptions.length},{title:`Logs`,type:`logs`,count:this.logs.length},{title:`Views`,type:`views`,count:this.views.length},{title:`Queries`,type:`queries`,count:this.queries.length},{title:`Models`,type:`models`,count:this.models.length},{title:`Gates`,type:`gates`,count:this.gates.length},{title:`Jobs`,type:`jobs`,count:this.jobs.length},{title:`Mail`,type:`mails`,count:this.mails.length},{title:`Notifications`,type:`notifications`,count:this.notifications.length},{title:`Events`,type:`events`,count:this.events.length},{title:`Cache`,type:`cache`,count:this.cache.length},{title:`Redis`,type:`redis`,count:this.redis.length},{title:`HTTP Client`,type:`client_requests`,count:this.clientRequests.length}],e=>e.count>0)},separateTabs(){return CC.default.slice(this.tabs,0,7)},dropdownTabs(){return CC.default.slice(this.tabs,7)},dropdownTabSelected(){return CC.default.includes(CC.default.map(this.dropdownTabs,`type`),this.currentTab)}}},dQ={key:0,class:`card overflow-hidden mt-5`},fQ={class:`nav nav-pills`},pQ=[`onClick`],mQ={key:0,class:`nav-item dropdown`},hQ={class:`dropdown-menu`},gQ=[`onClick`],_Q={class:`table table-hover mb-0`},vQ=[`title`],yQ={class:`text-muted text-break`},bQ={class:`table-fit`},xQ={class:`table table-hover mb-0`},SQ=[`title`],CQ={class:`table-fit`},wQ={class:`table-fit`},TQ={class:`table table-hover mb-0`},EQ={class:`text-end`},DQ=[`title`],OQ={class:`table-fit text-end`},kQ={key:0,class:`badge badge-danger`},AQ={key:1,class:`text-muted`},jQ={class:`table-fit`},MQ={class:`table table-hover mb-0`},NQ=[`title`],PQ={class:`table-fit`},FQ={class:`table-fit`},IQ={class:`table table-hover mb-0`},LQ=[`title`],RQ={class:`table-fit`},zQ={class:`table-fit`},BQ={class:`table table-hover mb-0`},VQ=[`title`],HQ={class:`text-muted`},UQ={class:`table-fit`},WQ={class:`table-fit`},GQ={class:`table table-hover mb-0`},KQ=[`title`],qQ={key:0,class:`badge badge-info ms-2`},JQ={class:`table-fit text-end text-muted`},YQ={class:`table-fit`},XQ={class:`table table-hover mb-0`},ZQ=[`title`],QQ={class:`table-fit`},$Q={class:`table-fit`},e$={class:`table table-hover mb-0`},t$=[`title`],n$={class:`table-fit text-end text-muted`},r$={class:`table-fit`},i$={class:`table table-hover mb-0`},a$=[`title`],o$={key:0,class:`badge badge-secondary ms-2`},s$=[`title`],c$={class:`table-fit`},l$={class:`table table-hover mb-0`},u$=[`title`],d$={key:0,class:`badge badge-secondary ms-2`},f$=[`title`],p$={class:`table-fit text-muted`},m$={class:`table-fit`},h$={class:`table table-hover mb-0`},g$={class:`text-muted`},_$={class:`table-fit text-end text-muted`},v$={class:`table-fit`},y$={class:`table table-hover mb-0`},b$={class:`table-fit pe-0`},x$=[`title`],S$={class:`table-fit`},C$={class:`table-fit text-end text-muted`},w$={key:0},T$={key:1},E$=[`data-timeago`,`title`],D$={class:`table-fit`};function O$(e,t,n,r,i,a){let o=I(`router-link`),s=Ia(`dropdown`);return a.hasRelatedEntries?(L(),R(`div`,dQ,[z(`ul`,fQ,[(L(!0),R(Ns,null,za(a.separateTabs,e=>(L(),R(`li`,{class:`nav-item`,key:e.type},[z(`a`,{class:M([`nav-link`,{active:i.currentTab==e.type}]),href:`#`,onClick:H(t=>a.activateTab(e.type),[`prevent`])},N(e.title)+` (`+N(e.count)+`) `,11,pQ)]))),128)),a.dropdownTabs.length?(L(),R(`li`,mQ,[Vr((L(),R(`a`,{class:M([`nav-link dropdown-toggle`,{active:a.dropdownTabSelected}]),"data-bs-toggle":`dropdown`,href:`#`,role:`button`,"aria-haspopup":`true`,"aria-expanded":`false`},[...t[0]||=[Qs(`More`,-1)]],2)),[[s]]),z(`div`,hQ,[(L(!0),R(Ns,null,za(a.dropdownTabs,e=>(L(),R(`a`,{class:M([`dropdown-item`,{active:i.currentTab==e.type}]),href:`#`,key:e.type,onClick:H(t=>a.activateTab(e.type),[`prevent`])},N(e.title)+` (`+N(e.count)+`)`,11,gQ))),128))])])):V(``,!0)]),z(`div`,null,[Vr(z(`table`,_Q,[t[3]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Message`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.exceptions,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.class},[Qs(N(e.truncate(n.content.class,70)),1),t[1]||=z(`br`,null,null,-1),z(`small`,yQ,N(e.truncate(n.content.message,200)),1)],8,vQ),z(`td`,bQ,[B(o,{to:{name:`exception-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[2]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`exceptions`&&a.exceptions.length]]),Vr(z(`table`,xQ,[t[5]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Message`),z(`th`,{scope:`col`},`Level`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.logs,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.message},N(e.truncate(n.content.message,90)),9,SQ),z(`td`,CQ,[z(`span`,{class:M([`badge`,`badge-`+e.logLevelClass(n.content.level)])},N(n.content.level),3)]),z(`td`,wQ,[B(o,{to:{name:`log-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[4]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`logs`&&a.logs.length]]),Vr(z(`table`,TQ,[z(`thead`,null,[z(`tr`,null,[z(`th`,null,[t[6]||=Qs(` Query`,-1),t[7]||=z(`br`,null,null,-1),z(`small`,null,N(a.queries.length)+` queries, `+N(a.queriesSummary.duplicated)+` of which are duplicated.`,1)]),z(`th`,EQ,[t[8]||=Qs(` Duration`,-1),t[9]||=z(`br`,null,null,-1),z(`small`,null,N(a.queriesSummary.time)+`ms`,1)]),t[10]||=z(`th`,null,null,-1)])]),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.queries,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.sql},[z(`code`,null,N(e.truncate(n.content.sql,110)),1)],8,DQ),z(`td`,OQ,[n.content.slow?(L(),R(`span`,kQ,N(n.content.time)+`ms `,1)):(L(),R(`span`,AQ,N(n.content.time)+`ms `,1))]),z(`td`,jQ,[B(o,{to:{name:`query-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[11]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`queries`&&a.queries.length]]),Vr(z(`table`,MQ,[t[13]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Model`),z(`th`,null,`Hydrated`),z(`th`,null,`Action`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.models,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.model},N(e.truncate(n.content.model,100)),9,NQ),z(`td`,null,N(n.content?.count),1),z(`td`,PQ,[z(`span`,{class:M([`badge`,`badge-`+e.modelActionClass(n.content.action)])},N(n.content.action),3)]),z(`td`,FQ,[B(o,{to:{name:`model-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[12]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`models`&&a.models.length]]),Vr(z(`table`,IQ,[t[15]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Ability`),z(`th`,null,`Result`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.gates,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.ability},N(e.truncate(n.content.ability,80)),9,LQ),z(`td`,RQ,[z(`span`,{class:M([`badge`,`badge-`+e.gateResultClass(n.content.result)])},N(n.content.result),3)]),z(`td`,zQ,[B(o,{to:{name:`gate-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[14]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`gates`&&a.gates.length]]),Vr(z(`table`,BQ,[t[18]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Job`),z(`th`,{scope:`col`},`Status`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.jobs,n=>(L(),R(`tr`,null,[z(`td`,null,[z(`span`,{title:n.content.name},N(e.truncate(n.content.name,68)),9,VQ),t[16]||=z(`br`,null,null,-1),z(`small`,HQ,` Connection: `+N(n.content.connection)+` | Queue: `+N(n.content.queue),1)]),z(`td`,UQ,[z(`span`,{class:M([`badge`,`badge-`+e.jobStatusClass(n.content.status)])},N(n.content.status),3)]),z(`td`,WQ,[B(o,{to:{name:`job-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[17]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`jobs`&&a.jobs.length]]),Vr(z(`table`,GQ,[t[20]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Name`),z(`th`,{class:`text-end`},`Listeners`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.events,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.name},[Qs(N(e.truncate(n.content.name,80))+` `,1),n.content.broadcast?(L(),R(`span`,qQ,` Broadcast `)):V(``,!0)],8,KQ),z(`td`,JQ,N(n.content.listeners.length),1),z(`td`,YQ,[B(o,{to:{name:`event-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[19]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`events`&&a.events.length]]),Vr(z(`table`,XQ,[t[22]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Key`),z(`th`,null,`Action`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.cache,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.key},N(e.truncate(n.content.key,100)),9,ZQ),z(`td`,QQ,[z(`span`,{class:M([`badge`,`badge-`+e.cacheActionTypeClass(n.content.type)])},N(n.content.type),3)]),z(`td`,$Q,[B(o,{to:{name:`cache-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[21]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`cache`&&a.cache.length]]),Vr(z(`table`,e$,[t[24]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Command`),z(`th`,{class:`text-end`},`Duration`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.redis,n=>(L(),R(`tr`,null,[z(`td`,{title:n.content.command},N(e.truncate(n.content.command,100)),9,t$),z(`td`,n$,N(n.content.time)+`ms`,1),z(`td`,r$,[B(o,{to:{name:`redis-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[23]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`redis`&&a.redis.length]]),Vr(z(`table`,i$,[t[27]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Mailable`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.mails,n=>(L(),R(`tr`,null,[z(`td`,null,[z(`span`,{title:n.content.mailable},N(e.truncate(n.content.mailable||`-`,70)),9,a$),n.content.queued?(L(),R(`span`,o$,` Queued `)):V(``,!0),t[25]||=z(`br`,null,null,-1),z(`small`,{class:`text-muted`,title:n.content.subject},` Subject: `+N(e.truncate(n.content.subject,90)),9,s$)]),z(`td`,c$,[B(o,{to:{name:`mail-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[26]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`mails`&&a.mails.length]]),Vr(z(`table`,l$,[t[30]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Notification`),z(`th`,null,`Channel`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.notifications,n=>(L(),R(`tr`,null,[z(`td`,null,[z(`span`,{title:n.content.notification},N(e.truncate(n.content.notification||`-`,70)),9,u$),n.content.queued?(L(),R(`span`,d$,` Queued `)):V(``,!0),t[28]||=z(`br`,null,null,-1),z(`small`,{class:`text-muted`,title:n.content.notifiable},` Recipient: `+N(e.truncate(n.content.notifiable,90)),9,f$)]),z(`td`,p$,N(e.truncate(n.content.channel,20)),1),z(`td`,m$,[B(o,{to:{name:`notification-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[29]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`notifications`&&a.notifications.length]]),Vr(z(`table`,h$,[t[33]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Name`),z(`th`,{class:`text-end`},`Composers`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.views,n=>(L(),R(`tr`,null,[z(`td`,null,[Qs(N(n.content.name)+` `,1),t[31]||=z(`br`,null,null,-1),z(`small`,g$,N(e.truncate(n.content.path,100)),1)]),z(`td`,_$,N(n.content.composers?n.content.composers.length:0),1),z(`td`,v$,[B(o,{to:{name:`view-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[32]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`views`&&a.views.length]]),Vr(z(`table`,y$,[t[35]||=z(`thead`,null,[z(`tr`,null,[z(`th`,null,`Verb`),z(`th`,null,`URI`),z(`th`,null,`Status`),z(`th`,{class:`text-end`},`Duration`),z(`th`,{class:`text-end`},`Happened`),z(`th`)])],-1),z(`tbody`,null,[(L(!0),R(Ns,null,za(a.clientRequests,n=>(L(),R(`tr`,null,[z(`td`,b$,[z(`span`,{class:M([`badge`,`badge-`+e.requestMethodClass(n.content.method)])},N(n.content.method),3)]),z(`td`,{title:n.content.uri},N(e.truncate(n.content.uri,60)),9,x$),z(`td`,S$,[z(`span`,{class:M([`badge`,`badge-`+e.requestStatusClass(n.content.response_status===void 0?null:n.content.response_status)])},N(n.content.response_status===void 0?`N/A`:n.content.response_status),3)]),z(`td`,C$,[n.content.duration?(L(),R(`span`,w$,N(n.content.duration)+`ms`,1)):(L(),R(`span`,T$,`-`))]),z(`td`,{class:`table-fit text-end text-muted`,"data-timeago":n.created_at,title:n.created_at},N(e.timeAgo(n.created_at)),9,E$),z(`td`,D$,[B(o,{to:{name:`client-request-preview`,params:{id:n.id}},class:`control-action`},{default:F(()=>[...t[34]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[z(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z`,"clip-rule":`evenodd`})],-1)]]),_:1},8,[`to`])])]))),256))])],512),[[yl,i.currentTab==`client_requests`&&a.clientRequests.length]])])])):V(``,!0)}var k$=xD(uQ,[[`render`,O$],[`__scopeId`,`data-v-4281b226`]]),A$={props:[`resource`,`title`,`showAllFamily`,`hideSearch`],data(){return{tag:``,familyHash:``,entries:[],ready:!1,requestController:new AbortController,recordingStatus:`enabled`,lastEntryIndex:``,hasMoreEntries:!0,hasNewEntries:!1,entriesPerRequest:50,loadingNewEntries:!1,loadingMoreEntries:!1,updateTimeAgoTimeout:null,newEntriesTimeout:null,newEntriesTimer:2500,updateEntriesTimeout:null,updateEntriesTimer:2500}},created(){this.debouncer=CC.default.debounce(e=>e(),500)},mounted(){document.title=this.title+` - Telescope`,this.familyHash=this.$route.query.family_hash||``,this.tag=this.$route.query.tag||``,this.loadEntries(e=>{this.entries=e,this.checkForNewEntries(),this.ready=!0}),this.updateEntries(),this.updateTimeAgo(),document.addEventListener(`keyup`,this.focusOnSearch)},beforeUnmount(){this.requestController.abort(),clearTimeout(this.newEntriesTimeout),clearTimeout(this.updateEntriesTimeout),clearTimeout(this.updateTimeAgoTimeout),this.debouncer.cancel(),document.removeEventListener(`keyup`,this.focusOnSearch)},watch:{"$route.query":function(){this.requestController.abort(),this.requestController=new AbortController,clearTimeout(this.newEntriesTimeout),clearTimeout(this.updateEntriesTimeout),this.hasNewEntries=!1,this.lastEntryIndex=``,this.loadingNewEntries=!1,this.loadingMoreEntries=!1,this.familyHash=this.$route.query.family_hash||``,this.tag=this.$route.query.tag||``,this.ready=!1,this.loadEntries(e=>{this.entries=e,this.checkForNewEntries(),this.updateEntries(),this.ready=!0})}},methods:{loadEntries(e){let{signal:t}=this.requestController;return bD.post(Telescope.basePath+`/telescope-api/`+this.resource,null,{signal:t,params:{tag:this.tag,exact_tag:this.$route.query.exact_tag,before:this.lastEntryIndex,take:this.entriesPerRequest,family_hash:this.familyHash}}).then(n=>{t.aborted||(this.lastEntryIndex=n.data.entries.length?CC.default.last(n.data.entries).sequence:this.lastEntryIndex,this.hasMoreEntries=n.data.entries.length>=this.entriesPerRequest,this.recordingStatus=n.data.status,CC.default.isFunction(e)&&e(this.familyHash||this.showAllFamily?n.data.entries:CC.default.uniqBy(n.data.entries,e=>e.family_hash||CC.default.uniqueId())))}).catch(e=>{t.aborted||(this.ready=!0,this.loadingNewEntries=!1,this.loadingMoreEntries=!1,this.mayRetry(e,t)&&(this.checkForNewEntries(),this.updateEntries()))})},checkForNewEntries(){let{signal:e}=this.requestController;clearTimeout(this.newEntriesTimeout),this.newEntriesTimeout=setTimeout(()=>{bD.post(Telescope.basePath+`/telescope-api/`+this.resource,null,{signal:e,params:{tag:this.tag,exact_tag:this.$route.query.exact_tag,take:1,family_hash:this.familyHash}}).then(t=>{e.aborted||(this.recordingStatus=t.data.status,t.data.entries.length&&!this.entries.length?this.loadNewEntries():t.data.entries.length&&CC.default.first(t.data.entries).id!==CC.default.first(this.entries).id?this.$root.autoLoadsNewEntries?this.loadNewEntries():this.hasNewEntries=!0:this.checkForNewEntries())}).catch(t=>{this.mayRetry(t,e)&&this.checkForNewEntries()})},this.newEntriesTimer)},updateTimeAgo(){this.updateTimeAgoTimeout=setTimeout(()=>{this.$el.querySelectorAll(`[data-timeago]`).forEach(e=>{e.textContent=this.timeAgo(e.dataset.timeago)}),this.updateTimeAgo()},6e4)},search(){this.debouncer(()=>(this.hasNewEntries=!1,this.lastEntryIndex=``,this.$router.push({query:CC.default.assign({},this.$route.query,{tag:this.tag,exact_tag:void 0})})))},loadOlderEntries(){this.loadingMoreEntries=!0,this.loadEntries(e=>{this.entries.push(...e),this.loadingMoreEntries=!1})},loadNewEntries(){this.hasMoreEntries=!0,this.hasNewEntries=!1,this.lastEntryIndex=``,this.loadingNewEntries=!0,clearTimeout(this.newEntriesTimeout),this.loadEntries(e=>{this.entries=e,this.loadingNewEntries=!1,this.checkForNewEntries()})},updateEntries(){let{signal:e}=this.requestController;this.resource===`jobs`&&(clearTimeout(this.updateEntriesTimeout),this.updateEntriesTimeout=setTimeout(()=>{let t=CC.default.chain(this.entries).filter(e=>e.content.status===`pending`).map(`id`).value();if(!t.length)return this.updateEntries();bD.post(Telescope.basePath+`/telescope-api/`+this.resource,{uuids:t},{signal:e}).then(n=>{e.aborted||(this.recordingStatus=n.data.status,this.entries=CC.default.map(this.entries,e=>CC.default.includes(t,e.id)&&CC.default.find(n.data.entries,{id:e.id})||e),this.updateEntries())}).catch(t=>{this.mayRetry(t,e)&&this.updateEntries()})},this.updateEntriesTimer))},focusOnSearch(e){if(e.key===`/`){let e=this.$el.querySelector(`#searchInput`);e&&e.focus()}}}},j$={class:`card overflow-hidden`},M$={class:`card-header d-flex align-items-center justify-content-between`},N$={class:`h6 m-0`},P$={key:0,class:`form-control-with-icon w-25`},F$={key:0,class:`mt-0 mb-0 disabled-watcher d-flex align-items-center`},I$={key:0,class:`ms-1`},L$={key:1,class:`ms-1`},R$={key:2,class:`ms-1`},z$={key:1,class:`d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},B$={key:2,class:`d-flex flex-column align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},V$={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 60 60`,class:`fill-text-color`,style:{width:`200px`}},H$={key:3,id:`indexScreen`,class:`table table-hover mb-0 penultimate-column-right`},U$={key:`newEntries`,class:`dontanimate`},W$={colspan:`100`,class:`text-center card-bg-secondary py-2`},G$={key:0},K$={key:`olderEntries`,class:`dontanimate`},q$={colspan:`100`,class:`text-center card-bg-secondary py-2`},J$={key:0};function Y$(e,t,n,r,i,a){return L(),R(`div`,j$,[z(`div`,M$,[z(`h2`,N$,N(n.title),1),!n.hideSearch&&(i.tag||i.entries.length>0)?(L(),R(`div`,P$,[t[4]||=z(`div`,{class:`icon-wrapper`},[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,class:`icon`},[z(`path`,{"fill-rule":`evenodd`,d:`M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z`,"clip-rule":`evenodd`})])],-1),Vr(z(`input`,{type:`text`,class:`form-control w-100`,id:`searchInput`,placeholder:`Search Tag`,"onUpdate:modelValue":t[0]||=e=>i.tag=e,onInput:t[1]||=H((...e)=>a.search&&a.search(...e),[`stop`])},null,544),[[Du,i.tag]])])):V(``,!0)]),i.recordingStatus===`enabled`?V(``,!0):(L(),R(`p`,F$,[t[5]||=z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,x:`0px`,y:`0px`,width:`20px`,height:`20px`,viewBox:`0 0 90 90`,class:`me-2`},[z(`path`,{fill:`#FFFFFF`,d:`M45 0C20.1 0 0 20.1 0 45s20.1 45 45 45 45-20.1 45-45S69.9 0 45 0zM45 74.5c-3.6 0-6.5-2.9-6.5-6.5s2.9-6.5 6.5-6.5 6.5 2.9 6.5 6.5S48.6 74.5 45 74.5zM52.1 23.9l-2.5 29.6c0 2.5-2.1 4.6-4.6 4.6 -2.5 0-4.6-2.1-4.6-4.6l-2.5-29.6c-0.1-0.4-0.1-0.7-0.1-1.1 0-4 3.2-7.2 7.2-7.2 4 0 7.2 3.2 7.2 7.2C52.2 23.1 52.2 23.5 52.1 23.9z`})],-1),i.recordingStatus==`disabled`?(L(),R(`span`,I$,`Telescope is currently disabled.`)):V(``,!0),i.recordingStatus==`paused`?(L(),R(`span`,L$,`Telescope recording is paused.`)):V(``,!0),i.recordingStatus==`off`?(L(),R(`span`,R$,`This watcher is turned off.`)):V(``,!0)])),i.ready?V(``,!0):(L(),R(`div`,z$,[...t[6]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,class:`icon spin me-2 fill-text-color`},[z(`path`,{d:`M12 10a2 2 0 0 1-3.41 1.41A2 2 0 0 1 10 8V0a9.97 9.97 0 0 1 10 10h-8zm7.9 1.41A10 10 0 1 1 8.59.1v2.03a8 8 0 1 0 9.29 9.29h2.02zm-4.07 0a6 6 0 1 1-7.25-7.25v2.1a3.99 3.99 0 0 0-1.4 6.57 4 4 0 0 0 6.56-1.42h2.1z`})],-1),z(`span`,null,`Scanning...`,-1)]])),i.ready&&i.entries.length==0?(L(),R(`div`,B$,[(L(),R(`svg`,V$,[...t[7]||=[z(`path`,{"fill-rule":`evenodd`,d:`M7 10h41a11 11 0 0 1 0 22h-8a3 3 0 0 0 0 6h6a6 6 0 1 1 0 12H10a4 4 0 1 1 0-8h2a2 2 0 1 0 0-4H7a5 5 0 0 1 0-10h3a3 3 0 0 0 0-6H7a6 6 0 1 1 0-12zm14 19a1 1 0 0 1-1-1 1 1 0 0 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0 0 2 1 1 0 0 1 1 1 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 0-2zm-5.5-11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm24 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm1 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm-14-3a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm22-23a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM33 18a1 1 0 0 1-1-1v-1a1 1 0 0 0-2 0v1a1 1 0 0 1-1 1h-1a1 1 0 0 0 0 2h1a1 1 0 0 1 1 1v1a1 1 0 0 0 2 0v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 0-2h-1z`},null,-1)]])),t[8]||=z(`span`,null,`We didn't find anything - just empty space.`,-1)])):V(``,!0),i.ready&&i.entries.length>0?(L(),R(`table`,H$,[z(`thead`,null,[Va(e.$slots,`table-header`)]),B(du,{tag:`tbody`,name:`list`},{default:F(()=>[i.hasNewEntries?(L(),R(`tr`,U$,[z(`td`,W$,[z(`small`,null,[i.loadingNewEntries?V(``,!0):(L(),R(`a`,{key:0,href:`#`,onClick:t[2]||=H((...e)=>a.loadNewEntries&&a.loadNewEntries(...e),[`prevent`])},`Load New Entries`))]),i.loadingNewEntries?(L(),R(`small`,G$,`Loading...`)):V(``,!0)])])):V(``,!0),(L(!0),R(Ns,null,za(i.entries,t=>(L(),R(`tr`,{key:t.id},[Va(e.$slots,`row`,{entry:t})]))),128)),i.hasMoreEntries?(L(),R(`tr`,K$,[z(`td`,q$,[z(`small`,null,[i.loadingMoreEntries?V(``,!0):(L(),R(`a`,{key:0,href:`#`,onClick:t[3]||=H((...e)=>a.loadOlderEntries&&a.loadOlderEntries(...e),[`prevent`])},`Load Older Entries`))]),i.loadingMoreEntries?(L(),R(`small`,J$,`Loading...`)):V(``,!0)])])):V(``,!0)]),_:3})])):V(``,!0)])}var X$=xD(A$,[[`render`,Y$]]),Z$={props:{resource:{required:!0},title:{required:!0},id:{required:!0},entryPoint:{default:!1}},emits:[`ready`],data(){return{entry:null,batch:null,ready:!1,requestController:new AbortController,unwatchReady:null,updateEntryTimeout:null,updateEntryTimer:2500}},watch:{id(){this.prepareEntry()}},mounted(){this.prepareEntry()},beforeUnmount(){this.requestController.abort(),clearTimeout(this.updateEntryTimeout)},computed:{job(){return CC.default.find(this.batch,{type:`job`})},request(){return CC.default.find(this.batch,{type:`request`})},command(){return CC.default.find(this.batch,{type:`command`})}},methods:{prepareEntry(){this.requestController.abort(),this.requestController=new AbortController,clearTimeout(this.updateEntryTimeout),document.title=this.title+` - Telescope`,this.ready=!1,this.entry=null,this.batch=null,this.$parent.entry=null,this.$parent.batch=[],this.unwatchReady&&this.unwatchReady();let e=this.unwatchReady=this.$watch(`ready`,t=>{t&&(this.$emit(`ready`),e())});this.loadEntry(e=>{this.entry=e.data.entry,this.batch=e.data.batch,this.$parent.entry=e.data.entry,this.$parent.batch=e.data.batch,this.ready=!0,this.updateEntry()})},loadEntry(e,t=!1){let{signal:n}=this.requestController;return bD.get(Telescope.basePath+`/telescope-api/`+this.resource+`/`+this.id,{signal:n}).then(t=>{n.aborted||CC.default.isFunction(e)&&e(t)}).catch(e=>{n.aborted||(this.ready=!0,t&&this.mayRetry(e,n)&&this.updateEntry())})},updateEntry(){this.resource==`jobs`&&this.entry&&this.entry.content.status===`pending`&&(this.updateEntryTimeout=setTimeout(()=>{this.loadEntry(e=>{this.entry=e.data.entry,this.batch=e.data.batch,this.$parent.entry=e.data.entry,this.$parent.batch=e.data.batch,this.ready=!0,this.updateEntry()},!0)},this.updateEntryTimer))}}},Q$={class:`card overflow-hidden`},$$={class:`card-header d-flex align-items-center justify-content-between`},e1={class:`h6 m-0`},t1={key:0,class:`d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},n1={key:1,class:`d-flex align-items-center justify-content-center card-bg-secondary p-5 bottom-radius`},r1={class:`table-responsive border-top`},i1={key:0,class:`table mb-0 card-bg-secondary table-borderless`},a1={key:0},o1={key:1},s1={key:2},c1={key:3},l1={key:0,class:`card mt-5`},u1={class:`table mb-0 card-bg-secondary table-borderless`},d1={key:0},f1={class:`align-middle`},p1=[`src`,`alt`],m1={key:1};function h1(e,t,n,r,i,a){let o=I(`router-link`);return L(),R(`div`,null,[z(`div`,Q$,[z(`div`,$$,[z(`h2`,e1,N(n.title),1)]),i.ready?V(``,!0):(L(),R(`div`,t1,[...t[0]||=[z(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,class:`icon spin me-2`},[z(`path`,{d:`M12 10a2 2 0 0 1-3.41 1.41A2 2 0 0 1 10 8V0a9.97 9.97 0 0 1 10 10h-8zm7.9 1.41A10 10 0 1 1 8.59.1v2.03a8 8 0 1 0 9.29 9.29h2.02zm-4.07 0a6 6 0 1 1-7.25-7.25v2.1a3.99 3.99 0 0 0-1.4 6.57 4 4 0 0 0 6.56-1.42h2.1z`})],-1),z(`span`,null,`Fetching...`,-1)]])),i.ready&&!i.entry?(L(),R(`div`,n1,[...t[1]||=[z(`span`,null,`No entry found.`,-1)]])):V(``,!0),z(`div`,r1,[i.ready&&i.entry?(L(),R(`table`,i1,[z(`tbody`,null,[z(`tr`,null,[t[2]||=z(`td`,{class:`table-fit text-muted`},`Time`,-1),z(`td`,null,N(e.localTime(i.entry.created_at))+` (`+N(e.timeAgo(i.entry.created_at))+`)`,1)]),z(`tr`,null,[t[3]||=z(`td`,{class:`table-fit text-muted`},`Hostname`,-1),z(`td`,null,N(i.entry.content.hostname),1)]),Va(e.$slots,`table-parameters`,{entry:i.entry}),!n.entryPoint&&a.job?(L(),R(`tr`,a1,[t[5]||=z(`td`,{class:`table-fit text-muted`},`Job`,-1),z(`td`,null,[B(o,{to:{name:`job-preview`,params:{id:a.job.id}},class:`control-action`},{default:F(()=>[...t[4]||=[Qs(` View Job `,-1)]]),_:1},8,[`to`])])])):V(``,!0),!n.entryPoint&&a.request?(L(),R(`tr`,o1,[t[7]||=z(`td`,{class:`table-fit text-muted`},`Request`,-1),z(`td`,null,[B(o,{to:{name:`request-preview`,params:{id:a.request.id}},class:`control-action`},{default:F(()=>[...t[6]||=[Qs(` View Request `,-1)]]),_:1},8,[`to`])])])):V(``,!0),!n.entryPoint&&a.command?(L(),R(`tr`,s1,[t[9]||=z(`td`,{class:`table-fit text-muted`},`Command`,-1),z(`td`,null,[B(o,{to:{name:`command-preview`,params:{id:a.command.id}},class:`control-action`},{default:F(()=>[...t[8]||=[Qs(` View Command `,-1)]]),_:1},8,[`to`])])])):V(``,!0),i.entry.tags.length?(L(),R(`tr`,c1,[t[10]||=z(`td`,{class:`table-fit text-muted`},`Tags`,-1),z(`td`,null,[(L(!0),R(Ns,null,za(i.entry.tags,e=>(L(),Us(o,{key:e,to:{name:n.resource,query:{tag:e,exact_tag:1}},class:`badge badge-info me-1`},{default:F(()=>[Qs(N(e),1)]),_:2},1032,[`to`]))),128))])])):V(``,!0)])])):V(``,!0)]),i.ready&&i.entry?Va(e.$slots,`below-table`,{entry:i.entry},void 0,void 0,2):V(``,!0)]),i.ready&&i.entry&&i.entry.content.user&&i.entry.content.user.id?(L(),R(`div`,l1,[t[14]||=z(`div`,{class:`card-header d-flex align-items-center justify-content-between`},[z(`h5`,null,`Authenticated User`)],-1),z(`table`,u1,[z(`tbody`,null,[z(`tr`,null,[t[11]||=z(`td`,{class:`table-fit text-muted`},`ID`,-1),z(`td`,null,N(i.entry.content.user.id),1)]),i.entry.content.user.name?(L(),R(`tr`,d1,[t[12]||=z(`td`,{class:`table-fit text-muted align-middle`},`Name`,-1),z(`td`,f1,[i.entry.content.user.avatar?(L(),R(`img`,{key:0,src:i.entry.content.user.avatar,alt:i.entry.content.user.name,class:`me-2 rounded-circle`,height:`40`,width:`40`},null,8,p1)):V(``,!0),Qs(` `+N(i.entry.content.user.name),1)])])):V(``,!0),i.entry.content.user.email?(L(),R(`tr`,m1,[t[13]||=z(`td`,{class:`table-fit text-muted`},`Email Address`,-1),z(`td`,null,N(i.entry.content.user.email),1)])):V(``,!0)])])])):V(``,!0),i.ready&&i.entry?Va(e.$slots,`after-attributes-card`,{entry:i.entry},void 0,void 0,1):V(``,!0)])}var g1=xD(Z$,[[`render`,h1]]),_1={props:[`type`,`message`,`autoClose`,`confirmationProceed`,`confirmationCancel`],data(){return{timeout:null,alertModal:null,anotherModalOpened:document.body.classList.contains(`modal-open`)}},mounted(){this.alertModal=kG.getOrCreateInstance(this.$el,{backdrop:`static`}),this.$el.addEventListener(`hidden.bs.modal`,this.hidden),this.alertModal.show(),this.autoClose&&(this.timeout=setTimeout(()=>{this.close()},this.autoClose))},beforeUnmount(){clearTimeout(this.timeout),this.alertModal.hide(),this.$el.removeEventListener(`hidden.bs.modal`,this.hidden),this.alertModal.dispose()},methods:{hidden(){this.$root.alert.type=null,this.$root.alert.autoClose=!1,this.$root.alert.message=``,this.$root.alert.confirmationProceed=null,this.$root.alert.confirmationCancel=null,this.anotherModalOpened&&document.body.classList.add(`modal-open`)},close(){clearTimeout(this.timeout),this.alertModal.hide()},confirm(){this.confirmationProceed(),this.close()},cancel(){this.confirmationCancel&&this.confirmationCancel(),this.close()}}},v1={class:`modal`,id:`alertModal`,tabindex:`-1`,role:`dialog`,"aria-labelledby":`alertModalLabel`,"aria-hidden":`true`},y1={class:`modal-dialog`,role:`document`},b1={class:`modal-content`},x1={class:`modal-body`},S1={class:`m-0 py-4`,id:`alertModalLabel`},C1={class:`modal-footer justify-content-start flex-row-reverse`};function w1(e,t,n,r,i,a){return L(),R(`div`,v1,[z(`div`,y1,[z(`div`,b1,[z(`div`,x1,[z(`p`,S1,N(n.message),1)]),z(`div`,C1,[n.type==`error`?(L(),R(`button`,{key:0,class:`btn btn-primary`,onClick:t[0]||=(...e)=>a.close&&a.close(...e)},`Close`)):V(``,!0),n.type==`success`?(L(),R(`button`,{key:1,class:`btn btn-primary`,onClick:t[1]||=(...e)=>a.close&&a.close(...e)},`Okay`)):V(``,!0),n.type==`confirmation`?(L(),R(`button`,{key:2,class:`btn btn-danger`,onClick:t[2]||=(...e)=>a.confirm&&a.confirm(...e)},`Yes`)):V(``,!0),n.type==`confirmation`?(L(),R(`button`,{key:3,class:`btn`,onClick:t[3]||=(...e)=>a.cancel&&a.cancel(...e)},`Cancel`)):V(``,!0)])])])])}var T1=xD(_1,[[`render`,w1]]),E1=s(((e,t)=>{t.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r{var n=E1(),r={"text/plain":`Text`,"text/html":`Url`,default:`Text`},i=`Copy to clipboard: #{key}, Enter`;function a(e){var t=(/mac os x/i.test(navigator.userAgent)?`⌘`:`Ctrl`)+`+C`;return e.replace(/#{\s*key\s*}/g,t)}function o(e,t){var o,s,c,l,u,d,f=!1;t||={},o=t.debug||!1;try{if(c=n(),l=document.createRange(),u=document.getSelection(),d=document.createElement(`span`),d.textContent=e,d.ariaHidden=`true`,d.style.all=`unset`,d.style.position=`fixed`,d.style.top=0,d.style.clip=`rect(0, 0, 0, 0)`,d.style.whiteSpace=`pre`,d.style.webkitUserSelect=`text`,d.style.MozUserSelect=`text`,d.style.msUserSelect=`text`,d.style.userSelect=`text`,d.addEventListener(`copy`,function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),n.clipboardData===void 0){o&&console.warn(`unable to use e.clipboardData`),o&&console.warn(`trying IE specific stuff`),window.clipboardData.clearData();var i=r[t.format]||r.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),l.selectNodeContents(d),u.addRange(l),!document.execCommand(`copy`))throw Error(`copy command was unsuccessful`);f=!0}catch(n){o&&console.error(`unable to copy using execCommand: `,n),o&&console.warn(`trying IE specific stuff`);try{window.clipboardData.setData(t.format||`text`,e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(n){o&&console.error(`unable to copy using clipboardData: `,n),o&&console.error(`falling back to prompt`),s=a(`message`in t?t.message:i),window.prompt(s,e)}}finally{u&&(typeof u.removeRange==`function`?u.removeRange(l):u.removeAllRanges()),d&&document.body.removeChild(d),c()}return f}t.exports=o}))()),O1={props:[`data`],data(){return{copying:!1}},methods:{handleCopy(){(0,D1.default)(this.copyText)&&(this.copying=!0,setTimeout(()=>this.copying=!1,1e3))}},computed:{copyText(){return typeof this.data==`string`?this.data:JSON.stringify(this.data,null,` `)}}},k1={class:`position-relative`},A1={class:`copy-to-clipboard`},j1={key:0,style:{color:`#ffffff`}},M1={fill:`currentColor`,viewBox:`0 0 20 20`,style:{width:`1.25rem`,height:`1.25rem`}},N1={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,style:{width:`1.25rem`,height:`1.25rem`}};function P1(e,t,n,r,i,a){return L(),R(`div`,k1,[z(`div`,A1,[i.copying?(L(),R(`span`,j1,[(L(),R(`svg`,M1,[...t[1]||=[z(`path`,{d:`M9 2a1 1 0 000 2h2a1 1 0 100-2H9z`},null,-1),z(`path`,{"fill-rule":`evenodd`,d:`M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`},null,-1)]]))])):(L(),R(`a`,{key:1,href:`#`,onClick:t[0]||=H((...e)=>a.handleCopy&&a.handleCopy(...e),[`prevent`])},[(L(),R(`svg`,N1,[...t[2]||=[z(`path`,{d:`M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z`},null,-1),z(`path`,{d:`M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z`},null,-1)]]))]))]),Va(e.$slots,`default`)])}var F1=xD(O1,[[`render`,P1]]),I1=`telescopeAutoLoadsNewEntries`,L1=document.head.querySelector(`meta[name="csrf-token"]`);L1&&(bD.defaults.headers.common[`X-CSRF-TOKEN`]=L1.content),wC.default.tz.setDefault(Telescope.timezone);var R1=Zu({data(){return{alert:{type:null,autoClose:0,message:``,confirmationProceed:null,confirmationCancel:null},autoLoadsNewEntries:localStorage[I1]===`1`,recording:Telescope.recording,recordingPending:!1}},created(){window.addEventListener(`keydown`,this.keydownListener)},beforeUnmount(){window.removeEventListener(`keydown`,this.keydownListener)},methods:{autoLoadNewEntries(){this.autoLoadsNewEntries=!this.autoLoadsNewEntries,localStorage[I1]=Number(this.autoLoadsNewEntries)},toggleRecording(){if(!this.recordingPending)return this.recordingPending=!0,bD.post(Telescope.basePath+`/telescope-api/toggle-recording`).then(()=>{this.recording=!this.recording}).catch(()=>{this.alertError(`Telescope could not confirm the recording change. Reload the page to see the current status.`)}).finally(()=>{this.recordingPending=!1})},clearEntries(e=!0){if(!e||confirm(`Are you sure you want to delete all Telescope data?`))return bD.delete(Telescope.basePath+`/telescope-api/entries`).then(()=>location.reload()).catch(()=>this.alertError(`Telescope could not confirm that entries were cleared. Reload the page to check.`))},keydownListener(e){e.metaKey&&e.key===`k`&&this.clearEntries(!1)}}});window.Telescope.basePath=`/`+window.Telescope.path;var z1=window.Telescope.basePath+`/`;(window.Telescope.path===``||window.Telescope.path===`/`)&&(z1=`/`,window.Telescope.basePath=``);var B1=PZ({history:$X(z1),routes:AY});R1.use(B1),R1.component(`vue-json-pretty`,lQ),R1.component(`related-entries`,k$),R1.component(`index-screen`,X$),R1.component(`preview-screen`,g1),R1.component(`alert`,T1),R1.component(`copy-clipboard`,F1),R1.mixin(TC),R1.mount(`#telescope`); \ No newline at end of file diff --git a/src/telescope/resources/js/components/IndexScreen.vue b/src/telescope/resources/js/components/IndexScreen.vue index a23925af21..9cf1103c8b 100644 --- a/src/telescope/resources/js/components/IndexScreen.vue +++ b/src/telescope/resources/js/components/IndexScreen.vue @@ -324,7 +324,7 @@ export default {