From dfa86dcb277023735c4e4fcc045cd409665a955c Mon Sep 17 00:00:00 2001 From: Moussa Gerges Date: Mon, 16 Mar 2026 18:27:02 +0100 Subject: [PATCH 1/9] Add support for external subscriptions in reimbursable deposits endpoint --- backend/treasury/tests.py | 32 ++++++++++++++++++++++++++++++++ backend/treasury/views.py | 11 +++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/backend/treasury/tests.py b/backend/treasury/tests.py index 9619e3da3..98f5ea3db 100644 --- a/backend/treasury/tests.py +++ b/backend/treasury/tests.py @@ -1031,6 +1031,38 @@ def test_reimbursable_deposits_excludes_reimbursed(self): self.assertEqual(response.status_code, 200) self.assertFalse(any(r["id"] == sub.pk for r in response.data)) + def test_reimbursable_deposits_supports_external_subscription(self): + """External subscriptions (without profile) should not crash endpoint.""" + profile = _create_profile("board@esnpolimi.it") + user = _create_user(profile) + self.authenticate(user) + + event = _create_event(cost=10, deposit=5) + list_main = _create_event_list(event) + account = _create_account("Main", user=user) + sub = Subscription.objects.create( + profile=None, + external_name="John External", + event=event, + list=list_main, + ) + Transaction.objects.create( + subscription=sub, + account=account, + executor=user, + type=Transaction.TransactionType.CAUZIONE, + amount=5, + description="Cauzione" + ) + + response = self.client.get(f"/backend/reimbursable_deposits/?event={event.pk}&list={list_main.pk}") + + self.assertEqual(response.status_code, 200) + entry = next((r for r in response.data if r["id"] == sub.pk), None) + self.assertIsNotNone(entry) + self.assertIsNone(entry["profile_id"]) + self.assertEqual(entry["profile_name"], "John External") + class TransactionsExportTests(TreasuryBaseTestCase): """Tests for transactions export endpoint.""" diff --git a/backend/treasury/views.py b/backend/treasury/views.py index 88ea86b00..d3a14d210 100644 --- a/backend/treasury/views.py +++ b/backend/treasury/views.py @@ -726,10 +726,17 @@ def reimbursable_deposits(request): reimbursed = Transaction.objects.filter(subscription=sub, type=Transaction.TransactionType.RIMBORSO_CAUZIONE).exists() if deposit_tx and not reimbursed: + profile_id = sub.profile.id if sub.profile else None + if sub.profile: + profile_name = f"{sub.profile.name} {sub.profile.surname}" + elif sub.external_name: + profile_name = sub.external_name + else: + profile_name = "Esterno" result.append({ "id": sub.pk, - "profile_id": sub.profile.id, - "profile_name": f"{sub.profile.name} {sub.profile.surname}", + "profile_id": profile_id, + "profile_name": profile_name, "account_name": deposit_tx.account.name if deposit_tx.account else None }) return Response(result, status=200) From 3ca343bdc8de8779c3aea34ba246806d26604e09 Mon Sep 17 00:00:00 2001 From: Moussa Gerges Date: Sat, 21 Mar 2026 13:02:55 +0100 Subject: [PATCH 2/9] Refactor content management permissions and update related comments for clarity --- backend/content/views.py | 22 ++++++---------------- backend/users/models.py | 2 +- backend/users/serializers.py | 13 +++---------- backend/users/views.py | 8 ++++---- frontend/src/Pages/profiles/Profile.jsx | 6 +++--- 5 files changed, 17 insertions(+), 34 deletions(-) diff --git a/backend/content/views.py b/backend/content/views.py index 3849d002c..643a43569 100644 --- a/backend/content/views.py +++ b/backend/content/views.py @@ -121,7 +121,7 @@ class IsContentManagerOrReadOnly(permissions.BasePermission): """ Custom permission for content management. - GET: All authenticated users - - POST/PUT/PATCH/DELETE: Board, Attivi, or users with can_manage_content flag + - POST/PUT/PATCH/DELETE: Board users or users with can_manage_content flag """ def has_permission(self, request, view): if request.method in permissions.SAFE_METHODS: @@ -131,15 +131,8 @@ def has_permission(self, request, view): if not user or not user.is_authenticated: return False - # Board and Attivi always have permission - if user.groups.filter(name__in=['Board', 'Attivi']).exists(): - return True - - # Users with content/finance management flags - if getattr(user, 'can_manage_content', False) or getattr(user, 'can_manage_casse', False): - return True - - return False + # Content management is implicit for Board and explicit via a dedicated flag for others. + return user.groups.filter(name='Board').exists() or getattr(user, 'can_manage_content', False) class ContentSectionViewSet(viewsets.ModelViewSet): @@ -189,7 +182,7 @@ def perform_create(self, serializer): def whatsapp_config(request): """ GET /backend/content/whatsapp-config/ → returns the current WhatsApp link. - PATCH /backend/content/whatsapp-config/ → updates the link (board/attivi only). + PATCH /backend/content/whatsapp-config/ → updates the link (Board or content managers). """ instance = WhatsAppConfig.get_instance() @@ -197,12 +190,9 @@ def whatsapp_config(request): serializer = WhatsAppConfigSerializer(instance) return Response(serializer.data) - # PATCH – board/attivi or content managers can edit + # PATCH – Board or content managers can edit user = request.user - can_edit = ( - user.groups.filter(name__in=['Board', 'Attivi']).exists() - or getattr(user, 'can_manage_content', False) - ) + can_edit = user.groups.filter(name='Board').exists() or getattr(user, 'can_manage_content', False) if not can_edit: return Response({'detail': 'Permission denied.'}, status=drf_status.HTTP_403_FORBIDDEN) diff --git a/backend/users/models.py b/backend/users/models.py index 0a351c872..93322c4ae 100644 --- a/backend/users/models.py +++ b/backend/users/models.py @@ -15,7 +15,7 @@ class User(AbstractBaseUser, PermissionsMixin): last_login = models.DateTimeField(null=True, blank=True) # Override last_login, to be NULL initially can_manage_casse = models.BooleanField(default=False) # Board-granted for Aspiranti can_view_casse_import = models.BooleanField(default=False) # Board-granted for Aspiranti - can_manage_content = models.BooleanField(default=False) # Board-granted for Aspiranti/Attivi + can_manage_content = models.BooleanField(default=False) # Explicitly granted; Board has implicit access USERNAME_FIELD = 'profile' REQUIRED_FIELDS = [] diff --git a/backend/users/serializers.py b/backend/users/serializers.py index 326a16d8b..db50b0927 100644 --- a/backend/users/serializers.py +++ b/backend/users/serializers.py @@ -70,11 +70,8 @@ def get_permissions(cls, obj): user_permissions = obj.user_permissions.values_list('codename', flat=True) group_permissions = obj.groups.values_list('permissions__codename', flat=True) permissions = set(user_permissions).union(set(group_permissions)) - # Virtual permission: manage_content — granted to Board, Attivi, or flagged users - if ( - obj.groups.filter(name__in=['Board', 'Attivi']).exists() - or getattr(obj, 'can_manage_content', False) - ): + # Virtual permission: manage_content — implicit for Board, explicit for flagged users. + if obj.groups.filter(name='Board').exists() or getattr(obj, 'can_manage_content', False): permissions.add('manage_content') return list(permissions) @@ -97,11 +94,7 @@ def get_effective_can_view_casse_import(self, obj): ) def get_effective_can_manage_content(self, obj): - return ( - obj.can_manage_content - or self._is_in(obj, 'Attivi') - or self._is_in(obj, 'Board') - ) + return obj.can_manage_content or self._is_in(obj, 'Board') def get_restricted_accounts(self, obj): if self._is_in(obj, 'Board'): diff --git a/backend/users/views.py b/backend/users/views.py index c7f4bdd7e..96063ec27 100644 --- a/backend/users/views.py +++ b/backend/users/views.py @@ -335,7 +335,7 @@ def _in_group(user, name: str): def user_finance_permissions(request): """ GET: Return raw and effective finance permission flags. - PATCH: Board only. Allowed only if target is ESNer in group 'Aspiranti'. + PATCH: Board only. Allowed only if target is ESNer. """ email = request.query_params.get("email") if not email: @@ -352,7 +352,7 @@ def effective_view(u): return u.can_view_casse_import or _in_group(u, 'Attivi') or _in_group(u, 'Board') def effective_content(u): - return u.can_manage_content or _in_group(u, 'Attivi') or _in_group(u, 'Board') + return u.can_manage_content or _in_group(u, 'Board') if request.method == 'GET': return Response({ @@ -376,8 +376,8 @@ def effective_content(u): if finance_fields and not _in_group(target, 'Aspiranti'): return Response({'error': 'Permessi casse applicabili solo agli Aspiranti.'}, status=400) - if content_fields and not (_in_group(target, 'Aspiranti') or _in_group(target, 'Attivi')): - return Response({'error': 'Ruolo Content Manager applicabile solo ad Aspiranti e Attivi.'}, status=400) + if content_fields and not target.profile.is_esner: + return Response({'error': 'Ruolo Content Manager applicabile solo agli ESNer.'}, status=400) serializer = FinancePermissionSerializer(target, data=request.data, partial=True) if serializer.is_valid(): diff --git a/frontend/src/Pages/profiles/Profile.jsx b/frontend/src/Pages/profiles/Profile.jsx index 1527ed855..1918692bb 100644 --- a/frontend/src/Pages/profiles/Profile.jsx +++ b/frontend/src/Pages/profiles/Profile.jsx @@ -1373,10 +1373,10 @@ export default function Profile() { )} - {/* Content Manager role toggle (Board → ESNer Aspiranti/Attivi) */} - {user?.groups?.includes('Board') && profileType === 'ESNer' && ['Aspiranti', 'Attivi'].includes(profile?.group) && ( + {/* Content Manager role toggle (Board → ESNer; Board target users inherit the role) */} + {user?.groups?.includes('Board') && profileType === 'ESNer' && ( financePerms && financePerms.can_manage_content !== financePerms.effective_can_manage_content ? ( - + + + + + setConfirmDialog({open: false, action: null, message: ''})} + /> + {popup && } + + )} + + + ); +} diff --git a/frontend/src/Pages/events/Event.jsx b/frontend/src/Pages/events/Event.jsx index 8b9afbb1d..a4ef69799 100644 --- a/frontend/src/Pages/events/Event.jsx +++ b/frontend/src/Pages/events/Event.jsx @@ -17,7 +17,7 @@ import Popup from "../../Components/Popup"; import SubscriptionModal from "../../Components/events/SubscriptionModal"; import MoveToListModal from "../../Components/events/MoveToListModal"; import ReimburseDepositsModal from "../../Components/events/ReimburseDepositsModal"; -import ReimburseQuotaModal from "../../Components/events/ReimburseQuotaModal"; +import ReimburseSelectionModal from "../../Components/events/ReimburseSelectionModal"; import PrintableLiberatorieModal from "../../Components/events/PrintableLiberatorieModal"; import dayjs from "dayjs"; import FestivalIcon from "@mui/icons-material/Festival"; @@ -45,7 +45,7 @@ export default function Event() { const [subscriptionModalOpen, setSubscriptionModalOpen] = useState(false); const [moveToListModalOpen, setMoveToListModalOpen] = useState(false); const [reimburseDepositsModalOpen, setReimburseDepositsModalOpen] = useState(false); - const [reimburseQuotaModalOpen, setReimburseQuotaModalOpen] = useState(false); + const [reimburseSelectionModalOpen, setReimburseSelectionModalOpen] = useState(false); const [printableLiberatorieModalOpen, setPrintableLiberatorieModalOpen] = useState(false); const [printableLiberatorieListId, setPrintableLiberatorieListId] = useState(null); const [selectedRows, setSelectedRows] = useState([]); @@ -60,7 +60,6 @@ export default function Event() { const [subscriptionIsEdit, setSubscriptionIsEdit] = useState(null); const [reimburseDepositsListId, setReimburseDepositsListId] = useState(null); const [singleSubToReimburse, setSingleSubToReimburse] = useState(null); - const [singleSubToReimburseQuota, setSingleSubToReimburseQuota] = useState(null); const [editAnswersModalOpen, setEditAnswersModalOpen] = useState(false); const [editAnswersSubscription, setEditAnswersSubscription] = useState(null); const hasDeposit = data?.deposit > 0; @@ -173,14 +172,14 @@ export default function Event() { }; const handleOpenReimburseDeposits = (subscription, listId) => { - setSingleSubToReimburse(subscription); + setSingleSubToReimburse(subscription || null); setReimburseDepositsListId(listId); setReimburseDepositsModalOpen(true); }; - const handleOpenReimburseQuota = (subscription) => { - setSingleSubToReimburseQuota(subscription); - setReimburseQuotaModalOpen(true); + const handleOpenReimburseMenu = (subscription) => { + setSingleSubToReimburse(subscription); + setReimburseSelectionModalOpen(true); }; @@ -215,13 +214,13 @@ export default function Event() { setSingleSubToReimburse(null); }; - const handleCloseReimburseQuotaModal = (success, message) => { - setReimburseQuotaModalOpen(false); + const handleCloseReimburseSelectionModal = (success, message) => { + setReimburseSelectionModalOpen(false); if (success) { setPopup({message: message, state: "success", id: Date.now()}); refreshEventData(); } - setSingleSubToReimburseQuota(null); + setSingleSubToReimburse(null); }; @@ -290,12 +289,13 @@ export default function Event() { refreshEventData={refreshEventData} /> )} - {reimburseQuotaModalOpen && ( - )} {printableLiberatorieModalOpen && ( @@ -516,7 +516,7 @@ export default function Event() { onEditSubscription={handleEditSubscription} onMoveToList={handleMoveToList} onOpenReimburseDeposits={handleOpenReimburseDeposits} - onOpenReimburseQuota={handleOpenReimburseQuota} + onOpenReimburseMenu={handleOpenReimburseMenu} onOpenPrintableLibetatorie={handleOpenPrintableLibetatorie} onOpenEditAnswers={handleOpenEditAnswers} canChangeSubscription={canManageSubscriptions} From c1b32bf4d2855b69f5be51284079c82d83b5cfb0 Mon Sep 17 00:00:00 2001 From: Moussa Gerges Date: Tue, 31 Mar 2026 22:23:22 +0200 Subject: [PATCH 6/9] feat: Add ESNcard revocation feature and update transaction types - Modified TransactionModal to include 'rimborso_esncard' in deletable transaction types and negative types. - Enhanced Profile component to support revoking the latest ESNcard, including confirmation dialog and API integration for deletion. - Updated transactionConfigs to include configuration for 'rimborso_esncard'. - Added display name for 'rimborso_esncard' in displayAttributes. --- backend/Project Documentation/00_OVERVIEW.md | 129 ++++++------ .../Project Documentation/01_USERS_MODULE.md | 114 +++++----- .../02_PROFILES_MODULE.md | 120 ++++++----- .../Project Documentation/03_EVENTS_MODULE.md | 150 +++++++------- .../04_TREASURY_MODULE.md | 169 ++++++++------- .../05_CONTENT_MODULE.md | 84 ++++---- .../06_INTEGRATION_E2E.md | 193 ++++++++--------- .../07_MAINTENANCE_MODULE.md | 121 ++++++----- .../TEST_COVERAGE_REPORT.md | 109 +++++----- backend/README_APIs.md | 81 +++++--- backend/README_Content.md | 170 +++++++-------- backend/README_Models.md | 48 ++--- backend/treasury/models.py | 6 + backend/treasury/tests.py | 196 ++++++++++++++++++ backend/treasury/views.py | 98 ++++++++- .../{index-B060htL7.js => index-CD2rGuOx.js} | 154 +++++++------- frontend/build/index.html | 2 +- .../Components/treasury/TransactionModal.jsx | 4 +- frontend/src/Pages/profiles/Profile.jsx | 90 +++++++- frontend/src/data/transactionConfigs.js | 1 + frontend/src/utils/displayAttributes.jsx | 1 + 21 files changed, 1242 insertions(+), 798 deletions(-) rename frontend/build/assets/{index-B060htL7.js => index-CD2rGuOx.js} (64%) diff --git a/backend/Project Documentation/00_OVERVIEW.md b/backend/Project Documentation/00_OVERVIEW.md index 9229edf88..251f66b7d 100644 --- a/backend/Project Documentation/00_OVERVIEW.md +++ b/backend/Project Documentation/00_OVERVIEW.md @@ -1,82 +1,82 @@ # ESN Polimi Management - Technical System Overview -Questo documento e la vista architetturale di riferimento del progetto. -Scopo: fornire una baseline tecnica chiara per sviluppo, manutenzione, onboarding e automazione AI. +This document is the reference architectural view of the project. +Purpose: provide a clear technical baseline for development, maintenance, onboarding, and AI automation. ## 1. Product Scope -Il sistema copre i processi core ESN Polimi: +The system covers ESN Polimi core processes: -- gestione anagrafiche Erasmus ed ESNer -- onboarding con verifica email -- gestione eventi, liste, iscrizioni e form pubblici -- pagamenti e rimborsi (quota, cauzione, servizi) -- tesoreria (casse, transazioni, export) -- contenuti dinamici homepage -- registrazione WhatsApp pubblica con audit -- gestione stato manutenzione applicativa +- Erasmus and ESNer profile management +- onboarding with email verification +- event, list, subscription, and public-form management +- payments and reimbursements (fee, deposit, services) +- treasury operations (accounts, transactions, export) +- dynamic homepage content +- public WhatsApp registration with audit trail +- maintenance state management ## 2. Architecture Snapshot ### 2.1 Backend - framework: Django + Django REST Framework -- autenticazione: JWT (SimpleJWT access/refresh) +- authentication: JWT (SimpleJWT access/refresh) - database: MySQL (dev/prod), SQLite (test) -- pattern: modular monolith per dominio applicativo +- pattern: modular monolith by application domain ### 2.2 Frontend - stack: React 19 + Vite + MUI -- routing: SPA con route protette +- routing: SPA with protected routes - API base URL: - local: http://localhost:8000/backend - prod: https://mgmt.esnpolimi.it/backend ### 2.3 External Integrations -- Google Drive API: upload file form + append CSV audit +- Google Drive API: form file upload + CSV audit append - SumUp API: checkout, payment confirmation, webhook reconciliation -- SMTP: invio email operative/transazionali -- Sentry: error tracking in produzione -- OIDC provider: integrazione Dokuwiki +- SMTP: operational/transactional email delivery +- Sentry: error tracking in production +- OIDC provider: Dokuwiki integration ## 3. Domain Boundaries -| Modulo | Responsabilita | Dipendenze logiche | +| Module | Responsibilities | Logical Dependencies | |---|---|---| -| users | auth, gestione utenti e gruppi, permessi speciali | profiles | -| profiles | profili, documenti, verifica email, ricerca | users, events | -| events | eventi, liste, iscrizioni, form, pagamenti | profiles, treasury | -| treasury | casse, transazioni, ESNcard, rimborsi | profiles, events, users | -| content | contenuti homepage, WhatsApp config/register | users | -| maintenance | stato manutenzione e notifiche | - | +| users | auth, user/group management, special permissions | profiles | +| profiles | profiles, documents, email verification, search | users, events | +| events | events, lists, subscriptions, forms, payments | profiles, treasury | +| treasury | accounts, transactions, ESNcard, reimbursements | profiles, events, users | +| content | homepage content, WhatsApp config/register | users | +| maintenance | maintenance state and notifications | - | ## 4. Authorization Model -### 4.1 Gruppi +### 4.1 Groups - Board - Attivi - Aspiranti -### 4.2 Flag custom utente +### 4.2 Custom User Flags - can_manage_casse - can_view_casse_import - can_manage_content -### 4.3 Regole globali +### 4.3 Global Rules -1. Board mantiene privilegi impliciti estesi su quasi tutti i moduli. -2. Attivi puo operare su aree treasury in base ai permessi endpoint. -3. Aspiranti richiede flag espliciti per funzioni extra. -4. Content manager e Board oppure can_manage_content=true. -5. Alcuni endpoint applicano object-level permissions (owner/staff/Board). +1. Board has broad implicit privileges across most modules. +2. Attivi can operate in treasury areas based on endpoint permissions. +3. Aspiranti require explicit flags for extra capabilities. +4. A content manager is either Board or has `can_manage_content=true`. +5. Some endpoints enforce object-level permissions (owner/staff/Board). ## 5. API Surface Map -Prefisso comune backend: /backend/ +Common backend prefix: /backend/ - users: /login/, /logout/, /api/token/*, /users/*, /groups/ - profiles: /erasmus_profiles/, /esner_profiles/, /profile/*, /document/* @@ -92,22 +92,22 @@ Prefisso comune backend: /backend/ 3. office subscription flow: events + treasury 4. public form subscription flow: events + profiles + treasury 5. SumUp online payment reconciliation: events + treasury -6. reimbursement flow (quota/cauzione/servizi): treasury + events -7. ESNcard issuance flow: treasury + profiles +6. reimbursement flow (fee/deposit/services): treasury + events +7. ESNcard issuance/revocation flow: treasury + profiles 8. WhatsApp public registration flow: content + email + drive -Dettagli operativi nei documenti modulo 01-06. +Operational details are available in module documents 01-06. ## 7. Configuration and Environments -Settings principali: +Primary settings files: - backend/settings/base.py - backend/settings/dev.py - backend/settings/prod.py - backend/settings/test.py -Variabili sensibili principali: +Primary sensitive variables: - SECRET_KEY - SIMPLE_JWT_SIGNING_KEY @@ -123,25 +123,26 @@ Variabili sensibili principali: ## 8. Observability and Audit -- logging backend su file in produzione -- audit middleware per context DB/action -- Sentry con tracing configurabile -- maintenance notification persistita in maintenance_notification.json +- backend file logging in production +- audit middleware for DB/action context +- Sentry with configurable tracing +- maintenance notification persisted in `maintenance_notification.json` ## 9. Technical Constraints and Invariants -1. Coerenza saldo account deve essere preservata su create/update/delete transazioni. -2. Pagamenti online e webhook devono essere trattati in modo idempotente. -3. Vincoli permessi non devono essere bypassati lato API. -4. I campi dinamici evento devono rispettare schema JSON previsto. -5. I flussi esterni senza profile (iscritti esterni) devono essere sempre gestiti nei rimborsi. +1. Account balance consistency must be preserved on transaction create/update/delete. +2. Online payments and webhooks must be handled idempotently. +3. Permission constraints must not be bypassed at API level. +4. Dynamic event fields must respect the expected JSON schema. +5. External flows without profile (external subscribers) must always be handled in reimbursements. +6. ESNcard revocation must preserve the original emission transaction and register a dedicated refund transaction. ## 10. AI/Automation Notes -1. Verificare sempre urls.py per endpoint effettivi e non assumere naming legacy. -2. Per pagamenti usare insieme logica events e treasury. -3. Non assumere che Subscription.profile sia sempre valorizzato. -4. In content, Board e can_manage_content sono le sole condizioni di gestione. +1. Always check `urls.py` for actual endpoints and avoid assuming legacy naming. +2. For payments, evaluate `events` and `treasury` logic together. +3. Do not assume `Subscription.profile` is always set. +4. In content, only Board and `can_manage_content` enable management actions. ## 11. Documentation Index @@ -156,7 +157,7 @@ Variabili sensibili principali: ## 12. Canonical Code Pointers -Questa sezione indica i file da trattare come source of truth quando un agente deve verificare comportamento reale. +This section lists the files to treat as source of truth when an agent must validate real behavior. - backend routing root: backend/backend/urls.py - users: backend/users/urls.py, backend/users/views.py, backend/users/serializers.py @@ -168,19 +169,19 @@ Questa sezione indica i file da trattare come source of truth quando un agente d ## 13. AI Reference Usage Rules -Regole operative per agenti AI: +Operational rules for AI agents: -1. Usare questi documenti come baseline funzionale, non come sostituto del codice. -2. In caso di mismatch documentazione-codice, prevale il comportamento osservabile nei file canonici. -3. Prima di modifiche su pagamenti/rimborsi, verificare sempre sia events che treasury. -4. Prima di modifiche su autorizzazioni, verificare sia permessi Django sia flag custom utente. -5. Non assumere invarianti non esplicitate nei documenti o non verificabili nel codice. +1. Use these documents as functional baseline, not as a replacement for code inspection. +2. If documentation and code differ, observed behavior in canonical files is authoritative. +3. Before payment/reimbursement changes, always verify both `events` and `treasury`. +4. Before authorization changes, verify both Django permissions and custom user flags. +5. Do not assume invariants that are not explicitly documented or verifiable in code. ## 14. Documentation Completeness Notes -Copertura attuale: +Current coverage: -- moduli core users, profiles, events, treasury, content: dettagliati -- modulo maintenance: dettagliato -- integrazione E2E: baseline presente -- coverage qualitativa: presente +- core modules users, profiles, events, treasury, content: detailed +- maintenance module: detailed +- E2E integration baseline: present +- qualitative coverage: present diff --git a/backend/Project Documentation/01_USERS_MODULE.md b/backend/Project Documentation/01_USERS_MODULE.md index a087f6e2c..682d3af84 100644 --- a/backend/Project Documentation/01_USERS_MODULE.md +++ b/backend/Project Documentation/01_USERS_MODULE.md @@ -2,26 +2,26 @@ ## 1. Module Purpose -Il modulo users implementa autenticazione, ciclo token JWT, gestione utenti e policy autorizzative trasversali. +The users module implements authentication, JWT token lifecycle handling, user management, and cross-cutting authorization policies. -Responsabilita principali: +Main responsibilities: -- login/logout e token lifecycle -- recupero password -- gestione utenti e gruppi Django -- esposizione permessi raw/effective per frontend -- controllo flag custom finance/content -- endpoint OIDC di supporto integrazione wiki +- login/logout and token lifecycle +- password recovery +- user and Django group management +- exposing raw/effective permissions to frontend +- custom finance/content flag controls +- OIDC support endpoints for wiki integration ## 2. Data Model and Identity ### 2.1 Entita User -User estende AbstractBaseUser + PermissionsMixin. +`User` extends `AbstractBaseUser` + `PermissionsMixin`. -Campi rilevanti: +Relevant fields: -- profile (OneToOne con Profile, chiave logica utente) +- profile (OneToOne with `Profile`, logical user key) - is_staff - last_login - can_manage_casse @@ -30,9 +30,9 @@ Campi rilevanti: ### 2.2 Identity Mapping -- email utente e derivata da profile.email -- id applicativo e allineato alla chiave profile -- la validita dell account dipende anche dallo stato del profilo correlato +- user email is derived from `profile.email` +- application ID is aligned with the profile key +- account validity also depends on linked profile state ## 3. API Contract Summary @@ -40,100 +40,100 @@ Base path: /backend/ ### 3.1 Authentication APIs -| Endpoint | Metodo | Auth richiesta | Note | +| Endpoint | Method | Auth Required | Notes | |---|---|---|---| -| /login/ | POST | no | consente solo dominio @esnpolimi.it | -| /logout/ | POST | no | blacklist refresh se presente, cookie cleanup | +| /login/ | POST | no | only `@esnpolimi.it` domain is accepted | +| /logout/ | POST | no | blacklists refresh token if present, clears cookies | | /api/token/ | POST | no | token pair creation | | /api/token/refresh/ | POST | no | refresh da cookie | -| /api/token/verify/ | POST | no | verifica token | -| /api/forgot-password/ | POST | no | risposta neutra anti user enumeration | -| /api/reset-password/// | POST | no | reset con token signed | +| /api/token/verify/ | POST | no | token verification | +| /api/forgot-password/ | POST | no | neutral response to prevent user enumeration | +| /api/reset-password/// | POST | no | reset with signed token | ### 3.2 User Management APIs -| Endpoint | Metodo | Permission | +| Endpoint | Method | Permission | |---|---|---| -| /users/ | GET | autenticato | +| /users/ | GET | authenticated | | /users/ | POST | users.add_user | -| /users// | GET | autenticato | +| /users// | GET | authenticated | | /users// | PATCH | users.change_user | -| /users// | DELETE | solo Board | -| /groups/ | GET | autenticato | -| /users/finance-permissions/ | GET | autenticato | +| /users// | DELETE | Board only | +| /groups/ | GET | authenticated | +| /users/finance-permissions/ | GET | authenticated | | /users/finance-permissions/ | PATCH | Board | ## 4. Business Rules ### 4.1 Login Rules -1. dominio email obbligatorio: @esnpolimi.it -2. credenziali corrette obbligatorie -3. profile.email_is_verified deve essere true -4. risposta include token pair e metadati utente +1. Required email domain: `@esnpolimi.it`. +2. Valid credentials are mandatory. +3. `profile.email_is_verified` must be `true`. +4. Response includes token pair and user metadata. ### 4.2 Refresh Rules -1. refresh letto da cookie httpOnly -2. cookie mancante -> 400 -3. token invalido/scaduto -> 401 +1. Refresh token is read from an httpOnly cookie. +2. Missing cookie -> `400`. +3. Invalid/expired token -> `401`. ### 4.3 Password Reset Rules -1. forgot-password non conferma mai se email esiste -2. reset richiede uid/token validi e password coerenti +1. Forgot-password never confirms whether an email exists. +2. Reset requires valid uid/token and matching password input. ## 5. Authorization and Effective Permissions -Permessi effettivi (effective) sono derivati da: +Effective permissions are derived from: -- appartenenza a gruppo (Board/Attivi/Aspiranti) -- flag custom utente +- group membership (Board/Attivi/Aspiranti) +- custom user flags -Regole endpoint finance-permissions: +`finance-permissions` endpoint rules: -1. PATCH consentito solo a Board -2. flag casse assegnabili solo ad Aspiranti -3. flag content assegnabile solo a profili ESNer -4. output GET espone raw + effective permissions +1. `PATCH` is allowed only to Board. +2. `can_manage_casse` and related flags can be assigned only to Aspiranti. +3. `can_manage_content` can be assigned only to ESNer profiles. +4. `GET` returns both raw and effective permissions. ## 6. Security Notes -1. logout e resiliente: successo anche su token non black-listabile -2. refresh cookie gestito con attributi secure compatibili con ambiente -3. reset password basato su token signed e uid encoded +1. Logout is resilient: it succeeds even if token blacklisting is not possible. +2. Refresh cookie uses secure attributes compatible with environment. +3. Password reset is based on signed token and encoded uid. ## 7. Frontend Integration Points - AuthContext: login/logout/refresh - ForgotPassword: trigger email reset -- ResetPassword: submit nuova password -- Profile/Settings: lettura e aggiornamento finance permissions +- ResetPassword: submit new password +- Profile/Settings: reading and updating finance permissions ## 8. Operational Risks -1. differenze browser su cookie secure in locale -2. regressioni su permessi effective esposti al frontend -3. mismatch tra stato profile e stato user attivo +1. Browser differences for secure cookies in local environments. +2. Regressions in effective permissions exposed to frontend. +3. Mismatch between profile state and active user state. ## 9. Testing Requirements -Test minimi obbligatori: +Minimum required tests: -1. login matrix (dominio, verificato, credenziali) +1. login matrix (domain, verified state, credentials) 2. refresh da cookie (ok/missing/expired) 3. permission matrix CRUD users -4. finance-permissions Board-only + vincoli gruppo -5. reset-password token invalidi e mismatch +4. Board-only `finance-permissions` + group constraints +5. reset-password invalid token and mismatch cases -Riferimenti test: +Test references: - backend/users/tests.py - backend/users/test_integration.py ## 10. Canonical Source Files -Per analisi/verifica agenti AI usare come riferimento primario: +For AI-agent analysis/verification, use these files as primary references: - backend/users/models.py - backend/users/urls.py diff --git a/backend/Project Documentation/02_PROFILES_MODULE.md b/backend/Project Documentation/02_PROFILES_MODULE.md index 6d076754f..114d9e46b 100644 --- a/backend/Project Documentation/02_PROFILES_MODULE.md +++ b/backend/Project Documentation/02_PROFILES_MODULE.md @@ -2,27 +2,28 @@ ## 1. Module Purpose -Il modulo profiles gestisce il lifecycle anagrafico e documentale di Erasmus/ESNer. +The profiles module manages demographic and document lifecycle for Erasmus and ESNer users. -Responsabilita: +Responsibilities: -- registrazione iniziale profilo -- verifica email automatica e manuale -- gestione documenti identificativi -- ricerca e listing amministrativo -- esposizione dati profilo per moduli events/treasury +- initial profile registration +- automatic and manual email verification +- identity document management +- administrative search and listing +- profile data exposure for events/treasury modules +- ESNcard actions from profile view integrated with treasury (issuance and revocation) ## 2. Domain Model ### 2.1 Profile -Campi funzionali principali: +Main functional fields: -- identificazione: email (unique), is_esner -- stato: email_is_verified, enabled -- anagrafica: name, surname, birthdate, country, course, domicile -- contatti: phone_*, whatsapp_* -- identificativi: person_code, matricola_number, matricola_expiration +- identification: `email` (unique), `is_esner` +- state: `email_is_verified`, `enabled` +- personal info: `name`, `surname`, `birthdate`, `country`, `course`, `domicile` +- contacts: `phone_*`, `whatsapp_*` +- identifiers: `person_code`, `matricola_number`, `matricola_expiration` Computed properties: @@ -32,8 +33,8 @@ Computed properties: ### 2.2 Document - relazione: FK su Profile -- tipo documento: enum (Passport, ID Card, Driving License, Residency Permit, Other) -- number unique globale +- document type: enum (Passport, ID Card, Driving License, Residency Permit, Other) +- globally unique number - expiration - enabled @@ -43,70 +44,70 @@ Base path: /backend/ ### 3.1 Listing and Search -| Endpoint | Metodo | Note | +| Endpoint | Method | Notes | |---|---|---| -| /erasmus_profiles/ | GET | listing paginato profili non ESNer | -| /esner_profiles/ | GET | listing paginato profili ESNer | -| /profiles/search/ | GET | ricerca multi-token cross-field | +| /erasmus_profiles/ | GET | paginated listing of non-ESNer profiles | +| /esner_profiles/ | GET | paginated listing of ESNer profiles | +| /profiles/search/ | GET | cross-field multi-token search | -Filtri principali: +Main filters: - page, page_size, ordering, search -- group (solo esner_profiles) +- group (only on `esner_profiles`) - esncardValidity = valid|expired|absent ### 3.2 Creation and Verification -| Endpoint | Metodo | Auth | +| Endpoint | Method | Auth | |---|---|---| -| /profile/initiate-creation/ | POST | pubblico | -| /api/profile/verify-email/// | GET | pubblico | +| /profile/initiate-creation/ | POST | public | +| /api/profile/verify-email/// | GET | public | | /profile//manual-verify-email/ | POST | Board | ### 3.3 Detail and Related Data -| Endpoint | Metodo | Auth | +| Endpoint | Method | Auth | |---|---|---| -| /profile// | GET/PATCH/DELETE | autenticato + permessi | -| /document/ | POST | autenticato | -| /document// | PATCH/DELETE | autenticato + permessi | +| /profile// | GET/PATCH/DELETE | authenticated + permissions | +| /document/ | POST | authenticated | +| /document// | PATCH/DELETE | authenticated + permissions | | /profile_subscriptions// | GET | object-level protected | -| /profile_events// | GET | autenticato | -| /check_erasmus_email/ | POST | pubblico | +| /profile_events// | GET | authenticated | +| /check_erasmus_email/ | POST | public | ## 4. Lifecycle Flows ### 4.1 Erasmus Registration Flow -1. initiate-creation crea profile/document disabled -2. invio email verifica -3. verify-email abilita profile/document +1. `initiate-creation` creates disabled `Profile`/`Document` records. +2. Verification email is sent. +3. `verify-email` enables profile/document. ### 4.2 ESNer Registration Flow -1. dominio email obbligatorio @esnpolimi.it -2. creazione User correlato in gruppo Aspiranti -3. verify-email abilita profile/document/user -4. invio notifica segreteria post-verifica +1. `@esnpolimi.it` email domain is mandatory. +2. A related `User` is created in group `Aspiranti`. +3. `verify-email` enables profile/document/user. +4. Post-verification notification is sent to secretariat. ### 4.3 Manual Verification -Board puo forzare verifica/attivazione profilo per casi eccezionali. +Board can force profile verification/activation for exceptional cases. ## 5. Authorization Rules ### 5.1 Profile Permissions -- listing: autenticazione richiesta +- listing: authentication required - patch profile: profiles.change_profile -- delete profile: solo Board -- delete bloccato se esistono Subscription collegate +- delete profile: Board only +- delete is blocked if linked `Subscription` records exist ### 5.2 Group Transition Constraints -1. Aspiranti -> Attivi/Board: solo Board -2. Attivi -> Board: solo Board -3. altre transizioni secondo validazione richiesta +1. `Aspiranti` -> `Attivi`/`Board`: Board only. +2. `Attivi` -> `Board`: Board only. +3. Other transitions follow request validation rules. ### 5.3 Document Permissions @@ -115,48 +116,55 @@ Board puo forzare verifica/attivazione profilo per casi eccezionali. ### 5.4 Object-Level Access -profile_subscriptions accessibile solo a: +`profile_subscriptions` is accessible only to: - owner - staff - Board +### 5.5 ESNcard Actions From Profile View + +- ESNcard issue/update follows dedicated treasury permissions +- ESNcard revocation is visible only to Board members +- Revocation uses treasury flow and generates a `rimborso_esncard` transaction + ## 6. Search Semantics -Ricerca profili combinata su: +Combined profile search across: - name, surname, email - document number - esncard number - phone/whatsapp -Filtro esncardValidity basato su valutazione latest_esncard. +`esncardValidity` filter is based on `latest_esncard` evaluation. ## 7. Integration Notes -- users: creazione/attivazione account ESNer -- events: risoluzione profilo per iscrizioni e visibilita dati -- treasury: lookup latest_esncard per validita servizi/card +- users: ESNer account creation/activation +- events: profile resolution for subscriptions and data visibility +- treasury: `latest_esncard` lookup for card/service validity +- treasury: ESNcard revocation from profile with preserved emission history and new `rimborso_esncard` ## 8. Operational Risks -1. stati non allineati profile/document/user in flussi di attivazione -2. regressioni su regole promozione gruppi -3. cancellazione profilo con dipendenze evento non intercettata +1. Misaligned profile/document/user states during activation flows. +2. Regressions in group-promotion rules. +3. Profile deletion with uncaught event dependencies. ## 9. Testing Requirements -1. registration matrix Erasmus vs ESNer +1. Registration matrix Erasmus vs ESNer 2. token verification valid/invalid/expired 3. permission matrix profile/document CRUD 4. group transition constraints 5. object-level access profile_subscriptions -Riferimento test: backend/profiles/tests.py. +Test reference: `backend/profiles/tests.py`. ## 10. Canonical Source Files -Per analisi/verifica agenti AI usare come riferimento primario: +For AI-agent analysis/verification, use these files as primary references: - backend/profiles/models.py - backend/profiles/urls.py diff --git a/backend/Project Documentation/03_EVENTS_MODULE.md b/backend/Project Documentation/03_EVENTS_MODULE.md index fcbe5222d..d460f0cbb 100644 --- a/backend/Project Documentation/03_EVENTS_MODULE.md +++ b/backend/Project Documentation/03_EVENTS_MODULE.md @@ -2,37 +2,37 @@ ## 1. Module Purpose -Il modulo events e il cuore operativo per gestione eventi, liste e iscrizioni. +The events module is the operational core for event, list, and subscription management. -Responsabilita: +Responsibilities: -- CRUD evento e metadati -- gestione EventList e capacity pooling -- iscrizioni office e public form -- campi dinamici (form/additional) -- integrazione pagamenti SumUp -- sincronizzazione stato pagamento con treasury -- strumenti organizzativi (move, liberatorie, liste condivise) +- event CRUD and metadata +- EventList management and capacity pooling +- office subscriptions and public form submissions +- dynamic fields (form/additional) +- SumUp payment integration +- payment-state synchronization with treasury +- organizer utilities (move, waivers, shared lists) ## 2. Domain Model ### 2.1 Event -Attributi business principali: +Main business attributes: -- identificativi: name, date, description -- pricing: cost, deposit -- finestra iscrizione: subscription_start_date, subscription_end_date -- form: enable_form, form_programmed_open_time, form_note -- online payment toggle: allow_online_payment -- configurazione dinamica: fields, profile_fields, services -- governance: notify_list, visible_to_board_only, reimbursements_by_organizers_only +- identifiers: `name`, `date`, `description` +- pricing: `cost`, `deposit` +- subscription window: `subscription_start_date`, `subscription_end_date` +- form: `enable_form`, `form_programmed_open_time`, `form_note` +- online payment toggle: `allow_online_payment` +- dynamic configuration: `fields`, `profile_fields`, `services` +- governance: `notify_list`, `visible_to_board_only`, `reimbursements_by_organizers_only` ### 2.2 EventList -Relazione many-to-many con Event tramite EventListEvent. +Many-to-many relation with `Event` through `EventListEvent`. -Attributi: +Attributes: - name - capacity (0 = unlimited) @@ -47,16 +47,16 @@ Computed metrics: ### 2.3 Subscription -Attributi: +Attributes: -- profile (nullable) e campi external_* per iscritti esterni +- `profile` (nullable) and `external_*` fields for external subscribers - event, list - form_data, additional_data - selected_services - created_by_form - sumup_checkout_id, sumup_transaction_id -Vincolo: unique(profile, event). +Constraint: `unique(profile, event)`. ## 3. API Contract Summary @@ -107,60 +107,60 @@ Core mapping: - change_subscription - delete_subscription -Regole aggiuntive: +Additional rules: -1. printable/generate liberatorie: Board o lead organizer. -2. visible_to_board_only: visibilita ristretta a Board. -3. reimbursements_by_organizers_only: rimborsi limitati a organizer/Board. +1. printable/generate waivers: Board or lead organizer. +2. `visible_to_board_only`: visibility restricted to Board. +3. `reimbursements_by_organizers_only`: reimbursements limited to organizer/Board. ## 5. Core Business Flows ### 5.1 Office Subscription Flow -1. validazione finestra iscrizione -2. check duplicati profile/event o external_name/event -3. validazione selected_services contro catalogo evento -4. persistenza subscription -5. sync transazioni quota/cauzione/servizi +1. subscription-window validation +2. duplicate check on `profile/event` or `external_name/event` +3. `selected_services` validation against event catalog +4. subscription persistence +5. transaction sync for fee/deposit/services ### 5.2 Public Form Flow -1. caricamento schema fields da Event -2. validazione dinamica payload -3. upload eventuali file (field type l) su Drive -4. inserimento in form list -5. invio email conferma -6. eventuale innesco checkout online +1. load `fields` schema from `Event` +2. dynamic payload validation +3. optional file upload (field type `l`) to Drive +4. insertion into form list +5. confirmation email delivery +6. optional online checkout trigger ### 5.3 Online Payment Reconciliation -1. process_payment interroga stato checkout -2. webhook conferma asincrona server-server -3. creazione transazioni idempotente -4. allineamento stato subscription +1. `process_payment` queries checkout status +2. webhook asynchronous server-to-server confirmation +3. idempotent transaction creation +4. subscription state alignment ### 5.4 Unified Refund UI Flow (Single Icon) -Per ogni subscription in lista e disponibile una singola azione "Rimborsa". +For each subscription in list view, a single "Reimburse" action is available. -Comportamento: +Behavior: -1. apertura menu/modal con selezione voci rimborsabili -2. voci disponibili: quota, servizi aggiuntivi, cauzione -3. checkbox disabilitata se voce gia rimborsata o non pagata -4. icona disabilitata se nessuna voce e rimborsabile -5. submit con orchestrazione frontend su endpoint esistenti -6. gestione esiti parziali con stato per singola voce (OK/Errore) +1. open menu/modal with reimbursable-item selection +2. available items: fee, additional services, deposit +3. checkbox disabled when item is already reimbursed or not paid +4. icon disabled when no item is reimbursable +5. submit uses frontend orchestration across existing endpoints +6. partial outcomes are managed per item (OK/Error) -Nota operativa: +Operational note: -- il flusso combinato usa chiamate separate a reimburse_quota e reimburse_deposits -- in caso di errore parziale, le voci riuscite restano confermate e le fallite sono ripetibili -- con logica backend attuale, "solo servizi" e consentito solo se quota gia rimborsata +- combined flow uses separate calls to `reimburse_quota` and `reimburse_deposits` +- in partial errors, successful items stay confirmed and failed items can be retried +- with current backend logic, "services only" is allowed only if fee is already reimbursed ## 6. Dynamic Field Schema -Event.fields contiene due blocchi logici: +`Event.fields` contains two logical blocks: - form - additional @@ -169,47 +169,47 @@ Tipologie supportate: - t, n, c, m, s, b, d, e, p, l -Event.services definisce catalogo servizi opzionali con pricing. +`Event.services` defines the optional-services catalog with pricing. ## 7. Shared Lists Model -Una lista puo essere condivisa tra eventi multipli. +A list can be shared across multiple events. Invarianti: -1. capacity della lista e pool unica cross-event -2. move-subscriptions puo cambiare list e event contestualmente -3. il vincolo unique(profile,event) deve restare valido dopo move +1. list capacity is a single cross-event pool +2. `move-subscriptions` can change list and event in the same operation +3. `unique(profile,event)` must remain valid after move ## 8. Integration Notes -- profiles: risoluzione utente e metadati anagrafici -- treasury: transazioni pagamento/rimborso -- content: superfici pubbliche di comunicazione evento +- profiles: user resolution and profile metadata +- treasury: payment/reimbursement transactions +- content: public surfaces for event communication ## 9. Operational Risks -1. webhook duplicati/non ordinati -2. inconsistenza stato pagamento events vs treasury -3. gestione incompleta iscritti esterni nei flussi downstream -4. regressioni su validazione schema dinamico +1. duplicate/out-of-order webhooks +2. inconsistent payment state between events and treasury +3. incomplete handling of external subscribers in downstream flows +4. regressions in dynamic-schema validation ## 10. Testing Requirements -1. permission matrix eventi e iscrizioni -2. validazione schema fields/services +1. permission matrix for events and subscriptions +2. `fields/services` schema validation 3. idempotenza process_payment + webhook -4. integrita move-subscriptions con shared list -5. sync transazioni su update subscription -6. upload file form e fallback error handling -7. rimborso unificato: disable coerente icona/checkbox e validazioni selezione -8. rimborso parziale: messaggi errore per voce fallita e retry selettivo +4. `move-subscriptions` integrity with shared list +5. transaction sync on subscription update +6. form file upload and fallback error handling +7. unified reimbursement: coherent icon/checkbox disable logic and selection validation +8. partial reimbursement: per-item error messages and selective retry -Riferimento test: backend/events/tests.py. +Test reference: `backend/events/tests.py`. ## 11. Canonical Source Files -Per analisi/verifica agenti AI usare come riferimento primario: +For AI-agent analysis/verification, use these files as primary references: - backend/events/models.py - backend/events/urls.py diff --git a/backend/Project Documentation/04_TREASURY_MODULE.md b/backend/Project Documentation/04_TREASURY_MODULE.md index bb7120658..bd43f14f9 100644 --- a/backend/Project Documentation/04_TREASURY_MODULE.md +++ b/backend/Project Documentation/04_TREASURY_MODULE.md @@ -2,36 +2,37 @@ ## 1. Module Purpose -Il modulo treasury gestisce la contabilita applicativa e le regole finanziarie: +The treasury module manages application accounting and financial rules: -- casse (Account) e visibilita per gruppi -- ledger transazioni con aggiornamento saldo -- emissione/modifica ESNcard con fee parametrica -- workflow richieste rimborso -- rimborsi automatici su flussi evento (quota/cauzione/servizi) -- export transazioni per reporting operativo +- accounts and group-based visibility +- transaction ledger with balance updates +- ESNcard issue/update with parameterized fee policy +- ESNcard revocation with refund tracked in ledger +- reimbursement request workflow +- automatic event-flow reimbursements (fee/deposit/services) +- transaction export for operational reporting ## 2. Domain Model ### 2.1 Settings -Parametri economici configurabili: +Configurable economic parameters: - esncard_release_fee - esncard_lost_fee ### 2.2 ESNcard -Attributi principali: +Main attributes: - profile - number (unique) -- expiration (calcolata) -- membership_year (derivata) +- expiration (computed) +- membership_year (derived) ### 2.3 Account -Attributi principali: +Main attributes: - name (unique) - status: open|closed @@ -41,32 +42,33 @@ Attributi principali: ### 2.4 Transaction -Tipi operativi: +Operational types: - subscription - esncard +- rimborso_esncard - deposit - withdrawal - reimbursement -- cauzione +- `cauzione` (event deposit transaction type) - rimborso_cauzione - rimborso_quota - service - rimborso_service -Invarianti contabili: +Accounting invariants: -1. create/update/delete transazione riallinea sempre balance account. -2. account closed non accetta nuove operazioni mutative. -3. per tipi vincolati, saldo negativo bloccato. +1. Transaction create/update/delete always realigns account balance. +2. Closed accounts do not accept new mutating operations. +3. For constrained types, negative balance is blocked. ### 2.5 ReimbursementRequest -Attributi: +Attributes: - user - amount -- payment (cash/paypal/bonifico) +- payment (cash/PayPal/bank transfer) - description - receipt_link - account @@ -79,7 +81,7 @@ Base path: /backend/ ### 3.1 ESNcard APIs - POST /esncard_emission/ -- PATCH /esncard// +- PATCH|DELETE /esncard// - GET /esncard_fees/ ### 3.2 Transaction APIs @@ -106,108 +108,125 @@ Base path: /backend/ ## 4. Permission Model -Regole principali: +Main rules: -1. creazione account: Board. -2. patch completo account: change_account. -3. update status account: anche casse manager (gruppo/flag). -4. create transaction: add_transaction. -5. patch/delete transaction: permessi specifici o can_manage_casse. -6. patch reimbursement request: Board. -7. delete reimbursement request: Board o permesso dedicato. +1. Account creation: Board. +2. Full account patch: `change_account`. +3. Account status update: also allowed for treasury managers (group/flag). +4. Transaction creation: `add_transaction`. +5. Transaction patch/delete: specific permissions or `can_manage_casse`. +6. ESNcard revocation (`DELETE esncard/`): Board only. +7. Reimbursement request patch: Board. +8. Reimbursement request delete: Board or dedicated permission. -Visibilita account: +Account visibility: -- account visibile se utente appartiene a visible_to_groups -- oppure se account non ha gruppi associati +- account is visible if user belongs to `visible_to_groups` +- or if account has no associated groups ## 5. Core Business Flows ### 5.1 ESNcard Emission -1. validazione profilo e prerequisiti emissione -2. calcolo fee corretta (rilascio/smarrimento/rinnovo) -3. creazione ESNcard -4. registrazione transaction esncard su account +1. profile and issue-prerequisite validation +2. correct fee calculation (issue/lost/renewal) +3. ESNcard creation +4. `esncard` transaction registration on account + +### 5.1bis ESNcard Revocation (Board only) + +1. Board-permission validation +2. atomic lock on ESNcard, linked transactions, and account +3. reference-integrity validation (no non-ESNcard types, max 1 linked emission) +4. if a valid ESNcard emission exists: + - verify account is open and has sufficient balance + - create `rimborso_esncard` transaction with negative amount +5. delete ESNcard record +6. keep original emission transaction for audit history ### 5.2 Manual Transactions -1. creazione deposit/withdrawal -2. validazione account e saldo -3. eventuale upload ricevuta -4. notifica operativa in ambienti non localhost +1. deposit/withdrawal creation +2. account and balance validation +3. optional receipt upload +4. operational notification in non-localhost environments ### 5.3 Reimbursement Request Lifecycle -1. utente apre richiesta rimborso -2. Board valuta e aggiorna stato/dati -3. creazione transazione rimborso collegata -4. riallineamento saldo account +1. user opens reimbursement request +2. Board reviews and updates state/data +3. linked reimbursement transaction creation +4. account balance realignment ### 5.4 Event Reimbursements Depositi: -1. input bulk subscription_ids -2. verifica transazione cauzione originaria -3. blocco duplicati rimborso_cauzione -4. supporto iscritti esterni senza profile +1. bulk `subscription_ids` input +2. original deposit transaction verification +3. duplicate `rimborso_cauzione` block +4. support for external subscribers without profile -Quota/servizi: +Fee/services: -1. verifica pagamenti originari -2. blocco doppio rimborso -3. rimborso opzionale servizi associati -4. controllo saldo account disponibile +1. original-payment verification +2. duplicate-refund block +3. optional reimbursement for related services +4. available account-balance check Orchestrazione UI unificata (single icon): -1. il frontend puo selezionare piu voci (quota/servizi/cauzione) in una singola azione utente -2. lato backend restano endpoint separati (reimburse_quota, reimburse_deposits) -3. il flusso non e atomico cross-endpoint: possibili successi parziali -4. in caso di successo parziale, ogni voce mantiene il proprio stato e puo essere ritentata -5. motivazione errore per singola voce propagata al client per retry guidato +1. frontend can select multiple items (fee/services/deposit) in one user action +2. backend still uses separate endpoints (`reimburse_quota`, `reimburse_deposits`) +3. flow is not cross-endpoint atomic: partial success is possible +4. on partial success, each item keeps its own state and can be retried +5. per-item error reason is propagated to client for guided retry ## 6. Query, Filters and Export -transactions list supporta: +`transactions` list supports: - search - event -- account multipli -- type multipli +- multiple accounts +- multiple types - dateFrom/dateTo - limit per dashboard -transactions_export produce XLSX con metadati contabili e descrizioni operative. +`transactions_export` produces XLSX with accounting metadata and operational descriptions. + +Note: `rimborso_esncard` is exported with a dedicated description. ## 7. Cross-Module Dependencies -- events: source of truth per Subscription/Event usati nei rimborsi +- events: source of truth for `Subscription`/`Event` data used in reimbursements - profiles/users: identita attore e ownership richieste - notification/email: avvisi operativi su operazioni sensibili ## 8. Operational Risks -1. race su aggiornamento balance in operazioni concorrenti -2. disallineamento transazioni evento/treasury in caso errori parziali -3. regressioni su edge case iscritti esterni senza profile -4. policy account visibility non allineata con gruppi runtime +1. race conditions in balance updates during concurrent operations +2. event/treasury transaction misalignment on partial failures +3. regressions on edge cases with external subscribers without profile +4. account-visibility policy misalignment with runtime groups +5. ESNcard revocation blocked on insufficient balance or closed account ## 9. Testing Requirements -1. coerenza balance su create/update/delete transaction -2. blocco operazioni su account chiuso -3. permission matrix Board/Attivi/Aspiranti con flag speciali -4. rimborsi quota/cauzione/servizi incluse condizioni duplicate -5. gestione esterni senza profile nei rimborsi deposito -6. export con filtri combinati e dataset non banali +1. balance consistency on transaction create/update/delete +2. operation block on closed account +3. permission matrix Board/Attivi/Aspiranti with special flags +4. fee/deposit/services reimbursements including duplicate conditions +5. handling external users without profile in deposit reimbursements +6. export with combined filters and non-trivial datasets +7. ESNcard revocation with `rimborso_esncard` creation and balance consistency +8. ESNcard revocation blocks on edge cases (multiple emissions, anomalous references, insufficient balance, closed account) -Riferimento test: backend/treasury/tests.py. +Test reference: `backend/treasury/tests.py`. ## 10. Canonical Source Files -Per analisi/verifica agenti AI usare come riferimento primario: +For AI-agent analysis/verification, use these files as primary references: - backend/treasury/models.py - backend/treasury/urls.py diff --git a/backend/Project Documentation/05_CONTENT_MODULE.md b/backend/Project Documentation/05_CONTENT_MODULE.md index 9c3afcaa9..ce0539edd 100644 --- a/backend/Project Documentation/05_CONTENT_MODULE.md +++ b/backend/Project Documentation/05_CONTENT_MODULE.md @@ -2,20 +2,20 @@ ## 1. Module Purpose -Il modulo content governa i contenuti dinamici della home e il workflow pubblico WhatsApp. +The content module governs dynamic homepage content and the public WhatsApp workflow. -Responsabilita: +Responsibilities: -- gestione sezioni editoriali e link ordinati -- enforcement autorizzativo content manager -- configurazione centralizzata link WhatsApp -- registrazione pubblica con validazione, email e audit CSV su Drive +- management of editorial sections and ordered links +- authorization enforcement for content managers +- centralized WhatsApp link configuration +- public registration with validation, email delivery, and CSV audit on Drive ## 2. Domain Model ### 2.1 ContentSection -Attributi principali: +Main attributes: - title (enum, unique): LINK_UTILI | WIKI_TUTORIAL - order @@ -24,7 +24,7 @@ Attributi principali: ### 2.2 ContentLink -Attributi principali: +Main attributes: - section (FK) - name @@ -36,7 +36,7 @@ Attributi principali: ### 2.3 WhatsAppConfig -Configurazione singleton (pk=1): +Singleton configuration (`pk=1`): - whatsapp_link - updated_at @@ -68,33 +68,33 @@ Base path: /backend/content/ ## 4. Permission Model -Guard centrale: _can_manage_content(user) +Central guard: `_can_manage_content(user)` -Condizioni true: +True conditions: - user in Board - user.can_manage_content -Policy endpoint: +Endpoint policy: -1. sections/links GET: autenticati. +1. `sections/links` GET: authenticated. 2. sections/links POST/PATCH/DELETE: content manager. -3. whatsapp-config GET: autenticati. +3. `whatsapp-config` GET: authenticated. 4. whatsapp-config PATCH: content manager. -5. whatsapp-register POST: pubblico (AllowAny). +5. `whatsapp-register` POST: public (`AllowAny`). ## 5. Core Business Flows ### 5.1 Editorial CRUD Flow -1. manager crea/aggiorna sezione o link -2. ordinamento applicato via campo order -3. is_active governa esposizione lato home -4. audit metadata mantiene tracciabilita modifica +1. manager creates/updates section or link +2. ordering is applied through `order` +3. `is_active` controls homepage exposure +4. audit metadata preserves change traceability ### 5.2 Public WhatsApp Registration -Input richiesto: +Required input: - first_name - last_name @@ -103,48 +103,48 @@ Input richiesto: - home_university - course_of_study -Sequenza: +Sequence: -1. validazione serializer -2. applicazione regole ammissibilita (international/erasmus) -3. verifica presenza whatsapp_link configurato -4. invio email con link gruppo -5. append audit CSV su Google Drive con timestamp/esito +1. serializer validation +2. application of eligibility rules (international/erasmus) +3. verify configured `whatsapp_link` presence +4. send email with group link +5. append audit CSV to Google Drive with timestamp/outcome -CSV target: cronologia richieste gruppo whatsapp.csv. +Target CSV: `cronologia richieste gruppo whatsapp.csv`. ## 6. Integration Notes -- home frontend: rendering sezioni attive e links ordinati -- content manager frontend: amministrazione completa contenuti/config -- servizi esterni: SMTP per invio email, Drive API per audit trail +- home frontend: rendering active sections and ordered links +- content manager frontend: complete content/configuration administration +- external services: SMTP for emails, Drive API for audit trail ## 7. Operational Constraints -1. active_sections filtrate server-side. -2. append CSV protetto da lock in-process per ridurre collisioni. -3. errori email/Drive devono essere tracciati e osservabili. +1. `active_sections` is filtered server-side. +2. CSV append is protected by in-process lock to reduce collisions. +3. Email/Drive errors must be traced and observable. ## 8. Operational Risks -1. inconsistenza configurazione singleton WhatsApp in ambienti multipli -2. lock locale non sufficiente in deployment multi-process -3. regressioni su policy di accesso content manager -4. error handling esterno (SMTP/Drive) non uniforme +1. inconsistent WhatsApp singleton configuration across environments +2. local lock may be insufficient in multi-process deployments +3. regressions in content-manager access policy +4. non-uniform external error handling (SMTP/Drive) ## 9. Testing Requirements -1. permission matrix Board, can_manage_content, utente standard +1. permission matrix for Board, `can_manage_content`, standard user 2. validazioni ContentLink (url/color/name/order) -3. percorso whatsapp-register ammesso e non ammesso +3. `whatsapp-register` allowed and blocked paths 4. failure path email e append CSV -5. verifica active_sections solo su contenuti attivi +5. verify `active_sections` returns only active content -Riferimento test: backend/content/tests.py. +Test reference: `backend/content/tests.py`. ## 10. Canonical Source Files -Per analisi/verifica agenti AI usare come riferimento primario: +For AI-agent analysis/verification, use these files as primary references: - backend/content/models.py - backend/content/urls.py diff --git a/backend/Project Documentation/06_INTEGRATION_E2E.md b/backend/Project Documentation/06_INTEGRATION_E2E.md index e6ce3aba4..783919303 100644 --- a/backend/Project Documentation/06_INTEGRATION_E2E.md +++ b/backend/Project Documentation/06_INTEGRATION_E2E.md @@ -2,7 +2,7 @@ ## 1. Document Purpose -Questa specifica definisce i flussi cross-modulo che rappresentano la baseline di accettazione funzionale. +This specification defines the cross-module flows that represent the functional acceptance baseline. Scope: @@ -15,126 +15,131 @@ Scope: ## 2. End-to-End Critical Scenarios -### 2.1 Scenario A - ESNer onboarding completo +### 2.1 Scenario A - Complete ESNer Onboarding -Precondizioni: +Preconditions: -- email dominio istituzionale valida -- endpoint verifica email operativo +- valid institutional email domain +- working email verification endpoint -Sequenza: +Sequence: 1. POST profile/initiate-creation con is_esner=true -2. GET verify-email con uid/token validi +2. GET verify-email with valid uid/token 3. POST login -4. accesso endpoint protetti -5. verifica gruppo iniziale e stato attivazione +4. access protected endpoints +5. verify initial group and activation state -Oracoli di test: +Test oracles: -- utente attivo -- profile coerente con ruolo iniziale -- token lifecycle valido +- active user +- profile aligned with initial role +- valid token lifecycle ### 2.2 Scenario B - Erasmus onboarding + public form -Precondizioni: +Preconditions: -- evento con form attivo +- event with active form -Sequenza: +Sequence: -1. registrazione erasmus e verifica email -2. lettura form pubblico -3. submit payload valido -4. creazione subscription in form list -5. invio conferma email +1. Erasmus registration and email verification +2. read public form +3. submit valid payload +4. create subscription in form list +5. send confirmation email -Oracoli di test: +Test oracles: -- persistenza dati form/additional -- stato subscription corretto +- persistence of form/additional data +- correct subscription state ### 2.3 Scenario C - SumUp payment reconciliation -Precondizioni: +Preconditions: - allow_online_payment=true -Sequenza: +Sequence: 1. formsubmit genera checkout_id -2. process_payment o webhook conferma stato paid -3. creazione transazioni locali (quota/cauzione/servizi) -4. riallineamento payment status subscription +2. `process_payment` or webhook confirms `paid` status +3. create local transactions (fee/deposit/services) +4. payment-status alignment on subscription -Oracoli di test: +Test oracles: -- idempotenza su webhook duplicati -- assenza doppia contabilizzazione +- idempotency on duplicate webhooks +- no double accounting -### 2.4 Scenario D - Reimbursements (deposit/quota/services) +### 2.4 Scenario D - Reimbursements (fee/deposit/services) -Precondizioni: +Preconditions: -- pagamenti originari esistenti +- original payment transactions exist -Sequenza: +Sequence: -1. apertura azione unica "Rimborsa" su subscription -2. selezione voci (quota/servizi/cauzione) con disable automatico voci non valide +1. open single "Reimburse" action on subscription +2. select items (fee/services/deposit) with automatic disable for invalid items 3. orchestrazione chiamate reimburse_quota e/o reimburse_deposits -4. generazione transazioni rimborso per voci riuscite -5. aggiornamento saldo account -6. blocco tentativo doppio rimborso +4. generate refund transactions for successful items +5. update account balance +6. block duplicate reimbursement attempts -Oracoli di test: +Test oracles: -- vincoli anti-duplicato rispettati -- gestione esterni senza profile preservata -- gestione esito parziale: errore puntuale per voce fallita + retry selettivo +- anti-duplicate constraints respected +- handling of external users without profile preserved +- partial-outcome management: precise error for failed item + selective retry -### 2.5 Scenario E - ESNcard emission + accounting +### 2.5 Scenario E - ESNcard emission/revocation + accounting -Sequenza: +Sequence: -1. emissione card su profilo valido -2. calcolo fee corretta per caso d'uso -3. creazione transazione esncard -4. verifica balance account +1. issue card on valid profile +2. correct fee calculation for the use case +3. create ESNcard transaction +4. card revocation by Board user +5. creation of `rimborso_esncard` transaction on the same account +6. verify emission transaction remains in history +7. verify account balance after refund -Oracoli di test: +Test oracles: -- fee policy corretta -- consistenza ledger +- correct fee policy +- ledger consistency (emission + refund) +- emission transaction preserved for audit +- revocation blocked on accounting edge cases (insufficient balance, closed account) ### 2.6 Scenario F - Content + WhatsApp public workflow -Sequenza: +Sequence: -1. manager aggiorna whatsapp-config -2. utente pubblico invia whatsapp-register -3. invio email link -4. append audit CSV su Drive +1. manager updates `whatsapp-config` +2. public user submits `whatsapp-register` +3. send email link +4. append audit CSV on Drive -Oracoli di test: +Test oracles: -- policy accesso rispettata -- audit trail presente +- access policy respected +- audit trail present ### 2.7 Scenario G - Maintenance notification -Sequenza: +Sequence: -1. admin trigger notifica -2. client autenticati leggono maintenance/status +1. admin triggers notification +2. authenticated clients read maintenance/status 3. banner frontend visibile -4. clear notifica +4. clear notification -Oracoli di test: +Test oracles: -- propagazione stato corretta -- reset notifica coerente +- correct state propagation +- consistent notification reset ## 3. Test Asset Mapping @@ -143,7 +148,7 @@ Suite integrazione dedicate: - backend/test_integration_e2e.py - backend/users/test_integration.py -Supporto cross-domain da suite modulo: +Cross-domain support from module suites: - backend/events/tests.py - backend/treasury/tests.py @@ -152,46 +157,46 @@ Supporto cross-domain da suite modulo: ## 4. Release Regression Gate -Checklist minima per ogni release: +Minimum checklist for each release: 1. login, refresh, logout -2. registrazione e verifica ESNer/Erasmus -3. creazione evento + liste principali -4. iscrizione office e public form -5. pagamento SumUp + webhook idempotente -6. rimborsi quota/cauzione/servizi -7. emissione ESNcard -8. export transazioni +2. ESNer/Erasmus registration and verification +3. event creation + main lists +4. office subscription and public form +5. SumUp payment + idempotent webhook +6. fee/deposit/services reimbursements +7. ESNcard issue and revocation +8. transaction export 9. CRUD content home 10. whatsapp register end-to-end ## 5. Cross-Module Risk Register -1. disallineamento pagamento tra events e treasury -2. race su update balance account -3. webhook non ordinati o duplicati -4. mismatch autorizzazioni backend/frontend -5. regressioni su flussi external subscriptions +1. payment misalignment between events and treasury +2. race conditions on account balance updates +3. out-of-order or duplicate webhooks +4. backend/frontend authorization mismatch +5. regressions on external-subscription flows ## 6. Test Strategy Guidelines -1. unit test per regole locali e permessi +1. unit tests for local rules and permissions 2. integration API test per side-effect DB -3. E2E sintetici su mission-critical flow -4. mock deterministic per SumUp, Drive, SMTP +3. synthetic E2E tests on mission-critical flows +4. deterministic mocks for SumUp, Drive, SMTP ## 7. Acceptance Baseline -Uno scenario E2E e considerato accettato solo se: +An E2E scenario is considered accepted only if: -1. stato finale persistito e verificabile -2. side-effect esterni tracciati (email/webhook/export) -3. invarianti contabili/autorizzative rispettate -4. assenza di duplicazioni in operazioni idempotenti +1. final state is persisted and verifiable +2. external side effects are tracked (email/webhook/export) +3. accounting/authorization invariants are respected +4. no duplication occurs in idempotent operations ## 8. Traceability Map (Scenario -> Test Assets) -Mappatura di riferimento per troubleshooting rapido agent-driven: +Reference mapping for quick agent-driven troubleshooting: - Scenario A: backend/users/test_integration.py, backend/profiles/tests.py - Scenario B: backend/profiles/tests.py, backend/events/tests.py @@ -201,8 +206,8 @@ Mappatura di riferimento per troubleshooting rapido agent-driven: - Scenario F: backend/content/tests.py - Scenario G: backend/maintenance/views.py (comportamento), backend/test_integration_e2e.py -Nota: la mappa indica i test principali da consultare; non implica copertura esaustiva di ogni edge case. +Note: this map indicates the primary tests to inspect; it does not imply exhaustive edge-case coverage. -Riferimento documentale scenario G: +Documentation reference for Scenario G: - 07_MAINTENANCE_MODULE.md diff --git a/backend/Project Documentation/07_MAINTENANCE_MODULE.md b/backend/Project Documentation/07_MAINTENANCE_MODULE.md index a833fd0ec..c45e71bec 100644 --- a/backend/Project Documentation/07_MAINTENANCE_MODULE.md +++ b/backend/Project Documentation/07_MAINTENANCE_MODULE.md @@ -2,34 +2,33 @@ ## 1. Module Purpose -Il modulo maintenance gestisce la notifica di manutenzione applicativa verso client autenticati. +The maintenance module manages application-maintenance notifications for authenticated clients. -Responsabilita: +Responsibilities: -- esposizione stato manutenzione corrente -- push eventi tramite SSE con connessioni controllate -- trigger e clear notifica via pagina admin staff-only -- persistenza stato notifica su file JSON condiviso +- expose current maintenance state +- push events via SSE with controlled connections +- trigger and clear notifications via staff-only admin page +- persist notification state in a shared JSON file ## 2. Domain Model -Il modulo non usa modelli Django dedicati. +The module does not use dedicated Django models. -Stato applicativo persistito in file: +Application state is persisted in: - backend/maintenance_notification.json -Schema payload: +Payload schema: -- notification_id (UUID o null) -- message (string) -- triggered_at (ISO datetime o null) +- notification_id (UUID or null) +- triggered_at (ISO datetime or null) -Invarianti: +Invariants: -1. notification_id null indica assenza notifica attiva. -2. message mantiene default operativo se non specificato. -3. triggered_at e valorizzato solo quando notifica e attiva. +1. `notification_id = null` indicates no active notification. +2. `message` keeps a default operational text when not provided. +3. `triggered_at` is set only when notification is active. ## 3. API Contract Summary @@ -39,92 +38,92 @@ Base path: /backend/ - GET /maintenance/stream/ -Comportamento: +Behavior: -- richiede token JWT access in query param token -- ritorna HTTP 403 se token assente o invalido -- invia evento maintenance quando notification_id cambia -- invia heartbeat periodico per mantenere connessione viva -- auto-rotate connessione dopo finestra temporale per riciclo worker +- requires JWT access token in query parameter `token` +- returns HTTP `403` when token is missing or invalid +- sends a maintenance event when `notification_id` changes +- sends periodic heartbeat to keep connection alive +- auto-rotates connection after a time window to recycle workers ### 3.2 Polling API - GET /maintenance/status/ -Comportamento: +Behavior: -- richiede autenticazione (IsAuthenticated) -- ritorna stato corrente notifica (notification_id, message, triggered_at) +- requires authentication (`IsAuthenticated`) +- returns current notification state (`notification_id`, `message`, `triggered_at`) ### 3.3 Admin Action Endpoint - GET|POST /admin/maintenance-notify/ -Comportamento: +Behavior: -- accessibile solo a staff member -- action=send: crea nuova notifica con UUID e timestamp -- action=clear: resetta stato a notifica assente +- accessible only to staff members +- `action=send`: creates a new notification with UUID and timestamp +- `action=clear`: resets state to no active notification ## 4. Permission Model -Regole principali: +Main rules: -1. maintenance stream richiede token JWT valido. -2. maintenance status richiede utente autenticato. -3. maintenance admin page richiede staff_member_required. -4. trigger/clear sono disponibili solo da interfaccia admin autorizzata. +1. maintenance stream requires valid JWT token. +2. maintenance status requires an authenticated user. +3. maintenance admin page requires `staff_member_required`. +4. trigger/clear are available only from authorized admin UI. ## 5. Core Business Flows ### 5.1 Trigger Maintenance Notification -1. staff apre pagina admin maintenance -2. invia action send -3. backend genera notification_id e triggered_at -4. stato scritto su maintenance_notification.json -5. client SSE rilevano cambio e ricevono evento maintenance +1. staff opens maintenance admin page +2. submits `action=send` +3. backend generates `notification_id` and `triggered_at` +4. state is written to `maintenance_notification.json` +5. SSE clients detect change and receive maintenance event ### 5.2 Clear Maintenance Notification -1. staff invia action clear -2. backend resetta payload a notification_id null -3. stato aggiornato su maintenance_notification.json -4. client polling/SSE non ricevono piu stato attivo +1. staff submits `action=clear` +2. backend resets payload with `notification_id = null` +3. state is updated in `maintenance_notification.json` +4. polling/SSE clients no longer receive active state ### 5.3 Client Consumption Flow -1. client autenticato legge stato da /maintenance/status/ -2. opzionalmente apre EventSource su /maintenance/stream/?token= -3. su evento maintenance mostra banner/notifica UI -4. su clear rimuove banner +1. authenticated client reads state from `/maintenance/status/` +2. optionally opens `EventSource` on `/maintenance/stream/?token=` +3. on maintenance event, shows UI banner/notification +4. on clear, removes banner ## 6. Operational Constraints -1. persistenza file-based: dipende da accesso filesystem locale condiviso. -2. SSE su WSGI: connessioni lunghe controllate con timeout/riciclo. -3. autenticazione stream via query param necessaria per limiti EventSource headers. -4. heartbeats necessari per prevenire idle timeout infrastrutturali. +1. File-based persistence depends on shared local filesystem access. +2. SSE on WSGI relies on controlled long-lived connections with timeout/recycle. +3. Stream authentication via query param is required due to EventSource header limits. +4. Heartbeats are required to prevent infrastructure idle timeouts. ## 7. Operational Risks -1. race condition su scrittura file in ambienti multi-process. -2. mismatch stato tra istanze se storage non condiviso. -3. token esposto in query string nei log infrastrutturali. -4. saturazione worker se stream non limitato/correttamente riciclato. +1. race condition on file writes in multi-process environments. +2. state mismatch across instances if storage is not shared. +3. token exposure in query string inside infrastructure logs. +4. worker saturation if stream is not limited/recycled correctly. ## 8. Testing Requirements -1. stream senza token ritorna 403. -2. stream con token invalido/scaduto ritorna 403. -3. status richiede autenticazione e ritorna payload completo. -4. action send crea notification_id e triggered_at. +1. stream without token returns 403. +2. stream with invalid/expired token returns 403. +3. status requires authentication and returns full payload. +4. `action=send` creates `notification_id` and `triggered_at`. 5. action clear resetta notification_id e triggered_at. -6. verifica emissione evento maintenance su cambio notification_id. +6. verify maintenance-event emission when `notification_id` changes. ## 9. Canonical Source Files -Per analisi/verifica agenti AI usare come riferimento primario: +For AI-agent analysis/verification, use these files as primary references: - backend/maintenance/urls.py - backend/maintenance/views.py diff --git a/backend/Project Documentation/TEST_COVERAGE_REPORT.md b/backend/Project Documentation/TEST_COVERAGE_REPORT.md index 05a11a887..63e1df2a7 100644 --- a/backend/Project Documentation/TEST_COVERAGE_REPORT.md +++ b/backend/Project Documentation/TEST_COVERAGE_REPORT.md @@ -1,101 +1,102 @@ # Test Coverage Report - ESN Polimi Management -Data ultimo aggiornamento: 2026-03-25 -Ambito: backend Django (users, profiles, events, treasury, content) +Last update date: 2026-03-31 +Scope: Django backend (users, profiles, events, treasury, content) ## 1. Quality Scope -Questo report descrive la copertura test a livello funzionale e i rischi residui. +This report describes functional test coverage and residual risks. -Nota metodologica: +Methodology note: -- i conteggi rappresentano numero di funzioni test_, non line coverage percentuale -- il dato misura ampiezza della suite, non profondita per ramo logico +- counts represent the number of `test_` functions, not line coverage percentage +- this metric reflects suite breadth, not branch-level depth ## 2. Test Inventory -| File test | Numero funzioni test_ | +| Test File | Number of `test_` Functions | |---|---:| | backend/users/tests.py | 40 | | backend/users/test_integration.py | 14 | | backend/profiles/tests.py | 70 | | backend/events/tests.py | 111 | -| backend/treasury/tests.py | 76 | +| backend/treasury/tests.py | 83 | | backend/content/tests.py | 43 | | backend/test_integration_e2e.py | 6 | -| Totale | 360 | +| Total | 367 | ## 3. Functional Coverage Matrix ### 3.1 Users -- autenticazione JWT (login/refresh/logout) -- reset e forgot password -- CRUD utenti e gruppi -- gestione permessi applicativi speciali +- JWT authentication (login/refresh/logout) +- reset and forgot password +- user and group CRUD +- special application-permission management ### 3.2 Profiles -- onboarding Erasmus/ESNer -- verifica email automatica e verifica manuale Board -- CRUD profili e documenti -- ricerca e filtri -- endpoint di supporto per eventi/iscrizioni +- Erasmus/ESNer onboarding +- automatic email verification and Board manual verification +- profile and document CRUD +- search and filters +- support endpoints for events/subscriptions ### 3.3 Events -- CRUD eventi/liste -- iscrizioni office e public form -- schema campi dinamici e additional fields -- servizi opzionali con pricing -- flussi SumUp (checkout/process/webhook) -- shared lists e move subscriptions -- liberatorie e utilities organizzative +- event/list CRUD +- office and public-form subscriptions +- dynamic field schema and additional fields +- optional services with pricing +- SumUp flows (checkout/process/webhook) +- shared lists and move subscriptions +- waivers and organizer utilities ### 3.4 Treasury -- CRUD account e visibilita per gruppi -- CRUD transazioni con impatto su balance -- emissione ESNcard e fee policy +- account CRUD and group-based visibility +- transaction CRUD with balance impact +- ESNcard issuance and fee policy +- ESNcard revocation with tracked refund (`rimborso_esncard`) - reimbursement request lifecycle -- rimborsi deposito/quota/servizi +- deposit/fee/services reimbursements - export XLSX ### 3.5 Content -- CRUD sezioni e link +- section and link CRUD - policy content manager (Board o can_manage_content) -- configurazione WhatsApp singleton -- workflow pubblico whatsapp-register con email e audit CSV Drive +- WhatsApp singleton configuration +- public `whatsapp-register` workflow with email and Drive CSV audit ### 3.6 E2E Integration -- test multi-modulo in backend/test_integration_e2e.py -- copertura flussi critici onboarding/eventi/pagamenti/rimborsi +- multi-module tests in `backend/test_integration_e2e.py` +- coverage of critical onboarding/events/payments/reimbursements flows ## 4. Residual Risk Register -1. Concorrenza treasury: race su update simultanei di balance. -2. Scalabilita: dataset grandi su events/transactions/reimbursements. -3. Sicurezza webhook/token: replay, ordering, scadenza, abuse rate. -4. Contratti frontend-backend: drift payload su form pubblici/pagamenti. +1. Treasury concurrency: race conditions on simultaneous balance updates. +2. Scalability: large datasets on events/transactions/reimbursements. +3. Webhook/token security: replay, ordering, expiration, abuse rate. +4. Frontend-backend contracts: payload drift on public forms/payments. ## 5. Recommended Test Enhancements -1. Aggiungere test di concorrenza per transazioni contabili. -2. Introdurre contract test espliciti per endpoint pubblici. -3. Rafforzare test idempotenza webhook con eventi duplicati/disordinati. -4. Aggiungere smoke E2E automatizzati su gate release. +1. Add concurrency tests for accounting transactions. +2. Introduce explicit contract tests for public endpoints. +3. Strengthen webhook idempotency tests with duplicate/out-of-order events. +4. Add automated E2E smoke tests in release gate. ## 6. Execution Commands -Esecuzione completa: +Full execution: ```bash python manage.py test ``` -Per modulo: +Per module: ```bash python manage.py test users @@ -106,7 +107,7 @@ python manage.py test content python manage.py test test_integration_e2e ``` -Esecuzione con test settings: +Execution with test settings: ```bash DJANGO_SETTINGS_MODULE=backend.settings.test python manage.py test @@ -114,16 +115,16 @@ DJANGO_SETTINGS_MODULE=backend.settings.test python manage.py test ## 7. Maintenance Policy -1. Ogni bug fix deve includere almeno un test di regressione. -2. Ogni nuova API deve includere permessi, validazione, happy path, error path. -3. Flussi finanziari devono includere controlli su balance e idempotenza. -4. Questo report va aggiornato a ogni modifica significativa della suite test. +1. Every bug fix must include at least one regression test. +2. Every new API must include permissions, validation, happy path, and error path tests. +3. Financial flows must include balance and idempotency checks. +4. This report must be updated for every significant test-suite change. ## 8. AI Agent Interpretation Notes -Regole per uso corretto del report da parte di agenti AI: +Rules for correct report usage by AI agents: -1. Non usare il numero totale test come metrica unica di qualita. -2. Per cambi ad alto rischio consultare prima 06_INTEGRATION_E2E.md. -3. Validare sempre i gap residui rispetto al cambiamento richiesto. -4. In caso di mismatch tra report e suite reale, prevale l esecuzione test corrente. +1. Do not use total test count as the only quality metric. +2. For high-risk changes, consult `06_INTEGRATION_E2E.md` first. +3. Always validate residual gaps against the requested change. +4. If report and real suite differ, current test execution is authoritative. diff --git a/backend/README_APIs.md b/backend/README_APIs.md index 70ff5e547..ac970ab81 100644 --- a/backend/README_APIs.md +++ b/backend/README_APIs.md @@ -3,13 +3,13 @@ python, using [Django](https://www.djangoproject.com) and [Django Rest Framework The code is divided into 4 apps that handle different functionalities of the management platform. -- **profiles**: manages the registration of new profiles (erasmus or esners), adding or editing documents or matricole, +- **profiles**: manages registration of new profiles (Erasmus or ESNers), including documents and student IDs (`matricole`), releasing esncards, retrieving data and search through it. - **events**: manages events, i.e. creation, editing, registering a profile to an event, etc. - **treasury**: manages transactions (created when a payment is issued, for example when registering to an event or - releasing an esncard) and accounts (i.e. casse) + releasing an ESNcard) and cash accounts - **users**: handles authentication @@ -37,7 +37,7 @@ The structure of every app is as follows: `POST /profiles` -Creates a profile with related document and matricola. `verified` field is initialized to false. +Creates a profile with related document and student ID (`matricola`). `verified` field is initialized to false. #### **Parameters:** @@ -62,14 +62,14 @@ Creates a profile with related document and matricola. `verified` field is initi `GET /profiles` -Returns all profiles without linked documents, matricole or ESNcards. +Returns all profiles without linked documents, student IDs, or ESNcards. ### Fetch specified profile * `GET /profiles/` If existing, returns detailed profile corresponding to the primary key (pk), including list of the profile's documents, -matricole and ESNcards. +student IDs and ESNcards. ### Update specified profile * @@ -137,13 +137,13 @@ Updates the fields of the specified document. Deletes the specified document. -# Matricola endpoints +# Student ID (`matricola`) Endpoints -### Create matricola +### Create Student ID (`matricola`) `POST /matricole/` -Creates a new matricola associated to the specified profile. +Creates a new student ID (`matricola`) associated with the specified profile. #### **Parameters** @@ -153,18 +153,18 @@ Creates a new matricola associated to the specified profile. | number | string | yes | document number | | expiration | timestamp | yes | expiration date | -### Update matricola +### Update Student ID (`matricola`) `PATCH /matricole/` -Updates the fields of the specified matricola. +Updates the fields of the specified student ID (`matricola`). | name | type | mandatory | description | |------------|-----------|-----------|-----------------| | number | string | no | document number | | expiration | timestamp | no | expiration date | -### Delete matricola +### Delete Student ID (`matricola`) `DELETE /matricole/` @@ -172,32 +172,59 @@ Deletes the specified # ESNcard endpoints -### Create ESNcard +### Emit ESNcard -`POST /esncards` +`POST /esncard_emission/` -Creates a new ESNcard associated to the specified profile. +Creates a new ESNcard associated to the specified profile and registers the related treasury transaction +(`type=esncard`) on the selected account. #### **Parameters** -| name | type | mandatory | description | -|------------|-----------|-----------|-----------------------------------------------| -| email | string | yes | email corresponding to the associated profile | -| number | string | yes | document number | -| expiration | timestamp | yes | expiration date | +| name | type | mandatory | description | +|---------------|--------|-----------|--------------------| +| profile_id | int | yes | profile identifier | +| esncard_number| string | yes | ESNcard number | +| account_id | int | yes | treasury account | ### Update ESNcard -`PATCH /esncards/` +`PATCH /esncard//` -Updates the fields of the specified ESNcard. +Updates editable fields of the specified ESNcard. #### **Parameters** -| name | type | mandatory | description | -|------------|-----------|-----------|-----------------| -| number | string | no | document number | -| expiration | timestamp | no | expiration date | +| name | type | mandatory | description | +|--------|--------|-----------|---------------| +| number | string | no | ESNcard number| + +### Revoke ESNcard (Board only) + +`DELETE /esncard//` + +Revokes the specified ESNcard. + +Behavior: + +- deletes the ESNcard record +- keeps the original ESNcard emission transaction +- creates a new treasury refund transaction (`type=rimborso_esncard`) with negative amount on the same account + +#### **Response fields** + +| name | type | description | +|-------------------------|--------|-------------| +| message | string | operation result summary | +| revoked_esncard_number | string | revoked card number | +| original_transaction_id | int\|null | ESNcard emission transaction id | +| refund_transaction_id | int\|null | generated refund transaction id | + +#### **Common errors** + +- `401`: caller is not a Board member +- `404`: ESNcard does not exist +- `409`: automatic revoke blocked (linked anomalous transactions, multiple linked emissions, closed account, insufficient balance) # User endpoints @@ -205,7 +232,7 @@ Updates the fields of the specified ESNcard. `POST /users` -Creates a user and its associated profile, document and matricola. Profile's `verified` field is initialized to false. +Creates a user and its associated profile, document, and student ID (`matricola`). Profile's `verified` field is initialized to false. #### **Parameters:** @@ -343,7 +370,7 @@ Updates specific subscription. Deletes subscription. Possible only if there are no transactions related to the subscription. -# Account (cassa) +# Cash Account ### Fetch accounts diff --git a/backend/README_Content.md b/backend/README_Content.md index 7156f72cd..ae12c1151 100644 --- a/backend/README_Content.md +++ b/backend/README_Content.md @@ -1,136 +1,136 @@ -# Sistema di Gestione Contenuti Dinamici +# Dynamic Content Management System -## Descrizione +## Description -Questo modulo permette di gestire dinamicamente i contenuti della home page attraverso un'interfaccia di amministrazione. Il sistema è progettato per gestire due categorie fisse di contenuti: **LINK UTILI** e **WIKI E TUTORIAL**. +This module allows dynamic management of homepage content through an administration interface. The system is designed around two fixed content categories: **USEFUL LINKS** and **WIKI AND TUTORIALS**. -## Caratteristiche Principali +## Main Features -- **Due categorie predefinite**: LINK UTILI e WIKI E TUTORIAL -- **Campi obbligatori per ogni link**: Titolo, Descrizione, URL e Colore -- **Gestione completa dal pannello admin**: Solo membri Board possono modificare -- **Tutti i link vengono letti dal database**: Nessun contenuto hardcoded +- **Two predefined categories**: USEFUL LINKS and WIKI AND TUTORIALS +- **Mandatory fields for each link**: Title, Description, URL, and Color +- **Full admin-panel management**: only Board members can modify content +- **All links are loaded from the database**: no hardcoded content -## Struttura +## Structure ### Backend (`backend/content/`) -- **models.py**: Definisce i modelli `ContentSection` e `ContentLink` - - `ContentSection`: Sezione di contenuti (es: "LINK UTILI") - - `ContentLink`: Singolo link all'interno di una sezione +- **models.py**: defines `ContentSection` and `ContentLink` + - `ContentSection`: content section (for example "USEFUL LINKS") + - `ContentLink`: single link inside a section -- **serializers.py**: Serializer REST per le API -- **views.py**: ViewSet con permessi (solo Board può modificare) -- **urls.py**: Route API per gestione contenuti -- **admin.py**: Interfaccia Django Admin +- **serializers.py**: REST serializers for API payloads +- **views.py**: ViewSets with permission checks (only Board can modify) +- **urls.py**: API routes for content management +- **admin.py**: Django Admin integration ### Frontend -- **Pages/ContentManager.jsx**: Pagina di amministrazione per gestire sezioni e link -- **Pages/Home.jsx**: Pagina home aggiornata per leggere contenuti dinamici -- **Components/ProtectedRoute.jsx**: Aggiornato per supportare `requiredGroup` +- **Pages/ContentManager.jsx**: admin page for sections and links +- **Pages/Home.jsx**: homepage rendering dynamic content +- **Components/ProtectedRoute.jsx**: supports `requiredGroup` ## API Endpoints ``` -GET /backend/content/sections/ - Lista sezioni -GET /backend/content/sections/active_sections/ - Sezioni attive con link -POST /backend/content/sections/ - Crea sezione (solo Board) -PATCH /backend/content/sections/{id}/ - Modifica sezione (solo Board) -DELETE /backend/content/sections/{id}/ - Elimina sezione (solo Board) - -GET /backend/content/links/ - Lista link -POST /backend/content/links/ - Crea link (solo Board) -PATCH /backend/content/links/{id}/ - Modifica link (solo Board) -DELETE /backend/content/links/{id}/ - Elimina link (solo Board) +GET /backend/content/sections/ - list sections +GET /backend/content/sections/active_sections/ - list active sections with links +POST /backend/content/sections/ - create section (Board only) +PATCH /backend/content/sections/{id}/ - update section (Board only) +DELETE /backend/content/sections/{id}/ - delete section (Board only) + +GET /backend/content/links/ - list links +POST /backend/content/links/ - create link (Board only) +PATCH /backend/content/links/{id}/ - update link (Board only) +DELETE /backend/content/links/{id}/ - delete link (Board only) ``` -## Permessi +## Permissions -- **Lettura**: Tutti gli utenti autenticati -- **Modifica**: Solo membri del Board +- **Read**: all authenticated users +- **Write**: Board members only -## Setup e Migrazione +## Setup and Migration -1. **Eseguire le migrazioni**: +1. **Run migrations**: ```bash cd backend python manage.py migrate ``` -2. **Popolare il database con i dati iniziali**: +2. **Populate initial content data**: ```bash python manage.py populate_content ``` -Questo comando creerà automaticamente le due sezioni (LINK UTILI e WIKI E TUTORIAL) e popolerà i link iniziali. +This command automatically creates the two fixed sections (USEFUL LINKS and WIKI AND TUTORIALS) and populates initial links. -## Modelli +## Models ### ContentSection -- `title`: Categoria (LINK_UTILI o WIKI_TUTORIAL) - **Campo unico** -- `order`: Ordine di visualizzazione -- `is_active`: Flag per attivare/disattivare -- `created_by`: Utente creatore -- `created_at`/`updated_at`: Timestamp +- `title`: category (`LINK_UTILI` or `WIKI_TUTORIAL`) - **unique field** +- `order`: display order +- `is_active`: active/inactive flag +- `created_by`: creator user +- `created_at`/`updated_at`: timestamps -**Nota**: Le sezioni sono fisse, solo due categorie possibili. +Note: sections are fixed to two categories by design. ### ContentLink -- `section`: ForeignKey a ContentSection -- `name`: Titolo del link - **Obbligatorio** -- `description`: Descrizione del link - **Obbligatorio** -- `url`: URL del link - **Obbligatorio** -- `color`: Colore esadecimale (es: #1976d2) - **Obbligatorio** -- `order`: Ordine all'interno della sezione -- `is_active`: Flag per attivare/disattivare -- `created_by`: Utente creatore -- `created_at`/`updated_at`: Timestamp +- `section`: foreign key to `ContentSection` +- `name`: link title - **required** +- `description`: link description - **required** +- `url`: link URL - **required** +- `color`: hexadecimal color (for example `#1976d2`) - **required** +- `order`: order inside the section +- `is_active`: active/inactive flag +- `created_by`: creator user +- `created_at`/`updated_at`: timestamps -**Tutti i campi name, description, url e color sono obbligatori.** +All `name`, `description`, `url`, and `color` fields are mandatory. -## Azioni Speciali +## Special Actions -~~Per link che devono eseguire azioni custom (come aprire modali), impostare il campo `action_type`~~ +~~For links that should trigger custom actions (for example opening a modal), set `action_type`.~~ -**Rimosso**: Il campo `action_type` è stato rimosso. Tutti i link ora sono link standard che aprono URL. +**Removed**: `action_type` has been removed. All links are standard URL links. -## Fallback +## Fallback Behavior -~~Se il caricamento dei contenuti dinamici fallisce, la home page usa automaticamente i contenuti statici hardcoded come fallback.~~ +~~If dynamic content loading fails, the homepage automatically uses static hardcoded fallback content.~~ -**Aggiornato**: Tutti i contenuti ora vengono caricati dal database. Non ci sono più contenuti statici di fallback. In caso di errore, viene mostrato un messaggio di errore all'utente. +**Updated**: all content is loaded from the database. Static fallback content is no longer used. If loading fails, the user sees an error message. -## Accesso alla Pagina di Gestione +## Access to Content Manager -La pagina di gestione contenuti è accessibile solo ai membri del Board tramite: -- Menu laterale: "Gestione Contenuti" -- URL diretto: `/content-manager` +The content management page is available only to Board members via: +- sidebar item: "Content Management" +- direct URL: `/content-manager` -## Funzionalità della Pagina di Gestione +## Content Manager Capabilities -### Sezioni -- **Due sezioni fisse**: LINK UTILI e WIKI E TUTORIAL -- Solo visualizzazione, non si possono creare/eliminare sezioni -- Ogni sezione mostra il numero di link contenuti +### Sections +- **Two fixed sections**: USEFUL LINKS and WIKI AND TUTORIALS +- display-only for sections (no create/delete in UI) +- each section shows the current number of links -### Link -- Aggiunta link a una sezione -- **Campi obbligatori**: - - **Titolo**: Nome del link - - **Descrizione**: Testo descrittivo del link - - **Link/URL**: URL completo (es: https://...) - - **Colore**: Colore in formato esadecimale (es: #1976d2) -- Impostazione ordine di visualizzazione -- Attivazione/disattivazione -- Eliminazione +### Links +- add a link to a section +- **required fields**: + - **Title**: link name + - **Description**: descriptive text + - **Link/URL**: full URL (for example `https://...`) + - **Color**: hexadecimal color (for example `#1976d2`) +- set display order +- activate/deactivate +- delete -### Validazione -La pagina di gestione valida che tutti i campi obbligatori siano compilati prima di salvare. +### Validation +The page validates required fields before save. -## Note Tecniche +## Technical Notes -- I contenuti vengono caricati all'apertura della home page -- La cache non è implementata (ogni visita alla home carica i dati freschi) -- I contenuti inattivi non vengono mostrati agli utenti -- L'ordine dei contenuti è gestibile tramite il campo `order` +- Content is loaded whenever the homepage is opened. +- Caching is currently not implemented (fresh data on each homepage visit). +- Inactive content is not shown to users. +- Display ordering is controlled by the `order` field. diff --git a/backend/README_Models.md b/backend/README_Models.md index 36b4e787b..cbe59000f 100644 --- a/backend/README_Models.md +++ b/backend/README_Models.md @@ -1,33 +1,33 @@ -# Eventi -Obiettivo: integrare le funzionalità di gestione degli eventi e delle iscrizioni in un'unica piattaforma, eliminando la necessità di utilizzare sia un gestionale che un foglio Excel. La piattaforma permetterà di gestire i pagamenti, i rimborsi e l'organizzazione degli eventi in modo più efficiente e centralizzato. +# Events +Goal: integrate event and subscription management features into a single platform, removing the need to use both a management tool and an Excel sheet. The platform supports payments, reimbursements, and event operations in a more efficient and centralized way. -### Funzionalità Principali +### Main Features -1. **Creazione e Gestione degli Eventi** - - Ogni evento può avere attributi come nome, data, descrizione, RE ed RS. - - È possibile specificare diverse tabelle per ogni evento, ad esempio "Main List" e "Waiting List", con nome e capienza. +1. **Event Creation and Management** + - Each event can include attributes such as name, date, description, RE, and RS. + - Multiple lists can be configured per event, such as "Main List" and "Waiting List", each with its own name and capacity. -2. **Iscrizioni (Subscriptions)** - - Ogni riga di una tabella è associata a un'iscrizione, che rappresenta l'iscrizione di un profilo a un evento. - - Una subscription può essere presente in una sola tabella alla volta. +2. **Subscriptions** + - Each row in a list is linked to a subscription, representing one profile enrolled in one event. + - A subscription can belong to only one list at a time. -3. **Colonne delle Tabelle** - - **Profile Fields**: Colonne che includono dati anagrafici degli iscritti (nome, cognome, numero di telefono, ESN card, ecc.). Queste colonne sono immutabili e vengono popolate automaticamente dal database. - - **Form Fields**: Colonne che vengono riempite con le risposte fornite dagli iscritti attraverso un form. Queste colonne sono modificabili dagli organizzatori. - - **Additional Fields**: Colonne aggiuntive compilabili direttamente dagli organizzatori per supportare l'organizzazione dell'evento (es. annotazioni, richieste di noleggio, ecc.). Ogni campo ha attributi booleani per la visibilità e l'editabilità da parte dell'ufficio. +3. **List Columns** + - **Profile Fields**: Columns containing participant profile data (name, surname, phone number, ESN card, and so on). These columns are immutable and automatically populated from the database. + - **Form Fields**: Columns populated with answers submitted by participants through a form. These columns can be edited by organizers. + - **Additional Fields**: Extra columns filled directly by organizers to support event operations (for example notes or rental requests). Each field includes boolean attributes for office visibility and editability. -4. **Gestione delle Righe** - - Le righe possono essere trasferite da una tabella all'altra rispettando la capienza massima. - - È possibile aggiungere manualmente delle righe, associandole a un profilo esistente. +4. **Row Management** + - Rows can be moved between lists while respecting capacity limits. + - Organizers can manually add rows by linking them to an existing profile. -5. **Gestione dei Pagamenti** - - Ogni riga ha un pulsante che apre un modale con la lista delle transazioni effettuate per quello specifico evento. - - Il modale permette di visualizzare lo storico dei pagamenti/rimborsi e di effettuare nuove transazioni. - - È possibile creare un campo aggiuntivo "Stato" per indicare manualmente lo stato dei pagamenti (es. "Pagato", "Non pagato", "Rimborsato"). +5. **Payment Management** + - Each row has a button that opens a modal with the list of transactions for that specific event. + - The modal allows viewing payment/reimbursement history and creating new transactions. + - An optional additional field called "Status" can be used to manually track payment state (for example "Paid", "Unpaid", "Reimbursed"). -### Vantaggi +### Benefits -- **Centralizzazione**: Tutte le informazioni e le funzionalità sono integrate in un'unica piattaforma. -- **Flessibilità**: La possibilità di aggiungere e modificare campi e tabelle permette una gestione personalizzata degli eventi. -- **Efficienza**: La gestione automatizzata dei dati anagrafici e delle iscrizioni riduce gli errori e semplifica l'organizzazione. +- **Centralization**: All information and capabilities are available in one platform. +- **Flexibility**: Custom fields and lists allow tailored event management. +- **Efficiency**: Automated profile data and subscription flows reduce errors and simplify operations. diff --git a/backend/treasury/models.py b/backend/treasury/models.py index a584f5d87..3a3a6b77e 100644 --- a/backend/treasury/models.py +++ b/backend/treasury/models.py @@ -76,6 +76,7 @@ class Transaction(BaseEntity): class TransactionType(models.TextChoices): SUBSCRIPTION = "subscription", _("Subscription") ESNCARD = "esncard", _("ESNcard") + RIMBORSO_ESNCARD = "rimborso_esncard", _("Rimborso ESNcard") DEPOSIT = "deposit", _("Deposit") # Manual deposit (not cauzione) WITHDRAWAL = "withdrawal", _("Withdrawal") REIMBURSEMENT = "reimbursement", _("Reimbursement"), @@ -110,6 +111,11 @@ def clean(self): raise ValueError("Le transazioni di Rimborso Servizi devono avere un'Iscrizione.") if self.type == self.TransactionType.ESNCARD and not self.esncard: raise ValueError("Le transazioni di Emissione ESNcard devono avere una ESNcard.") + if self.type == self.TransactionType.RIMBORSO_ESNCARD: + if self.subscription: + raise ValueError("Le transazioni di Rimborso ESNcard non devono avere un'Iscrizione.") + if self.esncard: + raise ValueError("Le transazioni di Rimborso ESNcard non devono avere una ESNcard associata.") if self.type == self.TransactionType.CAUZIONE: if not self.subscription: raise ValueError("Le transazioni di Cauzione devono avere un'Iscrizione.") diff --git a/backend/treasury/tests.py b/backend/treasury/tests.py index 98f5ea3db..9bea151fe 100644 --- a/backend/treasury/tests.py +++ b/backend/treasury/tests.py @@ -292,6 +292,202 @@ def test_esncard_detail_patch_success(self): card.refresh_from_db() self.assertEqual(card.number, "ESN-00000") + def test_esncard_detail_delete_requires_board(self): + """ESNcard revoke must be restricted to Board members.""" + profile = _create_profile("editor@esnpolimi.it") + user = _create_user(profile) + self.authenticate(user) + + card_owner = _create_profile("owner@uni.it", is_esner=False) + card = ESNcard.objects.create(profile=card_owner, number="ESN-DEL-001") + + response = self.client.delete(f"/backend/esncard/{card.pk}/") + + self.assertEqual(response.status_code, 401) + self.assertTrue(ESNcard.objects.filter(pk=card.pk).exists()) + + def test_esncard_detail_delete_success_creates_refund_and_reverts_balance(self): + """Revoking a card should keep emission tx and create a refund tx restoring balance.""" + profile = _create_profile("board@esnpolimi.it") + user = _create_user(profile) + user.groups.add(self.group_board) + self.authenticate(user) + + account = _create_account("Main", user=user, balance="0.00") + card_owner = _create_profile("owner@uni.it", is_esner=False) + card = ESNcard.objects.create(profile=card_owner, number="ESN-DEL-002") + tx = Transaction.objects.create( + account=account, + executor=user, + type=Transaction.TransactionType.ESNCARD, + esncard=card, + amount=Decimal("10.00"), + description="Emissione ESNcard test", + ) + + account.refresh_from_db() + self.assertEqual(account.balance, Decimal("10.00")) + + response = self.client.delete(f"/backend/esncard/{card.pk}/") + + self.assertEqual(response.status_code, 200) + self.assertFalse(ESNcard.objects.filter(pk=card.pk).exists()) + self.assertTrue(Transaction.objects.filter(pk=tx.pk).exists()) + + refund_tx = Transaction.objects.filter( + type=Transaction.TransactionType.RIMBORSO_ESNCARD, + account=account, + ).first() + self.assertIsNotNone(refund_tx) + self.assertEqual(refund_tx.amount, Decimal("-10.00")) + self.assertIn("ESN-DEL-002", refund_tx.description) + self.assertEqual(response.data.get("original_transaction_id"), tx.pk) + self.assertEqual(response.data.get("refund_transaction_id"), refund_tx.pk) + + account.refresh_from_db() + self.assertEqual(account.balance, Decimal("0.00")) + + def test_esncard_detail_delete_success_without_linked_emission(self): + """Revoking should still work when no linked ESNcard emission tx is present.""" + profile = _create_profile("board@esnpolimi.it") + user = _create_user(profile) + user.groups.add(self.group_board) + self.authenticate(user) + + card_owner = _create_profile("owner@uni.it", is_esner=False) + card = ESNcard.objects.create(profile=card_owner, number="ESN-DEL-003") + + response = self.client.delete(f"/backend/esncard/{card.pk}/") + + self.assertEqual(response.status_code, 200) + self.assertFalse(ESNcard.objects.filter(pk=card.pk).exists()) + self.assertIsNone(response.data.get("original_transaction_id")) + self.assertIsNone(response.data.get("refund_transaction_id")) + + def test_esncard_detail_delete_rejects_insufficient_balance_for_refund(self): + """Revoking should fail if account balance is insufficient for ESNcard refund.""" + profile = _create_profile("board@esnpolimi.it") + user = _create_user(profile) + user.groups.add(self.group_board) + self.authenticate(user) + + account = _create_account("Main", user=user, balance="0.00") + card_owner = _create_profile("owner@uni.it", is_esner=False) + card = ESNcard.objects.create(profile=card_owner, number="ESN-DEL-006") + emission_tx = Transaction.objects.create( + account=account, + executor=user, + type=Transaction.TransactionType.ESNCARD, + esncard=card, + amount=Decimal("10.00"), + description="Emissione ESNcard test", + ) + Transaction.objects.create( + account=account, + executor=user, + type=Transaction.TransactionType.WITHDRAWAL, + amount=Decimal("-10.00"), + description="Prelievo test", + ) + + account.refresh_from_db() + self.assertEqual(account.balance, Decimal("0.00")) + + response = self.client.delete(f"/backend/esncard/{card.pk}/") + + self.assertEqual(response.status_code, 409) + self.assertTrue(ESNcard.objects.filter(pk=card.pk).exists()) + self.assertTrue(Transaction.objects.filter(pk=emission_tx.pk).exists()) + self.assertFalse(Transaction.objects.filter(type=Transaction.TransactionType.RIMBORSO_ESNCARD).exists()) + + def test_esncard_detail_delete_rejects_closed_account_for_refund(self): + """Revoking should fail if emission account is closed before refund.""" + profile = _create_profile("board@esnpolimi.it") + user = _create_user(profile) + user.groups.add(self.group_board) + self.authenticate(user) + + account = _create_account("Main", user=user, balance="0.00") + card_owner = _create_profile("owner@uni.it", is_esner=False) + card = ESNcard.objects.create(profile=card_owner, number="ESN-DEL-007") + emission_tx = Transaction.objects.create( + account=account, + executor=user, + type=Transaction.TransactionType.ESNCARD, + esncard=card, + amount=Decimal("10.00"), + description="Emissione ESNcard test", + ) + account.status = Account.Status.closed + account.save(update_fields=["status"]) + + response = self.client.delete(f"/backend/esncard/{card.pk}/") + + self.assertEqual(response.status_code, 409) + self.assertTrue(ESNcard.objects.filter(pk=card.pk).exists()) + self.assertTrue(Transaction.objects.filter(pk=emission_tx.pk).exists()) + self.assertFalse(Transaction.objects.filter(type=Transaction.TransactionType.RIMBORSO_ESNCARD).exists()) + + def test_esncard_detail_delete_rejects_multiple_linked_emissions(self): + """Revoking should fail if more than one ESNcard emission tx is linked.""" + profile = _create_profile("board@esnpolimi.it") + user = _create_user(profile) + user.groups.add(self.group_board) + self.authenticate(user) + + account = _create_account("Main", user=user, balance="0.00") + card_owner = _create_profile("owner@uni.it", is_esner=False) + card = ESNcard.objects.create(profile=card_owner, number="ESN-DEL-004") + Transaction.objects.create( + account=account, + executor=user, + type=Transaction.TransactionType.ESNCARD, + esncard=card, + amount=Decimal("10.00"), + description="Emissione ESNcard 1", + ) + Transaction.objects.create( + account=account, + executor=user, + type=Transaction.TransactionType.ESNCARD, + esncard=card, + amount=Decimal("10.00"), + description="Emissione ESNcard 2", + ) + + response = self.client.delete(f"/backend/esncard/{card.pk}/") + + self.assertEqual(response.status_code, 409) + self.assertTrue(ESNcard.objects.filter(pk=card.pk).exists()) + self.assertEqual(Transaction.objects.filter(esncard=card, type=Transaction.TransactionType.ESNCARD).count(), 2) + + def test_esncard_detail_delete_rejects_unexpected_transaction_types(self): + """Revoking should fail if the card is linked to non-ESNcard transaction types.""" + profile = _create_profile("board@esnpolimi.it") + user = _create_user(profile) + user.groups.add(self.group_board) + self.authenticate(user) + + account = _create_account("Main", user=user, balance="0.00") + card_owner = _create_profile("owner@uni.it", is_esner=False) + card = ESNcard.objects.create(profile=card_owner, number="ESN-DEL-005") + + tx = Transaction.objects.create( + account=account, + executor=user, + type=Transaction.TransactionType.DEPOSIT, + amount=Decimal("10.00"), + description="Deposito test", + ) + # Simulate legacy/corrupted data by linking the ESNcard post-save. + Transaction.objects.filter(pk=tx.pk).update(esncard=card) + + response = self.client.delete(f"/backend/esncard/{card.pk}/") + + self.assertEqual(response.status_code, 409) + self.assertTrue(ESNcard.objects.filter(pk=card.pk).exists()) + self.assertTrue(Transaction.objects.filter(pk=tx.pk).exists()) + class TransactionTests(TreasuryBaseTestCase): """Tests for transaction endpoints.""" diff --git a/backend/treasury/views.py b/backend/treasury/views.py index d3a14d210..452d62657 100644 --- a/backend/treasury/views.py +++ b/backend/treasury/views.py @@ -59,6 +59,8 @@ def get_action_permissions(action, user): return user.has_perm('treasury.delete_transaction') or getattr(user, 'can_manage_casse', False) if action == 'esncard_detail_patch': return user.has_perm('treasury.change_esncard') + if action == 'esncard_detail_delete': + return user_is_board(user) if action == 'reimbursement_request_detail_patch': return user_is_board(user) if action == 'reimbursement_request_detail_delete': @@ -161,12 +163,12 @@ def esncard_emission(request): return Response({'error': 'Errore interno del server.'}, status=500) -@api_view(['PATCH']) +@api_view(['PATCH', 'DELETE']) @permission_classes([IsAuthenticated]) def esncard_detail(request, pk): try: - esncard = ESNcard.objects.get(pk=pk) if request.method == 'PATCH': + esncard = ESNcard.objects.get(pk=pk) if not get_action_permissions('esncard_detail_patch', request.user): return Response({'error': 'Non autorizzato.'}, status=401) update_data = {} @@ -178,10 +180,95 @@ def esncard_detail(request, pk): return Response(esncard_serializer.data, status=200) # Return updated data else: return Response(esncard_serializer.errors, status=400) + + elif request.method == 'DELETE': + if not get_action_permissions('esncard_detail_delete', request.user): + return Response({'error': 'Non autorizzato.'}, status=401) + + with transaction.atomic(): + esncard = ESNcard.objects.select_for_update().select_related('profile').get(pk=pk) + + # Defensive guard: this flow only reverts ESNcard emission transactions. + # If the card is linked to unexpected transaction types, stop and require manual fix. + non_esncard_refs = Transaction.objects.select_for_update().filter(esncard=esncard).exclude( + type=Transaction.TransactionType.ESNCARD + ) + if non_esncard_refs.exists(): + return Response( + {'error': 'La ESNcard è collegata a transazioni non revocabili automaticamente.'}, + status=409 + ) + + linked_emissions = list( + Transaction.objects.select_for_update().filter( + esncard=esncard, + type=Transaction.TransactionType.ESNCARD + ).order_by('-created_at', '-id')[:2] + ) + if len(linked_emissions) > 1: + return Response( + {'error': 'Sono state trovate più transazioni ESNcard collegate. Revoca annullata.'}, + status=409 + ) + + original_transaction_id = None + refund_transaction_id = None + if linked_emissions: + emission_tx = linked_emissions[0] + original_transaction_id = emission_tx.id + + emission_amount = Decimal(str(emission_tx.amount or 0)) + if emission_amount <= 0: + return Response( + {'error': 'Importo della transazione ESNcard non valido per il rimborso automatico.'}, + status=409 + ) + + refund_account = Account.objects.select_for_update().get(pk=emission_tx.account_id) + if refund_account.status == Account.Status.closed: + return Response({'error': 'La cassa della transazione ESNcard è chiusa.'}, status=409) + + if refund_account.balance - emission_amount < 0: + return Response({'error': 'Saldo insufficiente per effettuare il rimborso ESNcard.'}, status=409) + + refund_tx = Transaction( + type=Transaction.TransactionType.RIMBORSO_ESNCARD, + account=refund_account, + executor=request.user, + amount=-emission_amount, + description=( + f"Rimborso ESNcard revocata {esncard.number}: " + f"{esncard.profile.name} {esncard.profile.surname} " + f"(emissione #{emission_tx.id})" + ) + ) + try: + refund_tx.save() + except (PermissionDenied, ValueError) as refund_error: + return Response({'error': str(refund_error)}, status=409) + + refund_transaction_id = refund_tx.id + + revoked_number = esncard.number + esncard.delete() + + msg = 'ESNcard revocata con successo.' + if original_transaction_id and refund_transaction_id: + msg += ' Creata transazione di rimborso in tesoreria.' + else: + msg += ' Nessuna transazione di emissione trovata da rimborsare.' + + return Response({ + 'message': msg, + 'revoked_esncard_number': revoked_number, + 'original_transaction_id': original_transaction_id, + 'refund_transaction_id': refund_transaction_id, + }, status=200) else: return Response({'error': "Metodo non consentito"}, status=405) except ESNcard.DoesNotExist: - return Response({'error': 'La ESNcard non esiste'}, status=400) + not_found_status = 404 if request.method == 'DELETE' else 400 + return Response({'error': 'La ESNcard non esiste'}, status=not_found_status) except Exception as e: logger.error(str(e)) sentry_sdk.capture_exception(e) @@ -365,6 +452,7 @@ def transaction_detail(request, pk): # Allow deletion only for specific transaction types list_deleteable = [ Transaction.TransactionType.RIMBORSO_CAUZIONE, + Transaction.TransactionType.RIMBORSO_ESNCARD, Transaction.TransactionType.REIMBURSEMENT, Transaction.TransactionType.RIMBORSO_QUOTA, Transaction.TransactionType.DEPOSIT, @@ -944,6 +1032,8 @@ def compute_amount(tx_obj): def build_attivita(tx_obj): if tx_obj.type == Transaction.TransactionType.ESNCARD: return "Quota Associativa" + if tx_obj.type == Transaction.TransactionType.RIMBORSO_ESNCARD: + return "Rimborso ESNcard" if tx_obj.type == Transaction.TransactionType.DEPOSIT: return "Deposito" if tx_obj.type == Transaction.TransactionType.WITHDRAWAL: @@ -973,6 +1063,8 @@ def build_descrizione(tx_obj): # New computed description column. if tx_obj.type == Transaction.TransactionType.ESNCARD: return f"Quota Associativa {_academic_year(tx_obj.created_at)}" + if tx_obj.type == Transaction.TransactionType.RIMBORSO_ESNCARD: + return f"Rimborso Quota Associativa {_academic_year(tx_obj.created_at)}" ev = None if getattr(tx_obj, 'subscription_id', None) and getattr(tx_obj.subscription, 'event', None): ev = tx_obj.subscription.event diff --git a/frontend/build/assets/index-B060htL7.js b/frontend/build/assets/index-CD2rGuOx.js similarity index 64% rename from frontend/build/assets/index-B060htL7.js rename to frontend/build/assets/index-CD2rGuOx.js index 62508e26e..3f5764b30 100644 --- a/frontend/build/assets/index-B060htL7.js +++ b/frontend/build/assets/index-CD2rGuOx.js @@ -1,29 +1,29 @@ -var A4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G1e=A4((Rs,ks)=>{function D4(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M0={exports:{}},Dp={};var hE;function O4(){if(hE)return Dp;hE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Dp.Fragment=t,Dp.jsx=n,Dp.jsxs=n,Dp}var gE;function I4(){return gE||(gE=1,M0.exports=O4()),M0.exports}var a=I4();const pn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Kn=globalThis,uu="10.36.0";function Ey(){return My(Kn),Kn}function My(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||uu,t[uu]=t[uu]||{}}function Ef(e,t,n=Kn){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[uu]=r[uu]||{};return o[e]||(o[e]=t())}const L4=["debug","info","warn","error","log","assert","trace"],z4="Sentry Logger ",Gb={};function Mf(e){if(!("console"in Kn))return e();const t=Kn.console,n={},r=Object.keys(Gb);r.forEach(o=>{const s=Gb[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function N4(){vC().enabled=!0}function $4(){vC().enabled=!1}function PA(){return vC().enabled}function F4(...e){yC("log",...e)}function B4(...e){yC("warn",...e)}function V4(...e){yC("error",...e)}function yC(e,...t){pn&&PA()&&Mf(()=>{Kn.console[e](`${z4}[${e}]:`,...t)})}function vC(){return pn?Ef("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Qt={enable:N4,disable:$4,isEnabled:PA,log:F4,warn:B4,error:V4},AA=50,mu="?",bE=/\(error: (.*)\)/,yE=/captureMessage|captureException/;function DA(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],l=n.split(` -`);for(let u=r;u1024&&(d=d.slice(0,1024));const p=bE.test(d)?d.replace(bE,"$1"):d;if(!p.match(/\S*Error: /)){for(const m of t){const b=m(p);if(b){s.push(b);break}}if(s.length>=AA+o)break}}return q4(s.slice(o))}}function H4(e){return Array.isArray(e)?DA(...e):e}function q4(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Eg(t).function||"")&&t.pop(),t.reverse(),yE.test(Eg(t).function||"")&&(t.pop(),yE.test(Eg(t).function||"")&&t.pop()),t.slice(0,AA).map(n=>({...n,filename:n.filename||Eg(t).filename,function:n.function||mu}))}function Eg(e){return e[e.length-1]||{}}const R0="";function pc(e){try{return!e||typeof e!="function"?R0:e.name||R0}catch{return R0}}function vE(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function OA(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const gb={},xE={};function ju(e,t){gb[e]=gb[e]||[],gb[e].push(t)}function Eu(e,t){if(!xE[e]){xE[e]=!0;try{t()}catch(n){pn&&Qt.error(`Error while instrumenting ${e}`,n)}}}function Fi(e,t){const n=e&&gb[e];if(n)for(const r of n)try{r(t)}catch(o){pn&&Qt.error(`Error while triggering instrumentation handler. +var A4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G1e=A4((ks,Ps)=>{function D4(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M0={exports:{}},Op={};var hE;function O4(){if(hE)return Op;hE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Op.Fragment=t,Op.jsx=n,Op.jsxs=n,Op}var gE;function I4(){return gE||(gE=1,M0.exports=O4()),M0.exports}var a=I4();const bn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Zn=globalThis,uu="10.36.0";function Ey(){return My(Zn),Zn}function My(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||uu,t[uu]=t[uu]||{}}function Pf(e,t,n=Zn){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[uu]=r[uu]||{};return o[e]||(o[e]=t())}const L4=["debug","info","warn","error","log","assert","trace"],z4="Sentry Logger ",Gb={};function Af(e){if(!("console"in Zn))return e();const t=Zn.console,n={},r=Object.keys(Gb);r.forEach(o=>{const s=Gb[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function N4(){vC().enabled=!0}function $4(){vC().enabled=!1}function PA(){return vC().enabled}function F4(...e){yC("log",...e)}function B4(...e){yC("warn",...e)}function V4(...e){yC("error",...e)}function yC(e,...t){bn&&PA()&&Af(()=>{Zn.console[e](`${z4}[${e}]:`,...t)})}function vC(){return bn?Pf("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const tn={enable:N4,disable:$4,isEnabled:PA,log:F4,warn:B4,error:V4},AA=50,mu="?",bE=/\(error: (.*)\)/,yE=/captureMessage|captureException/;function DA(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],l=n.split(` +`);for(let u=r;u1024&&(d=d.slice(0,1024));const p=bE.test(d)?d.replace(bE,"$1"):d;if(!p.match(/\S*Error: /)){for(const m of t){const b=m(p);if(b){s.push(b);break}}if(s.length>=AA+o)break}}return q4(s.slice(o))}}function H4(e){return Array.isArray(e)?DA(...e):e}function q4(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Eg(t).function||"")&&t.pop(),t.reverse(),yE.test(Eg(t).function||"")&&(t.pop(),yE.test(Eg(t).function||"")&&t.pop()),t.slice(0,AA).map(n=>({...n,filename:n.filename||Eg(t).filename,function:n.function||mu}))}function Eg(e){return e[e.length-1]||{}}const R0="";function pc(e){try{return!e||typeof e!="function"?R0:e.name||R0}catch{return R0}}function vE(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function OA(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const gb={},xE={};function Ru(e,t){gb[e]=gb[e]||[],gb[e].push(t)}function ku(e,t){if(!xE[e]){xE[e]=!0;try{t()}catch(n){bn&&tn.error(`Error while instrumenting ${e}`,n)}}}function Fi(e,t){const n=e&&gb[e];if(n)for(const r of n)try{r(t)}catch(o){bn&&tn.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${pc(r)} -Error:`,o)}}let k0=null;function U4(e){const t="error";ju(t,e),Eu(t,W4)}function W4(){k0=Kn.onerror,Kn.onerror=function(e,t,n,r,o){return Fi("error",{column:r,error:o,line:n,msg:e,url:t}),k0?k0.apply(this,arguments):!1},Kn.onerror.__SENTRY_INSTRUMENTED__=!0}let P0=null;function G4(e){const t="unhandledrejection";ju(t,e),Eu(t,Y4)}function Y4(){P0=Kn.onunhandledrejection,Kn.onunhandledrejection=function(e){return Fi("unhandledrejection",e),P0?P0.apply(this,arguments):!0},Kn.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const IA=Object.prototype.toString;function qm(e){switch(IA.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return mc(e,Error)}}function Rf(e,t){return IA.call(e)===`[object ${t}]`}function LA(e){return Rf(e,"ErrorEvent")}function SE(e){return Rf(e,"DOMError")}function K4(e){return Rf(e,"DOMException")}function il(e){return Rf(e,"String")}function xC(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ry(e){return e===null||xC(e)||typeof e!="object"&&typeof e!="function"}function xm(e){return Rf(e,"Object")}function ky(e){return typeof Event<"u"&&mc(e,Event)}function X4(e){return typeof Element<"u"&&mc(e,Element)}function Q4(e){return Rf(e,"RegExp")}function Um(e){return!!(e?.then&&typeof e.then=="function")}function Z4(e){return xm(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function mc(e,t){try{return e instanceof t}catch{return!1}}function zA(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function NA(e){return typeof Request<"u"&&mc(e,Request)}const SC=Kn,J4=80;function $A(e,t={}){if(!e)return"";try{let n=e;const r=5,o=[];let s=0,l=0;const u=" > ",d=u.length;let p;const m=Array.isArray(t)?t:t.keyAttrs,b=!Array.isArray(t)&&t.maxStringLength||J4;for(;n&&s++1&&l+o.length*d+p.length>=b));)o.push(p),l+=p.length,n=n.parentNode;return o.reverse().join(u)}catch{return""}}function eF(e,t){const n=e,r=[];if(!n?.tagName)return"";if(SC.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=t?.length?t.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(o?.length)o.forEach(l=>{r.push(`[${l[0]}="${l[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const l=n.className;if(l&&il(l)){const u=l.split(/\s+/);for(const d of u)r.push(`.${d}`)}}const s=["aria-label","type","name","title","alt"];for(const l of s){const u=n.getAttribute(l);u&&r.push(`[${l}="${u}"]`)}return r.join("")}function CC(){try{return SC.document.location.href}catch{return""}}function tF(e){if(!SC.HTMLElement)return null;let t=e;const n=5;for(let r=0;r"}}function wE(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function nF(e){const t=Object.keys(BA(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Sd;function Py(e){if(Sd!==void 0)return Sd?Sd(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=Kn;return t in n&&typeof n[t]=="function"?(Sd=n[t],Sd(e)):(Sd=null,e())}function Yb(){return Py(()=>Math.random())}function Ay(){return Py(()=>Date.now())}function W1(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function _E(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;rbb(e,r,n))}function rF(){const e=Kn;return e.crypto||e.msCrypto}let A0;function oF(){return Yb()*16}function di(e=rF()){try{if(e?.randomUUID)return Py(()=>e.randomUUID()).replace(/-/g,"")}catch{}return A0||(A0="10000000100040008000"+1e11),A0.replace(/[018]/g,t=>(t^(oF()&15)>>t/4).toString(16))}function VA(e){return e.exception?.values?.[0]}function su(e){const{message:t,event_id:n}=e;if(t)return t;const r=VA(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function G1(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function rf(e,t){const n=VA(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const s={...o?.data,...t.data};n.mechanism.data=s}}function TE(e){if(sF(e))return!0;try{hc(e,"__sentry_captured__",!0)}catch{}return!1}function sF(e){try{return e.__sentry_captured__}catch{}}const HA=1e3;function Wm(){return Ay()/HA}function iF(){const{performance:e}=Kn;if(!e?.now||!e.timeOrigin)return Wm;const t=e.timeOrigin;return()=>(t+Py(()=>e.now()))/HA}let jE;function al(){return(jE??(jE=iF()))()}function aF(e){const t=al(),n={sid:di(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>cF(n)};return e&&of(n,e),n}function of(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||al(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:di()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function lF(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),of(e,n)}function cF(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Gm(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Gm(r[o],t[o],n-1));return r}function EE(){return di()}function qA(){return di().substring(16)}const Y1="_sentrySpan";function ME(e,t){t?hc(e,Y1,t):delete e[Y1]}function RE(e){return e[Y1]}const uF=100;let hu=class K1{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:EE(),sampleRand:Yb()}}clone(){const t=new K1;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,ME(t,RE(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&of(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof K1?n.getScopeData():xm(n)?t:void 0,{tags:o,attributes:s,extra:l,user:u,contexts:d,level:p,fingerprint:m=[],propagationContext:b}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...l},this._contexts={...this._contexts,...d},u&&Object.keys(u).length&&(this._user=u),p&&(this._level=p),m.length&&(this._fingerprint=m),b&&(this._propagationContext=b),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,ME(this,void 0),this._attachments=[],this.setPropagationContext({traceId:EE(),sampleRand:Yb()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:uF;if(r<=0)return this;const o={timestamp:Wm(),...t,message:t.message?W1(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:RE(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Gm(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n?.event_id||di();if(!this._client)return pn&&Qt.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=r?.event_id||di();if(!this._client)return pn&&Qt.warn("No client configured on scope - will not capture message!"),o;const s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){const r=n?.event_id||di();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(pn&&Qt.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function dF(){return Ef("defaultCurrentScope",()=>new hu)}function fF(){return Ef("defaultIsolationScope",()=>new hu)}class pF{constructor(t,n){let r;t?r=t:r=new hu;let o;n?o=n:o=new hu,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return Um(r)?r.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function sf(){const e=Ey(),t=My(e);return t.stack=t.stack||new pF(dF(),fF())}function mF(e){return sf().withScope(e)}function hF(e,t){const n=sf();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function kE(e){return sf().withScope(()=>e(sf().getIsolationScope()))}function gF(){return{withIsolationScope:kE,withScope:mF,withSetScope:hF,withSetIsolationScope:(e,t)=>kE(t),getCurrentScope:()=>sf().getScope(),getIsolationScope:()=>sf().getIsolationScope()}}function _C(e){const t=My(e);return t.acs?t.acs:gF()}function hl(){const e=Ey();return _C(e).getCurrentScope()}function Mu(){const e=Ey();return _C(e).getIsolationScope()}function bF(){return Ef("globalScope",()=>new hu)}function TC(...e){const t=Ey(),n=_C(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function ao(){return hl().getClient()}function yF(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||qA()};return r&&(s.parent_span_id=r),s}const vF="sentry.source",xF="sentry.sample_rate",SF="sentry.previous_trace_sample_rate",CF="sentry.op",wF="sentry.origin",UA="sentry.profile_id",WA="sentry.exclusive_time",_F=0,TF=1,jF="_sentryScope",EF="_sentryIsolationScope";function MF(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function GA(e){const t=e;return{scope:t[jF],isolationScope:MF(t[EF])}}const RF="sentry-",kF=/^sentry-/;function PF(e){const t=AF(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.match(kF)){const l=o.slice(RF.length);r[l]=s}return r},{});if(Object.keys(n).length>0)return n}function AF(e){if(!(!e||!il(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=PE(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):PE(e)}function PE(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}const DF=/^o(\d+)\./,OF=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function IF(e){return e==="http"||e==="https"}function kf(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:l,protocol:u,publicKey:d}=e;return`${u}://${d}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${l}`}function LF(e){const t=OF.exec(e);if(!t){Mf(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",l="",u=""]=t.slice(1);let d="",p=u;const m=p.split("/");if(m.length>1&&(d=m.slice(0,-1).join("/"),p=m.pop()),p){const b=p.match(/^\d+/);b&&(p=b[0])}return YA({host:s,pass:o,path:d,projectId:p,port:l,protocol:n,publicKey:r})}function YA(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function zF(e){if(!pn)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(l=>e[l]?!1:(Qt.error(`Invalid Sentry Dsn: ${l} missing`),!0))?!1:n.match(/^\d+$/)?IF(r)?t&&isNaN(parseInt(t,10))?(Qt.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Qt.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Qt.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function NF(e){return e.match(DF)?.[1]}function $F(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=NF(n)),r}function KA(e){const t=typeof e=="string"?LF(e):YA(e);if(!(!t||!zF(t)))return t}function FF(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const XA=1;let AE=!1;function BF(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:jC(e).parent_span_id,s=GA(e).scope,l=r?s?.getPropagationContext().propagationSpanId||qA():t;return{parent_span_id:o,span_id:l,trace_id:n}}function VF(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===XA,attributes:s,...o}))}function DE(e){return typeof e=="number"?OE(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?OE(e.getTime()):al()}function OE(e){return e>9999999999?e/1e3:e}function jC(e){if(qF(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(HF(e)){const{attributes:r,startTime:o,name:s,endTime:l,status:u,links:d}=e,p="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:p,start_timestamp:DE(o),timestamp:DE(l)||void 0,status:WF(u),op:r[CF],origin:r[wF],links:VF(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function HF(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function qF(e){return typeof e.getSpanJSON=="function"}function UF(e){const{traceFlags:t}=e.spanContext();return t===XA}function WF(e){if(!(!e||e.code===_F))return e.code===TF?"ok":e.message||"internal_error"}const GF="_sentryRootSpan";function QA(e){return e[GF]||e}function IE(){AE||(Mf(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),AE=!0)}function YF(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=ao()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function LE(e){Qt.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function zE(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(XF(n)){if(bb(e.description,n))return pn&&LE(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?bb(e.description,n.name):!0,o=n.op?e.op&&bb(e.op,n.op):!0;if(r&&o)return pn&&LE(e),!0}return!1}function KF(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function XF(e){return typeof e=="string"||e instanceof RegExp}const EC="production",QF="_frozenDsc";function ZA(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||EC,release:n.release,public_key:r,trace_id:e,org_id:$F(t)};return t.emit("createDsc",o),o}function ZF(e,t){const n=t.getPropagationContext();return n.dsc||ZA(n.traceId,e)}function JF(e){const t=ao();if(!t)return{};const n=QA(e),r=jC(n),o=r.data,s=n.spanContext().traceState,l=s?.get("sentry.sample_rate")??o[xF]??o[SF];function u(x){return(typeof l=="number"||typeof l=="string")&&(x.sample_rate=`${l}`),x}const d=n[QF];if(d)return u(d);const p=s?.get("sentry.dsc"),m=p&&PF(p);if(m)return u(m);const b=ZA(e.spanContext().traceId,t),y=o[vF],h=r.description;return y!=="url"&&h&&(b.transaction=h),YF()&&(b.sampled=String(UF(n)),b.sample_rand=s?.get("sentry.sample_rand")??GA(n).scope?.getPropagationContext().sampleRand.toString()),u(b),t.emit("createDsc",b,n),b}function Za(e,t=100,n=1/0){try{return X1("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function JA(e,t=3,n=100*1024){const r=Za(e,t);return r3(r)>n?JA(e,t-1,n):r}function X1(e,t,n=1/0,r=1/0,o=o3()){const[s,l]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const u=e3(e,t);if(!u.startsWith("[object "))return u;if(t.__sentry_skip_normalization__)return t;const d=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(d===0)return u.replace("object ","");if(s(t))return"[Circular ~]";const p=t;if(p&&typeof p.toJSON=="function")try{const h=p.toJSON();return X1("",h,d-1,r,o)}catch{}const m=Array.isArray(t)?[]:{};let b=0;const y=BA(t);for(const h in y){if(!Object.prototype.hasOwnProperty.call(y,h))continue;if(b>=r){m[h]="[MaxProperties ~]";break}const x=y[h];m[h]=X1(h,x,d-1,r,o),b++}return l(t),m}function e3(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(zA(t))return OA(t);if(Z4(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${pc(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=t3(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function t3(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function n3(e){return~-encodeURI(e).split(/%..|./).length}function r3(e){return n3(JSON.stringify(e))}function o3(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Pf(e,t=[]){return[e,t]}function s3(e,t){const[n,r]=e;return[n,[...r,t]]}function Q1(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function i3(e,t){return Q1(e,(n,r)=>t.includes(r))}function Z1(e){const t=My(Kn);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function a3(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Z1(r),s]:r.push(typeof s=="string"?Z1(s):s)}for(const s of n){const[l,u]=s;if(o(` +Error:`,o)}}let k0=null;function U4(e){const t="error";Ru(t,e),ku(t,W4)}function W4(){k0=Zn.onerror,Zn.onerror=function(e,t,n,r,o){return Fi("error",{column:r,error:o,line:n,msg:e,url:t}),k0?k0.apply(this,arguments):!1},Zn.onerror.__SENTRY_INSTRUMENTED__=!0}let P0=null;function G4(e){const t="unhandledrejection";Ru(t,e),ku(t,Y4)}function Y4(){P0=Zn.onunhandledrejection,Zn.onunhandledrejection=function(e){return Fi("unhandledrejection",e),P0?P0.apply(this,arguments):!0},Zn.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const IA=Object.prototype.toString;function Um(e){switch(IA.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return mc(e,Error)}}function Df(e,t){return IA.call(e)===`[object ${t}]`}function LA(e){return Df(e,"ErrorEvent")}function SE(e){return Df(e,"DOMError")}function K4(e){return Df(e,"DOMException")}function il(e){return Df(e,"String")}function xC(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ry(e){return e===null||xC(e)||typeof e!="object"&&typeof e!="function"}function Sm(e){return Df(e,"Object")}function ky(e){return typeof Event<"u"&&mc(e,Event)}function X4(e){return typeof Element<"u"&&mc(e,Element)}function Q4(e){return Df(e,"RegExp")}function Wm(e){return!!(e?.then&&typeof e.then=="function")}function Z4(e){return Sm(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function mc(e,t){try{return e instanceof t}catch{return!1}}function zA(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function NA(e){return typeof Request<"u"&&mc(e,Request)}const SC=Zn,J4=80;function $A(e,t={}){if(!e)return"";try{let n=e;const r=5,o=[];let s=0,l=0;const u=" > ",d=u.length;let p;const m=Array.isArray(t)?t:t.keyAttrs,b=!Array.isArray(t)&&t.maxStringLength||J4;for(;n&&s++1&&l+o.length*d+p.length>=b));)o.push(p),l+=p.length,n=n.parentNode;return o.reverse().join(u)}catch{return""}}function eF(e,t){const n=e,r=[];if(!n?.tagName)return"";if(SC.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=t?.length?t.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(o?.length)o.forEach(l=>{r.push(`[${l[0]}="${l[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const l=n.className;if(l&&il(l)){const u=l.split(/\s+/);for(const d of u)r.push(`.${d}`)}}const s=["aria-label","type","name","title","alt"];for(const l of s){const u=n.getAttribute(l);u&&r.push(`[${l}="${u}"]`)}return r.join("")}function CC(){try{return SC.document.location.href}catch{return""}}function tF(e){if(!SC.HTMLElement)return null;let t=e;const n=5;for(let r=0;r"}}function wE(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function nF(e){const t=Object.keys(BA(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let _d;function Py(e){if(_d!==void 0)return _d?_d(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=Zn;return t in n&&typeof n[t]=="function"?(_d=n[t],_d(e)):(_d=null,e())}function Yb(){return Py(()=>Math.random())}function Ay(){return Py(()=>Date.now())}function W1(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function _E(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;rbb(e,r,n))}function rF(){const e=Zn;return e.crypto||e.msCrypto}let A0;function oF(){return Yb()*16}function fi(e=rF()){try{if(e?.randomUUID)return Py(()=>e.randomUUID()).replace(/-/g,"")}catch{}return A0||(A0="10000000100040008000"+1e11),A0.replace(/[018]/g,t=>(t^(oF()&15)>>t/4).toString(16))}function VA(e){return e.exception?.values?.[0]}function su(e){const{message:t,event_id:n}=e;if(t)return t;const r=VA(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function G1(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function af(e,t){const n=VA(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const s={...o?.data,...t.data};n.mechanism.data=s}}function TE(e){if(sF(e))return!0;try{hc(e,"__sentry_captured__",!0)}catch{}return!1}function sF(e){try{return e.__sentry_captured__}catch{}}const HA=1e3;function Gm(){return Ay()/HA}function iF(){const{performance:e}=Zn;if(!e?.now||!e.timeOrigin)return Gm;const t=e.timeOrigin;return()=>(t+Py(()=>e.now()))/HA}let jE;function al(){return(jE??(jE=iF()))()}function aF(e){const t=al(),n={sid:fi(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>cF(n)};return e&&lf(n,e),n}function lf(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||al(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:fi()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function lF(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),lf(e,n)}function cF(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Ym(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Ym(r[o],t[o],n-1));return r}function EE(){return fi()}function qA(){return fi().substring(16)}const Y1="_sentrySpan";function ME(e,t){t?hc(e,Y1,t):delete e[Y1]}function RE(e){return e[Y1]}const uF=100;let hu=class K1{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:EE(),sampleRand:Yb()}}clone(){const t=new K1;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,ME(t,RE(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&lf(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof K1?n.getScopeData():Sm(n)?t:void 0,{tags:o,attributes:s,extra:l,user:u,contexts:d,level:p,fingerprint:m=[],propagationContext:b}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...l},this._contexts={...this._contexts,...d},u&&Object.keys(u).length&&(this._user=u),p&&(this._level=p),m.length&&(this._fingerprint=m),b&&(this._propagationContext=b),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,ME(this,void 0),this._attachments=[],this.setPropagationContext({traceId:EE(),sampleRand:Yb()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:uF;if(r<=0)return this;const o={timestamp:Gm(),...t,message:t.message?W1(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:RE(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Ym(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n?.event_id||fi();if(!this._client)return bn&&tn.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=r?.event_id||fi();if(!this._client)return bn&&tn.warn("No client configured on scope - will not capture message!"),o;const s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){const r=n?.event_id||fi();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(bn&&tn.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function dF(){return Pf("defaultCurrentScope",()=>new hu)}function fF(){return Pf("defaultIsolationScope",()=>new hu)}class pF{constructor(t,n){let r;t?r=t:r=new hu;let o;n?o=n:o=new hu,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return Wm(r)?r.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function cf(){const e=Ey(),t=My(e);return t.stack=t.stack||new pF(dF(),fF())}function mF(e){return cf().withScope(e)}function hF(e,t){const n=cf();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function kE(e){return cf().withScope(()=>e(cf().getIsolationScope()))}function gF(){return{withIsolationScope:kE,withScope:mF,withSetScope:hF,withSetIsolationScope:(e,t)=>kE(t),getCurrentScope:()=>cf().getScope(),getIsolationScope:()=>cf().getIsolationScope()}}function _C(e){const t=My(e);return t.acs?t.acs:gF()}function hl(){const e=Ey();return _C(e).getCurrentScope()}function Pu(){const e=Ey();return _C(e).getIsolationScope()}function bF(){return Pf("globalScope",()=>new hu)}function TC(...e){const t=Ey(),n=_C(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function fo(){return hl().getClient()}function yF(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||qA()};return r&&(s.parent_span_id=r),s}const vF="sentry.source",xF="sentry.sample_rate",SF="sentry.previous_trace_sample_rate",CF="sentry.op",wF="sentry.origin",UA="sentry.profile_id",WA="sentry.exclusive_time",_F=0,TF=1,jF="_sentryScope",EF="_sentryIsolationScope";function MF(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function GA(e){const t=e;return{scope:t[jF],isolationScope:MF(t[EF])}}const RF="sentry-",kF=/^sentry-/;function PF(e){const t=AF(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.match(kF)){const l=o.slice(RF.length);r[l]=s}return r},{});if(Object.keys(n).length>0)return n}function AF(e){if(!(!e||!il(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=PE(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):PE(e)}function PE(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}const DF=/^o(\d+)\./,OF=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function IF(e){return e==="http"||e==="https"}function Of(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:l,protocol:u,publicKey:d}=e;return`${u}://${d}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${l}`}function LF(e){const t=OF.exec(e);if(!t){Af(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",l="",u=""]=t.slice(1);let d="",p=u;const m=p.split("/");if(m.length>1&&(d=m.slice(0,-1).join("/"),p=m.pop()),p){const b=p.match(/^\d+/);b&&(p=b[0])}return YA({host:s,pass:o,path:d,projectId:p,port:l,protocol:n,publicKey:r})}function YA(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function zF(e){if(!bn)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(l=>e[l]?!1:(tn.error(`Invalid Sentry Dsn: ${l} missing`),!0))?!1:n.match(/^\d+$/)?IF(r)?t&&isNaN(parseInt(t,10))?(tn.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(tn.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(tn.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function NF(e){return e.match(DF)?.[1]}function $F(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=NF(n)),r}function KA(e){const t=typeof e=="string"?LF(e):YA(e);if(!(!t||!zF(t)))return t}function FF(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const XA=1;let AE=!1;function BF(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:jC(e).parent_span_id,s=GA(e).scope,l=r?s?.getPropagationContext().propagationSpanId||qA():t;return{parent_span_id:o,span_id:l,trace_id:n}}function VF(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===XA,attributes:s,...o}))}function DE(e){return typeof e=="number"?OE(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?OE(e.getTime()):al()}function OE(e){return e>9999999999?e/1e3:e}function jC(e){if(qF(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(HF(e)){const{attributes:r,startTime:o,name:s,endTime:l,status:u,links:d}=e,p="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:p,start_timestamp:DE(o),timestamp:DE(l)||void 0,status:WF(u),op:r[CF],origin:r[wF],links:VF(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function HF(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function qF(e){return typeof e.getSpanJSON=="function"}function UF(e){const{traceFlags:t}=e.spanContext();return t===XA}function WF(e){if(!(!e||e.code===_F))return e.code===TF?"ok":e.message||"internal_error"}const GF="_sentryRootSpan";function QA(e){return e[GF]||e}function IE(){AE||(Af(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),AE=!0)}function YF(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=fo()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function LE(e){tn.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function zE(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(XF(n)){if(bb(e.description,n))return bn&&LE(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?bb(e.description,n.name):!0,o=n.op?e.op&&bb(e.op,n.op):!0;if(r&&o)return bn&&LE(e),!0}return!1}function KF(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function XF(e){return typeof e=="string"||e instanceof RegExp}const EC="production",QF="_frozenDsc";function ZA(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||EC,release:n.release,public_key:r,trace_id:e,org_id:$F(t)};return t.emit("createDsc",o),o}function ZF(e,t){const n=t.getPropagationContext();return n.dsc||ZA(n.traceId,e)}function JF(e){const t=fo();if(!t)return{};const n=QA(e),r=jC(n),o=r.data,s=n.spanContext().traceState,l=s?.get("sentry.sample_rate")??o[xF]??o[SF];function u(x){return(typeof l=="number"||typeof l=="string")&&(x.sample_rate=`${l}`),x}const d=n[QF];if(d)return u(d);const p=s?.get("sentry.dsc"),m=p&&PF(p);if(m)return u(m);const b=ZA(e.spanContext().traceId,t),y=o[vF],h=r.description;return y!=="url"&&h&&(b.transaction=h),YF()&&(b.sampled=String(UF(n)),b.sample_rand=s?.get("sentry.sample_rand")??GA(n).scope?.getPropagationContext().sampleRand.toString()),u(b),t.emit("createDsc",b,n),b}function Za(e,t=100,n=1/0){try{return X1("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function JA(e,t=3,n=100*1024){const r=Za(e,t);return r3(r)>n?JA(e,t-1,n):r}function X1(e,t,n=1/0,r=1/0,o=o3()){const[s,l]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const u=e3(e,t);if(!u.startsWith("[object "))return u;if(t.__sentry_skip_normalization__)return t;const d=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(d===0)return u.replace("object ","");if(s(t))return"[Circular ~]";const p=t;if(p&&typeof p.toJSON=="function")try{const h=p.toJSON();return X1("",h,d-1,r,o)}catch{}const m=Array.isArray(t)?[]:{};let b=0;const y=BA(t);for(const h in y){if(!Object.prototype.hasOwnProperty.call(y,h))continue;if(b>=r){m[h]="[MaxProperties ~]";break}const x=y[h];m[h]=X1(h,x,d-1,r,o),b++}return l(t),m}function e3(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(zA(t))return OA(t);if(Z4(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${pc(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=t3(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function t3(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function n3(e){return~-encodeURI(e).split(/%..|./).length}function r3(e){return n3(JSON.stringify(e))}function o3(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function If(e,t=[]){return[e,t]}function s3(e,t){const[n,r]=e;return[n,[...r,t]]}function Q1(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function i3(e,t){return Q1(e,(n,r)=>t.includes(r))}function Z1(e){const t=My(Zn);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function a3(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Z1(r),s]:r.push(typeof s=="string"?Z1(s):s)}for(const s of n){const[l,u]=s;if(o(` ${JSON.stringify(l)} -`),typeof u=="string"||u instanceof Uint8Array)o(u);else{let d;try{d=JSON.stringify(u)}catch{d=JSON.stringify(Za(u))}o(d)}}return typeof r=="string"?r:l3(r)}function l3(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function c3(e){const t=typeof e.data=="string"?Z1(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const u3={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function NE(e){return u3[e]}function eD(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function d3(e,t,n,r){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:kf(r)},...o&&{trace:o}}}function f3(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function p3(e,t,n,r){const o=eD(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:kf(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Pf(s,[l])}function m3(e,t,n,r){const o=eD(n),s=e.type&&e.type!=="replay_event"?e.type:"event";f3(e,n?.sdk);const l=d3(e,o,r,t);return delete e.sdkProcessingMetadata,Pf(l,[[{type:s},e]])}const D0=0,$E=1,FE=2;function Oy(e){return new Sm(t=>{t(e)})}function MC(e){return new Sm((t,n)=>{n(e)})}class Sm{constructor(t){this._state=D0,this._handlers=[],this._runExecutor(t)}then(t,n){return new Sm((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(l){o(l)}},s=>{if(!n)o(s);else try{r(n(s))}catch(l){o(l)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Sm((n,r)=>{let o,s;return this.then(l=>{s=!1,o=l,t&&t()},l=>{s=!0,o=l,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===D0)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===$E&&n[1](this._value),this._state===FE&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,l)=>{if(this._state===D0){if(Um(l)){l.then(r,o);return}this._state=s,this._value=l,this._executeHandlers()}},r=s=>{n($E,s)},o=s=>{n(FE,s)};try{t(r,o)}catch(s){o(s)}}}function h3(e,t,n,r=0){try{const o=J1(t,n,e,r);return Um(o)?o:Oy(o)}catch(o){return MC(o)}}function J1(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return pn&&s===null&&Qt.log(`Event processor "${o.id||"?"}" dropped event`),Um(s)?s.then(l=>J1(l,t,n,r+1)):J1(s,t,n,r+1)}let Qc,BE,VE,Jl;function g3(e){const t=Kn._sentryDebugIds,n=Kn._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Jl&&r.length===BE&&o.length===VE)return Jl;BE=r.length,VE=o.length,Jl={},Qc||(Qc={});const s=(l,u)=>{for(const d of l){const p=u[d],m=Qc?.[d];if(m&&Jl&&p)Jl[m[0]]=p,Qc&&(Qc[d]=[m[0],p]);else if(p){const b=e(d);for(let y=b.length-1;y>=0;y--){const x=b[y]?.filename;if(x&&Jl&&Qc){Jl[x]=p,Qc[d]=[x,p];break}}}}};return t&&s(r,t),n&&s(o,n),Jl}function b3(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;v3(e,t),r&&C3(e,r),w3(e,n),x3(e,o),S3(e,s)}function HE(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:l,level:u,sdkProcessingMetadata:d,breadcrumbs:p,fingerprint:m,eventProcessors:b,attachments:y,propagationContext:h,transactionName:x,span:C}=t;Op(e,"extra",n),Op(e,"tags",r),Op(e,"attributes",o),Op(e,"user",s),Op(e,"contexts",l),e.sdkProcessingMetadata=Gm(e.sdkProcessingMetadata,d,2),u&&(e.level=u),x&&(e.transactionName=x),C&&(e.span=C),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),m.length&&(e.fingerprint=[...e.fingerprint,...m]),b.length&&(e.eventProcessors=[...e.eventProcessors,...b]),y.length&&(e.attachments=[...e.attachments,...y]),e.propagationContext={...e.propagationContext,...h}}function Op(e,t,n){e[t]=Gm(e[t],n,1)}function y3(e,t){const n=bF().getScopeData();return e&&HE(n,e.getScopeData()),t&&HE(n,t.getScopeData()),n}function v3(e,t){const{extra:n,tags:r,user:o,contexts:s,level:l,transactionName:u}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),l&&(e.level=l),u&&e.type!=="transaction"&&(e.transaction=u)}function x3(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function S3(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function C3(e,t){e.contexts={trace:BF(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:JF(t),...e.sdkProcessingMetadata};const n=QA(t),r=jC(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function w3(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function _3(e,t,n,r,o,s){const{normalizeDepth:l=3,normalizeMaxBreadth:u=1e3}=e,d={...t,event_id:t.event_id||n.event_id||di(),timestamp:t.timestamp||Wm()},p=n.integrations||e.integrations.map(S=>S.name);T3(d,e),M3(d,p),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&j3(d,e.stackParser);const m=k3(r,n.captureContext);n.mechanism&&rf(d,n.mechanism);const b=o?o.getEventProcessors():[],y=y3(s,m),h=[...n.attachments||[],...y.attachments];h.length&&(n.attachments=h),b3(d,y);const x=[...b,...y.eventProcessors];return h3(x,d,n).then(S=>(S&&E3(S),typeof l=="number"&&l>0?R3(S,l,u):S))}function T3(e,t){const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||EC,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const l=e.request;l?.url&&s&&(l.url=W1(l.url,s)),s&&e.exception?.values?.forEach(u=>{u.value&&(u.value=W1(u.value,s))})}function j3(e,t){const n=g3(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function E3(e){const t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function M3(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function R3(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Za(o.data,t,n)}}))},...e.user&&{user:Za(e.user,t,n)},...e.contexts&&{contexts:Za(e.contexts,t,n)},...e.extra&&{extra:Za(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Za(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Za(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Za(e.contexts.flags,3,n)),r}function k3(e,t){if(!t)return e;const n=e?e.clone():new hu;return n.update(t),n}function P3(e){if(e)return A3(e)?{captureContext:e}:O3(e)?{captureContext:e}:e}function A3(e){return e instanceof hu||typeof e=="function"}const D3=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function O3(e){return Object.keys(e).some(t=>D3.includes(t))}function Wd(e,t){return hl().captureException(e,P3(t))}function tD(e,t){return hl().captureEvent(e,t)}function I3(e,t){Mu().setContext(e,t)}function L3(){return Mu().lastEventId()}function qE(e){const t=Mu(),n=hl(),{userAgent:r}=Kn.navigator||{},o=aF({user:n.getUser()||t.getUser(),...r&&{userAgent:r},...e}),s=t.getSession();return s?.status==="ok"&&of(s,{status:"exited"}),nD(),t.setSession(o),o}function nD(){const e=Mu(),n=hl().getSession()||e.getSession();n&&lF(n),rD(),e.setSession()}function rD(){const e=Mu(),t=ao(),n=e.getSession();n&&t&&t.captureSession(n)}function UE(e=!1){if(e){nD();return}rD()}const z3="7";function oD(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function N3(e){return`${oD(e)}${e.projectId}/envelope/`}function $3(e,t){const n={sentry_version:z3};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function F3(e,t,n){return t||`${N3(e)}?${$3(e,n)}`}function B3(e,t){const n=KA(e);if(!n)return"";const r=`${oD(n)}embed/error-page/`;let o=`dsn=${kf(n)}`;for(const s in t)if(s!=="dsn"&&s!=="onClose")if(s==="user"){const l=t.user;if(!l)continue;l.name&&(o+=`&name=${encodeURIComponent(l.name)}`),l.email&&(o+=`&email=${encodeURIComponent(l.email)}`)}else o+=`&${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`;return`${r}?${o}`}const WE=[];function V3(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function H3(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return V3(r)}function q3(e,t){const n={};return t.forEach(r=>{r&&sD(e,r,n)}),n}function GE(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function sD(e,t,n){if(n[t.name]){pn&&Qt.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!WE.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),WE.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,l)=>r(s,l,e),{id:t.name});e.addEventProcessor(o)}pn&&Qt.log(`Integration installed: ${t.name}`)}function U3(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function W3(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=kf(r)),Pf(o,[U3(e)])}function iD(e,t){const n=t??G3(e)??[];if(n.length===0)return;const r=e.getOptions(),o=W3(n,r._metadata,r.tunnel,e.getDsn());aD().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function G3(e){return aD().get(e)}function aD(){return Ef("clientToLogBufferMap",()=>new WeakMap)}function Y3(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function K3(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=kf(r)),Pf(o,[Y3(e)])}function lD(e,t){const n=t??X3(e)??[];if(n.length===0)return;const r=e.getOptions(),o=K3(n,r._metadata,r.tunnel,e.getDsn());cD().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function X3(e){return cD().get(e)}function cD(){return Ef("clientToMetricBufferMap",()=>new WeakMap)}const RC=Symbol.for("SentryBufferFullError");function kC(e=100){const t=new Set;function n(){return t.sizer(u),()=>r(u)),u}function s(l){if(!t.size)return Oy(!0);const u=Promise.allSettled(Array.from(t)).then(()=>!0);if(!l)return u;const d=[u,new Promise(p=>setTimeout(()=>p(!1),l))];return Promise.race(d)}return{get $(){return Array.from(t)},add:o,drain:s}}const Q3=60*1e3;function Z3(e,t=Ay()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Q3:r-t}function J3(e,t){return e[t]||e.all||0}function eB(e,t,n=Ay()){return J3(e,t)>n}function tB(e,{statusCode:t,headers:n},r=Ay()){const o={...e},s=n?.["x-sentry-rate-limits"],l=n?.["retry-after"];if(s)for(const u of s.trim().split(",")){const[d,p,,,m]=u.split(":",5),b=parseInt(d,10),y=(isNaN(b)?60:b)*1e3;if(!p)o.all=r+y;else for(const h of p.split(";"))h==="metric_bucket"?(!m||m.split(";").includes("custom"))&&(o[h]=r+y):o[h]=r+y}else l?o.all=r+Z3(l,r):t===429&&(o.all=r+60*1e3);return o}const uD=64;function nB(e,t,n=kC(e.bufferSize||uD)){let r={};const o=l=>n.drain(l);function s(l){const u=[];if(Q1(l,(b,y)=>{const h=NE(y);eB(r,h)?e.recordDroppedEvent("ratelimit_backoff",h):u.push(b)}),u.length===0)return Promise.resolve({});const d=Pf(l[0],u),p=b=>{if(i3(d,["client_report"])){pn&&Qt.warn(`Dropping client report. Will not send outcomes (reason: ${b}).`);return}Q1(d,(y,h)=>{e.recordDroppedEvent(b,NE(h))})},m=()=>t({body:a3(d)}).then(b=>(b.statusCode!==void 0&&(b.statusCode<200||b.statusCode>=300)&&pn&&Qt.warn(`Sentry responded with status code ${b.statusCode} to sent event.`),r=tB(r,b),b),b=>{throw p("network_error"),pn&&Qt.error("Encountered error running transport request:",b),b});return n.add(m).then(b=>b,b=>{if(b===RC)return pn&&Qt.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw b})}return{send:s,flush:o}}function rB(e,t,n){const r=[{type:"client_report"},{timestamp:Wm(),discarded_events:e}];return Pf(t?{dsn:t}:{},[r])}function dD(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function oB(e){const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:l,op:u}=e.contexts?.trace??{};return{data:l??{},description:e.transaction,op:u,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:l?.[UA],exclusive_time:l?.[WA],measurements:e.measurements,is_segment:!0}}function sB(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[UA]:e.profile_id},...e.exclusive_time&&{[WA]:e.exclusive_time}}}},measurements:e.measurements}}const YE="Not capturing exception because it's already been captured.",KE="Discarded session because of missing or non-string release",fD=Symbol.for("SentryInternalError"),pD=Symbol.for("SentryDoNotSendEventError"),iB=5e3;function yb(e){return{message:e,[fD]:!0}}function O0(e){return{message:e,[pD]:!0}}function XE(e){return!!e&&typeof e=="object"&&fD in e}function QE(e){return!!e&&typeof e=="object"&&pD in e}function ZE(e,t,n,r,o){let s=0,l,u=!1;e.on(n,()=>{s=0,clearTimeout(l),u=!1}),e.on(t,d=>{s+=r(d),s>=8e5?o(e):u||(u=!0,l=setTimeout(()=>{o(e)},iB))}),e.on("flush",()=>{o(e)})}class aB{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=kC(t.transportOptions?.bufferSize??uD),t.dsn?this._dsn=KA(t.dsn):pn&&Qt.warn("No DSN provided, client will not send events."),this._dsn){const r=F3(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&ZE(this,"afterCaptureLog","flushLogs",dB,iD),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&ZE(this,"afterCaptureMetric","flushMetrics",uB,lD)}captureException(t,n,r){const o=di();if(TE(t))return pn&&Qt.log(YE),o;const s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(l=>this._captureEvent(l,s,r)).then(l=>l),"error"),s.event_id}captureMessage(t,n,r,o){const s={event_id:di(),...r},l=xC(t)?t:String(t),u=Ry(t),d=u?this.eventFromMessage(l,n,s):this.eventFromException(t,s);return this._process(()=>d.then(p=>this._captureEvent(p,s,o)),u?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=di();if(n?.originalException&&TE(n.originalException))return pn&&Qt.log(YE),o;const s={event_id:o,...n},l=t.sdkProcessingMetadata||{},u=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=JE(t.type);return this._process(()=>this._captureEvent(t,s,u||r,d),p),s.event_id}captureSession(t){this.sendSession(t),of(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];sD(this,t,this._integrations),n||GE(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=m3(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=s3(r,c3(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=EC}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){pn&&Qt.warn(KE);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){pn&&Qt.warn(KE);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=p3(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;pn&&Qt.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return pn&&Qt.error("Error while sending envelope:",n),{}}return pn&&Qt.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=q3(this,t),GE(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1;const s=n.exception?.values;if(s){o=!0,r=!1;for(const d of s)if(d.mechanism?.handled===!1){r=!0;break}}const l=t.status==="ok";(l&&t.errors===0||l&&r)&&(of(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||nsetTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){const s=this.getOptions(),l=Object.keys(this._integrations);return!n.integrations&&l?.length&&(n.integrations=l),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),_3(s,t,n,r,this,o).then(u=>{if(u===null)return u;this.emit("postprocessEvent",u,n),u.contexts={trace:yF(r),...u.contexts};const d=ZF(this,r);return u.sdkProcessingMetadata={dynamicSamplingContext:d,...u.sdkProcessingMetadata},u})}_captureEvent(t,n={},r=hl(),o=Mu()){return pn&&eS(t)&&Qt.log(`Captured error event \`${dD(t)[0]||""}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{pn&&(QE(s)?Qt.log(s.message):XE(s)?Qt.warn(s.message):Qt.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:l}=s,u=mD(t),d=eS(t),m=`before send for type \`${t.type||"error"}\``,b=typeof l>"u"?void 0:FF(l);if(d&&typeof b=="number"&&Yb()>b)return this.recordDroppedEvent("sample_rate","error"),MC(O0(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const y=JE(t.type);return this._prepareEvent(t,n,r,o).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",y),O0("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return h;const C=cB(this,s,h,n);return lB(C,m)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",y),u){const w=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",w)}throw O0(`${m} returned \`null\`, will not send event.`)}const x=r.getSession()||o.getSession();if(d&&x&&this._updateSessionFromEvent(x,h),u){const S=h.sdkProcessingMetadata?.spanCountBeforeProcessing||0,w=h.spans?h.spans.length:0,_=S-w;_>0&&this.recordDroppedEvent("before_send","span",_)}const C=h.transaction_info;if(u&&C&&h.transaction!==t.transaction){const S="custom";h.transaction_info={...C,source:S}}return this.sendEvent(h,n),h}).then(null,h=>{throw QE(h)||XE(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),yb(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. -Reason: ${h}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===RC&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){pn&&Qt.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){pn&&Qt.log("No outcomes to send");return}if(!this._dsn){pn&&Qt.log("No dsn provided, will not send outcomes");return}pn&&Qt.log("Sending outcomes:",t);const n=rB(t,this._options.tunnel&&kf(this._dsn));this.sendEnvelope(n)}}function JE(e){return e==="replay_event"?"replay":e||"error"}function lB(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Um(e))return e.then(r=>{if(!xm(r)&&r!==null)throw yb(n);return r},r=>{throw yb(`${t} rejected with ${r}`)});if(!xm(e)&&e!==null)throw yb(n);return e}function cB(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,beforeSendSpan:l,ignoreSpans:u}=t;let d=n;if(eS(d)&&o)return o(d,r);if(mD(d)){if(l||u){const p=oB(d);if(u?.length&&zE(p,u))return null;if(l){const m=l(p);m?d=Gm(n,sB(m)):IE()}if(d.spans){const m=[],b=d.spans;for(const h of b){if(u?.length&&zE(h,u)){KF(b,h);continue}if(l){const x=l(h);x?m.push(x):(IE(),m.push(h))}else m.push(h)}const y=d.spans.length-m.length;y&&e.recordDroppedEvent("before_send","span",y),d.spans=m}}if(s){if(d.spans){const p=d.spans.length;d.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return s(d,r)}}return d}function eS(e){return e.type===void 0}function mD(e){return e.type==="transaction"}function uB(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+hD(e.attributes)}function dB(e){let t=0;return e.message&&(t+=e.message.length*2),t+hD(e.attributes)}function hD(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*eM(n[0]):Ry(n)?t+=eM(n):t+=100}),t}function eM(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function fB(e){return qm(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function tM(e){return fB(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function pB(e,t){t.debug===!0&&(pn?Qt.enable():Mf(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),hl().update(t.initialScope);const r=new e(t);return mB(r),r.init(),r}function mB(e){hl().setClient(e)}function I0(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function hB(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let l="";if(t&&s!==-1){const u=e.slice(s+1);l=u.length>10?`${u.slice(0,10)}... [truncated]`:u}return`data:${r}${o?",base64":""}${l?`,${l}`:""}`}return e}function gB(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function gD(e,t,n=[t],r="npm"){const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:uu})),version:uu}),e._metadata=o}const bB=100;function gu(e,t){const n=ao(),r=Mu();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=bB}=n.getOptions();if(s<=0)return;const u={timestamp:Wm(),...e},d=o?Mf(()=>o(u,t)):u;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),r.addBreadcrumb(d,s))}let nM;const yB="FunctionToString",rM=new WeakMap,vB=(()=>({name:yB,setupOnce(){nM=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=wC(this),n=rM.has(ao())&&t!==void 0?t:this;return nM.apply(n,e)}}catch{}},setup(e){rM.set(e,!0)}})),xB=vB,SB=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],CB="EventFilters",wB=(e={})=>{let t;return{name:CB,setup(n){const r=n.getOptions();t=oM(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=oM(e,s)}return TB(n,t)?null:n}}},_B=((e={})=>({...wB(e),name:"InboundFilters"}));function oM(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:SB],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function TB(e,t){if(e.type){if(e.type==="transaction"&&EB(e,t.ignoreTransactions))return pn&&Qt.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. -Event: ${su(e)}`),!0}else{if(jB(e,t.ignoreErrors))return pn&&Qt.warn(`Event dropped due to being matched by \`ignoreErrors\` option. -Event: ${su(e)}`),!0;if(PB(e))return pn&&Qt.warn(`Event dropped due to not having an error message, error type or stacktrace. -Event: ${su(e)}`),!0;if(MB(e,t.denyUrls))return pn&&Qt.warn(`Event dropped due to being matched by \`denyUrls\` option. +`),typeof u=="string"||u instanceof Uint8Array)o(u);else{let d;try{d=JSON.stringify(u)}catch{d=JSON.stringify(Za(u))}o(d)}}return typeof r=="string"?r:l3(r)}function l3(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function c3(e){const t=typeof e.data=="string"?Z1(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const u3={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function NE(e){return u3[e]}function eD(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function d3(e,t,n,r){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Of(r)},...o&&{trace:o}}}function f3(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function p3(e,t,n,r){const o=eD(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Of(t)}},l="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return If(s,[l])}function m3(e,t,n,r){const o=eD(n),s=e.type&&e.type!=="replay_event"?e.type:"event";f3(e,n?.sdk);const l=d3(e,o,r,t);return delete e.sdkProcessingMetadata,If(l,[[{type:s},e]])}const D0=0,$E=1,FE=2;function Oy(e){return new Cm(t=>{t(e)})}function MC(e){return new Cm((t,n)=>{n(e)})}class Cm{constructor(t){this._state=D0,this._handlers=[],this._runExecutor(t)}then(t,n){return new Cm((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(l){o(l)}},s=>{if(!n)o(s);else try{r(n(s))}catch(l){o(l)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Cm((n,r)=>{let o,s;return this.then(l=>{s=!1,o=l,t&&t()},l=>{s=!0,o=l,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===D0)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===$E&&n[1](this._value),this._state===FE&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,l)=>{if(this._state===D0){if(Wm(l)){l.then(r,o);return}this._state=s,this._value=l,this._executeHandlers()}},r=s=>{n($E,s)},o=s=>{n(FE,s)};try{t(r,o)}catch(s){o(s)}}}function h3(e,t,n,r=0){try{const o=J1(t,n,e,r);return Wm(o)?o:Oy(o)}catch(o){return MC(o)}}function J1(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return bn&&s===null&&tn.log(`Event processor "${o.id||"?"}" dropped event`),Wm(s)?s.then(l=>J1(l,t,n,r+1)):J1(s,t,n,r+1)}let Qc,BE,VE,Jl;function g3(e){const t=Zn._sentryDebugIds,n=Zn._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Jl&&r.length===BE&&o.length===VE)return Jl;BE=r.length,VE=o.length,Jl={},Qc||(Qc={});const s=(l,u)=>{for(const d of l){const p=u[d],m=Qc?.[d];if(m&&Jl&&p)Jl[m[0]]=p,Qc&&(Qc[d]=[m[0],p]);else if(p){const b=e(d);for(let y=b.length-1;y>=0;y--){const x=b[y]?.filename;if(x&&Jl&&Qc){Jl[x]=p,Qc[d]=[x,p];break}}}}};return t&&s(r,t),n&&s(o,n),Jl}function b3(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;v3(e,t),r&&C3(e,r),w3(e,n),x3(e,o),S3(e,s)}function HE(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:l,level:u,sdkProcessingMetadata:d,breadcrumbs:p,fingerprint:m,eventProcessors:b,attachments:y,propagationContext:h,transactionName:x,span:C}=t;Ip(e,"extra",n),Ip(e,"tags",r),Ip(e,"attributes",o),Ip(e,"user",s),Ip(e,"contexts",l),e.sdkProcessingMetadata=Ym(e.sdkProcessingMetadata,d,2),u&&(e.level=u),x&&(e.transactionName=x),C&&(e.span=C),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),m.length&&(e.fingerprint=[...e.fingerprint,...m]),b.length&&(e.eventProcessors=[...e.eventProcessors,...b]),y.length&&(e.attachments=[...e.attachments,...y]),e.propagationContext={...e.propagationContext,...h}}function Ip(e,t,n){e[t]=Ym(e[t],n,1)}function y3(e,t){const n=bF().getScopeData();return e&&HE(n,e.getScopeData()),t&&HE(n,t.getScopeData()),n}function v3(e,t){const{extra:n,tags:r,user:o,contexts:s,level:l,transactionName:u}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),l&&(e.level=l),u&&e.type!=="transaction"&&(e.transaction=u)}function x3(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function S3(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function C3(e,t){e.contexts={trace:BF(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:JF(t),...e.sdkProcessingMetadata};const n=QA(t),r=jC(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function w3(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function _3(e,t,n,r,o,s){const{normalizeDepth:l=3,normalizeMaxBreadth:u=1e3}=e,d={...t,event_id:t.event_id||n.event_id||fi(),timestamp:t.timestamp||Gm()},p=n.integrations||e.integrations.map(S=>S.name);T3(d,e),M3(d,p),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&j3(d,e.stackParser);const m=k3(r,n.captureContext);n.mechanism&&af(d,n.mechanism);const b=o?o.getEventProcessors():[],y=y3(s,m),h=[...n.attachments||[],...y.attachments];h.length&&(n.attachments=h),b3(d,y);const x=[...b,...y.eventProcessors];return h3(x,d,n).then(S=>(S&&E3(S),typeof l=="number"&&l>0?R3(S,l,u):S))}function T3(e,t){const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||EC,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const l=e.request;l?.url&&s&&(l.url=W1(l.url,s)),s&&e.exception?.values?.forEach(u=>{u.value&&(u.value=W1(u.value,s))})}function j3(e,t){const n=g3(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function E3(e){const t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function M3(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function R3(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Za(o.data,t,n)}}))},...e.user&&{user:Za(e.user,t,n)},...e.contexts&&{contexts:Za(e.contexts,t,n)},...e.extra&&{extra:Za(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Za(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Za(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Za(e.contexts.flags,3,n)),r}function k3(e,t){if(!t)return e;const n=e?e.clone():new hu;return n.update(t),n}function P3(e){if(e)return A3(e)?{captureContext:e}:O3(e)?{captureContext:e}:e}function A3(e){return e instanceof hu||typeof e=="function"}const D3=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function O3(e){return Object.keys(e).some(t=>D3.includes(t))}function Kd(e,t){return hl().captureException(e,P3(t))}function tD(e,t){return hl().captureEvent(e,t)}function I3(e,t){Pu().setContext(e,t)}function L3(){return Pu().lastEventId()}function qE(e){const t=Pu(),n=hl(),{userAgent:r}=Zn.navigator||{},o=aF({user:n.getUser()||t.getUser(),...r&&{userAgent:r},...e}),s=t.getSession();return s?.status==="ok"&&lf(s,{status:"exited"}),nD(),t.setSession(o),o}function nD(){const e=Pu(),n=hl().getSession()||e.getSession();n&&lF(n),rD(),e.setSession()}function rD(){const e=Pu(),t=fo(),n=e.getSession();n&&t&&t.captureSession(n)}function UE(e=!1){if(e){nD();return}rD()}const z3="7";function oD(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function N3(e){return`${oD(e)}${e.projectId}/envelope/`}function $3(e,t){const n={sentry_version:z3};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function F3(e,t,n){return t||`${N3(e)}?${$3(e,n)}`}function B3(e,t){const n=KA(e);if(!n)return"";const r=`${oD(n)}embed/error-page/`;let o=`dsn=${Of(n)}`;for(const s in t)if(s!=="dsn"&&s!=="onClose")if(s==="user"){const l=t.user;if(!l)continue;l.name&&(o+=`&name=${encodeURIComponent(l.name)}`),l.email&&(o+=`&email=${encodeURIComponent(l.email)}`)}else o+=`&${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`;return`${r}?${o}`}const WE=[];function V3(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function H3(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return V3(r)}function q3(e,t){const n={};return t.forEach(r=>{r&&sD(e,r,n)}),n}function GE(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function sD(e,t,n){if(n[t.name]){bn&&tn.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!WE.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),WE.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,l)=>r(s,l,e),{id:t.name});e.addEventProcessor(o)}bn&&tn.log(`Integration installed: ${t.name}`)}function U3(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function W3(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Of(r)),If(o,[U3(e)])}function iD(e,t){const n=t??G3(e)??[];if(n.length===0)return;const r=e.getOptions(),o=W3(n,r._metadata,r.tunnel,e.getDsn());aD().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function G3(e){return aD().get(e)}function aD(){return Pf("clientToLogBufferMap",()=>new WeakMap)}function Y3(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function K3(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Of(r)),If(o,[Y3(e)])}function lD(e,t){const n=t??X3(e)??[];if(n.length===0)return;const r=e.getOptions(),o=K3(n,r._metadata,r.tunnel,e.getDsn());cD().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function X3(e){return cD().get(e)}function cD(){return Pf("clientToMetricBufferMap",()=>new WeakMap)}const RC=Symbol.for("SentryBufferFullError");function kC(e=100){const t=new Set;function n(){return t.sizer(u),()=>r(u)),u}function s(l){if(!t.size)return Oy(!0);const u=Promise.allSettled(Array.from(t)).then(()=>!0);if(!l)return u;const d=[u,new Promise(p=>setTimeout(()=>p(!1),l))];return Promise.race(d)}return{get $(){return Array.from(t)},add:o,drain:s}}const Q3=60*1e3;function Z3(e,t=Ay()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Q3:r-t}function J3(e,t){return e[t]||e.all||0}function eB(e,t,n=Ay()){return J3(e,t)>n}function tB(e,{statusCode:t,headers:n},r=Ay()){const o={...e},s=n?.["x-sentry-rate-limits"],l=n?.["retry-after"];if(s)for(const u of s.trim().split(",")){const[d,p,,,m]=u.split(":",5),b=parseInt(d,10),y=(isNaN(b)?60:b)*1e3;if(!p)o.all=r+y;else for(const h of p.split(";"))h==="metric_bucket"?(!m||m.split(";").includes("custom"))&&(o[h]=r+y):o[h]=r+y}else l?o.all=r+Z3(l,r):t===429&&(o.all=r+60*1e3);return o}const uD=64;function nB(e,t,n=kC(e.bufferSize||uD)){let r={};const o=l=>n.drain(l);function s(l){const u=[];if(Q1(l,(b,y)=>{const h=NE(y);eB(r,h)?e.recordDroppedEvent("ratelimit_backoff",h):u.push(b)}),u.length===0)return Promise.resolve({});const d=If(l[0],u),p=b=>{if(i3(d,["client_report"])){bn&&tn.warn(`Dropping client report. Will not send outcomes (reason: ${b}).`);return}Q1(d,(y,h)=>{e.recordDroppedEvent(b,NE(h))})},m=()=>t({body:a3(d)}).then(b=>(b.statusCode!==void 0&&(b.statusCode<200||b.statusCode>=300)&&bn&&tn.warn(`Sentry responded with status code ${b.statusCode} to sent event.`),r=tB(r,b),b),b=>{throw p("network_error"),bn&&tn.error("Encountered error running transport request:",b),b});return n.add(m).then(b=>b,b=>{if(b===RC)return bn&&tn.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw b})}return{send:s,flush:o}}function rB(e,t,n){const r=[{type:"client_report"},{timestamp:Gm(),discarded_events:e}];return If(t?{dsn:t}:{},[r])}function dD(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function oB(e){const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:l,op:u}=e.contexts?.trace??{};return{data:l??{},description:e.transaction,op:u,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:l?.[UA],exclusive_time:l?.[WA],measurements:e.measurements,is_segment:!0}}function sB(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[UA]:e.profile_id},...e.exclusive_time&&{[WA]:e.exclusive_time}}}},measurements:e.measurements}}const YE="Not capturing exception because it's already been captured.",KE="Discarded session because of missing or non-string release",fD=Symbol.for("SentryInternalError"),pD=Symbol.for("SentryDoNotSendEventError"),iB=5e3;function yb(e){return{message:e,[fD]:!0}}function O0(e){return{message:e,[pD]:!0}}function XE(e){return!!e&&typeof e=="object"&&fD in e}function QE(e){return!!e&&typeof e=="object"&&pD in e}function ZE(e,t,n,r,o){let s=0,l,u=!1;e.on(n,()=>{s=0,clearTimeout(l),u=!1}),e.on(t,d=>{s+=r(d),s>=8e5?o(e):u||(u=!0,l=setTimeout(()=>{o(e)},iB))}),e.on("flush",()=>{o(e)})}class aB{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=kC(t.transportOptions?.bufferSize??uD),t.dsn?this._dsn=KA(t.dsn):bn&&tn.warn("No DSN provided, client will not send events."),this._dsn){const r=F3(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&ZE(this,"afterCaptureLog","flushLogs",dB,iD),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&ZE(this,"afterCaptureMetric","flushMetrics",uB,lD)}captureException(t,n,r){const o=fi();if(TE(t))return bn&&tn.log(YE),o;const s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(l=>this._captureEvent(l,s,r)).then(l=>l),"error"),s.event_id}captureMessage(t,n,r,o){const s={event_id:fi(),...r},l=xC(t)?t:String(t),u=Ry(t),d=u?this.eventFromMessage(l,n,s):this.eventFromException(t,s);return this._process(()=>d.then(p=>this._captureEvent(p,s,o)),u?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=fi();if(n?.originalException&&TE(n.originalException))return bn&&tn.log(YE),o;const s={event_id:o,...n},l=t.sdkProcessingMetadata||{},u=l.capturedSpanScope,d=l.capturedSpanIsolationScope,p=JE(t.type);return this._process(()=>this._captureEvent(t,s,u||r,d),p),s.event_id}captureSession(t){this.sendSession(t),lf(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];sD(this,t,this._integrations),n||GE(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=m3(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=s3(r,c3(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=EC}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){bn&&tn.warn(KE);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){bn&&tn.warn(KE);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=p3(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;bn&&tn.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return bn&&tn.error("Error while sending envelope:",n),{}}return bn&&tn.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=q3(this,t),GE(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1;const s=n.exception?.values;if(s){o=!0,r=!1;for(const d of s)if(d.mechanism?.handled===!1){r=!0;break}}const l=t.status==="ok";(l&&t.errors===0||l&&r)&&(lf(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||nsetTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){const s=this.getOptions(),l=Object.keys(this._integrations);return!n.integrations&&l?.length&&(n.integrations=l),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),_3(s,t,n,r,this,o).then(u=>{if(u===null)return u;this.emit("postprocessEvent",u,n),u.contexts={trace:yF(r),...u.contexts};const d=ZF(this,r);return u.sdkProcessingMetadata={dynamicSamplingContext:d,...u.sdkProcessingMetadata},u})}_captureEvent(t,n={},r=hl(),o=Pu()){return bn&&eS(t)&&tn.log(`Captured error event \`${dD(t)[0]||""}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{bn&&(QE(s)?tn.log(s.message):XE(s)?tn.warn(s.message):tn.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:l}=s,u=mD(t),d=eS(t),m=`before send for type \`${t.type||"error"}\``,b=typeof l>"u"?void 0:FF(l);if(d&&typeof b=="number"&&Yb()>b)return this.recordDroppedEvent("sample_rate","error"),MC(O0(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const y=JE(t.type);return this._prepareEvent(t,n,r,o).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",y),O0("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return h;const C=cB(this,s,h,n);return lB(C,m)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",y),u){const w=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",w)}throw O0(`${m} returned \`null\`, will not send event.`)}const x=r.getSession()||o.getSession();if(d&&x&&this._updateSessionFromEvent(x,h),u){const S=h.sdkProcessingMetadata?.spanCountBeforeProcessing||0,w=h.spans?h.spans.length:0,_=S-w;_>0&&this.recordDroppedEvent("before_send","span",_)}const C=h.transaction_info;if(u&&C&&h.transaction!==t.transaction){const S="custom";h.transaction_info={...C,source:S}}return this.sendEvent(h,n),h}).then(null,h=>{throw QE(h)||XE(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),yb(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. +Reason: ${h}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===RC&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){bn&&tn.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){bn&&tn.log("No outcomes to send");return}if(!this._dsn){bn&&tn.log("No dsn provided, will not send outcomes");return}bn&&tn.log("Sending outcomes:",t);const n=rB(t,this._options.tunnel&&Of(this._dsn));this.sendEnvelope(n)}}function JE(e){return e==="replay_event"?"replay":e||"error"}function lB(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Wm(e))return e.then(r=>{if(!Sm(r)&&r!==null)throw yb(n);return r},r=>{throw yb(`${t} rejected with ${r}`)});if(!Sm(e)&&e!==null)throw yb(n);return e}function cB(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,beforeSendSpan:l,ignoreSpans:u}=t;let d=n;if(eS(d)&&o)return o(d,r);if(mD(d)){if(l||u){const p=oB(d);if(u?.length&&zE(p,u))return null;if(l){const m=l(p);m?d=Ym(n,sB(m)):IE()}if(d.spans){const m=[],b=d.spans;for(const h of b){if(u?.length&&zE(h,u)){KF(b,h);continue}if(l){const x=l(h);x?m.push(x):(IE(),m.push(h))}else m.push(h)}const y=d.spans.length-m.length;y&&e.recordDroppedEvent("before_send","span",y),d.spans=m}}if(s){if(d.spans){const p=d.spans.length;d.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return s(d,r)}}return d}function eS(e){return e.type===void 0}function mD(e){return e.type==="transaction"}function uB(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+hD(e.attributes)}function dB(e){let t=0;return e.message&&(t+=e.message.length*2),t+hD(e.attributes)}function hD(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*eM(n[0]):Ry(n)?t+=eM(n):t+=100}),t}function eM(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function fB(e){return Um(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function tM(e){return fB(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function pB(e,t){t.debug===!0&&(bn?tn.enable():Af(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),hl().update(t.initialScope);const r=new e(t);return mB(r),r.init(),r}function mB(e){hl().setClient(e)}function I0(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function hB(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let l="";if(t&&s!==-1){const u=e.slice(s+1);l=u.length>10?`${u.slice(0,10)}... [truncated]`:u}return`data:${r}${o?",base64":""}${l?`,${l}`:""}`}return e}function gB(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function gD(e,t,n=[t],r="npm"){const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:uu})),version:uu}),e._metadata=o}const bB=100;function gu(e,t){const n=fo(),r=Pu();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=bB}=n.getOptions();if(s<=0)return;const u={timestamp:Gm(),...e},d=o?Af(()=>o(u,t)):u;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),r.addBreadcrumb(d,s))}let nM;const yB="FunctionToString",rM=new WeakMap,vB=(()=>({name:yB,setupOnce(){nM=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=wC(this),n=rM.has(fo())&&t!==void 0?t:this;return nM.apply(n,e)}}catch{}},setup(e){rM.set(e,!0)}})),xB=vB,SB=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],CB="EventFilters",wB=(e={})=>{let t;return{name:CB,setup(n){const r=n.getOptions();t=oM(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=oM(e,s)}return TB(n,t)?null:n}}},_B=((e={})=>({...wB(e),name:"InboundFilters"}));function oM(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:SB],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function TB(e,t){if(e.type){if(e.type==="transaction"&&EB(e,t.ignoreTransactions))return bn&&tn.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. +Event: ${su(e)}`),!0}else{if(jB(e,t.ignoreErrors))return bn&&tn.warn(`Event dropped due to being matched by \`ignoreErrors\` option. +Event: ${su(e)}`),!0;if(PB(e))return bn&&tn.warn(`Event dropped due to not having an error message, error type or stacktrace. +Event: ${su(e)}`),!0;if(MB(e,t.denyUrls))return bn&&tn.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${su(e)}. -Url: ${Kb(e)}`),!0;if(!RB(e,t.allowUrls))return pn&&Qt.warn(`Event dropped due to not being matched by \`allowUrls\` option. +Url: ${Kb(e)}`),!0;if(!RB(e,t.allowUrls))return bn&&tn.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${su(e)}. -Url: ${Kb(e)}`),!0}return!1}function jB(e,t){return t?.length?dD(e).some(n=>Dy(n,t)):!1}function EB(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Dy(n,t):!1}function MB(e,t){if(!t?.length)return!1;const n=Kb(e);return n?Dy(n,t):!1}function RB(e,t){if(!t?.length)return!0;const n=Kb(e);return n?Dy(n,t):!0}function kB(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!==""&&n.filename!=="[native code]")return n.filename||null}return null}function Kb(e){try{const n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?kB(n):null}catch{return pn&&Qt.error(`Cannot extract url for event ${su(e)}`),null}}function PB(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function AB(e,t,n,r,o,s){if(!o.exception?.values||!s||!mc(s.originalException,Error))return;const l=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;l&&(o.exception.values=tS(e,t,r,s.originalException,n,o.exception.values,l,0))}function tS(e,t,n,r,o,s,l,u){if(s.length>=n+1)return s;let d=[...s];if(mc(r[o],Error)){sM(l,u);const p=e(t,r[o]),m=d.length;iM(p,o,m,u),d=tS(e,t,n,r[o],o,[p,...d],p,m)}return Array.isArray(r.errors)&&r.errors.forEach((p,m)=>{if(mc(p,Error)){sM(l,u);const b=e(t,p),y=d.length;iM(b,`errors[${m}]`,y,u),d=tS(e,t,n,p,o,[b,...d],b,y)}}),d}function sM(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function iM(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function DB(e){const t="console";ju(t,e),Eu(t,OB)}function OB(){"console"in Kn&&L4.forEach(function(e){e in Kn.console&&Es(Kn.console,e,function(t){return Gb[e]=t,function(...n){Fi("console",{args:n,level:e}),Gb[e]?.apply(Kn.console,n)}})})}function IB(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const LB="Dedupe",zB=(()=>{let e;return{name:LB,processEvent(t){if(t.type)return t;try{if($B(t,e))return pn&&Qt.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),NB=zB;function $B(e,t){return t?!!(FB(e,t)||BB(e,t)):!1}function FB(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!yD(e,t)||!bD(e,t))}function BB(e,t){const n=aM(t),r=aM(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!yD(e,t)||!bD(e,t))}function bD(e,t){let n=vE(e),r=vE(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o=400&&e<500?"warning":e>=500?"error":void 0}const Cm=Kn;function VB(){return"history"in Cm&&!!Cm.history}function HB(){if(!("fetch"in Cm))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function nS(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function qB(){if(typeof EdgeRuntime=="string")return!0;if(!HB())return!1;if(nS(Cm.fetch))return!0;let e=!1;const t=Cm.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=nS(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){pn&&Qt.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function UB(e,t){const n="fetch";ju(n,e),Eu(n,()=>WB(void 0,t))}function WB(e,t=!1){t&&!qB()||Es(Kn,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:l}=GB(r),u={args:r,fetchData:{method:s,url:l},startTimestamp:al()*1e3,virtualError:o,headers:YB(r)};return Fi("fetch",{...u}),n.apply(Kn,r).then(async d=>(Fi("fetch",{...u,endTimestamp:al()*1e3,response:d}),d),d=>{Fi("fetch",{...u,endTimestamp:al()*1e3,error:d}),qm(d)&&d.stack===void 0&&(d.stack=o.stack,hc(d,"framesToPop",1));const m=ao()?.getOptions().enhanceFetchErrorMessages??"always";if(m!==!1&&d instanceof TypeError&&(d.message==="Failed to fetch"||d.message==="Load failed"||d.message==="NetworkError when attempting to fetch resource."))try{const h=new URL(u.fetchData.url).host;m==="always"?d.message=`${d.message} (${h})`:hc(d,"__sentry_fetch_url_host__",h)}catch{}throw d})}})}function vb(e,t){return!!e&&typeof e=="object"&&!!e[t]}function lM(e){return typeof e=="string"?e:e?vb(e,"url")?e.url:e.toString?e.toString():"":""}function GB(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:lM(n),method:vb(r,"method")?String(r.method).toUpperCase():NA(n)&&vb(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:lM(t),method:vb(t,"method")?String(t.method).toUpperCase():"GET"}}function YB(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(NA(t))return new Headers(t.headers)}catch{}}function KB(){return"npm"}const pr=Kn;let rS=0;function xD(){return rS>0}function XB(){rS++,setTimeout(()=>{rS--})}function af(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{const o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(wC(e))return e}catch{return e}const r=function(...o){try{const s=o.map(l=>af(l,t));return e.apply(this,s)}catch(s){throw XB(),TC(l=>{l.addEventProcessor(u=>(t.mechanism&&(G1(u,void 0),rf(u,t.mechanism)),u.extra={...u.extra,arguments:o},u)),Wd(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}FA(r,e),hc(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function QB(){const e=CC(),{referrer:t}=pr.document||{},{userAgent:n}=pr.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function PC(e,t){const n=AC(e,t),r={type:n6(t),value:r6(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function ZB(e,t,n,r){const s=ao()?.getOptions().normalizeDepth,l=l6(t),u={__serialized__:JA(t,s)};if(l)return{exception:{values:[PC(e,l)]},extra:u};const d={exception:{values:[{type:ky(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:i6(t,{isUnhandledRejection:r})}]},extra:u};if(n){const p=AC(e,n);p.length&&(d.exception.values[0].stacktrace={frames:p})}return d}function L0(e,t){return{exception:{values:[PC(e,t)]}}}function AC(e,t){const n=t.stacktrace||t.stack||"",r=e6(t),o=t6(t);try{return e(n,r,o)}catch{}return[]}const JB=/Minified React error #\d+;/i;function e6(e){return e&&JB.test(e.message)?1:0}function t6(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function SD(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function n6(e){const t=e?.name;return!t&&SD(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function r6(e){const t=e?.message;return SD(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?tM(t.error):tM(e):"No error message"}function o6(e,t,n,r){const o=n?.syntheticException||void 0,s=DC(e,t,o,r);return rf(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),Oy(s)}function s6(e,t,n="info",r,o){const s=r?.syntheticException||void 0,l=oS(e,t,s,o);return l.level=n,r?.event_id&&(l.event_id=r.event_id),Oy(l)}function DC(e,t,n,r,o){let s;if(LA(t)&&t.error)return L0(e,t.error);if(SE(t)||K4(t)){const l=t;if("stack"in t)s=L0(e,t);else{const u=l.name||(SE(l)?"DOMError":"DOMException"),d=l.message?`${u}: ${l.message}`:u;s=oS(e,d,n,r),G1(s,d)}return"code"in l&&(s.tags={...s.tags,"DOMException.code":`${l.code}`}),s}return qm(t)?L0(e,t):xm(t)||ky(t)?(s=ZB(e,t,n,o),rf(s,{synthetic:!0}),s):(s=oS(e,t,n,r),G1(s,`${t}`),rf(s,{synthetic:!0}),s)}function oS(e,t,n,r){const o={};if(r&&n){const s=AC(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),rf(o,{synthetic:!0})}if(xC(t)){const{__sentry_template_string__:s,__sentry_template_values__:l}=t;return o.logentry={message:s,params:l},o}return o.message=t,o}function i6(e,{isUnhandledRejection:t}){const n=nF(e),r=t?"promise rejection":"exception";return LA(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ky(e)?`Event \`${a6(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function a6(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function l6(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class c6 extends aB{constructor(t){const n=u6(t),r=pr.SENTRY_SDK_SOURCE||KB();gD(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:o,sendClientReports:s,enableLogs:l,_experiments:u,enableMetrics:d}=this._options,p=d??u?.enableMetrics??!0;pr.document&&(s||l||p)&&pr.document.addEventListener("visibilitychange",()=>{pr.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),l&&iD(this),p&&lD(this))}),o&&this.on("beforeSendSession",gB)}eventFromException(t,n){return o6(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return s6(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function u6(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:pr.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const d6=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Fo=Kn,f6=1e3;let cM,sS,iS;function p6(e){ju("dom",e),Eu("dom",m6)}function m6(){if(!Fo.document)return;const e=Fi.bind(null,"dom"),t=uM(e,!0);Fo.document.addEventListener("click",t,!1),Fo.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const o=Fo[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(Es(o,"addEventListener",function(s){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},m=p[l]=p[l]||{refCount:0};if(!m.handler){const b=uM(e);m.handler=b,s.call(this,l,b,d)}m.refCount++}catch{}return s.call(this,l,u,d)}}),Es(o,"removeEventListener",function(s){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},m=p[l];m&&(m.refCount--,m.refCount<=0&&(s.call(this,l,m.handler,d),m.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,l,u,d)}}))})}function h6(e){if(e.type!==sS)return!1;try{if(!e.target||e.target._sentryId!==iS)return!1}catch{}return!0}function g6(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function uM(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=b6(n);if(g6(n.type,r))return;hc(n,"_sentryCaptured",!0),r&&!r._sentryId&&hc(r,"_sentryId",di());const o=n.type==="keypress"?"input":n.type;h6(n)||(e({event:n,name:o,global:t}),sS=n.type,iS=r?r._sentryId:void 0),clearTimeout(cM),cM=Fo.setTimeout(()=>{iS=void 0,sS=void 0},f6)}}function b6(e){try{return e.target}catch{return null}}let Mg;function CD(e){const t="history";ju(t,e),Eu(t,y6)}function y6(){if(Fo.addEventListener("popstate",()=>{const t=Fo.location.href,n=Mg;if(Mg=t,n===t)return;Fi("history",{from:n,to:t})}),!VB())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=Mg,s=v6(String(r));if(Mg=s,o===s)return t.apply(this,n);Fi("history",{from:o,to:s})}return t.apply(this,n)}}Es(Fo.history,"pushState",e),Es(Fo.history,"replaceState",e)}function v6(e){try{return new URL(e,Fo.location.origin).toString()}catch{return e}}const xb={};function x6(e){const t=xb[e];if(t)return t;let n=Fo[e];if(nS(n))return xb[e]=n.bind(Fo);const r=Fo.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){d6&&Qt.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(xb[e]=n.bind(Fo))}function S6(e){xb[e]=void 0}const Xp="__sentry_xhr_v3__";function C6(e){ju("xhr",e),Eu("xhr",w6)}function w6(){if(!Fo.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=al()*1e3,l=il(r[0])?r[0].toUpperCase():void 0,u=_6(r[1]);if(!l||!u)return t.apply(n,r);n[Xp]={method:l,url:u,request_headers:{}},l==="POST"&&u.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[Xp];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const m={endTimestamp:al()*1e3,startTimestamp:s,xhr:n,virtualError:o};Fi("xhr",m)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(p,m,b){return d(),p.apply(m,b)}}):n.addEventListener("readystatechange",d),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(p,m,b){const[y,h]=b,x=m[Xp];return x&&il(y)&&il(h)&&(x.request_headers[y.toLowerCase()]=h),p.apply(m,b)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[Xp];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:al()*1e3,xhr:n};return Fi("xhr",s),t.apply(n,r)}})}function _6(e){if(il(e))return e;try{return e.toString()}catch{}}const T6=40;function j6(e,t=x6("fetch")){let n=0,r=0;async function o(s){const l=s.body.length;n+=l,r++;const u={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const d=await t(e.url,u);return{statusCode:d.status,headers:{"x-sentry-rate-limits":d.headers.get("X-Sentry-Rate-Limits"),"retry-after":d.headers.get("Retry-After")}}}catch(d){throw S6("fetch"),d}finally{n-=l,r--}}return nB(e,o,kC(e.bufferSize||T6))}const lf=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,E6=30,M6=50;function aS(e,t,n,r){const o={filename:e,function:t===""?mu:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const R6=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,k6=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,P6=/\((\S*)(?::(\d+))(?::(\d+))\)/,A6=/at (.+?) ?\(data:(.+?),/,D6=e=>{const t=e.match(A6);if(t)return{filename:``,function:t[1]};const n=R6.exec(e);if(n){const[,o,s,l]=n;return aS(o,mu,+s,+l)}const r=k6.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const u=P6.exec(r[2]);u&&(r[2]=u[1],r[3]=u[2],r[4]=u[3])}const[s,l]=wD(r[1]||mu,r[2]);return aS(l,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},O6=[E6,D6],I6=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,L6=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,z6=e=>{const t=I6.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=L6.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||mu;return[o,r]=wD(o,r),aS(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},N6=[M6,z6],$6=[O6,N6],F6=DA(...$6),wD=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:mu,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Rg=1024,B6="Breadcrumbs",V6=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:B6,setup(n){t.console&&DB(W6(n)),t.dom&&p6(U6(n,t.dom)),t.xhr&&C6(G6(n)),t.fetch&&UB(Y6(n)),t.history&&CD(K6(n)),t.sentry&&n.on("beforeSendEvent",q6(n))}}}),H6=V6;function q6(e){return function(n){ao()===e&&gu({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:su(n)},{event:n})}}function U6(e,t){return function(r){if(ao()!==e)return;let o,s,l=typeof t=="object"?t.serializeAttribute:void 0,u=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;u&&u>Rg&&(lf&&Qt.warn(`\`dom.maxStringLength\` cannot exceed ${Rg}, but a value of ${u} was configured. Sentry will use ${Rg} instead.`),u=Rg),typeof l=="string"&&(l=[l]);try{const p=r.event,m=X6(p)?p.target:p;o=$A(m,{keyAttrs:l,maxStringLength:u}),s=tF(m)}catch{o=""}if(o.length===0)return;const d={category:`ui.${r.name}`,message:o};s&&(d.data={"ui.component_name":s}),gu(d,{event:r.event,name:r.name,global:r.global})}}function W6(e){return function(n){if(ao()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:IB(n.level),message:_E(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${_E(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;gu(r,{input:n.args,level:n.level})}}function G6(e){return function(n){if(ao()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[Xp];if(!r||!o||!s)return;const{method:l,url:u,status_code:d,body:p}=s,m={method:l,url:u,status_code:d},b={xhr:n.xhr,input:p,startTimestamp:r,endTimestamp:o},y={category:"xhr",data:m,type:"http",level:vD(d)};e.emit("beforeOutgoingRequestBreadcrumb",y,b),gu(y,b)}}function Y6(e){return function(n){if(ao()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const s=n.fetchData,l={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},u={category:"fetch",data:s,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",u,l),gu(u,l)}else{const s=n.response,l={...n.fetchData,status_code:s?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,s?.status;const u={input:n.args,response:s,startTimestamp:r,endTimestamp:o},d={category:"fetch",data:l,type:"http",level:vD(l.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,u),gu(d,u)}}}function K6(e){return function(n){if(ao()!==e)return;let r=n.from,o=n.to;const s=I0(pr.location.href);let l=r?I0(r):void 0;const u=I0(o);l?.path||(l=s),s.protocol===u.protocol&&s.host===u.host&&(o=u.relative),s.protocol===l.protocol&&s.host===l.host&&(r=l.relative),gu({category:"navigation",data:{from:r,to:o}})}}function X6(e){return!!e&&!!e.target}const Q6=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Z6="BrowserApiErrors",J6=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Z6,setupOnce(){t.setTimeout&&Es(pr,"setTimeout",dM),t.setInterval&&Es(pr,"setInterval",dM),t.requestAnimationFrame&&Es(pr,"requestAnimationFrame",t8),t.XMLHttpRequest&&"XMLHttpRequest"in pr&&Es(XMLHttpRequest.prototype,"send",n8);const n=t.eventTarget;n&&(Array.isArray(n)?n:Q6).forEach(o=>r8(o,t))}}}),e8=J6;function dM(e){return function(...t){const n=t[0];return t[0]=af(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${pc(e)}`}}),e.apply(this,t)}}function t8(e){return function(t){return e.apply(this,[af(t,{mechanism:{data:{handler:pc(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function n8(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Es(n,o,function(s){const l={mechanism:{data:{handler:pc(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},u=wC(s);return u&&(l.mechanism.data.handler=pc(u)),af(s,l)})}),e.apply(this,t)}}function r8(e,t){const r=pr[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Es(r,"addEventListener",function(o){return function(s,l,u){try{o8(l)&&(l.handleEvent=af(l.handleEvent,{mechanism:{data:{handler:pc(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&s8(this,s,l),o.apply(this,[s,af(l,{mechanism:{data:{handler:pc(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),Es(r,"removeEventListener",function(o){return function(s,l,u){try{const d=l.__sentry_wrapped__;d&&o.call(this,s,d,u)}catch{}return o.call(this,s,l,u)}}))}function o8(e){return typeof e.handleEvent=="function"}function s8(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const i8=()=>({name:"BrowserSession",setupOnce(){if(typeof pr.document>"u"){lf&&Qt.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}qE({ignoreDuration:!0}),UE(),CD(({from:e,to:t})=>{e!==void 0&&e!==t&&(qE({ignoreDuration:!0}),UE())})}}),a8="GlobalHandlers",l8=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:a8,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(u8(n),fM("onerror")),t.onunhandledrejection&&(d8(n),fM("onunhandledrejection"))}}}),c8=l8;function u8(e){U4(t=>{const{stackParser:n,attachStacktrace:r}=_D();if(ao()!==e||xD())return;const{msg:o,url:s,line:l,column:u,error:d}=t,p=m8(DC(n,d||o,void 0,r,!1),s,l,u);p.level="error",tD(p,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function d8(e){G4(t=>{const{stackParser:n,attachStacktrace:r}=_D();if(ao()!==e||xD())return;const o=f8(t),s=Ry(o)?p8(o):DC(n,o,void 0,r,!0);s.level="error",tD(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function f8(e){if(Ry(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function p8(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function m8(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],l=s[0]=s[0]||{},u=l.stacktrace=l.stacktrace||{},d=u.frames=u.frames||[],p=r,m=n,b=h8(t)??CC();return d.length===0&&d.push({colno:p,filename:b,function:mu,in_app:!0,lineno:m}),e}function fM(e){lf&&Qt.log(`Global Handler attached: ${e}`)}function _D(){return ao()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function h8(e){if(!(!il(e)||e.length===0))return e.startsWith("data:")?`<${hB(e,!1)}>`:e}const g8=()=>({name:"HttpContext",preprocessEvent(e){if(!pr.navigator&&!pr.location&&!pr.document)return;const t=QB(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),b8="cause",y8=5,v8="LinkedErrors",x8=((e={})=>{const t=e.limit||y8,n=e.key||b8;return{name:v8,preprocessEvent(r,o,s){const l=s.getOptions();AB(PC,l.stackParser,n,t,r,o)}}}),S8=x8;function C8(){return w8()?(lf&&Mf(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function w8(){if(typeof pr.window>"u")return!1;const e=pr;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=CC(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(pr===pr.top&&r.some(s=>n.startsWith(`${s}://`)))}function _8(e){return[_B(),xB(),e8(),H6(),c8(),S8(),NB(),g8(),i8()]}function T8(e={}){const t=!e.skipBrowserExtensionCheck&&C8();let n=e.defaultIntegrations==null?_8():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:H4(e.stackParser||F6),integrations:H3({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||j6};return pB(c6,r)}function pM(e={}){const t=pr.document,n=t?.head||t?.body;if(!n){lf&&Qt.error("[showReportDialog] Global document not defined");return}const r=hl(),s=ao()?.getDsn();if(!s){lf&&Qt.error("[showReportDialog] DSN not configured");return}const l={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||L3()},u=pr.document.createElement("script");u.async=!0,u.crossOrigin="anonymous",u.src=B3(s,l);const{onLoad:d,onClose:p}=l;if(d&&(u.onload=d),p){const m=b=>{if(b.data==="__sentry_reportdialog_closed__")try{p()}finally{pr.removeEventListener("message",m)}};pr.addEventListener("message",m)}n.appendChild(u)}var z0={exports:{}},ln={};var mM;function j8(){if(mM)return ln;mM=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),y=Symbol.iterator;function h(H){return H===null||typeof H!="object"?null:(H=y&&H[y]||H["@@iterator"],typeof H=="function"?H:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,S={};function w(H,K,Z){this.props=H,this.context=K,this.refs=S,this.updater=Z||x}w.prototype.isReactComponent={},w.prototype.setState=function(H,K){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,K,"setState")},w.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function _(){}_.prototype=w.prototype;function T(H,K,Z){this.props=H,this.context=K,this.refs=S,this.updater=Z||x}var M=T.prototype=new _;M.constructor=T,C(M,w.prototype),M.isPureReactComponent=!0;var R=Array.isArray;function L(){}var N={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function F(H,K,Z){var ee=Z.ref;return{$$typeof:e,type:H,key:K,ref:ee!==void 0?ee:null,props:Z}}function B(H,K){return F(H.type,K,H.props)}function A(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function E(H){var K={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(Z){return K[Z]})}var I=/\/+/g;function $(H,K){return typeof H=="object"&&H!==null&&H.key!=null?E(""+H.key):K.toString(36)}function z(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(L,L):(H.status="pending",H.then(function(K){H.status==="pending"&&(H.status="fulfilled",H.value=K)},function(K){H.status==="pending"&&(H.status="rejected",H.reason=K)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function P(H,K,Z,ee,J){var X=typeof H;(X==="undefined"||X==="boolean")&&(H=null);var ue=!1;if(H===null)ue=!0;else switch(X){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(H.$$typeof){case e:case t:ue=!0;break;case m:return ue=H._init,P(ue(H._payload),K,Z,ee,J)}}if(ue)return J=J(H),ue=ee===""?"."+$(H,0):ee,R(J)?(Z="",ue!=null&&(Z=ue.replace(I,"$&/")+"/"),P(J,K,Z,"",function(xe){return xe})):J!=null&&(A(J)&&(J=B(J,Z+(J.key==null||H&&H.key===J.key?"":(""+J.key).replace(I,"$&/")+"/")+ue)),K.push(J)),1;ue=0;var pe=ee===""?".":ee+":";if(R(H))for(var fe=0;fe=17}function R8(e,t){const n=new WeakSet;function r(o,s){if(!n.has(o)){if(o.cause)return n.add(o),r(o.cause,s);o.cause=s}}r(e,t)}function k8(e,{componentStack:t},n){if(M8(v.version)&&qm(e)&&t){const r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,R8(e,r)}return TC(r=>(r.setContext("react",{componentStack:t}),Wd(e,n)))}const P8=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,N0={componentStack:null,error:null,eventId:null};class A8 extends v.Component{constructor(t){super(t),this.state=N0,this._openFallbackReportDialog=!0;const n=ao();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&pM({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){const{componentStack:r}=n,{beforeCapture:o,onError:s,showDialog:l,dialogOptions:u}=this.props;TC(d=>{o&&o(d,t,r);const p=this.props.handled!=null?this.props.handled:!!this.props.fallback,m=k8(t,n,{mechanism:{handled:p,type:"auto.function.react.error_boundary"}});s&&s(t,r,m),l&&(this._lastEventId=m,this._openFallbackReportDialog&&pM({...u,eventId:m})),this.setState({error:t,componentStack:r,eventId:m})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===N0?o(null,null,null):o(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){const{onReset:t}=this.props,{error:n,componentStack:r,eventId:o}=this.state;t&&t(n,r,o),this.setState(N0)}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;const o=typeof t=="function"?v.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return v.isValidElement(o)?o:(t&&P8&&Qt.warn("fallback did not produce a valid ReactElement"),null)}}var $0={exports:{}},Ip={},F0={exports:{}},B0={};var gM;function D8(){return gM||(gM=1,(function(e){function t(P,O){var V=P.length;P.push(O);e:for(;0>>1,G=P[q];if(0>>1;qo(Z,V))eeo(J,Z)?(P[q]=J,P[ee]=V,q=ee):(P[q]=Z,P[K]=V,q=K);else if(eeo(J,V))P[q]=J,P[ee]=V,q=ee;else break e}}return O}function o(P,O){var V=P.sortIndex-O.sortIndex;return V!==0?V:P.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],m=1,b=null,y=3,h=!1,x=!1,C=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function M(P){for(var O=n(p);O!==null;){if(O.callback===null)r(p);else if(O.startTime<=P)r(p),O.sortIndex=O.expirationTime,t(d,O);else break;O=n(p)}}function R(P){if(C=!1,M(P),!x)if(n(d)!==null)x=!0,L||(L=!0,E());else{var O=n(p);O!==null&&z(R,O.startTime-P)}}var L=!1,N=-1,D=5,F=-1;function B(){return S?!0:!(e.unstable_now()-FP&&B());){var q=b.callback;if(typeof q=="function"){b.callback=null,y=b.priorityLevel;var G=q(b.expirationTime<=P);if(P=e.unstable_now(),typeof G=="function"){b.callback=G,M(P),O=!0;break t}b===n(d)&&r(d),M(P)}else r(d);b=n(d)}if(b!==null)O=!0;else{var H=n(p);H!==null&&z(R,H.startTime-P),O=!1}}break e}finally{b=null,y=V,h=!1}O=void 0}}finally{O?E():L=!1}}}var E;if(typeof T=="function")E=function(){T(A)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,$=I.port2;I.port1.onmessage=A,E=function(){$.postMessage(null)}}else E=function(){w(A,0)};function z(P,O){N=w(function(){P(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125q?(P.sortIndex=V,t(p,P),n(d)===null&&P===n(p)&&(C?(_(N),N=-1):C=!0,z(R,V-q))):(P.sortIndex=G,t(d,P),x||h||(x=!0,L||(L=!0,E()))),P},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(P){var O=y;return function(){var V=y;y=O;try{return P.apply(this,arguments)}finally{y=V}}}})(B0)),B0}var bM;function O8(){return bM||(bM=1,F0.exports=D8()),F0.exports}var V0={exports:{}},_o={};var yM;function I8(){if(yM)return _o;yM=1;var e=OC();function t(d){var p="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),V0.exports=I8(),V0.exports}var xM;function L8(){if(xM)return Ip;xM=1;var e=O8(),t=OC(),n=TD();function r(i){var c="https://react.dev/errors/"+i;if(1G||(i.current=q[G],q[G]=null,G--)}function Z(i,c){G++,q[G]=i.current,i.current=c}var ee=H(null),J=H(null),X=H(null),ue=H(null);function pe(i,c){switch(Z(X,c),Z(J,i),Z(ee,null),c.nodeType){case 9:case 11:i=(i=c.documentElement)&&(i=i.namespaceURI)?Nj(i):0;break;default:if(i=c.tagName,c=c.namespaceURI)c=Nj(c),i=$j(c,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}K(ee),Z(ee,i)}function fe(){K(ee),K(J),K(X)}function xe(i){i.memoizedState!==null&&Z(ue,i);var c=ee.current,f=$j(c,i.type);c!==f&&(Z(J,i),Z(ee,f))}function me(i){J.current===i&&(K(ee),K(J)),ue.current===i&&(K(ue),Rp._currentValue=V)}var Ce,De;function ae(i){if(Ce===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);Ce=c&&c[1]||"",De=-1Dy(n,t)):!1}function EB(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Dy(n,t):!1}function MB(e,t){if(!t?.length)return!1;const n=Kb(e);return n?Dy(n,t):!1}function RB(e,t){if(!t?.length)return!0;const n=Kb(e);return n?Dy(n,t):!0}function kB(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!==""&&n.filename!=="[native code]")return n.filename||null}return null}function Kb(e){try{const n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?kB(n):null}catch{return bn&&tn.error(`Cannot extract url for event ${su(e)}`),null}}function PB(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function AB(e,t,n,r,o,s){if(!o.exception?.values||!s||!mc(s.originalException,Error))return;const l=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;l&&(o.exception.values=tS(e,t,r,s.originalException,n,o.exception.values,l,0))}function tS(e,t,n,r,o,s,l,u){if(s.length>=n+1)return s;let d=[...s];if(mc(r[o],Error)){sM(l,u);const p=e(t,r[o]),m=d.length;iM(p,o,m,u),d=tS(e,t,n,r[o],o,[p,...d],p,m)}return Array.isArray(r.errors)&&r.errors.forEach((p,m)=>{if(mc(p,Error)){sM(l,u);const b=e(t,p),y=d.length;iM(b,`errors[${m}]`,y,u),d=tS(e,t,n,p,o,[b,...d],b,y)}}),d}function sM(e,t){e.mechanism={handled:!0,type:"auto.core.linked_errors",...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function iM(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function DB(e){const t="console";Ru(t,e),ku(t,OB)}function OB(){"console"in Zn&&L4.forEach(function(e){e in Zn.console&&Ms(Zn.console,e,function(t){return Gb[e]=t,function(...n){Fi("console",{args:n,level:e}),Gb[e]?.apply(Zn.console,n)}})})}function IB(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const LB="Dedupe",zB=(()=>{let e;return{name:LB,processEvent(t){if(t.type)return t;try{if($B(t,e))return bn&&tn.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),NB=zB;function $B(e,t){return t?!!(FB(e,t)||BB(e,t)):!1}function FB(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!yD(e,t)||!bD(e,t))}function BB(e,t){const n=aM(t),r=aM(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!yD(e,t)||!bD(e,t))}function bD(e,t){let n=vE(e),r=vE(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o=400&&e<500?"warning":e>=500?"error":void 0}const wm=Zn;function VB(){return"history"in wm&&!!wm.history}function HB(){if(!("fetch"in wm))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function nS(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function qB(){if(typeof EdgeRuntime=="string")return!0;if(!HB())return!1;if(nS(wm.fetch))return!0;let e=!1;const t=wm.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=nS(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){bn&&tn.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function UB(e,t){const n="fetch";Ru(n,e),ku(n,()=>WB(void 0,t))}function WB(e,t=!1){t&&!qB()||Ms(Zn,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:l}=GB(r),u={args:r,fetchData:{method:s,url:l},startTimestamp:al()*1e3,virtualError:o,headers:YB(r)};return Fi("fetch",{...u}),n.apply(Zn,r).then(async d=>(Fi("fetch",{...u,endTimestamp:al()*1e3,response:d}),d),d=>{Fi("fetch",{...u,endTimestamp:al()*1e3,error:d}),Um(d)&&d.stack===void 0&&(d.stack=o.stack,hc(d,"framesToPop",1));const m=fo()?.getOptions().enhanceFetchErrorMessages??"always";if(m!==!1&&d instanceof TypeError&&(d.message==="Failed to fetch"||d.message==="Load failed"||d.message==="NetworkError when attempting to fetch resource."))try{const h=new URL(u.fetchData.url).host;m==="always"?d.message=`${d.message} (${h})`:hc(d,"__sentry_fetch_url_host__",h)}catch{}throw d})}})}function vb(e,t){return!!e&&typeof e=="object"&&!!e[t]}function lM(e){return typeof e=="string"?e:e?vb(e,"url")?e.url:e.toString?e.toString():"":""}function GB(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:lM(n),method:vb(r,"method")?String(r.method).toUpperCase():NA(n)&&vb(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:lM(t),method:vb(t,"method")?String(t.method).toUpperCase():"GET"}}function YB(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(NA(t))return new Headers(t.headers)}catch{}}function KB(){return"npm"}const br=Zn;let rS=0;function xD(){return rS>0}function XB(){rS++,setTimeout(()=>{rS--})}function uf(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{const o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(wC(e))return e}catch{return e}const r=function(...o){try{const s=o.map(l=>uf(l,t));return e.apply(this,s)}catch(s){throw XB(),TC(l=>{l.addEventProcessor(u=>(t.mechanism&&(G1(u,void 0),af(u,t.mechanism)),u.extra={...u.extra,arguments:o},u)),Kd(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}FA(r,e),hc(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function QB(){const e=CC(),{referrer:t}=br.document||{},{userAgent:n}=br.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function PC(e,t){const n=AC(e,t),r={type:n6(t),value:r6(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function ZB(e,t,n,r){const s=fo()?.getOptions().normalizeDepth,l=l6(t),u={__serialized__:JA(t,s)};if(l)return{exception:{values:[PC(e,l)]},extra:u};const d={exception:{values:[{type:ky(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:i6(t,{isUnhandledRejection:r})}]},extra:u};if(n){const p=AC(e,n);p.length&&(d.exception.values[0].stacktrace={frames:p})}return d}function L0(e,t){return{exception:{values:[PC(e,t)]}}}function AC(e,t){const n=t.stacktrace||t.stack||"",r=e6(t),o=t6(t);try{return e(n,r,o)}catch{}return[]}const JB=/Minified React error #\d+;/i;function e6(e){return e&&JB.test(e.message)?1:0}function t6(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function SD(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function n6(e){const t=e?.name;return!t&&SD(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function r6(e){const t=e?.message;return SD(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?tM(t.error):tM(e):"No error message"}function o6(e,t,n,r){const o=n?.syntheticException||void 0,s=DC(e,t,o,r);return af(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),Oy(s)}function s6(e,t,n="info",r,o){const s=r?.syntheticException||void 0,l=oS(e,t,s,o);return l.level=n,r?.event_id&&(l.event_id=r.event_id),Oy(l)}function DC(e,t,n,r,o){let s;if(LA(t)&&t.error)return L0(e,t.error);if(SE(t)||K4(t)){const l=t;if("stack"in t)s=L0(e,t);else{const u=l.name||(SE(l)?"DOMError":"DOMException"),d=l.message?`${u}: ${l.message}`:u;s=oS(e,d,n,r),G1(s,d)}return"code"in l&&(s.tags={...s.tags,"DOMException.code":`${l.code}`}),s}return Um(t)?L0(e,t):Sm(t)||ky(t)?(s=ZB(e,t,n,o),af(s,{synthetic:!0}),s):(s=oS(e,t,n,r),G1(s,`${t}`),af(s,{synthetic:!0}),s)}function oS(e,t,n,r){const o={};if(r&&n){const s=AC(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),af(o,{synthetic:!0})}if(xC(t)){const{__sentry_template_string__:s,__sentry_template_values__:l}=t;return o.logentry={message:s,params:l},o}return o.message=t,o}function i6(e,{isUnhandledRejection:t}){const n=nF(e),r=t?"promise rejection":"exception";return LA(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ky(e)?`Event \`${a6(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function a6(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function l6(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class c6 extends aB{constructor(t){const n=u6(t),r=br.SENTRY_SDK_SOURCE||KB();gD(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:o,sendClientReports:s,enableLogs:l,_experiments:u,enableMetrics:d}=this._options,p=d??u?.enableMetrics??!0;br.document&&(s||l||p)&&br.document.addEventListener("visibilitychange",()=>{br.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),l&&iD(this),p&&lD(this))}),o&&this.on("beforeSendSession",gB)}eventFromException(t,n){return o6(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return s6(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function u6(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:br.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const d6=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Vo=Zn,f6=1e3;let cM,sS,iS;function p6(e){Ru("dom",e),ku("dom",m6)}function m6(){if(!Vo.document)return;const e=Fi.bind(null,"dom"),t=uM(e,!0);Vo.document.addEventListener("click",t,!1),Vo.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const o=Vo[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(Ms(o,"addEventListener",function(s){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},m=p[l]=p[l]||{refCount:0};if(!m.handler){const b=uM(e);m.handler=b,s.call(this,l,b,d)}m.refCount++}catch{}return s.call(this,l,u,d)}}),Ms(o,"removeEventListener",function(s){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},m=p[l];m&&(m.refCount--,m.refCount<=0&&(s.call(this,l,m.handler,d),m.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,l,u,d)}}))})}function h6(e){if(e.type!==sS)return!1;try{if(!e.target||e.target._sentryId!==iS)return!1}catch{}return!0}function g6(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function uM(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=b6(n);if(g6(n.type,r))return;hc(n,"_sentryCaptured",!0),r&&!r._sentryId&&hc(r,"_sentryId",fi());const o=n.type==="keypress"?"input":n.type;h6(n)||(e({event:n,name:o,global:t}),sS=n.type,iS=r?r._sentryId:void 0),clearTimeout(cM),cM=Vo.setTimeout(()=>{iS=void 0,sS=void 0},f6)}}function b6(e){try{return e.target}catch{return null}}let Mg;function CD(e){const t="history";Ru(t,e),ku(t,y6)}function y6(){if(Vo.addEventListener("popstate",()=>{const t=Vo.location.href,n=Mg;if(Mg=t,n===t)return;Fi("history",{from:n,to:t})}),!VB())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=Mg,s=v6(String(r));if(Mg=s,o===s)return t.apply(this,n);Fi("history",{from:o,to:s})}return t.apply(this,n)}}Ms(Vo.history,"pushState",e),Ms(Vo.history,"replaceState",e)}function v6(e){try{return new URL(e,Vo.location.origin).toString()}catch{return e}}const xb={};function x6(e){const t=xb[e];if(t)return t;let n=Vo[e];if(nS(n))return xb[e]=n.bind(Vo);const r=Vo.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){d6&&tn.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(xb[e]=n.bind(Vo))}function S6(e){xb[e]=void 0}const Qp="__sentry_xhr_v3__";function C6(e){Ru("xhr",e),ku("xhr",w6)}function w6(){if(!Vo.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=al()*1e3,l=il(r[0])?r[0].toUpperCase():void 0,u=_6(r[1]);if(!l||!u)return t.apply(n,r);n[Qp]={method:l,url:u,request_headers:{}},l==="POST"&&u.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[Qp];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const m={endTimestamp:al()*1e3,startTimestamp:s,xhr:n,virtualError:o};Fi("xhr",m)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(p,m,b){return d(),p.apply(m,b)}}):n.addEventListener("readystatechange",d),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(p,m,b){const[y,h]=b,x=m[Qp];return x&&il(y)&&il(h)&&(x.request_headers[y.toLowerCase()]=h),p.apply(m,b)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[Qp];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:al()*1e3,xhr:n};return Fi("xhr",s),t.apply(n,r)}})}function _6(e){if(il(e))return e;try{return e.toString()}catch{}}const T6=40;function j6(e,t=x6("fetch")){let n=0,r=0;async function o(s){const l=s.body.length;n+=l,r++;const u={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const d=await t(e.url,u);return{statusCode:d.status,headers:{"x-sentry-rate-limits":d.headers.get("X-Sentry-Rate-Limits"),"retry-after":d.headers.get("Retry-After")}}}catch(d){throw S6("fetch"),d}finally{n-=l,r--}}return nB(e,o,kC(e.bufferSize||T6))}const df=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,E6=30,M6=50;function aS(e,t,n,r){const o={filename:e,function:t===""?mu:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const R6=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,k6=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,P6=/\((\S*)(?::(\d+))(?::(\d+))\)/,A6=/at (.+?) ?\(data:(.+?),/,D6=e=>{const t=e.match(A6);if(t)return{filename:``,function:t[1]};const n=R6.exec(e);if(n){const[,o,s,l]=n;return aS(o,mu,+s,+l)}const r=k6.exec(e);if(r){if(r[2]&&r[2].indexOf("eval")===0){const u=P6.exec(r[2]);u&&(r[2]=u[1],r[3]=u[2],r[4]=u[3])}const[s,l]=wD(r[1]||mu,r[2]);return aS(l,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},O6=[E6,D6],I6=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,L6=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,z6=e=>{const t=I6.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=L6.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||mu;return[o,r]=wD(o,r),aS(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},N6=[M6,z6],$6=[O6,N6],F6=DA(...$6),wD=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:mu,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Rg=1024,B6="Breadcrumbs",V6=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:B6,setup(n){t.console&&DB(W6(n)),t.dom&&p6(U6(n,t.dom)),t.xhr&&C6(G6(n)),t.fetch&&UB(Y6(n)),t.history&&CD(K6(n)),t.sentry&&n.on("beforeSendEvent",q6(n))}}}),H6=V6;function q6(e){return function(n){fo()===e&&gu({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:su(n)},{event:n})}}function U6(e,t){return function(r){if(fo()!==e)return;let o,s,l=typeof t=="object"?t.serializeAttribute:void 0,u=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;u&&u>Rg&&(df&&tn.warn(`\`dom.maxStringLength\` cannot exceed ${Rg}, but a value of ${u} was configured. Sentry will use ${Rg} instead.`),u=Rg),typeof l=="string"&&(l=[l]);try{const p=r.event,m=X6(p)?p.target:p;o=$A(m,{keyAttrs:l,maxStringLength:u}),s=tF(m)}catch{o=""}if(o.length===0)return;const d={category:`ui.${r.name}`,message:o};s&&(d.data={"ui.component_name":s}),gu(d,{event:r.event,name:r.name,global:r.global})}}function W6(e){return function(n){if(fo()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:IB(n.level),message:_E(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${_E(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;gu(r,{input:n.args,level:n.level})}}function G6(e){return function(n){if(fo()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[Qp];if(!r||!o||!s)return;const{method:l,url:u,status_code:d,body:p}=s,m={method:l,url:u,status_code:d},b={xhr:n.xhr,input:p,startTimestamp:r,endTimestamp:o},y={category:"xhr",data:m,type:"http",level:vD(d)};e.emit("beforeOutgoingRequestBreadcrumb",y,b),gu(y,b)}}function Y6(e){return function(n){if(fo()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const s=n.fetchData,l={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},u={category:"fetch",data:s,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",u,l),gu(u,l)}else{const s=n.response,l={...n.fetchData,status_code:s?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,s?.status;const u={input:n.args,response:s,startTimestamp:r,endTimestamp:o},d={category:"fetch",data:l,type:"http",level:vD(l.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,u),gu(d,u)}}}function K6(e){return function(n){if(fo()!==e)return;let r=n.from,o=n.to;const s=I0(br.location.href);let l=r?I0(r):void 0;const u=I0(o);l?.path||(l=s),s.protocol===u.protocol&&s.host===u.host&&(o=u.relative),s.protocol===l.protocol&&s.host===l.host&&(r=l.relative),gu({category:"navigation",data:{from:r,to:o}})}}function X6(e){return!!e&&!!e.target}const Q6=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Z6="BrowserApiErrors",J6=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Z6,setupOnce(){t.setTimeout&&Ms(br,"setTimeout",dM),t.setInterval&&Ms(br,"setInterval",dM),t.requestAnimationFrame&&Ms(br,"requestAnimationFrame",t8),t.XMLHttpRequest&&"XMLHttpRequest"in br&&Ms(XMLHttpRequest.prototype,"send",n8);const n=t.eventTarget;n&&(Array.isArray(n)?n:Q6).forEach(o=>r8(o,t))}}}),e8=J6;function dM(e){return function(...t){const n=t[0];return t[0]=uf(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${pc(e)}`}}),e.apply(this,t)}}function t8(e){return function(t){return e.apply(this,[uf(t,{mechanism:{data:{handler:pc(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function n8(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Ms(n,o,function(s){const l={mechanism:{data:{handler:pc(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},u=wC(s);return u&&(l.mechanism.data.handler=pc(u)),uf(s,l)})}),e.apply(this,t)}}function r8(e,t){const r=br[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ms(r,"addEventListener",function(o){return function(s,l,u){try{o8(l)&&(l.handleEvent=uf(l.handleEvent,{mechanism:{data:{handler:pc(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&s8(this,s,l),o.apply(this,[s,uf(l,{mechanism:{data:{handler:pc(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),Ms(r,"removeEventListener",function(o){return function(s,l,u){try{const d=l.__sentry_wrapped__;d&&o.call(this,s,d,u)}catch{}return o.call(this,s,l,u)}}))}function o8(e){return typeof e.handleEvent=="function"}function s8(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const i8=()=>({name:"BrowserSession",setupOnce(){if(typeof br.document>"u"){df&&tn.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}qE({ignoreDuration:!0}),UE(),CD(({from:e,to:t})=>{e!==void 0&&e!==t&&(qE({ignoreDuration:!0}),UE())})}}),a8="GlobalHandlers",l8=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:a8,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(u8(n),fM("onerror")),t.onunhandledrejection&&(d8(n),fM("onunhandledrejection"))}}}),c8=l8;function u8(e){U4(t=>{const{stackParser:n,attachStacktrace:r}=_D();if(fo()!==e||xD())return;const{msg:o,url:s,line:l,column:u,error:d}=t,p=m8(DC(n,d||o,void 0,r,!1),s,l,u);p.level="error",tD(p,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function d8(e){G4(t=>{const{stackParser:n,attachStacktrace:r}=_D();if(fo()!==e||xD())return;const o=f8(t),s=Ry(o)?p8(o):DC(n,o,void 0,r,!0);s.level="error",tD(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function f8(e){if(Ry(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function p8(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function m8(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],l=s[0]=s[0]||{},u=l.stacktrace=l.stacktrace||{},d=u.frames=u.frames||[],p=r,m=n,b=h8(t)??CC();return d.length===0&&d.push({colno:p,filename:b,function:mu,in_app:!0,lineno:m}),e}function fM(e){df&&tn.log(`Global Handler attached: ${e}`)}function _D(){return fo()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function h8(e){if(!(!il(e)||e.length===0))return e.startsWith("data:")?`<${hB(e,!1)}>`:e}const g8=()=>({name:"HttpContext",preprocessEvent(e){if(!br.navigator&&!br.location&&!br.document)return;const t=QB(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),b8="cause",y8=5,v8="LinkedErrors",x8=((e={})=>{const t=e.limit||y8,n=e.key||b8;return{name:v8,preprocessEvent(r,o,s){const l=s.getOptions();AB(PC,l.stackParser,n,t,r,o)}}}),S8=x8;function C8(){return w8()?(df&&Af(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function w8(){if(typeof br.window>"u")return!1;const e=br;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=CC(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(br===br.top&&r.some(s=>n.startsWith(`${s}://`)))}function _8(e){return[_B(),xB(),e8(),H6(),c8(),S8(),NB(),g8(),i8()]}function T8(e={}){const t=!e.skipBrowserExtensionCheck&&C8();let n=e.defaultIntegrations==null?_8():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:H4(e.stackParser||F6),integrations:H3({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||j6};return pB(c6,r)}function pM(e={}){const t=br.document,n=t?.head||t?.body;if(!n){df&&tn.error("[showReportDialog] Global document not defined");return}const r=hl(),s=fo()?.getDsn();if(!s){df&&tn.error("[showReportDialog] DSN not configured");return}const l={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||L3()},u=br.document.createElement("script");u.async=!0,u.crossOrigin="anonymous",u.src=B3(s,l);const{onLoad:d,onClose:p}=l;if(d&&(u.onload=d),p){const m=b=>{if(b.data==="__sentry_reportdialog_closed__")try{p()}finally{br.removeEventListener("message",m)}};br.addEventListener("message",m)}n.appendChild(u)}var z0={exports:{}},pn={};var mM;function j8(){if(mM)return pn;mM=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),y=Symbol.iterator;function h(H){return H===null||typeof H!="object"?null:(H=y&&H[y]||H["@@iterator"],typeof H=="function"?H:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,S={};function w(H,Y,Z){this.props=H,this.context=Y,this.refs=S,this.updater=Z||x}w.prototype.isReactComponent={},w.prototype.setState=function(H,Y){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,Y,"setState")},w.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function _(){}_.prototype=w.prototype;function T(H,Y,Z){this.props=H,this.context=Y,this.refs=S,this.updater=Z||x}var M=T.prototype=new _;M.constructor=T,C(M,w.prototype),M.isPureReactComponent=!0;var R=Array.isArray;function L(){}var N={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function F(H,Y,Z){var ee=Z.ref;return{$$typeof:e,type:H,key:Y,ref:ee!==void 0?ee:null,props:Z}}function B(H,Y){return F(H.type,Y,H.props)}function A(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function E(H){var Y={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(Z){return Y[Z]})}var I=/\/+/g;function $(H,Y){return typeof H=="object"&&H!==null&&H.key!=null?E(""+H.key):Y.toString(36)}function z(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(L,L):(H.status="pending",H.then(function(Y){H.status==="pending"&&(H.status="fulfilled",H.value=Y)},function(Y){H.status==="pending"&&(H.status="rejected",H.reason=Y)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function P(H,Y,Z,ee,J){var X=typeof H;(X==="undefined"||X==="boolean")&&(H=null);var ce=!1;if(H===null)ce=!0;else switch(X){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(H.$$typeof){case e:case t:ce=!0;break;case m:return ce=H._init,P(ce(H._payload),Y,Z,ee,J)}}if(ce)return J=J(H),ce=ee===""?"."+$(H,0):ee,R(J)?(Z="",ce!=null&&(Z=ce.replace(I,"$&/")+"/"),P(J,Y,Z,"",function(ye){return ye})):J!=null&&(A(J)&&(J=B(J,Z+(J.key==null||H&&H.key===J.key?"":(""+J.key).replace(I,"$&/")+"/")+ce)),Y.push(J)),1;ce=0;var pe=ee===""?".":ee+":";if(R(H))for(var ue=0;ue=17}function R8(e,t){const n=new WeakSet;function r(o,s){if(!n.has(o)){if(o.cause)return n.add(o),r(o.cause,s);o.cause=s}}r(e,t)}function k8(e,{componentStack:t},n){if(M8(v.version)&&Um(e)&&t){const r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,R8(e,r)}return TC(r=>(r.setContext("react",{componentStack:t}),Kd(e,n)))}const P8=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,N0={componentStack:null,error:null,eventId:null};class A8 extends v.Component{constructor(t){super(t),this.state=N0,this._openFallbackReportDialog=!0;const n=fo();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&pM({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){const{componentStack:r}=n,{beforeCapture:o,onError:s,showDialog:l,dialogOptions:u}=this.props;TC(d=>{o&&o(d,t,r);const p=this.props.handled!=null?this.props.handled:!!this.props.fallback,m=k8(t,n,{mechanism:{handled:p,type:"auto.function.react.error_boundary"}});s&&s(t,r,m),l&&(this._lastEventId=m,this._openFallbackReportDialog&&pM({...u,eventId:m})),this.setState({error:t,componentStack:r,eventId:m})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===N0?o(null,null,null):o(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){const{onReset:t}=this.props,{error:n,componentStack:r,eventId:o}=this.state;t&&t(n,r,o),this.setState(N0)}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;const o=typeof t=="function"?v.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return v.isValidElement(o)?o:(t&&P8&&tn.warn("fallback did not produce a valid ReactElement"),null)}}var $0={exports:{}},Lp={},F0={exports:{}},B0={};var gM;function D8(){return gM||(gM=1,(function(e){function t(P,O){var V=P.length;P.push(O);e:for(;0>>1,G=P[q];if(0>>1;qo(Z,V))eeo(J,Z)?(P[q]=J,P[ee]=V,q=ee):(P[q]=Z,P[Y]=V,q=Y);else if(eeo(J,V))P[q]=J,P[ee]=V,q=ee;else break e}}return O}function o(P,O){var V=P.sortIndex-O.sortIndex;return V!==0?V:P.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],m=1,b=null,y=3,h=!1,x=!1,C=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function M(P){for(var O=n(p);O!==null;){if(O.callback===null)r(p);else if(O.startTime<=P)r(p),O.sortIndex=O.expirationTime,t(d,O);else break;O=n(p)}}function R(P){if(C=!1,M(P),!x)if(n(d)!==null)x=!0,L||(L=!0,E());else{var O=n(p);O!==null&&z(R,O.startTime-P)}}var L=!1,N=-1,D=5,F=-1;function B(){return S?!0:!(e.unstable_now()-FP&&B());){var q=b.callback;if(typeof q=="function"){b.callback=null,y=b.priorityLevel;var G=q(b.expirationTime<=P);if(P=e.unstable_now(),typeof G=="function"){b.callback=G,M(P),O=!0;break t}b===n(d)&&r(d),M(P)}else r(d);b=n(d)}if(b!==null)O=!0;else{var H=n(p);H!==null&&z(R,H.startTime-P),O=!1}}break e}finally{b=null,y=V,h=!1}O=void 0}}finally{O?E():L=!1}}}var E;if(typeof T=="function")E=function(){T(A)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,$=I.port2;I.port1.onmessage=A,E=function(){$.postMessage(null)}}else E=function(){w(A,0)};function z(P,O){N=w(function(){P(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125q?(P.sortIndex=V,t(p,P),n(d)===null&&P===n(p)&&(C?(_(N),N=-1):C=!0,z(R,V-q))):(P.sortIndex=G,t(d,P),x||h||(x=!0,L||(L=!0,E()))),P},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(P){var O=y;return function(){var V=y;y=O;try{return P.apply(this,arguments)}finally{y=V}}}})(B0)),B0}var bM;function O8(){return bM||(bM=1,F0.exports=D8()),F0.exports}var V0={exports:{}},Eo={};var yM;function I8(){if(yM)return Eo;yM=1;var e=OC();function t(d){var p="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),V0.exports=I8(),V0.exports}var xM;function L8(){if(xM)return Lp;xM=1;var e=O8(),t=OC(),n=TD();function r(i){var c="https://react.dev/errors/"+i;if(1G||(i.current=q[G],q[G]=null,G--)}function Z(i,c){G++,q[G]=i.current,i.current=c}var ee=H(null),J=H(null),X=H(null),ce=H(null);function pe(i,c){switch(Z(X,c),Z(J,i),Z(ee,null),c.nodeType){case 9:case 11:i=(i=c.documentElement)&&(i=i.namespaceURI)?Nj(i):0;break;default:if(i=c.tagName,c=c.namespaceURI)c=Nj(c),i=$j(c,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Y(ee),Z(ee,i)}function ue(){Y(ee),Y(J),Y(X)}function ye(i){i.memoizedState!==null&&Z(ce,i);var c=ee.current,f=$j(c,i.type);c!==f&&(Z(J,i),Z(ee,f))}function he(i){J.current===i&&(Y(ee),Y(J)),ce.current===i&&(Y(ce),kp._currentValue=V)}var Se,ke;function be(i){if(Se===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);Se=c&&c[1]||"",ke=-1)":-1j||Pe[g]!==He[j]){var Qe=` -`+Pe[g].replace(" at new "," at ");return i.displayName&&Qe.includes("")&&(Qe=Qe.replace("",i.displayName)),Qe}while(1<=g&&0<=j);break}}}finally{re=!1,Error.prepareStackTrace=f}return(f=i?i.displayName||i.name:"")?ae(f):""}function te(i,c){switch(i.tag){case 26:case 27:case 5:return ae(i.type);case 16:return ae("Lazy");case 13:return i.child!==c&&c!==null?ae("Suspense Fallback"):ae("Suspense");case 19:return ae("SuspenseList");case 0:case 15:return Y(i.type,!1);case 11:return Y(i.type.render,!1);case 1:return Y(i.type,!0);case 31:return ae("Activity");default:return""}}function oe(i){try{var c="",f=null;do c+=te(i,f),f=i,i=i.return;while(i);return c}catch(g){return` +`+Se+i+ke}var oe=!1;function K(i,c){if(!i||oe)return"";oe=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var ot=function(){throw Error()};if(Object.defineProperty(ot.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ot,[])}catch(Ge){var He=Ge}Reflect.construct(i,[],ot)}else{try{ot.call()}catch(Ge){He=Ge}i.call(ot.prototype)}}else{try{throw Error()}catch(Ge){He=Ge}(ot=i())&&typeof ot.catch=="function"&&ot.catch(function(){})}}catch(Ge){if(Ge&&He&&typeof Ge.stack=="string")return[Ge.stack,He.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var j=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");j&&j.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),W=k[0],ne=k[1];if(W&&ne){var Pe=W.split(` +`),Ve=ne.split(` +`);for(j=g=0;gj||Pe[g]!==Ve[j]){var Qe=` +`+Pe[g].replace(" at new "," at ");return i.displayName&&Qe.includes("")&&(Qe=Qe.replace("",i.displayName)),Qe}while(1<=g&&0<=j);break}}}finally{oe=!1,Error.prepareStackTrace=f}return(f=i?i.displayName||i.name:"")?be(f):""}function re(i,c){switch(i.tag){case 26:case 27:case 5:return be(i.type);case 16:return be("Lazy");case 13:return i.child!==c&&c!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return K(i.type,!1);case 11:return K(i.type.render,!1);case 1:return K(i.type,!0);case 31:return be("Activity");default:return""}}function te(i){try{var c="",f=null;do c+=re(i,f),f=i,i=i.return;while(i);return c}catch(g){return` Error generating stack: `+g.message+` -`+g.stack}}var he=Object.prototype.hasOwnProperty,le=e.unstable_scheduleCallback,ye=e.unstable_cancelCallback,ce=e.unstable_shouldYield,de=e.unstable_requestPaint,_e=e.unstable_now,Me=e.unstable_getCurrentPriorityLevel,ge=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,Se=e.unstable_LowPriority,we=e.unstable_IdlePriority,Ie=e.log,We=e.unstable_setDisableYieldValue,Ae=null,$e=null;function at(i){if(typeof Ie=="function"&&We(i),$e&&typeof $e.setStrictMode=="function")try{$e.setStrictMode(Ae,i)}catch{}}var xt=Math.clz32?Math.clz32:Rt,Be=Math.log,St=Math.LN2;function Rt(i){return i>>>=0,i===0?32:31-(Be(i)/St|0)|0}var Yt=256,mn=262144,Pt=4194304;function Tt(i){var c=i&42;if(c!==0)return c;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function un(i,c,f){var g=i.pendingLanes;if(g===0)return 0;var j=0,k=i.suspendedLanes,W=i.pingedLanes;i=i.warmLanes;var ne=g&134217727;return ne!==0?(g=ne&~k,g!==0?j=Tt(g):(W&=ne,W!==0?j=Tt(W):f||(f=ne&~i,f!==0&&(j=Tt(f))))):(ne=g&~k,ne!==0?j=Tt(ne):W!==0?j=Tt(W):f||(f=g&~i,f!==0&&(j=Tt(f)))),j===0?0:c!==0&&c!==j&&(c&k)===0&&(k=j&-j,f=c&-c,k>=f||k===32&&(f&4194048)!==0)?c:j}function ct(i,c){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&c)===0}function Mt(i,c){switch(i){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mt(){var i=Pt;return Pt<<=1,(Pt&62914560)===0&&(Pt=4194304),i}function Gt(i){for(var c=[],f=0;31>f;f++)c.push(i);return c}function pt(i,c){i.pendingLanes|=c,c!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Et(i,c,f,g,j,k){var W=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var ne=i.entanglements,Pe=i.expirationTimes,He=i.hiddenUpdates;for(f=W&~f;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Gf=/[\n"\\]/g;function So(i){return i.replace(Gf,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Dc(i,c,f,g,j,k,W,ne){i.name="",W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.type=W:i.removeAttribute("type"),c!=null?W==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+Kr(c)):i.value!==""+Kr(c)&&(i.value=""+Kr(c)):W!=="submit"&&W!=="reset"||i.removeAttribute("value"),c!=null?Oc(i,W,Kr(c)):f!=null?Oc(i,W,Kr(f)):g!=null&&i.removeAttribute("value"),j==null&&k!=null&&(i.defaultChecked=!!k),j!=null&&(i.checked=j&&typeof j!="function"&&typeof j!="symbol"),ne!=null&&typeof ne!="function"&&typeof ne!="symbol"&&typeof ne!="boolean"?i.name=""+Kr(ne):i.removeAttribute("name")}function Tl(i,c,f,g,j,k,W,ne){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.type=k),c!=null||f!=null){if(!(k!=="submit"&&k!=="reset"||c!=null)){wl(i);return}f=f!=null?""+Kr(f):"",c=c!=null?""+Kr(c):f,ne||c===i.value||(i.value=c),i.defaultValue=c}g=g??j,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=ne?i.checked:!!g,i.defaultChecked=!!g,W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"&&(i.name=W),wl(i)}function Oc(i,c,f){c==="number"&&_l(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function Qi(i,c,f,g){if(i=i.options,c){c={};for(var j=0;j"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rl=!1;if(Oo)try{var wo={};Object.defineProperty(wo,"passive",{get:function(){Rl=!0}}),window.addEventListener("test",wo,wo),window.removeEventListener("test",wo,wo)}catch{Rl=!1}var ps=null,Aa=null,kl=null;function Hu(){if(kl)return kl;var i,c=Aa,f=c.length,g,j="value"in ps?ps.value:ps.textContent,k=j.length;for(i=0;i=Xf),U_=" ",W_=!1;function G_(i,c){switch(i){case"keyup":return e$.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Y_(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Wu=!1;function n$(i,c){switch(i){case"compositionend":return Y_(c);case"keypress":return c.which!==32?null:(W_=!0,U_);case"textInput":return i=c.data,i===U_&&W_?null:i;default:return null}}function r$(i,c){if(Wu)return i==="compositionend"||!Ov&&G_(i,c)?(i=Hu(),kl=Aa=ps=null,Wu=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:f,offset:c-i};i=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=n2(f)}}function o2(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?o2(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function s2(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var c=_l(i.document);c instanceof i.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)i=c.contentWindow;else break;c=_l(i.document)}return c}function zv(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}var d$=Oo&&"documentMode"in document&&11>=document.documentMode,Gu=null,Nv=null,ep=null,$v=!1;function i2(i,c,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;$v||Gu==null||Gu!==_l(g)||(g=Gu,"selectionStart"in g&&zv(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),ep&&Jf(ep,g)||(ep=g,g=fg(Nv,"onSelect"),0>=W,j-=W,na=1<<32-xt(c)+j|f<hn?(En=zt,zt=null):En=zt.sibling;var In=qe(Ne,zt,Ve[hn],Je);if(In===null){zt===null&&(zt=En);break}i&&zt&&In.alternate===null&&c(Ne,zt),Le=k(In,Le,hn),On===null?Vt=In:On.sibling=In,On=In,zt=En}if(hn===Ve.length)return f(Ne,zt),Rn&&Ia(Ne,hn),Vt;if(zt===null){for(;hnhn?(En=zt,zt=null):En=zt.sibling;var Zl=qe(Ne,zt,In.value,Je);if(Zl===null){zt===null&&(zt=En);break}i&&zt&&Zl.alternate===null&&c(Ne,zt),Le=k(Zl,Le,hn),On===null?Vt=Zl:On.sibling=Zl,On=Zl,zt=En}if(In.done)return f(Ne,zt),Rn&&Ia(Ne,hn),Vt;if(zt===null){for(;!In.done;hn++,In=Ve.next())In=ot(Ne,In.value,Je),In!==null&&(Le=k(In,Le,hn),On===null?Vt=In:On.sibling=In,On=In);return Rn&&Ia(Ne,hn),Vt}for(zt=g(zt);!In.done;hn++,In=Ve.next())In=Ye(zt,Ne,hn,In.value,Je),In!==null&&(i&&In.alternate!==null&&zt.delete(In.key===null?hn:In.key),Le=k(In,Le,hn),On===null?Vt=In:On.sibling=In,On=In);return i&&zt.forEach(function(P4){return c(Ne,P4)}),Rn&&Ia(Ne,hn),Vt}function Jn(Ne,Le,Ve,Je){if(typeof Ve=="object"&&Ve!==null&&Ve.type===C&&Ve.key===null&&(Ve=Ve.props.children),typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case h:e:{for(var Vt=Ve.key;Le!==null;){if(Le.key===Vt){if(Vt=Ve.type,Vt===C){if(Le.tag===7){f(Ne,Le.sibling),Je=j(Le,Ve.props.children),Je.return=Ne,Ne=Je;break e}}else if(Le.elementType===Vt||typeof Vt=="object"&&Vt!==null&&Vt.$$typeof===D&&qc(Vt)===Le.type){f(Ne,Le.sibling),Je=j(Le,Ve.props),ip(Je,Ve),Je.return=Ne,Ne=Je;break e}f(Ne,Le);break}else c(Ne,Le);Le=Le.sibling}Ve.type===C?(Je=$c(Ve.props.children,Ne.mode,Je,Ve.key),Je.return=Ne,Ne=Je):(Je=Rh(Ve.type,Ve.key,Ve.props,null,Ne.mode,Je),ip(Je,Ve),Je.return=Ne,Ne=Je)}return W(Ne);case x:e:{for(Vt=Ve.key;Le!==null;){if(Le.key===Vt)if(Le.tag===4&&Le.stateNode.containerInfo===Ve.containerInfo&&Le.stateNode.implementation===Ve.implementation){f(Ne,Le.sibling),Je=j(Le,Ve.children||[]),Je.return=Ne,Ne=Je;break e}else{f(Ne,Le);break}else c(Ne,Le);Le=Le.sibling}Je=Wv(Ve,Ne.mode,Je),Je.return=Ne,Ne=Je}return W(Ne);case D:return Ve=qc(Ve),Jn(Ne,Le,Ve,Je)}if(z(Ve))return Dt(Ne,Le,Ve,Je);if(E(Ve)){if(Vt=E(Ve),typeof Vt!="function")throw Error(r(150));return Ve=Vt.call(Ve),Xt(Ne,Le,Ve,Je)}if(typeof Ve.then=="function")return Jn(Ne,Le,Lh(Ve),Je);if(Ve.$$typeof===T)return Jn(Ne,Le,Ah(Ne,Ve),Je);zh(Ne,Ve)}return typeof Ve=="string"&&Ve!==""||typeof Ve=="number"||typeof Ve=="bigint"?(Ve=""+Ve,Le!==null&&Le.tag===6?(f(Ne,Le.sibling),Je=j(Le,Ve),Je.return=Ne,Ne=Je):(f(Ne,Le),Je=Uv(Ve,Ne.mode,Je),Je.return=Ne,Ne=Je),W(Ne)):f(Ne,Le)}return function(Ne,Le,Ve,Je){try{sp=0;var Vt=Jn(Ne,Le,Ve,Je);return od=null,Vt}catch(zt){if(zt===rd||zt===Oh)throw zt;var On=gs(29,zt,null,Ne.mode);return On.lanes=Je,On.return=Ne,On}}}var Wc=R2(!0),k2=R2(!1),Il=!1;function ox(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sx(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ll(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function zl(i,c,f){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(Ln&2)!==0){var j=g.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),g.pending=c,c=Mh(i),p2(i,null,f),c}return Eh(i,g,c,f),Mh(i)}function ap(i,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var g=c.lanes;g&=i.pendingLanes,f|=g,c.lanes=f,en(i,f)}}function ix(i,c){var f=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var j=null,k=null;if(f=f.firstBaseUpdate,f!==null){do{var W={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};k===null?j=k=W:k=k.next=W,f=f.next}while(f!==null);k===null?j=k=c:k=k.next=c}else j=k=c;f={baseState:g.baseState,firstBaseUpdate:j,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=c:i.next=c,f.lastBaseUpdate=c}var ax=!1;function lp(){if(ax){var i=nd;if(i!==null)throw i}}function cp(i,c,f,g){ax=!1;var j=i.updateQueue;Il=!1;var k=j.firstBaseUpdate,W=j.lastBaseUpdate,ne=j.shared.pending;if(ne!==null){j.shared.pending=null;var Pe=ne,He=Pe.next;Pe.next=null,W===null?k=He:W.next=He,W=Pe;var Qe=i.alternate;Qe!==null&&(Qe=Qe.updateQueue,ne=Qe.lastBaseUpdate,ne!==W&&(ne===null?Qe.firstBaseUpdate=He:ne.next=He,Qe.lastBaseUpdate=Pe))}if(k!==null){var ot=j.baseState;W=0,Qe=He=Pe=null,ne=k;do{var qe=ne.lane&-536870913,Ye=qe!==ne.lane;if(Ye?(jn&qe)===qe:(g&qe)===qe){qe!==0&&qe===td&&(ax=!0),Qe!==null&&(Qe=Qe.next={lane:0,tag:ne.tag,payload:ne.payload,callback:null,next:null});e:{var Dt=i,Xt=ne;qe=c;var Jn=f;switch(Xt.tag){case 1:if(Dt=Xt.payload,typeof Dt=="function"){ot=Dt.call(Jn,ot,qe);break e}ot=Dt;break e;case 3:Dt.flags=Dt.flags&-65537|128;case 0:if(Dt=Xt.payload,qe=typeof Dt=="function"?Dt.call(Jn,ot,qe):Dt,qe==null)break e;ot=b({},ot,qe);break e;case 2:Il=!0}}qe=ne.callback,qe!==null&&(i.flags|=64,Ye&&(i.flags|=8192),Ye=j.callbacks,Ye===null?j.callbacks=[qe]:Ye.push(qe))}else Ye={lane:qe,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Qe===null?(He=Qe=Ye,Pe=ot):Qe=Qe.next=Ye,W|=qe;if(ne=ne.next,ne===null){if(ne=j.shared.pending,ne===null)break;Ye=ne,ne=Ye.next,Ye.next=null,j.lastBaseUpdate=Ye,j.shared.pending=null}}while(!0);Qe===null&&(Pe=ot),j.baseState=Pe,j.firstBaseUpdate=He,j.lastBaseUpdate=Qe,k===null&&(j.shared.lanes=0),Vl|=W,i.lanes=W,i.memoizedState=ot}}function P2(i,c){if(typeof i!="function")throw Error(r(191,i));i.call(c)}function A2(i,c){var f=i.callbacks;if(f!==null)for(i.callbacks=null,i=0;ik?k:8;var W=P.T,ne={};P.T=ne,jx(i,!1,c,f);try{var Pe=j(),He=P.S;if(He!==null&&He(ne,Pe),Pe!==null&&typeof Pe=="object"&&typeof Pe.then=="function"){var Qe=x$(Pe,g);fp(i,c,Qe,Ss(i))}else fp(i,c,g,Ss(i))}catch(ot){fp(i,c,{then:function(){},status:"rejected",reason:ot},Ss())}finally{O.p=k,W!==null&&ne.types!==null&&(W.types=ne.types),P.T=W}}function j$(){}function _x(i,c,f,g){if(i.tag!==5)throw Error(r(476));var j=uT(i).queue;cT(i,j,c,V,f===null?j$:function(){return dT(i),f(g)})}function uT(i){var c=i.memoizedState;if(c!==null)return c;c={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:V},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:f},next:null},i.memoizedState=c,i=i.alternate,i!==null&&(i.memoizedState=c),c}function dT(i){var c=uT(i);c.next===null&&(c=i.alternate.memoizedState),fp(i,c.next.queue,{},Ss())}function Tx(){return po(Rp)}function fT(){return zr().memoizedState}function pT(){return zr().memoizedState}function E$(i){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var f=Ss();i=Ll(f);var g=zl(c,i,f);g!==null&&(Qo(g,c,f),ap(g,c,f)),c={cache:ex()},i.payload=c;return}c=c.return}}function M$(i,c,f){var g=Ss();f={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Gh(i)?hT(c,f):(f=Hv(i,c,f,g),f!==null&&(Qo(f,i,g),gT(f,c,g)))}function mT(i,c,f){var g=Ss();fp(i,c,f,g)}function fp(i,c,f,g){var j={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Gh(i))hT(c,j);else{var k=i.alternate;if(i.lanes===0&&(k===null||k.lanes===0)&&(k=c.lastRenderedReducer,k!==null))try{var W=c.lastRenderedState,ne=k(W,f);if(j.hasEagerState=!0,j.eagerState=ne,hs(ne,W))return Eh(i,c,j,0),rr===null&&jh(),!1}catch{}if(f=Hv(i,c,j,g),f!==null)return Qo(f,i,g),gT(f,c,g),!0}return!1}function jx(i,c,f,g){if(g={lane:2,revertLane:o0(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Gh(i)){if(c)throw Error(r(479))}else c=Hv(i,f,g,2),c!==null&&Qo(c,i,2)}function Gh(i){var c=i.alternate;return i===fn||c!==null&&c===fn}function hT(i,c){id=Fh=!0;var f=i.pending;f===null?c.next=c:(c.next=f.next,f.next=c),i.pending=c}function gT(i,c,f){if((f&4194048)!==0){var g=c.lanes;g&=i.pendingLanes,f|=g,c.lanes=f,en(i,f)}}var pp={readContext:po,use:Hh,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useLayoutEffect:Er,useInsertionEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useSyncExternalStore:Er,useId:Er,useHostTransitionStatus:Er,useFormState:Er,useActionState:Er,useOptimistic:Er,useMemoCache:Er,useCacheRefresh:Er};pp.useEffectEvent=Er;var bT={readContext:po,use:Hh,useCallback:function(i,c){return Io().memoizedState=[i,c===void 0?null:c],i},useContext:po,useEffect:eT,useImperativeHandle:function(i,c,f){f=f!=null?f.concat([i]):null,Uh(4194308,4,oT.bind(null,c,i),f)},useLayoutEffect:function(i,c){return Uh(4194308,4,i,c)},useInsertionEffect:function(i,c){Uh(4,2,i,c)},useMemo:function(i,c){var f=Io();c=c===void 0?null:c;var g=i();if(Gc){at(!0);try{i()}finally{at(!1)}}return f.memoizedState=[g,c],g},useReducer:function(i,c,f){var g=Io();if(f!==void 0){var j=f(c);if(Gc){at(!0);try{f(c)}finally{at(!1)}}}else j=c;return g.memoizedState=g.baseState=j,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:j},g.queue=i,i=i.dispatch=M$.bind(null,fn,i),[g.memoizedState,i]},useRef:function(i){var c=Io();return i={current:i},c.memoizedState=i},useState:function(i){i=vx(i);var c=i.queue,f=mT.bind(null,fn,c);return c.dispatch=f,[i.memoizedState,f]},useDebugValue:Cx,useDeferredValue:function(i,c){var f=Io();return wx(f,i,c)},useTransition:function(){var i=vx(!1);return i=cT.bind(null,fn,i.queue,!0,!1),Io().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,c,f){var g=fn,j=Io();if(Rn){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),rr===null)throw Error(r(349));(jn&127)!==0||N2(g,c,f)}j.memoizedState=f;var k={value:f,getSnapshot:c};return j.queue=k,eT(F2.bind(null,g,k,i),[i]),g.flags|=2048,ld(9,{destroy:void 0},$2.bind(null,g,k,f,c),null),f},useId:function(){var i=Io(),c=rr.identifierPrefix;if(Rn){var f=ra,g=na;f=(g&~(1<<32-xt(g)-1)).toString(32)+f,c="_"+c+"R_"+f,f=Bh++,0<\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?W.createElement("select",{is:g.is}):W.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?W.createElement(j,{is:g.is}):W.createElement(j)}}k[Bt]=c,k[dn]=g;e:for(W=c.child;W!==null;){if(W.tag===5||W.tag===6)k.appendChild(W.stateNode);else if(W.tag!==4&&W.tag!==27&&W.child!==null){W.child.return=W,W=W.child;continue}if(W===c)break e;for(;W.sibling===null;){if(W.return===null||W.return===c)break e;W=W.return}W.sibling.return=W.return,W=W.sibling}c.stateNode=k;e:switch(ho(k,j,g),j){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ba(c)}}return cr(c),Fx(c,c.type,i===null?null:i.memoizedProps,c.pendingProps,f),null;case 6:if(i&&c.stateNode!=null)i.memoizedProps!==g&&Ba(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(i=X.current,Ju(c)){if(i=c.stateNode,f=c.memoizedProps,g=null,j=fo,j!==null)switch(j.tag){case 27:case 5:g=j.memoizedProps}i[Bt]=c,i=!!(i.nodeValue===f||g!==null&&g.suppressHydrationWarning===!0||Lj(i.nodeValue,f)),i||Dl(c,!0)}else i=pg(i).createTextNode(g),i[Bt]=c,c.stateNode=i}return cr(c),null;case 31:if(f=c.memoizedState,i===null||i.memoizedState!==null){if(g=Ju(c),f!==null){if(i===null){if(!g)throw Error(r(318));if(i=c.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Bt]=c}else Fc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;cr(c),i=!1}else f=Xv(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),i=!0;if(!i)return c.flags&256?(ys(c),c):(ys(c),null);if((c.flags&128)!==0)throw Error(r(558))}return cr(c),null;case 13:if(g=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(j=Ju(c),g!==null&&g.dehydrated!==null){if(i===null){if(!j)throw Error(r(318));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(r(317));j[Bt]=c}else Fc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;cr(c),j=!1}else j=Xv(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=j),j=!0;if(!j)return c.flags&256?(ys(c),c):(ys(c),null)}return ys(c),(c.flags&128)!==0?(c.lanes=f,c):(f=g!==null,i=i!==null&&i.memoizedState!==null,f&&(g=c.child,j=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(j=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==j&&(g.flags|=2048)),f!==i&&f&&(c.child.flags|=8192),Zh(c,c.updateQueue),cr(c),null);case 4:return fe(),i===null&&l0(c.stateNode.containerInfo),cr(c),null;case 10:return za(c.type),cr(c),null;case 19:if(K(Lr),g=c.memoizedState,g===null)return cr(c),null;if(j=(c.flags&128)!==0,k=g.rendering,k===null)if(j)hp(g,!1);else{if(Mr!==0||i!==null&&(i.flags&128)!==0)for(i=c.child;i!==null;){if(k=$h(i),k!==null){for(c.flags|=128,hp(g,!1),i=k.updateQueue,c.updateQueue=i,Zh(c,i),c.subtreeFlags=0,i=f,f=c.child;f!==null;)m2(f,i),f=f.sibling;return Z(Lr,Lr.current&1|2),Rn&&Ia(c,g.treeForkCount),c.child}i=i.sibling}g.tail!==null&&_e()>rg&&(c.flags|=128,j=!0,hp(g,!1),c.lanes=4194304)}else{if(!j)if(i=$h(k),i!==null){if(c.flags|=128,j=!0,i=i.updateQueue,c.updateQueue=i,Zh(c,i),hp(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!Rn)return cr(c),null}else 2*_e()-g.renderingStartTime>rg&&f!==536870912&&(c.flags|=128,j=!0,hp(g,!1),c.lanes=4194304);g.isBackwards?(k.sibling=c.child,c.child=k):(i=g.last,i!==null?i.sibling=k:c.child=k,g.last=k)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=_e(),i.sibling=null,f=Lr.current,Z(Lr,j?f&1|2:f&1),Rn&&Ia(c,g.treeForkCount),i):(cr(c),null);case 22:case 23:return ys(c),cx(),g=c.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(f&536870912)!==0&&(c.flags&128)===0&&(cr(c),c.subtreeFlags&6&&(c.flags|=8192)):cr(c),f=c.updateQueue,f!==null&&Zh(c,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==f&&(c.flags|=2048),i!==null&&K(Hc),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),za(Vr),cr(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function D$(i,c){switch(Yv(c),c.tag){case 1:return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return za(Vr),fe(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 26:case 27:case 5:return me(c),null;case 31:if(c.memoizedState!==null){if(ys(c),c.alternate===null)throw Error(r(340));Fc()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 13:if(ys(c),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Fc()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return K(Lr),null;case 4:return fe(),null;case 10:return za(c.type),null;case 22:case 23:return ys(c),cx(),i!==null&&K(Hc),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 24:return za(Vr),null;case 25:return null;default:return null}}function BT(i,c){switch(Yv(c),c.tag){case 3:za(Vr),fe();break;case 26:case 27:case 5:me(c);break;case 4:fe();break;case 31:c.memoizedState!==null&&ys(c);break;case 13:ys(c);break;case 19:K(Lr);break;case 10:za(c.type);break;case 22:case 23:ys(c),cx(),i!==null&&K(Hc);break;case 24:za(Vr)}}function gp(i,c){try{var f=c.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var j=g.next;f=j;do{if((f.tag&i)===i){g=void 0;var k=f.create,W=f.inst;g=k(),W.destroy=g}f=f.next}while(f!==j)}}catch(ne){Un(c,c.return,ne)}}function Fl(i,c,f){try{var g=c.updateQueue,j=g!==null?g.lastEffect:null;if(j!==null){var k=j.next;g=k;do{if((g.tag&i)===i){var W=g.inst,ne=W.destroy;if(ne!==void 0){W.destroy=void 0,j=c;var Pe=f,He=ne;try{He()}catch(Qe){Un(j,Pe,Qe)}}}g=g.next}while(g!==k)}}catch(Qe){Un(c,c.return,Qe)}}function VT(i){var c=i.updateQueue;if(c!==null){var f=i.stateNode;try{A2(c,f)}catch(g){Un(i,i.return,g)}}}function HT(i,c,f){f.props=Yc(i.type,i.memoizedProps),f.state=i.memoizedState;try{f.componentWillUnmount()}catch(g){Un(i,c,g)}}function bp(i,c){try{var f=i.ref;if(f!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof f=="function"?i.refCleanup=f(g):f.current=g}}catch(j){Un(i,c,j)}}function oa(i,c){var f=i.ref,g=i.refCleanup;if(f!==null)if(typeof g=="function")try{g()}catch(j){Un(i,c,j)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(j){Un(i,c,j)}else f.current=null}function qT(i){var c=i.type,f=i.memoizedProps,g=i.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&g.focus();break e;case"img":f.src?g.src=f.src:f.srcSet&&(g.srcset=f.srcSet)}}catch(j){Un(i,i.return,j)}}function Bx(i,c,f){try{var g=i.stateNode;t4(g,i.type,f,c),g[dn]=c}catch(j){Un(i,i.return,j)}}function UT(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Gl(i.type)||i.tag===4}function Vx(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||UT(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Gl(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Hx(i,c,f){var g=i.tag;if(g===5||g===6)i=i.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(i,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(i),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Wo));else if(g!==4&&(g===27&&Gl(i.type)&&(f=i.stateNode,c=null),i=i.child,i!==null))for(Hx(i,c,f),i=i.sibling;i!==null;)Hx(i,c,f),i=i.sibling}function Jh(i,c,f){var g=i.tag;if(g===5||g===6)i=i.stateNode,c?f.insertBefore(i,c):f.appendChild(i);else if(g!==4&&(g===27&&Gl(i.type)&&(f=i.stateNode),i=i.child,i!==null))for(Jh(i,c,f),i=i.sibling;i!==null;)Jh(i,c,f),i=i.sibling}function WT(i){var c=i.stateNode,f=i.memoizedProps;try{for(var g=i.type,j=c.attributes;j.length;)c.removeAttributeNode(j[0]);ho(c,g,f),c[Bt]=i,c[dn]=f}catch(k){Un(i,i.return,k)}}var Va=!1,Ur=!1,qx=!1,GT=typeof WeakSet=="function"?WeakSet:Set,ro=null;function O$(i,c){if(i=i.containerInfo,d0=xg,i=s2(i),zv(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var j=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{f.nodeType,k.nodeType}catch{f=null;break e}var W=0,ne=-1,Pe=-1,He=0,Qe=0,ot=i,qe=null;t:for(;;){for(var Ye;ot!==f||j!==0&&ot.nodeType!==3||(ne=W+j),ot!==k||g!==0&&ot.nodeType!==3||(Pe=W+g),ot.nodeType===3&&(W+=ot.nodeValue.length),(Ye=ot.firstChild)!==null;)qe=ot,ot=Ye;for(;;){if(ot===i)break t;if(qe===f&&++He===j&&(ne=W),qe===k&&++Qe===g&&(Pe=W),(Ye=ot.nextSibling)!==null)break;ot=qe,qe=ot.parentNode}ot=Ye}f=ne===-1||Pe===-1?null:{start:ne,end:Pe}}else f=null}f=f||{start:0,end:0}}else f=null;for(f0={focusedElem:i,selectionRange:f},xg=!1,ro=c;ro!==null;)if(c=ro,i=c.child,(c.subtreeFlags&1028)!==0&&i!==null)i.return=c,ro=i;else for(;ro!==null;){switch(c=ro,k=c.alternate,i=c.flags,c.tag){case 0:if((i&4)!==0&&(i=c.updateQueue,i=i!==null?i.events:null,i!==null))for(f=0;f title"))),ho(k,g,f),k[Bt]=i,kn(k),g=k;break e;case"link":var W=Jj("link","href",j).get(g+(f.href||""));if(W){for(var ne=0;neJn&&(W=Jn,Jn=Xt,Xt=W);var Ne=r2(ne,Xt),Le=r2(ne,Jn);if(Ne&&Le&&(Ye.rangeCount!==1||Ye.anchorNode!==Ne.node||Ye.anchorOffset!==Ne.offset||Ye.focusNode!==Le.node||Ye.focusOffset!==Le.offset)){var Ve=ot.createRange();Ve.setStart(Ne.node,Ne.offset),Ye.removeAllRanges(),Xt>Jn?(Ye.addRange(Ve),Ye.extend(Le.node,Le.offset)):(Ve.setEnd(Le.node,Le.offset),Ye.addRange(Ve))}}}}for(ot=[],Ye=ne;Ye=Ye.parentNode;)Ye.nodeType===1&&ot.push({element:Ye,left:Ye.scrollLeft,top:Ye.scrollTop});for(typeof ne.focus=="function"&&ne.focus(),ne=0;nef?32:f,P.T=null,f=Qx,Qx=null;var k=ql,W=Ga;if(Jr=0,pd=ql=null,Ga=0,(Ln&6)!==0)throw Error(r(331));var ne=Ln;if(Ln|=4,oj(k.current),tj(k,k.current,W,f),Ln=ne,wp(0,!1),$e&&typeof $e.onPostCommitFiberRoot=="function")try{$e.onPostCommitFiberRoot(Ae,k)}catch{}return!0}finally{O.p=j,P.T=g,Cj(i,c)}}function _j(i,c,f){c=Ws(f,c),c=kx(i.stateNode,c,2),i=zl(i,c,2),i!==null&&(pt(i,2),sa(i))}function Un(i,c,f){if(i.tag===3)_j(i,i,f);else for(;c!==null;){if(c.tag===3){_j(c,i,f);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Hl===null||!Hl.has(g))){i=Ws(f,i),f=TT(2),g=zl(c,f,2),g!==null&&(jT(f,g,c,i),pt(g,2),sa(g));break}}c=c.return}}function t0(i,c,f){var g=i.pingCache;if(g===null){g=i.pingCache=new z$;var j=new Set;g.set(c,j)}else j=g.get(c),j===void 0&&(j=new Set,g.set(c,j));j.has(f)||(Gx=!0,j.add(f),i=V$.bind(null,i,c,f),c.then(i,i))}function V$(i,c,f){var g=i.pingCache;g!==null&&g.delete(c),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,rr===i&&(jn&f)===f&&(Mr===4||Mr===3&&(jn&62914560)===jn&&300>_e()-ng?(Ln&2)===0&&md(i,0):Yx|=f,fd===jn&&(fd=0)),sa(i)}function Tj(i,c){c===0&&(c=mt()),i=Nc(i,c),i!==null&&(pt(i,c),sa(i))}function H$(i){var c=i.memoizedState,f=0;c!==null&&(f=c.retryLane),Tj(i,f)}function q$(i,c){var f=0;switch(i.tag){case 31:case 13:var g=i.stateNode,j=i.memoizedState;j!==null&&(f=j.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),Tj(i,f)}function U$(i,c){return le(i,c)}var cg=null,gd=null,n0=!1,ug=!1,r0=!1,Wl=0;function sa(i){i!==gd&&i.next===null&&(gd===null?cg=gd=i:gd=gd.next=i),ug=!0,n0||(n0=!0,G$())}function wp(i,c){if(!r0&&ug){r0=!0;do for(var f=!1,g=cg;g!==null;){if(i!==0){var j=g.pendingLanes;if(j===0)var k=0;else{var W=g.suspendedLanes,ne=g.pingedLanes;k=(1<<31-xt(42|i)+1)-1,k&=j&~(W&~ne),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(f=!0,Rj(g,k))}else k=jn,k=un(g,g===rr?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||ct(g,k)||(f=!0,Rj(g,k));g=g.next}while(f);r0=!1}}function W$(){jj()}function jj(){ug=n0=!1;var i=0;Wl!==0&&r4()&&(i=Wl);for(var c=_e(),f=null,g=cg;g!==null;){var j=g.next,k=Ej(g,c);k===0?(g.next=null,f===null?cg=j:f.next=j,j===null&&(gd=f)):(f=g,(i!==0||(k&3)!==0)&&(ug=!0)),g=j}Jr!==0&&Jr!==5||wp(i),Wl!==0&&(Wl=0)}function Ej(i,c){for(var f=i.suspendedLanes,g=i.pingedLanes,j=i.expirationTimes,k=i.pendingLanes&-62914561;0ne)break;var Qe=Pe.transferSize,ot=Pe.initiatorType;Qe&&zj(ot)&&(Pe=Pe.responseEnd,W+=Qe*(Pe"u"?null:document;function Kj(i,c,f){var g=bd;if(g&&typeof c=="string"&&c){var j=So(c);j='link[rel="'+i+'"][href="'+j+'"]',typeof f=="string"&&(j+='[crossorigin="'+f+'"]'),Yj.has(j)||(Yj.add(j),i={rel:i,crossOrigin:f,href:c},g.querySelector(j)===null&&(c=g.createElement("link"),ho(c,"link",i),kn(c),g.head.appendChild(c)))}}function f4(i){Ya.D(i),Kj("dns-prefetch",i,null)}function p4(i,c){Ya.C(i,c),Kj("preconnect",i,c)}function m4(i,c,f){Ya.L(i,c,f);var g=bd;if(g&&i&&c){var j='link[rel="preload"][as="'+So(c)+'"]';c==="image"&&f&&f.imageSrcSet?(j+='[imagesrcset="'+So(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(j+='[imagesizes="'+So(f.imageSizes)+'"]')):j+='[href="'+So(i)+'"]';var k=j;switch(c){case"style":k=yd(i);break;case"script":k=vd(i)}Zs.has(k)||(i=b({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:i,as:c},f),Zs.set(k,i),g.querySelector(j)!==null||c==="style"&&g.querySelector(Ep(k))||c==="script"&&g.querySelector(Mp(k))||(c=g.createElement("link"),ho(c,"link",i),kn(c),g.head.appendChild(c)))}}function h4(i,c){Ya.m(i,c);var f=bd;if(f&&i){var g=c&&typeof c.as=="string"?c.as:"script",j='link[rel="modulepreload"][as="'+So(g)+'"][href="'+So(i)+'"]',k=j;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=vd(i)}if(!Zs.has(k)&&(i=b({rel:"modulepreload",href:i},c),Zs.set(k,i),f.querySelector(j)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Mp(k)))return}g=f.createElement("link"),ho(g,"link",i),kn(g),f.head.appendChild(g)}}}function g4(i,c,f){Ya.S(i,c,f);var g=bd;if(g&&i){var j=Dn(g).hoistableStyles,k=yd(i);c=c||"default";var W=j.get(k);if(!W){var ne={loading:0,preload:null};if(W=g.querySelector(Ep(k)))ne.loading=5;else{i=b({rel:"stylesheet",href:i,"data-precedence":c},f),(f=Zs.get(k))&&v0(i,f);var Pe=W=g.createElement("link");kn(Pe),ho(Pe,"link",i),Pe._p=new Promise(function(He,Qe){Pe.onload=He,Pe.onerror=Qe}),Pe.addEventListener("load",function(){ne.loading|=1}),Pe.addEventListener("error",function(){ne.loading|=2}),ne.loading|=4,hg(W,c,g)}W={type:"stylesheet",instance:W,count:1,state:ne},j.set(k,W)}}}function b4(i,c){Ya.X(i,c);var f=bd;if(f&&i){var g=Dn(f).hoistableScripts,j=vd(i),k=g.get(j);k||(k=f.querySelector(Mp(j)),k||(i=b({src:i,async:!0},c),(c=Zs.get(j))&&x0(i,c),k=f.createElement("script"),kn(k),ho(k,"link",i),f.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(j,k))}}function y4(i,c){Ya.M(i,c);var f=bd;if(f&&i){var g=Dn(f).hoistableScripts,j=vd(i),k=g.get(j);k||(k=f.querySelector(Mp(j)),k||(i=b({src:i,async:!0,type:"module"},c),(c=Zs.get(j))&&x0(i,c),k=f.createElement("script"),kn(k),ho(k,"link",i),f.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(j,k))}}function Xj(i,c,f,g){var j=(j=X.current)?mg(j):null;if(!j)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=yd(f.href),f=Dn(j).hoistableStyles,g=f.get(c),g||(g={type:"style",instance:null,count:0,state:null},f.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=yd(f.href);var k=Dn(j).hoistableStyles,W=k.get(i);if(W||(j=j.ownerDocument||j,W={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,W),(k=j.querySelector(Ep(i)))&&!k._p&&(W.instance=k,W.state.loading=5),Zs.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Zs.set(i,f),k||v4(j,i,f,W.state))),c&&g===null)throw Error(r(528,""));return W}if(c&&g!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=vd(f),f=Dn(j).hoistableScripts,g=f.get(c),g||(g={type:"script",instance:null,count:0,state:null},f.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function yd(i){return'href="'+So(i)+'"'}function Ep(i){return'link[rel="stylesheet"]['+i+"]"}function Qj(i){return b({},i,{"data-precedence":i.precedence,precedence:null})}function v4(i,c,f,g){i.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=i.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),ho(c,"link",f),kn(c),i.head.appendChild(c))}function vd(i){return'[src="'+So(i)+'"]'}function Mp(i){return"script[async]"+i}function Zj(i,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var g=i.querySelector('style[data-href~="'+So(f.href)+'"]');if(g)return c.instance=g,kn(g),g;var j=b({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),kn(g),ho(g,"style",j),hg(g,f.precedence,i),c.instance=g;case"stylesheet":j=yd(f.href);var k=i.querySelector(Ep(j));if(k)return c.state.loading|=4,c.instance=k,kn(k),k;g=Qj(f),(j=Zs.get(j))&&v0(g,j),k=(i.ownerDocument||i).createElement("link"),kn(k);var W=k;return W._p=new Promise(function(ne,Pe){W.onload=ne,W.onerror=Pe}),ho(k,"link",g),c.state.loading|=4,hg(k,f.precedence,i),c.instance=k;case"script":return k=vd(f.src),(j=i.querySelector(Mp(k)))?(c.instance=j,kn(j),j):(g=f,(j=Zs.get(k))&&(g=b({},f),x0(g,j)),i=i.ownerDocument||i,j=i.createElement("script"),kn(j),ho(j,"link",g),i.head.appendChild(j),c.instance=j);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,hg(g,f.precedence,i));return c.instance}function hg(i,c,f){for(var g=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),j=g.length?g[g.length-1]:null,k=j,W=0;W title"):null)}function x4(i,c,f){if(f===1||c.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(i=c.disabled,typeof c.precedence=="string"&&i==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function tE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function S4(i,c,f,g){if(f.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var j=yd(g.href),k=c.querySelector(Ep(j));if(k){c=k._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(i.count++,i=bg.bind(i),c.then(i,i)),f.state.loading|=4,f.instance=k,kn(k);return}k=c.ownerDocument||c,g=Qj(g),(j=Zs.get(j))&&v0(g,j),k=k.createElement("link"),kn(k);var W=k;W._p=new Promise(function(ne,Pe){W.onload=ne,W.onerror=Pe}),ho(k,"link",g),f.instance=k}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(i.count++,f=bg.bind(i),c.addEventListener("load",f),c.addEventListener("error",f))}}var S0=0;function C4(i,c){return i.stylesheets&&i.count===0&&vg(i,i.stylesheets),0S0?50:800)+c);return i.unsuspend=f,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(j)}}:null}function bg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vg(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var yg=null;function vg(i,c){i.stylesheets=null,i.unsuspend!==null&&(i.count++,yg=new Map,c.forEach(w4,i),yg=null,bg.call(i))}function w4(i,c){if(!(c.state.loading&4)){var f=yg.get(i);if(f)var g=f.get(null);else{f=new Map,yg.set(i,f);for(var j=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$0.exports=L8(),$0.exports}var N8=z8();const $8=bi(N8);var CM="popstate";function F8(e={}){function t(r,o){let{pathname:s,search:l,hash:u}=r.location;return lS("",{pathname:s,search:l,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:wm(o)}return V8(t,n,null,e)}function Cr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ca(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function B8(){return Math.random().toString(36).substring(2,10)}function wM(e,t){return{usr:e.state,key:e.key,idx:t}}function lS(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Af(t):t,state:n,key:t&&t.key||r||B8()}}function wm({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Af(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function V8(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,l=o.history,u="POP",d=null,p=m();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function m(){return(l.state||{idx:null}).idx}function b(){u="POP";let S=m(),w=S==null?null:S-p;p=S,d&&d({action:u,location:C.location,delta:w})}function y(S,w){u="PUSH";let _=lS(C.location,S,w);p=m()+1;let T=wM(_,p),M=C.createHref(_);try{l.pushState(T,"",M)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;o.location.assign(M)}s&&d&&d({action:u,location:C.location,delta:1})}function h(S,w){u="REPLACE";let _=lS(C.location,S,w);p=m();let T=wM(_,p),M=C.createHref(_);l.replaceState(T,"",M),s&&d&&d({action:u,location:C.location,delta:0})}function x(S){return H8(S)}let C={get action(){return u},get location(){return e(o,l)},listen(S){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(CM,b),d=S,()=>{o.removeEventListener(CM,b),d=null}},createHref(S){return t(o,S)},createURL:x,encodeLocation(S){let w=x(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:y,replace:h,go(S){return l.go(S)}};return C}function H8(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Cr(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:wm(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function jD(e,t,n="/"){return q8(e,t,n,!1)}function q8(e,t,n,r){let o=typeof t=="string"?Af(t):t,s=ul(o.pathname||"/",n);if(s==null)return null;let l=ED(e);U8(l);let u=null;for(let d=0;u==null&&d{let m={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&d)return;Cr(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let b=ll([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&(Cr(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),ED(l.children,t,y,b,d)),!(l.path==null&&!l.index)&&t.push({path:b,score:Z8(b,l.index),routesMeta:y})};return e.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))s(l,u);else for(let d of MD(l.path))s(l,u,!0,d)}),t}function MD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let l=MD(r.join("/")),u=[];return u.push(...l.map(d=>d===""?s:[s,d].join("/"))),o&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function U8(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:J8(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var W8=/^:[\w-]+$/,G8=3,Y8=2,K8=1,X8=10,Q8=-2,_M=e=>e==="*";function Z8(e,t){let n=e.split("/"),r=n.length;return n.some(_M)&&(r+=Q8),t&&(r+=Y8),n.filter(o=>!_M(o)).reduce((o,s)=>o+(W8.test(s)?G8:s===""?K8:X8),r)}function J8(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function e9(e,t,n=!1){let{routesMeta:r}=e,o={},s="/",l=[];for(let u=0;u{if(m==="*"){let x=u[y]||"";l=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const h=u[y];return b&&!h?p[m]=void 0:p[m]=(h||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:e}}function t9(e,t=!1,n=!0){Ca(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function n9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ca(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ul(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var r9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function o9(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Af(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=TM(n.substring(1),"/"):s=TM(n,t)):s=t,{pathname:s,search:a9(r),hash:l9(o)}}function TM(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function H0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function s9(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function RD(e){let t=s9(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function kD(e,t,n,r=!1){let o;typeof e=="string"?o=Af(e):(o={...e},Cr(!o.pathname||!o.pathname.includes("?"),H0("?","pathname","search",o)),Cr(!o.pathname||!o.pathname.includes("#"),H0("#","pathname","hash",o)),Cr(!o.search||!o.search.includes("#"),H0("#","search","hash",o)));let s=e===""||o.pathname==="",l=s?"/":o.pathname,u;if(l==null)u=n;else{let b=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),b-=1;o.pathname=y.join("/")}u=b>=0?t[b]:"/"}let d=o9(o,u),p=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||m)&&(d.pathname+="/"),d}var ll=e=>e.join("/").replace(/\/\/+/g,"/"),i9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),a9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,l9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,c9=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function u9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function d9(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var PD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AD(e,t){let n=e;if(typeof n!="string"||!r9.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(PD)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=ul(l.pathname,t);l.origin===s.origin&&u!=null?n=u+l.search+l.hash:o=!0}catch{Ca(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var DD=["POST","PUT","PATCH","DELETE"];new Set(DD);var f9=["GET",...DD];new Set(f9);var Df=v.createContext(null);Df.displayName="DataRouter";var Iy=v.createContext(null);Iy.displayName="DataRouterState";var p9=v.createContext(!1),OD=v.createContext({isTransitioning:!1});OD.displayName="ViewTransition";var m9=v.createContext(new Map);m9.displayName="Fetchers";var h9=v.createContext(null);h9.displayName="Await";var yi=v.createContext(null);yi.displayName="Navigation";var Ym=v.createContext(null);Ym.displayName="Location";var ja=v.createContext({outlet:null,matches:[],isDataRoute:!1});ja.displayName="Route";var IC=v.createContext(null);IC.displayName="RouteError";var ID="REACT_ROUTER_ERROR",g9="REDIRECT",b9="ROUTE_ERROR_RESPONSE";function y9(e){if(e.startsWith(`${ID}:${g9}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function v9(e){if(e.startsWith(`${ID}:${b9}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new c9(t.status,t.statusText,t.data)}catch{}}function x9(e,{relative:t}={}){Cr(Km(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=v.useContext(yi),{hash:o,pathname:s,search:l}=Xm(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:ll([n,s])),r.createHref({pathname:u,search:l,hash:o})}function Km(){return v.useContext(Ym)!=null}function vi(){return Cr(Km(),"useLocation() may be used only in the context of a component."),v.useContext(Ym).location}var LD="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zD(e){v.useContext(yi).static||v.useLayoutEffect(e)}function Yr(){let{isDataRoute:e}=v.useContext(ja);return e?D9():S9()}function S9(){Cr(Km(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(Df),{basename:t,navigator:n}=v.useContext(yi),{matches:r}=v.useContext(ja),{pathname:o}=vi(),s=JSON.stringify(RD(r)),l=v.useRef(!1);return zD(()=>{l.current=!0}),v.useCallback((d,p={})=>{if(Ca(l.current,LD),!l.current)return;if(typeof d=="number"){n.go(d);return}let m=kD(d,JSON.parse(s),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ll([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,o,e])}v.createContext(null);function gl(){let{matches:e}=v.useContext(ja),t=e[e.length-1];return t?t.params:{}}function Xm(e,{relative:t}={}){let{matches:n}=v.useContext(ja),{pathname:r}=vi(),o=JSON.stringify(RD(n));return v.useMemo(()=>kD(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function C9(e,t){return ND(e,t)}function ND(e,t,n,r,o){Cr(Km(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=v.useContext(yi),{matches:l}=v.useContext(ja),u=l[l.length-1],d=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",b=u&&u.route;{let _=b&&b.path||"";FD(p,!b||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${p}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. +`+g.stack}}var de=Object.prototype.hasOwnProperty,ie=e.unstable_scheduleCallback,xe=e.unstable_cancelCallback,se=e.unstable_shouldYield,fe=e.unstable_requestPaint,_e=e.unstable_now,Te=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Me=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,we=e.unstable_LowPriority,ve=e.unstable_IdlePriority,Oe=e.log,Ue=e.unstable_setDisableYieldValue,Ae=null,ze=null;function at(i){if(typeof Oe=="function"&&Ue(i),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(Ae,i)}catch{}}var vt=Math.clz32?Math.clz32:Rt,Fe=Math.log,xt=Math.LN2;function Rt(i){return i>>>=0,i===0?32:31-(Fe(i)/xt|0)|0}var Zt=256,yn=262144,At=4194304;function Dt(i){var c=i&42;if(c!==0)return c;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function hn(i,c,f){var g=i.pendingLanes;if(g===0)return 0;var j=0,k=i.suspendedLanes,W=i.pingedLanes;i=i.warmLanes;var ne=g&134217727;return ne!==0?(g=ne&~k,g!==0?j=Dt(g):(W&=ne,W!==0?j=Dt(W):f||(f=ne&~i,f!==0&&(j=Dt(f))))):(ne=g&~k,ne!==0?j=Dt(ne):W!==0?j=Dt(W):f||(f=g&~i,f!==0&&(j=Dt(f)))),j===0?0:c!==0&&c!==j&&(c&k)===0&&(k=j&-j,f=c&-c,k>=f||k===32&&(f&4194048)!==0)?c:j}function ct(i,c){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&c)===0}function kt(i,c){switch(i){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pt(){var i=At;return At<<=1,(At&62914560)===0&&(At=4194304),i}function Lt(i){for(var c=[],f=0;31>f;f++)c.push(i);return c}function ft(i,c){i.pendingLanes|=c,c!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Tt(i,c,f,g,j,k){var W=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var ne=i.entanglements,Pe=i.expirationTimes,Ve=i.hiddenUpdates;for(f=W&~f;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Yf=/[\n"\\]/g;function _o(i){return i.replace(Yf,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Dc(i,c,f,g,j,k,W,ne){i.name="",W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.type=W:i.removeAttribute("type"),c!=null?W==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+Jr(c)):i.value!==""+Jr(c)&&(i.value=""+Jr(c)):W!=="submit"&&W!=="reset"||i.removeAttribute("value"),c!=null?Oc(i,W,Jr(c)):f!=null?Oc(i,W,Jr(f)):g!=null&&i.removeAttribute("value"),j==null&&k!=null&&(i.defaultChecked=!!k),j!=null&&(i.checked=j&&typeof j!="function"&&typeof j!="symbol"),ne!=null&&typeof ne!="function"&&typeof ne!="symbol"&&typeof ne!="boolean"?i.name=""+Jr(ne):i.removeAttribute("name")}function Tl(i,c,f,g,j,k,W,ne){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.type=k),c!=null||f!=null){if(!(k!=="submit"&&k!=="reset"||c!=null)){wl(i);return}f=f!=null?""+Jr(f):"",c=c!=null?""+Jr(c):f,ne||c===i.value||(i.value=c),i.defaultValue=c}g=g??j,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=ne?i.checked:!!g,i.defaultChecked=!!g,W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"&&(i.name=W),wl(i)}function Oc(i,c,f){c==="number"&&_l(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function Qi(i,c,f,g){if(i=i.options,c){c={};for(var j=0;j"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rl=!1;if(Lo)try{var jo={};Object.defineProperty(jo,"passive",{get:function(){Rl=!0}}),window.addEventListener("test",jo,jo),window.removeEventListener("test",jo,jo)}catch{Rl=!1}var ms=null,Aa=null,kl=null;function Wu(){if(kl)return kl;var i,c=Aa,f=c.length,g,j="value"in ms?ms.value:ms.textContent,k=j.length;for(i=0;i=Qf),U_=" ",W_=!1;function G_(i,c){switch(i){case"keyup":return e$.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Y_(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ku=!1;function n$(i,c){switch(i){case"compositionend":return Y_(c);case"keypress":return c.which!==32?null:(W_=!0,U_);case"textInput":return i=c.data,i===U_&&W_?null:i;default:return null}}function r$(i,c){if(Ku)return i==="compositionend"||!Ov&&G_(i,c)?(i=Wu(),kl=Aa=ms=null,Ku=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:f,offset:c-i};i=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=n2(f)}}function o2(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?o2(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function s2(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var c=_l(i.document);c instanceof i.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)i=c.contentWindow;else break;c=_l(i.document)}return c}function zv(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}var d$=Lo&&"documentMode"in document&&11>=document.documentMode,Xu=null,Nv=null,tp=null,$v=!1;function i2(i,c,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;$v||Xu==null||Xu!==_l(g)||(g=Xu,"selectionStart"in g&&zv(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),tp&&ep(tp,g)||(tp=g,g=fg(Nv,"onSelect"),0>=W,j-=W,na=1<<32-vt(c)+j|f<vn?(Pn=$t,$t=null):Pn=$t.sibling;var Nn=He(Ne,$t,Be[vn],Je);if(Nn===null){$t===null&&($t=Pn);break}i&&$t&&Nn.alternate===null&&c(Ne,$t),Ie=k(Nn,Ie,vn),zn===null?Wt=Nn:zn.sibling=Nn,zn=Nn,$t=Pn}if(vn===Be.length)return f(Ne,$t),On&&Ia(Ne,vn),Wt;if($t===null){for(;vnvn?(Pn=$t,$t=null):Pn=$t.sibling;var Zl=He(Ne,$t,Nn.value,Je);if(Zl===null){$t===null&&($t=Pn);break}i&&$t&&Zl.alternate===null&&c(Ne,$t),Ie=k(Zl,Ie,vn),zn===null?Wt=Zl:zn.sibling=Zl,zn=Zl,$t=Pn}if(Nn.done)return f(Ne,$t),On&&Ia(Ne,vn),Wt;if($t===null){for(;!Nn.done;vn++,Nn=Be.next())Nn=ot(Ne,Nn.value,Je),Nn!==null&&(Ie=k(Nn,Ie,vn),zn===null?Wt=Nn:zn.sibling=Nn,zn=Nn);return On&&Ia(Ne,vn),Wt}for($t=g($t);!Nn.done;vn++,Nn=Be.next())Nn=Ge($t,Ne,vn,Nn.value,Je),Nn!==null&&(i&&Nn.alternate!==null&&$t.delete(Nn.key===null?vn:Nn.key),Ie=k(Nn,Ie,vn),zn===null?Wt=Nn:zn.sibling=Nn,zn=Nn);return i&&$t.forEach(function(P4){return c(Ne,P4)}),On&&Ia(Ne,vn),Wt}function rr(Ne,Ie,Be,Je){if(typeof Be=="object"&&Be!==null&&Be.type===C&&Be.key===null&&(Be=Be.props.children),typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case h:e:{for(var Wt=Be.key;Ie!==null;){if(Ie.key===Wt){if(Wt=Be.type,Wt===C){if(Ie.tag===7){f(Ne,Ie.sibling),Je=j(Ie,Be.props.children),Je.return=Ne,Ne=Je;break e}}else if(Ie.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===D&&qc(Wt)===Ie.type){f(Ne,Ie.sibling),Je=j(Ie,Be.props),ap(Je,Be),Je.return=Ne,Ne=Je;break e}f(Ne,Ie);break}else c(Ne,Ie);Ie=Ie.sibling}Be.type===C?(Je=$c(Be.props.children,Ne.mode,Je,Be.key),Je.return=Ne,Ne=Je):(Je=Rh(Be.type,Be.key,Be.props,null,Ne.mode,Je),ap(Je,Be),Je.return=Ne,Ne=Je)}return W(Ne);case x:e:{for(Wt=Be.key;Ie!==null;){if(Ie.key===Wt)if(Ie.tag===4&&Ie.stateNode.containerInfo===Be.containerInfo&&Ie.stateNode.implementation===Be.implementation){f(Ne,Ie.sibling),Je=j(Ie,Be.children||[]),Je.return=Ne,Ne=Je;break e}else{f(Ne,Ie);break}else c(Ne,Ie);Ie=Ie.sibling}Je=Wv(Be,Ne.mode,Je),Je.return=Ne,Ne=Je}return W(Ne);case D:return Be=qc(Be),rr(Ne,Ie,Be,Je)}if(z(Be))return Ot(Ne,Ie,Be,Je);if(E(Be)){if(Wt=E(Be),typeof Wt!="function")throw Error(r(150));return Be=Wt.call(Be),en(Ne,Ie,Be,Je)}if(typeof Be.then=="function")return rr(Ne,Ie,Lh(Be),Je);if(Be.$$typeof===T)return rr(Ne,Ie,Ah(Ne,Be),Je);zh(Ne,Be)}return typeof Be=="string"&&Be!==""||typeof Be=="number"||typeof Be=="bigint"?(Be=""+Be,Ie!==null&&Ie.tag===6?(f(Ne,Ie.sibling),Je=j(Ie,Be),Je.return=Ne,Ne=Je):(f(Ne,Ie),Je=Uv(Be,Ne.mode,Je),Je.return=Ne,Ne=Je),W(Ne)):f(Ne,Ie)}return function(Ne,Ie,Be,Je){try{ip=0;var Wt=rr(Ne,Ie,Be,Je);return ad=null,Wt}catch($t){if($t===id||$t===Oh)throw $t;var zn=bs(29,$t,null,Ne.mode);return zn.lanes=Je,zn.return=Ne,zn}}}var Wc=R2(!0),k2=R2(!1),Il=!1;function ox(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sx(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ll(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function zl(i,c,f){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(Fn&2)!==0){var j=g.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),g.pending=c,c=Mh(i),p2(i,null,f),c}return Eh(i,g,c,f),Mh(i)}function lp(i,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var g=c.lanes;g&=i.pendingLanes,f|=g,c.lanes=f,rn(i,f)}}function ix(i,c){var f=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var j=null,k=null;if(f=f.firstBaseUpdate,f!==null){do{var W={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};k===null?j=k=W:k=k.next=W,f=f.next}while(f!==null);k===null?j=k=c:k=k.next=c}else j=k=c;f={baseState:g.baseState,firstBaseUpdate:j,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=c:i.next=c,f.lastBaseUpdate=c}var ax=!1;function cp(){if(ax){var i=sd;if(i!==null)throw i}}function up(i,c,f,g){ax=!1;var j=i.updateQueue;Il=!1;var k=j.firstBaseUpdate,W=j.lastBaseUpdate,ne=j.shared.pending;if(ne!==null){j.shared.pending=null;var Pe=ne,Ve=Pe.next;Pe.next=null,W===null?k=Ve:W.next=Ve,W=Pe;var Qe=i.alternate;Qe!==null&&(Qe=Qe.updateQueue,ne=Qe.lastBaseUpdate,ne!==W&&(ne===null?Qe.firstBaseUpdate=Ve:ne.next=Ve,Qe.lastBaseUpdate=Pe))}if(k!==null){var ot=j.baseState;W=0,Qe=Ve=Pe=null,ne=k;do{var He=ne.lane&-536870913,Ge=He!==ne.lane;if(Ge?(kn&He)===He:(g&He)===He){He!==0&&He===od&&(ax=!0),Qe!==null&&(Qe=Qe.next={lane:0,tag:ne.tag,payload:ne.payload,callback:null,next:null});e:{var Ot=i,en=ne;He=c;var rr=f;switch(en.tag){case 1:if(Ot=en.payload,typeof Ot=="function"){ot=Ot.call(rr,ot,He);break e}ot=Ot;break e;case 3:Ot.flags=Ot.flags&-65537|128;case 0:if(Ot=en.payload,He=typeof Ot=="function"?Ot.call(rr,ot,He):Ot,He==null)break e;ot=b({},ot,He);break e;case 2:Il=!0}}He=ne.callback,He!==null&&(i.flags|=64,Ge&&(i.flags|=8192),Ge=j.callbacks,Ge===null?j.callbacks=[He]:Ge.push(He))}else Ge={lane:He,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Qe===null?(Ve=Qe=Ge,Pe=ot):Qe=Qe.next=Ge,W|=He;if(ne=ne.next,ne===null){if(ne=j.shared.pending,ne===null)break;Ge=ne,ne=Ge.next,Ge.next=null,j.lastBaseUpdate=Ge,j.shared.pending=null}}while(!0);Qe===null&&(Pe=ot),j.baseState=Pe,j.firstBaseUpdate=Ve,j.lastBaseUpdate=Qe,k===null&&(j.shared.lanes=0),Vl|=W,i.lanes=W,i.memoizedState=ot}}function P2(i,c){if(typeof i!="function")throw Error(r(191,i));i.call(c)}function A2(i,c){var f=i.callbacks;if(f!==null)for(i.callbacks=null,i=0;ik?k:8;var W=P.T,ne={};P.T=ne,jx(i,!1,c,f);try{var Pe=j(),Ve=P.S;if(Ve!==null&&Ve(ne,Pe),Pe!==null&&typeof Pe=="object"&&typeof Pe.then=="function"){var Qe=x$(Pe,g);pp(i,c,Qe,Cs(i))}else pp(i,c,g,Cs(i))}catch(ot){pp(i,c,{then:function(){},status:"rejected",reason:ot},Cs())}finally{O.p=k,W!==null&&ne.types!==null&&(W.types=ne.types),P.T=W}}function j$(){}function _x(i,c,f,g){if(i.tag!==5)throw Error(r(476));var j=uT(i).queue;cT(i,j,c,V,f===null?j$:function(){return dT(i),f(g)})}function uT(i){var c=i.memoizedState;if(c!==null)return c;c={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:V},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:f},next:null},i.memoizedState=c,i=i.alternate,i!==null&&(i.memoizedState=c),c}function dT(i){var c=uT(i);c.next===null&&(c=i.alternate.memoizedState),pp(i,c.next.queue,{},Cs())}function Tx(){return bo(kp)}function fT(){return Br().memoizedState}function pT(){return Br().memoizedState}function E$(i){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var f=Cs();i=Ll(f);var g=zl(c,i,f);g!==null&&(Jo(g,c,f),lp(g,c,f)),c={cache:ex()},i.payload=c;return}c=c.return}}function M$(i,c,f){var g=Cs();f={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Gh(i)?hT(c,f):(f=Hv(i,c,f,g),f!==null&&(Jo(f,i,g),gT(f,c,g)))}function mT(i,c,f){var g=Cs();pp(i,c,f,g)}function pp(i,c,f,g){var j={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Gh(i))hT(c,j);else{var k=i.alternate;if(i.lanes===0&&(k===null||k.lanes===0)&&(k=c.lastRenderedReducer,k!==null))try{var W=c.lastRenderedState,ne=k(W,f);if(j.hasEagerState=!0,j.eagerState=ne,gs(ne,W))return Eh(i,c,j,0),ar===null&&jh(),!1}catch{}if(f=Hv(i,c,j,g),f!==null)return Jo(f,i,g),gT(f,c,g),!0}return!1}function jx(i,c,f,g){if(g={lane:2,revertLane:o0(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Gh(i)){if(c)throw Error(r(479))}else c=Hv(i,f,g,2),c!==null&&Jo(c,i,2)}function Gh(i){var c=i.alternate;return i===gn||c!==null&&c===gn}function hT(i,c){cd=Fh=!0;var f=i.pending;f===null?c.next=c:(c.next=f.next,f.next=c),i.pending=c}function gT(i,c,f){if((f&4194048)!==0){var g=c.lanes;g&=i.pendingLanes,f|=g,c.lanes=f,rn(i,f)}}var mp={readContext:bo,use:Hh,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useLayoutEffect:Pr,useInsertionEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useSyncExternalStore:Pr,useId:Pr,useHostTransitionStatus:Pr,useFormState:Pr,useActionState:Pr,useOptimistic:Pr,useMemoCache:Pr,useCacheRefresh:Pr};mp.useEffectEvent=Pr;var bT={readContext:bo,use:Hh,useCallback:function(i,c){return zo().memoizedState=[i,c===void 0?null:c],i},useContext:bo,useEffect:eT,useImperativeHandle:function(i,c,f){f=f!=null?f.concat([i]):null,Uh(4194308,4,oT.bind(null,c,i),f)},useLayoutEffect:function(i,c){return Uh(4194308,4,i,c)},useInsertionEffect:function(i,c){Uh(4,2,i,c)},useMemo:function(i,c){var f=zo();c=c===void 0?null:c;var g=i();if(Gc){at(!0);try{i()}finally{at(!1)}}return f.memoizedState=[g,c],g},useReducer:function(i,c,f){var g=zo();if(f!==void 0){var j=f(c);if(Gc){at(!0);try{f(c)}finally{at(!1)}}}else j=c;return g.memoizedState=g.baseState=j,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:j},g.queue=i,i=i.dispatch=M$.bind(null,gn,i),[g.memoizedState,i]},useRef:function(i){var c=zo();return i={current:i},c.memoizedState=i},useState:function(i){i=vx(i);var c=i.queue,f=mT.bind(null,gn,c);return c.dispatch=f,[i.memoizedState,f]},useDebugValue:Cx,useDeferredValue:function(i,c){var f=zo();return wx(f,i,c)},useTransition:function(){var i=vx(!1);return i=cT.bind(null,gn,i.queue,!0,!1),zo().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,c,f){var g=gn,j=zo();if(On){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),ar===null)throw Error(r(349));(kn&127)!==0||N2(g,c,f)}j.memoizedState=f;var k={value:f,getSnapshot:c};return j.queue=k,eT(F2.bind(null,g,k,i),[i]),g.flags|=2048,dd(9,{destroy:void 0},$2.bind(null,g,k,f,c),null),f},useId:function(){var i=zo(),c=ar.identifierPrefix;if(On){var f=ra,g=na;f=(g&~(1<<32-vt(g)-1)).toString(32)+f,c="_"+c+"R_"+f,f=Bh++,0<\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?W.createElement("select",{is:g.is}):W.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?W.createElement(j,{is:g.is}):W.createElement(j)}}k[Ht]=c,k[fn]=g;e:for(W=c.child;W!==null;){if(W.tag===5||W.tag===6)k.appendChild(W.stateNode);else if(W.tag!==4&&W.tag!==27&&W.child!==null){W.child.return=W,W=W.child;continue}if(W===c)break e;for(;W.sibling===null;){if(W.return===null||W.return===c)break e;W=W.return}W.sibling.return=W.return,W=W.sibling}c.stateNode=k;e:switch(vo(k,j,g),j){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ba(c)}}return pr(c),Fx(c,c.type,i===null?null:i.memoizedProps,c.pendingProps,f),null;case 6:if(i&&c.stateNode!=null)i.memoizedProps!==g&&Ba(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(i=X.current,nd(c)){if(i=c.stateNode,f=c.memoizedProps,g=null,j=go,j!==null)switch(j.tag){case 27:case 5:g=j.memoizedProps}i[Ht]=c,i=!!(i.nodeValue===f||g!==null&&g.suppressHydrationWarning===!0||Lj(i.nodeValue,f)),i||Dl(c,!0)}else i=pg(i).createTextNode(g),i[Ht]=c,c.stateNode=i}return pr(c),null;case 31:if(f=c.memoizedState,i===null||i.memoizedState!==null){if(g=nd(c),f!==null){if(i===null){if(!g)throw Error(r(318));if(i=c.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ht]=c}else Fc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;pr(c),i=!1}else f=Xv(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),i=!0;if(!i)return c.flags&256?(vs(c),c):(vs(c),null);if((c.flags&128)!==0)throw Error(r(558))}return pr(c),null;case 13:if(g=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(j=nd(c),g!==null&&g.dehydrated!==null){if(i===null){if(!j)throw Error(r(318));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(r(317));j[Ht]=c}else Fc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;pr(c),j=!1}else j=Xv(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=j),j=!0;if(!j)return c.flags&256?(vs(c),c):(vs(c),null)}return vs(c),(c.flags&128)!==0?(c.lanes=f,c):(f=g!==null,i=i!==null&&i.memoizedState!==null,f&&(g=c.child,j=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(j=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==j&&(g.flags|=2048)),f!==i&&f&&(c.child.flags|=8192),Zh(c,c.updateQueue),pr(c),null);case 4:return ue(),i===null&&l0(c.stateNode.containerInfo),pr(c),null;case 10:return za(c.type),pr(c),null;case 19:if(Y(Fr),g=c.memoizedState,g===null)return pr(c),null;if(j=(c.flags&128)!==0,k=g.rendering,k===null)if(j)gp(g,!1);else{if(Ar!==0||i!==null&&(i.flags&128)!==0)for(i=c.child;i!==null;){if(k=$h(i),k!==null){for(c.flags|=128,gp(g,!1),i=k.updateQueue,c.updateQueue=i,Zh(c,i),c.subtreeFlags=0,i=f,f=c.child;f!==null;)m2(f,i),f=f.sibling;return Z(Fr,Fr.current&1|2),On&&Ia(c,g.treeForkCount),c.child}i=i.sibling}g.tail!==null&&_e()>rg&&(c.flags|=128,j=!0,gp(g,!1),c.lanes=4194304)}else{if(!j)if(i=$h(k),i!==null){if(c.flags|=128,j=!0,i=i.updateQueue,c.updateQueue=i,Zh(c,i),gp(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!On)return pr(c),null}else 2*_e()-g.renderingStartTime>rg&&f!==536870912&&(c.flags|=128,j=!0,gp(g,!1),c.lanes=4194304);g.isBackwards?(k.sibling=c.child,c.child=k):(i=g.last,i!==null?i.sibling=k:c.child=k,g.last=k)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=_e(),i.sibling=null,f=Fr.current,Z(Fr,j?f&1|2:f&1),On&&Ia(c,g.treeForkCount),i):(pr(c),null);case 22:case 23:return vs(c),cx(),g=c.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(f&536870912)!==0&&(c.flags&128)===0&&(pr(c),c.subtreeFlags&6&&(c.flags|=8192)):pr(c),f=c.updateQueue,f!==null&&Zh(c,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==f&&(c.flags|=2048),i!==null&&Y(Hc),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),za(Wr),pr(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function D$(i,c){switch(Yv(c),c.tag){case 1:return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return za(Wr),ue(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 26:case 27:case 5:return he(c),null;case 31:if(c.memoizedState!==null){if(vs(c),c.alternate===null)throw Error(r(340));Fc()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 13:if(vs(c),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Fc()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return Y(Fr),null;case 4:return ue(),null;case 10:return za(c.type),null;case 22:case 23:return vs(c),cx(),i!==null&&Y(Hc),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 24:return za(Wr),null;case 25:return null;default:return null}}function BT(i,c){switch(Yv(c),c.tag){case 3:za(Wr),ue();break;case 26:case 27:case 5:he(c);break;case 4:ue();break;case 31:c.memoizedState!==null&&vs(c);break;case 13:vs(c);break;case 19:Y(Fr);break;case 10:za(c.type);break;case 22:case 23:vs(c),cx(),i!==null&&Y(Hc);break;case 24:za(Wr)}}function bp(i,c){try{var f=c.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var j=g.next;f=j;do{if((f.tag&i)===i){g=void 0;var k=f.create,W=f.inst;g=k(),W.destroy=g}f=f.next}while(f!==j)}}catch(ne){Yn(c,c.return,ne)}}function Fl(i,c,f){try{var g=c.updateQueue,j=g!==null?g.lastEffect:null;if(j!==null){var k=j.next;g=k;do{if((g.tag&i)===i){var W=g.inst,ne=W.destroy;if(ne!==void 0){W.destroy=void 0,j=c;var Pe=f,Ve=ne;try{Ve()}catch(Qe){Yn(j,Pe,Qe)}}}g=g.next}while(g!==k)}}catch(Qe){Yn(c,c.return,Qe)}}function VT(i){var c=i.updateQueue;if(c!==null){var f=i.stateNode;try{A2(c,f)}catch(g){Yn(i,i.return,g)}}}function HT(i,c,f){f.props=Yc(i.type,i.memoizedProps),f.state=i.memoizedState;try{f.componentWillUnmount()}catch(g){Yn(i,c,g)}}function yp(i,c){try{var f=i.ref;if(f!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof f=="function"?i.refCleanup=f(g):f.current=g}}catch(j){Yn(i,c,j)}}function oa(i,c){var f=i.ref,g=i.refCleanup;if(f!==null)if(typeof g=="function")try{g()}catch(j){Yn(i,c,j)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(j){Yn(i,c,j)}else f.current=null}function qT(i){var c=i.type,f=i.memoizedProps,g=i.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&g.focus();break e;case"img":f.src?g.src=f.src:f.srcSet&&(g.srcset=f.srcSet)}}catch(j){Yn(i,i.return,j)}}function Bx(i,c,f){try{var g=i.stateNode;t4(g,i.type,f,c),g[fn]=c}catch(j){Yn(i,i.return,j)}}function UT(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Gl(i.type)||i.tag===4}function Vx(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||UT(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Gl(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Hx(i,c,f){var g=i.tag;if(g===5||g===6)i=i.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(i,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(i),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Yo));else if(g!==4&&(g===27&&Gl(i.type)&&(f=i.stateNode,c=null),i=i.child,i!==null))for(Hx(i,c,f),i=i.sibling;i!==null;)Hx(i,c,f),i=i.sibling}function Jh(i,c,f){var g=i.tag;if(g===5||g===6)i=i.stateNode,c?f.insertBefore(i,c):f.appendChild(i);else if(g!==4&&(g===27&&Gl(i.type)&&(f=i.stateNode),i=i.child,i!==null))for(Jh(i,c,f),i=i.sibling;i!==null;)Jh(i,c,f),i=i.sibling}function WT(i){var c=i.stateNode,f=i.memoizedProps;try{for(var g=i.type,j=c.attributes;j.length;)c.removeAttributeNode(j[0]);vo(c,g,f),c[Ht]=i,c[fn]=f}catch(k){Yn(i,i.return,k)}}var Va=!1,Kr=!1,qx=!1,GT=typeof WeakSet=="function"?WeakSet:Set,ao=null;function O$(i,c){if(i=i.containerInfo,d0=xg,i=s2(i),zv(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var j=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{f.nodeType,k.nodeType}catch{f=null;break e}var W=0,ne=-1,Pe=-1,Ve=0,Qe=0,ot=i,He=null;t:for(;;){for(var Ge;ot!==f||j!==0&&ot.nodeType!==3||(ne=W+j),ot!==k||g!==0&&ot.nodeType!==3||(Pe=W+g),ot.nodeType===3&&(W+=ot.nodeValue.length),(Ge=ot.firstChild)!==null;)He=ot,ot=Ge;for(;;){if(ot===i)break t;if(He===f&&++Ve===j&&(ne=W),He===k&&++Qe===g&&(Pe=W),(Ge=ot.nextSibling)!==null)break;ot=He,He=ot.parentNode}ot=Ge}f=ne===-1||Pe===-1?null:{start:ne,end:Pe}}else f=null}f=f||{start:0,end:0}}else f=null;for(f0={focusedElem:i,selectionRange:f},xg=!1,ao=c;ao!==null;)if(c=ao,i=c.child,(c.subtreeFlags&1028)!==0&&i!==null)i.return=c,ao=i;else for(;ao!==null;){switch(c=ao,k=c.alternate,i=c.flags,c.tag){case 0:if((i&4)!==0&&(i=c.updateQueue,i=i!==null?i.events:null,i!==null))for(f=0;f title"))),vo(k,g,f),k[Ht]=i,Le(k),g=k;break e;case"link":var W=Jj("link","href",j).get(g+(f.href||""));if(W){for(var ne=0;nerr&&(W=rr,rr=en,en=W);var Ne=r2(ne,en),Ie=r2(ne,rr);if(Ne&&Ie&&(Ge.rangeCount!==1||Ge.anchorNode!==Ne.node||Ge.anchorOffset!==Ne.offset||Ge.focusNode!==Ie.node||Ge.focusOffset!==Ie.offset)){var Be=ot.createRange();Be.setStart(Ne.node,Ne.offset),Ge.removeAllRanges(),en>rr?(Ge.addRange(Be),Ge.extend(Ie.node,Ie.offset)):(Be.setEnd(Ie.node,Ie.offset),Ge.addRange(Be))}}}}for(ot=[],Ge=ne;Ge=Ge.parentNode;)Ge.nodeType===1&&ot.push({element:Ge,left:Ge.scrollLeft,top:Ge.scrollTop});for(typeof ne.focus=="function"&&ne.focus(),ne=0;nef?32:f,P.T=null,f=Qx,Qx=null;var k=ql,W=Ga;if(ro=0,gd=ql=null,Ga=0,(Fn&6)!==0)throw Error(r(331));var ne=Fn;if(Fn|=4,oj(k.current),tj(k,k.current,W,f),Fn=ne,_p(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(Ae,k)}catch{}return!0}finally{O.p=j,P.T=g,Cj(i,c)}}function _j(i,c,f){c=Gs(f,c),c=kx(i.stateNode,c,2),i=zl(i,c,2),i!==null&&(ft(i,2),sa(i))}function Yn(i,c,f){if(i.tag===3)_j(i,i,f);else for(;c!==null;){if(c.tag===3){_j(c,i,f);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Hl===null||!Hl.has(g))){i=Gs(f,i),f=TT(2),g=zl(c,f,2),g!==null&&(jT(f,g,c,i),ft(g,2),sa(g));break}}c=c.return}}function t0(i,c,f){var g=i.pingCache;if(g===null){g=i.pingCache=new z$;var j=new Set;g.set(c,j)}else j=g.get(c),j===void 0&&(j=new Set,g.set(c,j));j.has(f)||(Gx=!0,j.add(f),i=V$.bind(null,i,c,f),c.then(i,i))}function V$(i,c,f){var g=i.pingCache;g!==null&&g.delete(c),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,ar===i&&(kn&f)===f&&(Ar===4||Ar===3&&(kn&62914560)===kn&&300>_e()-ng?(Fn&2)===0&&bd(i,0):Yx|=f,hd===kn&&(hd=0)),sa(i)}function Tj(i,c){c===0&&(c=pt()),i=Nc(i,c),i!==null&&(ft(i,c),sa(i))}function H$(i){var c=i.memoizedState,f=0;c!==null&&(f=c.retryLane),Tj(i,f)}function q$(i,c){var f=0;switch(i.tag){case 31:case 13:var g=i.stateNode,j=i.memoizedState;j!==null&&(f=j.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),Tj(i,f)}function U$(i,c){return ie(i,c)}var cg=null,vd=null,n0=!1,ug=!1,r0=!1,Wl=0;function sa(i){i!==vd&&i.next===null&&(vd===null?cg=vd=i:vd=vd.next=i),ug=!0,n0||(n0=!0,G$())}function _p(i,c){if(!r0&&ug){r0=!0;do for(var f=!1,g=cg;g!==null;){if(i!==0){var j=g.pendingLanes;if(j===0)var k=0;else{var W=g.suspendedLanes,ne=g.pingedLanes;k=(1<<31-vt(42|i)+1)-1,k&=j&~(W&~ne),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(f=!0,Rj(g,k))}else k=kn,k=hn(g,g===ar?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||ct(g,k)||(f=!0,Rj(g,k));g=g.next}while(f);r0=!1}}function W$(){jj()}function jj(){ug=n0=!1;var i=0;Wl!==0&&r4()&&(i=Wl);for(var c=_e(),f=null,g=cg;g!==null;){var j=g.next,k=Ej(g,c);k===0?(g.next=null,f===null?cg=j:f.next=j,j===null&&(vd=f)):(f=g,(i!==0||(k&3)!==0)&&(ug=!0)),g=j}ro!==0&&ro!==5||_p(i),Wl!==0&&(Wl=0)}function Ej(i,c){for(var f=i.suspendedLanes,g=i.pingedLanes,j=i.expirationTimes,k=i.pendingLanes&-62914561;0ne)break;var Qe=Pe.transferSize,ot=Pe.initiatorType;Qe&&zj(ot)&&(Pe=Pe.responseEnd,W+=Qe*(Pe"u"?null:document;function Kj(i,c,f){var g=xd;if(g&&typeof c=="string"&&c){var j=_o(c);j='link[rel="'+i+'"][href="'+j+'"]',typeof f=="string"&&(j+='[crossorigin="'+f+'"]'),Yj.has(j)||(Yj.add(j),i={rel:i,crossOrigin:f,href:c},g.querySelector(j)===null&&(c=g.createElement("link"),vo(c,"link",i),Le(c),g.head.appendChild(c)))}}function f4(i){Ya.D(i),Kj("dns-prefetch",i,null)}function p4(i,c){Ya.C(i,c),Kj("preconnect",i,c)}function m4(i,c,f){Ya.L(i,c,f);var g=xd;if(g&&i&&c){var j='link[rel="preload"][as="'+_o(c)+'"]';c==="image"&&f&&f.imageSrcSet?(j+='[imagesrcset="'+_o(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(j+='[imagesizes="'+_o(f.imageSizes)+'"]')):j+='[href="'+_o(i)+'"]';var k=j;switch(c){case"style":k=Sd(i);break;case"script":k=Cd(i)}Js.has(k)||(i=b({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:i,as:c},f),Js.set(k,i),g.querySelector(j)!==null||c==="style"&&g.querySelector(Mp(k))||c==="script"&&g.querySelector(Rp(k))||(c=g.createElement("link"),vo(c,"link",i),Le(c),g.head.appendChild(c)))}}function h4(i,c){Ya.m(i,c);var f=xd;if(f&&i){var g=c&&typeof c.as=="string"?c.as:"script",j='link[rel="modulepreload"][as="'+_o(g)+'"][href="'+_o(i)+'"]',k=j;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=Cd(i)}if(!Js.has(k)&&(i=b({rel:"modulepreload",href:i},c),Js.set(k,i),f.querySelector(j)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Rp(k)))return}g=f.createElement("link"),vo(g,"link",i),Le(g),f.head.appendChild(g)}}}function g4(i,c,f){Ya.S(i,c,f);var g=xd;if(g&&i){var j=An(g).hoistableStyles,k=Sd(i);c=c||"default";var W=j.get(k);if(!W){var ne={loading:0,preload:null};if(W=g.querySelector(Mp(k)))ne.loading=5;else{i=b({rel:"stylesheet",href:i,"data-precedence":c},f),(f=Js.get(k))&&v0(i,f);var Pe=W=g.createElement("link");Le(Pe),vo(Pe,"link",i),Pe._p=new Promise(function(Ve,Qe){Pe.onload=Ve,Pe.onerror=Qe}),Pe.addEventListener("load",function(){ne.loading|=1}),Pe.addEventListener("error",function(){ne.loading|=2}),ne.loading|=4,hg(W,c,g)}W={type:"stylesheet",instance:W,count:1,state:ne},j.set(k,W)}}}function b4(i,c){Ya.X(i,c);var f=xd;if(f&&i){var g=An(f).hoistableScripts,j=Cd(i),k=g.get(j);k||(k=f.querySelector(Rp(j)),k||(i=b({src:i,async:!0},c),(c=Js.get(j))&&x0(i,c),k=f.createElement("script"),Le(k),vo(k,"link",i),f.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(j,k))}}function y4(i,c){Ya.M(i,c);var f=xd;if(f&&i){var g=An(f).hoistableScripts,j=Cd(i),k=g.get(j);k||(k=f.querySelector(Rp(j)),k||(i=b({src:i,async:!0,type:"module"},c),(c=Js.get(j))&&x0(i,c),k=f.createElement("script"),Le(k),vo(k,"link",i),f.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(j,k))}}function Xj(i,c,f,g){var j=(j=X.current)?mg(j):null;if(!j)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=Sd(f.href),f=An(j).hoistableStyles,g=f.get(c),g||(g={type:"style",instance:null,count:0,state:null},f.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=Sd(f.href);var k=An(j).hoistableStyles,W=k.get(i);if(W||(j=j.ownerDocument||j,W={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,W),(k=j.querySelector(Mp(i)))&&!k._p&&(W.instance=k,W.state.loading=5),Js.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Js.set(i,f),k||v4(j,i,f,W.state))),c&&g===null)throw Error(r(528,""));return W}if(c&&g!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Cd(f),f=An(j).hoistableScripts,g=f.get(c),g||(g={type:"script",instance:null,count:0,state:null},f.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Sd(i){return'href="'+_o(i)+'"'}function Mp(i){return'link[rel="stylesheet"]['+i+"]"}function Qj(i){return b({},i,{"data-precedence":i.precedence,precedence:null})}function v4(i,c,f,g){i.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=i.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),vo(c,"link",f),Le(c),i.head.appendChild(c))}function Cd(i){return'[src="'+_o(i)+'"]'}function Rp(i){return"script[async]"+i}function Zj(i,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var g=i.querySelector('style[data-href~="'+_o(f.href)+'"]');if(g)return c.instance=g,Le(g),g;var j=b({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Le(g),vo(g,"style",j),hg(g,f.precedence,i),c.instance=g;case"stylesheet":j=Sd(f.href);var k=i.querySelector(Mp(j));if(k)return c.state.loading|=4,c.instance=k,Le(k),k;g=Qj(f),(j=Js.get(j))&&v0(g,j),k=(i.ownerDocument||i).createElement("link"),Le(k);var W=k;return W._p=new Promise(function(ne,Pe){W.onload=ne,W.onerror=Pe}),vo(k,"link",g),c.state.loading|=4,hg(k,f.precedence,i),c.instance=k;case"script":return k=Cd(f.src),(j=i.querySelector(Rp(k)))?(c.instance=j,Le(j),j):(g=f,(j=Js.get(k))&&(g=b({},f),x0(g,j)),i=i.ownerDocument||i,j=i.createElement("script"),Le(j),vo(j,"link",g),i.head.appendChild(j),c.instance=j);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,hg(g,f.precedence,i));return c.instance}function hg(i,c,f){for(var g=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),j=g.length?g[g.length-1]:null,k=j,W=0;W title"):null)}function x4(i,c,f){if(f===1||c.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(i=c.disabled,typeof c.precedence=="string"&&i==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function tE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function S4(i,c,f,g){if(f.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var j=Sd(g.href),k=c.querySelector(Mp(j));if(k){c=k._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(i.count++,i=bg.bind(i),c.then(i,i)),f.state.loading|=4,f.instance=k,Le(k);return}k=c.ownerDocument||c,g=Qj(g),(j=Js.get(j))&&v0(g,j),k=k.createElement("link"),Le(k);var W=k;W._p=new Promise(function(ne,Pe){W.onload=ne,W.onerror=Pe}),vo(k,"link",g),f.instance=k}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(i.count++,f=bg.bind(i),c.addEventListener("load",f),c.addEventListener("error",f))}}var S0=0;function C4(i,c){return i.stylesheets&&i.count===0&&vg(i,i.stylesheets),0S0?50:800)+c);return i.unsuspend=f,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(j)}}:null}function bg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vg(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var yg=null;function vg(i,c){i.stylesheets=null,i.unsuspend!==null&&(i.count++,yg=new Map,c.forEach(w4,i),yg=null,bg.call(i))}function w4(i,c){if(!(c.state.loading&4)){var f=yg.get(i);if(f)var g=f.get(null);else{f=new Map,yg.set(i,f);for(var j=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$0.exports=L8(),$0.exports}var N8=z8();const $8=yi(N8);var CM="popstate";function F8(e={}){function t(r,o){let{pathname:s,search:l,hash:u}=r.location;return lS("",{pathname:s,search:l,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:_m(o)}return V8(t,n,null,e)}function jr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ca(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function B8(){return Math.random().toString(36).substring(2,10)}function wM(e,t){return{usr:e.state,key:e.key,idx:t}}function lS(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Lf(t):t,state:n,key:t&&t.key||r||B8()}}function _m({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Lf(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function V8(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,l=o.history,u="POP",d=null,p=m();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function m(){return(l.state||{idx:null}).idx}function b(){u="POP";let S=m(),w=S==null?null:S-p;p=S,d&&d({action:u,location:C.location,delta:w})}function y(S,w){u="PUSH";let _=lS(C.location,S,w);p=m()+1;let T=wM(_,p),M=C.createHref(_);try{l.pushState(T,"",M)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;o.location.assign(M)}s&&d&&d({action:u,location:C.location,delta:1})}function h(S,w){u="REPLACE";let _=lS(C.location,S,w);p=m();let T=wM(_,p),M=C.createHref(_);l.replaceState(T,"",M),s&&d&&d({action:u,location:C.location,delta:0})}function x(S){return H8(S)}let C={get action(){return u},get location(){return e(o,l)},listen(S){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(CM,b),d=S,()=>{o.removeEventListener(CM,b),d=null}},createHref(S){return t(o,S)},createURL:x,encodeLocation(S){let w=x(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:y,replace:h,go(S){return l.go(S)}};return C}function H8(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),jr(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:_m(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function jD(e,t,n="/"){return q8(e,t,n,!1)}function q8(e,t,n,r){let o=typeof t=="string"?Lf(t):t,s=ul(o.pathname||"/",n);if(s==null)return null;let l=ED(e);U8(l);let u=null;for(let d=0;u==null&&d{let m={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&d)return;jr(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let b=ll([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&(jr(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),ED(l.children,t,y,b,d)),!(l.path==null&&!l.index)&&t.push({path:b,score:Z8(b,l.index),routesMeta:y})};return e.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))s(l,u);else for(let d of MD(l.path))s(l,u,!0,d)}),t}function MD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let l=MD(r.join("/")),u=[];return u.push(...l.map(d=>d===""?s:[s,d].join("/"))),o&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function U8(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:J8(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var W8=/^:[\w-]+$/,G8=3,Y8=2,K8=1,X8=10,Q8=-2,_M=e=>e==="*";function Z8(e,t){let n=e.split("/"),r=n.length;return n.some(_M)&&(r+=Q8),t&&(r+=Y8),n.filter(o=>!_M(o)).reduce((o,s)=>o+(W8.test(s)?G8:s===""?K8:X8),r)}function J8(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function e9(e,t,n=!1){let{routesMeta:r}=e,o={},s="/",l=[];for(let u=0;u{if(m==="*"){let x=u[y]||"";l=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const h=u[y];return b&&!h?p[m]=void 0:p[m]=(h||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:e}}function t9(e,t=!1,n=!0){Ca(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function n9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ca(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ul(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var r9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function o9(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Lf(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=TM(n.substring(1),"/"):s=TM(n,t)):s=t,{pathname:s,search:a9(r),hash:l9(o)}}function TM(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function H0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function s9(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function RD(e){let t=s9(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function kD(e,t,n,r=!1){let o;typeof e=="string"?o=Lf(e):(o={...e},jr(!o.pathname||!o.pathname.includes("?"),H0("?","pathname","search",o)),jr(!o.pathname||!o.pathname.includes("#"),H0("#","pathname","hash",o)),jr(!o.search||!o.search.includes("#"),H0("#","search","hash",o)));let s=e===""||o.pathname==="",l=s?"/":o.pathname,u;if(l==null)u=n;else{let b=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),b-=1;o.pathname=y.join("/")}u=b>=0?t[b]:"/"}let d=o9(o,u),p=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||m)&&(d.pathname+="/"),d}var ll=e=>e.join("/").replace(/\/\/+/g,"/"),i9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),a9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,l9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,c9=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function u9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function d9(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var PD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AD(e,t){let n=e;if(typeof n!="string"||!r9.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(PD)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=ul(l.pathname,t);l.origin===s.origin&&u!=null?n=u+l.search+l.hash:o=!0}catch{Ca(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var DD=["POST","PUT","PATCH","DELETE"];new Set(DD);var f9=["GET",...DD];new Set(f9);var zf=v.createContext(null);zf.displayName="DataRouter";var Iy=v.createContext(null);Iy.displayName="DataRouterState";var p9=v.createContext(!1),OD=v.createContext({isTransitioning:!1});OD.displayName="ViewTransition";var m9=v.createContext(new Map);m9.displayName="Fetchers";var h9=v.createContext(null);h9.displayName="Await";var vi=v.createContext(null);vi.displayName="Navigation";var Km=v.createContext(null);Km.displayName="Location";var ja=v.createContext({outlet:null,matches:[],isDataRoute:!1});ja.displayName="Route";var IC=v.createContext(null);IC.displayName="RouteError";var ID="REACT_ROUTER_ERROR",g9="REDIRECT",b9="ROUTE_ERROR_RESPONSE";function y9(e){if(e.startsWith(`${ID}:${g9}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function v9(e){if(e.startsWith(`${ID}:${b9}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new c9(t.status,t.statusText,t.data)}catch{}}function x9(e,{relative:t}={}){jr(Xm(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=v.useContext(vi),{hash:o,pathname:s,search:l}=Qm(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:ll([n,s])),r.createHref({pathname:u,search:l,hash:o})}function Xm(){return v.useContext(Km)!=null}function xi(){return jr(Xm(),"useLocation() may be used only in the context of a component."),v.useContext(Km).location}var LD="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zD(e){v.useContext(vi).static||v.useLayoutEffect(e)}function Zr(){let{isDataRoute:e}=v.useContext(ja);return e?D9():S9()}function S9(){jr(Xm(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(zf),{basename:t,navigator:n}=v.useContext(vi),{matches:r}=v.useContext(ja),{pathname:o}=xi(),s=JSON.stringify(RD(r)),l=v.useRef(!1);return zD(()=>{l.current=!0}),v.useCallback((d,p={})=>{if(Ca(l.current,LD),!l.current)return;if(typeof d=="number"){n.go(d);return}let m=kD(d,JSON.parse(s),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ll([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,o,e])}v.createContext(null);function gl(){let{matches:e}=v.useContext(ja),t=e[e.length-1];return t?t.params:{}}function Qm(e,{relative:t}={}){let{matches:n}=v.useContext(ja),{pathname:r}=xi(),o=JSON.stringify(RD(n));return v.useMemo(()=>kD(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function C9(e,t){return ND(e,t)}function ND(e,t,n,r,o){jr(Xm(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=v.useContext(vi),{matches:l}=v.useContext(ja),u=l[l.length-1],d=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",b=u&&u.route;{let _=b&&b.path||"";FD(p,!b||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${p}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let y=vi(),h;if(t){let _=typeof t=="string"?Af(t):t;Cr(m==="/"||_.pathname?.startsWith(m),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${_.pathname}" was given in the \`location\` prop.`),h=_}else h=y;let x=h.pathname||"/",C=x;if(m!=="/"){let _=m.replace(/^\//,"").split("/");C="/"+x.replace(/^\//,"").split("/").slice(_.length).join("/")}let S=jD(e,{pathname:C});Ca(b||S!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Ca(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let w=E9(S&&S.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:ll([m,s.encodeLocation?s.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?m:ll([m,s.encodeLocation?s.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,n,r,o);return t&&w?v.createElement(Ym.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},w):w}function w9(){let e=A9(),t=u9(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:s},"ErrorBoundary")," or"," ",v.createElement("code",{style:s},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:o},n):null,l)}var _9=v.createElement(w9,null),$D=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=v9(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(ja.Provider,{value:this.props.routeContext},v.createElement(IC.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(T9,{error:e},t):t}};$D.contextType=p9;var q0=new WeakMap;function T9({children:e,error:t}){let{basename:n}=v.useContext(yi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=y9(t.digest);if(r){let o=q0.get(t);if(o)throw o;let s=AD(r.location,n);if(PD&&!q0.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw q0.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function j9({routeContext:e,match:t,children:n}){let r=v.useContext(Df);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(ja.Provider,{value:e},n)}function E9(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=n?.errors;if(l!=null){let m=s.findIndex(b=>b.route.id&&l?.[b.route.id]!==void 0);Cr(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let u=!1,d=-1;if(n)for(let m=0;m=0?s=s.slice(0,d+1):s=[s[0]];break}}}let p=n&&r?(m,b)=>{r(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:d9(n.matches),errorInfo:b})}:void 0;return s.reduceRight((m,b,y)=>{let h,x=!1,C=null,S=null;n&&(h=l&&b.route.id?l[b.route.id]:void 0,C=b.route.errorElement||_9,u&&(d<0&&y===0?(FD("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):d===y&&(x=!0,S=b.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,y+1)),_=()=>{let T;return h?T=C:x?T=S:b.route.Component?T=v.createElement(b.route.Component,null):b.route.element?T=b.route.element:T=m,v.createElement(j9,{match:b,routeContext:{outlet:m,matches:w,isDataRoute:n!=null},children:T})};return n&&(b.route.ErrorBoundary||b.route.errorElement||y===0)?v.createElement($D,{location:n.location,revalidation:n.revalidation,component:C,error:h,children:_(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:p}):_()},null)}function LC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function M9(e){let t=v.useContext(Df);return Cr(t,LC(e)),t}function R9(e){let t=v.useContext(Iy);return Cr(t,LC(e)),t}function k9(e){let t=v.useContext(ja);return Cr(t,LC(e)),t}function zC(e){let t=k9(e),n=t.matches[t.matches.length-1];return Cr(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function P9(){return zC("useRouteId")}function A9(){let e=v.useContext(IC),t=R9("useRouteError"),n=zC("useRouteError");return e!==void 0?e:t.errors?.[n]}function D9(){let{router:e}=M9("useNavigate"),t=zC("useNavigate"),n=v.useRef(!1);return zD(()=>{n.current=!0}),v.useCallback(async(o,s={})=>{Ca(n.current,LD),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var jM={};function FD(e,t,n){!t&&!jM[e]&&(jM[e]=!0,Ca(!1,n))}v.memo(O9);function O9({routes:e,future:t,state:n,onError:r}){return ND(e,void 0,n,r,t)}function xr(e){Cr(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function I9({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1,unstable_useTransitions:l}){Cr(!Km(),"You cannot render a inside another . You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:u,navigator:o,static:s,unstable_useTransitions:l,future:{}}),[u,o,s,l]);typeof n=="string"&&(n=Af(n));let{pathname:p="/",search:m="",hash:b="",state:y=null,key:h="default"}=n,x=v.useMemo(()=>{let C=ul(p,u);return C==null?null:{location:{pathname:C,search:m,hash:b,state:y,key:h},navigationType:r}},[u,p,m,b,y,h,r]);return Ca(x!=null,` is not able to match the URL "${p}${m}${b}" because it does not start with the basename, so the won't render anything.`),x==null?null:v.createElement(yi.Provider,{value:d},v.createElement(Ym.Provider,{children:t,value:x}))}function L9({children:e,location:t}){return C9(cS(e),t)}function cS(e,t=[]){let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let s=[...t,o];if(r.type===v.Fragment){n.push.apply(n,cS(r.props.children,s));return}Cr(r.type===xr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Cr(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=cS(r.props.children,s)),n.push(l)}),n}var Sb="get",Cb="application/x-www-form-urlencoded";function Ly(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function z9(e){return Ly(e)&&e.tagName.toLowerCase()==="button"}function N9(e){return Ly(e)&&e.tagName.toLowerCase()==="form"}function $9(e){return Ly(e)&&e.tagName.toLowerCase()==="input"}function F9(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function B9(e,t){return e.button===0&&(!t||t==="_self")&&!F9(e)}var kg=null;function V9(){if(kg===null)try{new FormData(document.createElement("form"),0),kg=!1}catch{kg=!0}return kg}var H9=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function U0(e){return e!=null&&!H9.has(e)?(Ca(!1,`"${e}" is not a valid \`encType\` for \`\`/\`\` and will default to "${Cb}"`),null):e}function q9(e,t){let n,r,o,s,l;if(N9(e)){let u=e.getAttribute("action");r=u?ul(u,t):null,n=e.getAttribute("method")||Sb,o=U0(e.getAttribute("enctype"))||Cb,s=new FormData(e)}else if(z9(e)||$9(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a + + + )} )} + !revokingESNcard && setRevokeESNcardConfirmOpen(false)} + maxWidth="xs" + fullWidth + > + Conferma Revoca ESNcard + + + Questa azione cancellerà la ESNcard e creerà una transazione di rimborso in tesoreria. + + + ESNcard: {latestESNcard?.number || "N/D"} + + + + + + + setDeleteConfirmOpen(false)} maxWidth="xs" fullWidth> Conferma Eliminazione diff --git a/frontend/src/data/transactionConfigs.js b/frontend/src/data/transactionConfigs.js index 5ab96b18f..454c914aa 100644 --- a/frontend/src/data/transactionConfigs.js +++ b/frontend/src/data/transactionConfigs.js @@ -7,6 +7,7 @@ export const TRANSACTION_CONFIGS = { withdrawal: {label: names.tran_type["withdrawal"], color: 'error'}, reimbursement: {label: names.tran_type["reimbursement"], color: 'info'}, cauzione: {label: names.tran_type["cauzione"], color: 'warning'}, + rimborso_esncard: {label: names.tran_type["rimborso_esncard"], color: 'default'}, rimborso_cauzione: {label: names.tran_type["rimborso_cauzione"], color: 'default'}, rimborso_quota: {label: names.tran_type["rimborso_quota"], color: 'default'}, service: {label: names.tran_type["service"], color: 'primary'}, diff --git a/frontend/src/utils/displayAttributes.jsx b/frontend/src/utils/displayAttributes.jsx index 2c2d3cc1c..a16ed62ff 100644 --- a/frontend/src/utils/displayAttributes.jsx +++ b/frontend/src/utils/displayAttributes.jsx @@ -65,6 +65,7 @@ export const transactionDisplayNames = { subscription: 'Iscrizione', cauzione: 'Cauzione', reimbursement: 'Richiesta Rimborso', + rimborso_esncard: 'Rimborso ESNcard', rimborso_cauzione: 'Rimborso Cauzione Evento', rimborso_quota: 'Rimborso Quota Evento', service: 'Acquisto Servizio', From 3eeeeb776f0346a1f59a5bdab6d64532feb95559 Mon Sep 17 00:00:00 2001 From: Moussa Gerges Date: Wed, 1 Apr 2026 17:56:22 +0200 Subject: [PATCH 7/9] Refactor EventPayment component to handle sold-out scenarios and improve error messaging; update maintenance notification polling interval to 5 minutes; replace build assets with new versions. --- .github/workflows/deploy-production.yml | 4 +- .../Project Documentation/03_EVENTS_MODULE.md | 20 +++- .../06_INTEGRATION_E2E.md | 13 ++- .../TEST_COVERAGE_REPORT.md | 7 +- backend/events/tests.py | 86 ++++++++++++++ backend/events/views.py | 110 +++++++++++++----- .../{index-CD2rGuOx.js => index-BMkv-w2E.js} | 8 +- frontend/build/index.html | 2 +- frontend/src/Pages/events/EventPayment.jsx | 73 +++++++----- .../src/utils/useMaintenanceNotification.js | 4 +- 10 files changed, 248 insertions(+), 79 deletions(-) rename frontend/build/assets/{index-CD2rGuOx.js => index-BMkv-w2E.js} (95%) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index ee4dabfb0..a9bf27b69 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -33,8 +33,8 @@ jobs: IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION" # Incrementa PATCH - MINOR - MAJOR - PATCH=$((PATCH + 1)) - MINOR=$((MINOR + 0)) + PATCH=$((PATCH + 0)) + MINOR=$((MINOR + 1)) MAJOR=$((MAJOR + 0)) # Nuova versione diff --git a/backend/Project Documentation/03_EVENTS_MODULE.md b/backend/Project Documentation/03_EVENTS_MODULE.md index d460f0cbb..084b11692 100644 --- a/backend/Project Documentation/03_EVENTS_MODULE.md +++ b/backend/Project Documentation/03_EVENTS_MODULE.md @@ -86,6 +86,11 @@ Base path: /backend/ - POST /subscription//process_payment/ - POST /sumup/webhook/ +Behavior notes: + +- `status` can expose a pre-payment block (`payment_blocked=true`, reason `sold_out`) when both Main and Waiting lists are full. +- `process_payment` returns `409` with `status=BLOCKED` and `error=sold_out` in the same condition. + ### 3.5 Organizer Utilities - GET /event//printable_liberatorie/ @@ -128,16 +133,18 @@ Additional rules: 1. load `fields` schema from `Event` 2. dynamic payload validation 3. optional file upload (field type `l`) to Drive -4. insertion into form list +4. insertion into form list (always, even when Main/Waiting are full) 5. confirmation email delivery -6. optional online checkout trigger +6. optional online checkout trigger (payment remains a separate step) ### 5.3 Online Payment Reconciliation -1. `process_payment` queries checkout status -2. webhook asynchronous server-to-server confirmation -3. idempotent transaction creation -4. subscription state alignment +1. pre-check on list capacity for subscriptions outside Main/Waiting +2. if Main and Waiting are both full: block payment with `409 BLOCKED` (`sold_out`) +3. otherwise `process_payment` queries checkout status +4. webhook asynchronous server-to-server confirmation +5. idempotent transaction creation +6. subscription state alignment ### 5.4 Unified Refund UI Flow (Single Icon) @@ -204,6 +211,7 @@ Invarianti: 6. form file upload and fallback error handling 7. unified reimbursement: coherent icon/checkbox disable logic and selection validation 8. partial reimbursement: per-item error messages and selective retry +9. form submit vs payment separation: form list insertion must stay allowed, payment blocked only on full Main+Waiting Test reference: `backend/events/tests.py`. diff --git a/backend/Project Documentation/06_INTEGRATION_E2E.md b/backend/Project Documentation/06_INTEGRATION_E2E.md index 783919303..23eb2e25f 100644 --- a/backend/Project Documentation/06_INTEGRATION_E2E.md +++ b/backend/Project Documentation/06_INTEGRATION_E2E.md @@ -63,15 +63,18 @@ Preconditions: Sequence: -1. formsubmit genera checkout_id -2. `process_payment` or webhook confirms `paid` status -3. create local transactions (fee/deposit/services) -4. payment-status alignment on subscription +1. formsubmit creates subscription in Form List and generates checkout_id +2. if Main and Waiting are both full, `status` reports `payment_blocked=true` (`sold_out`) +3. in the same sold-out condition, `process_payment` returns `409 BLOCKED` +4. otherwise `process_payment` or webhook confirms `paid` status +5. create local transactions (fee/deposit/services) +6. payment-status alignment on subscription Test oracles: - idempotency on duplicate webhooks - no double accounting +- form submit remains accepted even when payment is blocked by full Main+Waiting capacity ### 2.4 Scenario D - Reimbursements (fee/deposit/services) @@ -163,7 +166,7 @@ Minimum checklist for each release: 2. ESNer/Erasmus registration and verification 3. event creation + main lists 4. office subscription and public form -5. SumUp payment + idempotent webhook +5. SumUp payment + idempotent webhook + sold-out pre-payment block 6. fee/deposit/services reimbursements 7. ESNcard issue and revocation 8. transaction export diff --git a/backend/Project Documentation/TEST_COVERAGE_REPORT.md b/backend/Project Documentation/TEST_COVERAGE_REPORT.md index 63e1df2a7..e9f7cf053 100644 --- a/backend/Project Documentation/TEST_COVERAGE_REPORT.md +++ b/backend/Project Documentation/TEST_COVERAGE_REPORT.md @@ -1,6 +1,6 @@ # Test Coverage Report - ESN Polimi Management -Last update date: 2026-03-31 +Last update date: 2026-04-01 Scope: Django backend (users, profiles, events, treasury, content) ## 1. Quality Scope @@ -19,11 +19,11 @@ Methodology note: | backend/users/tests.py | 40 | | backend/users/test_integration.py | 14 | | backend/profiles/tests.py | 70 | -| backend/events/tests.py | 111 | +| backend/events/tests.py | 114 | | backend/treasury/tests.py | 83 | | backend/content/tests.py | 43 | | backend/test_integration_e2e.py | 6 | -| Total | 367 | +| Total | 370 | ## 3. Functional Coverage Matrix @@ -49,6 +49,7 @@ Methodology note: - dynamic field schema and additional fields - optional services with pricing - SumUp flows (checkout/process/webhook) +- sold-out handling: form submission stays allowed in Form List, payment blocked only when Main+Waiting are full - shared lists and move subscriptions - waivers and organizer utilities diff --git a/backend/events/tests.py b/backend/events/tests.py index 4291c3859..e68696a4c 100644 --- a/backend/events/tests.py +++ b/backend/events/tests.py @@ -809,6 +809,34 @@ def test_event_form_submit_success(self): self.assertTrue(response.data["success"]) self.assertTrue(Subscription.objects.filter(profile=profile, event=event).exists()) + @override_settings(EMAIL_BACKEND="django.core.mail.backends.locmem.EmailBackend") + @patch("events.views.create_sumup_checkout", return_value=("chk_form_full_lists", {})) + def test_event_form_submit_online_payment_allows_form_list_when_main_waiting_full(self, _): + """Form submission must stay allowed even when Main/Waiting are full; payment remains a separate step.""" + event = _create_event(enable_form=True, allow_online_payment=True, cost=10) + form_list = _create_event_list(event, name="Form List", is_main_list=False, is_waiting_list=False) + main_list = _create_event_list(event, name="Main List", capacity=1, is_main_list=True, is_waiting_list=False) + waiting_list = _create_event_list(event, name="Waiting List", capacity=1, is_main_list=False, is_waiting_list=True) + + Subscription.objects.create(profile=_create_profile("main_full_form_submit@esnpolimi.it"), event=event, list=main_list) + Subscription.objects.create(profile=_create_profile("wait_full_form_submit@esnpolimi.it"), event=event, list=waiting_list) + + profile = _create_profile("form_only_submitter@esnpolimi.it") + + response = self.client.post(f"/backend/event/{event.pk}/formsubmit/", { + "email": profile.email, + "form_data": {}, + }, format="json") + + self.assertEqual(response.status_code, 200) + self.assertTrue(response.data["success"]) + self.assertEqual(response.data["assigned_list"], "Form List") + self.assertTrue(response.data["payment_required"]) + + sub = Subscription.objects.get(profile=profile, event=event) + self.assertEqual(sub.list, form_list) + self.assertEqual(sub.sumup_checkout_id, "chk_form_full_lists") + @override_settings(EMAIL_BACKEND="django.core.mail.backends.locmem.EmailBackend") def test_event_form_submit_invalid_email(self): """Invalid email should return 400.""" @@ -1518,6 +1546,33 @@ def test_payment_status_failed_flag(self): self.assertEqual(response.status_code, 200) self.assertEqual(response.data["overall_status"], "failed") + def test_payment_status_reports_blocked_when_lists_full(self): + """Status should report payment as blocked when both Main and Waiting lists are full.""" + profile = _create_profile("blockedpayer@esnpolimi.it") + _create_user(profile) + + event = _create_event(cost=10, allow_online_payment=True) + form_list = _create_event_list(event, name="Form List", is_main_list=False, is_waiting_list=False) + main_list = _create_event_list(event, name="Main List", capacity=1, is_main_list=True, is_waiting_list=False) + waiting_list = _create_event_list(event, name="Waiting List", capacity=1, is_main_list=False, is_waiting_list=True) + + Subscription.objects.create(profile=_create_profile("ml-status@esnpolimi.it"), event=event, list=main_list) + Subscription.objects.create(profile=_create_profile("wl-status@esnpolimi.it"), event=event, list=waiting_list) + + sub = Subscription.objects.create( + profile=profile, + event=event, + list=form_list, + sumup_checkout_id="chk_blocked_status", + ) + + response = self.client.get(f"/backend/subscription/{sub.pk}/status/") + + self.assertEqual(response.status_code, 200) + self.assertTrue(response.data["payment_blocked"]) + self.assertEqual(response.data["payment_blocked_reason"], "sold_out") + self.assertIn("sold out", response.data["payment_blocked_message"].lower()) + class SumUpWebhookEdgeCaseTests(EventsBaseTestCase): """Additional SumUp webhook edge cases.""" @@ -1585,6 +1640,37 @@ def test_subscription_process_payment_success(self, mock_ensure, mock_process): self.assertEqual(response.data["status"], "PAID") mock_ensure.assert_called_once() + @patch("events.views._process_sumup_checkout") + @patch("events.views._ensure_sumup_transactions") + def test_subscription_process_payment_blocked_when_lists_full(self, mock_ensure, mock_process): + """Process payment should be blocked when both Main and Waiting lists are full.""" + profile = _create_profile("formpayer@esnpolimi.it") + _create_user(profile) + + event = _create_event(cost=10, allow_online_payment=True) + form_list = _create_event_list(event, name="Form List", is_main_list=False, is_waiting_list=False) + main_list = _create_event_list(event, name="Main List", capacity=1, is_main_list=True, is_waiting_list=False) + waiting_list = _create_event_list(event, name="Waiting List", capacity=1, is_main_list=False, is_waiting_list=True) + + Subscription.objects.create(profile=_create_profile("ml-full@esnpolimi.it"), event=event, list=main_list) + Subscription.objects.create(profile=_create_profile("wl-full@esnpolimi.it"), event=event, list=waiting_list) + + sub = Subscription.objects.create( + profile=profile, + event=event, + list=form_list, + sumup_checkout_id="chk_blocked", + ) + + response = self.client.post(f"/backend/subscription/{sub.pk}/process_payment/", {}, format="json") + + self.assertEqual(response.status_code, 409) + self.assertEqual(response.data["status"], "BLOCKED") + self.assertEqual(response.data["error"], "sold_out") + self.assertIn("sold out", response.data["message"].lower()) + mock_process.assert_not_called() + mock_ensure.assert_not_called() + class EventModelTests(EventsBaseTestCase): """Tests for Event model properties and methods.""" diff --git a/backend/events/views.py b/backend/events/views.py index c7a98ebf6..431381660 100644 --- a/backend/events/views.py +++ b/backend/events/views.py @@ -46,6 +46,11 @@ logger = logging.getLogger(__name__) +PAYMENT_SOLD_OUT_MESSAGE = ( + "All spots are currently sold out. " + "Please wait for a notification from the ESN team." +) + # --- Allowed file types for 'link' form fields (mirrors treasury) --- FORM_UPLOAD_ALLOWED_MIMETYPES = [ 'application/pdf', @@ -290,6 +295,39 @@ def _services_total(selected_services): return total +def _list_has_space(target_list): + if not target_list: + return False + if target_list.capacity == 0: + return True + return target_list.subscription_count < target_list.capacity + + +def _get_main_waiting_lists(event): + lists_qs = event.lists.all() + main_list = lists_qs.filter(is_main_list=True).first() + waiting_list = lists_qs.filter(is_waiting_list=True).first() + return main_list, waiting_list + + +def _is_payment_blocked_by_full_lists(subscription): + """ + True when subscription is outside Main/Waiting and there is no space in both Main and Waiting. + Missing waiting list is treated as full. + """ + if not subscription or not subscription.event: + return False + + current_list = subscription.list + if current_list and (current_list.is_main_list or current_list.is_waiting_list): + return False + + main_list, waiting_list = _get_main_waiting_lists(subscription.event) + main_full = not _list_has_space(main_list) + waiting_full = not _list_has_space(waiting_list) if waiting_list else True + return main_full and waiting_full + + # --- Helper to auto-move from any non-ML/WL to ML/WL after payment --- def attempt_move_from_form_list(subscription): """ @@ -326,19 +364,10 @@ def attempt_move_from_form_list(subscription): if not paid_flag: return {'status': 'stayed', 'reason': 'not_paid'} - lists_qs = event.lists.all() - main_list = lists_qs.filter(is_main_list=True).first() - waiting_list = lists_qs.filter(is_waiting_list=True).first() - - def has_space(target): - if not target: - return False - if target.capacity == 0: - return True - return target.subscriptions.count() < target.capacity + main_list, waiting_list = _get_main_waiting_lists(event) for target in [main_list, waiting_list]: - if has_space(target): + if _list_has_space(target): subscription.list = target subscription.save(update_fields=['list']) return {'status': 'moved', 'list': target.name} @@ -443,7 +472,9 @@ def _send_form_subscription_email(subscription, assigned_label, online_payment_r return event = subscription.event - waiting = 'wait' in (assigned_label or '').lower() + assigned_label_lower = (assigned_label or '').lower() + waiting = 'wait' in assigned_label_lower + main_available = 'main' in assigned_label_lower notify_lists = getattr(event, 'notify_list', True) subject = f"{event.name} - Subscription received" html_parts = [ @@ -460,7 +491,7 @@ def _send_form_subscription_email(subscription, assigned_label, online_payment_r if notify_lists: if waiting: html_parts.append("

Spots are only available in the Waiting List at the moment.

") - else: + elif main_available: html_parts.append("

Spots are available in the Main List at the moment.

") html_parts.append( "

Use the link below to complete your payment:
" @@ -2068,25 +2099,17 @@ def event_form_submit(request, event_id): assigned_label = '' - # Determine available list for only online payments (main, else waiting) + # Compute availability hint for payment email/UI. + # Subscription is always created in Form List and is never rejected here due to Main/Waiting capacity. if online_payment_required: - event_lists = EventList.objects.filter(events=event) - main_list = event_lists.filter(is_main_list=True).first() - waiting_list = event_lists.filter(is_waiting_list=True).first() - - def has_space(lst): - if not lst: - return False - if lst.capacity == 0: - return True - return lst.subscription_count < lst.capacity + main_list, waiting_list = _get_main_waiting_lists(event) - if has_space(main_list): + if _list_has_space(main_list): assigned_label = "Main List" - elif has_space(waiting_list): + elif _list_has_space(waiting_list): assigned_label = "Waiting List" else: - return Response({"error": "No available spot for subscription. All lists are full."}, status=400) + assigned_label = "Form List" _send_form_subscription_email(sub, assigned_label, online_payment_required, payment_required) @@ -2140,6 +2163,14 @@ def subscription_payment_status(_, pk): else: overall = 'none' + payment_required = cost_needed or dep_needed or services_needed + payment_blocked = bool( + sub.event.allow_online_payment + and payment_required + and not _subscription_payment_already_registered(sub) + and _is_payment_blocked_by_full_lists(sub) + ) + return Response({ "subscription_id": sub.pk, "overall_status": overall, @@ -2148,6 +2179,9 @@ def subscription_payment_status(_, pk): "services_status": services_status, "sumup_checkout_id": sub.sumup_checkout_id, "sumup_transaction_id": sub.sumup_transaction_id, + "payment_blocked": payment_blocked, + "payment_blocked_reason": "sold_out" if payment_blocked else None, + "payment_blocked_message": PAYMENT_SOLD_OUT_MESSAGE if payment_blocked else "", }, status=200) @@ -2162,6 +2196,28 @@ def subscription_process_payment(request, pk): except Subscription.DoesNotExist: return Response({"error": "Subscription not found"}, status=404) + event = sub.event + has_payable_amount = bool( + Decimal(event.cost or 0) > 0 + or Decimal(event.deposit or 0) > 0 + or _services_total(sub.selected_services or []) > 0 + ) + should_block_payment = bool( + event.allow_online_payment + and has_payable_amount + and not _subscription_payment_already_registered(sub) + and _is_payment_blocked_by_full_lists(sub) + ) + if should_block_payment: + return Response( + { + "status": "BLOCKED", + "error": "sold_out", + "message": PAYMENT_SOLD_OUT_MESSAGE, + }, + status=409, + ) + payload = request.data or {} widget_payload = payload.get('widget_payload') or {} diff --git a/frontend/build/assets/index-CD2rGuOx.js b/frontend/build/assets/index-BMkv-w2E.js similarity index 95% rename from frontend/build/assets/index-CD2rGuOx.js rename to frontend/build/assets/index-BMkv-w2E.js index 3f5764b30..63e947ead 100644 --- a/frontend/build/assets/index-CD2rGuOx.js +++ b/frontend/build/assets/index-BMkv-w2E.js @@ -1,4 +1,4 @@ -var A4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G1e=A4((ks,Ps)=>{function D4(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M0={exports:{}},Op={};var hE;function O4(){if(hE)return Op;hE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Op.Fragment=t,Op.jsx=n,Op.jsxs=n,Op}var gE;function I4(){return gE||(gE=1,M0.exports=O4()),M0.exports}var a=I4();const bn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Zn=globalThis,uu="10.36.0";function Ey(){return My(Zn),Zn}function My(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||uu,t[uu]=t[uu]||{}}function Pf(e,t,n=Zn){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[uu]=r[uu]||{};return o[e]||(o[e]=t())}const L4=["debug","info","warn","error","log","assert","trace"],z4="Sentry Logger ",Gb={};function Af(e){if(!("console"in Zn))return e();const t=Zn.console,n={},r=Object.keys(Gb);r.forEach(o=>{const s=Gb[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function N4(){vC().enabled=!0}function $4(){vC().enabled=!1}function PA(){return vC().enabled}function F4(...e){yC("log",...e)}function B4(...e){yC("warn",...e)}function V4(...e){yC("error",...e)}function yC(e,...t){bn&&PA()&&Af(()=>{Zn.console[e](`${z4}[${e}]:`,...t)})}function vC(){return bn?Pf("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const tn={enable:N4,disable:$4,isEnabled:PA,log:F4,warn:B4,error:V4},AA=50,mu="?",bE=/\(error: (.*)\)/,yE=/captureMessage|captureException/;function DA(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],l=n.split(` +var A4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Y1e=A4((ks,Ps)=>{function D4(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M0={exports:{}},Op={};var hE;function O4(){if(hE)return Op;hE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:s}}return Op.Fragment=t,Op.jsx=n,Op.jsxs=n,Op}var gE;function I4(){return gE||(gE=1,M0.exports=O4()),M0.exports}var a=I4();const bn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Zn=globalThis,uu="10.36.0";function Ey(){return My(Zn),Zn}function My(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||uu,t[uu]=t[uu]||{}}function Pf(e,t,n=Zn){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[uu]=r[uu]||{};return o[e]||(o[e]=t())}const L4=["debug","info","warn","error","log","assert","trace"],z4="Sentry Logger ",Gb={};function Af(e){if(!("console"in Zn))return e();const t=Zn.console,n={},r=Object.keys(Gb);r.forEach(o=>{const s=Gb[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function N4(){vC().enabled=!0}function $4(){vC().enabled=!1}function PA(){return vC().enabled}function F4(...e){yC("log",...e)}function B4(...e){yC("warn",...e)}function V4(...e){yC("error",...e)}function yC(e,...t){bn&&PA()&&Af(()=>{Zn.console[e](`${z4}[${e}]:`,...t)})}function vC(){return bn?Pf("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const tn={enable:N4,disable:$4,isEnabled:PA,log:F4,warn:B4,error:V4},AA=50,mu="?",bE=/\(error: (.*)\)/,yE=/captureMessage|captureException/;function DA(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],l=n.split(` `);for(let u=r;u1024&&(d=d.slice(0,1024));const p=bE.test(d)?d.replace(bE,"$1"):d;if(!p.match(/\S*Error: /)){for(const m of t){const b=m(p);if(b){s.push(b);break}}if(s.length>=AA+o)break}}return q4(s.slice(o))}}function H4(e){return Array.isArray(e)?DA(...e):e}function q4(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Eg(t).function||"")&&t.pop(),t.reverse(),yE.test(Eg(t).function||"")&&(t.pop(),yE.test(Eg(t).function||"")&&t.pop()),t.slice(0,AA).map(n=>({...n,filename:n.filename||Eg(t).filename,function:n.function||mu}))}function Eg(e){return e[e.length-1]||{}}const R0="";function pc(e){try{return!e||typeof e!="function"?R0:e.name||R0}catch{return R0}}function vE(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function OA(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const gb={},xE={};function Ru(e,t){gb[e]=gb[e]||[],gb[e].push(t)}function ku(e,t){if(!xE[e]){xE[e]=!0;try{t()}catch(n){bn&&tn.error(`Error while instrumenting ${e}`,n)}}}function Fi(e,t){const n=e&&gb[e];if(n)for(const r of n)try{r(t)}catch(o){bn&&tn.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${pc(r)} @@ -22,7 +22,7 @@ Error generating stack: `+g.message+` `+g.stack}}var de=Object.prototype.hasOwnProperty,ie=e.unstable_scheduleCallback,xe=e.unstable_cancelCallback,se=e.unstable_shouldYield,fe=e.unstable_requestPaint,_e=e.unstable_now,Te=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Me=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,we=e.unstable_LowPriority,ve=e.unstable_IdlePriority,Oe=e.log,Ue=e.unstable_setDisableYieldValue,Ae=null,ze=null;function at(i){if(typeof Oe=="function"&&Ue(i),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(Ae,i)}catch{}}var vt=Math.clz32?Math.clz32:Rt,Fe=Math.log,xt=Math.LN2;function Rt(i){return i>>>=0,i===0?32:31-(Fe(i)/xt|0)|0}var Zt=256,yn=262144,At=4194304;function Dt(i){var c=i&42;if(c!==0)return c;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function hn(i,c,f){var g=i.pendingLanes;if(g===0)return 0;var j=0,k=i.suspendedLanes,W=i.pingedLanes;i=i.warmLanes;var ne=g&134217727;return ne!==0?(g=ne&~k,g!==0?j=Dt(g):(W&=ne,W!==0?j=Dt(W):f||(f=ne&~i,f!==0&&(j=Dt(f))))):(ne=g&~k,ne!==0?j=Dt(ne):W!==0?j=Dt(W):f||(f=g&~i,f!==0&&(j=Dt(f)))),j===0?0:c!==0&&c!==j&&(c&k)===0&&(k=j&-j,f=c&-c,k>=f||k===32&&(f&4194048)!==0)?c:j}function ct(i,c){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&c)===0}function kt(i,c){switch(i){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pt(){var i=At;return At<<=1,(At&62914560)===0&&(At=4194304),i}function Lt(i){for(var c=[],f=0;31>f;f++)c.push(i);return c}function ft(i,c){i.pendingLanes|=c,c!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Tt(i,c,f,g,j,k){var W=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var ne=i.entanglements,Pe=i.expirationTimes,Ve=i.hiddenUpdates;for(f=W&~f;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Yf=/[\n"\\]/g;function _o(i){return i.replace(Yf,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Dc(i,c,f,g,j,k,W,ne){i.name="",W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.type=W:i.removeAttribute("type"),c!=null?W==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+Jr(c)):i.value!==""+Jr(c)&&(i.value=""+Jr(c)):W!=="submit"&&W!=="reset"||i.removeAttribute("value"),c!=null?Oc(i,W,Jr(c)):f!=null?Oc(i,W,Jr(f)):g!=null&&i.removeAttribute("value"),j==null&&k!=null&&(i.defaultChecked=!!k),j!=null&&(i.checked=j&&typeof j!="function"&&typeof j!="symbol"),ne!=null&&typeof ne!="function"&&typeof ne!="symbol"&&typeof ne!="boolean"?i.name=""+Jr(ne):i.removeAttribute("name")}function Tl(i,c,f,g,j,k,W,ne){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.type=k),c!=null||f!=null){if(!(k!=="submit"&&k!=="reset"||c!=null)){wl(i);return}f=f!=null?""+Jr(f):"",c=c!=null?""+Jr(c):f,ne||c===i.value||(i.value=c),i.defaultValue=c}g=g??j,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=ne?i.checked:!!g,i.defaultChecked=!!g,W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"&&(i.name=W),wl(i)}function Oc(i,c,f){c==="number"&&_l(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function Qi(i,c,f,g){if(i=i.options,c){c={};for(var j=0;j"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rl=!1;if(Lo)try{var jo={};Object.defineProperty(jo,"passive",{get:function(){Rl=!0}}),window.addEventListener("test",jo,jo),window.removeEventListener("test",jo,jo)}catch{Rl=!1}var ms=null,Aa=null,kl=null;function Wu(){if(kl)return kl;var i,c=Aa,f=c.length,g,j="value"in ms?ms.value:ms.textContent,k=j.length;for(i=0;i=Qf),U_=" ",W_=!1;function G_(i,c){switch(i){case"keyup":return e$.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Y_(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ku=!1;function n$(i,c){switch(i){case"compositionend":return Y_(c);case"keypress":return c.which!==32?null:(W_=!0,U_);case"textInput":return i=c.data,i===U_&&W_?null:i;default:return null}}function r$(i,c){if(Ku)return i==="compositionend"||!Ov&&G_(i,c)?(i=Wu(),kl=Aa=ms=null,Ku=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:f,offset:c-i};i=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=n2(f)}}function o2(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?o2(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function s2(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var c=_l(i.document);c instanceof i.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)i=c.contentWindow;else break;c=_l(i.document)}return c}function zv(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}var d$=Lo&&"documentMode"in document&&11>=document.documentMode,Xu=null,Nv=null,tp=null,$v=!1;function i2(i,c,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;$v||Xu==null||Xu!==_l(g)||(g=Xu,"selectionStart"in g&&zv(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),tp&&ep(tp,g)||(tp=g,g=fg(Nv,"onSelect"),0>=W,j-=W,na=1<<32-vt(c)+j|f<vn?(Pn=$t,$t=null):Pn=$t.sibling;var Nn=He(Ne,$t,Be[vn],Je);if(Nn===null){$t===null&&($t=Pn);break}i&&$t&&Nn.alternate===null&&c(Ne,$t),Ie=k(Nn,Ie,vn),zn===null?Wt=Nn:zn.sibling=Nn,zn=Nn,$t=Pn}if(vn===Be.length)return f(Ne,$t),On&&Ia(Ne,vn),Wt;if($t===null){for(;vnvn?(Pn=$t,$t=null):Pn=$t.sibling;var Zl=He(Ne,$t,Nn.value,Je);if(Zl===null){$t===null&&($t=Pn);break}i&&$t&&Zl.alternate===null&&c(Ne,$t),Ie=k(Zl,Ie,vn),zn===null?Wt=Zl:zn.sibling=Zl,zn=Zl,$t=Pn}if(Nn.done)return f(Ne,$t),On&&Ia(Ne,vn),Wt;if($t===null){for(;!Nn.done;vn++,Nn=Be.next())Nn=ot(Ne,Nn.value,Je),Nn!==null&&(Ie=k(Nn,Ie,vn),zn===null?Wt=Nn:zn.sibling=Nn,zn=Nn);return On&&Ia(Ne,vn),Wt}for($t=g($t);!Nn.done;vn++,Nn=Be.next())Nn=Ge($t,Ne,vn,Nn.value,Je),Nn!==null&&(i&&Nn.alternate!==null&&$t.delete(Nn.key===null?vn:Nn.key),Ie=k(Nn,Ie,vn),zn===null?Wt=Nn:zn.sibling=Nn,zn=Nn);return i&&$t.forEach(function(P4){return c(Ne,P4)}),On&&Ia(Ne,vn),Wt}function rr(Ne,Ie,Be,Je){if(typeof Be=="object"&&Be!==null&&Be.type===C&&Be.key===null&&(Be=Be.props.children),typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case h:e:{for(var Wt=Be.key;Ie!==null;){if(Ie.key===Wt){if(Wt=Be.type,Wt===C){if(Ie.tag===7){f(Ne,Ie.sibling),Je=j(Ie,Be.props.children),Je.return=Ne,Ne=Je;break e}}else if(Ie.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===D&&qc(Wt)===Ie.type){f(Ne,Ie.sibling),Je=j(Ie,Be.props),ap(Je,Be),Je.return=Ne,Ne=Je;break e}f(Ne,Ie);break}else c(Ne,Ie);Ie=Ie.sibling}Be.type===C?(Je=$c(Be.props.children,Ne.mode,Je,Be.key),Je.return=Ne,Ne=Je):(Je=Rh(Be.type,Be.key,Be.props,null,Ne.mode,Je),ap(Je,Be),Je.return=Ne,Ne=Je)}return W(Ne);case x:e:{for(Wt=Be.key;Ie!==null;){if(Ie.key===Wt)if(Ie.tag===4&&Ie.stateNode.containerInfo===Be.containerInfo&&Ie.stateNode.implementation===Be.implementation){f(Ne,Ie.sibling),Je=j(Ie,Be.children||[]),Je.return=Ne,Ne=Je;break e}else{f(Ne,Ie);break}else c(Ne,Ie);Ie=Ie.sibling}Je=Wv(Be,Ne.mode,Je),Je.return=Ne,Ne=Je}return W(Ne);case D:return Be=qc(Be),rr(Ne,Ie,Be,Je)}if(z(Be))return Ot(Ne,Ie,Be,Je);if(E(Be)){if(Wt=E(Be),typeof Wt!="function")throw Error(r(150));return Be=Wt.call(Be),en(Ne,Ie,Be,Je)}if(typeof Be.then=="function")return rr(Ne,Ie,Lh(Be),Je);if(Be.$$typeof===T)return rr(Ne,Ie,Ah(Ne,Be),Je);zh(Ne,Be)}return typeof Be=="string"&&Be!==""||typeof Be=="number"||typeof Be=="bigint"?(Be=""+Be,Ie!==null&&Ie.tag===6?(f(Ne,Ie.sibling),Je=j(Ie,Be),Je.return=Ne,Ne=Je):(f(Ne,Ie),Je=Uv(Be,Ne.mode,Je),Je.return=Ne,Ne=Je),W(Ne)):f(Ne,Ie)}return function(Ne,Ie,Be,Je){try{ip=0;var Wt=rr(Ne,Ie,Be,Je);return ad=null,Wt}catch($t){if($t===id||$t===Oh)throw $t;var zn=bs(29,$t,null,Ne.mode);return zn.lanes=Je,zn.return=Ne,zn}}}var Wc=R2(!0),k2=R2(!1),Il=!1;function ox(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sx(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ll(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function zl(i,c,f){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(Fn&2)!==0){var j=g.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),g.pending=c,c=Mh(i),p2(i,null,f),c}return Eh(i,g,c,f),Mh(i)}function lp(i,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var g=c.lanes;g&=i.pendingLanes,f|=g,c.lanes=f,rn(i,f)}}function ix(i,c){var f=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var j=null,k=null;if(f=f.firstBaseUpdate,f!==null){do{var W={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};k===null?j=k=W:k=k.next=W,f=f.next}while(f!==null);k===null?j=k=c:k=k.next=c}else j=k=c;f={baseState:g.baseState,firstBaseUpdate:j,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=c:i.next=c,f.lastBaseUpdate=c}var ax=!1;function cp(){if(ax){var i=sd;if(i!==null)throw i}}function up(i,c,f,g){ax=!1;var j=i.updateQueue;Il=!1;var k=j.firstBaseUpdate,W=j.lastBaseUpdate,ne=j.shared.pending;if(ne!==null){j.shared.pending=null;var Pe=ne,Ve=Pe.next;Pe.next=null,W===null?k=Ve:W.next=Ve,W=Pe;var Qe=i.alternate;Qe!==null&&(Qe=Qe.updateQueue,ne=Qe.lastBaseUpdate,ne!==W&&(ne===null?Qe.firstBaseUpdate=Ve:ne.next=Ve,Qe.lastBaseUpdate=Pe))}if(k!==null){var ot=j.baseState;W=0,Qe=Ve=Pe=null,ne=k;do{var He=ne.lane&-536870913,Ge=He!==ne.lane;if(Ge?(kn&He)===He:(g&He)===He){He!==0&&He===od&&(ax=!0),Qe!==null&&(Qe=Qe.next={lane:0,tag:ne.tag,payload:ne.payload,callback:null,next:null});e:{var Ot=i,en=ne;He=c;var rr=f;switch(en.tag){case 1:if(Ot=en.payload,typeof Ot=="function"){ot=Ot.call(rr,ot,He);break e}ot=Ot;break e;case 3:Ot.flags=Ot.flags&-65537|128;case 0:if(Ot=en.payload,He=typeof Ot=="function"?Ot.call(rr,ot,He):Ot,He==null)break e;ot=b({},ot,He);break e;case 2:Il=!0}}He=ne.callback,He!==null&&(i.flags|=64,Ge&&(i.flags|=8192),Ge=j.callbacks,Ge===null?j.callbacks=[He]:Ge.push(He))}else Ge={lane:He,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Qe===null?(Ve=Qe=Ge,Pe=ot):Qe=Qe.next=Ge,W|=He;if(ne=ne.next,ne===null){if(ne=j.shared.pending,ne===null)break;Ge=ne,ne=Ge.next,Ge.next=null,j.lastBaseUpdate=Ge,j.shared.pending=null}}while(!0);Qe===null&&(Pe=ot),j.baseState=Pe,j.firstBaseUpdate=Ve,j.lastBaseUpdate=Qe,k===null&&(j.shared.lanes=0),Vl|=W,i.lanes=W,i.memoizedState=ot}}function P2(i,c){if(typeof i!="function")throw Error(r(191,i));i.call(c)}function A2(i,c){var f=i.callbacks;if(f!==null)for(i.callbacks=null,i=0;ik?k:8;var W=P.T,ne={};P.T=ne,jx(i,!1,c,f);try{var Pe=j(),Ve=P.S;if(Ve!==null&&Ve(ne,Pe),Pe!==null&&typeof Pe=="object"&&typeof Pe.then=="function"){var Qe=x$(Pe,g);pp(i,c,Qe,Cs(i))}else pp(i,c,g,Cs(i))}catch(ot){pp(i,c,{then:function(){},status:"rejected",reason:ot},Cs())}finally{O.p=k,W!==null&&ne.types!==null&&(W.types=ne.types),P.T=W}}function j$(){}function _x(i,c,f,g){if(i.tag!==5)throw Error(r(476));var j=uT(i).queue;cT(i,j,c,V,f===null?j$:function(){return dT(i),f(g)})}function uT(i){var c=i.memoizedState;if(c!==null)return c;c={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:V},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:f},next:null},i.memoizedState=c,i=i.alternate,i!==null&&(i.memoizedState=c),c}function dT(i){var c=uT(i);c.next===null&&(c=i.alternate.memoizedState),pp(i,c.next.queue,{},Cs())}function Tx(){return bo(kp)}function fT(){return Br().memoizedState}function pT(){return Br().memoizedState}function E$(i){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var f=Cs();i=Ll(f);var g=zl(c,i,f);g!==null&&(Jo(g,c,f),lp(g,c,f)),c={cache:ex()},i.payload=c;return}c=c.return}}function M$(i,c,f){var g=Cs();f={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Gh(i)?hT(c,f):(f=Hv(i,c,f,g),f!==null&&(Jo(f,i,g),gT(f,c,g)))}function mT(i,c,f){var g=Cs();pp(i,c,f,g)}function pp(i,c,f,g){var j={lane:g,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Gh(i))hT(c,j);else{var k=i.alternate;if(i.lanes===0&&(k===null||k.lanes===0)&&(k=c.lastRenderedReducer,k!==null))try{var W=c.lastRenderedState,ne=k(W,f);if(j.hasEagerState=!0,j.eagerState=ne,gs(ne,W))return Eh(i,c,j,0),ar===null&&jh(),!1}catch{}if(f=Hv(i,c,j,g),f!==null)return Jo(f,i,g),gT(f,c,g),!0}return!1}function jx(i,c,f,g){if(g={lane:2,revertLane:o0(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Gh(i)){if(c)throw Error(r(479))}else c=Hv(i,f,g,2),c!==null&&Jo(c,i,2)}function Gh(i){var c=i.alternate;return i===gn||c!==null&&c===gn}function hT(i,c){cd=Fh=!0;var f=i.pending;f===null?c.next=c:(c.next=f.next,f.next=c),i.pending=c}function gT(i,c,f){if((f&4194048)!==0){var g=c.lanes;g&=i.pendingLanes,f|=g,c.lanes=f,rn(i,f)}}var mp={readContext:bo,use:Hh,useCallback:Pr,useContext:Pr,useEffect:Pr,useImperativeHandle:Pr,useLayoutEffect:Pr,useInsertionEffect:Pr,useMemo:Pr,useReducer:Pr,useRef:Pr,useState:Pr,useDebugValue:Pr,useDeferredValue:Pr,useTransition:Pr,useSyncExternalStore:Pr,useId:Pr,useHostTransitionStatus:Pr,useFormState:Pr,useActionState:Pr,useOptimistic:Pr,useMemoCache:Pr,useCacheRefresh:Pr};mp.useEffectEvent=Pr;var bT={readContext:bo,use:Hh,useCallback:function(i,c){return zo().memoizedState=[i,c===void 0?null:c],i},useContext:bo,useEffect:eT,useImperativeHandle:function(i,c,f){f=f!=null?f.concat([i]):null,Uh(4194308,4,oT.bind(null,c,i),f)},useLayoutEffect:function(i,c){return Uh(4194308,4,i,c)},useInsertionEffect:function(i,c){Uh(4,2,i,c)},useMemo:function(i,c){var f=zo();c=c===void 0?null:c;var g=i();if(Gc){at(!0);try{i()}finally{at(!1)}}return f.memoizedState=[g,c],g},useReducer:function(i,c,f){var g=zo();if(f!==void 0){var j=f(c);if(Gc){at(!0);try{f(c)}finally{at(!1)}}}else j=c;return g.memoizedState=g.baseState=j,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:j},g.queue=i,i=i.dispatch=M$.bind(null,gn,i),[g.memoizedState,i]},useRef:function(i){var c=zo();return i={current:i},c.memoizedState=i},useState:function(i){i=vx(i);var c=i.queue,f=mT.bind(null,gn,c);return c.dispatch=f,[i.memoizedState,f]},useDebugValue:Cx,useDeferredValue:function(i,c){var f=zo();return wx(f,i,c)},useTransition:function(){var i=vx(!1);return i=cT.bind(null,gn,i.queue,!0,!1),zo().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,c,f){var g=gn,j=zo();if(On){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),ar===null)throw Error(r(349));(kn&127)!==0||N2(g,c,f)}j.memoizedState=f;var k={value:f,getSnapshot:c};return j.queue=k,eT(F2.bind(null,g,k,i),[i]),g.flags|=2048,dd(9,{destroy:void 0},$2.bind(null,g,k,f,c),null),f},useId:function(){var i=zo(),c=ar.identifierPrefix;if(On){var f=ra,g=na;f=(g&~(1<<32-vt(g)-1)).toString(32)+f,c="_"+c+"R_"+f,f=Bh++,0<\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?W.createElement("select",{is:g.is}):W.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?W.createElement(j,{is:g.is}):W.createElement(j)}}k[Ht]=c,k[fn]=g;e:for(W=c.child;W!==null;){if(W.tag===5||W.tag===6)k.appendChild(W.stateNode);else if(W.tag!==4&&W.tag!==27&&W.child!==null){W.child.return=W,W=W.child;continue}if(W===c)break e;for(;W.sibling===null;){if(W.return===null||W.return===c)break e;W=W.return}W.sibling.return=W.return,W=W.sibling}c.stateNode=k;e:switch(vo(k,j,g),j){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ba(c)}}return pr(c),Fx(c,c.type,i===null?null:i.memoizedProps,c.pendingProps,f),null;case 6:if(i&&c.stateNode!=null)i.memoizedProps!==g&&Ba(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(i=X.current,nd(c)){if(i=c.stateNode,f=c.memoizedProps,g=null,j=go,j!==null)switch(j.tag){case 27:case 5:g=j.memoizedProps}i[Ht]=c,i=!!(i.nodeValue===f||g!==null&&g.suppressHydrationWarning===!0||Lj(i.nodeValue,f)),i||Dl(c,!0)}else i=pg(i).createTextNode(g),i[Ht]=c,c.stateNode=i}return pr(c),null;case 31:if(f=c.memoizedState,i===null||i.memoizedState!==null){if(g=nd(c),f!==null){if(i===null){if(!g)throw Error(r(318));if(i=c.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ht]=c}else Fc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;pr(c),i=!1}else f=Xv(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),i=!0;if(!i)return c.flags&256?(vs(c),c):(vs(c),null);if((c.flags&128)!==0)throw Error(r(558))}return pr(c),null;case 13:if(g=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(j=nd(c),g!==null&&g.dehydrated!==null){if(i===null){if(!j)throw Error(r(318));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(r(317));j[Ht]=c}else Fc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;pr(c),j=!1}else j=Xv(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=j),j=!0;if(!j)return c.flags&256?(vs(c),c):(vs(c),null)}return vs(c),(c.flags&128)!==0?(c.lanes=f,c):(f=g!==null,i=i!==null&&i.memoizedState!==null,f&&(g=c.child,j=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(j=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==j&&(g.flags|=2048)),f!==i&&f&&(c.child.flags|=8192),Zh(c,c.updateQueue),pr(c),null);case 4:return ue(),i===null&&l0(c.stateNode.containerInfo),pr(c),null;case 10:return za(c.type),pr(c),null;case 19:if(Y(Fr),g=c.memoizedState,g===null)return pr(c),null;if(j=(c.flags&128)!==0,k=g.rendering,k===null)if(j)gp(g,!1);else{if(Ar!==0||i!==null&&(i.flags&128)!==0)for(i=c.child;i!==null;){if(k=$h(i),k!==null){for(c.flags|=128,gp(g,!1),i=k.updateQueue,c.updateQueue=i,Zh(c,i),c.subtreeFlags=0,i=f,f=c.child;f!==null;)m2(f,i),f=f.sibling;return Z(Fr,Fr.current&1|2),On&&Ia(c,g.treeForkCount),c.child}i=i.sibling}g.tail!==null&&_e()>rg&&(c.flags|=128,j=!0,gp(g,!1),c.lanes=4194304)}else{if(!j)if(i=$h(k),i!==null){if(c.flags|=128,j=!0,i=i.updateQueue,c.updateQueue=i,Zh(c,i),gp(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!On)return pr(c),null}else 2*_e()-g.renderingStartTime>rg&&f!==536870912&&(c.flags|=128,j=!0,gp(g,!1),c.lanes=4194304);g.isBackwards?(k.sibling=c.child,c.child=k):(i=g.last,i!==null?i.sibling=k:c.child=k,g.last=k)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=_e(),i.sibling=null,f=Fr.current,Z(Fr,j?f&1|2:f&1),On&&Ia(c,g.treeForkCount),i):(pr(c),null);case 22:case 23:return vs(c),cx(),g=c.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(f&536870912)!==0&&(c.flags&128)===0&&(pr(c),c.subtreeFlags&6&&(c.flags|=8192)):pr(c),f=c.updateQueue,f!==null&&Zh(c,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==f&&(c.flags|=2048),i!==null&&Y(Hc),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),za(Wr),pr(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function D$(i,c){switch(Yv(c),c.tag){case 1:return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return za(Wr),ue(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 26:case 27:case 5:return he(c),null;case 31:if(c.memoizedState!==null){if(vs(c),c.alternate===null)throw Error(r(340));Fc()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 13:if(vs(c),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Fc()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return Y(Fr),null;case 4:return ue(),null;case 10:return za(c.type),null;case 22:case 23:return vs(c),cx(),i!==null&&Y(Hc),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 24:return za(Wr),null;case 25:return null;default:return null}}function BT(i,c){switch(Yv(c),c.tag){case 3:za(Wr),ue();break;case 26:case 27:case 5:he(c);break;case 4:ue();break;case 31:c.memoizedState!==null&&vs(c);break;case 13:vs(c);break;case 19:Y(Fr);break;case 10:za(c.type);break;case 22:case 23:vs(c),cx(),i!==null&&Y(Hc);break;case 24:za(Wr)}}function bp(i,c){try{var f=c.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var j=g.next;f=j;do{if((f.tag&i)===i){g=void 0;var k=f.create,W=f.inst;g=k(),W.destroy=g}f=f.next}while(f!==j)}}catch(ne){Yn(c,c.return,ne)}}function Fl(i,c,f){try{var g=c.updateQueue,j=g!==null?g.lastEffect:null;if(j!==null){var k=j.next;g=k;do{if((g.tag&i)===i){var W=g.inst,ne=W.destroy;if(ne!==void 0){W.destroy=void 0,j=c;var Pe=f,Ve=ne;try{Ve()}catch(Qe){Yn(j,Pe,Qe)}}}g=g.next}while(g!==k)}}catch(Qe){Yn(c,c.return,Qe)}}function VT(i){var c=i.updateQueue;if(c!==null){var f=i.stateNode;try{A2(c,f)}catch(g){Yn(i,i.return,g)}}}function HT(i,c,f){f.props=Yc(i.type,i.memoizedProps),f.state=i.memoizedState;try{f.componentWillUnmount()}catch(g){Yn(i,c,g)}}function yp(i,c){try{var f=i.ref;if(f!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof f=="function"?i.refCleanup=f(g):f.current=g}}catch(j){Yn(i,c,j)}}function oa(i,c){var f=i.ref,g=i.refCleanup;if(f!==null)if(typeof g=="function")try{g()}catch(j){Yn(i,c,j)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(j){Yn(i,c,j)}else f.current=null}function qT(i){var c=i.type,f=i.memoizedProps,g=i.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&g.focus();break e;case"img":f.src?g.src=f.src:f.srcSet&&(g.srcset=f.srcSet)}}catch(j){Yn(i,i.return,j)}}function Bx(i,c,f){try{var g=i.stateNode;t4(g,i.type,f,c),g[fn]=c}catch(j){Yn(i,i.return,j)}}function UT(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Gl(i.type)||i.tag===4}function Vx(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||UT(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Gl(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Hx(i,c,f){var g=i.tag;if(g===5||g===6)i=i.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(i,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(i),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Yo));else if(g!==4&&(g===27&&Gl(i.type)&&(f=i.stateNode,c=null),i=i.child,i!==null))for(Hx(i,c,f),i=i.sibling;i!==null;)Hx(i,c,f),i=i.sibling}function Jh(i,c,f){var g=i.tag;if(g===5||g===6)i=i.stateNode,c?f.insertBefore(i,c):f.appendChild(i);else if(g!==4&&(g===27&&Gl(i.type)&&(f=i.stateNode),i=i.child,i!==null))for(Jh(i,c,f),i=i.sibling;i!==null;)Jh(i,c,f),i=i.sibling}function WT(i){var c=i.stateNode,f=i.memoizedProps;try{for(var g=i.type,j=c.attributes;j.length;)c.removeAttributeNode(j[0]);vo(c,g,f),c[Ht]=i,c[fn]=f}catch(k){Yn(i,i.return,k)}}var Va=!1,Kr=!1,qx=!1,GT=typeof WeakSet=="function"?WeakSet:Set,ao=null;function O$(i,c){if(i=i.containerInfo,d0=xg,i=s2(i),zv(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var j=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{f.nodeType,k.nodeType}catch{f=null;break e}var W=0,ne=-1,Pe=-1,Ve=0,Qe=0,ot=i,He=null;t:for(;;){for(var Ge;ot!==f||j!==0&&ot.nodeType!==3||(ne=W+j),ot!==k||g!==0&&ot.nodeType!==3||(Pe=W+g),ot.nodeType===3&&(W+=ot.nodeValue.length),(Ge=ot.firstChild)!==null;)He=ot,ot=Ge;for(;;){if(ot===i)break t;if(He===f&&++Ve===j&&(ne=W),He===k&&++Qe===g&&(Pe=W),(Ge=ot.nextSibling)!==null)break;ot=He,He=ot.parentNode}ot=Ge}f=ne===-1||Pe===-1?null:{start:ne,end:Pe}}else f=null}f=f||{start:0,end:0}}else f=null;for(f0={focusedElem:i,selectionRange:f},xg=!1,ao=c;ao!==null;)if(c=ao,i=c.child,(c.subtreeFlags&1028)!==0&&i!==null)i.return=c,ao=i;else for(;ao!==null;){switch(c=ao,k=c.alternate,i=c.flags,c.tag){case 0:if((i&4)!==0&&(i=c.updateQueue,i=i!==null?i.events:null,i!==null))for(f=0;f title"))),vo(k,g,f),k[Ht]=i,Le(k),g=k;break e;case"link":var W=Jj("link","href",j).get(g+(f.href||""));if(W){for(var ne=0;nerr&&(W=rr,rr=en,en=W);var Ne=r2(ne,en),Ie=r2(ne,rr);if(Ne&&Ie&&(Ge.rangeCount!==1||Ge.anchorNode!==Ne.node||Ge.anchorOffset!==Ne.offset||Ge.focusNode!==Ie.node||Ge.focusOffset!==Ie.offset)){var Be=ot.createRange();Be.setStart(Ne.node,Ne.offset),Ge.removeAllRanges(),en>rr?(Ge.addRange(Be),Ge.extend(Ie.node,Ie.offset)):(Be.setEnd(Ie.node,Ie.offset),Ge.addRange(Be))}}}}for(ot=[],Ge=ne;Ge=Ge.parentNode;)Ge.nodeType===1&&ot.push({element:Ge,left:Ge.scrollLeft,top:Ge.scrollTop});for(typeof ne.focus=="function"&&ne.focus(),ne=0;nef?32:f,P.T=null,f=Qx,Qx=null;var k=ql,W=Ga;if(ro=0,gd=ql=null,Ga=0,(Fn&6)!==0)throw Error(r(331));var ne=Fn;if(Fn|=4,oj(k.current),tj(k,k.current,W,f),Fn=ne,_p(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(Ae,k)}catch{}return!0}finally{O.p=j,P.T=g,Cj(i,c)}}function _j(i,c,f){c=Gs(f,c),c=kx(i.stateNode,c,2),i=zl(i,c,2),i!==null&&(ft(i,2),sa(i))}function Yn(i,c,f){if(i.tag===3)_j(i,i,f);else for(;c!==null;){if(c.tag===3){_j(c,i,f);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Hl===null||!Hl.has(g))){i=Gs(f,i),f=TT(2),g=zl(c,f,2),g!==null&&(jT(f,g,c,i),ft(g,2),sa(g));break}}c=c.return}}function t0(i,c,f){var g=i.pingCache;if(g===null){g=i.pingCache=new z$;var j=new Set;g.set(c,j)}else j=g.get(c),j===void 0&&(j=new Set,g.set(c,j));j.has(f)||(Gx=!0,j.add(f),i=V$.bind(null,i,c,f),c.then(i,i))}function V$(i,c,f){var g=i.pingCache;g!==null&&g.delete(c),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,ar===i&&(kn&f)===f&&(Ar===4||Ar===3&&(kn&62914560)===kn&&300>_e()-ng?(Fn&2)===0&&bd(i,0):Yx|=f,hd===kn&&(hd=0)),sa(i)}function Tj(i,c){c===0&&(c=pt()),i=Nc(i,c),i!==null&&(ft(i,c),sa(i))}function H$(i){var c=i.memoizedState,f=0;c!==null&&(f=c.retryLane),Tj(i,f)}function q$(i,c){var f=0;switch(i.tag){case 31:case 13:var g=i.stateNode,j=i.memoizedState;j!==null&&(f=j.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),Tj(i,f)}function U$(i,c){return ie(i,c)}var cg=null,vd=null,n0=!1,ug=!1,r0=!1,Wl=0;function sa(i){i!==vd&&i.next===null&&(vd===null?cg=vd=i:vd=vd.next=i),ug=!0,n0||(n0=!0,G$())}function _p(i,c){if(!r0&&ug){r0=!0;do for(var f=!1,g=cg;g!==null;){if(i!==0){var j=g.pendingLanes;if(j===0)var k=0;else{var W=g.suspendedLanes,ne=g.pingedLanes;k=(1<<31-vt(42|i)+1)-1,k&=j&~(W&~ne),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(f=!0,Rj(g,k))}else k=kn,k=hn(g,g===ar?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||ct(g,k)||(f=!0,Rj(g,k));g=g.next}while(f);r0=!1}}function W$(){jj()}function jj(){ug=n0=!1;var i=0;Wl!==0&&r4()&&(i=Wl);for(var c=_e(),f=null,g=cg;g!==null;){var j=g.next,k=Ej(g,c);k===0?(g.next=null,f===null?cg=j:f.next=j,j===null&&(vd=f)):(f=g,(i!==0||(k&3)!==0)&&(ug=!0)),g=j}ro!==0&&ro!==5||_p(i),Wl!==0&&(Wl=0)}function Ej(i,c){for(var f=i.suspendedLanes,g=i.pingedLanes,j=i.expirationTimes,k=i.pendingLanes&-62914561;0ne)break;var Qe=Pe.transferSize,ot=Pe.initiatorType;Qe&&zj(ot)&&(Pe=Pe.responseEnd,W+=Qe*(Pe"u"?null:document;function Kj(i,c,f){var g=xd;if(g&&typeof c=="string"&&c){var j=_o(c);j='link[rel="'+i+'"][href="'+j+'"]',typeof f=="string"&&(j+='[crossorigin="'+f+'"]'),Yj.has(j)||(Yj.add(j),i={rel:i,crossOrigin:f,href:c},g.querySelector(j)===null&&(c=g.createElement("link"),vo(c,"link",i),Le(c),g.head.appendChild(c)))}}function f4(i){Ya.D(i),Kj("dns-prefetch",i,null)}function p4(i,c){Ya.C(i,c),Kj("preconnect",i,c)}function m4(i,c,f){Ya.L(i,c,f);var g=xd;if(g&&i&&c){var j='link[rel="preload"][as="'+_o(c)+'"]';c==="image"&&f&&f.imageSrcSet?(j+='[imagesrcset="'+_o(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(j+='[imagesizes="'+_o(f.imageSizes)+'"]')):j+='[href="'+_o(i)+'"]';var k=j;switch(c){case"style":k=Sd(i);break;case"script":k=Cd(i)}Js.has(k)||(i=b({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:i,as:c},f),Js.set(k,i),g.querySelector(j)!==null||c==="style"&&g.querySelector(Mp(k))||c==="script"&&g.querySelector(Rp(k))||(c=g.createElement("link"),vo(c,"link",i),Le(c),g.head.appendChild(c)))}}function h4(i,c){Ya.m(i,c);var f=xd;if(f&&i){var g=c&&typeof c.as=="string"?c.as:"script",j='link[rel="modulepreload"][as="'+_o(g)+'"][href="'+_o(i)+'"]',k=j;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=Cd(i)}if(!Js.has(k)&&(i=b({rel:"modulepreload",href:i},c),Js.set(k,i),f.querySelector(j)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Rp(k)))return}g=f.createElement("link"),vo(g,"link",i),Le(g),f.head.appendChild(g)}}}function g4(i,c,f){Ya.S(i,c,f);var g=xd;if(g&&i){var j=An(g).hoistableStyles,k=Sd(i);c=c||"default";var W=j.get(k);if(!W){var ne={loading:0,preload:null};if(W=g.querySelector(Mp(k)))ne.loading=5;else{i=b({rel:"stylesheet",href:i,"data-precedence":c},f),(f=Js.get(k))&&v0(i,f);var Pe=W=g.createElement("link");Le(Pe),vo(Pe,"link",i),Pe._p=new Promise(function(Ve,Qe){Pe.onload=Ve,Pe.onerror=Qe}),Pe.addEventListener("load",function(){ne.loading|=1}),Pe.addEventListener("error",function(){ne.loading|=2}),ne.loading|=4,hg(W,c,g)}W={type:"stylesheet",instance:W,count:1,state:ne},j.set(k,W)}}}function b4(i,c){Ya.X(i,c);var f=xd;if(f&&i){var g=An(f).hoistableScripts,j=Cd(i),k=g.get(j);k||(k=f.querySelector(Rp(j)),k||(i=b({src:i,async:!0},c),(c=Js.get(j))&&x0(i,c),k=f.createElement("script"),Le(k),vo(k,"link",i),f.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(j,k))}}function y4(i,c){Ya.M(i,c);var f=xd;if(f&&i){var g=An(f).hoistableScripts,j=Cd(i),k=g.get(j);k||(k=f.querySelector(Rp(j)),k||(i=b({src:i,async:!0,type:"module"},c),(c=Js.get(j))&&x0(i,c),k=f.createElement("script"),Le(k),vo(k,"link",i),f.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(j,k))}}function Xj(i,c,f,g){var j=(j=X.current)?mg(j):null;if(!j)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=Sd(f.href),f=An(j).hoistableStyles,g=f.get(c),g||(g={type:"style",instance:null,count:0,state:null},f.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=Sd(f.href);var k=An(j).hoistableStyles,W=k.get(i);if(W||(j=j.ownerDocument||j,W={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,W),(k=j.querySelector(Mp(i)))&&!k._p&&(W.instance=k,W.state.loading=5),Js.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Js.set(i,f),k||v4(j,i,f,W.state))),c&&g===null)throw Error(r(528,""));return W}if(c&&g!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Cd(f),f=An(j).hoistableScripts,g=f.get(c),g||(g={type:"script",instance:null,count:0,state:null},f.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Sd(i){return'href="'+_o(i)+'"'}function Mp(i){return'link[rel="stylesheet"]['+i+"]"}function Qj(i){return b({},i,{"data-precedence":i.precedence,precedence:null})}function v4(i,c,f,g){i.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=i.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),vo(c,"link",f),Le(c),i.head.appendChild(c))}function Cd(i){return'[src="'+_o(i)+'"]'}function Rp(i){return"script[async]"+i}function Zj(i,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var g=i.querySelector('style[data-href~="'+_o(f.href)+'"]');if(g)return c.instance=g,Le(g),g;var j=b({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Le(g),vo(g,"style",j),hg(g,f.precedence,i),c.instance=g;case"stylesheet":j=Sd(f.href);var k=i.querySelector(Mp(j));if(k)return c.state.loading|=4,c.instance=k,Le(k),k;g=Qj(f),(j=Js.get(j))&&v0(g,j),k=(i.ownerDocument||i).createElement("link"),Le(k);var W=k;return W._p=new Promise(function(ne,Pe){W.onload=ne,W.onerror=Pe}),vo(k,"link",g),c.state.loading|=4,hg(k,f.precedence,i),c.instance=k;case"script":return k=Cd(f.src),(j=i.querySelector(Rp(k)))?(c.instance=j,Le(j),j):(g=f,(j=Js.get(k))&&(g=b({},f),x0(g,j)),i=i.ownerDocument||i,j=i.createElement("script"),Le(j),vo(j,"link",g),i.head.appendChild(j),c.instance=j);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,hg(g,f.precedence,i));return c.instance}function hg(i,c,f){for(var g=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),j=g.length?g[g.length-1]:null,k=j,W=0;W title"):null)}function x4(i,c,f){if(f===1||c.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(i=c.disabled,typeof c.precedence=="string"&&i==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function tE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function S4(i,c,f,g){if(f.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var j=Sd(g.href),k=c.querySelector(Mp(j));if(k){c=k._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(i.count++,i=bg.bind(i),c.then(i,i)),f.state.loading|=4,f.instance=k,Le(k);return}k=c.ownerDocument||c,g=Qj(g),(j=Js.get(j))&&v0(g,j),k=k.createElement("link"),Le(k);var W=k;W._p=new Promise(function(ne,Pe){W.onload=ne,W.onerror=Pe}),vo(k,"link",g),f.instance=k}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(i.count++,f=bg.bind(i),c.addEventListener("load",f),c.addEventListener("error",f))}}var S0=0;function C4(i,c){return i.stylesheets&&i.count===0&&vg(i,i.stylesheets),0S0?50:800)+c);return i.unsuspend=f,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(j)}}:null}function bg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vg(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var yg=null;function vg(i,c){i.stylesheets=null,i.unsuspend!==null&&(i.count++,yg=new Map,c.forEach(w4,i),yg=null,bg.call(i))}function w4(i,c){if(!(c.state.loading&4)){var f=yg.get(i);if(f)var g=f.get(null);else{f=new Map,yg.set(i,f);for(var j=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$0.exports=L8(),$0.exports}var N8=z8();const $8=yi(N8);var CM="popstate";function F8(e={}){function t(r,o){let{pathname:s,search:l,hash:u}=r.location;return lS("",{pathname:s,search:l,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:_m(o)}return V8(t,n,null,e)}function jr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ca(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function B8(){return Math.random().toString(36).substring(2,10)}function wM(e,t){return{usr:e.state,key:e.key,idx:t}}function lS(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Lf(t):t,state:n,key:t&&t.key||r||B8()}}function _m({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Lf(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function V8(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,l=o.history,u="POP",d=null,p=m();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function m(){return(l.state||{idx:null}).idx}function b(){u="POP";let S=m(),w=S==null?null:S-p;p=S,d&&d({action:u,location:C.location,delta:w})}function y(S,w){u="PUSH";let _=lS(C.location,S,w);p=m()+1;let T=wM(_,p),M=C.createHref(_);try{l.pushState(T,"",M)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;o.location.assign(M)}s&&d&&d({action:u,location:C.location,delta:1})}function h(S,w){u="REPLACE";let _=lS(C.location,S,w);p=m();let T=wM(_,p),M=C.createHref(_);l.replaceState(T,"",M),s&&d&&d({action:u,location:C.location,delta:0})}function x(S){return H8(S)}let C={get action(){return u},get location(){return e(o,l)},listen(S){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(CM,b),d=S,()=>{o.removeEventListener(CM,b),d=null}},createHref(S){return t(o,S)},createURL:x,encodeLocation(S){let w=x(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:y,replace:h,go(S){return l.go(S)}};return C}function H8(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),jr(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:_m(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function jD(e,t,n="/"){return q8(e,t,n,!1)}function q8(e,t,n,r){let o=typeof t=="string"?Lf(t):t,s=ul(o.pathname||"/",n);if(s==null)return null;let l=ED(e);U8(l);let u=null;for(let d=0;u==null&&d{let m={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&d)return;jr(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let b=ll([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&(jr(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),ED(l.children,t,y,b,d)),!(l.path==null&&!l.index)&&t.push({path:b,score:Z8(b,l.index),routesMeta:y})};return e.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))s(l,u);else for(let d of MD(l.path))s(l,u,!0,d)}),t}function MD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let l=MD(r.join("/")),u=[];return u.push(...l.map(d=>d===""?s:[s,d].join("/"))),o&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function U8(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:J8(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var W8=/^:[\w-]+$/,G8=3,Y8=2,K8=1,X8=10,Q8=-2,_M=e=>e==="*";function Z8(e,t){let n=e.split("/"),r=n.length;return n.some(_M)&&(r+=Q8),t&&(r+=Y8),n.filter(o=>!_M(o)).reduce((o,s)=>o+(W8.test(s)?G8:s===""?K8:X8),r)}function J8(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function e9(e,t,n=!1){let{routesMeta:r}=e,o={},s="/",l=[];for(let u=0;u{if(m==="*"){let x=u[y]||"";l=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const h=u[y];return b&&!h?p[m]=void 0:p[m]=(h||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:e}}function t9(e,t=!1,n=!0){Ca(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function n9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ca(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ul(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var r9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function o9(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Lf(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=TM(n.substring(1),"/"):s=TM(n,t)):s=t,{pathname:s,search:a9(r),hash:l9(o)}}function TM(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function H0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function s9(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function RD(e){let t=s9(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function kD(e,t,n,r=!1){let o;typeof e=="string"?o=Lf(e):(o={...e},jr(!o.pathname||!o.pathname.includes("?"),H0("?","pathname","search",o)),jr(!o.pathname||!o.pathname.includes("#"),H0("#","pathname","hash",o)),jr(!o.search||!o.search.includes("#"),H0("#","search","hash",o)));let s=e===""||o.pathname==="",l=s?"/":o.pathname,u;if(l==null)u=n;else{let b=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),b-=1;o.pathname=y.join("/")}u=b>=0?t[b]:"/"}let d=o9(o,u),p=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||m)&&(d.pathname+="/"),d}var ll=e=>e.join("/").replace(/\/\/+/g,"/"),i9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),a9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,l9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,c9=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function u9(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function d9(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var PD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AD(e,t){let n=e;if(typeof n!="string"||!r9.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(PD)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=ul(l.pathname,t);l.origin===s.origin&&u!=null?n=u+l.search+l.hash:o=!0}catch{Ca(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var DD=["POST","PUT","PATCH","DELETE"];new Set(DD);var f9=["GET",...DD];new Set(f9);var zf=v.createContext(null);zf.displayName="DataRouter";var Iy=v.createContext(null);Iy.displayName="DataRouterState";var p9=v.createContext(!1),OD=v.createContext({isTransitioning:!1});OD.displayName="ViewTransition";var m9=v.createContext(new Map);m9.displayName="Fetchers";var h9=v.createContext(null);h9.displayName="Await";var vi=v.createContext(null);vi.displayName="Navigation";var Km=v.createContext(null);Km.displayName="Location";var ja=v.createContext({outlet:null,matches:[],isDataRoute:!1});ja.displayName="Route";var IC=v.createContext(null);IC.displayName="RouteError";var ID="REACT_ROUTER_ERROR",g9="REDIRECT",b9="ROUTE_ERROR_RESPONSE";function y9(e){if(e.startsWith(`${ID}:${g9}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function v9(e){if(e.startsWith(`${ID}:${b9}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new c9(t.status,t.statusText,t.data)}catch{}}function x9(e,{relative:t}={}){jr(Xm(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=v.useContext(vi),{hash:o,pathname:s,search:l}=Qm(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:ll([n,s])),r.createHref({pathname:u,search:l,hash:o})}function Xm(){return v.useContext(Km)!=null}function xi(){return jr(Xm(),"useLocation() may be used only in the context of a component."),v.useContext(Km).location}var LD="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zD(e){v.useContext(vi).static||v.useLayoutEffect(e)}function Zr(){let{isDataRoute:e}=v.useContext(ja);return e?D9():S9()}function S9(){jr(Xm(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(zf),{basename:t,navigator:n}=v.useContext(vi),{matches:r}=v.useContext(ja),{pathname:o}=xi(),s=JSON.stringify(RD(r)),l=v.useRef(!1);return zD(()=>{l.current=!0}),v.useCallback((d,p={})=>{if(Ca(l.current,LD),!l.current)return;if(typeof d=="number"){n.go(d);return}let m=kD(d,JSON.parse(s),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ll([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,o,e])}v.createContext(null);function gl(){let{matches:e}=v.useContext(ja),t=e[e.length-1];return t?t.params:{}}function Qm(e,{relative:t}={}){let{matches:n}=v.useContext(ja),{pathname:r}=xi(),o=JSON.stringify(RD(n));return v.useMemo(()=>kD(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function C9(e,t){return ND(e,t)}function ND(e,t,n,r,o){jr(Xm(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=v.useContext(vi),{matches:l}=v.useContext(ja),u=l[l.length-1],d=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",b=u&&u.route;{let _=b&&b.path||"";FD(p,!b||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${p}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let y=xi(),h;if(t){let _=typeof t=="string"?Lf(t):t;jr(m==="/"||_.pathname?.startsWith(m),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${_.pathname}" was given in the \`location\` prop.`),h=_}else h=y;let x=h.pathname||"/",C=x;if(m!=="/"){let _=m.replace(/^\//,"").split("/");C="/"+x.replace(/^\//,"").split("/").slice(_.length).join("/")}let S=jD(e,{pathname:C});Ca(b||S!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Ca(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let w=E9(S&&S.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:ll([m,s.encodeLocation?s.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?m:ll([m,s.encodeLocation?s.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,n,r,o);return t&&w?v.createElement(Km.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},w):w}function w9(){let e=A9(),t=u9(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:s},"ErrorBoundary")," or"," ",v.createElement("code",{style:s},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:o},n):null,l)}var _9=v.createElement(w9,null),$D=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=v9(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(ja.Provider,{value:this.props.routeContext},v.createElement(IC.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(T9,{error:e},t):t}};$D.contextType=p9;var q0=new WeakMap;function T9({children:e,error:t}){let{basename:n}=v.useContext(vi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=y9(t.digest);if(r){let o=q0.get(t);if(o)throw o;let s=AD(r.location,n);if(PD&&!q0.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw q0.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function j9({routeContext:e,match:t,children:n}){let r=v.useContext(zf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(ja.Provider,{value:e},n)}function E9(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=n?.errors;if(l!=null){let m=s.findIndex(b=>b.route.id&&l?.[b.route.id]!==void 0);jr(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let u=!1,d=-1;if(n)for(let m=0;m=0?s=s.slice(0,d+1):s=[s[0]];break}}}let p=n&&r?(m,b)=>{r(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:d9(n.matches),errorInfo:b})}:void 0;return s.reduceRight((m,b,y)=>{let h,x=!1,C=null,S=null;n&&(h=l&&b.route.id?l[b.route.id]:void 0,C=b.route.errorElement||_9,u&&(d<0&&y===0?(FD("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):d===y&&(x=!0,S=b.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,y+1)),_=()=>{let T;return h?T=C:x?T=S:b.route.Component?T=v.createElement(b.route.Component,null):b.route.element?T=b.route.element:T=m,v.createElement(j9,{match:b,routeContext:{outlet:m,matches:w,isDataRoute:n!=null},children:T})};return n&&(b.route.ErrorBoundary||b.route.errorElement||y===0)?v.createElement($D,{location:n.location,revalidation:n.revalidation,component:C,error:h,children:_(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:p}):_()},null)}function LC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function M9(e){let t=v.useContext(zf);return jr(t,LC(e)),t}function R9(e){let t=v.useContext(Iy);return jr(t,LC(e)),t}function k9(e){let t=v.useContext(ja);return jr(t,LC(e)),t}function zC(e){let t=k9(e),n=t.matches[t.matches.length-1];return jr(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function P9(){return zC("useRouteId")}function A9(){let e=v.useContext(IC),t=R9("useRouteError"),n=zC("useRouteError");return e!==void 0?e:t.errors?.[n]}function D9(){let{router:e}=M9("useNavigate"),t=zC("useNavigate"),n=v.useRef(!1);return zD(()=>{n.current=!0}),v.useCallback(async(o,s={})=>{Ca(n.current,LD),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var jM={};function FD(e,t,n){!t&&!jM[e]&&(jM[e]=!0,Ca(!1,n))}v.memo(O9);function O9({routes:e,future:t,state:n,onError:r}){return ND(e,void 0,n,r,t)}function _r(e){jr(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function I9({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1,unstable_useTransitions:l}){jr(!Xm(),"You cannot render a inside another . You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:u,navigator:o,static:s,unstable_useTransitions:l,future:{}}),[u,o,s,l]);typeof n=="string"&&(n=Lf(n));let{pathname:p="/",search:m="",hash:b="",state:y=null,key:h="default"}=n,x=v.useMemo(()=>{let C=ul(p,u);return C==null?null:{location:{pathname:C,search:m,hash:b,state:y,key:h},navigationType:r}},[u,p,m,b,y,h,r]);return Ca(x!=null,` is not able to match the URL "${p}${m}${b}" because it does not start with the basename, so the won't render anything.`),x==null?null:v.createElement(vi.Provider,{value:d},v.createElement(Km.Provider,{children:t,value:x}))}function L9({children:e,location:t}){return C9(cS(e),t)}function cS(e,t=[]){let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let s=[...t,o];if(r.type===v.Fragment){n.push.apply(n,cS(r.props.children,s));return}jr(r.type===_r,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),jr(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=cS(r.props.children,s)),n.push(l)}),n}var Sb="get",Cb="application/x-www-form-urlencoded";function Ly(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function z9(e){return Ly(e)&&e.tagName.toLowerCase()==="button"}function N9(e){return Ly(e)&&e.tagName.toLowerCase()==="form"}function $9(e){return Ly(e)&&e.tagName.toLowerCase()==="input"}function F9(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function B9(e,t){return e.button===0&&(!t||t==="_self")&&!F9(e)}var kg=null;function V9(){if(kg===null)try{new FormData(document.createElement("form"),0),kg=!1}catch{kg=!0}return kg}var H9=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function U0(e){return e!=null&&!H9.has(e)?(Ca(!1,`"${e}" is not a valid \`encType\` for \`\`/\`\` and will default to "${Cb}"`),null):e}function q9(e,t){let n,r,o,s,l;if(N9(e)){let u=e.getAttribute("action");r=u?ul(u,t):null,n=e.getAttribute("method")||Sb,o=U0(e.getAttribute("enctype"))||Cb,s=new FormData(e)}else if(z9(e)||$9(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a - {transaction && deletableTranTypes.includes(transaction.type) && ( + {transaction && deletableTranTypes.has(transaction.type) && (