diff --git a/app/Livewire/Followers/Index.php b/app/Livewire/Followers/Index.php index b785dc08b..30f559669 100644 --- a/app/Livewire/Followers/Index.php +++ b/app/Livewire/Followers/Index.php @@ -5,14 +5,17 @@ namespace App\Livewire\Followers; use App\Models\User; +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\View\View; use Livewire\Attributes\Locked; use Livewire\Component; +use Livewire\WithoutUrlPagination; use Livewire\WithPagination; final class Index extends Component { - use WithPagination; + use WithoutUrlPagination, WithPagination; /** * The component's user ID. @@ -20,6 +23,11 @@ final class Index extends Component #[Locked] public int $userId; + /** + * Indicates if the modal is opened. + */ + public bool $isOpened = false; + /** * Renders the user's followers. */ @@ -29,7 +37,14 @@ public function render(): View return view('livewire.followers.index', [ 'user' => $user, - 'followers' => $user->followers()->orderBy('created_at', 'desc')->simplePaginate(10), + 'followers' => $this->isOpened ? $user->followers() + ->when(auth()->user()?->isNot($user), function (Builder|BelongsToMany $query): void { + $query->withExists([ + 'following as is_follower' => function (Builder $query): void { + $query->where('user_id', auth()->id()); + }, + ]); + })->orderBy('created_at', 'desc')->simplePaginate(10) : collect(), ]); } } diff --git a/app/Livewire/Following/Index.php b/app/Livewire/Following/Index.php index 7cfce27f3..a8b0aad38 100644 --- a/app/Livewire/Following/Index.php +++ b/app/Livewire/Following/Index.php @@ -5,14 +5,16 @@ namespace App\Livewire\Following; use App\Models\User; +use Illuminate\Database\Eloquent\Builder; use Illuminate\View\View; use Livewire\Attributes\Locked; use Livewire\Component; +use Livewire\WithoutUrlPagination; use Livewire\WithPagination; final class Index extends Component { - use WithPagination; + use WithoutUrlPagination, WithPagination; /** * The component's user ID. @@ -20,6 +22,11 @@ final class Index extends Component #[Locked] public int $userId; + /** + * Indicates if the modal is opened. + */ + public bool $isOpened = false; + /** * Renders the user's followers. */ @@ -29,7 +36,11 @@ public function render(): View return view('livewire.following.index', [ 'user' => $user, - 'following' => $user->following()->orderBy('created_at', 'desc')->simplePaginate(10), + 'following' => $this->isOpened ? $user->following()->withExists([ + 'following as is_follower' => function (Builder $query): void { + $query->where('user_id', auth()->id()); + }, + ])->orderBy('created_at', 'desc')->simplePaginate(10) : collect(), ]); } } diff --git a/app/Livewire/Questions/Edit.php b/app/Livewire/Questions/Edit.php index a8d14bfc7..00d5167f2 100644 --- a/app/Livewire/Questions/Edit.php +++ b/app/Livewire/Questions/Edit.php @@ -25,23 +25,35 @@ final class Edit extends Component */ public string $answer = ''; + /** + * Mount the component. + */ + public function mount(string $questionId): void + { + $this->questionId = $questionId; + $question = Question::findOrFail($questionId); + $rawAnswer = $question->getRawOriginal('answer'); + $this->answer = is_string($rawAnswer) ? $rawAnswer : ''; + } + /** * Updates the question with the given answer. */ public function update(Request $request): void { - $this->validate([ + $validated = $this->validate([ 'answer' => ['required', 'string', 'max:1000', new NoBlankCharacters], ]); $user = type($request->user())->as(User::class); $question = Question::query() - ->whereNull('answer') ->where('is_reported', false) ->where('is_ignored', false) ->find($this->questionId); + $originalAnswer = $question->answer ?? null; + if (is_null($question)) { $this->dispatch('notification.created', message: 'Sorry, something unexpected happened. Please try again.'); $this->redirectRoute('profile.show', ['username' => $user->username], navigate: true); @@ -49,16 +61,29 @@ public function update(Request $request): void return; } + if ($question->answered_at !== null && $question->answered_at->diffInHours(now()) > 24) { + $this->dispatch('notification.created', message: 'Answer cannot be edited after 24 hours.'); + + return; + } + $this->authorize('update', $question); - $question->update([ - 'answer' => $this->answer, - 'answered_at' => now(), - ]); + if ($originalAnswer === null) { + $validated['answered_at'] = now(); + } else { + $validated['answer_updated_at'] = now(); + } + + $question->update($validated); - $this->answer = ''; + if ($originalAnswer !== null) { + $question->likes()->delete(); + + $this->dispatch('close-modal', "question.edit.answer.{$question->id}"); + } - $this->dispatch('notification.created', message: 'Question answered.'); + $this->dispatch('notification.created', message: $originalAnswer === null ? 'Question answered.' : 'Answer updated.'); $this->dispatch('question.updated'); } diff --git a/app/Livewire/Questions/Index.php b/app/Livewire/Questions/Index.php index 0f340afae..c2f34fb6c 100644 --- a/app/Livewire/Questions/Index.php +++ b/app/Livewire/Questions/Index.php @@ -9,6 +9,7 @@ use App\Models\Question; use App\Models\User; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Http\Request; use Illuminate\View\View; use Livewire\Attributes\Locked; @@ -42,7 +43,7 @@ public function render(Request $request): View ->questionsReceived() ->where('is_ignored', false) ->where('is_reported', false) - ->when($user->isNot($request->user()), function (Builder $query, bool $_): void { // @phpstan-ignore-line + ->when($user->isNot($request->user()), function (Builder|HasMany $query): void { $query->whereNotNull('answer'); }) ->orderByDesc('pinned') diff --git a/app/Models/Question.php b/app/Models/Question.php index 098a62282..69786405e 100644 --- a/app/Models/Question.php +++ b/app/Models/Question.php @@ -25,6 +25,7 @@ * @property bool $anonymously * @property string|null $answer * @property Carbon|null $answered_at + * @property Carbon|null $answer_updated_at * @property bool $is_reported * @property bool $is_ignored * @property int $views @@ -84,6 +85,7 @@ public function casts(): array 'is_reported' => 'boolean', 'anonymously' => 'boolean', 'answered_at' => 'datetime', + 'answer_updated_at' => 'datetime', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'pinned' => 'bool', diff --git a/app/Services/ParsableContentProviders/MentionProviderParsable.php b/app/Services/ParsableContentProviders/MentionProviderParsable.php index 261992c1e..22ce5bd01 100644 --- a/app/Services/ParsableContentProviders/MentionProviderParsable.php +++ b/app/Services/ParsableContentProviders/MentionProviderParsable.php @@ -14,7 +14,7 @@ public function parse(string $content): string { return (string) preg_replace_callback( - '/(]*>.*?<\/a>)|@([^\s,.?!\/@<]+)/i', + '/(]*>.*?<\/a>)|@([a-z0-9_]+)/i', fn (array $matches): string => $matches[1] !== '' ? $matches[1] : '@'.$matches[2].'', diff --git a/composer.json b/composer.json index c3f58619c..492d3416f 100644 --- a/composer.json +++ b/composer.json @@ -3,13 +3,13 @@ "type": "project", "require": { "php": "^8.3", - "filament/filament": "^3.2.73", "laravel/fortify": "^1.21", - "intervention/image": "^3.6.3", - "laravel/framework": "dev-feat/exception-page as 11.5.0", - "laravel/pennant": "^1.7", - "laravel/pulse": "^1.0@beta", - "laravel/socialite": "^5.13.2", + "filament/filament": "^3.2.76", + "intervention/image": "^3.6.4", + "laravel/framework": "^11.7.0", + "laravel/pennant": "^1.7.1", + "laravel/pulse": "^1.1.0", + "laravel/socialite": "^5.14.0", "laravel/tinker": "^2.9.0", "livewire/livewire": "^3.4.12", "matomo/device-detector": "^6.3.1", @@ -21,7 +21,7 @@ "require-dev": { "barryvdh/laravel-debugbar": "^3.13.5", "fakerphp/faker": "^1.23.1", - "larastan/larastan": "^2.9.5", + "larastan/larastan": "^2.9.6", "laravel/pint": "^1.15.3", "laravel/sail": "^1.29.1", "mockery/mockery": "^1.6.11", @@ -29,7 +29,7 @@ "pestphp/pest": "^3.0.0", "pestphp/pest-plugin-laravel": "^3.0.0", "pestphp/pest-plugin-type-coverage": "^3.0.0", - "rector/rector": "^1.0.4" + "rector/rector": "^1.0.5" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index c1b22ecca..d78efe22b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "830181b849908c54e231452468c2e3bb", + "content-hash": "1a9a0375ddd95ee2a40907b1a4127a4a", "packages": [ { "name": "anourvalar/eloquent-serialize", @@ -458,16 +458,16 @@ }, { "name": "danharrin/livewire-rate-limiting", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/danharrin/livewire-rate-limiting.git", - "reference": "bf16003f0d977b5a41071526d697eec94ac41735" + "reference": "1a1b299e20de61f88ed6e94ea0bbcfc33aab1ddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/danharrin/livewire-rate-limiting/zipball/bf16003f0d977b5a41071526d697eec94ac41735", - "reference": "bf16003f0d977b5a41071526d697eec94ac41735", + "url": "https://api.github.com/repos/danharrin/livewire-rate-limiting/zipball/1a1b299e20de61f88ed6e94ea0bbcfc33aab1ddb", + "reference": "1a1b299e20de61f88ed6e94ea0bbcfc33aab1ddb", "shasum": "" }, "require": { @@ -508,7 +508,7 @@ "type": "github" } ], - "time": "2024-01-21T14:53:34+00:00" + "time": "2024-05-06T09:10:03+00:00" }, { "name": "dasprid/enum", @@ -1149,23 +1149,26 @@ }, { "name": "doctrine/sql-formatter", - "version": "1.2.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/sql-formatter.git", - "reference": "a321d114e0a18e6497f8a2cd6f890e000cc17ecc" + "reference": "d1ac84aef745c69ea034929eb6d65a6908b675cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/a321d114e0a18e6497f8a2cd6f890e000cc17ecc", - "reference": "a321d114e0a18e6497f8a2cd6f890e000cc17ecc", + "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/d1ac84aef745c69ea034929eb6d65a6908b675cc", + "reference": "d1ac84aef745c69ea034929eb6d65a6908b675cc", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4" + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.24" }, "bin": [ "bin/sql-formatter" @@ -1195,9 +1198,9 @@ ], "support": { "issues": "https://github.com/doctrine/sql-formatter/issues", - "source": "https://github.com/doctrine/sql-formatter/tree/1.2.0" + "source": "https://github.com/doctrine/sql-formatter/tree/1.4.0" }, - "time": "2023-08-16T21:49:04+00:00" + "time": "2024-05-08T08:12:09+00:00" }, { "name": "dragonmantank/cron-expression", @@ -1329,16 +1332,16 @@ }, { "name": "filament/actions", - "version": "v3.2.73", + "version": "v3.2.76", "source": { "type": "git", "url": "https://github.com/filamentphp/actions.git", - "reference": "2ff960d4b0ec9c852cbb101eb2fe886323f59a78" + "reference": "36292c4e811b1c90605ce207f1fbeb0452e5936c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/actions/zipball/2ff960d4b0ec9c852cbb101eb2fe886323f59a78", - "reference": "2ff960d4b0ec9c852cbb101eb2fe886323f59a78", + "url": "https://api.github.com/repos/filamentphp/actions/zipball/36292c4e811b1c90605ce207f1fbeb0452e5936c", + "reference": "36292c4e811b1c90605ce207f1fbeb0452e5936c", "shasum": "" }, "require": { @@ -1378,20 +1381,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-05-03T12:25:51+00:00" + "time": "2024-05-08T16:21:06+00:00" }, { "name": "filament/filament", - "version": "v3.2.73", + "version": "v3.2.76", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "be5a86ff4e6805910e43b055c1e67d2894ab47a7" + "reference": "80b4cfb0ab7e858aada7439e8f002e1f896f3d65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/be5a86ff4e6805910e43b055c1e67d2894ab47a7", - "reference": "be5a86ff4e6805910e43b055c1e67d2894ab47a7", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/80b4cfb0ab7e858aada7439e8f002e1f896f3d65", + "reference": "80b4cfb0ab7e858aada7439e8f002e1f896f3d65", "shasum": "" }, "require": { @@ -1443,20 +1446,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-05-03T12:25:56+00:00" + "time": "2024-05-08T16:21:17+00:00" }, { "name": "filament/forms", - "version": "v3.2.73", + "version": "v3.2.76", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "d747dd60968269e4529983906b5aa62737a825ca" + "reference": "ce53bc7fe494a2f5129d6bdeb707b0c1099226bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/d747dd60968269e4529983906b5aa62737a825ca", - "reference": "d747dd60968269e4529983906b5aa62737a825ca", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/ce53bc7fe494a2f5129d6bdeb707b0c1099226bb", + "reference": "ce53bc7fe494a2f5129d6bdeb707b0c1099226bb", "shasum": "" }, "require": { @@ -1499,20 +1502,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-05-03T12:25:52+00:00" + "time": "2024-05-09T08:34:11+00:00" }, { "name": "filament/infolists", - "version": "v3.2.73", + "version": "v3.2.76", "source": { "type": "git", "url": "https://github.com/filamentphp/infolists.git", - "reference": "612497be1c0e5b8b1e0ef9eeefe4754baab54271" + "reference": "377ae7abbe2199b512580543764a581d61f7cbfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/infolists/zipball/612497be1c0e5b8b1e0ef9eeefe4754baab54271", - "reference": "612497be1c0e5b8b1e0ef9eeefe4754baab54271", + "url": "https://api.github.com/repos/filamentphp/infolists/zipball/377ae7abbe2199b512580543764a581d61f7cbfd", + "reference": "377ae7abbe2199b512580543764a581d61f7cbfd", "shasum": "" }, "require": { @@ -1550,20 +1553,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-04-28T08:39:09+00:00" + "time": "2024-05-09T08:34:11+00:00" }, { "name": "filament/notifications", - "version": "v3.2.73", + "version": "v3.2.76", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", - "reference": "f06016bea87b8b688eeafbea19f24720062cd87e" + "reference": "646ed10673b03144ff8341a6c42bea04f6443b81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/notifications/zipball/f06016bea87b8b688eeafbea19f24720062cd87e", - "reference": "f06016bea87b8b688eeafbea19f24720062cd87e", + "url": "https://api.github.com/repos/filamentphp/notifications/zipball/646ed10673b03144ff8341a6c42bea04f6443b81", + "reference": "646ed10673b03144ff8341a6c42bea04f6443b81", "shasum": "" }, "require": { @@ -1602,20 +1605,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-05-03T12:25:54+00:00" + "time": "2024-05-08T16:21:24+00:00" }, { "name": "filament/support", - "version": "v3.2.73", + "version": "v3.2.76", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "49637c225f9eb72380a3dc54e9fd951563955770" + "reference": "2ed906a82070c07da5367ae71f52826698d17b9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/49637c225f9eb72380a3dc54e9fd951563955770", - "reference": "49637c225f9eb72380a3dc54e9fd951563955770", + "url": "https://api.github.com/repos/filamentphp/support/zipball/2ed906a82070c07da5367ae71f52826698d17b9e", + "reference": "2ed906a82070c07da5367ae71f52826698d17b9e", "shasum": "" }, "require": { @@ -1660,20 +1663,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-05-03T12:26:17+00:00" + "time": "2024-05-09T08:34:31+00:00" }, { "name": "filament/tables", - "version": "v3.2.73", + "version": "v3.2.76", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "773f0ff40f5a656432dbee41058087175c53813b" + "reference": "8d66675fdf45e246d11bdcf7eabb7bb6643fd6fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/773f0ff40f5a656432dbee41058087175c53813b", - "reference": "773f0ff40f5a656432dbee41058087175c53813b", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/8d66675fdf45e246d11bdcf7eabb7bb6643fd6fa", + "reference": "8d66675fdf45e246d11bdcf7eabb7bb6643fd6fa", "shasum": "" }, "require": { @@ -1713,20 +1716,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-05-03T12:26:18+00:00" + "time": "2024-05-08T16:21:32+00:00" }, { "name": "filament/widgets", - "version": "v3.2.73", + "version": "v3.2.76", "source": { "type": "git", "url": "https://github.com/filamentphp/widgets.git", - "reference": "0b7b774981725e8ef6786fdfccb1105bf794d2ba" + "reference": "65ec747c3eac23664a2bcbd6adb61babc0c41b51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/widgets/zipball/0b7b774981725e8ef6786fdfccb1105bf794d2ba", - "reference": "0b7b774981725e8ef6786fdfccb1105bf794d2ba", + "url": "https://api.github.com/repos/filamentphp/widgets/zipball/65ec747c3eac23664a2bcbd6adb61babc0c41b51", + "reference": "65ec747c3eac23664a2bcbd6adb61babc0c41b51", "shasum": "" }, "require": { @@ -1757,7 +1760,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-05-03T12:26:16+00:00" + "time": "2024-05-08T16:21:40+00:00" }, { "name": "firebase/php-jwt", @@ -2432,16 +2435,16 @@ }, { "name": "intervention/image", - "version": "3.6.3", + "version": "3.6.4", "source": { "type": "git", "url": "https://github.com/Intervention/image.git", - "reference": "2dbfb53bf8909257e710cf6091d10a9ca7500742" + "reference": "193324ec88bc5ad4039e57ce9b926ae28dfde813" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/2dbfb53bf8909257e710cf6091d10a9ca7500742", - "reference": "2dbfb53bf8909257e710cf6091d10a9ca7500742", + "url": "https://api.github.com/repos/Intervention/image/zipball/193324ec88bc5ad4039e57ce9b926ae28dfde813", + "reference": "193324ec88bc5ad4039e57ce9b926ae28dfde813", "shasum": "" }, "require": { @@ -2488,7 +2491,7 @@ ], "support": { "issues": "https://github.com/Intervention/image/issues", - "source": "https://github.com/Intervention/image/tree/3.6.3" + "source": "https://github.com/Intervention/image/tree/3.6.4" }, "funding": [ { @@ -2500,7 +2503,7 @@ "type": "github" } ], - "time": "2024-05-02T09:03:18+00:00" + "time": "2024-05-08T13:53:15+00:00" }, { "name": "kirschbaum-development/eloquent-power-joins", @@ -2631,16 +2634,16 @@ }, { "name": "laravel/framework", - "version": "dev-feat/exception-page", + "version": "v11.7.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "950cb58564d48a8c27347e3af004ccfa5eb07884" + "reference": "e5ac72f513f635f208024aa76b8a04efc1b47f93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/950cb58564d48a8c27347e3af004ccfa5eb07884", - "reference": "950cb58564d48a8c27347e3af004ccfa5eb07884", + "url": "https://api.github.com/repos/laravel/framework/zipball/e5ac72f513f635f208024aa76b8a04efc1b47f93", + "reference": "e5ac72f513f635f208024aa76b8a04efc1b47f93", "shasum": "" }, "require": { @@ -2832,20 +2835,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-05-01T23:05:20+00:00" + "time": "2024-05-07T13:41:51+00:00" }, { "name": "laravel/pennant", - "version": "v1.7.0", + "version": "v1.7.1", "source": { "type": "git", "url": "https://github.com/laravel/pennant.git", - "reference": "401e9051a3a600296c81c3733b52949c60750f02" + "reference": "251d9f28e00ebf39f59e25eada71a2641d8ae40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pennant/zipball/401e9051a3a600296c81c3733b52949c60750f02", - "reference": "401e9051a3a600296c81c3733b52949c60750f02", + "url": "https://api.github.com/repos/laravel/pennant/zipball/251d9f28e00ebf39f59e25eada71a2641d8ae40d", + "reference": "251d9f28e00ebf39f59e25eada71a2641d8ae40d", "shasum": "" }, "require": { @@ -2856,6 +2859,7 @@ "illuminate/queue": "^10.0|^11.0", "illuminate/support": "^10.0|^11.0", "php": "^8.1", + "symfony/console": "^6.0|^7.0", "symfony/finder": "^6.0|^7.0" }, "require-dev": { @@ -2908,7 +2912,7 @@ "issues": "https://github.com/laravel/pennant/issues", "source": "https://github.com/laravel/pennant" }, - "time": "2024-03-04T22:18:21+00:00" + "time": "2024-05-06T17:31:26+00:00" }, { "name": "laravel/prompts", @@ -2970,20 +2974,20 @@ }, { "name": "laravel/pulse", - "version": "v1.0.0", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/laravel/pulse.git", - "reference": "37fc7512d01de7e59b0ae9634c638849d98c3fca" + "reference": "16746346a6cb2cd12d9e93db206aaf2b9d792b21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pulse/zipball/37fc7512d01de7e59b0ae9634c638849d98c3fca", - "reference": "37fc7512d01de7e59b0ae9634c638849d98c3fca", + "url": "https://api.github.com/repos/laravel/pulse/zipball/16746346a6cb2cd12d9e93db206aaf2b9d792b21", + "reference": "16746346a6cb2cd12d9e93db206aaf2b9d792b21", "shasum": "" }, "require": { - "doctrine/sql-formatter": "^1.1", + "doctrine/sql-formatter": "^1.2", "guzzlehttp/promises": "^1.0|^2.0", "illuminate/auth": "^10.48.4|^11.0.8", "illuminate/cache": "^10.48.4|^11.0.8", @@ -3053,7 +3057,7 @@ "issues": "https://github.com/laravel/pulse/issues", "source": "https://github.com/laravel/pulse" }, - "time": "2024-04-30T14:43:29+00:00" + "time": "2024-05-06T17:11:35+00:00" }, { "name": "laravel/serializable-closure", @@ -3117,16 +3121,16 @@ }, { "name": "laravel/socialite", - "version": "v5.13.2", + "version": "v5.14.0", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "278d4615f68205722b3a129135774b3764b28a90" + "reference": "c7b0193a3753a29aff8ce80aa2f511917e6ed68a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/278d4615f68205722b3a129135774b3764b28a90", - "reference": "278d4615f68205722b3a129135774b3764b28a90", + "url": "https://api.github.com/repos/laravel/socialite/zipball/c7b0193a3753a29aff8ce80aa2f511917e6ed68a", + "reference": "c7b0193a3753a29aff8ce80aa2f511917e6ed68a", "shasum": "" }, "require": { @@ -3185,7 +3189,7 @@ "issues": "https://github.com/laravel/socialite/issues", "source": "https://github.com/laravel/socialite" }, - "time": "2024-04-26T13:48:16+00:00" + "time": "2024-05-03T20:31:38+00:00" }, { "name": "laravel/tinker", @@ -4754,16 +4758,16 @@ }, { "name": "openspout/openspout", - "version": "v4.23.0", + "version": "v4.24.0", "source": { "type": "git", "url": "https://github.com/openspout/openspout.git", - "reference": "28f6a0e45acc3377f34c26cc3866e21f0447e0c8" + "reference": "51f2a627d4cdcdb06eb451c6f434daeb190c4afb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/openspout/openspout/zipball/28f6a0e45acc3377f34c26cc3866e21f0447e0c8", - "reference": "28f6a0e45acc3377f34c26cc3866e21f0447e0c8", + "url": "https://api.github.com/repos/openspout/openspout/zipball/51f2a627d4cdcdb06eb451c6f434daeb190c4afb", + "reference": "51f2a627d4cdcdb06eb451c6f434daeb190c4afb", "shasum": "" }, "require": { @@ -4777,13 +4781,13 @@ }, "require-dev": { "ext-zlib": "*", - "friendsofphp/php-cs-fixer": "^3.46.0", - "infection/infection": "^0.27.9", + "friendsofphp/php-cs-fixer": "^3.56.0", + "infection/infection": "^0.28.1", "phpbench/phpbench": "^1.2.15", - "phpstan/phpstan": "^1.10.55", - "phpstan/phpstan-phpunit": "^1.3.15", - "phpstan/phpstan-strict-rules": "^1.5.2", - "phpunit/phpunit": "^10.5.5" + "phpstan/phpstan": "^1.10.67", + "phpstan/phpstan-phpunit": "^1.3.16", + "phpstan/phpstan-strict-rules": "^1.5.5", + "phpunit/phpunit": "^10.5.20" }, "suggest": { "ext-iconv": "To handle non UTF-8 CSV files (if \"php-mbstring\" is not already installed or is too limited)", @@ -4831,7 +4835,7 @@ ], "support": { "issues": "https://github.com/openspout/openspout/issues", - "source": "https://github.com/openspout/openspout/tree/v4.23.0" + "source": "https://github.com/openspout/openspout/tree/v4.24.0" }, "funding": [ { @@ -4843,20 +4847,20 @@ "type": "github" } ], - "time": "2024-01-09T09:30:37+00:00" + "time": "2024-05-10T09:06:16+00:00" }, { "name": "paragonie/constant_time_encoding", - "version": "v2.6.3", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "58c3f47f650c94ec05a151692652a868995d2938" + "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", - "reference": "58c3f47f650c94ec05a151692652a868995d2938", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/52a0d99e69f56b9ec27ace92ba56897fe6993105", + "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105", "shasum": "" }, "require": { @@ -4910,7 +4914,7 @@ "issues": "https://github.com/paragonie/constant_time_encoding/issues", "source": "https://github.com/paragonie/constant_time_encoding" }, - "time": "2022-06-14T06:56:20+00:00" + "time": "2024-05-08T12:18:48+00:00" }, { "name": "paragonie/random_compat", @@ -5526,20 +5530,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -5563,7 +5567,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -5575,9 +5579,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -9867,16 +9871,16 @@ }, { "name": "larastan/larastan", - "version": "v2.9.5", + "version": "v2.9.6", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "101f1a4470f87326f4d3995411d28679d8800abe" + "reference": "93d5b95d2e29cdb8203363d44abfdbc0bc7ef57f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/101f1a4470f87326f4d3995411d28679d8800abe", - "reference": "101f1a4470f87326f4d3995411d28679d8800abe", + "url": "https://api.github.com/repos/larastan/larastan/zipball/93d5b95d2e29cdb8203363d44abfdbc0bc7ef57f", + "reference": "93d5b95d2e29cdb8203363d44abfdbc0bc7ef57f", "shasum": "" }, "require": { @@ -9945,7 +9949,7 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.9.5" + "source": "https://github.com/larastan/larastan/tree/v2.9.6" }, "funding": [ { @@ -9965,7 +9969,7 @@ "type": "patreon" } ], - "time": "2024-04-16T19:13:34+00:00" + "time": "2024-05-09T11:53:26+00:00" }, { "name": "laravel/pint", @@ -10409,16 +10413,16 @@ "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "b611d0d4444d5d8c7700a503d15e26b224077f22" + "reference": "81693823620bcb1472aef627c9e7b84c2d797caa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/b611d0d4444d5d8c7700a503d15e26b224077f22", - "reference": "b611d0d4444d5d8c7700a503d15e26b224077f22", + "url": "https://api.github.com/repos/pestphp/pest/zipball/81693823620bcb1472aef627c9e7b84c2d797caa", + "reference": "81693823620bcb1472aef627c9e7b84c2d797caa", "shasum": "" }, "require": { - "brianium/paratest": "^7.4.3", + "brianium/paratest": "^7.4.4", "nunomaduro/collision": "^8.1.1", "nunomaduro/termwind": "^2.0.1", "pestphp/pest-plugin": "^3.0.0", @@ -10433,7 +10437,7 @@ "require-dev": { "pestphp/pest-dev-tools": "^3.0.0", "pestphp/pest-plugin-type-coverage": "^3.0.0", - "symfony/process": "^7.0.4" + "symfony/process": "^7.0.7" }, "bin": [ "bin/pest" @@ -10508,7 +10512,7 @@ "type": "github" } ], - "time": "2024-04-30T19:48:49+00:00" + "time": "2024-05-08T00:24:30+00:00" }, { "name": "pestphp/pest-plugin", @@ -11180,16 +11184,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.28.0", + "version": "1.29.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb" + "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", - "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/536889f2b340489d328f5ffb7b02bb6b183ddedc", + "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc", "shasum": "" }, "require": { @@ -11221,9 +11225,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.28.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.0" }, - "time": "2024-04-03T18:51:33+00:00" + "time": "2024-05-06T12:04:23+00:00" }, { "name": "phpstan/phpstan", @@ -11708,16 +11712,16 @@ }, { "name": "rector/rector", - "version": "1.0.4", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "6e04d0eb087aef707fa0c5686d33d6ff61f4a555" + "reference": "73eb63e4f9011dba6b7c66c3262543014e352f34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/6e04d0eb087aef707fa0c5686d33d6ff61f4a555", - "reference": "6e04d0eb087aef707fa0c5686d33d6ff61f4a555", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/73eb63e4f9011dba6b7c66c3262543014e352f34", + "reference": "73eb63e4f9011dba6b7c66c3262543014e352f34", "shasum": "" }, "require": { @@ -11755,7 +11759,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/1.0.4" + "source": "https://github.com/rectorphp/rector/tree/1.0.5" }, "funding": [ { @@ -11763,7 +11767,7 @@ "type": "github" } ], - "time": "2024-04-05T09:01:07+00:00" + "time": "2024-05-10T05:31:15+00:00" }, { "name": "sebastian/cli-parser", @@ -12926,19 +12930,9 @@ "time": "2024-04-26T13:56:40+00:00" } ], - "aliases": [ - { - "package": "laravel/framework", - "version": "dev-feat/exception-page", - "alias": "11.5.0", - "alias_normalized": "11.5.0.0" - } - ], + "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "laravel/framework": 20, - "laravel/pulse": 10 - }, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/config/livewire.php b/config/livewire.php new file mode 100644 index 000000000..ed595a745 --- /dev/null +++ b/config/livewire.php @@ -0,0 +1,162 @@ + 'App\\Livewire', + + /* + |--------------------------------------------------------------------------- + | View Path + |--------------------------------------------------------------------------- + | + | This value is used to specify where Livewire component Blade templates are + | stored when running file creation commands like `artisan make:livewire`. + | It is also used if you choose to omit a component's render() method. + | + */ + + 'view_path' => resource_path('views/livewire'), + + /* + |--------------------------------------------------------------------------- + | Layout + |--------------------------------------------------------------------------- + | The view that will be used as the layout when rendering a single component + | as an entire page via `Route::get('/post/create', CreatePost::class);`. + | In this case, the view returned by CreatePost will render into $slot. + | + */ + + 'layout' => 'components.layouts.app', + + /* + |--------------------------------------------------------------------------- + | Lazy Loading Placeholder + |--------------------------------------------------------------------------- + | Livewire allows you to lazy load components that would otherwise slow down + | the initial page load. Every component can have a custom placeholder or + | you can define the default placeholder view for all components below. + | + */ + + 'lazy_placeholder' => null, + + /* + |--------------------------------------------------------------------------- + | Temporary File Uploads + |--------------------------------------------------------------------------- + | + | Livewire handles file uploads by storing uploads in a temporary directory + | before the file is stored permanently. All file uploads are directed to + | a global endpoint for temporary storage. You may configure this below: + | + */ + + 'temporary_file_upload' => [ + 'disk' => null, // Example: 'local', 's3' | Default: 'default' + 'rules' => null, // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB) + 'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp' + 'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1' + 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs... + 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4', + 'mov', 'avi', 'wmv', 'mp3', 'm4a', + 'jpg', 'jpeg', 'mpga', 'webp', 'wma', + ], + 'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated... + 'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs... + ], + + /* + |--------------------------------------------------------------------------- + | Render On Redirect + |--------------------------------------------------------------------------- + | + | This value determines if Livewire will run a component's `render()` method + | after a redirect has been triggered using something like `redirect(...)` + | Setting this to true will render the view once more before redirecting + | + */ + + 'render_on_redirect' => false, + + /* + |--------------------------------------------------------------------------- + | Eloquent Model Binding + |--------------------------------------------------------------------------- + | + | Previous versions of Livewire supported binding directly to eloquent model + | properties using wire:model by default. However, this behavior has been + | deemed too "magical" and has therefore been put under a feature flag. + | + */ + + 'legacy_model_binding' => false, + + /* + |--------------------------------------------------------------------------- + | Auto-inject Frontend Assets + |--------------------------------------------------------------------------- + | + | By default, Livewire automatically injects its JavaScript and CSS into the + |
and of pages containing Livewire components. By disabling + | this behavior, you need to use @livewireStyles and @livewireScripts. + | + */ + + 'inject_assets' => true, + + /* + |--------------------------------------------------------------------------- + | Navigate (SPA mode) + |--------------------------------------------------------------------------- + | + | By adding `wire:navigate` to links in your Livewire application, Livewire + | will prevent the default link handling and instead request those pages + | via AJAX, creating an SPA-like effect. Configure this behavior here. + | + */ + + 'navigate' => [ + 'show_progress_bar' => true, + 'progress_bar_color' => '#db2777', + ], + + /* + |--------------------------------------------------------------------------- + | HTML Morph Markers + |--------------------------------------------------------------------------- + | + | Livewire intelligently "morphs" existing HTML into the newly rendered HTML + | after each update. To make this process more reliable, Livewire injects + | "markers" into the rendered Blade surrounding @if, @class & @foreach. + | + */ + + 'inject_morph_markers' => true, + + /* + |--------------------------------------------------------------------------- + | Pagination Theme + |--------------------------------------------------------------------------- + | + | When enabling Livewire's pagination feature by using the `WithPagination` + | trait, Livewire will use Tailwind templates to render pagination views + | on the page. If you want Bootstrap CSS, you can specify: "bootstrap" + | + */ + + 'pagination_theme' => 'tailwind', +]; diff --git a/config/pulse.php b/config/pulse.php index 64bf05590..ca4bceb56 100644 --- a/config/pulse.php +++ b/config/pulse.php @@ -166,7 +166,7 @@ Recorders\Servers::class => [ 'server_name' => env('PULSE_SERVER_NAME', gethostname()), - 'directories' => explode(':', (string) env('PULSE_SERVER_DIRECTORIES', '/')), // @phpstan-ignore-line + 'directories' => explode(':', type(env('PULSE_SERVER_DIRECTORIES', '/'))->asString()), ], Recorders\SlowJobs::class => [ diff --git a/config/sponsors.php b/config/sponsors.php index 70b090463..688cecae5 100644 --- a/config/sponsors.php +++ b/config/sponsors.php @@ -15,11 +15,11 @@ | */ - 'github_usernames' => collect(explode(',', (string) env('SPONSORS_GITHUB_USERNAMES', '')))->map( // @phpstan-ignore-line + 'github_usernames' => collect(explode(',', type(env('SPONSORS_GITHUB_USERNAMES', ''))->asString()))->map( fn (string $username): string => trim($username) )->filter()->values()->all(), - 'github_company_usernames' => collect(explode(',', (string) env('SPONSORS_GITHUB_COMPANY_USERNAMES', '')))->map( // @phpstan-ignore-line + 'github_company_usernames' => collect(explode(',', type(env('SPONSORS_GITHUB_COMPANY_USERNAMES', ''))->asString()))->map( fn (string $username): string => trim($username) )->filter()->values()->all(), ]; diff --git a/database/migrations/2024_05_11_141256_add_answer_updated_at_to_questions_table.php b/database/migrations/2024_05_11_141256_add_answer_updated_at_to_questions_table.php new file mode 100644 index 000000000..c2c1d75f6 --- /dev/null +++ b/database/migrations/2024_05_11_141256_add_answer_updated_at_to_questions_table.php @@ -0,0 +1,23 @@ +timestamp('answer_updated_at')->nullable()->after('answered_at'); + }); + + DB::statement('UPDATE questions SET answer_updated_at = updated_at WHERE answered_at < updated_at'); + } +}; diff --git a/public/js/filament/forms/components/markdown-editor.js b/public/js/filament/forms/components/markdown-editor.js index b484c762f..f42cab603 100644 --- a/public/js/filament/forms/components/markdown-editor.js +++ b/public/js/filament/forms/components/markdown-editor.js @@ -1,43 +1,43 @@ -var ss=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var Td=Object.getOwnPropertyNames;var Ld=Object.prototype.hasOwnProperty;var Cd=(o,p)=>()=>(o&&(p=o(o=0)),p);var Ke=(o,p)=>()=>(p||o((p={exports:{}}).exports,p),p.exports);var Ed=(o,p,v,C)=>{if(p&&typeof p=="object"||typeof p=="function")for(let b of Td(p))!Ld.call(o,b)&&b!==v&&ss(o,b,{get:()=>p[b],enumerable:!(C=Sd(p,b))||C.enumerable});return o};var zd=o=>Ed(ss({},"__esModule",{value:!0}),o);var We=Ke((Yo,Qo)=>{(function(o,p){typeof Yo=="object"&&typeof Qo<"u"?Qo.exports=p():typeof define=="function"&&define.amd?define(p):(o=o||self,o.CodeMirror=p())})(Yo,function(){"use strict";var o=navigator.userAgent,p=navigator.platform,v=/gecko\/\d/i.test(o),C=/MSIE \d/.test(o),b=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),T=/Edge\/(\d+)/.exec(o),s=C||b||T,h=s&&(C?document.documentMode||6:+(T||b)[1]),g=!T&&/WebKit\//.test(o),w=g&&/Qt\/\d+\.\d+/.test(o),S=!T&&/Chrome\/(\d+)/.exec(o),c=S&&+S[1],d=/Opera\//.test(o),k=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),z=/PhantomJS/.test(o),y=k&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),R=/Android/.test(o),M=y||R||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),H=y||/Mac/.test(p),Z=/\bCrOS\b/.test(o),ee=/win/i.test(p),re=d&&o.match(/Version\/(\d*\.\d*)/);re&&(re=Number(re[1])),re&&re>=15&&(d=!1,g=!0);var N=H&&(w||d&&(re==null||re<12.11)),F=v||s&&h>=9;function D(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Q=function(e,t){var n=e.className,r=D(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function j(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function V(e,t){return j(e).appendChild(t)}function x(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;ae.options.maxHighlightLength&&Vt(e.doc.mode,r.state),a=fa(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function wn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Jt(r,!0,t);var a=Tc(e,t,n),l=a>r.first&&Ae(r,a-1).stateAfter,u=l?Jt.fromSaved(r,l,a):new Jt(r,Gr(r.mode),a);return r.iter(a,t,function(f){ro(e,f.text,u);var m=u.line;f.stateAfter=m==t-1||m%5==0||m>=i.viewFrom&&m e.options.maxHighlightLength&&Vt(e.doc.mode,r.state),a=fa(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function wn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Jt(r,!0,t);var a=Tc(e,t,n),l=a>r.first&&Ae(r,a-1).stateAfter,u=l?Jt.fromSaved(r,l,a):new Jt(r,Gr(r.mode),a);return r.iter(a,t,function(f){ro(e,f.text,u);var m=u.line;f.stateAfter=m==t-1||m%5==0||m>=i.viewFrom&&m