From 4b39d708d2acf1c9e98f13a82749bec1c3f626a0 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sun, 11 May 2025 02:33:22 +0700 Subject: [PATCH] refactor isSeedBox judgement --- app/Console/Commands/Test.php | 6 +- app/Console/Kernel.php | 2 + app/Enums/SeedBoxRecord/IpAsnEnum.php | 10 + app/Enums/SeedBoxRecord/IsAllowedEnum.php | 9 + app/Enums/SeedBoxRecord/TypeEnum.php | 10 + .../System/SeedBoxRecordResource.php | 4 +- .../Pages/ListSeedBoxRecords.php | 50 +- .../UpdateIsSeedBoxFromUserRecordsCache.php | 39 ++ app/Models/SeedBoxRecord.php | 42 ++ app/Providers/Filament/AppPanelProvider.php | 2 +- app/Repositories/SeedBoxRepository.php | 212 ++++++++- app/Repositories/UserRepository.php | 3 + config/horizon.php | 6 +- ...10_add_index_to_seed_box_records_table.php | 28 ++ include/cleanup.php | 5 +- include/constants.php | 2 +- include/functions.php | 2 +- include/globalfunctions.php | 9 + public/announce.php | 4 +- public/usercp.php | 18 +- public/vendor/livewire/livewire.esm.js | 446 +++++++++++++----- public/vendor/livewire/livewire.esm.js.map | 6 +- public/vendor/livewire/livewire.js | 312 ++++++++++-- public/vendor/livewire/livewire.min.js | 12 +- public/vendor/livewire/livewire.min.js.map | 6 +- public/vendor/livewire/manifest.json | 2 +- resources/lang/en/label.php | 2 +- resources/lang/en/seed-box.php | 2 +- resources/lang/zh_CN/label.php | 4 +- resources/lang/zh_CN/seed-box.php | 4 +- resources/lang/zh_TW/label.php | 2 +- resources/lang/zh_TW/seed-box.php | 2 +- 32 files changed, 1030 insertions(+), 233 deletions(-) create mode 100644 app/Enums/SeedBoxRecord/IpAsnEnum.php create mode 100644 app/Enums/SeedBoxRecord/IsAllowedEnum.php create mode 100644 app/Enums/SeedBoxRecord/TypeEnum.php create mode 100644 app/Jobs/UpdateIsSeedBoxFromUserRecordsCache.php create mode 100644 database/migrations/2025_05_09_215710_add_index_to_seed_box_records_table.php diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 03783499..0c1df113 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -9,6 +9,7 @@ use App\Models\PersonalAccessToken; use App\Models\Torrent; use App\Models\User; use App\Repositories\ExamRepository; +use App\Repositories\SeedBoxRepository; use App\Repositories\UploadRepository; use Illuminate\Console\Command; use NexusPlugin\Menu\Filament\MenuItemResource\Pages\ManageMenuItems; @@ -55,9 +56,8 @@ class Test extends Command */ public function handle() { - $rep = new MenuRepository(); - $result = \Nexus\Plugin\Plugin::listEnabled(); - dd($result); + $rep = new SeedBoxRepository(); + $rep->updateCacheCronjob(); } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 9b782b1e..606ff49a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -6,6 +6,7 @@ use App\Jobs\CheckCleanup; use App\Jobs\CheckQueueFailedJobs; use App\Jobs\MaintainPluginState; use App\Jobs\ManagePlugin; +use App\Jobs\UpdateIsSeedBoxFromUserRecordsCache; use App\Utils\ThirdPartyJob; use Carbon\Carbon; use Illuminate\Console\Scheduling\Event; @@ -48,6 +49,7 @@ class Kernel extends ConsoleKernel $schedule->job(new CheckQueueFailedJobs())->everySixHours()->withoutOverlapping(); $schedule->job(new ThirdPartyJob())->everyMinute()->withoutOverlapping(); $schedule->job(new MaintainPluginState())->everyMinute()->withoutOverlapping(); + $schedule->job(new UpdateIsSeedBoxFromUserRecordsCache())->everySixHours()->withoutOverlapping(); $this->registerScheduleCleanup($schedule); } diff --git a/app/Enums/SeedBoxRecord/IpAsnEnum.php b/app/Enums/SeedBoxRecord/IpAsnEnum.php new file mode 100644 index 00000000..644df177 --- /dev/null +++ b/app/Enums/SeedBoxRecord/IpAsnEnum.php @@ -0,0 +1,10 @@ +label(__('label.seed_box_record.operator')), Forms\Components\TextInput::make('bandwidth')->label(__('label.seed_box_record.bandwidth'))->integer(), Forms\Components\TextInput::make('asn')->label(__('label.seed_box_record.asn'))->integer(), - Forms\Components\TextInput::make('ip_begin')->label(__('label.seed_box_record.ip_begin')), - Forms\Components\TextInput::make('ip_end')->label(__('label.seed_box_record.ip_end')), +// Forms\Components\TextInput::make('ip_begin')->label(__('label.seed_box_record.ip_begin')), +// Forms\Components\TextInput::make('ip_end')->label(__('label.seed_box_record.ip_end')), Forms\Components\TextInput::make('ip')->label(__('label.seed_box_record.ip'))->helperText(__('label.seed_box_record.ip_help')), Forms\Components\Toggle::make('is_allowed') ->label(__('label.seed_box_record.is_allowed')) diff --git a/app/Filament/Resources/System/SeedBoxRecordResource/Pages/ListSeedBoxRecords.php b/app/Filament/Resources/System/SeedBoxRecordResource/Pages/ListSeedBoxRecords.php index 56bd8524..e709a9b8 100644 --- a/app/Filament/Resources/System/SeedBoxRecordResource/Pages/ListSeedBoxRecords.php +++ b/app/Filament/Resources/System/SeedBoxRecordResource/Pages/ListSeedBoxRecords.php @@ -2,16 +2,19 @@ namespace App\Filament\Resources\System\SeedBoxRecordResource\Pages; -use App\Exceptions\SeedBoxYesException; use App\Filament\PageList; use App\Filament\Resources\System\SeedBoxRecordResource; -use Filament\Pages\Actions; +use App\Repositories\SeedBoxRepository; +use Filament\Actions; use Filament\Forms; +use Illuminate\Support\HtmlString; class ListSeedBoxRecords extends PageList { protected static string $resource = SeedBoxRecordResource::class; + protected static ?array $checkResult = null; + protected function getHeaderActions(): array { return [ @@ -23,17 +26,40 @@ class ListSeedBoxRecords extends PageList Forms\Components\TextInput::make('uid')->required()->label('UID'), ]) ->modalHeading(__('admin.resources.seed_box_record.check_modal_header')) - ->action(function ($data) { - try { - isIPSeedBox($data['ip'], $data['uid'], true, true); - send_admin_success_notification(nexus_trans("seed-box.is_seed_box_no")); - } catch (SeedBoxYesException $exception) { - send_admin_fail_notification(nexus_trans("seed-box.is_seed_box_yes", ['id' => $exception->getId()])); - } catch (\Throwable $throwable) { - do_log($throwable->getMessage() . $throwable->getTraceAsString(), "error"); - send_admin_fail_notification($throwable->getMessage()); - } + ->action(function (array $data) { + $result = SeedBoxRepository::isSeedBoxFromUserRecords($data['uid'], $data['ip']); + self::$checkResult = $result; +// return $result; +// $this->replaceMountedAction("checkResult", ['result' => $result]); +// if ($checkResult['result']) { +// send_admin_success_notification(nexus_trans("seed-box.is_seed_box_yes", ['desc' => $checkResult['desc']])); +// } else { +// send_admin_fail_notification(nexus_trans("seed-box.is_seed_box_no", ['desc' => $checkResult['desc']])); +// } }) + ->registerModalActions([ + Actions\Action::make('checkResult') + ->modalHeading(function () { + if (self::$checkResult !== null) { + if (self::$checkResult['result']) { + return nexus_trans("seed-box.is_seed_box_yes"); + } else { + return nexus_trans("seed-box.is_seed_box_no"); + } + } + return 'Unknown'; + }) + ->action(null) + ->modalSubmitAction(false) + ->modalCancelAction(false) + ->modalDescription(fn () => new HtmlString(self::$checkResult['desc'] ?? '')) +// ->modalContent(fn () => new HtmlString(self::$checkResult['desc'] ?? '')) + ]) + ->after(function() { + $this->mountAction("checkResult"); + }) + , ]; } + } diff --git a/app/Jobs/UpdateIsSeedBoxFromUserRecordsCache.php b/app/Jobs/UpdateIsSeedBoxFromUserRecordsCache.php new file mode 100644 index 00000000..9db04c64 --- /dev/null +++ b/app/Jobs/UpdateIsSeedBoxFromUserRecordsCache.php @@ -0,0 +1,39 @@ +updateUserCacheCronjob($isAllowed, $field); + do_log("SeedBoxRepository::updateUserCacheCronjob isAllowed: $isAllowed->name, field: $field->name success"); + $rep->updateAdminCacheCronjob($isAllowed, $field); + do_log("SeedBoxRepository::updateAdminCacheCronjob isAllowed: $isAllowed->name, field: $field->name success"); + } + } + do_log("UpdateIsSeedBoxFromUserRecordsCache done!"); + } +} diff --git a/app/Models/SeedBoxRecord.php b/app/Models/SeedBoxRecord.php index 811912c3..0e899a06 100644 --- a/app/Models/SeedBoxRecord.php +++ b/app/Models/SeedBoxRecord.php @@ -2,7 +2,12 @@ namespace App\Models; +use App\Enums\SeedBoxRecord\IpAsnEnum; +use App\Enums\SeedBoxRecord\IsAllowedEnum; +use App\Enums\SeedBoxRecord\TypeEnum; +use App\Repositories\SeedBoxRepository; use Illuminate\Database\Eloquent\Casts\Attribute; +use Nexus\Database\NexusDB; class SeedBoxRecord extends NexusModel { @@ -30,6 +35,43 @@ class SeedBoxRecord extends NexusModel self::STATUS_DENIED => ['text' => 'Denied'], ]; + protected static function booted(): void + { + static::saved(function (SeedBoxRecord $model) { + self::updateCache($model); + }); + static::deleted(function (SeedBoxRecord $model) { + self::updateCache($model); + }); + } + + private static function updateCache(SeedBoxRecord $model): void + { + SeedBoxRepository::updateCache( + $model->type == TypeEnum::ADMIN->value ? 0 : $model->uid, + TypeEnum::from($model->type), + IsAllowedEnum::from($model->is_allowed), + !empty($model->ip) ? IpAsnEnum::IP : IpAsnEnum::ASN, + ); + } + + public static function getValidQuery(TypeEnum $type, IsAllowedEnum $isAllowed, IpAsnEnum $field) + { + $query = self::query() + ->where('status', self::STATUS_ALLOWED) + ->where('type', $type->value) + ->where('is_allowed', $isAllowed->value) + ; + if ($field == IpAsnEnum::IP) { + $query->whereNotNull("ip"); + } elseif ($field == IpAsnEnum::ASN) { + $query->where("asn", ">", 0); + } else { + throw new \InvalidArgumentException("Invalid ipOrAsn"); + } + return $query; + } + protected function typeText(): Attribute { return new Attribute( diff --git a/app/Providers/Filament/AppPanelProvider.php b/app/Providers/Filament/AppPanelProvider.php index 466c3136..95c63bf7 100644 --- a/app/Providers/Filament/AppPanelProvider.php +++ b/app/Providers/Filament/AppPanelProvider.php @@ -80,7 +80,7 @@ class AppPanelProvider extends PanelProvider ]) ->navigationItems([ NavigationItem::make('Horizon') - ->label(nexus_trans('admin.sidebar.queue_monitor', [], Auth::user() ? get_langfolder_cookie(true) : 'en')) + ->label(fn () => nexus_trans('admin.sidebar.queue_monitor', [], Auth::user() ? get_langfolder_cookie(true) : 'en')) ->icon('heroicon-o-presentation-chart-line') ->group('System') ->sort(99) diff --git a/app/Repositories/SeedBoxRepository.php b/app/Repositories/SeedBoxRepository.php index 12258688..2cc88499 100644 --- a/app/Repositories/SeedBoxRepository.php +++ b/app/Repositories/SeedBoxRepository.php @@ -1,22 +1,30 @@ formatParams($params); $seedBoxRecord = SeedBoxRecord::query()->create($params); - $this->clearCache(); + $this->clearApprovalCountCache(); publish_model_event("seed_box_record_created", $seedBoxRecord->id); return $seedBoxRecord; } @@ -102,7 +110,7 @@ class SeedBoxRepository extends BaseRepository $model = SeedBoxRecord::query()->findOrFail($id); $params = $this->formatParams($params); $model->update($params); - $this->clearCache(); + $this->clearApprovalCountCache(); publish_model_event("seed_box_record_updated", $id); return $model; } @@ -115,7 +123,7 @@ class SeedBoxRepository extends BaseRepository public function delete($id, $uid) { - $this->clearCache(); + $this->clearApprovalCountCache(); publish_model_event("seed_box_record_deleted", $id); return SeedBoxRecord::query()->whereIn('id', Arr::wrap($id))->where('uid', $uid)->delete(); } @@ -146,7 +154,7 @@ class SeedBoxRepository extends BaseRepository return NexusDB::transaction(function () use ($seedBoxRecord, $status, $message) { $seedBoxRecord->status = $status; $seedBoxRecord->save(); - $this->clearCache(); + $this->clearApprovalCountCache(); return Message::add($message); }); } @@ -173,12 +181,194 @@ class SeedBoxRepository extends BaseRepository return ''; } - private function clearCache() + private function clearApprovalCountCache(): void { - NexusDB::cache_del('SEED_BOX_RECORD_APPROVAL_NONE'); -// SeedBoxRecordUpdated::dispatch(); + NexusDB::cache_del(self::APPROVAL_COUNT_CACHE_KEY); + } + + public function updateUserCacheCronjob(IsAllowedEnum $isAllowed, IpAsnEnum $field): void + { + $size = 1000; + $page = 1; + $logPrefix = "isAllowed: $isAllowed->name, field: $field->name, page: $page, size: $size"; + $selectRaw = sprintf("uid, group_concat(%s) as str", $field == IpAsnEnum::ASN ? 'asn' : 'ip'); + while (true) { + $list = SeedBoxRecord::getValidQuery(TypeEnum::USER, $isAllowed, $field) + ->selectRaw($selectRaw) + ->groupBy('uid') + ->forPage($page, $size) + ->get(); + if ($list->isEmpty()) { + do_log("$logPrefix, no more data ..."); + break; + } + foreach ($list as $record) { + $uid = $record->uid; + $str = $record->str; + do_log("$logPrefix, handling user: $uid with $field->name: $str"); + self::updateCache($record->uid, TypeEnum::USER, $isAllowed, $field, $str); + do_log("$logPrefix, handling user: $uid with $field->name: $str done!"); + } + $page++; + } + do_log("$logPrefix, all done!"); + } + + public function updateAdminCacheCronjob(IsAllowedEnum $isAllowed, IpAsnEnum $field): void + { + $size = 1000; + $page = 1; + $logPrefix = "isAllowed: $isAllowed->name, field: $field->name, page: $page, size: $size"; + $fieldName = $field == IpAsnEnum::ASN ? 'asn' : 'ip'; + while (true) { + $list = SeedBoxRecord::getValidQuery(TypeEnum::ADMIN, $isAllowed, $field) + ->selectRaw($fieldName) + ->forPage($page, $size) + ->get(); + if ($list->isEmpty()) { + do_log("$logPrefix, no more data ..."); + break; + } + self::updateCache(0, TypeEnum::ADMIN, $isAllowed, $field, $list->pluck($fieldName)->join(",")); + $page++; + } + do_log("$logPrefix, all done!"); + } + + public static function updateCache(int $userId, TypeEnum $type, IsAllowedEnum $isAllowed, IpAsnEnum $field, string $ipOrAsnStr = null): void + { + if (!is_null($ipOrAsnStr)) { + $list = explode(',', $ipOrAsnStr); + } else { + $query = SeedBoxRecord::getValidQuery($type, $isAllowed, $field); + if ($userId > 0) { + $query->where('uid', $userId); + } + if ($field == IpAsnEnum::IP) { + $list = $query->pluck('ip')->toArray(); + } else { + $list = $query->pluck('asn')->toArray(); + } + } + $list = array_filter($list); + $key = self::getCacheKey($userId, $isAllowed, $field); + do_log("userId: $userId, type: $type->name, isAllowed: $isAllowed->name, ipOrAsn: $field->name, key: $key, list: " . json_encode($list)); + NexusDB::cache_del($key); + if (!empty($list)) { + NexusDB::redis()->sadd($key, ...$list); + NexusDB::redis()->expireAt($key, time() + 86400 * 30); + } + } + + public static function isSeedBoxFromUserRecords(int $userId, string $ip): array + { + $logPrefix = "userId: $userId, ip: $ip"; + $redis = NexusDB::redis(); + //first check from asn field + $asn = self::getAsnFromIp($ip); + $uidArr = [0, $userId]; + if ($asn > 0) { + //check if allowed by asn + $logPrefix .= ", asn: $asn"; + foreach($uidArr as $uid) { + $key = self::getCacheKey($uid, IsAllowedEnum::YES, IpAsnEnum::ASN); + if ($redis->sismember($key, $asn)) { + $desc = "$logPrefix, asn $asn in allowed $key, result: false"; + return self::buildCheckResult(false, $desc); + } + } + foreach($uidArr as $uid) { + $key = self::getCacheKey($uid, IsAllowedEnum::NO, IpAsnEnum::ASN); + if ($redis->sismember($key, $asn)) { + $desc = ("$logPrefix, asn $asn in $key, result: true"); + return self::buildCheckResult(true, $desc); + } + } + } + //then check from ip field + foreach($uidArr as $uid) { + $key = self::getCacheKey($uid, IsAllowedEnum::YES, IpAsnEnum::IP); + if ($redis->sismember($key, $ip)) { + $desc = ("$logPrefix, ip $ip in allowed $key, result: false"); + return self::buildCheckResult(false, $desc); + } + } + foreach($uidArr as $uid) { + $key = self::getCacheKey($uid, IsAllowedEnum::NO, IpAsnEnum::IP); + if ($redis->sismember($key, $ip)) { + $desc = ("$logPrefix, ip $ip in $key, result: true"); + return self::buildCheckResult(true, $desc); + } + } + return self::buildCheckResult(false, "not match any record, result: false"); + } + + private static function buildCheckResult(bool $isSeedBox, string $desc): array + { + $result = [ + 'result' => $isSeedBox, + 'desc' => $desc, + ]; + do_log(json_encode($result)); + return $result; + } + + public static function getAsnFromIp(string $ip): int + { + //虽然 ip 对应的 asn 相对固定,但不宜设置较大的缓存时间,IP 地址较多,容易引起内存膨胀 + return NexusDB::remember("IP_TO_ASN:$ip", 3600, function () use ($ip) { + $reader = self::getAsnReader(); + if (is_null($reader)) { + return 0; + } + $asnObj = $reader->asn($ip); + return $asnObj->autonomousSystemNumber ?? 0; + }); + } + + /** + * IS_SEED_BOX_FROM_USER_RECORD:IP:INCLUDES:USER:10001 + * IS_SEED_BOX_FROM_USER_RECORD:IP:EXCLUDES:USER:10001 + * IS_SEED_BOX_FROM_USER_RECORD:ASN:INCLUDES:USER:10001 + * IS_SEED_BOX_FROM_USER_RECORD:ASN:EXCLUDES:USER:10001 + * IS_SEED_BOX_FROM_USER_RECORD:ASN:EXCLUDES:ADMIN + * + * @param int $userId + * @param int $isAllowed + * @param string $field + * @return string + */ + private static function getCacheKey(int $userId, IsAllowedEnum $isAllowed, IpAsnEnum $field): string + { + $key = sprintf( + "%s:%s:%s", + self::IS_SEED_BOX_FROM_USER_RECORD_CACHE_PREFIX, + $field->name, + $isAllowed == IsAllowedEnum::YES ? "EXCLUDES" : "INCLUDES", //允许,要排队它不是 seedBox + ); + if ($userId > 0) { + $key .= ":USER:$userId"; + } else { + $key .= ":ADMIN"; + } + return $key; + } + + /** + * @throws InvalidDatabaseException + */ + private static function getAsnReader(): ?Reader + { + if (is_null(self::$asnReader)) { + $database = nexus_env('GEOIP2_ASN_DATABASE'); + if (!file_exists($database) || !is_readable($database)) { + do_log("GEOIP2_ASN_DATABASE: $database not exists or not readable", "debug"); + return null; + } + self::$asnReader = new Reader($database); + } + return self::$asnReader; } - } diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index b804d8f9..78429a71 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -681,6 +681,9 @@ class UserRepository extends BaseRepository 'login_logs' => 'uid', 'oauth_access_tokens' => 'user_id', 'oauth_auth_codes' => 'user_id', + 'seed_box_records' => 'uid', + 'user_modify_logs' => 'user_id', + 'messages' => 'receiver', ]; foreach ($tables as $table => $key) { NexusDB::statement(sprintf("delete from `%s` where `%s` in (%s)", $table, $key, $uidStr)); diff --git a/config/horizon.php b/config/horizon.php index d1d8ba47..79deeb05 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -100,9 +100,9 @@ return [ */ 'trim' => [ - 'recent' => 60, - 'pending' => 60, - 'completed' => 60, + 'recent' => 60 * 72, + 'pending' => 60 * 72, + 'completed' => 60 * 72, 'recent_failed' => 10080, 'failed' => 10080, 'monitored' => 10080, diff --git a/database/migrations/2025_05_09_215710_add_index_to_seed_box_records_table.php b/database/migrations/2025_05_09_215710_add_index_to_seed_box_records_table.php new file mode 100644 index 00000000..2a572122 --- /dev/null +++ b/database/migrations/2025_05_09_215710_add_index_to_seed_box_records_table.php @@ -0,0 +1,28 @@ +index('uid'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('seed_box_records', function (Blueprint $table) { + // + }); + } +}; diff --git a/include/cleanup.php b/include/cleanup.php index a75f34a4..8dd56659 100644 --- a/include/cleanup.php +++ b/include/cleanup.php @@ -78,9 +78,8 @@ function peasant_to_user($down_floor_gb, $down_roof_gb, $minratio){ while ($arr = mysql_fetch_assoc($res)) { $locale = get_user_locale($arr['id']); - $subject = nexus_trans("cleanup.msg_low_ratio_warning_removed", [], $locale); - $msg = nexus_trans("cleanup.msg_your_ratio_warning_removed", [], $locale); - + $subject = sqlesc(nexus_trans("cleanup.msg_low_ratio_warning_removed", [], $locale)); + $msg = sqlesc(nexus_trans("cleanup.msg_your_ratio_warning_removed", [], $locale)); writecomment($arr['id'],"Leech Warning removed by System."); sql_query("UPDATE users SET class = 1, leechwarn = 'no', leechwarnuntil = null WHERE id = {$arr['id']}") or sqlerr(__FILE__, __LINE__); sql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES(0, {$arr['id']}, $dt, $subject, $msg)") or sqlerr(__FILE__, __LINE__); diff --git a/include/constants.php b/include/constants.php index 89da4701..4f331c3e 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ = \App\Models\User::CLASS_ADMINISTRATOR && get_setting('seed_box.enabled') == 'yes') { - $cacheKey = 'SEED_BOX_RECORD_APPROVAL_NONE'; + $cacheKey = \App\Repositories\SeedBoxRepository::APPROVAL_COUNT_CACHE_KEY; $toApprovalCounts = $Cache->get_value($cacheKey); if ($toApprovalCounts === false) { $toApprovalCounts = get_row_count('seed_box_records', 'where status = 0'); diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 59b55e05..76821e6d 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -915,6 +915,15 @@ function isIPSeedBoxFromASN($ip, $exceptionWhenYes = false): bool return $result; } +/** + * @deprecated + * @param $ip + * @param $uid + * @param $withoutCache + * @param $exceptionWhenYes + * @return bool + * @throws \App\Exceptions\SeedBoxYesException + */ function isIPSeedBox($ip, $uid, $withoutCache = false, $exceptionWhenYes = false): bool { $key = "nexus_is_ip_seed_box:ip:$ip:uid:$uid"; diff --git a/public/announce.php b/public/announce.php index 1c1a75a8..56b43d05 100644 --- a/public/announce.php +++ b/public/announce.php @@ -337,10 +337,10 @@ $isSeedBoxRuleEnabled = get_setting('seed_box.enabled') == 'yes'; $isIPSeedBox = false; if ($isSeedBoxRuleEnabled) { if (!empty($ipv4)) { - $isIPSeedBox = isIPSeedBox($ipv4, $userid); + $isIPSeedBox = \App\Repositories\SeedBoxRepository::isSeedBoxFromUserRecords($userid, $ipv4)['result']; } if (!$isIPSeedBox && !empty($ipv6)) { - $isIPSeedBox = isIPSeedBox($ipv6, $userid); + $isIPSeedBox = \App\Repositories\SeedBoxRepository::isSeedBoxFromUserRecords($userid, $ipv6)['result']; } } $log .= ", [SEED_BOX], isSeedBoxRuleEnabled: $isSeedBoxRuleEnabled, isIPSeedBox: $isIPSeedBox"; diff --git a/public/usercp.php b/public/usercp.php index e28979b1..bd2bb519 100644 --- a/public/usercp.php +++ b/public/usercp.php @@ -1007,8 +1007,8 @@ if (get_setting('seed_box.enabled') == 'yes') { $seedBox = ''; $columnOperator = nexus_trans('label.seed_box_record.operator'); $columnBandwidth = nexus_trans('label.seed_box_record.bandwidth'); - $columnIPBegin = nexus_trans('label.seed_box_record.ip_begin'); - $columnIPEnd = nexus_trans('label.seed_box_record.ip_end'); +// $columnIPBegin = nexus_trans('label.seed_box_record.ip_begin'); +// $columnIPEnd = nexus_trans('label.seed_box_record.ip_end'); $columnIP = nexus_trans('label.seed_box_record.ip'); $columnIPHelp = nexus_trans('label.seed_box_record.ip_help'); $columnComment = nexus_trans('label.comment'); @@ -1068,14 +1068,6 @@ CSS;
{$columnBandwidth}
-
-
{$columnIPBegin}
-
-
-
-
{$columnIPEnd}
-
-
{$columnIP}
{$columnIPHelp}
@@ -1097,8 +1089,9 @@ jQuery('#add-seed-box-btn').on('click', function () { btnAlign: 'c', yes: function () { let params = jQuery('#seed-box-form').serialize() + jQuery('body').loading({stoppable: false}); jQuery.post('ajax.php', params + "&action=addSeedBoxRecord", function (response) { - console.log(response) + jQuery('body').loading('stop'); if (response.ret != 0) { layer.alert(response.msg) return @@ -1111,8 +1104,9 @@ jQuery('#add-seed-box-btn').on('click', function () { jQuery('#seed-box-table').on('click', '.remove-seed-box-btn', function () { let params = {action: "removeSeedBoxRecord", params: {id: jQuery(this).attr("data-id")}} layer.confirm("{$lang_functions['std_confirm_remove']}", window.nexusLayerOptions.confirm, function (index) { + jQuery('body').loading({stoppable: false}); jQuery.post('ajax.php', params, function (response) { - console.log(response) + jQuery('body').loading('stop'); if (response.ret != 0) { layer.alert(response.msg, window.nexusLayerOptions.alert) return diff --git a/public/vendor/livewire/livewire.esm.js b/public/vendor/livewire/livewire.esm.js index 2d7ef479..e45b0459 100644 --- a/public/vendor/livewire/livewire.esm.js +++ b/public/vendor/livewire/livewire.esm.js @@ -1483,7 +1483,7 @@ var require_module_cjs = __commonJS({ deferredMutations = deferredMutations.concat(mutations); return; } - let addedNodes = /* @__PURE__ */ new Set(); + let addedNodes = []; let removedNodes = /* @__PURE__ */ new Set(); let addedAttributes = /* @__PURE__ */ new Map(); let removedAttributes = /* @__PURE__ */ new Map(); @@ -1491,8 +1491,24 @@ var require_module_cjs = __commonJS({ if (mutations[i].target._x_ignoreMutationObserver) continue; if (mutations[i].type === "childList") { - mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.add(node)); - mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.add(node)); + mutations[i].removedNodes.forEach((node) => { + if (node.nodeType !== 1) + return; + if (!node._x_marker) + return; + removedNodes.add(node); + }); + mutations[i].addedNodes.forEach((node) => { + if (node.nodeType !== 1) + return; + if (removedNodes.has(node)) { + removedNodes.delete(node); + return; + } + if (node._x_marker) + return; + addedNodes.push(node); + }); } if (mutations[i].type === "attributes") { let el = mutations[i].target; @@ -1525,29 +1541,15 @@ var require_module_cjs = __commonJS({ onAttributeAddeds.forEach((i) => i(el, attrs)); }); for (let node of removedNodes) { - if (addedNodes.has(node)) + if (addedNodes.some((i) => i.contains(node))) continue; onElRemoveds.forEach((i) => i(node)); } - addedNodes.forEach((node) => { - node._x_ignoreSelf = true; - node._x_ignore = true; - }); for (let node of addedNodes) { - if (removedNodes.has(node)) - continue; if (!node.isConnected) continue; - delete node._x_ignoreSelf; - delete node._x_ignore; onElAddeds.forEach((i) => i(node)); - node._x_ignore = true; - node._x_ignoreSelf = true; } - addedNodes.forEach((node) => { - delete node._x_ignoreSelf; - delete node._x_ignore; - }); addedNodes = null; removedNodes = null; addedAttributes = null; @@ -2050,13 +2052,20 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); function interceptInit(callback) { initInterceptors2.push(callback); } + var markerDispenser = 1; function initTree(el, walker = walk, intercept = () => { }) { + if (findClosest(el, (i) => i._x_ignore)) + return; deferHandlingDirectives(() => { walker(el, (el2, skip) => { + if (el2._x_marker) + return; intercept(el2, skip); initInterceptors2.forEach((i) => i(el2, skip)); directives(el2, el2.attributes).forEach((handle) => handle()); + if (!el2._x_ignore) + el2._x_marker = markerDispenser++; el2._x_ignore && skip(); }); }); @@ -2065,6 +2074,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); walker(root, (el) => { cleanupElement(el); cleanupAttributes(el); + delete el._x_marker; }); } function warnAboutMissingPlugins() { @@ -2853,7 +2863,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); }); return obj; } - var Alpine19 = { + var Alpine23 = { get reactive() { return reactive; }, @@ -2866,7 +2876,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); get raw() { return raw; }, - version: "3.14.3", + version: "3.14.9", flushAndStopDeferringMutations, dontAutoEvaluateFunctions, disableEffectScheduling, @@ -2919,7 +2929,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); data, bind: bind2 }; - var alpine_default = Alpine19; + var alpine_default = Alpine23; var import_reactivity10 = __toESM2(require_reactivity()); magic("nextTick", () => nextTick); magic("dispatch", (el) => dispatch3.bind(dispatch3, el)); @@ -3066,7 +3076,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); placeInDom(clone2, target, modifiers); skipDuringClone(() => { initTree(clone2); - clone2._x_ignore = true; })(); }); el._x_teleportPutBack = () => { @@ -3822,9 +3831,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); } }); -// ../../../../usr/local/lib/node_modules/@alpinejs/collapse/dist/module.cjs.js +// ../alpine/packages/collapse/dist/module.cjs.js var require_module_cjs2 = __commonJS({ - "../../../../usr/local/lib/node_modules/@alpinejs/collapse/dist/module.cjs.js"(exports, module) { + "../alpine/packages/collapse/dist/module.cjs.js"(exports, module) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -3848,8 +3857,8 @@ var require_module_cjs2 = __commonJS({ default: () => module_default }); module.exports = __toCommonJS(module_exports); - function src_default(Alpine19) { - Alpine19.directive("collapse", collapse3); + function src_default(Alpine23) { + Alpine23.directive("collapse", collapse3); collapse3.inline = (el, { modifiers }) => { if (!modifiers.includes("min")) return; @@ -3869,7 +3878,7 @@ var require_module_cjs2 = __commonJS({ if (!el._x_isShown) el.style.overflow = "hidden"; let setFunction = (el2, styles) => { - let revertFunction = Alpine19.setStyles(el2, styles); + let revertFunction = Alpine23.setStyles(el2, styles); return styles.height ? () => { } : revertFunction; }; @@ -3892,12 +3901,12 @@ var require_module_cjs2 = __commonJS({ if (current === full) { current = floor; } - Alpine19.transition(el, Alpine19.setStyles, { + Alpine23.transition(el, Alpine23.setStyles, { during: transitionStyles, start: { height: current + "px" }, end: { height: full + "px" } }, () => el._x_isShown = true, () => { - if (el.getBoundingClientRect().height == full) { + if (Math.abs(el.getBoundingClientRect().height - full) < 1) { el.style.overflow = null; } }); @@ -3906,7 +3915,7 @@ var require_module_cjs2 = __commonJS({ }, after = () => { }) { let full = el.getBoundingClientRect().height; - Alpine19.transition(el, setFunction, { + Alpine23.transition(el, setFunction, { during: transitionStyles, start: { height: full + "px" }, end: { height: floor + "px" } @@ -3943,9 +3952,9 @@ var require_module_cjs2 = __commonJS({ } }); -// ../../../../usr/local/lib/node_modules/@alpinejs/focus/dist/module.cjs.js +// ../alpine/packages/focus/dist/module.cjs.js var require_module_cjs3 = __commonJS({ - "../../../../usr/local/lib/node_modules/@alpinejs/focus/dist/module.cjs.js"(exports, module) { + "../alpine/packages/focus/dist/module.cjs.js"(exports, module) { var __create2 = Object.create; var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; @@ -4742,14 +4751,14 @@ var require_module_cjs3 = __commonJS({ module.exports = __toCommonJS(module_exports); var import_focus_trap = __toESM2(require_focus_trap()); var import_tabbable = __toESM2(require_dist()); - function src_default(Alpine19) { + function src_default(Alpine23) { let lastFocused; let currentFocused; window.addEventListener("focusin", () => { lastFocused = currentFocused; currentFocused = document.activeElement; }); - Alpine19.magic("focus", (el) => { + Alpine23.magic("focus", (el) => { let within = el; return { __noscroll: false, @@ -4853,7 +4862,7 @@ var require_module_cjs3 = __commonJS({ } }; }); - Alpine19.directive("trap", Alpine19.skipDuringClone((el, { expression, modifiers }, { effect, evaluateLater, cleanup }) => { + Alpine23.directive("trap", Alpine23.skipDuringClone((el, { expression, modifiers }, { effect, evaluateLater, cleanup }) => { let evaluator = evaluateLater(expression); let oldValue = false; let options = { @@ -4945,9 +4954,9 @@ var require_module_cjs3 = __commonJS({ } }); -// ../../../../usr/local/lib/node_modules/@alpinejs/persist/dist/module.cjs.js +// ../alpine/packages/persist/dist/module.cjs.js var require_module_cjs4 = __commonJS({ - "../../../../usr/local/lib/node_modules/@alpinejs/persist/dist/module.cjs.js"(exports, module) { + "../alpine/packages/persist/dist/module.cjs.js"(exports, module) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -4971,7 +4980,7 @@ var require_module_cjs4 = __commonJS({ persist: () => src_default }); module.exports = __toCommonJS(module_exports); - function src_default(Alpine19) { + function src_default(Alpine23) { let persist3 = () => { let alias; let storage; @@ -4986,11 +4995,11 @@ var require_module_cjs4 = __commonJS({ setItem: dummy.set.bind(dummy) }; } - return Alpine19.interceptor((initialValue, getter, setter, path, key) => { + return Alpine23.interceptor((initialValue, getter, setter, path, key) => { let lookup = alias || `_x_${path}`; let initial = storageHas(lookup, storage) ? storageGet(lookup, storage) : initialValue; setter(initial); - Alpine19.effect(() => { + Alpine23.effect(() => { let value = getter(); storageSet(lookup, value, storage); setter(value); @@ -5006,12 +5015,12 @@ var require_module_cjs4 = __commonJS({ }; }); }; - Object.defineProperty(Alpine19, "$persist", { get: () => persist3() }); - Alpine19.magic("persist", persist3); - Alpine19.persist = (key, { get, set }, storage = localStorage) => { + Object.defineProperty(Alpine23, "$persist", { get: () => persist3() }); + Alpine23.magic("persist", persist3); + Alpine23.persist = (key, { get, set }, storage = localStorage) => { let initial = storageHas(key, storage) ? storageGet(key, storage) : get(); set(initial); - Alpine19.effect(() => { + Alpine23.effect(() => { let value = get(); storageSet(key, value, storage); set(value); @@ -5034,9 +5043,9 @@ var require_module_cjs4 = __commonJS({ } }); -// ../../../../usr/local/lib/node_modules/@alpinejs/intersect/dist/module.cjs.js +// ../alpine/packages/intersect/dist/module.cjs.js var require_module_cjs5 = __commonJS({ - "../../../../usr/local/lib/node_modules/@alpinejs/intersect/dist/module.cjs.js"(exports, module) { + "../alpine/packages/intersect/dist/module.cjs.js"(exports, module) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -5060,8 +5069,8 @@ var require_module_cjs5 = __commonJS({ intersect: () => src_default }); module.exports = __toCommonJS(module_exports); - function src_default(Alpine19) { - Alpine19.directive("intersect", Alpine19.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => { + function src_default(Alpine23) { + Alpine23.directive("intersect", Alpine23.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => { let evaluate = evaluateLater(expression); let options = { rootMargin: getRootMargin(modifiers), @@ -5142,8 +5151,8 @@ var require_module_cjs6 = __commonJS({ resize: () => src_default }); module.exports = __toCommonJS(module_exports); - function src_default(Alpine19) { - Alpine19.directive("resize", Alpine19.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => { + function src_default(Alpine23) { + Alpine23.directive("resize", Alpine23.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => { let evaluator = evaluateLater(expression); let evaluate = (width, height) => { evaluator(() => { @@ -6387,20 +6396,20 @@ var require_module_cjs7 = __commonJS({ platform: platformWithCache }); }; - function src_default(Alpine19) { - Alpine19.magic("anchor", (el) => { + function src_default(Alpine23) { + Alpine23.magic("anchor", (el) => { if (!el._x_anchor) throw "Alpine: No x-anchor directive found on element using $anchor..."; return el._x_anchor; }); - Alpine19.interceptClone((from, to) => { + Alpine23.interceptClone((from, to) => { if (from && from._x_anchor && !to._x_anchor) { to._x_anchor = from._x_anchor; } }); - Alpine19.directive("anchor", Alpine19.skipDuringClone((el, { expression, modifiers, value }, { cleanup, evaluate: evaluate2 }) => { + Alpine23.directive("anchor", Alpine23.skipDuringClone((el, { expression, modifiers, value }, { cleanup, evaluate: evaluate2 }) => { let { placement, offsetValue, unstyled } = getOptions(modifiers); - el._x_anchor = Alpine19.reactive({ x: 0, y: 0 }); + el._x_anchor = Alpine23.reactive({ x: 0, y: 0 }); let reference = evaluate2(expression); if (!reference) throw "Alpine: no element provided to x-anchor..."; @@ -6775,7 +6784,8 @@ var require_module_cjs8 = __commonJS({ return swapElements(from2, to); } let updateChildrenOnly = false; - if (shouldSkip(updating, from2, to, () => updateChildrenOnly = true)) + let skipChildren = false; + if (shouldSkipChildren(updating, () => skipChildren = true, from2, to, () => updateChildrenOnly = true)) return; if (from2.nodeType === 1 && window.Alpine) { window.Alpine.cloneNode(from2, to); @@ -6792,7 +6802,9 @@ var require_module_cjs8 = __commonJS({ patchAttributes(from2, to); } updated(from2, to); - patchChildren(from2, to); + if (!skipChildren) { + patchChildren(from2, to); + } } function differentElementNamesTypesOrKeys(from2, to) { return from2.nodeType != to.nodeType || from2.nodeName != to.nodeName || getKey(from2) != getKey(to); @@ -6852,6 +6864,7 @@ var require_module_cjs8 = __commonJS({ let holdover = fromKeyHoldovers[toKey]; from2.appendChild(holdover); currentFrom = holdover; + fromKey = getKey(currentFrom); } else { if (!shouldSkip(adding, currentTo)) { let clone = currentTo.cloneNode(true); @@ -6925,6 +6938,7 @@ var require_module_cjs8 = __commonJS({ if (fromKeys[toKey]) { currentFrom.replaceWith(fromKeys[toKey]); currentFrom = fromKeys[toKey]; + fromKey = getKey(currentFrom); } } if (toKey && fromKey) { @@ -6933,6 +6947,7 @@ var require_module_cjs8 = __commonJS({ fromKeyHoldovers[fromKey] = currentFrom; currentFrom.replaceWith(fromKeyNode); currentFrom = fromKeyNode; + fromKey = getKey(currentFrom); } else { fromKeyHoldovers[fromKey] = currentFrom; currentFrom = addNodeBefore(from2, currentTo, currentFrom); @@ -7003,6 +7018,11 @@ var require_module_cjs8 = __commonJS({ hook(...args, () => skip = true); return skip; } + function shouldSkipChildren(hook, skipChildren, ...args) { + let skip = false; + hook(...args, () => skip = true, skipChildren); + return skip; + } var patched = false; function createElement(html) { const template = document.createElement("template"); @@ -7078,19 +7098,21 @@ var require_module_cjs8 = __commonJS({ let fromId = from && from._x_bindings && from._x_bindings.id; if (!fromId) return; + if (!to.setAttribute) + return; to.setAttribute("id", fromId); to.id = fromId; } - function src_default(Alpine19) { - Alpine19.morph = morph3; + function src_default(Alpine23) { + Alpine23.morph = morph3; } var module_default = src_default; } }); -// ../../../../usr/local/lib/node_modules/@alpinejs/mask/dist/module.cjs.js +// ../alpine/packages/mask/dist/module.cjs.js var require_module_cjs9 = __commonJS({ - "../../../../usr/local/lib/node_modules/@alpinejs/mask/dist/module.cjs.js"(exports, module) { + "../alpine/packages/mask/dist/module.cjs.js"(exports, module) { var __defProp2 = Object.defineProperty; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; var __getOwnPropNames2 = Object.getOwnPropertyNames; @@ -7115,8 +7137,8 @@ var require_module_cjs9 = __commonJS({ stripDown: () => stripDown }); module.exports = __toCommonJS(module_exports); - function src_default(Alpine19) { - Alpine19.directive("mask", (el, { value, expression }, { effect, evaluateLater, cleanup }) => { + function src_default(Alpine23) { + Alpine23.directive("mask", (el, { value, expression }, { effect, evaluateLater, cleanup }) => { let templateFn = () => expression; let lastInputValue = ""; queueMicrotask(() => { @@ -7125,7 +7147,7 @@ var require_module_cjs9 = __commonJS({ effect(() => { templateFn = (input) => { let result; - Alpine19.dontAutoEvaluateFunctions(() => { + Alpine23.dontAutoEvaluateFunctions(() => { evaluator((value2) => { result = typeof value2 === "function" ? value2(input) : value2; }, { scope: { @@ -7140,8 +7162,13 @@ var require_module_cjs9 = __commonJS({ } else { processInputValue(el, false); } - if (el._x_model) + if (el._x_model) { + if (el._x_model.get() === el.value) + return; + if (el._x_model.get() === null && el.value === "") + return; el._x_model.set(el.value); + } }); const controller = new AbortController(); cleanup(() => { @@ -7356,9 +7383,7 @@ function dataGet(object, key) { if (key === "") return object; return key.split(".").reduce((carry, i) => { - if (carry === void 0) - return void 0; - return carry[i]; + return carry?.[i]; }, object); } function dataSet(object, key, value) { @@ -7485,6 +7510,9 @@ function handleFileUpload(el, property, component, cleanup) { if (value === null || value === "") { el.value = ""; } + if (el.multiple && Array.isArray(value) && value.length === 0) { + el.value = ""; + } }); let clearFileInputValue = () => { el.value = null; @@ -8168,9 +8196,11 @@ var aliases = { "on": "$on", "el": "$el", "id": "$id", + "js": "$js", "get": "$get", "set": "$set", "call": "$call", + "hook": "$hook", "commit": "$commit", "watch": "$watch", "entangle": "$entangle", @@ -8238,6 +8268,14 @@ wireProperty("$el", (component) => { wireProperty("$id", (component) => { return component.id; }); +wireProperty("$js", (component) => { + let fn = component.addJsAction.bind(component); + let jsActions = component.getJsActions(); + Object.keys(jsActions).forEach((name) => { + fn[name] = component.getJsAction(name); + }); + return fn; +}); wireProperty("$set", (component) => async (property, value, live = true) => { dataSet(component.reactive, property, value); if (live) { @@ -8265,6 +8303,16 @@ wireProperty("$watch", (component) => (path, callback) => { wireProperty("$refresh", (component) => component.$wire.$commit); wireProperty("$commit", (component) => async () => await requestCommit(component)); wireProperty("$on", (component) => (...params) => listen2(component, ...params)); +wireProperty("$hook", (component) => (name, callback) => { + let unhook = on(name, ({ component: hookComponent, ...params }) => { + if (hookComponent === void 0) + return callback(params); + if (hookComponent.id === component.id) + return callback({ component: hookComponent, ...params }); + }); + component.addCleanup(unhook); + return unhook; +}); wireProperty("$dispatch", (component) => (...params) => dispatch2(component, ...params)); wireProperty("$dispatchSelf", (component) => (...params) => dispatchSelf(component, ...params)); wireProperty("$dispatchTo", () => (...params) => dispatchTo(...params)); @@ -8323,6 +8371,7 @@ var Component = class { this.ephemeral = extractData(deepClone(this.snapshot.data)); this.reactive = Alpine.reactive(this.ephemeral); this.queuedUpdates = {}; + this.jsActions = {}; this.$wire = generateWireObject(this, this.reactive); this.cleanups = []; this.processEffects(this.effects); @@ -8398,6 +8447,18 @@ var Component = class { } el.setAttribute("wire:effects", JSON.stringify(effects)); } + addJsAction(name, action) { + this.jsActions[name] = action; + } + hasJsAction(name) { + return this.jsActions[name] !== void 0; + } + getJsAction(name) { + return this.jsActions[name].bind(this.$wire); + } + getJsActions() { + return this.jsActions; + } addCleanup(cleanup) { this.cleanups.push(cleanup); } @@ -8524,6 +8585,16 @@ function directive(name, callback) { } }); } +function globalDirective(name, callback) { + if (customDirectiveNames.has(name)) + return; + customDirectiveNames.add(name); + on("directive.global.init", ({ el, directive: directive2, cleanup }) => { + if (directive2.value === name) { + callback({ el, directive: directive2, cleanup }); + } + }); +} function getDirectives(el) { return new DirectiveManager(el); } @@ -9019,6 +9090,8 @@ function injectStyles() { // js/plugins/navigate/popover.js function packUpPersistedPopovers(persistedEl) { + if (!isPopoverSupported()) + return; persistedEl.querySelectorAll(":popover-open").forEach((el) => { el.setAttribute("data-navigate-popover-open", ""); let animations = el.getAnimations(); @@ -9037,6 +9110,8 @@ function packUpPersistedPopovers(persistedEl) { }); } function unPackPersistedPopovers(persistedEl) { + if (!isPopoverSupported()) + return; persistedEl.querySelectorAll("[data-navigate-popover-open]").forEach((el) => { el.removeAttribute("data-navigate-popover-open"); queueMicrotask(() => { @@ -9054,6 +9129,9 @@ function unPackPersistedPopovers(persistedEl) { }); }); } +function isPopoverSupported() { + return typeof document.createElement("div").showPopover === "function"; +} // js/plugins/navigate/page.js var oldBodyScriptTagHashes = []; @@ -9063,6 +9141,7 @@ var attributesExemptFromScriptTagHashing = [ ]; function swapCurrentPageWithNewHtml(html, andThen) { let newDocument = new DOMParser().parseFromString(html, "text/html"); + let newHtml = newDocument.documentElement; let newBody = document.adoptNode(newDocument.body); let newHead = document.adoptNode(newDocument.head); oldBodyScriptTagHashes = oldBodyScriptTagHashes.concat(Array.from(document.body.querySelectorAll("script")).map((i) => { @@ -9070,6 +9149,7 @@ function swapCurrentPageWithNewHtml(html, andThen) { })); let afterRemoteScriptsHaveLoaded = () => { }; + replaceHtmlAttributes(newHtml); mergeNewHead(newHead).finally(() => { afterRemoteScriptsHaveLoaded(); }); @@ -9089,6 +9169,21 @@ function prepNewBodyScriptTagsToRun(newBody, oldBodyScriptTagHashes2) { i.replaceWith(cloneScriptTag(i)); }); } +function replaceHtmlAttributes(newHtmlElement) { + let currentHtmlElement = document.documentElement; + Array.from(newHtmlElement.attributes).forEach((attr) => { + const name = attr.name; + const value = attr.value; + if (currentHtmlElement.getAttribute(name) !== value) { + currentHtmlElement.setAttribute(name, value); + } + }); + Array.from(currentHtmlElement.attributes).forEach((attr) => { + if (!newHtmlElement.hasAttribute(attr.name)) { + currentHtmlElement.removeAttribute(attr.name); + } + }); +} function mergeNewHead(newHead) { let children = Array.from(document.head.children); let headChildrenHtmlLookup = children.map((i) => i.outerHTML); @@ -9122,6 +9217,8 @@ function mergeNewHead(newHead) { child.remove(); } for (let child of Array.from(newHead.children)) { + if (child.tagName.toLowerCase() === "noscript") + continue; document.head.appendChild(child); } return Promise.all(remoteScriptsPromises); @@ -9190,8 +9287,8 @@ var enablePersist = true; var showProgressBar = true; var restoreScroll = true; var autofocus = false; -function navigate_default(Alpine19) { - Alpine19.navigate = (url) => { +function navigate_default(Alpine23) { + Alpine23.navigate = (url) => { let destination = createUrlObjectFromString(url); let prevented = fireEventForOtherLibrariesToHookInto("alpine:navigate", { url: destination, @@ -9202,11 +9299,11 @@ function navigate_default(Alpine19) { return; navigateTo(destination); }; - Alpine19.navigate.disableProgressBar = () => { + Alpine23.navigate.disableProgressBar = () => { showProgressBar = false; }; - Alpine19.addInitSelector(() => `[${Alpine19.prefixed("navigate")}]`); - Alpine19.directive("navigate", (el, { modifiers }) => { + Alpine23.addInitSelector(() => `[${Alpine23.prefixed("navigate")}]`); + Alpine23.directive("navigate", (el, { modifiers }) => { let shouldPrefetchOnHover = modifiers.includes("hover"); shouldPrefetchOnHover && whenThisLinkIsHoveredFor(el, 60, () => { let destination = extractDestinationFromLink(el); @@ -9243,7 +9340,7 @@ function navigate_default(Alpine19) { showProgressBar && finishAndHideProgressBar(); cleanupAlpineElementsOnThePageThatArentInsideAPersistedElement(); updateCurrentPageHtmlInHistoryStateForLaterBackButtonClicks(); - preventAlpineFromPickingUpDomChanges(Alpine19, (andAfterAllThis) => { + preventAlpineFromPickingUpDomChanges(Alpine23, (andAfterAllThis) => { enablePersist && storePersistantElementsForLater((persistedEl) => { packUpPersistedTeleports(persistedEl); packUpPersistedPopovers(persistedEl); @@ -9265,7 +9362,7 @@ function navigate_default(Alpine19) { setTimeout(() => { autofocus && autofocusElementsWithTheAutofocusAttribute(); }); - nowInitializeAlpineOnTheNewPage(Alpine19); + nowInitializeAlpineOnTheNewPage(Alpine23); fireEventForOtherLibrariesToHookInto("alpine:navigated"); }); }); @@ -9298,7 +9395,7 @@ function navigate_default(Alpine19) { storeScrollInformationInHtmlBeforeNavigatingAway(); fireEventForOtherLibrariesToHookInto("alpine:navigating"); updateCurrentPageHtmlInSnapshotCacheForLaterBackButtonClicks(currentPageUrl, currentPageKey); - preventAlpineFromPickingUpDomChanges(Alpine19, (andAfterAllThis) => { + preventAlpineFromPickingUpDomChanges(Alpine23, (andAfterAllThis) => { enablePersist && storePersistantElementsForLater((persistedEl) => { packUpPersistedTeleports(persistedEl); packUpPersistedPopovers(persistedEl); @@ -9313,7 +9410,7 @@ function navigate_default(Alpine19) { restoreScrollPositionOrScrollToTop(); andAfterAllThis(() => { autofocus && autofocusElementsWithTheAutofocusAttribute(); - nowInitializeAlpineOnTheNewPage(Alpine19); + nowInitializeAlpineOnTheNewPage(Alpine23); fireEventForOtherLibrariesToHookInto("alpine:navigated"); }); }); @@ -9328,10 +9425,10 @@ function fetchHtmlOrUsePrefetchedHtml(fromDestination, callback) { fetchHtml(fromDestination, callback); }); } -function preventAlpineFromPickingUpDomChanges(Alpine19, callback) { - Alpine19.stopObservingMutations(); +function preventAlpineFromPickingUpDomChanges(Alpine23, callback) { + Alpine23.stopObservingMutations(); callback((afterAllThis) => { - Alpine19.startObservingMutations(); + Alpine23.startObservingMutations(); queueMicrotask(() => { afterAllThis(); }); @@ -9346,8 +9443,8 @@ function fireEventForOtherLibrariesToHookInto(name, detail) { document.dispatchEvent(event); return event.defaultPrevented; } -function nowInitializeAlpineOnTheNewPage(Alpine19) { - Alpine19.initTree(document.body, void 0, (el, skip) => { +function nowInitializeAlpineOnTheNewPage(Alpine23) { + Alpine23.initTree(document.body, void 0, (el, skip) => { if (el._x_wasPersisted) skip(); }); @@ -9370,8 +9467,8 @@ function cleanupAlpineElementsOnThePageThatArentInsideAPersistedElement() { } // js/plugins/history/index.js -function history2(Alpine19) { - Alpine19.magic("queryString", (el, { interceptor }) => { +function history2(Alpine23) { + Alpine23.magic("queryString", (el, { interceptor }) => { let alias; let alwaysShow = false; let usePush = false; @@ -9380,9 +9477,9 @@ function history2(Alpine19) { let { initial, replace: replace2, push: push2, pop } = track(queryKey, initialSeedValue, alwaysShow); setter(initial); if (!usePush) { - Alpine19.effect(() => replace2(getter())); + Alpine23.effect(() => replace2(getter())); } else { - Alpine19.effect(() => push2(getter())); + Alpine23.effect(() => push2(getter())); pop(async (newValue) => { setter(newValue); let tillTheEndOfTheMicrotaskQueue = () => Promise.resolve(); @@ -9405,7 +9502,7 @@ function history2(Alpine19) { }; }); }); - Alpine19.history = { track }; + Alpine23.history = { track }; } function track(name, initialSeedValue, alwaysShow = false, except = null) { let { has, get, set, remove } = queryStringUtils(); @@ -9469,14 +9566,22 @@ function replace(url, key, object) { if (!state.alpine) state.alpine = {}; state.alpine[key] = unwrap(object); - window.history.replaceState(state, "", url.toString()); + try { + window.history.replaceState(state, "", url.toString()); + } catch (e) { + console.error(e); + } } function push(url, key, object) { let state = window.history.state || {}; if (!state.alpine) state.alpine = {}; state = { alpine: { ...state.alpine, ...{ [key]: unwrap(object) } } }; - window.history.pushState(state, "", url.toString()); + try { + window.history.pushState(state, "", url.toString()); + } catch (e) { + console.error(e); + } } function unwrap(object) { if (object === void 0) @@ -9489,24 +9594,24 @@ function queryStringUtils() { let search = url.search; if (!search) return false; - let data = fromQueryString(search); + let data = fromQueryString(search, key); return Object.keys(data).includes(key); }, get(url, key) { let search = url.search; if (!search) return false; - let data = fromQueryString(search); + let data = fromQueryString(search, key); return data[key]; }, set(url, key, value) { - let data = fromQueryString(url.search); + let data = fromQueryString(url.search, key); data[key] = stripNulls(unwrap(value)); url.search = toQueryString(data); return url; }, remove(url, key) { - let data = fromQueryString(url.search); + let data = fromQueryString(url.search, key); delete data[key]; url.search = toQueryString(data); return url; @@ -9542,7 +9647,7 @@ function toQueryString(data) { let entries = buildQueryStringEntries(data); return Object.entries(entries).map(([key, value]) => `${key}=${value}`).join("&"); } -function fromQueryString(search) { +function fromQueryString(search, queryKey) { search = search.replace("?", ""); if (search === "") return {}; @@ -9561,10 +9666,12 @@ function fromQueryString(search) { if (typeof value == "undefined") return; value = decodeURIComponent(value.replaceAll("+", "%20")); - if (!key.includes("[")) { + let decodedKey = decodeURIComponent(key); + let shouldBeHandledAsArray = decodedKey.includes("[") && decodedKey.startsWith(queryKey); + if (!shouldBeHandledAsArray) { data[key] = value; } else { - let dotNotatedKey = key.replaceAll("[", ".").replaceAll("]", ""); + let dotNotatedKey = decodedKey.replaceAll("[", ".").replaceAll("]", ""); insertDotNotatedValueIntoData(dotNotatedKey, value, data); } }); @@ -9614,10 +9721,15 @@ function start() { destroyComponent(component2.id); }); } + let directives = Array.from(el.getAttributeNames()).filter((name) => matchesForLivewireDirective(name)).map((name) => extractDirective(el, name)); + directives.forEach((directive2) => { + trigger("directive.global.init", { el, directive: directive2, cleanup: (callback) => { + import_alpinejs5.default.onAttributeRemoved(el, directive2.raw, callback); + } }); + }); let component = closestComponent(el, false); if (component) { trigger("element.init", { el, component }); - let directives = Array.from(el.getAttributeNames()).filter((name) => matchesForLivewireDirective(name)).map((name) => extractDirective(el, name)); directives.forEach((directive2) => { trigger("directive.init", { el, component, directive: directive2, cleanup: (callback) => { import_alpinejs5.default.onAttributeRemoved(el, directive2.raw, callback); @@ -9640,7 +9752,7 @@ function ensureLivewireScriptIsntMisplaced() { } // js/index.js -var import_alpinejs17 = __toESM(require_module_cjs()); +var import_alpinejs21 = __toESM(require_module_cjs()); // js/features/supportListeners.js on("effect", ({ component, effects }) => { @@ -9697,7 +9809,7 @@ on("effect", ({ component, effects }) => { onlyIfScriptHasntBeenRunAlreadyForThisComponent(component, key, () => { let scriptContent = extractScriptTagContent(content); import_alpinejs6.default.dontAutoEvaluateFunctions(() => { - import_alpinejs6.default.evaluate(component.el, scriptContent, { "$wire": component.$wire }); + import_alpinejs6.default.evaluate(component.el, scriptContent, { "$wire": component.$wire, "$js": component.$wire.$js }); }); }); }); @@ -9770,6 +9882,10 @@ function cloneScriptTag2(el) { // js/features/supportJsEvaluation.js var import_alpinejs7 = __toESM(require_module_cjs()); +import_alpinejs7.default.magic("js", (el) => { + let component = closestComponent(el); + return component.$wire.js; +}); on("effect", ({ component, effects }) => { let js = effects.js; let xjs = effects.xjs; @@ -9781,8 +9897,9 @@ on("effect", ({ component, effects }) => { }); } if (xjs) { - xjs.forEach((expression) => { - import_alpinejs7.default.evaluate(component.el, expression); + xjs.forEach(({ expression, params }) => { + params = Object.values(params); + import_alpinejs7.default.evaluate(component.el, expression, { scope: component.jsActions, params }); }); } }); @@ -9803,10 +9920,10 @@ function morph2(component, el, html) { to.__livewire = component; trigger("morph", { el, toEl: to, component }); import_alpinejs8.default.morph(el, to, { - updating: (el2, toEl, childrenOnly, skip) => { + updating: (el2, toEl, childrenOnly, skip, skipChildren) => { if (isntElement(el2)) return; - trigger("morph.updating", { el: el2, toEl, component, skip, childrenOnly }); + trigger("morph.updating", { el: el2, toEl, component, skip, childrenOnly, skipChildren }); if (el2.__livewire_replace === true) el2.innerHTML = toEl.innerHTML; if (el2.__livewire_replace_self === true) { @@ -9817,6 +9934,8 @@ function morph2(component, el, html) { return skip(); if (el2.__livewire_ignore_self === true) childrenOnly(); + if (el2.__livewire_ignore_children === true) + return skipChildren(); if (isComponentRootEl(el2) && el2.getAttribute("wire:id") !== component.id) return skip(); if (isComponentRootEl(el2)) @@ -10252,6 +10371,14 @@ on("morph.added", ({ el }) => { el.__addedByMorph = true; }); directive("transition", ({ el, directive: directive2, component, cleanup }) => { + for (let i = 0; i < el.attributes.length; i++) { + if (el.attributes[i].name.startsWith("wire:show")) { + import_alpinejs11.default.bind(el, { + [directive2.rawName.replace("wire:transition", "x-transition")]: directive2.expression + }); + return; + } + } let visibility = import_alpinejs11.default.reactive({ state: el.__addedByMorph ? false : true }); import_alpinejs11.default.bind(el, { [directive2.rawName.replace("wire:", "x-")]: "", @@ -10366,6 +10493,56 @@ directive("confirm", ({ el, directive: directive2 }) => { }; }); +// js/directives/wire-current.js +var import_alpinejs14 = __toESM(require_module_cjs()); +import_alpinejs14.default.addInitSelector(() => `[wire\\:current]`); +var onPageChanges = /* @__PURE__ */ new Map(); +document.addEventListener("livewire:navigated", () => { + onPageChanges.forEach((i) => i(new URL(window.location.href))); +}); +globalDirective("current", ({ el, directive: directive2, cleanup }) => { + let expression = directive2.expression; + let options = { + exact: directive2.modifiers.includes("exact"), + strict: directive2.modifiers.includes("strict") + }; + if (expression.startsWith("#")) + return; + if (!el.hasAttribute("href")) + return; + let href = el.getAttribute("href"); + let hrefUrl = new URL(href, window.location.href); + let classes = expression.split(" ").filter(String); + let refreshCurrent = (url) => { + if (pathMatches(hrefUrl, url, options)) { + el.classList.add(...classes); + el.setAttribute("data-current", ""); + } else { + el.classList.remove(...classes); + el.removeAttribute("data-current"); + } + }; + refreshCurrent(new URL(window.location.href)); + onPageChanges.set(el, refreshCurrent); + cleanup(() => onPageChanges.delete(el)); +}); +function pathMatches(hrefUrl, actualUrl, options) { + if (hrefUrl.hostname !== actualUrl.hostname) + return false; + let hrefPath = options.strict ? hrefUrl.pathname : hrefUrl.pathname.replace(/\/+$/, ""); + let actualPath = options.strict ? actualUrl.pathname : actualUrl.pathname.replace(/\/+$/, ""); + if (options.exact) { + return hrefPath === actualPath; + } + let hrefPathSegments = hrefPath.split("/"); + let actualPathSegments = actualPath.split("/"); + for (let i = 0; i < hrefPathSegments.length; i++) { + if (hrefPathSegments[i] !== actualPathSegments[i]) + return false; + } + return true; +} + // js/directives/shared.js function toggleBooleanStateDirective(el, directive2, isTruthy, cachedDisplay = null) { isTruthy = directive2.modifiers.includes("remove") ? !isTruthy : isTruthy; @@ -10630,11 +10807,21 @@ directive("replace", ({ el, directive: directive2 }) => { directive("ignore", ({ el, directive: directive2 }) => { if (directive2.modifiers.includes("self")) { el.__livewire_ignore_self = true; + } else if (directive2.modifiers.includes("children")) { + el.__livewire_ignore_children = true; } else { el.__livewire_ignore = true; } }); +// js/directives/wire-cloak.js +var import_alpinejs15 = __toESM(require_module_cjs()); +import_alpinejs15.default.interceptInit((el) => { + if (el.hasAttribute("wire:cloak")) { + import_alpinejs15.default.mutateDom(() => el.removeAttribute("wire:cloak")); + } +}); + // js/directives/wire-dirty.js var refreshDirtyStatesByComponent = new WeakBag(); on("commit", ({ component, respond }) => { @@ -10646,7 +10833,6 @@ on("commit", ({ component, respond }) => { }); directive("dirty", ({ el, directive: directive2, component }) => { let targets = dirtyTargets(el); - let dirty = Alpine.reactive({ state: false }); let oldIsDirty = false; let initialDisplay = el.style.display; let refreshDirtyState = (isDirty) => { @@ -10685,7 +10871,7 @@ function dirtyTargets(el) { } // js/directives/wire-model.js -var import_alpinejs14 = __toESM(require_module_cjs()); +var import_alpinejs16 = __toESM(require_module_cjs()); directive("model", ({ el, directive: directive2, component, cleanup }) => { let { expression, modifiers } = directive2; if (!expression) { @@ -10703,7 +10889,7 @@ directive("model", ({ el, directive: directive2, component, cleanup }) => { let isDebounced = modifiers.includes("debounce"); let update = expression.startsWith("$parent") ? () => component.$wire.$parent.$commit() : () => component.$wire.$commit(); let debouncedUpdate = isTextInput(el) && !isDebounced && isLive ? debounce(update, 150) : update; - import_alpinejs14.default.bind(el, { + import_alpinejs16.default.bind(el, { ["@change"]() { isLazy && update(); }, @@ -10759,14 +10945,14 @@ function debounce(func, wait) { } // js/directives/wire-init.js -var import_alpinejs15 = __toESM(require_module_cjs()); +var import_alpinejs17 = __toESM(require_module_cjs()); directive("init", ({ el, directive: directive2 }) => { let fullMethod = directive2.expression ?? "$refresh"; - import_alpinejs15.default.evaluate(el, `$wire.${fullMethod}`); + import_alpinejs17.default.evaluate(el, `$wire.${fullMethod}`); }); // js/directives/wire-poll.js -var import_alpinejs16 = __toESM(require_module_cjs()); +var import_alpinejs18 = __toESM(require_module_cjs()); directive("poll", ({ el, directive: directive2 }) => { let interval = extractDurationFrom(directive2.modifiers, 2e3); let { start: start2, pauseWhile, throttleWhile, stopWhen } = poll(() => { @@ -10780,7 +10966,7 @@ directive("poll", ({ el, directive: directive2 }) => { stopWhen(() => theElementIsDisconnected(el)); }); function triggerComponentRequest(el, directive2) { - import_alpinejs16.default.evaluate(el, directive2.expression ? "$wire." + directive2.expression : "$wire.$commit()"); + import_alpinejs18.default.evaluate(el, directive2.expression ? "$wire." + directive2.expression : "$wire.$commit()"); } function poll(callback, interval = 2e3) { let pauseConditions = []; @@ -10868,6 +11054,40 @@ function extractDurationFrom(modifiers, defaultDuration) { return durationInMilliSeconds || defaultDuration; } +// js/directives/wire-show.js +var import_alpinejs19 = __toESM(require_module_cjs()); +import_alpinejs19.default.interceptInit((el) => { + for (let i = 0; i < el.attributes.length; i++) { + if (el.attributes[i].name.startsWith("wire:show")) { + let { name, value } = el.attributes[i]; + let modifierString = name.split("wire:show")[1]; + let expression = value.startsWith("!") ? "!$wire." + value.slice(1).trim() : "$wire." + value.trim(); + import_alpinejs19.default.bind(el, { + ["x-show" + modifierString]() { + return import_alpinejs19.default.evaluate(el, expression); + } + }); + } + } +}); + +// js/directives/wire-text.js +var import_alpinejs20 = __toESM(require_module_cjs()); +import_alpinejs20.default.interceptInit((el) => { + for (let i = 0; i < el.attributes.length; i++) { + if (el.attributes[i].name.startsWith("wire:text")) { + let { name, value } = el.attributes[i]; + let modifierString = name.split("wire:text")[1]; + let expression = value.startsWith("!") ? "!$wire." + value.slice(1).trim() : "$wire." + value.trim(); + import_alpinejs20.default.bind(el, { + ["x-text" + modifierString]() { + return import_alpinejs20.default.evaluate(el, expression); + } + }); + } + } +}); + // js/index.js var Livewire2 = { directive, @@ -10883,7 +11103,7 @@ var Livewire2 = { dispatch: dispatchGlobal, on: on2, get navigate() { - return import_alpinejs17.default.navigate; + return import_alpinejs21.default.navigate; } }; var warnAboutMultipleInstancesOf = (entity) => console.warn(`Detected multiple instances of ${entity} running`); @@ -10892,7 +11112,7 @@ if (window.Livewire) if (window.Alpine) warnAboutMultipleInstancesOf("Alpine"); window.Livewire = Livewire2; -window.Alpine = import_alpinejs17.default; +window.Alpine = import_alpinejs21.default; if (window.livewireScriptConfig === void 0) { window.Alpine.__fromLivewire = true; document.addEventListener("DOMContentLoaded", () => { @@ -10902,7 +11122,7 @@ if (window.livewireScriptConfig === void 0) { Livewire2.start(); }); } -var export_Alpine = import_alpinejs17.default; +var export_Alpine = import_alpinejs21.default; export { export_Alpine as Alpine, Livewire2 as Livewire diff --git a/public/vendor/livewire/livewire.esm.js.map b/public/vendor/livewire/livewire.esm.js.map index c4af6b08..939cd00d 100644 --- a/public/vendor/livewire/livewire.esm.js.map +++ b/public/vendor/livewire/livewire.esm.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../../alpine/packages/alpinejs/dist/module.cjs.js", "../../../../../usr/local/lib/node_modules/@alpinejs/collapse/dist/module.cjs.js", "../../../../../usr/local/lib/node_modules/@alpinejs/focus/dist/module.cjs.js", "../../../../../usr/local/lib/node_modules/@alpinejs/persist/dist/module.cjs.js", "../../../../../usr/local/lib/node_modules/@alpinejs/intersect/dist/module.cjs.js", "../node_modules/@alpinejs/resize/dist/module.cjs.js", "../../alpine/packages/anchor/dist/module.cjs.js", "../node_modules/nprogress/nprogress.js", "../../alpine/packages/morph/dist/module.cjs.js", "../../../../../usr/local/lib/node_modules/@alpinejs/mask/dist/module.cjs.js", "../js/utils.js", "../js/features/supportFileUploads.js", "../js/features/supportEntangle.js", "../js/hooks.js", "../js/request/modal.js", "../js/request/pool.js", "../js/request/commit.js", "../js/request/bus.js", "../js/request/index.js", "../js/$wire.js", "../js/component.js", "../js/store.js", "../js/events.js", "../js/directives.js", "../js/lifecycle.js", "../js/plugins/navigate/history.js", "../js/plugins/navigate/links.js", "../js/plugins/navigate/fetch.js", "../js/plugins/navigate/prefetch.js", "../js/plugins/navigate/teleport.js", "../js/plugins/navigate/scroll.js", "../js/plugins/navigate/persist.js", "../js/plugins/navigate/bar.js", "../js/plugins/navigate/popover.js", "../js/plugins/navigate/page.js", "../js/plugins/navigate/index.js", "../js/plugins/history/index.js", "../js/index.js", "../js/features/supportListeners.js", "../js/features/supportScriptsAndAssets.js", "../js/features/supportJsEvaluation.js", "../js/morph.js", "../js/features/supportMorphDom.js", "../js/features/supportDispatches.js", "../js/features/supportDisablingFormsDuringRequest.js", "../js/features/supportPropsAndModelables.js", "../js/features/supportFileDownloads.js", "../js/features/supportLazyLoading.js", "../js/features/supportQueryString.js", "../js/features/supportLaravelEcho.js", "../js/features/supportIsolating.js", "../js/features/supportNavigate.js", "../js/features/supportRedirects.js", "../js/directives/wire-transition.js", "../js/debounce.js", "../js/directives/wire-wildcard.js", "../js/directives/wire-navigate.js", "../js/directives/wire-confirm.js", "../js/directives/shared.js", "../js/directives/wire-offline.js", "../js/directives/wire-loading.js", "../js/directives/wire-stream.js", "../js/directives/wire-replace.js", "../js/directives/wire-ignore.js", "../js/directives/wire-dirty.js", "../js/directives/wire-model.js", "../js/directives/wire-init.js", "../js/directives/wire-poll.js"], - "sourcesContent": ["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// node_modules/@vue/shared/dist/shared.cjs.js\nvar require_shared_cjs = __commonJS({\n \"node_modules/@vue/shared/dist/shared.cjs.js\"(exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n function makeMap(str, expectsLowerCase) {\n const map = /* @__PURE__ */ Object.create(null);\n const list = str.split(\",\");\n for (let i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];\n }\n var PatchFlagNames = {\n [\n 1\n /* TEXT */\n ]: `TEXT`,\n [\n 2\n /* CLASS */\n ]: `CLASS`,\n [\n 4\n /* STYLE */\n ]: `STYLE`,\n [\n 8\n /* PROPS */\n ]: `PROPS`,\n [\n 16\n /* FULL_PROPS */\n ]: `FULL_PROPS`,\n [\n 32\n /* HYDRATE_EVENTS */\n ]: `HYDRATE_EVENTS`,\n [\n 64\n /* STABLE_FRAGMENT */\n ]: `STABLE_FRAGMENT`,\n [\n 128\n /* KEYED_FRAGMENT */\n ]: `KEYED_FRAGMENT`,\n [\n 256\n /* UNKEYED_FRAGMENT */\n ]: `UNKEYED_FRAGMENT`,\n [\n 512\n /* NEED_PATCH */\n ]: `NEED_PATCH`,\n [\n 1024\n /* DYNAMIC_SLOTS */\n ]: `DYNAMIC_SLOTS`,\n [\n 2048\n /* DEV_ROOT_FRAGMENT */\n ]: `DEV_ROOT_FRAGMENT`,\n [\n -1\n /* HOISTED */\n ]: `HOISTED`,\n [\n -2\n /* BAIL */\n ]: `BAIL`\n };\n var slotFlagsText = {\n [\n 1\n /* STABLE */\n ]: \"STABLE\",\n [\n 2\n /* DYNAMIC */\n ]: \"DYNAMIC\",\n [\n 3\n /* FORWARDED */\n ]: \"FORWARDED\"\n };\n var GLOBALS_WHITE_LISTED = \"Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt\";\n var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);\n var range = 2;\n function generateCodeFrame(source, start2 = 0, end = source.length) {\n let lines = source.split(/(\\r?\\n)/);\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n lines = lines.filter((_, idx) => idx % 2 === 0);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);\n if (count >= start2) {\n for (let j = i - range; j <= i + range || end > count; j++) {\n if (j < 0 || j >= lines.length)\n continue;\n const line = j + 1;\n res.push(`${line}${\" \".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);\n const lineLength = lines[j].length;\n const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;\n if (j === i) {\n const pad = start2 - (count - (lineLength + newLineSeqLength));\n const length = Math.max(1, end > count ? lineLength - pad : end - start2);\n res.push(` | ` + \" \".repeat(pad) + \"^\".repeat(length));\n } else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + \"^\".repeat(length));\n }\n count += lineLength + newLineSeqLength;\n }\n }\n break;\n }\n }\n return res.join(\"\\n\");\n }\n var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\n var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);\n var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);\n var unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\n var attrValidationCache = {};\n function isSSRSafeAttrName(name) {\n if (attrValidationCache.hasOwnProperty(name)) {\n return attrValidationCache[name];\n }\n const isUnsafe = unsafeAttrCharRE.test(name);\n if (isUnsafe) {\n console.error(`unsafe attribute name: ${name}`);\n }\n return attrValidationCache[name] = !isUnsafe;\n }\n var propsToAttrMap = {\n acceptCharset: \"accept-charset\",\n className: \"class\",\n htmlFor: \"for\",\n httpEquiv: \"http-equiv\"\n };\n var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`);\n var isKnownAttr = /* @__PURE__ */ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`);\n function normalizeStyle(value) {\n if (isArray(value)) {\n const res = {};\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);\n if (normalized) {\n for (const key in normalized) {\n res[key] = normalized[key];\n }\n }\n }\n return res;\n } else if (isObject(value)) {\n return value;\n }\n }\n var listDelimiterRE = /;(?![^(]*\\))/g;\n var propertyDelimiterRE = /:(.+)/;\n function parseStringStyle(cssText) {\n const ret = {};\n cssText.split(listDelimiterRE).forEach((item) => {\n if (item) {\n const tmp = item.split(propertyDelimiterRE);\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n }\n });\n return ret;\n }\n function stringifyStyle(styles) {\n let ret = \"\";\n if (!styles) {\n return ret;\n }\n for (const key in styles) {\n const value = styles[key];\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\n if (isString(value) || typeof value === \"number\" && isNoUnitNumericStyleProp(normalizedKey)) {\n ret += `${normalizedKey}:${value};`;\n }\n }\n return ret;\n }\n function normalizeClass(value) {\n let res = \"\";\n if (isString(value)) {\n res = value;\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const normalized = normalizeClass(value[i]);\n if (normalized) {\n res += normalized + \" \";\n }\n }\n } else if (isObject(value)) {\n for (const name in value) {\n if (value[name]) {\n res += name + \" \";\n }\n }\n }\n return res.trim();\n }\n var HTML_TAGS = \"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot\";\n var SVG_TAGS = \"svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view\";\n var VOID_TAGS = \"area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr\";\n var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);\n var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);\n var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);\n var escapeRE = /[\"'&<>]/;\n function escapeHtml(string) {\n const str = \"\" + string;\n const match = escapeRE.exec(str);\n if (!match) {\n return str;\n }\n let html = \"\";\n let escaped;\n let index;\n let lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n escaped = \""\";\n break;\n case 38:\n escaped = \"&\";\n break;\n case 39:\n escaped = \"'\";\n break;\n case 60:\n escaped = \"<\";\n break;\n case 62:\n escaped = \">\";\n break;\n default:\n continue;\n }\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n lastIndex = index + 1;\n html += escaped;\n }\n return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\n }\n var commentStripRE = /^-?>||--!>| looseEqual(item, val));\n }\n var toDisplayString = (val) => {\n return val == null ? \"\" : isObject(val) ? JSON.stringify(val, replacer, 2) : String(val);\n };\n var replacer = (_key, val) => {\n if (isMap(val)) {\n return {\n [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {\n entries[`${key} =>`] = val2;\n return entries;\n }, {})\n };\n } else if (isSet(val)) {\n return {\n [`Set(${val.size})`]: [...val.values()]\n };\n } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n return String(val);\n }\n return val;\n };\n var babelParserDefaultPlugins = [\n \"bigInt\",\n \"optionalChaining\",\n \"nullishCoalescingOperator\"\n ];\n var EMPTY_OBJ = Object.freeze({});\n var EMPTY_ARR = Object.freeze([]);\n var NOOP = () => {\n };\n var NO = () => false;\n var onRE = /^on[^a-z]/;\n var isOn = (key) => onRE.test(key);\n var isModelListener = (key) => key.startsWith(\"onUpdate:\");\n var extend = Object.assign;\n var remove = (arr, el) => {\n const i = arr.indexOf(el);\n if (i > -1) {\n arr.splice(i, 1);\n }\n };\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n var hasOwn = (val, key) => hasOwnProperty.call(val, key);\n var isArray = Array.isArray;\n var isMap = (val) => toTypeString(val) === \"[object Map]\";\n var isSet = (val) => toTypeString(val) === \"[object Set]\";\n var isDate = (val) => val instanceof Date;\n var isFunction = (val) => typeof val === \"function\";\n var isString = (val) => typeof val === \"string\";\n var isSymbol = (val) => typeof val === \"symbol\";\n var isObject = (val) => val !== null && typeof val === \"object\";\n var isPromise = (val) => {\n return isObject(val) && isFunction(val.then) && isFunction(val.catch);\n };\n var objectToString = Object.prototype.toString;\n var toTypeString = (value) => objectToString.call(value);\n var toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n };\n var isPlainObject = (val) => toTypeString(val) === \"[object Object]\";\n var isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\n var isReservedProp = /* @__PURE__ */ makeMap(\n // the leading comma is intentional so empty string \"\" is also included\n \",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted\"\n );\n var cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n };\n var camelizeRE = /-(\\w)/g;\n var camelize = cacheStringFunction((str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n });\n var hyphenateRE = /\\B([A-Z])/g;\n var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\n var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\n var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);\n var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);\n var invokeArrayFns = (fns, arg) => {\n for (let i = 0; i < fns.length; i++) {\n fns[i](arg);\n }\n };\n var def = (obj, key, value) => {\n Object.defineProperty(obj, key, {\n configurable: true,\n enumerable: false,\n value\n });\n };\n var toNumber = (val) => {\n const n = parseFloat(val);\n return isNaN(n) ? val : n;\n };\n var _globalThis;\n var getGlobalThis = () => {\n return _globalThis || (_globalThis = typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : {});\n };\n exports.EMPTY_ARR = EMPTY_ARR;\n exports.EMPTY_OBJ = EMPTY_OBJ;\n exports.NO = NO;\n exports.NOOP = NOOP;\n exports.PatchFlagNames = PatchFlagNames;\n exports.babelParserDefaultPlugins = babelParserDefaultPlugins;\n exports.camelize = camelize;\n exports.capitalize = capitalize;\n exports.def = def;\n exports.escapeHtml = escapeHtml;\n exports.escapeHtmlComment = escapeHtmlComment;\n exports.extend = extend;\n exports.generateCodeFrame = generateCodeFrame;\n exports.getGlobalThis = getGlobalThis;\n exports.hasChanged = hasChanged;\n exports.hasOwn = hasOwn;\n exports.hyphenate = hyphenate;\n exports.invokeArrayFns = invokeArrayFns;\n exports.isArray = isArray;\n exports.isBooleanAttr = isBooleanAttr2;\n exports.isDate = isDate;\n exports.isFunction = isFunction;\n exports.isGloballyWhitelisted = isGloballyWhitelisted;\n exports.isHTMLTag = isHTMLTag;\n exports.isIntegerKey = isIntegerKey;\n exports.isKnownAttr = isKnownAttr;\n exports.isMap = isMap;\n exports.isModelListener = isModelListener;\n exports.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp;\n exports.isObject = isObject;\n exports.isOn = isOn;\n exports.isPlainObject = isPlainObject;\n exports.isPromise = isPromise;\n exports.isReservedProp = isReservedProp;\n exports.isSSRSafeAttrName = isSSRSafeAttrName;\n exports.isSVGTag = isSVGTag;\n exports.isSet = isSet;\n exports.isSpecialBooleanAttr = isSpecialBooleanAttr;\n exports.isString = isString;\n exports.isSymbol = isSymbol;\n exports.isVoidTag = isVoidTag;\n exports.looseEqual = looseEqual;\n exports.looseIndexOf = looseIndexOf;\n exports.makeMap = makeMap;\n exports.normalizeClass = normalizeClass;\n exports.normalizeStyle = normalizeStyle;\n exports.objectToString = objectToString;\n exports.parseStringStyle = parseStringStyle;\n exports.propsToAttrMap = propsToAttrMap;\n exports.remove = remove;\n exports.slotFlagsText = slotFlagsText;\n exports.stringifyStyle = stringifyStyle;\n exports.toDisplayString = toDisplayString;\n exports.toHandlerKey = toHandlerKey;\n exports.toNumber = toNumber;\n exports.toRawType = toRawType;\n exports.toTypeString = toTypeString;\n }\n});\n\n// node_modules/@vue/shared/index.js\nvar require_shared = __commonJS({\n \"node_modules/@vue/shared/index.js\"(exports, module2) {\n \"use strict\";\n if (false) {\n module2.exports = null;\n } else {\n module2.exports = require_shared_cjs();\n }\n }\n});\n\n// node_modules/@vue/reactivity/dist/reactivity.cjs.js\nvar require_reactivity_cjs = __commonJS({\n \"node_modules/@vue/reactivity/dist/reactivity.cjs.js\"(exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n var shared = require_shared();\n var targetMap = /* @__PURE__ */ new WeakMap();\n var effectStack = [];\n var activeEffect;\n var ITERATE_KEY = Symbol(\"iterate\");\n var MAP_KEY_ITERATE_KEY = Symbol(\"Map key iterate\");\n function isEffect(fn) {\n return fn && fn._isEffect === true;\n }\n function effect3(fn, options = shared.EMPTY_OBJ) {\n if (isEffect(fn)) {\n fn = fn.raw;\n }\n const effect4 = createReactiveEffect(fn, options);\n if (!options.lazy) {\n effect4();\n }\n return effect4;\n }\n function stop2(effect4) {\n if (effect4.active) {\n cleanup(effect4);\n if (effect4.options.onStop) {\n effect4.options.onStop();\n }\n effect4.active = false;\n }\n }\n var uid = 0;\n function createReactiveEffect(fn, options) {\n const effect4 = function reactiveEffect() {\n if (!effect4.active) {\n return fn();\n }\n if (!effectStack.includes(effect4)) {\n cleanup(effect4);\n try {\n enableTracking();\n effectStack.push(effect4);\n activeEffect = effect4;\n return fn();\n } finally {\n effectStack.pop();\n resetTracking();\n activeEffect = effectStack[effectStack.length - 1];\n }\n }\n };\n effect4.id = uid++;\n effect4.allowRecurse = !!options.allowRecurse;\n effect4._isEffect = true;\n effect4.active = true;\n effect4.raw = fn;\n effect4.deps = [];\n effect4.options = options;\n return effect4;\n }\n function cleanup(effect4) {\n const { deps } = effect4;\n if (deps.length) {\n for (let i = 0; i < deps.length; i++) {\n deps[i].delete(effect4);\n }\n deps.length = 0;\n }\n }\n var shouldTrack = true;\n var trackStack = [];\n function pauseTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = false;\n }\n function enableTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = true;\n }\n function resetTracking() {\n const last = trackStack.pop();\n shouldTrack = last === void 0 ? true : last;\n }\n function track(target, type, key) {\n if (!shouldTrack || activeEffect === void 0) {\n return;\n }\n let depsMap = targetMap.get(target);\n if (!depsMap) {\n targetMap.set(target, depsMap = /* @__PURE__ */ new Map());\n }\n let dep = depsMap.get(key);\n if (!dep) {\n depsMap.set(key, dep = /* @__PURE__ */ new Set());\n }\n if (!dep.has(activeEffect)) {\n dep.add(activeEffect);\n activeEffect.deps.push(dep);\n if (activeEffect.options.onTrack) {\n activeEffect.options.onTrack({\n effect: activeEffect,\n target,\n type,\n key\n });\n }\n }\n }\n function trigger(target, type, key, newValue, oldValue, oldTarget) {\n const depsMap = targetMap.get(target);\n if (!depsMap) {\n return;\n }\n const effects = /* @__PURE__ */ new Set();\n const add2 = (effectsToAdd) => {\n if (effectsToAdd) {\n effectsToAdd.forEach((effect4) => {\n if (effect4 !== activeEffect || effect4.allowRecurse) {\n effects.add(effect4);\n }\n });\n }\n };\n if (type === \"clear\") {\n depsMap.forEach(add2);\n } else if (key === \"length\" && shared.isArray(target)) {\n depsMap.forEach((dep, key2) => {\n if (key2 === \"length\" || key2 >= newValue) {\n add2(dep);\n }\n });\n } else {\n if (key !== void 0) {\n add2(depsMap.get(key));\n }\n switch (type) {\n case \"add\":\n if (!shared.isArray(target)) {\n add2(depsMap.get(ITERATE_KEY));\n if (shared.isMap(target)) {\n add2(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n } else if (shared.isIntegerKey(key)) {\n add2(depsMap.get(\"length\"));\n }\n break;\n case \"delete\":\n if (!shared.isArray(target)) {\n add2(depsMap.get(ITERATE_KEY));\n if (shared.isMap(target)) {\n add2(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n }\n break;\n case \"set\":\n if (shared.isMap(target)) {\n add2(depsMap.get(ITERATE_KEY));\n }\n break;\n }\n }\n const run = (effect4) => {\n if (effect4.options.onTrigger) {\n effect4.options.onTrigger({\n effect: effect4,\n target,\n key,\n type,\n newValue,\n oldValue,\n oldTarget\n });\n }\n if (effect4.options.scheduler) {\n effect4.options.scheduler(effect4);\n } else {\n effect4();\n }\n };\n effects.forEach(run);\n }\n var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`);\n var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol));\n var get2 = /* @__PURE__ */ createGetter();\n var shallowGet = /* @__PURE__ */ createGetter(false, true);\n var readonlyGet = /* @__PURE__ */ createGetter(true);\n var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);\n var arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();\n function createArrayInstrumentations() {\n const instrumentations = {};\n [\"includes\", \"indexOf\", \"lastIndexOf\"].forEach((key) => {\n instrumentations[key] = function(...args) {\n const arr = toRaw2(this);\n for (let i = 0, l = this.length; i < l; i++) {\n track(arr, \"get\", i + \"\");\n }\n const res = arr[key](...args);\n if (res === -1 || res === false) {\n return arr[key](...args.map(toRaw2));\n } else {\n return res;\n }\n };\n });\n [\"push\", \"pop\", \"shift\", \"unshift\", \"splice\"].forEach((key) => {\n instrumentations[key] = function(...args) {\n pauseTracking();\n const res = toRaw2(this)[key].apply(this, args);\n resetTracking();\n return res;\n };\n });\n return instrumentations;\n }\n function createGetter(isReadonly2 = false, shallow = false) {\n return function get3(target, key, receiver) {\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_raw\" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {\n return target;\n }\n const targetIsArray = shared.isArray(target);\n if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) {\n return Reflect.get(arrayInstrumentations, key, receiver);\n }\n const res = Reflect.get(target, key, receiver);\n if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {\n return res;\n }\n if (!isReadonly2) {\n track(target, \"get\", key);\n }\n if (shallow) {\n return res;\n }\n if (isRef(res)) {\n const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key);\n return shouldUnwrap ? res.value : res;\n }\n if (shared.isObject(res)) {\n return isReadonly2 ? readonly(res) : reactive3(res);\n }\n return res;\n };\n }\n var set2 = /* @__PURE__ */ createSetter();\n var shallowSet = /* @__PURE__ */ createSetter(true);\n function createSetter(shallow = false) {\n return function set3(target, key, value, receiver) {\n let oldValue = target[key];\n if (!shallow) {\n value = toRaw2(value);\n oldValue = toRaw2(oldValue);\n if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n return true;\n }\n }\n const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key);\n const result = Reflect.set(target, key, value, receiver);\n if (target === toRaw2(receiver)) {\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (shared.hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n }\n return result;\n };\n }\n function deleteProperty(target, key) {\n const hadKey = shared.hasOwn(target, key);\n const oldValue = target[key];\n const result = Reflect.deleteProperty(target, key);\n if (result && hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n }\n function has(target, key) {\n const result = Reflect.has(target, key);\n if (!shared.isSymbol(key) || !builtInSymbols.has(key)) {\n track(target, \"has\", key);\n }\n return result;\n }\n function ownKeys(target) {\n track(target, \"iterate\", shared.isArray(target) ? \"length\" : ITERATE_KEY);\n return Reflect.ownKeys(target);\n }\n var mutableHandlers = {\n get: get2,\n set: set2,\n deleteProperty,\n has,\n ownKeys\n };\n var readonlyHandlers = {\n get: readonlyGet,\n set(target, key) {\n {\n console.warn(`Set operation on key \"${String(key)}\" failed: target is readonly.`, target);\n }\n return true;\n },\n deleteProperty(target, key) {\n {\n console.warn(`Delete operation on key \"${String(key)}\" failed: target is readonly.`, target);\n }\n return true;\n }\n };\n var shallowReactiveHandlers = /* @__PURE__ */ shared.extend({}, mutableHandlers, {\n get: shallowGet,\n set: shallowSet\n });\n var shallowReadonlyHandlers = /* @__PURE__ */ shared.extend({}, readonlyHandlers, {\n get: shallowReadonlyGet\n });\n var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value;\n var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value;\n var toShallow = (value) => value;\n var getProto = (v) => Reflect.getPrototypeOf(v);\n function get$1(target, key, isReadonly2 = false, isShallow = false) {\n target = target[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw2(target);\n const rawKey = toRaw2(key);\n if (key !== rawKey) {\n !isReadonly2 && track(rawTarget, \"get\", key);\n }\n !isReadonly2 && track(rawTarget, \"get\", rawKey);\n const { has: has2 } = getProto(rawTarget);\n const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;\n if (has2.call(rawTarget, key)) {\n return wrap(target.get(key));\n } else if (has2.call(rawTarget, rawKey)) {\n return wrap(target.get(rawKey));\n } else if (target !== rawTarget) {\n target.get(key);\n }\n }\n function has$1(key, isReadonly2 = false) {\n const target = this[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw2(target);\n const rawKey = toRaw2(key);\n if (key !== rawKey) {\n !isReadonly2 && track(rawTarget, \"has\", key);\n }\n !isReadonly2 && track(rawTarget, \"has\", rawKey);\n return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);\n }\n function size(target, isReadonly2 = false) {\n target = target[\n \"__v_raw\"\n /* RAW */\n ];\n !isReadonly2 && track(toRaw2(target), \"iterate\", ITERATE_KEY);\n return Reflect.get(target, \"size\", target);\n }\n function add(value) {\n value = toRaw2(value);\n const target = toRaw2(this);\n const proto = getProto(target);\n const hadKey = proto.has.call(target, value);\n if (!hadKey) {\n target.add(value);\n trigger(target, \"add\", value, value);\n }\n return this;\n }\n function set$1(key, value) {\n value = toRaw2(value);\n const target = toRaw2(this);\n const { has: has2, get: get3 } = getProto(target);\n let hadKey = has2.call(target, key);\n if (!hadKey) {\n key = toRaw2(key);\n hadKey = has2.call(target, key);\n } else {\n checkIdentityKeys(target, has2, key);\n }\n const oldValue = get3.call(target, key);\n target.set(key, value);\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (shared.hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n return this;\n }\n function deleteEntry(key) {\n const target = toRaw2(this);\n const { has: has2, get: get3 } = getProto(target);\n let hadKey = has2.call(target, key);\n if (!hadKey) {\n key = toRaw2(key);\n hadKey = has2.call(target, key);\n } else {\n checkIdentityKeys(target, has2, key);\n }\n const oldValue = get3 ? get3.call(target, key) : void 0;\n const result = target.delete(key);\n if (hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n }\n function clear() {\n const target = toRaw2(this);\n const hadItems = target.size !== 0;\n const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target);\n const result = target.clear();\n if (hadItems) {\n trigger(target, \"clear\", void 0, void 0, oldTarget);\n }\n return result;\n }\n function createForEach(isReadonly2, isShallow) {\n return function forEach(callback, thisArg) {\n const observed = this;\n const target = observed[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw2(target);\n const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;\n !isReadonly2 && track(rawTarget, \"iterate\", ITERATE_KEY);\n return target.forEach((value, key) => {\n return callback.call(thisArg, wrap(value), wrap(key), observed);\n });\n };\n }\n function createIterableMethod(method, isReadonly2, isShallow) {\n return function(...args) {\n const target = this[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw2(target);\n const targetIsMap = shared.isMap(rawTarget);\n const isPair = method === \"entries\" || method === Symbol.iterator && targetIsMap;\n const isKeyOnly = method === \"keys\" && targetIsMap;\n const innerIterator = target[method](...args);\n const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;\n !isReadonly2 && track(rawTarget, \"iterate\", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\n return {\n // iterator protocol\n next() {\n const { value, done } = innerIterator.next();\n return done ? { value, done } : {\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n done\n };\n },\n // iterable protocol\n [Symbol.iterator]() {\n return this;\n }\n };\n };\n }\n function createReadonlyMethod(type) {\n return function(...args) {\n {\n const key = args[0] ? `on key \"${args[0]}\" ` : ``;\n console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this));\n }\n return type === \"delete\" ? false : this;\n };\n }\n function createInstrumentations() {\n const mutableInstrumentations2 = {\n get(key) {\n return get$1(this, key);\n },\n get size() {\n return size(this);\n },\n has: has$1,\n add,\n set: set$1,\n delete: deleteEntry,\n clear,\n forEach: createForEach(false, false)\n };\n const shallowInstrumentations2 = {\n get(key) {\n return get$1(this, key, false, true);\n },\n get size() {\n return size(this);\n },\n has: has$1,\n add,\n set: set$1,\n delete: deleteEntry,\n clear,\n forEach: createForEach(false, true)\n };\n const readonlyInstrumentations2 = {\n get(key) {\n return get$1(this, key, true);\n },\n get size() {\n return size(this, true);\n },\n has(key) {\n return has$1.call(this, key, true);\n },\n add: createReadonlyMethod(\n \"add\"\n /* ADD */\n ),\n set: createReadonlyMethod(\n \"set\"\n /* SET */\n ),\n delete: createReadonlyMethod(\n \"delete\"\n /* DELETE */\n ),\n clear: createReadonlyMethod(\n \"clear\"\n /* CLEAR */\n ),\n forEach: createForEach(true, false)\n };\n const shallowReadonlyInstrumentations2 = {\n get(key) {\n return get$1(this, key, true, true);\n },\n get size() {\n return size(this, true);\n },\n has(key) {\n return has$1.call(this, key, true);\n },\n add: createReadonlyMethod(\n \"add\"\n /* ADD */\n ),\n set: createReadonlyMethod(\n \"set\"\n /* SET */\n ),\n delete: createReadonlyMethod(\n \"delete\"\n /* DELETE */\n ),\n clear: createReadonlyMethod(\n \"clear\"\n /* CLEAR */\n ),\n forEach: createForEach(true, true)\n };\n const iteratorMethods = [\"keys\", \"values\", \"entries\", Symbol.iterator];\n iteratorMethods.forEach((method) => {\n mutableInstrumentations2[method] = createIterableMethod(method, false, false);\n readonlyInstrumentations2[method] = createIterableMethod(method, true, false);\n shallowInstrumentations2[method] = createIterableMethod(method, false, true);\n shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);\n });\n return [\n mutableInstrumentations2,\n readonlyInstrumentations2,\n shallowInstrumentations2,\n shallowReadonlyInstrumentations2\n ];\n }\n var [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();\n function createInstrumentationGetter(isReadonly2, shallow) {\n const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;\n return (target, key, receiver) => {\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_raw\") {\n return target;\n }\n return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);\n };\n }\n var mutableCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, false)\n };\n var shallowCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, true)\n };\n var readonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, false)\n };\n var shallowReadonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, true)\n };\n function checkIdentityKeys(target, has2, key) {\n const rawKey = toRaw2(key);\n if (rawKey !== key && has2.call(target, rawKey)) {\n const type = shared.toRawType(target);\n console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);\n }\n }\n var reactiveMap = /* @__PURE__ */ new WeakMap();\n var shallowReactiveMap = /* @__PURE__ */ new WeakMap();\n var readonlyMap = /* @__PURE__ */ new WeakMap();\n var shallowReadonlyMap = /* @__PURE__ */ new WeakMap();\n function targetTypeMap(rawType) {\n switch (rawType) {\n case \"Object\":\n case \"Array\":\n return 1;\n case \"Map\":\n case \"Set\":\n case \"WeakMap\":\n case \"WeakSet\":\n return 2;\n default:\n return 0;\n }\n }\n function getTargetType(value) {\n return value[\n \"__v_skip\"\n /* SKIP */\n ] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value));\n }\n function reactive3(target) {\n if (target && target[\n \"__v_isReadonly\"\n /* IS_READONLY */\n ]) {\n return target;\n }\n return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);\n }\n function shallowReactive(target) {\n return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);\n }\n function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n }\n function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n }\n function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {\n if (!shared.isObject(target)) {\n {\n console.warn(`value cannot be made reactive: ${String(target)}`);\n }\n return target;\n }\n if (target[\n \"__v_raw\"\n /* RAW */\n ] && !(isReadonly2 && target[\n \"__v_isReactive\"\n /* IS_REACTIVE */\n ])) {\n return target;\n }\n const existingProxy = proxyMap.get(target);\n if (existingProxy) {\n return existingProxy;\n }\n const targetType = getTargetType(target);\n if (targetType === 0) {\n return target;\n }\n const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);\n proxyMap.set(target, proxy);\n return proxy;\n }\n function isReactive2(value) {\n if (isReadonly(value)) {\n return isReactive2(value[\n \"__v_raw\"\n /* RAW */\n ]);\n }\n return !!(value && value[\n \"__v_isReactive\"\n /* IS_REACTIVE */\n ]);\n }\n function isReadonly(value) {\n return !!(value && value[\n \"__v_isReadonly\"\n /* IS_READONLY */\n ]);\n }\n function isProxy(value) {\n return isReactive2(value) || isReadonly(value);\n }\n function toRaw2(observed) {\n return observed && toRaw2(observed[\n \"__v_raw\"\n /* RAW */\n ]) || observed;\n }\n function markRaw(value) {\n shared.def(value, \"__v_skip\", true);\n return value;\n }\n var convert = (val) => shared.isObject(val) ? reactive3(val) : val;\n function isRef(r) {\n return Boolean(r && r.__v_isRef === true);\n }\n function ref(value) {\n return createRef(value);\n }\n function shallowRef(value) {\n return createRef(value, true);\n }\n var RefImpl = class {\n constructor(value, _shallow = false) {\n this._shallow = _shallow;\n this.__v_isRef = true;\n this._rawValue = _shallow ? value : toRaw2(value);\n this._value = _shallow ? value : convert(value);\n }\n get value() {\n track(toRaw2(this), \"get\", \"value\");\n return this._value;\n }\n set value(newVal) {\n newVal = this._shallow ? newVal : toRaw2(newVal);\n if (shared.hasChanged(newVal, this._rawValue)) {\n this._rawValue = newVal;\n this._value = this._shallow ? newVal : convert(newVal);\n trigger(toRaw2(this), \"set\", \"value\", newVal);\n }\n }\n };\n function createRef(rawValue, shallow = false) {\n if (isRef(rawValue)) {\n return rawValue;\n }\n return new RefImpl(rawValue, shallow);\n }\n function triggerRef(ref2) {\n trigger(toRaw2(ref2), \"set\", \"value\", ref2.value);\n }\n function unref(ref2) {\n return isRef(ref2) ? ref2.value : ref2;\n }\n var shallowUnwrapHandlers = {\n get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),\n set: (target, key, value, receiver) => {\n const oldValue = target[key];\n if (isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n return true;\n } else {\n return Reflect.set(target, key, value, receiver);\n }\n }\n };\n function proxyRefs(objectWithRefs) {\n return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);\n }\n var CustomRefImpl = class {\n constructor(factory) {\n this.__v_isRef = true;\n const { get: get3, set: set3 } = factory(() => track(this, \"get\", \"value\"), () => trigger(this, \"set\", \"value\"));\n this._get = get3;\n this._set = set3;\n }\n get value() {\n return this._get();\n }\n set value(newVal) {\n this._set(newVal);\n }\n };\n function customRef(factory) {\n return new CustomRefImpl(factory);\n }\n function toRefs(object) {\n if (!isProxy(object)) {\n console.warn(`toRefs() expects a reactive object but received a plain one.`);\n }\n const ret = shared.isArray(object) ? new Array(object.length) : {};\n for (const key in object) {\n ret[key] = toRef(object, key);\n }\n return ret;\n }\n var ObjectRefImpl = class {\n constructor(_object, _key) {\n this._object = _object;\n this._key = _key;\n this.__v_isRef = true;\n }\n get value() {\n return this._object[this._key];\n }\n set value(newVal) {\n this._object[this._key] = newVal;\n }\n };\n function toRef(object, key) {\n return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key);\n }\n var ComputedRefImpl = class {\n constructor(getter, _setter, isReadonly2) {\n this._setter = _setter;\n this._dirty = true;\n this.__v_isRef = true;\n this.effect = effect3(getter, {\n lazy: true,\n scheduler: () => {\n if (!this._dirty) {\n this._dirty = true;\n trigger(toRaw2(this), \"set\", \"value\");\n }\n }\n });\n this[\n \"__v_isReadonly\"\n /* IS_READONLY */\n ] = isReadonly2;\n }\n get value() {\n const self2 = toRaw2(this);\n if (self2._dirty) {\n self2._value = this.effect();\n self2._dirty = false;\n }\n track(self2, \"get\", \"value\");\n return self2._value;\n }\n set value(newValue) {\n this._setter(newValue);\n }\n };\n function computed(getterOrOptions) {\n let getter;\n let setter;\n if (shared.isFunction(getterOrOptions)) {\n getter = getterOrOptions;\n setter = () => {\n console.warn(\"Write operation failed: computed value is readonly\");\n };\n } else {\n getter = getterOrOptions.get;\n setter = getterOrOptions.set;\n }\n return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set);\n }\n exports.ITERATE_KEY = ITERATE_KEY;\n exports.computed = computed;\n exports.customRef = customRef;\n exports.effect = effect3;\n exports.enableTracking = enableTracking;\n exports.isProxy = isProxy;\n exports.isReactive = isReactive2;\n exports.isReadonly = isReadonly;\n exports.isRef = isRef;\n exports.markRaw = markRaw;\n exports.pauseTracking = pauseTracking;\n exports.proxyRefs = proxyRefs;\n exports.reactive = reactive3;\n exports.readonly = readonly;\n exports.ref = ref;\n exports.resetTracking = resetTracking;\n exports.shallowReactive = shallowReactive;\n exports.shallowReadonly = shallowReadonly;\n exports.shallowRef = shallowRef;\n exports.stop = stop2;\n exports.toRaw = toRaw2;\n exports.toRef = toRef;\n exports.toRefs = toRefs;\n exports.track = track;\n exports.trigger = trigger;\n exports.triggerRef = triggerRef;\n exports.unref = unref;\n }\n});\n\n// node_modules/@vue/reactivity/index.js\nvar require_reactivity = __commonJS({\n \"node_modules/@vue/reactivity/index.js\"(exports, module2) {\n \"use strict\";\n if (false) {\n module2.exports = null;\n } else {\n module2.exports = require_reactivity_cjs();\n }\n }\n});\n\n// packages/alpinejs/builds/module.js\nvar module_exports = {};\n__export(module_exports, {\n Alpine: () => src_default,\n default: () => module_default\n});\nmodule.exports = __toCommonJS(module_exports);\n\n// packages/alpinejs/src/scheduler.js\nvar flushPending = false;\nvar flushing = false;\nvar queue = [];\nvar lastFlushedIndex = -1;\nfunction scheduler(callback) {\n queueJob(callback);\n}\nfunction queueJob(job) {\n if (!queue.includes(job))\n queue.push(job);\n queueFlush();\n}\nfunction dequeueJob(job) {\n let index = queue.indexOf(job);\n if (index !== -1 && index > lastFlushedIndex)\n queue.splice(index, 1);\n}\nfunction queueFlush() {\n if (!flushing && !flushPending) {\n flushPending = true;\n queueMicrotask(flushJobs);\n }\n}\nfunction flushJobs() {\n flushPending = false;\n flushing = true;\n for (let i = 0; i < queue.length; i++) {\n queue[i]();\n lastFlushedIndex = i;\n }\n queue.length = 0;\n lastFlushedIndex = -1;\n flushing = false;\n}\n\n// packages/alpinejs/src/reactivity.js\nvar reactive;\nvar effect;\nvar release;\nvar raw;\nvar shouldSchedule = true;\nfunction disableEffectScheduling(callback) {\n shouldSchedule = false;\n callback();\n shouldSchedule = true;\n}\nfunction setReactivityEngine(engine) {\n reactive = engine.reactive;\n release = engine.release;\n effect = (callback) => engine.effect(callback, { scheduler: (task) => {\n if (shouldSchedule) {\n scheduler(task);\n } else {\n task();\n }\n } });\n raw = engine.raw;\n}\nfunction overrideEffect(override) {\n effect = override;\n}\nfunction elementBoundEffect(el) {\n let cleanup = () => {\n };\n let wrappedEffect = (callback) => {\n let effectReference = effect(callback);\n if (!el._x_effects) {\n el._x_effects = /* @__PURE__ */ new Set();\n el._x_runEffects = () => {\n el._x_effects.forEach((i) => i());\n };\n }\n el._x_effects.add(effectReference);\n cleanup = () => {\n if (effectReference === void 0)\n return;\n el._x_effects.delete(effectReference);\n release(effectReference);\n };\n return effectReference;\n };\n return [wrappedEffect, () => {\n cleanup();\n }];\n}\nfunction watch(getter, callback) {\n let firstTime = true;\n let oldValue;\n let effectReference = effect(() => {\n let value = getter();\n JSON.stringify(value);\n if (!firstTime) {\n queueMicrotask(() => {\n callback(value, oldValue);\n oldValue = value;\n });\n } else {\n oldValue = value;\n }\n firstTime = false;\n });\n return () => release(effectReference);\n}\n\n// packages/alpinejs/src/mutation.js\nvar onAttributeAddeds = [];\nvar onElRemoveds = [];\nvar onElAddeds = [];\nfunction onElAdded(callback) {\n onElAddeds.push(callback);\n}\nfunction onElRemoved(el, callback) {\n if (typeof callback === \"function\") {\n if (!el._x_cleanups)\n el._x_cleanups = [];\n el._x_cleanups.push(callback);\n } else {\n callback = el;\n onElRemoveds.push(callback);\n }\n}\nfunction onAttributesAdded(callback) {\n onAttributeAddeds.push(callback);\n}\nfunction onAttributeRemoved(el, name, callback) {\n if (!el._x_attributeCleanups)\n el._x_attributeCleanups = {};\n if (!el._x_attributeCleanups[name])\n el._x_attributeCleanups[name] = [];\n el._x_attributeCleanups[name].push(callback);\n}\nfunction cleanupAttributes(el, names) {\n if (!el._x_attributeCleanups)\n return;\n Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {\n if (names === void 0 || names.includes(name)) {\n value.forEach((i) => i());\n delete el._x_attributeCleanups[name];\n }\n });\n}\nfunction cleanupElement(el) {\n var _a, _b;\n (_a = el._x_effects) == null ? void 0 : _a.forEach(dequeueJob);\n while ((_b = el._x_cleanups) == null ? void 0 : _b.length)\n el._x_cleanups.pop()();\n}\nvar observer = new MutationObserver(onMutate);\nvar currentlyObserving = false;\nfunction startObservingMutations() {\n observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true });\n currentlyObserving = true;\n}\nfunction stopObservingMutations() {\n flushObserver();\n observer.disconnect();\n currentlyObserving = false;\n}\nvar queuedMutations = [];\nfunction flushObserver() {\n let records = observer.takeRecords();\n queuedMutations.push(() => records.length > 0 && onMutate(records));\n let queueLengthWhenTriggered = queuedMutations.length;\n queueMicrotask(() => {\n if (queuedMutations.length === queueLengthWhenTriggered) {\n while (queuedMutations.length > 0)\n queuedMutations.shift()();\n }\n });\n}\nfunction mutateDom(callback) {\n if (!currentlyObserving)\n return callback();\n stopObservingMutations();\n let result = callback();\n startObservingMutations();\n return result;\n}\nvar isCollecting = false;\nvar deferredMutations = [];\nfunction deferMutations() {\n isCollecting = true;\n}\nfunction flushAndStopDeferringMutations() {\n isCollecting = false;\n onMutate(deferredMutations);\n deferredMutations = [];\n}\nfunction onMutate(mutations) {\n if (isCollecting) {\n deferredMutations = deferredMutations.concat(mutations);\n return;\n }\n let addedNodes = /* @__PURE__ */ new Set();\n let removedNodes = /* @__PURE__ */ new Set();\n let addedAttributes = /* @__PURE__ */ new Map();\n let removedAttributes = /* @__PURE__ */ new Map();\n for (let i = 0; i < mutations.length; i++) {\n if (mutations[i].target._x_ignoreMutationObserver)\n continue;\n if (mutations[i].type === \"childList\") {\n mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.add(node));\n mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.add(node));\n }\n if (mutations[i].type === \"attributes\") {\n let el = mutations[i].target;\n let name = mutations[i].attributeName;\n let oldValue = mutations[i].oldValue;\n let add = () => {\n if (!addedAttributes.has(el))\n addedAttributes.set(el, []);\n addedAttributes.get(el).push({ name, value: el.getAttribute(name) });\n };\n let remove = () => {\n if (!removedAttributes.has(el))\n removedAttributes.set(el, []);\n removedAttributes.get(el).push(name);\n };\n if (el.hasAttribute(name) && oldValue === null) {\n add();\n } else if (el.hasAttribute(name)) {\n remove();\n add();\n } else {\n remove();\n }\n }\n }\n removedAttributes.forEach((attrs, el) => {\n cleanupAttributes(el, attrs);\n });\n addedAttributes.forEach((attrs, el) => {\n onAttributeAddeds.forEach((i) => i(el, attrs));\n });\n for (let node of removedNodes) {\n if (addedNodes.has(node))\n continue;\n onElRemoveds.forEach((i) => i(node));\n }\n addedNodes.forEach((node) => {\n node._x_ignoreSelf = true;\n node._x_ignore = true;\n });\n for (let node of addedNodes) {\n if (removedNodes.has(node))\n continue;\n if (!node.isConnected)\n continue;\n delete node._x_ignoreSelf;\n delete node._x_ignore;\n onElAddeds.forEach((i) => i(node));\n node._x_ignore = true;\n node._x_ignoreSelf = true;\n }\n addedNodes.forEach((node) => {\n delete node._x_ignoreSelf;\n delete node._x_ignore;\n });\n addedNodes = null;\n removedNodes = null;\n addedAttributes = null;\n removedAttributes = null;\n}\n\n// packages/alpinejs/src/scope.js\nfunction scope(node) {\n return mergeProxies(closestDataStack(node));\n}\nfunction addScopeToNode(node, data2, referenceNode) {\n node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];\n return () => {\n node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);\n };\n}\nfunction closestDataStack(node) {\n if (node._x_dataStack)\n return node._x_dataStack;\n if (typeof ShadowRoot === \"function\" && node instanceof ShadowRoot) {\n return closestDataStack(node.host);\n }\n if (!node.parentNode) {\n return [];\n }\n return closestDataStack(node.parentNode);\n}\nfunction mergeProxies(objects) {\n return new Proxy({ objects }, mergeProxyTrap);\n}\nvar mergeProxyTrap = {\n ownKeys({ objects }) {\n return Array.from(\n new Set(objects.flatMap((i) => Object.keys(i)))\n );\n },\n has({ objects }, name) {\n if (name == Symbol.unscopables)\n return false;\n return objects.some(\n (obj) => Object.prototype.hasOwnProperty.call(obj, name) || Reflect.has(obj, name)\n );\n },\n get({ objects }, name, thisProxy) {\n if (name == \"toJSON\")\n return collapseProxies;\n return Reflect.get(\n objects.find(\n (obj) => Reflect.has(obj, name)\n ) || {},\n name,\n thisProxy\n );\n },\n set({ objects }, name, value, thisProxy) {\n const target = objects.find(\n (obj) => Object.prototype.hasOwnProperty.call(obj, name)\n ) || objects[objects.length - 1];\n const descriptor = Object.getOwnPropertyDescriptor(target, name);\n if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get))\n return descriptor.set.call(thisProxy, value) || true;\n return Reflect.set(target, name, value);\n }\n};\nfunction collapseProxies() {\n let keys = Reflect.ownKeys(this);\n return keys.reduce((acc, key) => {\n acc[key] = Reflect.get(this, key);\n return acc;\n }, {});\n}\n\n// packages/alpinejs/src/interceptor.js\nfunction initInterceptors(data2) {\n let isObject = (val) => typeof val === \"object\" && !Array.isArray(val) && val !== null;\n let recurse = (obj, basePath = \"\") => {\n Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => {\n if (enumerable === false || value === void 0)\n return;\n if (typeof value === \"object\" && value !== null && value.__v_skip)\n return;\n let path = basePath === \"\" ? key : `${basePath}.${key}`;\n if (typeof value === \"object\" && value !== null && value._x_interceptor) {\n obj[key] = value.initialize(data2, path, key);\n } else {\n if (isObject(value) && value !== obj && !(value instanceof Element)) {\n recurse(value, path);\n }\n }\n });\n };\n return recurse(data2);\n}\nfunction interceptor(callback, mutateObj = () => {\n}) {\n let obj = {\n initialValue: void 0,\n _x_interceptor: true,\n initialize(data2, path, key) {\n return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);\n }\n };\n mutateObj(obj);\n return (initialValue) => {\n if (typeof initialValue === \"object\" && initialValue !== null && initialValue._x_interceptor) {\n let initialize = obj.initialize.bind(obj);\n obj.initialize = (data2, path, key) => {\n let innerValue = initialValue.initialize(data2, path, key);\n obj.initialValue = innerValue;\n return initialize(data2, path, key);\n };\n } else {\n obj.initialValue = initialValue;\n }\n return obj;\n };\n}\nfunction get(obj, path) {\n return path.split(\".\").reduce((carry, segment) => carry[segment], obj);\n}\nfunction set(obj, path, value) {\n if (typeof path === \"string\")\n path = path.split(\".\");\n if (path.length === 1)\n obj[path[0]] = value;\n else if (path.length === 0)\n throw error;\n else {\n if (obj[path[0]])\n return set(obj[path[0]], path.slice(1), value);\n else {\n obj[path[0]] = {};\n return set(obj[path[0]], path.slice(1), value);\n }\n }\n}\n\n// packages/alpinejs/src/magics.js\nvar magics = {};\nfunction magic(name, callback) {\n magics[name] = callback;\n}\nfunction injectMagics(obj, el) {\n let memoizedUtilities = getUtilities(el);\n Object.entries(magics).forEach(([name, callback]) => {\n Object.defineProperty(obj, `$${name}`, {\n get() {\n return callback(el, memoizedUtilities);\n },\n enumerable: false\n });\n });\n return obj;\n}\nfunction getUtilities(el) {\n let [utilities, cleanup] = getElementBoundUtilities(el);\n let utils = { interceptor, ...utilities };\n onElRemoved(el, cleanup);\n return utils;\n}\n\n// packages/alpinejs/src/utils/error.js\nfunction tryCatch(el, expression, callback, ...args) {\n try {\n return callback(...args);\n } catch (e) {\n handleError(e, el, expression);\n }\n}\nfunction handleError(error2, el, expression = void 0) {\n error2 = Object.assign(\n error2 != null ? error2 : { message: \"No error message given.\" },\n { el, expression }\n );\n console.warn(`Alpine Expression Error: ${error2.message}\n\n${expression ? 'Expression: \"' + expression + '\"\\n\\n' : \"\"}`, el);\n setTimeout(() => {\n throw error2;\n }, 0);\n}\n\n// packages/alpinejs/src/evaluator.js\nvar shouldAutoEvaluateFunctions = true;\nfunction dontAutoEvaluateFunctions(callback) {\n let cache = shouldAutoEvaluateFunctions;\n shouldAutoEvaluateFunctions = false;\n let result = callback();\n shouldAutoEvaluateFunctions = cache;\n return result;\n}\nfunction evaluate(el, expression, extras = {}) {\n let result;\n evaluateLater(el, expression)((value) => result = value, extras);\n return result;\n}\nfunction evaluateLater(...args) {\n return theEvaluatorFunction(...args);\n}\nvar theEvaluatorFunction = normalEvaluator;\nfunction setEvaluator(newEvaluator) {\n theEvaluatorFunction = newEvaluator;\n}\nfunction normalEvaluator(el, expression) {\n let overriddenMagics = {};\n injectMagics(overriddenMagics, el);\n let dataStack = [overriddenMagics, ...closestDataStack(el)];\n let evaluator = typeof expression === \"function\" ? generateEvaluatorFromFunction(dataStack, expression) : generateEvaluatorFromString(dataStack, expression, el);\n return tryCatch.bind(null, el, expression, evaluator);\n}\nfunction generateEvaluatorFromFunction(dataStack, func) {\n return (receiver = () => {\n }, { scope: scope2 = {}, params = [] } = {}) => {\n let result = func.apply(mergeProxies([scope2, ...dataStack]), params);\n runIfTypeOfFunction(receiver, result);\n };\n}\nvar evaluatorMemo = {};\nfunction generateFunctionFromString(expression, el) {\n if (evaluatorMemo[expression]) {\n return evaluatorMemo[expression];\n }\n let AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor;\n let rightSideSafeExpression = /^[\\n\\s]*if.*\\(.*\\)/.test(expression.trim()) || /^(let|const)\\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression;\n const safeAsyncFunction = () => {\n try {\n let func2 = new AsyncFunction(\n [\"__self\", \"scope\"],\n `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`\n );\n Object.defineProperty(func2, \"name\", {\n value: `[Alpine] ${expression}`\n });\n return func2;\n } catch (error2) {\n handleError(error2, el, expression);\n return Promise.resolve();\n }\n };\n let func = safeAsyncFunction();\n evaluatorMemo[expression] = func;\n return func;\n}\nfunction generateEvaluatorFromString(dataStack, expression, el) {\n let func = generateFunctionFromString(expression, el);\n return (receiver = () => {\n }, { scope: scope2 = {}, params = [] } = {}) => {\n func.result = void 0;\n func.finished = false;\n let completeScope = mergeProxies([scope2, ...dataStack]);\n if (typeof func === \"function\") {\n let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression));\n if (func.finished) {\n runIfTypeOfFunction(receiver, func.result, completeScope, params, el);\n func.result = void 0;\n } else {\n promise.then((result) => {\n runIfTypeOfFunction(receiver, result, completeScope, params, el);\n }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0);\n }\n }\n };\n}\nfunction runIfTypeOfFunction(receiver, value, scope2, params, el) {\n if (shouldAutoEvaluateFunctions && typeof value === \"function\") {\n let result = value.apply(scope2, params);\n if (result instanceof Promise) {\n result.then((i) => runIfTypeOfFunction(receiver, i, scope2, params)).catch((error2) => handleError(error2, el, value));\n } else {\n receiver(result);\n }\n } else if (typeof value === \"object\" && value instanceof Promise) {\n value.then((i) => receiver(i));\n } else {\n receiver(value);\n }\n}\n\n// packages/alpinejs/src/directives.js\nvar prefixAsString = \"x-\";\nfunction prefix(subject = \"\") {\n return prefixAsString + subject;\n}\nfunction setPrefix(newPrefix) {\n prefixAsString = newPrefix;\n}\nvar directiveHandlers = {};\nfunction directive(name, callback) {\n directiveHandlers[name] = callback;\n return {\n before(directive2) {\n if (!directiveHandlers[directive2]) {\n console.warn(String.raw`Cannot find directive \\`${directive2}\\`. \\`${name}\\` will use the default order of execution`);\n return;\n }\n const pos = directiveOrder.indexOf(directive2);\n directiveOrder.splice(pos >= 0 ? pos : directiveOrder.indexOf(\"DEFAULT\"), 0, name);\n }\n };\n}\nfunction directiveExists(name) {\n return Object.keys(directiveHandlers).includes(name);\n}\nfunction directives(el, attributes, originalAttributeOverride) {\n attributes = Array.from(attributes);\n if (el._x_virtualDirectives) {\n let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value }));\n let staticAttributes = attributesOnly(vAttributes);\n vAttributes = vAttributes.map((attribute) => {\n if (staticAttributes.find((attr) => attr.name === attribute.name)) {\n return {\n name: `x-bind:${attribute.name}`,\n value: `\"${attribute.value}\"`\n };\n }\n return attribute;\n });\n attributes = attributes.concat(vAttributes);\n }\n let transformedAttributeMap = {};\n let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);\n return directives2.map((directive2) => {\n return getDirectiveHandler(el, directive2);\n });\n}\nfunction attributesOnly(attributes) {\n return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));\n}\nvar isDeferringHandlers = false;\nvar directiveHandlerStacks = /* @__PURE__ */ new Map();\nvar currentHandlerStackKey = Symbol();\nfunction deferHandlingDirectives(callback) {\n isDeferringHandlers = true;\n let key = Symbol();\n currentHandlerStackKey = key;\n directiveHandlerStacks.set(key, []);\n let flushHandlers = () => {\n while (directiveHandlerStacks.get(key).length)\n directiveHandlerStacks.get(key).shift()();\n directiveHandlerStacks.delete(key);\n };\n let stopDeferring = () => {\n isDeferringHandlers = false;\n flushHandlers();\n };\n callback(flushHandlers);\n stopDeferring();\n}\nfunction getElementBoundUtilities(el) {\n let cleanups = [];\n let cleanup = (callback) => cleanups.push(callback);\n let [effect3, cleanupEffect] = elementBoundEffect(el);\n cleanups.push(cleanupEffect);\n let utilities = {\n Alpine: alpine_default,\n effect: effect3,\n cleanup,\n evaluateLater: evaluateLater.bind(evaluateLater, el),\n evaluate: evaluate.bind(evaluate, el)\n };\n let doCleanup = () => cleanups.forEach((i) => i());\n return [utilities, doCleanup];\n}\nfunction getDirectiveHandler(el, directive2) {\n let noop = () => {\n };\n let handler4 = directiveHandlers[directive2.type] || noop;\n let [utilities, cleanup] = getElementBoundUtilities(el);\n onAttributeRemoved(el, directive2.original, cleanup);\n let fullHandler = () => {\n if (el._x_ignore || el._x_ignoreSelf)\n return;\n handler4.inline && handler4.inline(el, directive2, utilities);\n handler4 = handler4.bind(handler4, el, directive2, utilities);\n isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4();\n };\n fullHandler.runCleanups = cleanup;\n return fullHandler;\n}\nvar startingWith = (subject, replacement) => ({ name, value }) => {\n if (name.startsWith(subject))\n name = name.replace(subject, replacement);\n return { name, value };\n};\nvar into = (i) => i;\nfunction toTransformedAttributes(callback = () => {\n}) {\n return ({ name, value }) => {\n let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => {\n return transform(carry);\n }, { name, value });\n if (newName !== name)\n callback(newName, name);\n return { name: newName, value: newValue };\n };\n}\nvar attributeTransformers = [];\nfunction mapAttributes(callback) {\n attributeTransformers.push(callback);\n}\nfunction outNonAlpineAttributes({ name }) {\n return alpineAttributeRegex().test(name);\n}\nvar alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\\\b`);\nfunction toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {\n return ({ name, value }) => {\n let typeMatch = name.match(alpineAttributeRegex());\n let valueMatch = name.match(/:([a-zA-Z0-9\\-_:]+)/);\n let modifiers = name.match(/\\.[^.\\]]+(?=[^\\]]*$)/g) || [];\n let original = originalAttributeOverride || transformedAttributeMap[name] || name;\n return {\n type: typeMatch ? typeMatch[1] : null,\n value: valueMatch ? valueMatch[1] : null,\n modifiers: modifiers.map((i) => i.replace(\".\", \"\")),\n expression: value,\n original\n };\n };\n}\nvar DEFAULT = \"DEFAULT\";\nvar directiveOrder = [\n \"ignore\",\n \"ref\",\n \"data\",\n \"id\",\n \"anchor\",\n \"bind\",\n \"init\",\n \"for\",\n \"model\",\n \"modelable\",\n \"transition\",\n \"show\",\n \"if\",\n DEFAULT,\n \"teleport\"\n];\nfunction byPriority(a, b) {\n let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;\n let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;\n return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);\n}\n\n// packages/alpinejs/src/utils/dispatch.js\nfunction dispatch(el, name, detail = {}) {\n el.dispatchEvent(\n new CustomEvent(name, {\n detail,\n bubbles: true,\n // Allows events to pass the shadow DOM barrier.\n composed: true,\n cancelable: true\n })\n );\n}\n\n// packages/alpinejs/src/utils/walk.js\nfunction walk(el, callback) {\n if (typeof ShadowRoot === \"function\" && el instanceof ShadowRoot) {\n Array.from(el.children).forEach((el2) => walk(el2, callback));\n return;\n }\n let skip = false;\n callback(el, () => skip = true);\n if (skip)\n return;\n let node = el.firstElementChild;\n while (node) {\n walk(node, callback, false);\n node = node.nextElementSibling;\n }\n}\n\n// packages/alpinejs/src/utils/warn.js\nfunction warn(message, ...args) {\n console.warn(`Alpine Warning: ${message}`, ...args);\n}\n\n// packages/alpinejs/src/lifecycle.js\nvar started = false;\nfunction start() {\n if (started)\n warn(\"Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.\");\n started = true;\n if (!document.body)\n warn(\"Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's `