From 2b8a52328875f674af8dc45c61e0d9f84fd54cdc Mon Sep 17 00:00:00 2001 From: ahmaddev-codex Date: Mon, 12 Oct 2026 15:25:17 +0100 Subject: [PATCH 01/17] fix(db): connect revenue pool using database_url The pool read settings that don't exist, used a sync-only pool class, and was missing greenlet, so it never connected. --- backend/app/core/database_pool.py | 13 +++++++------ backend/requirements.txt | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/backend/app/core/database_pool.py b/backend/app/core/database_pool.py index d638dfcfe3..30f750f79a 100644 --- a/backend/app/core/database_pool.py +++ b/backend/app/core/database_pool.py @@ -1,6 +1,5 @@ import asyncio from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker -from sqlalchemy.pool import QueuePool import logging from ..config import settings @@ -13,13 +12,15 @@ def __init__(self): async def initialize(self): """Initialize database connection pool""" + if self.session_factory: + return + try: - # Create async engine with connection pooling - database_url = f"postgresql+asyncpg://{settings.supabase_db_user}:{settings.supabase_db_password}@{settings.supabase_db_host}:{settings.supabase_db_port}/{settings.supabase_db_name}" - + # Async engine needs the asyncpg driver in the URL. + database_url = settings.database_url.replace("postgresql://", "postgresql+asyncpg://", 1) + self.engine = create_async_engine( database_url, - poolclass=QueuePool, pool_size=20, # Number of connections to maintain max_overflow=30, # Additional connections when needed pool_pre_ping=True, # Validate connections @@ -45,7 +46,7 @@ async def close(self): if self.engine: await self.engine.dispose() - async def get_session(self) -> AsyncSession: + def get_session(self) -> AsyncSession: """Get database session from pool""" if not self.session_factory: raise Exception("Database pool not initialized") diff --git a/backend/requirements.txt b/backend/requirements.txt index 6b777d2aaa..06cb8bd4a6 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -18,7 +18,7 @@ pytz redis>=5.0.0 requests sendgrid -sqlalchemy>=2.0.0 +sqlalchemy[asyncio]>=2.0.0 supabase tenacity>=8.0.0 uvicorn[standard] From 2873c6afe9d74f45fc7e09545b74c0227a5fbb51 Mon Sep 17 00:00:00 2001 From: ahmaddev-codex Date: Mon, 12 Oct 2026 15:25:17 +0100 Subject: [PATCH 02/17] fix(revenue): remove mock data fallback Query failures returned hardcoded totals that looked real. Reuse the shared pool and return 503 when the database is unavailable. --- backend/app/api/v1/dashboard.py | 5 ++++- backend/app/services/reservations.py | 30 +++++----------------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/backend/app/api/v1/dashboard.py b/backend/app/api/v1/dashboard.py index 1ec352d7e3..13297cd107 100644 --- a/backend/app/api/v1/dashboard.py +++ b/backend/app/api/v1/dashboard.py @@ -13,7 +13,10 @@ async def get_dashboard_summary( tenant_id = getattr(current_user, "tenant_id", "default_tenant") or "default_tenant" - revenue_data = await get_revenue_summary(property_id, tenant_id) + try: + revenue_data = await get_revenue_summary(property_id, tenant_id) + except Exception: + raise HTTPException(status_code=503, detail="Revenue data is temporarily unavailable") total_revenue_float = float(revenue_data['total']) diff --git a/backend/app/services/reservations.py b/backend/app/services/reservations.py index 384bd00abe..4dcccb2d65 100644 --- a/backend/app/services/reservations.py +++ b/backend/app/services/reservations.py @@ -36,11 +36,9 @@ async def calculate_total_revenue(property_id: str, tenant_id: str) -> Dict[str, Aggregates revenue from database. """ try: - # Import database pool - from app.core.database_pool import DatabasePool - - # Initialize pool if needed - db_pool = DatabasePool() + # Reuse the shared pool instead of creating one per request. + from app.core.database_pool import db_pool + await db_pool.initialize() if db_pool.session_factory: @@ -86,24 +84,6 @@ async def calculate_total_revenue(property_id: str, tenant_id: str) -> Dict[str, raise Exception("Database pool not available") except Exception as e: + # Fail loudly: returning placeholder figures hides outages behind wrong numbers. print(f"Database error for {property_id} (tenant: {tenant_id}): {e}") - - # Create property-specific mock data for testing when DB is unavailable - # This ensures each property shows different figures - mock_data = { - 'prop-001': {'total': '1000.00', 'count': 3}, - 'prop-002': {'total': '4975.50', 'count': 4}, - 'prop-003': {'total': '6100.50', 'count': 2}, - 'prop-004': {'total': '1776.50', 'count': 4}, - 'prop-005': {'total': '3256.00', 'count': 3} - } - - mock_property_data = mock_data.get(property_id, {'total': '0.00', 'count': 0}) - - return { - "property_id": property_id, - "tenant_id": tenant_id, - "total": mock_property_data['total'], - "currency": "USD", - "count": mock_property_data['count'] - } + raise From 796991dfba3027fbcaeca5a37dd76d0b63359405 Mon Sep 17 00:00:00 2001 From: ahmaddev-codex Date: Mon, 12 Oct 2026 15:21:54 +0100 Subject: [PATCH 03/17] fix(cache): scope revenue cache key by tenant Property IDs repeat across tenants, so a shared key served one tenant's cached revenue to another. --- backend/app/services/cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/app/services/cache.py b/backend/app/services/cache.py index b81474957f..f51053bd19 100644 --- a/backend/app/services/cache.py +++ b/backend/app/services/cache.py @@ -10,7 +10,8 @@ async def get_revenue_summary(property_id: str, tenant_id: str) -> Dict[str, Any """ Fetches revenue summary, utilizing caching to improve performance. """ - cache_key = f"revenue:{property_id}" + # Property IDs are only unique per tenant, so the key must include the tenant. + cache_key = f"revenue:{tenant_id}:{property_id}" # Try to get from cache cached = await redis_client.get(cache_key) From 5566a7d91fe2b254405180b693ffba952e4fd50e Mon Sep 17 00:00:00 2001 From: ahmaddev-codex Date: Mon, 12 Oct 2026 15:29:11 +0100 Subject: [PATCH 04/17] chore(deps): add sqlalchemy asyncio extra to pyproject Keeps uv config in sync with requirements.txt. --- backend/pyproject.toml | 2 +- backend/uv.lock | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index ebaa4bc92d..6968736a46 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -27,7 +27,7 @@ dependencies = [ "reportlab>=4.4.3", "requests>=2.32.4", "sendgrid>=6.12.4", - "sqlalchemy>=2.0.0", + "sqlalchemy[asyncio]>=2.0.0", "stripe>=7.0.0", "supabase>=2.18.0", "tenacity>=9.1.2", diff --git a/backend/uv.lock b/backend/uv.lock index 01e9327152..f63e8c8fd0 100644 --- a/backend/uv.lock +++ b/backend/uv.lock @@ -177,7 +177,7 @@ dependencies = [ { name = "reportlab" }, { name = "requests" }, { name = "sendgrid" }, - { name = "sqlalchemy" }, + { name = "sqlalchemy", extra = ["asyncio"] }, { name = "stripe" }, { name = "supabase" }, { name = "tenacity" }, @@ -214,7 +214,7 @@ requires-dist = [ { name = "reportlab", specifier = ">=4.4.3" }, { name = "requests", specifier = ">=2.32.4" }, { name = "sendgrid", specifier = ">=6.12.4" }, - { name = "sqlalchemy", specifier = ">=2.0.0" }, + { name = "sqlalchemy", extras = ["asyncio"], specifier = ">=2.0.0" }, { name = "stripe", specifier = ">=7.0.0" }, { name = "supabase", specifier = ">=2.18.0" }, { name = "tenacity", specifier = ">=9.1.2" }, @@ -1863,6 +1863,11 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ee/55/ba2546ab09a6adebc521bf3974440dc1d8c06ed342cceb30ed62a8858835/sqlalchemy-2.0.42-py3-none-any.whl", hash = "sha256:defcdff7e661f0043daa381832af65d616e060ddb54d3fe4476f51df7eaa1835", size = 1922072, upload-time = "2025-07-29T13:09:17.061Z" }, ] +[package.optional-dependencies] +asyncio = [ + { name = "greenlet" }, +] + [[package]] name = "starlette" version = "0.47.2" From 846ce019b1c91df844aa2a1dc4f0d1212c7048d8 Mon Sep 17 00:00:00 2001 From: ahmaddev-codex Date: Mon, 12 Oct 2026 15:29:25 +0100 Subject: [PATCH 05/17] chore(git): add gitignore for build and cache files --- .gitignore | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..8622c68dc2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Python +__pycache__/ +*.py[cod] +.venv/ +.pytest_cache/ + +# Node +node_modules/ + +# Env +.env.local +.env.*.local + +# OS / editor +.DS_Store +*.log +vite.config.ts.timestamp-*.mjs From 71e38ee7efc83d28326bdd541c68308586f5b8e4 Mon Sep 17 00:00:00 2001 From: ahmaddev-codex Date: Mon, 12 Oct 2026 15:30:10 +0100 Subject: [PATCH 06/17] fix(revenue): round totals to cents with Decimal Totals were cast to float, which drifts on sub-cent amounts. Round once with ROUND_HALF_UP and return the amount as a string. --- backend/app/api/v1/dashboard.py | 5 ++--- backend/app/services/reservations.py | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/app/api/v1/dashboard.py b/backend/app/api/v1/dashboard.py index 13297cd107..06c166ba98 100644 --- a/backend/app/api/v1/dashboard.py +++ b/backend/app/api/v1/dashboard.py @@ -18,11 +18,10 @@ async def get_dashboard_summary( except Exception: raise HTTPException(status_code=503, detail="Revenue data is temporarily unavailable") - total_revenue_float = float(revenue_data['total']) - return { "property_id": revenue_data['property_id'], - "total_revenue": total_revenue_float, + # Sent as a decimal string; floats lose cents. + "total_revenue": revenue_data['total'], "currency": revenue_data['currency'], "reservations_count": revenue_data['count'] } diff --git a/backend/app/services/reservations.py b/backend/app/services/reservations.py index 4dcccb2d65..f5a59dc4ef 100644 --- a/backend/app/services/reservations.py +++ b/backend/app/services/reservations.py @@ -1,5 +1,5 @@ from datetime import datetime -from decimal import Decimal +from decimal import Decimal, ROUND_HALF_UP from typing import Dict, Any, List async def calculate_monthly_revenue(property_id: str, month: int, year: int, db_session=None) -> Decimal: @@ -63,7 +63,8 @@ async def calculate_total_revenue(property_id: str, tenant_id: str) -> Dict[str, row = result.fetchone() if row: - total_revenue = Decimal(str(row.total_revenue)) + # Amounts are stored to 3 decimals; round once, to cents, after summing. + total_revenue = Decimal(str(row.total_revenue)).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP) return { "property_id": property_id, "tenant_id": tenant_id, From f9066c89206be8c0f901d02f2f10478a4baa52b7 Mon Sep 17 00:00:00 2001 From: ahmaddev-codex Date: Mon, 12 Oct 2026 15:30:11 +0100 Subject: [PATCH 07/17] fix(dashboard): display revenue without float rounding Math.round on floats rounds half-cents down (1.005 -> 1.00). Use the backend-rounded value and drop the float-based mismatch warning. --- frontend/src/components/RevenueSummary.tsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/RevenueSummary.tsx b/frontend/src/components/RevenueSummary.tsx index dbb6d0629d..5e3ecd241b 100644 --- a/frontend/src/components/RevenueSummary.tsx +++ b/frontend/src/components/RevenueSummary.tsx @@ -3,7 +3,7 @@ import { SecureAPI } from '../lib/secureApi'; interface RevenueData { property_id: string; - total_revenue: number; + total_revenue: string; // decimal string, already rounded to cents currency: string; reservations_count: number; } @@ -61,7 +61,7 @@ export const RevenueSummary: React.FC = ({ propertyId = 'pr if (error) return
{error}
; if (!data) return null; - const displayTotal = Math.round(data.total_revenue * 100) / 100; + const displayTotal = Number(data.total_revenue); return (
@@ -102,17 +102,6 @@ export const RevenueSummary: React.FC = ({ propertyId = 'pr
- {/* Precision Warning Area */} -
- {Math.abs(data.total_revenue - displayTotal) > 0.000001 && showRaw && ( -
- - - - Precision Mismatch Detected -
- )} -
); From 6053d2a5e87098fe0cce4c6304d886724260707c Mon Sep 17 00:00:00 2001 From: ahmaddev-codex Date: Mon, 12 Oct 2026 15:32:44 +0100 Subject: [PATCH 08/17] chore(git): stop tracking frontend build output dist is generated by npm run build inside the Docker image. --- .gitignore | 6 + frontend/dist/Idmobile.png | Bin 1420 -> 0 bytes frontend/dist/Vector.png | Bin 553 -> 0 bytes frontend/dist/assets/charts-RKvbJDHG.js | 1 - frontend/dist/assets/data-api-Bj79fh9f.js | 1 - frontend/dist/assets/data-query-DIoVICGX.js | 1 - .../dist/assets/editor-complete-b_xua3o6.js | 1 - frontend/dist/assets/index-CLh9TTHC.css | 1 - frontend/dist/assets/index-qvxZ5pjb.js | 2 - frontend/dist/assets/logo-0e8ybaOJ.png | Bin 27000 -> 0 bytes .../dist/assets/quickSessionCheck-CDz9td7h.js | 1 - frontend/dist/assets/react-core-B2bfBmQ1.js | 1 - frontend/dist/assets/react-router-qpxRsT6p.js | 1 - .../dist/assets/sessionValidator-CHh5e7zs.js | 1 - frontend/dist/assets/ui-icons-kyIJ9IOi.js | 1 - frontend/dist/assets/ui-utils-CaKPsBzZ.js | 171 ------------------ frontend/dist/circle-check-big.png | Bin 531 -> 0 bytes frontend/dist/favicon.ico | Bin 19551 -> 0 bytes frontend/dist/favicon.svg | 4 - frontend/dist/favicon.webp | Bin 7508 -> 0 bytes frontend/dist/favicon_old.png | Bin 19551 -> 0 bytes frontend/dist/icons/calculate.svg | 10 - frontend/dist/icons/calculator.svg | 6 - frontend/dist/icons/calendar-clock.svg | 3 - frontend/dist/icons/calendar.svg | 3 - frontend/dist/icons/chevron-down.svg | 5 - frontend/dist/icons/dollar.svg | 5 - frontend/dist/icons/increase.svg | 9 - frontend/dist/icons/login.svg | 3 - frontend/dist/icons/ota-payment.svg | 7 - frontend/dist/icons/payment-protection.svg | 5 - frontend/dist/icons/payment-status.svg | 7 - frontend/dist/icons/payment.svg | 7 - frontend/dist/icons/payments-overlay.svg | 3 - frontend/dist/icons/payments.svg | 4 - frontend/dist/icons/penalty-cards.svg | 7 - frontend/dist/icons/piggy-bank-green.svg | 6 - frontend/dist/icons/piggy-bank.svg | 6 - frontend/dist/icons/plus.svg | 3 - frontend/dist/icons/receive-money.svg | 10 - frontend/dist/icons/shield.svg | 10 - frontend/dist/icons/wrench-simple.svg | 10 - frontend/dist/index.html | 41 ----- frontend/dist/iptv.png | Bin 2769 -> 0 bytes frontend/dist/manifest.json | 1 - frontend/dist/person.png | Bin 14097 -> 0 bytes 46 files changed, 6 insertions(+), 358 deletions(-) delete mode 100644 frontend/dist/Idmobile.png delete mode 100644 frontend/dist/Vector.png delete mode 100644 frontend/dist/assets/charts-RKvbJDHG.js delete mode 100644 frontend/dist/assets/data-api-Bj79fh9f.js delete mode 100644 frontend/dist/assets/data-query-DIoVICGX.js delete mode 100644 frontend/dist/assets/editor-complete-b_xua3o6.js delete mode 100644 frontend/dist/assets/index-CLh9TTHC.css delete mode 100644 frontend/dist/assets/index-qvxZ5pjb.js delete mode 100644 frontend/dist/assets/logo-0e8ybaOJ.png delete mode 100644 frontend/dist/assets/quickSessionCheck-CDz9td7h.js delete mode 100644 frontend/dist/assets/react-core-B2bfBmQ1.js delete mode 100644 frontend/dist/assets/react-router-qpxRsT6p.js delete mode 100644 frontend/dist/assets/sessionValidator-CHh5e7zs.js delete mode 100644 frontend/dist/assets/ui-icons-kyIJ9IOi.js delete mode 100644 frontend/dist/assets/ui-utils-CaKPsBzZ.js delete mode 100644 frontend/dist/circle-check-big.png delete mode 100644 frontend/dist/favicon.ico delete mode 100644 frontend/dist/favicon.svg delete mode 100644 frontend/dist/favicon.webp delete mode 100644 frontend/dist/favicon_old.png delete mode 100644 frontend/dist/icons/calculate.svg delete mode 100644 frontend/dist/icons/calculator.svg delete mode 100644 frontend/dist/icons/calendar-clock.svg delete mode 100644 frontend/dist/icons/calendar.svg delete mode 100644 frontend/dist/icons/chevron-down.svg delete mode 100644 frontend/dist/icons/dollar.svg delete mode 100644 frontend/dist/icons/increase.svg delete mode 100644 frontend/dist/icons/login.svg delete mode 100644 frontend/dist/icons/ota-payment.svg delete mode 100644 frontend/dist/icons/payment-protection.svg delete mode 100644 frontend/dist/icons/payment-status.svg delete mode 100644 frontend/dist/icons/payment.svg delete mode 100644 frontend/dist/icons/payments-overlay.svg delete mode 100644 frontend/dist/icons/payments.svg delete mode 100644 frontend/dist/icons/penalty-cards.svg delete mode 100644 frontend/dist/icons/piggy-bank-green.svg delete mode 100644 frontend/dist/icons/piggy-bank.svg delete mode 100644 frontend/dist/icons/plus.svg delete mode 100644 frontend/dist/icons/receive-money.svg delete mode 100644 frontend/dist/icons/shield.svg delete mode 100644 frontend/dist/icons/wrench-simple.svg delete mode 100644 frontend/dist/index.html delete mode 100644 frontend/dist/iptv.png delete mode 100644 frontend/dist/manifest.json delete mode 100644 frontend/dist/person.png diff --git a/.gitignore b/.gitignore index 8622c68dc2..0251e5af77 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,9 @@ node_modules/ .DS_Store *.log vite.config.ts.timestamp-*.mjs + +# Build output +frontend/dist/ + +# Local env (see frontend/.env.example) +.env diff --git a/frontend/dist/Idmobile.png b/frontend/dist/Idmobile.png deleted file mode 100644 index 06f075173441cb6082820b11fe96bf25626c4b2b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1420 zcmV;71#|j|P)HY?e9>=ll?c5$mvY%vb=XPgz zzx&(Y{$_S&ham=4J*4swe+>*3;JgIe0@E16J#e`+P3xOlw6LB{Uj!9bD+nYq5yFzDa=?22jQ6`=X#6k!6 zc(O4xq(K%s7aeb_b5=a|h)839+*DPy#_Q&~3$F-PVFtP|N~xr(>HrA_LJ!oC4|{3l zR#&>66z?ir%PZJnID+lQ5o|Y(V7qYy+l?dGZXCh3!j#+{C75%5+zm;(z8}Q+RgDlcMOjb*V<;>#5VY_hz+X-iEa7PJNczE1#3A>Sw!=X^fbXmq26h+QPQi6lQ zAm--g657Y>^&%@P3s#Z3+~wtEB#M=NqLH$2W@ctW0>~Y*6KE{OLrQQ)MuteK#0hJ5 zW9SkT1?J~dGjc?bk5dFO@^eGM3kwSg#aUVCT#Ji~hJp=ULMC2XWvhqS(83;%N2GMZ zi4t~W=n_jyOCnOFlAN3zxZRt}G88;JJ1brHCyL%3h5Y>dO}87mgltpL3R|7i(876n zc`1#FnSQ2DuD;FBU zl3=osS${m!*nsNCEA@8n{dGSY`1@8^5&wi?HgO z7r#L=u@u%~D}bvvZsORd=kdwWCSCMfLTIku38S{2#M~y9v|9UF61?A6zF}RTw(|Km ziGEaf2fBc0zm3ILRthUvwlIDBKvi)x5z*upk$gO8U#r!$<(lr);d(sNw(&_f5*p!) z*H6GImLEE@5;bTNMYa(n6(#88iHJ_Ld_1I^mn6VfT84Led-V!sB5s+LyHPKevLvNF z{OrCbM54y~u>a4sN@3;UEKlkOAW41Wptp-;d?sUr^Ac(|j$peX!2!xl|2uV6i1ur(8C0aGHbZ#Wuhgn?jiPzhk#s5d2;>II5mKfiWx6;gAeZV5<*B|*?EI@tchc@ z3p{D$@%(oD{0vG7TmkKNdjOlma|fTcF^3<^L#|}Yid`>54YRxNV%fb zYQ2aJzq{S;9c@oJ@(~}4eBWtk7={`ROVjvPS4TNhv*bgM0)?^JBo;B|crI({X>1EH ze9!ZGQk=ODDHACat>0s_$;zl)<_5U`OO}63{pd3Mi6LQit?b(V+A;z6?j1&d# z-^)6u!3S=k(LrfWVyr-xWe0A-buk!zgx+Yk+f8vuR1_QDSZ?Lv10)a;?@m zZk|LU=0~PO$rm!q00000NkvXXu0mjf9k22N diff --git a/frontend/dist/assets/charts-RKvbJDHG.js b/frontend/dist/assets/charts-RKvbJDHG.js deleted file mode 100644 index bd1bafde11..0000000000 --- a/frontend/dist/assets/charts-RKvbJDHG.js +++ /dev/null @@ -1 +0,0 @@ -import"./react-router-qpxRsT6p.js"; diff --git a/frontend/dist/assets/data-api-Bj79fh9f.js b/frontend/dist/assets/data-api-Bj79fh9f.js deleted file mode 100644 index 871a8e0cb1..0000000000 --- a/frontend/dist/assets/data-api-Bj79fh9f.js +++ /dev/null @@ -1 +0,0 @@ -const e={},t=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let t=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),s=(null==r?void 0:r.nonce)||(null==r?void 0:r.getAttribute("nonce"));o=t(n.map(t=>{if((t=function(e){return"/"+e}(t))in e)return;e[t]=!0;const n=t.endsWith(".css"),r=n?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${r}`))return;const o=document.createElement("link");return o.rel=n?"stylesheet":"modulepreload",n||(o.as="script"),o.crossOrigin="",o.href=t,s&&o.setAttribute("nonce",s),document.head.appendChild(o),n?new Promise((e,n)=>{o.addEventListener("load",e),o.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${t}`)))}):void 0}))}function s(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(e=>{for(const t of e||[])"rejected"===t.status&&s(t.reason);return t().catch(s)})};export{t as _}; diff --git a/frontend/dist/assets/data-query-DIoVICGX.js b/frontend/dist/assets/data-query-DIoVICGX.js deleted file mode 100644 index 78a4a36ae2..0000000000 --- a/frontend/dist/assets/data-query-DIoVICGX.js +++ /dev/null @@ -1 +0,0 @@ -var t,e,s,i,n,r,a,o,l,u,h,c,d,f,p,y,v,m,g,b,w,O,P,M,S,q,k,D,A,C,E,F,j,x,Q,R,T,K,W,U,I,_,H,L,G,N=Object.defineProperty,z=Object.defineProperties,B=Object.getOwnPropertyDescriptors,$=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,V=t=>{throw TypeError(t)},X=Math.pow,Z=(t,e,s)=>e in t?N(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,tt=(t,e)=>{for(var s in e||(e={}))J.call(e,s)&&Z(t,s,e[s]);if($)for(var s of $(e))Y.call(e,s)&&Z(t,s,e[s]);return t},et=(t,e)=>z(t,B(e)),st=(t,e)=>{var s={};for(var i in t)J.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&$)for(var i of $(t))e.indexOf(i)<0&&Y.call(t,i)&&(s[i]=t[i]);return s},it=(t,e,s)=>e.has(t)||V("Cannot "+s),nt=(t,e,s)=>(it(t,e,"read from private field"),s?s.call(t):e.get(t)),rt=(t,e,s)=>e.has(t)?V("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),at=(t,e,s,i)=>(it(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),ot=(t,e,s)=>(it(t,e,"access private method"),s),lt=(t,e,s,i)=>({set _(i){at(t,e,i,s)},get _(){return nt(t,e,i)}}),ut=(t,e,s)=>new Promise((i,n)=>{var r=t=>{try{o(s.next(t))}catch(e){n(e)}},a=t=>{try{o(s.throw(t))}catch(e){n(e)}},o=t=>t.done?i(t.value):Promise.resolve(t.value).then(r,a);o((s=s.apply(t,e)).next())});import{r as ht}from"./react-router-qpxRsT6p.js";import{r as ct}from"./react-core-B2bfBmQ1.js";var dt,ft,pt={exports:{}},yt={},vt=(ft||(ft=1,pt.exports=function(){if(dt)return yt;dt=1;var t=ct(),e=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,r={key:!0,ref:!0,__self:!0,__source:!0};function a(t,s,a){var o,l={},u=null,h=null;for(o in void 0!==a&&(u=""+a),void 0!==s.key&&(u=""+s.key),void 0!==s.ref&&(h=s.ref),s)i.call(s,o)&&!r.hasOwnProperty(o)&&(l[o]=s[o]);if(t&&t.defaultProps)for(o in s=t.defaultProps)void 0===l[o]&&(l[o]=s[o]);return{$$typeof:e,type:t,key:u,ref:h,props:l,_owner:n.current}}return yt.Fragment=s,yt.jsx=a,yt.jsxs=a,yt}()),pt.exports),mt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gt={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},bt=new(s=class{constructor(){rt(this,t,gt),rt(this,e,!1)}setTimeoutProvider(e){at(this,t,e)}setTimeout(e,s){return nt(this,t).setTimeout(e,s)}clearTimeout(e){nt(this,t).clearTimeout(e)}setInterval(e,s){return nt(this,t).setInterval(e,s)}clearInterval(e){nt(this,t).clearInterval(e)}},t=new WeakMap,e=new WeakMap,s),wt="undefined"==typeof window||"Deno"in globalThis;function Ot(){}function Pt(t,e){return"function"==typeof t?t(e):t}function Mt(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:r,queryKey:a,stale:o}=t;if(a)if(i){if(e.queryHash!==qt(a,e.options))return!1}else if(!Dt(e.queryKey,a))return!1;if("all"!==s){const t=e.isActive();if("active"===s&&!t)return!1;if("inactive"===s&&t)return!1}return!("boolean"==typeof o&&e.isStale()!==o||n&&n!==e.state.fetchStatus||r&&!r(e))}function St(t,e){const{exact:s,status:i,predicate:n,mutationKey:r}=t;if(r){if(!e.options.mutationKey)return!1;if(s){if(kt(e.options.mutationKey)!==kt(r))return!1}else if(!Dt(e.options.mutationKey,r))return!1}return!(i&&e.state.status!==i||n&&!n(e))}function qt(t,e){return((null==e?void 0:e.queryKeyHashFn)||kt)(t)}function kt(t){return JSON.stringify(t,(t,e)=>Ft(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function Dt(t,e){return t===e||typeof t==typeof e&&!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&Object.keys(e).every(s=>Dt(t[s],e[s]))}var At=Object.prototype.hasOwnProperty;function Ct(t,e){if(t===e)return t;const s=Et(t)&&Et(e);if(!(s||Ft(t)&&Ft(e)))return e;const i=(s?t:Object.keys(t)).length,n=s?e:Object.keys(e),r=n.length,a=s?new Array(r):{};let o=0;for(let l=0;ls?i.slice(1):i}function Rt(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var Tt=Symbol();function Kt(t,e){return!t.queryFn&&(null==e?void 0:e.initialPromise)?()=>e.initialPromise:t.queryFn&&t.queryFn!==Tt?t.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`))}var Wt=new(a=class extends mt{constructor(){super(),rt(this,i),rt(this,n),rt(this,r),at(this,r,t=>{if(!wt&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}onSubscribe(){nt(this,n)||this.setEventListener(nt(this,r))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=nt(this,n))||t.call(this),at(this,n,void 0))}setEventListener(t){var e;at(this,r,t),null==(e=nt(this,n))||e.call(this),at(this,n,t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){nt(this,i)!==t&&(at(this,i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){var t;return"boolean"==typeof nt(this,i)?nt(this,i):"hidden"!==(null==(t=globalThis.document)?void 0:t.visibilityState)}},i=new WeakMap,n=new WeakMap,r=new WeakMap,a);function Ut(t){return t}function It(t){return tt(tt({mutationKey:t.options.mutationKey,state:t.state},t.options.scope&&{scope:t.options.scope}),t.meta&&{meta:t.meta})}function _t(t,e,s){return tt(tt({dehydratedAt:Date.now(),state:tt(tt({},t.state),void 0!==t.state.data&&{data:e(t.state.data)}),queryKey:t.queryKey,queryHash:t.queryHash},"pending"===t.state.status&&{promise:(()=>{var i;const n=null==(i=t.promise)?void 0:i.then(e).catch(t=>s(t)?Promise.reject(new Error("redacted")):Promise.reject(t));return null==n||n.catch(Ot),n})()}),t.meta&&{meta:t.meta})}function Ht(t){return t.state.isPaused}function Lt(t){return"success"===t.state.status}function Gt(t){return!0}function Nt(t,e={}){var s,i,n,r,a,o,l,u,h,c,d,f;const p=null!=(n=null!=(i=e.shouldDehydrateMutation)?i:null==(s=t.getDefaultOptions().dehydrate)?void 0:s.shouldDehydrateMutation)?n:Ht,y=t.getMutationCache().getAll().flatMap(t=>p(t)?[It(t)]:[]),v=null!=(o=null!=(a=e.shouldDehydrateQuery)?a:null==(r=t.getDefaultOptions().dehydrate)?void 0:r.shouldDehydrateQuery)?o:Lt,m=null!=(h=null!=(u=e.shouldRedactErrors)?u:null==(l=t.getDefaultOptions().dehydrate)?void 0:l.shouldRedactErrors)?h:Gt,g=null!=(f=null!=(d=e.serializeData)?d:null==(c=t.getDefaultOptions().dehydrate)?void 0:c.serializeData)?f:Ut;return{mutations:y,queries:t.getQueryCache().getAll().flatMap(t=>v(t)?[_t(t,g,m)]:[])}}function zt(t,e,s){var i,n,r,a;if("object"!=typeof e||null===e)return;const o=t.getMutationCache(),l=t.getQueryCache(),u=null!=(a=null!=(r=null==(i=null==s?void 0:s.defaultOptions)?void 0:i.deserializeData)?r:null==(n=t.getDefaultOptions().hydrate)?void 0:n.deserializeData)?a:Ut,h=e.mutations||[],c=e.queries||[];h.forEach(e=>{var i,n,r=e,{state:a}=r,l=st(r,["state"]);o.build(t,tt(tt(tt({},null==(i=t.getDefaultOptions().hydrate)?void 0:i.mutations),null==(n=null==s?void 0:s.defaultOptions)?void 0:n.mutations),l),a)}),c.forEach(({queryKey:e,state:i,queryHash:n,meta:r,promise:a,dehydratedAt:o})=>{var h,c;const d=a?function(t){var e;let s;if(null==(e=t.then(t=>(s=t,t),Ot))||e.catch(Ot),void 0!==s)return{data:s}}(a):void 0,f=void 0===i.data?null==d?void 0:d.data:i.data,p=void 0===f?f:u(f);let y=l.get(n);const v="pending"===(null==y?void 0:y.state.status),m="fetching"===(null==y?void 0:y.state.fetchStatus);if(y){const t=d&&void 0!==o&&o>y.state.dataUpdatedAt;if(i.dataUpdatedAt>y.state.dataUpdatedAt||t){const t=i,{fetchStatus:e}=t,s=st(t,["fetchStatus"]);y.setState(et(tt({},s),{data:p}))}}else y=l.build(t,et(tt(tt({},null==(h=t.getDefaultOptions().hydrate)?void 0:h.queries),null==(c=null==s?void 0:s.defaultOptions)?void 0:c.queries),{queryKey:e,queryHash:n,meta:r}),et(tt({},i),{data:p,fetchStatus:"idle",status:void 0!==p?"success":i.status}));a&&!v&&!m&&(void 0===o||o>y.state.dataUpdatedAt)&&y.fetch(void 0,{initialPromise:Promise.resolve(a).then(u)}).catch(Ot)})}var Bt=function(t){setTimeout(t,0)},$t=function(){let t=[],e=0,s=t=>{t()},i=t=>{t()},n=Bt;const r=i=>{e?t.push(i):n(()=>{s(i)})};return{batch:r=>{let a;e++;try{a=r()}finally{e--,e||(()=>{const e=t;t=[],e.length&&n(()=>{i(()=>{e.forEach(t=>{s(t)})})})})()}return a},batchCalls:t=>(...e)=>{r(()=>{t(...e)})},schedule:r,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{n=t}}}(),Jt=new(h=class extends mt{constructor(){super(),rt(this,o,!0),rt(this,l),rt(this,u),at(this,u,t=>{if(!wt&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}})}onSubscribe(){nt(this,l)||this.setEventListener(nt(this,u))}onUnsubscribe(){var t;this.hasListeners()||(null==(t=nt(this,l))||t.call(this),at(this,l,void 0))}setEventListener(t){var e;at(this,u,t),null==(e=nt(this,l))||e.call(this),at(this,l,t(this.setOnline.bind(this)))}setOnline(t){nt(this,o)!==t&&(at(this,o,t),this.listeners.forEach(e=>{e(t)}))}isOnline(){return nt(this,o)}},o=new WeakMap,l=new WeakMap,u=new WeakMap,h);function Yt(t){return Math.min(1e3*X(2,t),3e4)}function Vt(t){return"online"!==(null!=t?t:"online")||Jt.isOnline()}var Xt=class extends Error{constructor(t){super("CancelledError"),this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}};function Zt(t){let e,s=!1,i=0;const n=function(){let t,e;const s=new Promise((s,i)=>{t=s,e=i});function i(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},s.reject=t=>{i({status:"rejected",reason:t}),e(t)},s}(),r=()=>"pending"!==n.status,a=()=>Wt.isFocused()&&("always"===t.networkMode||Jt.isOnline())&&t.canRun(),o=()=>Vt(t.networkMode)&&t.canRun(),l=t=>{r()||(null==e||e(),n.resolve(t))},u=t=>{r()||(null==e||e(),n.reject(t))},h=()=>new Promise(s=>{var i;e=t=>{(r()||a())&&s(t)},null==(i=t.onPause)||i.call(t)}).then(()=>{var s;e=void 0,r()||null==(s=t.onContinue)||s.call(t)}),c=()=>{if(r())return;let e;const n=0===i?t.initialPromise:void 0;try{e=null!=n?n:t.fn()}catch(o){e=Promise.reject(o)}Promise.resolve(e).then(l).catch(e=>{var n,o,l;if(r())return;const d=null!=(n=t.retry)?n:wt?0:3,f=null!=(o=t.retryDelay)?o:Yt,p="function"==typeof f?f(i,e):f,y=!0===d||"number"==typeof d&&i{bt.setTimeout(t,v)})).then(()=>a()?void 0:h()).then(()=>{s?u(e):c()})):u(e)})};return{promise:n,status:()=>n.status,cancel:e=>{var s;if(!r()){const i=new Xt(e);u(i),null==(s=t.onCancel)||s.call(t,i)}},continue:()=>(null==e||e(),n),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:o,start:()=>(o()?c():h().then(c),n)}}var te=(d=class{constructor(){rt(this,c)}destroy(){this.clearGcTimeout()}scheduleGc(){var t;this.clearGcTimeout(),"number"==typeof(t=this.gcTime)&&t>=0&&t!==1/0&&at(this,c,bt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,null!=t?t:wt?1/0:3e5)}clearGcTimeout(){nt(this,c)&&(bt.clearTimeout(nt(this,c)),at(this,c,void 0))}},c=new WeakMap,d),ee=(P=class extends te{constructor(t){var e;super(),rt(this,w),rt(this,f),rt(this,p),rt(this,y),rt(this,v),rt(this,m),rt(this,g),rt(this,b),at(this,b,!1),at(this,g,t.defaultOptions),this.setOptions(t.options),this.observers=[],at(this,v,t.client),at(this,y,nt(this,v).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,at(this,f,ie(this.options)),this.state=null!=(e=t.state)?e:nt(this,f),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return null==(t=nt(this,m))?void 0:t.promise}setOptions(t){if(this.options=tt(tt({},nt(this,g)),t),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const t=ie(this.options);void 0!==t.data&&(this.setState(se(t.data,t.dataUpdatedAt)),at(this,f,t))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||nt(this,y).remove(this)}setData(t,e){const s=xt(this.state.data,t,this.options);return ot(this,w,O).call(this,{data:s,type:"success",dataUpdatedAt:null==e?void 0:e.updatedAt,manual:null==e?void 0:e.manual}),s}setState(t,e){ot(this,w,O).call(this,{type:"setState",state:t,setStateOptions:e})}cancel(t){var e,s;const i=null==(e=nt(this,m))?void 0:e.promise;return null==(s=nt(this,m))||s.cancel(t),i?i.then(Ot).catch(Ot):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(nt(this,f))}isActive(){return this.observers.some(t=>{return!1!==("function"==typeof(e=t.options.enabled)?e(this):e);var e})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tt||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===Pt(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!function(t,e){return Math.max(t+(e||0)-Date.now(),0)}(this.state.dataUpdatedAt,t))}onFocus(){var t;const e=this.observers.find(t=>t.shouldFetchOnWindowFocus());null==e||e.refetch({cancelRefetch:!1}),null==(t=nt(this,m))||t.continue()}onOnline(){var t;const e=this.observers.find(t=>t.shouldFetchOnReconnect());null==e||e.refetch({cancelRefetch:!1}),null==(t=nt(this,m))||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),nt(this,y).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(nt(this,m)&&(nt(this,b)?nt(this,m).cancel({revert:!0}):nt(this,m).cancelRetry()),this.scheduleGc()),nt(this,y).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ot(this,w,O).call(this,{type:"invalidate"})}fetch(t,e){return ut(this,null,function*(){var s,i,n,r,a,o,l,u,h,c,d,f;if("idle"!==this.state.fetchStatus&&"rejected"!==(null==(s=nt(this,m))?void 0:s.status()))if(void 0!==this.state.data&&(null==e?void 0:e.cancelRefetch))this.cancel({silent:!0});else if(nt(this,m))return nt(this,m).continueRetry(),nt(this,m).promise;if(t&&this.setOptions(t),!this.options.queryFn){const t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}const g=new AbortController,P=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(at(this,b,!0),g.signal)})},M=()=>{const t=Kt(this.options,e),s=(()=>{const t={client:nt(this,v),queryKey:this.queryKey,meta:this.meta};return P(t),t})();return at(this,b,!1),this.options.persister?this.options.persister(t,s,this):t(s)},S=(()=>{const t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:nt(this,v),state:this.state,fetchFn:M};return P(t),t})();null==(i=this.options.behavior)||i.onFetch(S,this),at(this,p,this.state),"idle"!==this.state.fetchStatus&&this.state.fetchMeta===(null==(n=S.fetchOptions)?void 0:n.meta)||ot(this,w,O).call(this,{type:"fetch",meta:null==(r=S.fetchOptions)?void 0:r.meta}),at(this,m,Zt({initialPromise:null==e?void 0:e.initialPromise,fn:S.fetchFn,onCancel:t=>{t instanceof Xt&&t.revert&&this.setState(et(tt({},nt(this,p)),{fetchStatus:"idle"})),g.abort()},onFail:(t,e)=>{ot(this,w,O).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{ot(this,w,O).call(this,{type:"pause"})},onContinue:()=>{ot(this,w,O).call(this,{type:"continue"})},retry:S.options.retry,retryDelay:S.options.retryDelay,networkMode:S.options.networkMode,canRun:()=>!0}));try{const t=yield nt(this,m).start();if(void 0===t)throw new Error(`${this.queryHash} data is undefined`);return this.setData(t),null==(o=(a=nt(this,y).config).onSuccess)||o.call(a,t,this),null==(u=(l=nt(this,y).config).onSettled)||u.call(l,t,this.state.error,this),t}catch(q){if(q instanceof Xt){if(q.silent)return nt(this,m).promise;if(q.revert){if(void 0===this.state.data)throw q;return this.state.data}}throw ot(this,w,O).call(this,{type:"error",error:q}),null==(c=(h=nt(this,y).config).onError)||c.call(h,q,this),null==(f=(d=nt(this,y).config).onSettled)||f.call(d,this.state.data,q,this),q}finally{this.scheduleGc()}})}},f=new WeakMap,p=new WeakMap,y=new WeakMap,v=new WeakMap,m=new WeakMap,g=new WeakMap,b=new WeakMap,w=new WeakSet,O=function(t){this.state=(e=>{var s,i,n;switch(t.type){case"failed":return et(tt({},e),{fetchFailureCount:t.failureCount,fetchFailureReason:t.error});case"pause":return et(tt({},e),{fetchStatus:"paused"});case"continue":return et(tt({},e),{fetchStatus:"fetching"});case"fetch":return et(tt(tt({},e),(i=e.data,n=this.options,tt({fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Vt(n.networkMode)?"fetching":"paused"},void 0===i&&{error:null,status:"pending"}))),{fetchMeta:null!=(s=t.meta)?s:null});case"success":const r=tt(et(tt(tt({},e),se(t.data,t.dataUpdatedAt)),{dataUpdateCount:e.dataUpdateCount+1}),!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});return at(this,p,t.manual?r:void 0),r;case"error":const a=t.error;return et(tt({},e),{error:a,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"});case"invalidate":return et(tt({},e),{isInvalidated:!0});case"setState":return tt(tt({},e),t.state)}})(this.state),$t.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),nt(this,y).notify({query:this,type:"updated",action:t})})},P);function se(t,e){return{data:t,dataUpdatedAt:null!=e?e:Date.now(),error:null,isInvalidated:!1,status:"success"}}function ie(t){const e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,i=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?null!=i?i:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function ne(t){return{onFetch:(e,s)=>{var i,n,r,a,o;const l=e.options,u=null==(r=null==(n=null==(i=e.fetchOptions)?void 0:i.meta)?void 0:n.fetchMore)?void 0:r.direction,h=(null==(a=e.state.data)?void 0:a.pages)||[],c=(null==(o=e.state.data)?void 0:o.pageParams)||[];let d={pages:[],pageParams:[]},f=0;const p=()=>ut(null,null,function*(){var s;let i=!1;const n=Kt(e.options,e.fetchOptions),r=(t,s,r)=>ut(null,null,function*(){if(i)return Promise.reject();if(null==s&&t.pages.length)return Promise.resolve(t);const a=(()=>{const t={client:e.client,queryKey:e.queryKey,pageParam:s,direction:r?"backward":"forward",meta:e.options.meta};var n;return n=t,Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(e.signal.aborted?i=!0:e.signal.addEventListener("abort",()=>{i=!0}),e.signal)}),t})(),o=yield n(a),{maxPages:l}=e.options,u=r?Rt:Qt;return{pages:u(t.pages,o,l),pageParams:u(t.pageParams,s,l)}});if(u&&h.length){const t="backward"===u,e={pages:h,pageParams:c},s=(t?ae:re)(l,e);d=yield r(e,s,t)}else{const e=null!=t?t:h.length;do{const t=0===f?null!=(s=c[0])?s:l.initialPageParam:re(l,d);if(f>0&&null==t)break;d=yield r(d,t),f++}while(f{var t,i;return null==(i=(t=e.options).persister)?void 0:i.call(t,p,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=p}}}function re(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function ae(t,{pages:e,pageParams:s}){var i;return e.length>0?null==(i=t.getPreviousPageParam)?void 0:i.call(t,e[0],e,s[0],s):void 0}var oe=(C=class extends te{constructor(t){super(),rt(this,D),rt(this,M),rt(this,S),rt(this,q),rt(this,k),at(this,M,t.client),this.mutationId=t.mutationId,at(this,q,t.mutationCache),at(this,S,[]),this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){nt(this,S).includes(t)||(nt(this,S).push(t),this.clearGcTimeout(),nt(this,q).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){at(this,S,nt(this,S).filter(e=>e!==t)),this.scheduleGc(),nt(this,q).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){nt(this,S).length||("pending"===this.state.status?this.scheduleGc():nt(this,q).remove(this))}continue(){var t,e;return null!=(e=null==(t=nt(this,k))?void 0:t.continue())?e:this.execute(this.state.variables)}execute(t){return ut(this,null,function*(){var e,s,i,n,r,a,o,l,u,h,c,d,f,p,y,v,m,g,b,w,O;const P=()=>{ot(this,D,A).call(this,{type:"continue"})},S={client:nt(this,M),meta:this.options.meta,mutationKey:this.options.mutationKey};at(this,k,Zt({fn:()=>this.options.mutationFn?this.options.mutationFn(t,S):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{ot(this,D,A).call(this,{type:"failed",failureCount:t,error:e})},onPause:()=>{ot(this,D,A).call(this,{type:"pause"})},onContinue:P,retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>nt(this,q).canRun(this)}));const C="pending"===this.state.status,E=!nt(this,k).canStart();try{if(C)P();else{ot(this,D,A).call(this,{type:"pending",variables:t,isPaused:E}),yield null==(i=(s=nt(this,q).config).onMutate)?void 0:i.call(s,t,this,S);const e=yield null==(r=(n=this.options).onMutate)?void 0:r.call(n,t,S);e!==this.state.context&&ot(this,D,A).call(this,{type:"pending",context:e,variables:t,isPaused:E})}const e=yield nt(this,k).start();return yield null==(o=(a=nt(this,q).config).onSuccess)?void 0:o.call(a,e,t,this.state.context,this,S),yield null==(u=(l=this.options).onSuccess)?void 0:u.call(l,e,t,this.state.context,S),yield null==(c=(h=nt(this,q).config).onSettled)?void 0:c.call(h,e,null,this.state.variables,this.state.context,this,S),yield null==(f=(d=this.options).onSettled)?void 0:f.call(d,e,null,t,this.state.context,S),ot(this,D,A).call(this,{type:"success",data:e}),e}catch(F){try{throw yield null==(y=(p=nt(this,q).config).onError)?void 0:y.call(p,F,t,this.state.context,this,S),yield null==(m=(v=this.options).onError)?void 0:m.call(v,F,t,this.state.context,S),yield null==(b=(g=nt(this,q).config).onSettled)?void 0:b.call(g,void 0,F,this.state.variables,this.state.context,this,S),yield null==(O=(w=this.options).onSettled)?void 0:O.call(w,void 0,F,t,this.state.context,S),F}finally{ot(this,D,A).call(this,{type:"error",error:F})}}finally{nt(this,q).runNext(this)}})}},M=new WeakMap,S=new WeakMap,q=new WeakMap,k=new WeakMap,D=new WeakSet,A=function(t){this.state=(e=>{switch(t.type){case"failed":return et(tt({},e),{failureCount:t.failureCount,failureReason:t.error});case"pause":return et(tt({},e),{isPaused:!0});case"continue":return et(tt({},e),{isPaused:!1});case"pending":return et(tt({},e),{context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()});case"success":return et(tt({},e),{data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return et(tt({},e),{data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"})}})(this.state),$t.batch(()=>{nt(this,S).forEach(e=>{e.onMutationUpdate(t)}),nt(this,q).notify({mutation:this,type:"updated",action:t})})},C),le=(x=class extends mt{constructor(t={}){super(),rt(this,E),rt(this,F),rt(this,j),this.config=t,at(this,E,new Set),at(this,F,new Map),at(this,j,0)}build(t,e,s){const i=new oe({client:t,mutationCache:this,mutationId:++lt(this,j)._,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){nt(this,E).add(t);const e=ue(t);if("string"==typeof e){const s=nt(this,F).get(e);s?s.push(t):nt(this,F).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(nt(this,E).delete(t)){const e=ue(t);if("string"==typeof e){const s=nt(this,F).get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&nt(this,F).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=ue(t);if("string"==typeof e){const s=nt(this,F).get(e),i=null==s?void 0:s.find(t=>"pending"===t.state.status);return!i||i===t}return!0}runNext(t){var e,s;const i=ue(t);if("string"==typeof i){const n=null==(e=nt(this,F).get(i))?void 0:e.find(e=>e!==t&&e.state.isPaused);return null!=(s=null==n?void 0:n.continue())?s:Promise.resolve()}return Promise.resolve()}clear(){$t.batch(()=>{nt(this,E).forEach(t=>{this.notify({type:"removed",mutation:t})}),nt(this,E).clear(),nt(this,F).clear()})}getAll(){return Array.from(nt(this,E))}find(t){const e=tt({exact:!0},t);return this.getAll().find(t=>St(e,t))}findAll(t={}){return this.getAll().filter(e=>St(t,e))}notify(t){$t.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return $t.batch(()=>Promise.all(t.map(t=>t.continue().catch(Ot))))}},E=new WeakMap,F=new WeakMap,j=new WeakMap,x);function ue(t){var e;return null==(e=t.options.scope)?void 0:e.id}var he=(R=class extends mt{constructor(t={}){super(),rt(this,Q),this.config=t,at(this,Q,new Map)}build(t,e,s){var i;const n=e.queryKey,r=null!=(i=e.queryHash)?i:qt(n,e);let a=this.get(r);return a||(a=new ee({client:t,queryKey:n,queryHash:r,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(n)}),this.add(a)),a}add(t){nt(this,Q).has(t.queryHash)||(nt(this,Q).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=nt(this,Q).get(t.queryHash);e&&(t.destroy(),e===t&&nt(this,Q).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$t.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return nt(this,Q).get(t)}getAll(){return[...nt(this,Q).values()]}find(t){const e=tt({exact:!0},t);return this.getAll().find(t=>Mt(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>Mt(t,e)):e}notify(t){$t.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){$t.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$t.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Q=new WeakMap,R),ce=(G=class{constructor(t={}){rt(this,T),rt(this,K),rt(this,W),rt(this,U),rt(this,I),rt(this,_),rt(this,H),rt(this,L),at(this,T,t.queryCache||new he),at(this,K,t.mutationCache||new le),at(this,W,t.defaultOptions||{}),at(this,U,new Map),at(this,I,new Map),at(this,_,0)}mount(){lt(this,_)._++,1===nt(this,_)&&(at(this,H,Wt.subscribe(t=>ut(this,null,function*(){t&&(yield this.resumePausedMutations(),nt(this,T).onFocus())}))),at(this,L,Jt.subscribe(t=>ut(this,null,function*(){t&&(yield this.resumePausedMutations(),nt(this,T).onOnline())}))))}unmount(){var t,e;lt(this,_)._--,0===nt(this,_)&&(null==(t=nt(this,H))||t.call(this),at(this,H,void 0),null==(e=nt(this,L))||e.call(this),at(this,L,void 0))}isFetching(t){return nt(this,T).findAll(et(tt({},t),{fetchStatus:"fetching"})).length}isMutating(t){return nt(this,K).findAll(et(tt({},t),{status:"pending"})).length}getQueryData(t){var e;const s=this.defaultQueryOptions({queryKey:t});return null==(e=nt(this,T).get(s.queryHash))?void 0:e.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=nt(this,T).build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Pt(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return nt(this,T).findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),n=nt(this,T).get(i.queryHash),r=function(t,e){return"function"==typeof t?t(e):t}(e,null==n?void 0:n.state.data);if(void 0!==r)return nt(this,T).build(this,i).setData(r,et(tt({},s),{manual:!0}))}setQueriesData(t,e,s){return $t.batch(()=>nt(this,T).findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){var e;const s=this.defaultQueryOptions({queryKey:t});return null==(e=nt(this,T).get(s.queryHash))?void 0:e.state}removeQueries(t){const e=nt(this,T);$t.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=nt(this,T);return $t.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries(tt({type:"active"},t),e)))}cancelQueries(t,e={}){const s=tt({revert:!0},e),i=$t.batch(()=>nt(this,T).findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(Ot).catch(Ot)}invalidateQueries(t,e={}){return $t.batch(()=>{var s,i;return nt(this,T).findAll(t).forEach(t=>{t.invalidate()}),"none"===(null==t?void 0:t.refetchType)?Promise.resolve():this.refetchQueries(et(tt({},t),{type:null!=(i=null!=(s=null==t?void 0:t.refetchType)?s:null==t?void 0:t.type)?i:"active"}),e)})}refetchQueries(t,e={}){var s;const i=et(tt({},e),{cancelRefetch:null==(s=e.cancelRefetch)||s}),n=$t.batch(()=>nt(this,T).findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,i);return i.throwOnError||(e=e.catch(Ot)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(n).then(Ot)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=nt(this,T).build(this,e);return s.isStaleByTime(Pt(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ot).catch(Ot)}fetchInfiniteQuery(t){return t.behavior=ne(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ot).catch(Ot)}ensureInfiniteQueryData(t){return t.behavior=ne(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Jt.isOnline()?nt(this,K).resumePausedMutations():Promise.resolve()}getQueryCache(){return nt(this,T)}getMutationCache(){return nt(this,K)}getDefaultOptions(){return nt(this,W)}setDefaultOptions(t){at(this,W,t)}setQueryDefaults(t,e){nt(this,U).set(kt(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...nt(this,U).values()],s={};return e.forEach(e=>{Dt(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){nt(this,I).set(kt(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...nt(this,I).values()],s={};return e.forEach(e=>{Dt(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e=et(tt(tt(tt({},nt(this,W).queries),this.getQueryDefaults(t.queryKey)),t),{_defaulted:!0});return e.queryHash||(e.queryHash=qt(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Tt&&(e.enabled=!1),e}defaultMutationOptions(t){return(null==t?void 0:t._defaulted)?t:et(tt(tt(tt({},nt(this,W).mutations),(null==t?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey)),t),{_defaulted:!0})}clear(){nt(this,T).clear(),nt(this,K).clear()}},T=new WeakMap,K=new WeakMap,W=new WeakMap,U=new WeakMap,I=new WeakMap,_=new WeakMap,H=new WeakMap,L=new WeakMap,G),de=ht.createContext(void 0),fe=({client:t,children:e})=>(ht.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),vt.jsx(de.Provider,{value:t,children:e})),pe=ht.createContext(!1).Provider;export{pe as I,fe as Q,ce as a,Nt as d,zt as h,vt as j,bt as t}; diff --git a/frontend/dist/assets/editor-complete-b_xua3o6.js b/frontend/dist/assets/editor-complete-b_xua3o6.js deleted file mode 100644 index 997d921d91..0000000000 --- a/frontend/dist/assets/editor-complete-b_xua3o6.js +++ /dev/null @@ -1 +0,0 @@ -import"./react-router-qpxRsT6p.js";import"./data-query-DIoVICGX.js"; diff --git a/frontend/dist/assets/index-CLh9TTHC.css b/frontend/dist/assets/index-CLh9TTHC.css deleted file mode 100644 index 4ccbf5573f..0000000000 --- a/frontend/dist/assets/index-CLh9TTHC.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-y-0{top:0;bottom:0}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-1\/4{left:25%}.left-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.z-40{z-index:40}.z-50{z-index:50}.z-\[150\]{z-index:150}.z-\[300\]{z-index:300}.z-\[9999\]{z-index:9999}.order-1{order:1}.order-2{order:2}.m-0{margin:0}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-ml-1{margin-left:-.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-0\.5{margin-right:.125rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-32{max-height:8rem}.max-h-\[90vh\]{max-height:90vh}.min-h-\[16px\]{min-height:16px}.min-h-\[20px\]{min-height:20px}.min-h-\[32px\]{min-height:32px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[10rem\]{min-width:10rem}.min-w-\[16px\]{min-width:16px}.min-w-\[200px\]{min-width:200px}.min-w-\[20px\]{min-width:20px}.min-w-\[32px\]{min-width:32px}.min-w-\[8rem\]{min-width:8rem}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-7xl{max-width:80rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-1{row-gap:.25rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[\#E2E8F0\]{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-orange-300{--tw-border-opacity: 1;border-color:rgb(253 186 116 / var(--tw-border-opacity, 1))}.border-primary{--tw-border-opacity: 1;border-color:rgb(6 71 73 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-300{--tw-border-opacity: 1;border-color:rgb(253 224 71 / var(--tw-border-opacity, 1))}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.bg-\[\#09090B\]\/20{background-color:#09090b33}.bg-\[\#71717A\]\/20{background-color:#71717a33}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity: 1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(6 71 73 / var(--tw-bg-opacity, 1))}.bg-primary\/5{background-color:#0647490d}.bg-primary\/70{background-color:#064749b3}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-60{--tw-bg-opacity: .6}.bg-opacity-75{--tw-bg-opacity: .75}.bg-opacity-80{--tw-bg-opacity: .8}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-600{--tw-gradient-from: #2563eb var(--tw-gradient-from-position);--tw-gradient-to: rgb(37 99 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/10{--tw-gradient-from: rgb(6 71 73 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 71 73 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-indigo-700{--tw-gradient-to: #4338ca var(--tw-gradient-to-position)}.to-primary\/5{--tw-gradient-to: rgb(6 71 73 / .05) var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[10px\]{padding-top:10px;padding-bottom:10px}.pl-10{padding-left:2.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-6xl{font-size:3.75rem;line-height:1}.text-9xl{font-size:8rem;line-height:1}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-\[\#09090B\]{--tw-text-opacity: 1;color:rgb(9 9 11 / var(--tw-text-opacity, 1))}.text-\[\#64748B\]{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-gray-950{--tw-text-opacity: 1;color:rgb(3 7 18 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(6 71 73 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-\[\#5070FE\]{--tw-ring-opacity: 1;--tw-ring-color: rgb(80 112 254 / var(--tw-ring-opacity, 1))}.ring-offset-white{--tw-ring-offset-color: #fff}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.animate-in{animation:fadeInScale .3s cubic-bezier(.16,1,.3,1) forwards}.fade-in{animation:fadeIn .2s ease-out forwards}:root{--header-height: 4rem}@media (min-width: 768px){:root{--header-height: 3.5rem}}html,body{overflow-x:hidden;max-width:100vw}html{scrollbar-gutter:stable;overflow-y:scroll!important}body{overflow-y:auto}*{max-width:100%;box-sizing:border-box}.avatar-image{image-rendering:-webkit-optimize-contrast;image-rendering:crisp-edges;image-rendering:pixelated;backface-visibility:hidden;-webkit-perspective:1000;transform:translateZ(0)}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}.desktop-table-container{overflow:auto!important;scrollbar-width:auto!important;scrollbar-color:#64748b #e2e8f0!important}.desktop-table-container::-webkit-scrollbar{width:14px!important;height:14px!important;display:block!important}.desktop-table-container::-webkit-scrollbar-track{background:#e2e8f0!important;border-radius:7px!important;margin:2px!important}.desktop-table-container::-webkit-scrollbar-thumb{background:#64748b!important;border-radius:7px!important;border:2px solid #e2e8f0!important}.desktop-table-container::-webkit-scrollbar-thumb:hover{background:#475569!important}.desktop-table-container::-webkit-scrollbar-corner{background:#e2e8f0!important}.timeaway-scrollbar{scrollbar-width:thin;scrollbar-color:#cbd5e1 #f1f5f9}.timeaway-scrollbar::-webkit-scrollbar{height:8px;width:8px}.timeaway-scrollbar::-webkit-scrollbar-track{background:#f1f5f9;border-radius:6px}.timeaway-scrollbar::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:6px;border:2px solid #f1f5f9}.timeaway-scrollbar::-webkit-scrollbar-thumb:hover{background:#a8b3bf}.show-scrollbar{overflow:auto!important;scrollbar-width:auto!important;scrollbar-color:#64748b #e2e8f0!important;scrollbar-gutter:stable!important}.show-scrollbar::-webkit-scrollbar{width:14px!important;height:14px!important;display:block!important;-webkit-appearance:none!important}.show-scrollbar::-webkit-scrollbar-track{background:#e2e8f0!important;border-radius:7px!important;margin:2px!important}.show-scrollbar::-webkit-scrollbar-thumb{background:#64748b!important;border-radius:7px!important;border:2px solid #e2e8f0!important}.show-scrollbar::-webkit-scrollbar-thumb:hover{background:#475569!important}.show-scrollbar::-webkit-scrollbar-corner{background:#e2e8f0!important}.sidebar-scroll{overflow-y:auto!important;scrollbar-width:auto!important;scrollbar-color:#cbd5e1 #f1f5f9!important;scrollbar-gutter:stable!important}.sidebar-scroll::-webkit-scrollbar{width:8px!important;display:block!important;-webkit-appearance:none!important}.sidebar-scroll::-webkit-scrollbar-track{background:#f1f5f9!important;border-radius:4px!important}.sidebar-scroll::-webkit-scrollbar-thumb{background:#cbd5e1!important;border-radius:4px!important}.sidebar-scroll::-webkit-scrollbar-thumb:hover{background:#94a3b8!important}.main-content{position:relative;z-index:10}.custom-scrollbar{scrollbar-width:thin;scrollbar-color:#e5e7eb #f9fafb}.custom-scrollbar::-webkit-scrollbar{width:6px}.custom-scrollbar::-webkit-scrollbar-track{background:#f9fafb;border-radius:3px}.custom-scrollbar::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.custom-scrollbar::-webkit-scrollbar-thumb:hover{background:#9ca3af}.sticky-section{position:sticky;z-index:50}.content-safe-area{position:relative;z-index:10}.required:after{content:" *";color:#f43f5e}.no-spinner::-webkit-inner-spin-button,.no-spinner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.no-spinner{-moz-appearance:textfield}@keyframes fadeInScale{0%{opacity:0;transform:scale(.9) translateY(-20px) rotateX(-10deg)}50%{transform:scale(1.02) translateY(-5px) rotateX(-2deg)}to{opacity:1;transform:scale(1) translateY(0) rotateX(0)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideLeft{0%{transform:translate(0);opacity:1}to{transform:translate(-15px) rotateY(-5deg);opacity:.8}}@keyframes slideRight{0%{transform:translate(0);opacity:1}to{transform:translate(15px) rotateY(5deg);opacity:.8}}@keyframes calendarBounce{0%{transform:scale(1)}50%{transform:scale(1.05)}to{transform:scale(1)}}.animate-slideDown{animation:slideDown .3s ease-out forwards}.animate-fadeIn{animation:fadeIn .2s ease-out forwards}.sidebar-skeleton{background:linear-gradient(90deg,#f3f4f6 25%,#e5e7eb,#f3f4f6 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.has-away-start:after{content:attr(data-emoji) " " attr(data-typename);position:absolute;left:4px;top:50%;transform:translateY(-50%);font-size:10px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:10;display:inline-flex;align-items:center}.has-single-day:after{content:attr(data-emoji);position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:12px;z-index:10}.has-away-start{--day-width: calc(attr(data-visible-span-days number)*10px) ;min-width:var(--day-width);max-width:var(--day-width)}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\:text-\[\#71717A\]::-moz-placeholder{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity, 1))}.placeholder\:text-\[\#71717A\]::placeholder{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity, 1))}.placeholder\:text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.placeholder\:text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:left-\[2px\]:after{content:var(--tw-content);left:2px}.after\:top-\[2px\]:after{content:var(--tw-content);top:2px}.after\:h-4:after{content:var(--tw-content);height:1rem}.after\:h-5:after{content:var(--tw-content);height:1.25rem}.after\:w-4:after{content:var(--tw-content);width:1rem}.after\:w-5:after{content:var(--tw-content);width:1.25rem}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:border:after{content:var(--tw-content);border-width:1px}.after\:border-gray-300:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.after\:bg-white:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.after\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.hover\:-translate-y-1:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-700:hover{--tw-bg-opacity: 1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/90:hover{background-color:#064749e6}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-700:hover{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity, 1))}.hover\:text-gray-500:hover{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-800:hover{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-green-800:hover{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.hover\:text-red-800:hover{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\:border-primary:focus{--tw-border-opacity: 1;border-color:rgb(6 71 73 / var(--tw-border-opacity, 1))}.focus\:border-transparent:focus{border-color:transparent}.focus\:bg-gray-50:focus{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.focus\:text-gray-900:focus{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.focus\:ring-gray-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity, 1))}.focus\:ring-indigo-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-primary:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(6 71 73 / var(--tw-ring-opacity, 1))}.focus\:ring-primary\/20:focus{--tw-ring-color: rgb(6 71 73 / .2)}.focus\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus\:ring-yellow-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(234 179 8 / var(--tw-ring-opacity, 1))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-primary:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(6 71 73 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:border-gray-300:disabled{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.disabled\:bg-gray-300:disabled{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.disabled\:text-gray-300:disabled{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\:opacity-100{opacity:1}.peer:checked~.peer-checked\:bg-primary{--tw-bg-opacity: 1;background-color:rgb(6 71 73 / var(--tw-bg-opacity, 1))}.peer:checked~.peer-checked\:after\:translate-x-full:after{content:var(--tw-content);--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:after\:border-white:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.peer:focus~.peer-focus\:outline-none{outline:2px solid transparent;outline-offset:2px}.peer:focus~.peer-focus\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.peer:focus~.peer-focus\:ring-primary\/20{--tw-ring-color: rgb(6 71 73 / .2)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[state\=open\]\:bg-gray-50[data-state=open]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}@media (min-width: 640px){.sm\:mx-auto{margin-left:auto;margin-right:auto}.sm\:ml-6{margin-left:1.5rem}.sm\:block{display:block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-4{height:1rem}.sm\:w-4{width:1rem}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-md{max-width:28rem}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:items-end{align-items:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-1{gap:.25rem}.sm\:gap-4{gap:1rem}.sm\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:.5rem}.sm\:p-1\.5{padding:.375rem}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-2{padding-left:.5rem;padding-right:.5rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-1{padding-top:.25rem;padding-bottom:.25rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\:mt-2{margin-top:.5rem}.md\:block{display:block}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:static{position:static}.lg\:order-1{order:1}.lg\:order-2{order:2}.lg\:mt-0{margin-top:0}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:h-full{height:100%}.lg\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:p-6{padding:1.5rem}.lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:py-4{padding-top:1rem;padding-bottom:1rem}.lg\:text-base{font-size:1rem;line-height:1.5rem}.lg\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (prefers-color-scheme: dark){.dark\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}}.custom-datepicker-calendar{font-family:inherit!important;border:1px solid #e5e7eb!important;border-radius:12px!important;box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a!important;background-color:#fff!important;padding:6px!important;min-width:260px!important;max-width:300px!important;z-index:100000!important}.custom-datepicker-calendar-responsive{font-family:inherit!important;border:1px solid #e5e7eb!important;border-radius:12px!important;box-shadow:0 10px 25px -5px #0000001a,0 5px 10px -5px #0000000a!important;background-color:#fff!important;padding:8px!important;width:320px!important;z-index:100000!important}.react-datepicker-popper{z-index:9999!important;width:auto!important;position:absolute!important;transform:translateZ(0)!important}.react-datepicker__portal .react-datepicker-popper{min-width:320px!important;max-width:min(380px,calc(100vw - 40px))!important}.datepicker-calendar-container{width:auto!important;display:inline-block!important}.date-picker-wrapper{max-width:100%!important;overflow:visible!important;position:relative!important}.react-datepicker__tab-loop{position:absolute!important;top:auto!important;left:auto!important}.react-datepicker-wrapper{display:block!important;width:100%!important}.react-datepicker-popper[data-placement^=bottom]{margin-top:4px!important}.react-datepicker-popper[data-placement^=top]{margin-bottom:4px!important}.react-datepicker-popper[data-placement^=right]{margin-left:4px!important}.react-datepicker-popper[data-placement^=left]{margin-right:4px!important}.custom-datepicker-calendar .react-datepicker__header{background:linear-gradient(to right,#14b8a6,#0d9488)!important;border:none!important;border-radius:8px 8px 0 0!important;padding-top:8px!important;margin:-6px -6px 6px!important}.custom-datepicker-calendar-responsive .react-datepicker__header{background:linear-gradient(to right,#14b8a6,#0d9488)!important;border:none!important;border-radius:8px 8px 0 0!important;padding:12px 8px!important;margin:-12px -12px 12px!important}.custom-datepicker-calendar .react-datepicker__current-month{color:#fff!important;font-weight:600!important;font-size:16px!important;padding:4px 0!important}.custom-datepicker-calendar-responsive .react-datepicker__current-month{color:#fff!important;font-weight:700!important;font-size:18px!important;padding:6px 0!important;letter-spacing:.5px!important}.custom-datepicker-calendar .react-datepicker__day-names{margin-top:8px!important}.custom-datepicker-calendar-responsive .react-datepicker__day-names{margin-top:8px!important;display:flex!important;justify-content:space-between!important;width:100%!important}.custom-datepicker-calendar .react-datepicker__day-name{color:#ffffffe6!important;font-weight:600!important;font-size:11px!important;width:32px!important;line-height:32px!important;margin:1px!important}.custom-datepicker-calendar-responsive .react-datepicker__day-name{color:#fffffff2!important;font-weight:600!important;font-size:11px!important;width:38px!important;line-height:32px!important;margin:2px!important;text-transform:uppercase!important;display:inline-block!important}.custom-datepicker-calendar .react-datepicker__navigation{top:12px!important;width:28px!important;height:28px!important;border:none!important}.custom-datepicker-calendar-responsive .react-datepicker__navigation{top:14px!important;width:32px!important;height:32px!important;border:none!important;background:#ffffff1a!important;border-radius:6px!important}.custom-datepicker-calendar .react-datepicker__navigation-icon:before{border-color:#fff!important;border-width:2px 2px 0 0!important;top:10px!important}.custom-datepicker-calendar .react-datepicker__navigation:hover{background:#fff3!important;border-radius:8px!important}.custom-datepicker-calendar-responsive .react-datepicker__navigation:hover{background:#ffffff40!important}.custom-datepicker-calendar .react-datepicker__month-select,.custom-datepicker-calendar .react-datepicker__year-select{background-color:#ffffffe6!important;border:1px solid rgba(255,255,255,.3)!important;border-radius:6px!important;padding:4px 8px!important;margin:0 4px!important;font-weight:500!important;color:#0d9488!important;cursor:pointer!important;transition:all .2s!important}.custom-datepicker-calendar-responsive .react-datepicker__month-select,.custom-datepicker-calendar-responsive .react-datepicker__year-select{background-color:#fffffff2!important;border:2px solid rgba(255,255,255,.4)!important;border-radius:8px!important;padding:6px 12px!important;margin:0 6px!important;font-weight:600!important;font-size:14px!important;color:#0d9488!important;cursor:pointer!important;transition:all .2s!important;min-height:36px!important}.custom-datepicker-calendar .react-datepicker__month-select:hover,.custom-datepicker-calendar .react-datepicker__year-select:hover{background-color:#fff!important;border-color:#fff!important;box-shadow:0 1px 3px #0000001a!important}.custom-datepicker-calendar .react-datepicker__month-select:focus,.custom-datepicker-calendar .react-datepicker__year-select:focus{outline:2px solid white!important;outline-offset:2px!important}.custom-datepicker-calendar .react-datepicker__month,.custom-datepicker-calendar-responsive .react-datepicker__month{margin:8px 0!important}.custom-datepicker-calendar-responsive .react-datepicker__week{display:flex!important;justify-content:space-between!important;width:100%!important}.custom-datepicker-calendar .react-datepicker__week{display:flex!important;justify-content:space-around!important}.custom-datepicker-calendar .react-datepicker__day{color:#374151!important;width:32px!important;height:32px!important;line-height:32px!important;margin:1px!important;border-radius:8px!important;font-weight:500!important;font-size:13px!important;transition:all .2s ease!important;position:relative!important}.custom-datepicker-calendar-responsive .react-datepicker__day{color:#374151!important;width:38px!important;height:38px!important;line-height:38px!important;margin:2px!important;border-radius:8px!important;font-weight:500!important;font-size:14px!important;transition:all .2s ease!important;position:relative!important;display:inline-block!important}.custom-datepicker-calendar .react-datepicker__day:hover:not(.react-datepicker__day--disabled){background-color:#f0fdfa!important;color:#14b8a6!important;transform:scale(1.1)!important}.custom-datepicker-calendar-responsive .react-datepicker__day:hover:not(.react-datepicker__day--disabled){background-color:#f0fdfa!important;color:#14b8a6!important;transform:scale(1.05)!important;box-shadow:0 4px 6px -1px #0000001a!important}.custom-datepicker-calendar .react-datepicker__day--selected{background:linear-gradient(135deg,#14b8a6,#0d9488)!important;color:#fff!important;font-weight:600!important;box-shadow:0 4px 12px #14b8a666!important}.custom-datepicker-calendar-responsive .react-datepicker__day--selected{background:linear-gradient(135deg,#14b8a6,#0d9488)!important;color:#fff!important;font-weight:600!important;box-shadow:0 6px 16px #14b8a680!important;transform:scale(1.05)!important}.custom-datepicker-calendar .react-datepicker__day--selected:hover{background:linear-gradient(135deg,#0d9488,#0f766e)!important;transform:scale(1.1)!important}.custom-datepicker-calendar .react-datepicker__day--today{background-color:#e6fffa!important;color:#14b8a6!important;font-weight:600!important;position:relative!important}.custom-datepicker-calendar .react-datepicker__day--today:after{content:"";position:absolute;bottom:4px;left:50%;transform:translate(-50%);width:4px;height:4px;background-color:#14b8a6;border-radius:50%}.custom-datepicker-calendar .react-datepicker__day--disabled{color:#d1d5db!important;cursor:not-allowed!important;opacity:.5!important}.custom-datepicker-calendar .react-datepicker__day--disabled:hover{background-color:transparent!important;transform:scale(1)!important}.custom-datepicker-calendar .react-datepicker__day--outside-month{color:#9ca3af!important;opacity:.5!important}.custom-datepicker-calendar-responsive .react-datepicker__day--outside-month{color:#d1d5db!important;opacity:.4!important}.custom-datepicker-calendar .react-datepicker__day--keyboard-selected{background-color:#f3f4f6!important;border:2px solid #14b8a6!important;line-height:32px!important}.custom-datepicker-calendar .react-datepicker__day--in-range{background-color:#ccfbf1!important;color:#0d9488!important}.custom-datepicker-calendar .react-datepicker__day--range-start,.custom-datepicker-calendar .react-datepicker__day--range-end{background:linear-gradient(135deg,#14b8a6,#0d9488)!important;color:#fff!important;font-weight:600!important}@media (max-width: 640px){.custom-datepicker-calendar{min-width:260px!important;max-width:290px!important;font-size:13px!important;padding:4px!important}.custom-datepicker-calendar .react-datepicker__day{width:28px!important;height:28px!important;line-height:28px!important;margin:1px!important;font-size:12px!important}.custom-datepicker-calendar .react-datepicker__day-name{width:28px!important;line-height:28px!important;margin:1px!important;font-size:10px!important}.custom-datepicker-calendar .react-datepicker__current-month{font-size:13px!important}.custom-datepicker-calendar .react-datepicker__navigation{width:24px!important;height:24px!important;top:10px!important}.custom-datepicker-calendar .react-datepicker__header{padding-top:6px!important;margin:-4px -4px 4px!important}}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.react-datepicker-popper{animation:slideDown .2s ease-out;z-index:100000!important}.react-datepicker-popper[data-placement^=top]{animation:slideUp .2s ease-out}@keyframes slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.react-datepicker__portal{position:fixed!important;width:100vw!important;height:100vh!important;top:0!important;left:0!important;z-index:100000!important;display:flex!important;align-items:center!important;justify-content:center!important;background-color:#0006!important}.react-datepicker__portal .react-datepicker__overlay{position:static!important;background:transparent!important}.custom-datepicker-calendar-portal{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif!important;border:none!important;border-radius:12px!important;box-shadow:0 10px 40px #0003!important;background-color:#fff!important;padding:0!important;width:320px!important;max-width:calc(100vw - 40px)!important;animation:fadeInScale .15s ease-out!important;overflow:hidden!important}@keyframes fadeInScale{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.custom-datepicker-calendar-portal .react-datepicker__header{background:#fff!important;border:none!important;border-bottom:1px solid #f3f4f6!important;padding:16px 16px 0!important;margin:0!important}.custom-datepicker-calendar-portal .react-datepicker__current-month{color:#111827!important;font-weight:600!important;font-size:15px!important;padding:0 0 12px!important;text-align:center!important}.custom-datepicker-calendar-portal .react-datepicker__day-names{margin:0!important;padding:12px 16px 8px!important;display:flex!important;justify-content:space-between!important;background:#fff!important}.custom-datepicker-calendar-portal .react-datepicker__day-name{color:#6b7280!important;font-weight:500!important;font-size:12px!important;width:36px!important;line-height:20px!important;text-align:center!important;text-transform:uppercase!important;letter-spacing:.5px!important}.custom-datepicker-calendar-portal .react-datepicker__month{padding:8px 16px 16px!important;margin:0!important}.custom-datepicker-calendar-portal .react-datepicker__week{display:flex!important;justify-content:space-between!important;margin-bottom:2px!important}.custom-datepicker-calendar-portal .react-datepicker__day{color:#1f2937!important;width:36px!important;height:36px!important;line-height:36px!important;margin:0!important;border-radius:6px!important;font-weight:400!important;font-size:14px!important;text-align:center!important;transition:all .15s ease!important;cursor:pointer!important;position:relative!important}.custom-datepicker-calendar-portal .react-datepicker__day:hover:not(.react-datepicker__day--disabled):not(.react-datepicker__day--selected){background-color:#f3f4f6!important;color:#111827!important}.custom-datepicker-calendar-portal .react-datepicker__day--selected{background:#14b8a6!important;color:#fff!important;font-weight:500!important}.custom-datepicker-calendar-portal .react-datepicker__day--selected:hover{background:#0d9488!important}.custom-datepicker-calendar-portal .react-datepicker__day--today{font-weight:600!important;color:#14b8a6!important}.custom-datepicker-calendar-portal .react-datepicker__day--today:after{content:"";position:absolute;bottom:4px;left:50%;transform:translate(-50%);width:4px;height:4px;background:#14b8a6;border-radius:50%}.custom-datepicker-calendar-portal .react-datepicker__day--outside-month{color:#d1d5db!important}.custom-datepicker-calendar-portal .react-datepicker__day--disabled{color:#e5e7eb!important;cursor:not-allowed!important}.custom-datepicker-calendar-portal .react-datepicker__day--disabled:hover{background:transparent!important}.custom-datepicker-calendar-portal .react-datepicker__navigation{top:18px!important;width:28px!important;height:28px!important;background:transparent!important;border:none!important;border-radius:4px!important;transition:background .15s ease!important}.custom-datepicker-calendar-portal .react-datepicker__navigation:hover{background:#f3f4f6!important}.custom-datepicker-calendar-portal .react-datepicker__navigation-icon:before{border-color:#6b7280!important;border-width:2px 2px 0 0!important;width:8px!important;height:8px!important;top:9px!important}.custom-datepicker-calendar-portal .react-datepicker__navigation--previous{left:8px!important}.custom-datepicker-calendar-portal .react-datepicker__navigation--next{right:8px!important}.custom-datepicker-calendar-portal .react-datepicker__month-select,.custom-datepicker-calendar-portal .react-datepicker__year-select{background-color:#fff!important;border:1px solid #e5e7eb!important;border-radius:6px!important;padding:4px 8px!important;margin:0 2px!important;font-weight:500!important;color:#374151!important;cursor:pointer!important;font-size:13px!important;transition:all .15s ease!important}.custom-datepicker-calendar-portal .react-datepicker__month-select:hover,.custom-datepicker-calendar-portal .react-datepicker__year-select:hover{border-color:#14b8a6!important;background:#f0fdfa!important}.custom-datepicker-calendar-portal .react-datepicker__month-select:focus,.custom-datepicker-calendar-portal .react-datepicker__year-select:focus{outline:none!important;border-color:#14b8a6!important;box-shadow:0 0 0 3px #14b8a61a!important}.react-datepicker__triangle{display:none!important}.inline-calendar-compact{font-family:inherit!important;border:none!important;box-shadow:none!important;background-color:transparent!important;padding:0!important;width:100%!important}.inline-calendar-compact .react-datepicker__header{background:#f3f4f6!important;border:none!important;border-radius:6px 6px 0 0!important;padding:6px!important}.inline-calendar-compact .react-datepicker__current-month{color:#374151!important;font-weight:600!important;font-size:13px!important;padding:2px 0!important}.inline-calendar-compact .react-datepicker__month{margin:4px 0!important}.inline-calendar-compact .react-datepicker__day-name{color:#6b7280!important;font-weight:500!important;font-size:10px!important;width:28px!important;line-height:24px!important;margin:1px!important}.inline-calendar-compact .react-datepicker__day{color:#374151!important;width:28px!important;height:24px!important;line-height:24px!important;margin:1px!important;border-radius:4px!important;font-size:12px!important}.inline-calendar-compact .react-datepicker__day:hover:not(.react-datepicker__day--disabled){background-color:#e0f2fe!important;color:#0284c7!important}.inline-calendar-compact .react-datepicker__day--selected{background:#14b8a6!important;color:#fff!important;font-weight:600!important}.inline-calendar-compact .react-datepicker__day--today{background-color:#fef3c7!important;color:#92400e!important;font-weight:600!important}.inline-calendar-compact .react-datepicker__day--disabled{color:#d1d5db!important;cursor:not-allowed!important}.inline-calendar-compact .react-datepicker__navigation{top:8px!important;width:24px!important;height:24px!important}.inline-calendar-compact .react-datepicker__navigation-icon:before{border-color:#6b7280!important;border-width:2px 2px 0 0!important;top:8px!important}.inline-calendar-compact .react-datepicker__month-select,.inline-calendar-compact .react-datepicker__year-select{background-color:#fff!important;border:1px solid #d1d5db!important;border-radius:4px!important;padding:2px 4px!important;margin:0 2px!important;font-size:12px!important;color:#374151!important}.date-picker-wrapper,.date-picker-wrapper *,.react-datepicker-wrapper,.react-datepicker-wrapper *,.react-datepicker__input-container,.react-datepicker__input-container *{outline:none!important;box-shadow:none!important}.date-picker-wrapper input,.react-datepicker-wrapper input,.react-datepicker__input-container input{outline:none!important;outline-width:0!important;outline-style:none!important;outline-color:transparent!important;-webkit-tap-highlight-color:transparent!important;-webkit-focus-ring-color:transparent!important}.date-picker-wrapper input:focus,.date-picker-wrapper input:focus-visible,.date-picker-wrapper input:active,.react-datepicker-wrapper input:focus,.react-datepicker-wrapper input:focus-visible,.react-datepicker-wrapper input:active,.react-datepicker__input-container input:focus,.react-datepicker__input-container input:focus-visible,.react-datepicker__input-container input:active{outline:none!important;outline-width:0!important;outline-style:none!important;outline-color:transparent!important;box-shadow:none!important;-webkit-tap-highlight-color:transparent!important;-webkit-focus-ring-color:transparent!important} diff --git a/frontend/dist/assets/index-qvxZ5pjb.js b/frontend/dist/assets/index-qvxZ5pjb.js deleted file mode 100644 index 6dbc24ebc3..0000000000 --- a/frontend/dist/assets/index-qvxZ5pjb.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sessionValidator-CHh5e7zs.js","assets/data-query-DIoVICGX.js","assets/react-router-qpxRsT6p.js","assets/react-core-B2bfBmQ1.js","assets/data-api-Bj79fh9f.js","assets/ui-icons-kyIJ9IOi.js","assets/ui-utils-CaKPsBzZ.js","assets/quickSessionCheck-CDz9td7h.js"])))=>i.map(i=>d[i]); -var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,i=(t,r,s)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,a=(e,t)=>{for(var r in t||(t={}))n.call(t,r)&&i(e,r,t[r]);if(s)for(var r of s(t))o.call(t,r)&&i(e,r,t[r]);return e},l=(e,s)=>t(e,r(s)),c=(e,t,r)=>i(e,"symbol"!=typeof t?t+"":t,r),u=(e,t,r)=>new Promise((s,n)=>{var o=e=>{try{a(r.next(e))}catch(t){n(t)}},i=e=>{try{a(r.throw(e))}catch(t){n(t)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(o,i);a((r=r.apply(e,t)).next())});import{j as d,h,d as p,Q as g,I as m,t as f,a as y}from"./data-query-DIoVICGX.js";import{r as v,N as x,u as b,a as S,R as w,L as k,b as _,m as N,B as C,c as j,d as I}from"./react-router-qpxRsT6p.js";import{a as A,g as R}from"./react-core-B2bfBmQ1.js";import{_ as P}from"./data-api-Bj79fh9f.js";import{P as E,a as O,X as T,U as L,L as D,b as $,R as M,A as q,W as F,c as U,S as z,K as V,d as H,M as B,e as J,f as W,g as K,C as G,h as Y,i as Q,j as X,k as Z,l as ee,I as te,B as re,m as se,n as ne,o as oe,p as ie,q as ae,r as le,s as ce,t as ue,u as de,v as he,E as pe,w as ge,x as me,V as fe}from"./ui-icons-kyIJ9IOi.js";import{n as ye,F as ve}from"./ui-utils-CaKPsBzZ.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const r of e)if("childList"===r.type)for(const e of r.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var xe,be={},Se=function(){if(xe)return be;xe=1;var e=A();return be.createRoot=e.createRoot,be.hydrateRoot=e.hydrateRoot,be}();const we=new class{constructor(){c(this,"subscribers",[]),c(this,"session",null),c(this,"storageKey","base360-auth-token"),this.loadSession()}getApiUrl(){return"http://localhost:8000"}notifySubscribers(e,t){console.log(`📣 [LocalAuth] Notifying ${this.subscribers.length} subscribers of event: ${e}`),this.subscribers.forEach(r=>{try{r(e,t)}catch(s){console.error("📣 [LocalAuth] Error in subscriber callback:",s)}})}saveSession(e){this.session=e,e?(localStorage.setItem(this.storageKey,JSON.stringify(e)),this.notifySubscribers("SIGNED_IN",e)):(localStorage.removeItem(this.storageKey),this.notifySubscribers("SIGNED_OUT",null))}loadSession(){try{const e=localStorage.getItem(this.storageKey);e&&(this.session=JSON.parse(e))}catch(e){console.warn("[LocalAuth] Failed to load session from storage:",e),localStorage.removeItem(this.storageKey)}}signInWithPassword(e){return u(this,null,function*(){try{const t=yield fetch(`${this.getApiUrl()}/api/v1/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=yield t.json();if(!t.ok)throw new Error(r.detail||r.error||`HTTP ${t.status}`);if(r.error)throw new Error(r.error);const s={access_token:r.access_token,token_type:r.token_type||"bearer",user:r.user};return this.saveSession(s),{user:r.user,session:s,error:null}}catch(t){return console.error("[LocalAuth] Sign in failed:",t),{user:null,session:null,error:t}}})}signOut(){return u(this,null,function*(){var e;try{if(null==(e=this.session)?void 0:e.access_token)try{yield fetch(`${this.getApiUrl()}/api/v1/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${this.session.access_token}`}})}catch(t){console.warn("[LocalAuth] Backend logout failed (continuing):",t)}return this.saveSession(null),{error:null}}catch(r){return console.error("[LocalAuth] Sign out failed:",r),{error:r}}})}getSession(){return u(this,null,function*(){var e;if(null==(e=this.session)?void 0:e.access_token)try{if((yield fetch(`${this.getApiUrl()}/api/v1/auth/me`,{headers:{Authorization:`Bearer ${this.session.access_token}`}})).ok)return{data:{session:this.session}};this.saveSession(null)}catch(t){console.warn("[LocalAuth] Session validation failed:",t),this.saveSession(null)}return{data:{session:null}}})}getUser(e){return u(this,null,function*(){var t;const r=e||(null==(t=this.session)?void 0:t.access_token);if(!r)return{user:null};try{const e=yield fetch(`${this.getApiUrl()}/api/v1/auth/me`,{headers:{Authorization:`Bearer ${r}`}});return e.ok?{user:yield e.json()}:{user:null}}catch(s){return console.error("[LocalAuth] Get user failed:",s),{user:null}}})}setSession(e){return u(this,null,function*(){try{return this.saveSession(e),{error:null}}catch(t){return{error:t}}})}onAuthStateChange(e){return this.subscribers.push(e),e("INITIAL_SESSION",this.session),{data:{subscription:{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}}}get auth(){return{admin:{getUser:this.getUser.bind(this),getUserById:e=>this.getUser(),listUsers:()=>Promise.resolve([])},signInWithPassword:this.signInWithPassword.bind(this),signOut:this.signOut.bind(this),getSession:this.getSession.bind(this),getUser:this.getUser.bind(this),setSession:this.setSession.bind(this),onAuthStateChange:this.onAuthStateChange.bind(this)}}};console.log("✅ Using local authentication client instead of Supabase");const ke=we;"undefined"!=typeof window&&ke.auth.getSession().then(({data:{session:e}})=>{e?console.log("✅ Session found on page load:",e.user.email):console.log("ℹ️ No session found on page load")});const _e="session_metadata",Ne="storage_health",Ce="corruption_detected",je="2.0.0",Ie=class e{constructor(){c(this,"currentContext",{}),c(this,"healthCheckInterval",null),c(this,"NAMESPACE_SEPARATOR","::"),c(this,"MAX_STORAGE_SIZE",5242880),this.initializeHealthMonitoring()}static getInstance(){return e.instance||(e.instance=new e),e.instance}setContext(e){console.log("[StorageManager] Setting context:",{tenant_id:e.tenant_id,user_id:e.user_id,email:e.email}),this.currentContext=a({},e),this.updateStorageHealth()}clearContext(){console.log("[StorageManager] Clearing context"),this.currentContext={}}getNamespacedKey(e,t){const r=a(a({},this.currentContext),t);return r.tenant_id&&r.user_id?`${r.tenant_id}${this.NAMESPACE_SEPARATOR}${r.user_id}${this.NAMESPACE_SEPARATOR}${e}`:r.user_id?`${r.user_id}${this.NAMESPACE_SEPARATOR}${e}`:e}generateIntegrityHash(e){const t=JSON.stringify(e);let r=0;for(let s=0;sthis.MAX_STORAGE_SIZE?(console.warn("[StorageManager] Item too large for storage:",{key:s,size:o.length,limit:this.MAX_STORAGE_SIZE}),!1):(localStorage.setItem(s,o),console.log("[StorageManager] Set item:",{originalKey:e,namespacedKey:s,hasIntegrity:!!n.integrity_hash,size:o.length}),!0)}catch(s){return console.error("[StorageManager] Failed to set item:",{key:e,error:s instanceof Error?s.message:String(s)}),this.markCorruption(s),!1}}get(e,t){try{const r=this.getNamespacedKey(e,null==t?void 0:t.context),s=localStorage.getItem(r);if(!s)return(null==t?void 0:t.defaultValue)||null;const n=JSON.parse(s);return n.expires_at&&Date.now()>n.expires_at?(console.log("[StorageManager] Item expired, removing:",r),this.remove(e,t),(null==t?void 0:t.defaultValue)||null):(null==t?void 0:t.skipIntegrityCheck)||this.validateIntegrity(n)?(console.log("[StorageManager] Retrieved item:",{originalKey:e,namespacedKey:r,timestamp:new Date(n.timestamp).toISOString(),hasIntegrity:!!n.integrity_hash}),n.data):(console.warn("[StorageManager] Integrity validation failed, removing corrupted item:",r),this.remove(e,t),this.markCorruption("integrity_validation_failed"),(null==t?void 0:t.defaultValue)||null)}catch(r){return console.error("[StorageManager] Failed to get item:",{key:e,error:r instanceof Error?r.message:String(r)}),this.remove(e,t),this.markCorruption(r),(null==t?void 0:t.defaultValue)||null}}remove(e,t){try{const r=this.getNamespacedKey(e,null==t?void 0:t.context);return localStorage.removeItem(r),console.log("[StorageManager] Removed item:",{originalKey:e,namespacedKey:r}),!0}catch(r){return console.error("[StorageManager] Failed to remove item:",{key:e,error:r instanceof Error?r.message:String(r)}),!1}}clearUserData(e){const t=a(a({},this.currentContext),e);if(!t.user_id)return console.warn("[StorageManager] No user context to clear"),0;let r=0;const s=[];for(let n=0;n=2){const n=r[0],o=r[1];t.tenant_id&&t.user_id?n===t.tenant_id&&o===t.user_id&&s.push(e):t.user_id&&(o!==t.user_id&&n!==t.user_id||s.push(e))}}return s.forEach(e=>{localStorage.removeItem(e),r++}),console.log("[StorageManager] Cleared user data:",{context:t,clearedCount:r,keys:s}),r}clearAll(){const e=localStorage.length;localStorage.clear(),console.log("[StorageManager] Nuclear clear completed:",{clearedItems:e}),this.updateStorageHealth()}markCorruption(e){try{const t={timestamp:Date.now(),error:e instanceof Error?e.message:String(e),context:this.currentContext,user_agent:navigator.userAgent};localStorage.setItem(Ce,JSON.stringify(t)),console.warn("[StorageManager] Storage corruption marked:",t)}catch(t){console.error("[StorageManager] Failed to mark corruption:",t)}}isCorrupted(){try{return null!==localStorage.getItem(Ce)}catch(e){return!0}}updateStorageHealth(){try{const e={timestamp:Date.now(),version:je,context:this.currentContext,storage_size:this.getStorageSize(),item_count:localStorage.length};localStorage.setItem(Ne,JSON.stringify(e))}catch(e){console.error("[StorageManager] Failed to update health:",e)}}getStorageSize(){let e=0;for(let t=0;t{this.updateStorageHealth(),this.cleanupExpiredItems()},3e5),this.updateStorageHealth()}cleanupExpiredItems(){const e=Date.now(),t=[];for(let s=0;ss.expires_at&&t.push(n)}catch(r){t.push(n)}}t.length>0&&(t.forEach(e=>localStorage.removeItem(e)),console.log("[StorageManager] Cleaned up expired items:",t.length))}getDiagnostics(){const e=this.getStorageSize(),t=localStorage.length,r=this.isCorrupted();return{version:je,context:this.currentContext,total_size:e,total_size_mb:(e/1048576).toFixed(2),item_count:t,is_corrupted:r,max_size:this.MAX_STORAGE_SIZE,usage_percentage:(e/this.MAX_STORAGE_SIZE*100).toFixed(1)}}destroy(){this.healthCheckInterval&&(clearInterval(this.healthCheckInterval),this.healthCheckInterval=null)}};c(Ie,"instance");const Ae=Ie.getInstance();"undefined"!=typeof window&&(window.storageManager=Ae,window.getStorageDiagnostics=()=>Ae.getDiagnostics());const Re=class e{constructor(){c(this,"lastHealthCheck",0),c(this,"healthCheckInterval",null),c(this,"HEALTH_CHECK_INTERVAL",6e5),c(this,"MAX_ITEM_AGE_HOURS",24),c(this,"MAX_ORPHANED_AGE_HOURS",1),this.startHealthMonitoring()}static getInstance(){return e.instance||(e.instance=new e),e.instance}performHealthCheck(e){return u(this,null,function*(){const t=Date.now();console.log("[StorageHealthChecker] Starting comprehensive health check...");const r=[];let s=!1;try{const n=this.checkForCorruption();r.push(...n);const o=yield this.checkForOrphanedData();r.push(...o);const i=this.checkVersionMismatches();r.push(...i);const a=yield this.checkSessionConflicts();r.push(...a);const l=this.checkStorageSize();r.push(...l),(null==e?void 0:e.autoFix)&&(s=yield this.autoFixIssues(r));const c=this.generateDiagnostics(),u=this.determineOverallHealth(r),d={overall_health:u,issues:r,diagnostics:c,recommendations:this.generateRecommendations(r,c),auto_fix_applied:s,timestamp:Date.now()};Ae.set(Ne,d,{skipIntegrityCheck:!0,ttl:864e5});const h=Date.now()-t;return console.log("[StorageHealthChecker] Health check completed:",{duration_ms:h,overall_health:u,issues_found:r.length,auto_fix_applied:s}),this.lastHealthCheck=Date.now(),d}catch(n){return console.error("[StorageHealthChecker] Health check failed:",n),{overall_health:"critical",issues:[{type:"corruption",severity:"critical",description:`Health check system failure: ${n instanceof Error?n.message:String(n)}`,affected_keys:[],auto_fixable:!1}],diagnostics:this.generateDiagnostics(),recommendations:["Perform manual storage cleanup","Contact technical support"],auto_fix_applied:!1,timestamp:Date.now()}}})}checkForCorruption(){const e=[],t=[];for(let s=0;sDate.now())&&t.push(e),s.version&&"string"!=typeof s.version&&t.push(e)}}catch(r){t.push(e)}}return t.length>0&&e.push({type:"corruption",severity:t.length>10?"critical":t.length>5?"high":"medium",description:`Found ${t.length} corrupted storage items`,affected_keys:t,auto_fixable:!0}),e}checkForOrphanedData(){return u(this,null,function*(){var e,t,r;const s=[],n=[];let o=null,i=null;try{const{data:{session:s}}=yield ke.auth.getSession();o=(null==(e=null==s?void 0:s.user)?void 0:e.id)||null,i=(null==(r=null==(t=null==s?void 0:s.user)?void 0:t.app_metadata)?void 0:r.tenant_id)||null}catch(l){console.warn("[StorageHealthChecker] Could not get current session for orphan check:",l)}const a=Date.now();for(let u=0;u=3){const r=t[0],s=t[1];if(o&&i&&(s!==o||r!==i)){const t=localStorage.getItem(e);if(t)try{(a-JSON.parse(t).timestamp)/36e5>this.MAX_ORPHANED_AGE_HOURS&&n.push(e)}catch(c){n.push(e)}}}}catch(l){console.warn("[StorageHealthChecker] Error checking orphaned data:",l)}}return n.length>0&&s.push({type:"orphaned_data",severity:n.length>20?"high":"medium",description:`Found ${n.length} orphaned storage items from previous sessions`,affected_keys:n,auto_fixable:!0}),s})}checkVersionMismatches(){const e=[],t=[];for(let s=0;s0&&e.push({type:"version_mismatch",severity:"medium",description:`Found ${t.length} items with outdated storage format`,affected_keys:t,auto_fixable:!0}),e}checkSessionConflicts(){return u(this,null,function*(){const e=[];try{const t=[],r=[];for(let e=0;e3&&e.push({type:"session_conflict",severity:"high",description:`Multiple active session detected (${t.length} session keys found)`,affected_keys:t,auto_fixable:!0}),r.length>10&&e.push({type:"session_conflict",severity:"medium",description:`Excessive authentication data accumulation (${r.length} auth keys)`,affected_keys:r,auto_fixable:!0})}catch(t){console.warn("[StorageHealthChecker] Error checking session conflicts:",t)}return e})}checkStorageSize(){const e=[],t=Ae.getDiagnostics(),r=parseFloat(t.usage_percentage);return r>90?e.push({type:"size_overflow",severity:"critical",description:`Storage usage at ${r}% - approaching browser limits`,affected_keys:[],auto_fixable:!0}):r>75&&e.push({type:"size_overflow",severity:"high",description:`Storage usage at ${r}% - cleanup recommended`,affected_keys:[],auto_fixable:!0}),e}autoFixIssues(e){return u(this,null,function*(){let t=!1;for(const s of e)if(s.auto_fixable)try{switch(s.type){case"corruption":this.fixCorruptedItems(s.affected_keys),t=!0;break;case"orphaned_data":this.fixOrphanedItems(s.affected_keys),t=!0;break;case"version_mismatch":this.fixVersionMismatches(s.affected_keys),t=!0;break;case"session_conflict":yield this.fixSessionConflicts(s.affected_keys),t=!0;break;case"size_overflow":this.fixSizeOverflow(),t=!0}}catch(r){console.error(`[StorageHealthChecker] Failed to auto-fix ${s.type}:`,r)}return t&&console.log("[StorageHealthChecker] Auto-fix applied for detected issues"),t})}fixCorruptedItems(e){e.forEach(e=>{try{localStorage.removeItem(e)}catch(t){console.warn(`[StorageHealthChecker] Failed to remove corrupted key ${e}:`,t)}}),console.log(`[StorageHealthChecker] Removed ${e.length} corrupted items`)}fixOrphanedItems(e){e.forEach(e=>{try{localStorage.removeItem(e)}catch(t){console.warn(`[StorageHealthChecker] Failed to remove orphaned key ${e}:`,t)}}),console.log(`[StorageHealthChecker] Removed ${e.length} orphaned items`)}fixVersionMismatches(e){e.forEach(e=>{try{localStorage.removeItem(e)}catch(t){console.warn(`[StorageHealthChecker] Failed to fix version mismatch for ${e}:`,t)}}),console.log(`[StorageHealthChecker] Fixed ${e.length} version mismatches`)}fixSessionConflicts(e){return u(this,null,function*(){var t,r,s;const n=null==(s=null==(r=null==(t=(yield ke.auth.getSession()).data)?void 0:t.session)?void 0:r.user)?void 0:s.id;n?e.forEach(e=>{if(!e.includes(n))try{localStorage.removeItem(e)}catch(t){console.warn(`[StorageHealthChecker] Failed to remove conflicting session key ${e}:`,t)}}):e.forEach(e=>{try{localStorage.removeItem(e)}catch(t){console.warn(`[StorageHealthChecker] Failed to remove conflicting session key ${e}:`,t)}}),console.log("[StorageHealthChecker] Resolved session conflicts")})}fixSizeOverflow(){const e=Date.now(),t=[];for(let s=0;ss.expires_at&&t.push(n)}catch(r){}}t.forEach(e=>localStorage.removeItem(e)),console.log(`[StorageHealthChecker] Removed ${t.length} expired items to free space`)}generateDiagnostics(){let e=0,t=0,r=0,s=0,n={key:"",size:0},o={key:"",age_hours:0};const i=Date.now();for(let l=0;ln.size&&(n={key:c,size:d});try{const e=JSON.parse(u);if(e.timestamp){const t=(i-e.timestamp)/36e5;t>o.age_hours&&(o={key:c,age_hours:t}),e.expires_at&&i>e.expires_at&&r++}e.version&&"2.0.0"!==e.version&&s++}catch(a){t++}}return{total_size:e,total_items:localStorage.length,corrupted_items:t,orphaned_items:0,expired_items:r,version_mismatches:s,session_conflicts:0,largest_item:n,oldest_item:o,storage_efficiency:e>0?(e-1e3*(t+r))/e*100:100}}determineOverallHealth(e){const t=e.filter(e=>"critical"===e.severity).length,r=e.filter(e=>"high"===e.severity).length,s=e.filter(e=>"medium"===e.severity).length;return t>0?"critical":r>2||r>0&&s>3?"corrupted":r>0||s>2?"degraded":"healthy"}generateRecommendations(e,t){const r=[];return e.filter(e=>"critical"===e.severity).length>0&&(r.push("Immediate action required: Perform emergency storage cleanup"),r.push("Consider using incognito mode temporarily")),t.total_size>4194304&&r.push("Clear old cached data to free up storage space"),t.corrupted_items>5&&r.push("Run storage integrity check and auto-fix"),e.filter(e=>"session_conflict"===e.type).length>0&&r.push("Clear conflicting session data and re-login"),t.expired_items>10&&r.push("Enable automatic cleanup of expired items"),0===r.length&&r.push("Storage is healthy - no action required"),r}startHealthMonitoring(){setTimeout(()=>{this.performHealthCheck({autoFix:!0})},5e3),this.healthCheckInterval=setInterval(()=>{this.performHealthCheck({autoFix:!0})},this.HEALTH_CHECK_INTERVAL)}stopHealthMonitoring(){this.healthCheckInterval&&(clearInterval(this.healthCheckInterval),this.healthCheckInterval=null)}getLastHealthCheck(){return this.lastHealthCheck}};c(Re,"instance");const Pe=Re.getInstance();"undefined"!=typeof window&&(window.storageHealthChecker=Pe,window.runStorageHealthCheck=()=>Pe.performHealthCheck({autoFix:!0,detailed:!0}));const Ee=class e{constructor(){c(this,"sessionValidationPromise",null),c(this,"lastValidationTime",0),c(this,"VALIDATION_CACHE_DURATION",3e5),c(this,"MAX_RETRY_ATTEMPTS",5),c(this,"RETRY_DELAY_BASE",1e3),c(this,"isRefreshing",!1),c(this,"refreshPromise",null),c(this,"currentContext",null),c(this,"sessionChangeListeners",new Set),c(this,"sessionMonitorInterval",null),c(this,"SESSION_TIMEOUT",864e5),c(this,"ACTIVITY_CHECK_INTERVAL",3e5),c(this,"isCleanupInProgress",!1),this.initializeSessionMonitoring(),this.setupSupabaseAuthListener()}static getInstance(){return e.instance||(e.instance=new e),e.instance}validateSession(){return u(this,null,function*(){return this.sessionValidationPromise&&Date.now()-this.lastValidationTimesetTimeout(t,e))}}return console.error("[SessionManager] All validation attempts failed"),{isValid:!1,session:null,error:(null==e?void 0:e.message)||"Session validation failed after all retries"}})}refreshSession(){return u(this,null,function*(){if(this.isRefreshing&&this.refreshPromise)return console.log("[SessionManager] Refresh already in progress, waiting..."),this.refreshPromise;this.isRefreshing=!0,this.refreshPromise=this.performRefresh();try{return yield this.refreshPromise}finally{this.isRefreshing=!1,this.refreshPromise=null}})}performRefresh(){return u(this,null,function*(){var e;try{console.log("[SessionManager] Refreshing session token...");const{data:{session:s},error:n}=yield ke.auth.refreshSession();if(n){console.error("[SessionManager] Token refresh failed:",n);const r=`sb-${(void 0).split("//")[1].split(".")[0]}-auth-token`,s=localStorage.getItem(r);if(s)try{const t=JSON.parse(s);if(null==(e=null==t?void 0:t.currentSession)?void 0:e.refresh_token){console.log("[SessionManager] Attempting refresh with stored refresh token");const{data:{session:e},error:r}=yield ke.auth.refreshSession({refresh_token:t.currentSession.refresh_token});if(!r&&e)return console.log("[SessionManager] Session refreshed with stored token"),yield ke.auth.setSession({access_token:e.access_token,refresh_token:e.refresh_token}),e}}catch(t){console.error("[SessionManager] Failed to use stored refresh token:",t)}return null}if(s){console.log("[SessionManager] Session refreshed successfully");try{yield ke.auth.setSession({access_token:s.access_token,refresh_token:s.refresh_token}),console.log("[SessionManager] Refreshed session persisted to storage")}catch(r){console.error("[SessionManager] Failed to persist refreshed session:",r)}this.sessionValidationPromise=null,this.lastValidationTime=0}return s}catch(s){return console.error("[SessionManager] Unexpected error during refresh:",s),null}})}ensureValidSession(){return u(this,null,function*(){const e=yield this.validateSession();if(!e.isValid){console.log("[SessionManager] Session invalid, attempting to recover...");return(yield this.refreshSession())||(console.log("[SessionManager] Unable to recover session, clearing auth state"),yield this.clearAuthState(),null)}return e.session})}initializeSession(){return u(this,null,function*(){console.log("[SessionManager] Initializing session with isolation checks...");try{if(yield this.detectSessionCorruption())return console.warn("[SessionManager] Session corruption detected, performing cleanup"),yield this.performEmergencyCleanup(),null;const{data:{session:e}}=yield ke.auth.getSession();if(!e||!e.user)return console.log("[SessionManager] No active session found"),yield this.clearSessionComplete(),null;const t=yield this.createSessionContext(e),r=this.currentContext;return r&&r.user_id!==t.user_id?(console.log("[SessionManager] User change detected, cleaning previous session"),yield this.handleUserChange(r,t)):r&&r.tenant_id!==t.tenant_id?(console.log("[SessionManager] Tenant change detected, cleaning previous session"),yield this.handleTenantChange(r,t)):yield this.setSessionContext(t),this.currentContext}catch(e){return console.error("[SessionManager] Failed to initialize session:",e),yield this.performEmergencyCleanup(),null}})}setSessionContext(e){return u(this,null,function*(){console.log("[SessionManager] Setting session context:",{user_id:e.user_id,tenant_id:e.tenant_id,email:e.email,session_id:e.session_id});const t=this.currentContext;this.currentContext=e,Ae.setContext({user_id:e.user_id,tenant_id:e.tenant_id,email:e.email}),Ae.set(_e,e,{skipIntegrityCheck:!1,ttl:this.SESSION_TIMEOUT}),yield this.notifySessionChange({type:t?"user_change":"login",previous_context:t||void 0,new_context:e,cleanup_performed:!1,timestamp:Date.now()}),console.log("[SessionManager] Session context set successfully")})}clearSessionComplete(){return u(this,null,function*(){if(this.isCleanupInProgress)console.log("[SessionManager] Cleanup already in progress, waiting...");else{this.isCleanupInProgress=!0;try{console.log("[SessionManager] Starting complete session cleanup...");const e=this.currentContext;this.currentContext=null,Ae.clearContext(),yield this.performComprehensiveCleanup(),yield this.notifySessionChange({type:"logout",previous_context:e||void 0,new_context:void 0,cleanup_performed:!0,timestamp:Date.now()}),console.log("[SessionManager] Complete session cleanup finished")}finally{this.isCleanupInProgress=!1}}})}handleUserChange(e,t){return u(this,null,function*(){console.log("[SessionManager] Handling user change:",{previous_user:e.email,new_user:t.email}),yield this.performUserSpecificCleanup(e),yield this.setSessionContext(t),yield this.notifySessionChange({type:"user_change",previous_context:e,new_context:t,cleanup_performed:!0,timestamp:Date.now()})})}handleTenantChange(e,t){return u(this,null,function*(){console.log("[SessionManager] Handling tenant change:",{user:t.email,previous_tenant:e.tenant_id,new_tenant:t.tenant_id}),yield this.performTenantSpecificCleanup(e),yield this.setSessionContext(t),yield this.notifySessionChange({type:"tenant_change",previous_context:e,new_context:t,cleanup_performed:!0,timestamp:Date.now()})})}performComprehensiveCleanup(){return u(this,null,function*(){console.log("[SessionManager] Performing comprehensive cleanup...");try{this.currentContext&&Ae.clearUserData(this.currentContext),yield this.clearLegacyStorage(),yield Pe.performHealthCheck({autoFix:!0}),yield this.clearAuthState(),console.log("[SessionManager] Comprehensive cleanup completed")}catch(e){console.error("[SessionManager] Error during comprehensive cleanup:",e)}})}performUserSpecificCleanup(e){return u(this,null,function*(){console.log("[SessionManager] Performing user-specific cleanup for:",e.email);try{Ae.clearUserData(e),console.log("[SessionManager] User-specific cleanup completed")}catch(t){console.error("[SessionManager] Error during user-specific cleanup:",t)}})}performTenantSpecificCleanup(e){return u(this,null,function*(){console.log("[SessionManager] Performing tenant-specific cleanup for tenant:",e.tenant_id);try{const t=["city_access","bootstrap_data","permissions_cache"];for(const r of t)Ae.remove(r,{context:{tenant_id:e.tenant_id,user_id:e.user_id}});console.log("[SessionManager] Tenant-specific cleanup completed")}catch(t){console.error("[SessionManager] Error during tenant-specific cleanup:",t)}})}clearLegacyStorage(){return u(this,null,function*(){const e=["city_access_cache","bootstrap_cache","auth_cache","user_context"];for(let r=localStorage.length-1;r>=0;r--){const s=localStorage.key(r);if(s&&e.some(e=>s.includes(e)||s.startsWith(e)))try{localStorage.removeItem(s)}catch(t){console.warn("[SessionManager] Failed to remove legacy key:",s,t)}}console.log("[SessionManager] Legacy storage cleared")})}detectSessionCorruption(){return u(this,null,function*(){try{const e=[];for(let s=0;s3)return console.warn("[SessionManager] Multiple session contexts detected"),!0;const{data:{session:t}}=yield ke.auth.getSession();if(t&&this.currentContext&&t.user.id!==this.currentContext.user_id)return console.warn("[SessionManager] Session user mismatch detected"),!0;const r=yield Pe.performHealthCheck();return("critical"===r.overall_health||"corrupted"===r.overall_health)&&(console.warn("[SessionManager] Storage corruption detected by health checker"),!0)}catch(e){return console.error("[SessionManager] Error detecting corruption:",e),!0}})}performEmergencyCleanup(){return u(this,null,function*(){console.log("[SessionManager] Performing emergency cleanup...");try{Ae.clearAll(),yield this.clearAuthState(),yield this.notifySessionChange({type:"cleanup",previous_context:this.currentContext||void 0,new_context:void 0,cleanup_performed:!0,timestamp:Date.now()}),this.currentContext=null,console.log("[SessionManager] Emergency cleanup completed")}catch(e){console.error("[SessionManager] Emergency cleanup failed:",e)}})}createSessionContext(e){return u(this,null,function*(){var t,r;const s=e.user;let n="";try{e.access_token&&e.access_token.includes(".")&&3===e.access_token.split(".").length?n=JSON.parse(atob(e.access_token.split(".")[1])).tenant_id||"":"mock-token-123"===e.access_token&&(n="tenant-a")}catch(o){n=(null==(t=s.app_metadata)?void 0:t.tenant_id)||(null==(r=s.user_metadata)?void 0:r.tenant_id)||""}return{user_id:s.id,tenant_id:n,email:s.email||"",session_id:`session_${s.id}_${Date.now()}`,login_timestamp:Date.now(),last_activity:Date.now()}})}setupSupabaseAuthListener(){ke.auth.onAuthStateChange((e,t)=>u(this,null,function*(){switch(console.log("[SessionManager] Supabase auth state changed:",e),e){case"SIGNED_IN":if(t){const e=yield this.createSessionContext(t);yield this.setSessionContext(e)}break;case"SIGNED_OUT":yield this.clearSessionComplete();break;case"TOKEN_REFRESHED":t&&this.currentContext&&(this.currentContext.last_activity=Date.now())}}))}initializeSessionMonitoring(){this.sessionMonitorInterval=setInterval(()=>u(this,null,function*(){this.currentContext&&Date.now()-this.currentContext.last_activity>this.SESSION_TIMEOUT&&(console.log("[SessionManager] Session timeout detected, clearing session"),yield this.clearSessionComplete())}),this.ACTIVITY_CHECK_INTERVAL)}updateActivity(){this.currentContext&&(this.currentContext.last_activity=Date.now())}addSessionChangeListener(e){this.sessionChangeListeners.add(e)}removeSessionChangeListener(e){this.sessionChangeListeners.delete(e)}notifySessionChange(e){return u(this,null,function*(){const t=Array.from(this.sessionChangeListeners).map(t=>u(this,null,function*(){try{yield t(e)}catch(r){console.error("[SessionManager] Session change listener error:",r)}}));yield Promise.all(t)})}getCurrentContext(){return this.currentContext}isLoggedInWithContext(){return null!==this.currentContext}clearAuthState(){return u(this,null,function*(){console.log("[SessionManager] Clearing all authentication state");try{yield ke.auth.signOut()}catch(t){console.error("[SessionManager] Error during signOut:",t)}const e=[];for(let r=0;r{localStorage.removeItem(e),console.log("[SessionManager] Removed auth key:",e)}),sessionStorage.clear(),this.sessionValidationPromise=null,this.lastValidationTime=0,this.isRefreshing=!1,this.refreshPromise=null})}getCurrentSession(){return u(this,null,function*(){try{const{data:{session:e}}=yield ke.auth.getSession();return e}catch(e){return console.error("[SessionManager] Error getting current session:",e),null}})}hasSession(){return u(this,null,function*(){return null!==(yield this.getCurrentSession())})}invalidateCache(){console.log("[SessionManager] Invalidating session validation cache"),this.sessionValidationPromise=null,this.lastValidationTime=0}};c(Ee,"instance");const Oe=Ee.getInstance(),Te=(()=>{if("undefined"!=typeof window&&"localhost"!==window.location.hostname&&"127.0.0.1"!==window.location.hostname)return console.log(`[SecureAPI] Using relative URLs for ${window.location.hostname}`),"";const e="http://localhost:8000";return e.includes("localhost")?"http://localhost:8000":e})();class Le extends Error{constructor(e){super(e),this.name="TenantIsolationError"}}const De=class e{constructor(){c(this,"backendUrl"),c(this,"requestCount",0),c(this,"securityViolations",[]),c(this,"cachedToken",null),c(this,"cachedTenantId",null),c(this,"pendingRequests",new Map),c(this,"requestCache",new Map),c(this,"CACHE_TTL",5e3),this.backendUrl=Te,this.interceptDirectQueries()}static getInstance(){return e.instance||(e.instance=new e),e.instance}interceptDirectQueries(){}getAuthHeaders(){return u(this,null,function*(){let e=this.cachedToken;if(!e){console.log("[SecureAPI] No cached token, waiting for session or validating...");const t=(yield this.waitForSession(5e3))||(yield Oe.ensureValidSession());if(!t||!t.access_token)throw new Le("No valid authentication token available");e=t.access_token,this.cachedToken=e}return{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Request-ID":`req_${Date.now()}_${++this.requestCount}`,"X-Client-Version":"2.0.0-secure"}})}setAccessToken(e){if(this.cachedToken!==e){const t=this.cachedTenantId;this.cachedTenantId=null,this.clearCache(),t&&e&&console.log("[SecureAPI SECURITY] Tenant context changed - cache cleared",{previousTenant:t,timestamp:(new Date).toISOString()})}this.cachedToken=e||null}getTenantId(){return u(this,null,function*(){var e;if(this.cachedTenantId)return this.cachedTenantId;try{const t=this.cachedToken;if(t){let r=null;if("mock-token-123"===t)r="tenant-a";else if(t.includes(".")&&3===t.split(".").length){const s=JSON.parse(atob(t.split(".")[1]));r=(null==(e=s.user_metadata)?void 0:e.tenant_id)||s.tenant_id}if(r){if(this.isValidTenantId(r))return this.cachedTenantId=r,this.cachedTenantId;console.error("[SecureAPI] Invalid tenant ID format:",r),this.cachedToken=null,this.cachedTenantId=null}}}catch(t){console.error("[SecureAPI] JWT parsing failed - clearing session:",t),this.cachedToken=null,this.cachedTenantId=null,this.clearCache()}return null})}getUserSessionKey(){return u(this,null,function*(){try{const e=this.cachedToken;if(e){const t=JSON.parse(atob(e.split(".")[1])),r=t.sub,s=t.email;if(r&&s)return`${r.substring(0,8)}-${s.split("@")[0]}`}}catch(e){console.error("[SecureAPI] Failed to extract user session key:",e)}return null})}isValidTenantId(e){return"string"==typeof e&&e.length>0&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}clearCache(){this.requestCache.clear(),this.pendingRequests.clear(),console.log("[SecureAPI] Cache cleared due to tenant/token change")}clearEndpointCache(e){let t=0;const r=[];for(const[n,o]of this.requestCache.entries())n.includes(e)&&(r.push(n),t++);r.forEach(e=>{this.requestCache.delete(e)});const s=[];for(const[n,o]of this.pendingRequests.entries())n.includes(e)&&s.push(n);return s.forEach(e=>{this.pendingRequests.delete(e)}),t>0&&console.log(`[SecureAPI] Cleared ${t} cache entries for pattern: ${e}`),t}getCacheDiagnostics(){var e,t,r;const s=Date.now();let n=0,o=0,i=1/0;const a=[];for(const[l,c]of this.requestCache.entries()){const u=s-c.timestamp;if(u>o&&(o=u),ue.localeCompare(t)).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join("&");o=`${e}:${s}?${l}:${r}${n}`}else o=`${e}:${t}:${r}${n}`;return(t.includes("secure/cleaning/reports")||t.includes("properties"))&&console.log("[SecureAPI] Generated cache key:",{endpoint:t,cacheKey:o.length>100?o.substring(0,100)+"...":o,hasQueryParams:t.includes("?")}),o})}shouldCacheCleaningResult(e,t){return!e.includes("/cleaning/reports")||((null==t?void 0:t.items)||null==t||t.data,null==t||t.total,!(!t||"object"!=typeof t||!(t.hasOwnProperty("items")||t.hasOwnProperty("data")||t.hasOwnProperty("total")))||null!=t||(console.warn("[SecureAPI] Not caching null/undefined cleaning result"),!1))}isCacheResultValid(e,t,r){return e.includes("/cleaning/reports")?((null==t?void 0:t.items)||null==t||t.data,null==t||t.total,!(r>3e4||null==t||("object"!=typeof t||!("items"in t)&&!("data"in t))&&(console.warn("[SecureAPI] Invalidating malformed cached cleaning result"),1))):r{var e;try{if("undefined"==typeof localStorage)return null;for(let t=0;tu(null,null,function*(){var e;return(null==(e=(yield ke.auth.getSession()).data.session)?void 0:e.access_token)||r()}),n=yield ke.auth.getSession();if(null==(t=n.data.session)?void 0:t.access_token)return n.data.session;const o=r();if(o)return{access_token:o};let i=null,a=!1;const l=new Promise(e=>{const{data:t}=ke.auth.onAuthStateChange((t,r)=>{!a&&(null==r?void 0:r.access_token)&&(a=!0,i&&i(),e(r))});i=()=>t.subscription.unsubscribe()}),c=new Promise(t=>u(null,null,function*(){const r=Date.now();for(;Date.now()-rsetTimeout(e,200))}t(null)})),d=new Promise(t=>setTimeout(()=>t(null),e)),h=yield Promise.race([l,c,d]);return i&&i(),h})}request(e){return u(this,arguments,function*(e,t={}){const r=t.method||"GET",s="GET"===r,n=(new Date).toISOString();console.log(`[API REQUEST] ${n} - ${r} ${e}`);const o=yield this.getTenantId();if(!o)return console.warn(`[API SECURITY] No valid tenant ID - bypassing cache for ${e}`),this.executeRequest(e,t,null,!1);const i=yield this.generateCacheKey(r,e,o);if(s){const t=this.requestCache.get(i);if(t){const r=Date.now()-t.timestamp;if(this.isCacheResultValid(e,t.data,r))return console.log(`[API CACHE HIT] ${e} (tenant: ${o}) age: ${r}ms`),t.data;console.log(`[API CACHE INVALID] ${e} - removing stale/suspicious entry`),this.requestCache.delete(i)}const r=this.pendingRequests.get(i);if(r){console.log(`[API DEDUP] ${e} - waiting for pending request (tenant: ${o})`);try{const t=yield Promise.race([r,new Promise((e,t)=>{setTimeout(()=>t(new Error("Pending request timeout")),1e4)})]);return console.log(`[API DEDUP SUCCESS] ${e} - returned cached result`),t}catch(l){console.warn("[SecureAPI] Pending request failed or timed out, making fresh request:",l),this.pendingRequests.delete(i)}}}const a=this.executeRequest(e,t,i,s);return s&&i&&this.pendingRequests.set(i,a),a})}executeRequest(e,t,r,s){return u(this,null,function*(){let n=null;for(let d=1;d<=3;d++)try{const n=yield this.getAuthHeaders(),c=`${this.backendUrl}${e}`;1===d?console.log(`🔒 Secure API Request: ${t.method||"GET"} ${e}`):console.log(`🔒 Secure API Request: ${t.method||"GET"} ${e} (retry ${d-1}/2)`);const h=yield fetch(c,l(a({},t),{headers:a(a({},n),t.headers)}));if(!h.ok){let e="";try{e=yield h.text()}catch(o){}let t="",r=null;try{r=JSON.parse(e),t=(null==r?void 0:r.detail)||(null==r?void 0:r.message)||"",console.error("🔴 API Error Details:",{status:h.status,statusText:h.statusText,errorData:r,bodyText:e,url:h.url})}catch(i){console.error("🔴 Could not parse error response:",e)}if(403===h.status)throw new Le(t||"Access denied: You can only access data from your organization");if(401===h.status){console.log("[SecureAPI] Got 401, attempting to refresh session...");const{sessionValidator:e}=yield P(()=>u(this,null,function*(){const{sessionValidator:e}=yield import("./sessionValidator-CHh5e7zs.js");return{sessionValidator:e}}),__vite__mapDeps([0,1,2,3,4,5,6]));this.cachedToken=null;const t=yield e.validateSession();if((null==t?void 0:t.access_token)&&(console.log("[SecureAPI] Session refreshed, will retry with new token"),this.cachedToken=t.access_token,d<3))throw new Error("Authentication refreshed, will retry with new token");throw new Error("Authentication failed - please login again")}const s=t||e||`${h.status} ${h.statusText}`;throw new Error(`API request failed: ${s}`)}let p;const g=h.headers.get("content-type");if(204===h.status||205===h.status)p=null;else if(g&&g.includes("application/json")){const e=yield h.text();p=e.trim()?JSON.parse(e):null}else p=(yield h.text())||null;return s&&null!==p&&r&&(this.shouldCacheCleaningResult(e,p)?(this.requestCache.set(r,{data:p,timestamp:Date.now()}),console.log(`[API CACHE STORE] ${e} (tenant: ${r.split(":")[2]})`)):console.log(`[API CACHE SKIP] ${e} - result validation failed`)),s&&r&&this.pendingRequests.delete(r),p}catch(c){if(n=c,s&&r&&this.pendingRequests.delete(r),c instanceof Le)throw c;if(console.error(`[SecureAPI] Attempt ${d}/3 failed:`,c),d<3){const e=1e3*Math.pow(2,d-1)+500*Math.random();console.log(`[SecureAPI] Retrying in ${Math.round(e)}ms...`),yield new Promise(t=>setTimeout(t,e))}}throw s&&r&&(this.pendingRequests.delete(r),this.requestCache.delete(r),console.log(`[API CACHE CLEAR] ${e} - cleared due to failed request`)),console.error("[SecureAPI] All retry attempts failed"),n||new Error("Request failed after all retries")})}requestPublic(e){return u(this,arguments,function*(e,t={}){const r=`${this.backendUrl}${e}`,s=yield fetch(r,l(a({},t),{headers:a({"Content-Type":"application/json","X-Request-ID":`req_${Date.now()}_${++this.requestCount}`,"X-Client-Version":"2.0.0-secure"},t.headers||{})}));if(!s.ok)throw new Error(`API request failed: ${s.status} ${s.statusText}`);return s.json()})}getAllReservations(){return u(this,null,function*(){return this.request("/api/v1/reservations/all")})}getReservations(e){return u(this,null,function*(){var t,r;const s=yield this.getCachedReservations(),n=Array.isArray(null==s?void 0:s.data)?s.data:Array.isArray(s)?s:(null==s?void 0:s.items)||[],o=((null==e?void 0:e.search)||"").toString().toLowerCase(),i=(null==e?void 0:e.property_id)||"",a=((null==e?void 0:e.status)||"").toString().toLowerCase(),l=(null==e?void 0:e.date_from)?new Date(e.date_from):null,c=(null==e?void 0:e.date_to)?new Date(e.date_to):null,u=n.filter(e=>{if(!e)return!1;if(i&&String(e.property_id)!==String(i))return!1;if(a&&String(e.status||"").toLowerCase()!==a)return!1;if(l){const t=e.checkin_date?new Date(e.checkin_date):null;if(!t||tc)return!1}if(o){const t=String(e.guest_name||"").toLowerCase(),r=String(e.guest_email||"").toLowerCase(),s=String(e.reservation_id||e.id||"").toLowerCase();if(!(t.includes(o)||r.includes(o)||s.includes(o)))return!1}return!0}),d=null!=(t=null==e?void 0:e.limit)?t:50,h=null!=(r=null==e?void 0:e.offset)?r:0;return{data:u.slice(h,h+d),total:u.length,limit:d,offset:h}})}getReservationSuggestions(e,t=10,r){return u(this,null,function*(){const s=a({search:e,limit:Math.max(1,Math.min(t,1e3))},(null==r?void 0:r.status)?{status:r.status}:{});return this.request("/api/v1/reservations-suggest",{method:"POST",body:JSON.stringify(s)})})}getReservation(e){return u(this,null,function*(){return this.request(`/api/v1/reservations/${e}`)})}getCachedReservations(e=!1){return u(this,null,function*(){const t=e?"/api/v1/reservations/all?force_refresh=true":"/api/v1/reservations/all";return this.request(t)})}getReservationsProgressive(e,t){return u(this,null,function*(){const r=new URLSearchParams;return r.set("offset",e.toString()),r.set("limit",t.toString()),this.request(`/api/v1/reservations/all?${r.toString()}`)})}getReservationFilterOptions(){return u(this,null,function*(){return this.request("/api/v1/filter-options")})}invalidateReservationCache(e){return u(this,null,function*(){const t=new URLSearchParams;e&&t.set("property_id",e);const r=t.toString()?`?${t.toString()}`:"";return this.request(`/api/v1/cache/invalidate${r}`,{method:"POST"})})}getReservationDistinctValues(e){return u(this,null,function*(){return this.request(`/api/v1/reservations/distinct-values/${e}`)})}updateReservation(e,t){return u(this,null,function*(){return this.request(`/api/v1/reservations/${e}`,{method:"PUT",body:JSON.stringify(t)})})}createReservation(e){return u(this,null,function*(){return this.request("/api/v1/reservations",{method:"POST",body:JSON.stringify(e)})})}deleteReservation(e){return u(this,null,function*(){return this.request(`/api/v1/reservations/${e}`,{method:"DELETE"})})}bulkUpdateReservations(e,t){return u(this,null,function*(){return this.request("/api/v1/reservations/bulk-update",{method:"POST",body:JSON.stringify({ids:e,updates:t})})})}createUser(e){return u(this,null,function*(){return this.request("/api/v1/users",{method:"POST",body:JSON.stringify(e)})})}updateUser(e,t){return u(this,null,function*(){return this.request(`/api/v1/users/${e}`,{method:"PUT",body:JSON.stringify(t)})})}getProperties(e){return u(this,null,function*(){var t,r;console.log("[SecureAPI.getProperties] Called with filters:",e);const s=new URLSearchParams;e&&Object.entries(e).forEach(([e,t])=>{void 0!==t&&s.append(e,String(t))}),s.has("page_size")||s.append("page_size","1000");const n=`/api/v1/properties?${s}`;console.log("[SecureAPI.getProperties] Requesting endpoint:",n);try{const e=yield this.request(n);return console.log("[SecureAPI.getProperties] Request successful"),console.log("[SecureAPI.getProperties] Result type:",typeof e),e&&"object"==typeof e?(console.log("[SecureAPI.getProperties] Result keys:",Object.keys(e)),"items"in e?(console.log("[SecureAPI.getProperties] Found items array with",(null==(t=e.items)?void 0:t.length)||0,"properties"),{data:e.items||[],total:e.total||0}):"data"in e?(console.log("[SecureAPI.getProperties] Found data array with",(null==(r=e.data)?void 0:r.length)||0,"properties"),e):Array.isArray(e)?(console.log("[SecureAPI.getProperties] Result is array with",e.length,"properties"),{data:e,total:e.length}):(console.warn("[SecureAPI.getProperties] Unexpected result format, returning empty data"),{data:[],total:0})):(console.log("[SecureAPI.getProperties] Returning empty data for null/undefined result"),{data:[],total:0})}catch(o){throw console.error("[SecureAPI.getProperties] Request failed:",o),o}})}getProperty(e){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}`)})}updateProperty(e,t){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}`,{method:"PUT",body:JSON.stringify(t)})})}getPropertyNotes(e){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/notes`)})}createPropertyNote(e,t){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/notes`,{method:"POST",body:JSON.stringify({note:t})})})}deletePropertyNote(e){return u(this,null,function*(){return this.request(`/api/v1/properties/notes/${e}`,{method:"DELETE"})})}getPropertyAppliances(e){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/appliances`)})}createPropertyAppliance(e,t){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/appliances`,{method:"POST",body:JSON.stringify(t)})})}createAppliance(e,t){return u(this,null,function*(){return this.createPropertyAppliance(e,t)})}updatePropertyAppliance(e,t,r){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/appliances/${t}`,{method:"PUT",body:JSON.stringify(r)})})}updateAppliance(e,t,r){return u(this,null,function*(){return this.updatePropertyAppliance(e,t,r)})}deletePropertyAppliance(e,t){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/appliances/${t}`,{method:"DELETE",body:JSON.stringify({property_id:e})})})}deleteAppliance(e,t){return u(this,null,function*(){return this.deletePropertyAppliance(e,t)})}getPropertyContracts(e){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/contracts`)})}createPropertyContract(e,t){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/contracts`,{method:"POST",body:JSON.stringify(t)})})}updatePropertyContract(e,t,r){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/contracts/${t}`,{method:"PUT",body:JSON.stringify(r)})})}deletePropertyContract(e,t){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/contracts/${t}`,{method:"DELETE"})})}getContractSignedUrl(e,t){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/contracts/${t}/signed-url`)})}createProperty(e){return u(this,null,function*(){return this.request("/api/v1/properties",{method:"POST",body:JSON.stringify(e)})})}getPropertyAvailability(e,t,r){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/availability?start=${t}&end=${r}`)})}getAvailabilityChecks(){return u(this,null,function*(){return this.request("/api/v1/availability-checks")})}getReputationProperties(e){return u(this,null,function*(){const t=new URLSearchParams;return e&&Object.entries(e).forEach(([e,r])=>{void 0!==r&&t.append(e,String(r))}),this.request(`/api/v1/reputation/properties?${t}`)})}getReputationNotes(e){return u(this,null,function*(){const t=new URLSearchParams;return e&&e.length&&t.append("property_ids",e.join(",")),this.request(`/api/v1/reputation/notes?${t}`)})}createReputationNote(e){return u(this,null,function*(){return this.request("/api/v1/reputation/notes",{method:"POST",body:JSON.stringify(e)})})}deleteReputationNote(e){return u(this,null,function*(){return this.request(`/api/v1/reputation/notes/${e}`,{method:"DELETE"})})}getLockboxes(e){return u(this,null,function*(){const t=new URLSearchParams;return(null==e?void 0:e.propertyId)&&t.append("property_id",e.propertyId),(null==e?void 0:e.city)&&t.append("city",e.city),(null==e?void 0:e.page)&&t.append("page",e.page.toString()),(null==e?void 0:e.limit)&&t.append("limit",e.limit.toString()),(null==e?void 0:e.search)&&t.append("search",e.search),(null==e?void 0:e.status)&&t.append("status",e.status),(null==e?void 0:e.lockbox_type)&&t.append("lockbox_type",e.lockbox_type),this.request(`/api/v1/lockboxes?${t}`)})}getLockbox(e){return u(this,null,function*(){return this.request(`/api/v1/lockboxes/${e}`)})}createLockbox(e){return u(this,null,function*(){return this.request("/api/v1/lockboxes",{method:"POST",body:JSON.stringify(e)})})}updateLockbox(e,t){return u(this,null,function*(){return this.request(`/api/v1/lockboxes/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deleteLockbox(e){return u(this,null,function*(){return this.request(`/api/v1/lockboxes/${e}`,{method:"DELETE"})})}getInternalKeys(e){return u(this,null,function*(){const t=new URLSearchParams;return(null==e?void 0:e.city)&&t.append("city",e.city),(null==e?void 0:e.page)&&t.append("page",e.page.toString()),(null==e?void 0:e.limit)&&t.append("limit",e.limit.toString()),(null==e?void 0:e.search)&&t.append("search",e.search),(null==e?void 0:e.status)&&t.append("status",e.status),this.request(`/api/v1/internal-keys?${t}`)})}createInternalKey(e){return u(this,null,function*(){return this.request("/api/v1/internal-keys",{method:"POST",body:JSON.stringify(e)})})}updateInternalKey(e,t){return u(this,null,function*(){return this.request(`/api/v1/internal-keys/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deleteInternalKey(e){return u(this,null,function*(){return this.request(`/api/v1/internal-keys/${e}`,{method:"DELETE"})})}getInternalKey(e){return u(this,null,function*(){return this.request(`/api/v1/internal-keys/${e}`)})}getKeynestKeys(e){return u(this,null,function*(){const t=new URLSearchParams;return(null==e?void 0:e.city)&&t.append("city",e.city),this.request(`/api/v1/keynest-keys?${t}`)})}getActiveKeyAssignment(e){return u(this,null,function*(){const t=new URLSearchParams;return t.append("lockbox_id",e),this.request(`/api/v1/key-assignments/active?${t}`)})}getBulkActiveKeyAssignments(e){return u(this,null,function*(){return this.request("/api/v1/key-assignments/bulk-active",{method:"POST",body:JSON.stringify(e)})})}getAccessLogs(e,t,r,s=10){return u(this,null,function*(){const n=new URLSearchParams;return n.append("entity_id",e),n.append("entity_type",t),r&&n.append("action",r),n.append("limit",s.toString()),this.request(`/api/v1/access-logs?${n}`)})}getBulkLastViewed(e,t){return u(this,null,function*(){return this.request("/api/v1/access-logs/bulk-last-viewed",{method:"POST",body:JSON.stringify({entity_ids:e,entity_type:t})})})}logAccess(e,t,r="view"){return u(this,null,function*(){return this.request("/api/v1/access-logs",{method:"POST",body:JSON.stringify({entity_id:e,entity_type:t,action:r})})})}getCompanySettings(){return u(this,null,function*(){return this.request("/api/v1/company-settings")})}updateCompanySettings(e){return u(this,null,function*(){return this.request("/api/v1/company-settings",{method:"PUT",body:JSON.stringify(e)})})}getDashboardSummary(e,t){return u(this,null,function*(){const r=new URLSearchParams({property_id:e});(null==t?void 0:t.timestamp)&&r.append("_t",t.timestamp.toString());const s={};return(null==t?void 0:t.simulatedTenant)&&(s.headers={"X-Simulated-Tenant":t.simulatedTenant}),this.request(`/api/v1/dashboard/summary?${r}`,s)})}uploadCompanyLogo(e){return u(this,null,function*(){return this.request("/api/v1/company-settings/logo",{method:"POST",body:JSON.stringify({logo_url:e})})})}deleteCompanyLogo(){return u(this,null,function*(){return this.request("/api/v1/company-settings/logo",{method:"DELETE"})})}getPortalConfiguration(){return u(this,null,function*(){return this.request("/api/v1/portal-configuration")})}getDepartments(){return u(this,null,function*(){const e=yield this.request("/api/v1/departments");return Array.isArray(e)?e:Array.isArray(null==e?void 0:e.departments)?e.departments:[]})}createDepartment(e){return u(this,null,function*(){return yield this.request("/api/v1/departments",{method:"POST",body:JSON.stringify(e)})})}updateDepartment(e,t){return u(this,null,function*(){return yield this.request(`/api/v1/departments/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deleteDepartment(e){return u(this,null,function*(){return yield this.request(`/api/v1/departments/${e}`,{method:"DELETE"})})}getMyDepartmentsWithPreferences(){return u(this,null,function*(){const e=yield this.request("/api/v1/departments/my-departments");return Array.isArray(e)?e:[]})}updateMyDepartmentPreference(e,t){return u(this,null,function*(){return yield this.request(`/api/v1/departments/my-departments/${e}/preference`,{method:"PUT",body:JSON.stringify({show_in_sidebar:t})})})}getProcessDocuments(e,t="active"){return u(this,null,function*(){const r=yield this.request(`/api/v1/departments/${e}/process-documents?status=${t}`);return Array.isArray(r)?r:[]})}createProcessDocument(e){return u(this,null,function*(){return this.request("/api/v1/process-documents",{method:"POST",headers:l(a({},yield this.getAuthHeaders()),{"Content-Type":"application/json"}),body:JSON.stringify(e)})})}updateProcessDocument(e,t){return u(this,null,function*(){const r={};return void 0!==t.title&&(r.title=t.title),void 0!==t.content&&(r.content=t.content),void 0!==t.status&&(r.status=t.status),this.request(`/api/v1/process-documents/${e}`,{method:"PUT",headers:l(a({},yield this.getAuthHeaders()),{"Content-Type":"application/json"}),body:JSON.stringify(r)})})}archiveProcessDocument(e){return u(this,null,function*(){return this.updateProcessDocument(e,{status:"archived"})})}restoreProcessDocument(e){return u(this,null,function*(){return this.updateProcessDocument(e,{status:"active"})})}listProcessDocumentAttachments(e){return u(this,null,function*(){return this.request(`/api/v1/process-documents/${e}/attachments`,{method:"GET",headers:yield this.getAuthHeaders()})})}getProcessDocument(e){return u(this,null,function*(){return this.request(`/api/v1/process-documents/${e}`)})}deleteProcessDocument(e){return u(this,null,function*(){return this.request(`/api/v1/process-documents/${e}`,{method:"DELETE"})})}uploadProcessDocumentAttachment(e,t){return u(this,null,function*(){const r=yield this.getAuthHeaders();delete r["Content-Type"];const s=new FormData;s.append("file",t),s.append("size",t.size.toString());const n=yield fetch(`${this.backendUrl}/api/v1/process-documents/${e}/attachments`,{method:"POST",headers:r,body:s});if(!n.ok){const e=yield n.text().catch(()=>"");throw new Error(`Upload failed (${n.status}) ${e}`)}return n.json()})}uploadInlineAttachment(e,t,r,s){return u(this,null,function*(){const n=yield this.getAuthHeaders();delete n["Content-Type"];const o=new FormData;o.append("file",t),o.append("size",t.size.toString()),o.append("node_id",r),s&&o.append("context_data",JSON.stringify(s));const i=yield fetch(`${this.backendUrl}/api/v1/process-documents/${e}/attachments/inline`,{method:"POST",headers:n,body:o});if(!i.ok){const e=yield i.text().catch(()=>"");throw new Error(`Upload failed (${i.status}) ${e}`)}return i.json()})}deleteProcessDocumentAttachment(e){return u(this,null,function*(){return this.request(`/api/v1/process-documents/attachments/${e}`,{method:"DELETE",headers:yield this.getAuthHeaders()})})}getAttachmentSignedUrl(e,t=3600){return u(this,null,function*(){return this.request(`/api/v1/process-documents/attachments/${e}/signed-url?expires_in=${t}`,{method:"GET",headers:yield this.getAuthHeaders()})})}getDepartmentDocuments(e,t="active"){return u(this,null,function*(){const r=yield this.request(`/api/v1/departments/${e}/documents?status=${t}`);return Array.isArray(r)?r:[]})}getPermissionTemplates(e){return u(this,null,function*(){const t=new URLSearchParams;(null==e?void 0:e.department_id)&&t.append("department_id",e.department_id),void 0!==(null==e?void 0:e.is_active)&&t.append("is_active",String(e.is_active));const r=yield this.request(`/api/v1/permission_templates?${t}`);return Array.isArray(null==r?void 0:r.permission_templates)?r.permission_templates:[]})}createPermissionTemplate(e){return u(this,null,function*(){return yield this.request("/api/v1/permission_templates",{method:"POST",body:JSON.stringify(e)})})}updatePermissionTemplate(e,t){return u(this,null,function*(){return yield this.request(`/api/v1/permission_templates/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deletePermissionTemplate(e){return u(this,null,function*(){return yield this.request(`/api/v1/permission_templates/${e}`,{method:"DELETE"})})}getLogs(e){return u(this,null,function*(){const t=new URLSearchParams;return Object.entries(e||{}).forEach(([e,r])=>{null!=r&&""!==r&&t.append(e,String(r))}),this.request(`/api/v1/logs?${t.toString()}`)})}exportLogs(e){return u(this,null,function*(){const t=new URLSearchParams;return Object.entries(e||{}).forEach(([e,r])=>{null!=r&&""!==r&&t.append(e,String(r))}),this.request(`/api/v1/logs/export?${t.toString()}`)})}getAllProperties(){return u(this,null,function*(){const e=yield this.getProperties({page_size:1e3});return e&&"object"==typeof e&&"data"in e?e:Array.isArray(e)?{data:e,total:e.length}:{data:[],total:0}})}createLog(e){return u(this,null,function*(){return this.request("/api/v1/logs",{method:"POST",body:JSON.stringify(e)})})}updatePortalConfiguration(e){return u(this,null,function*(){return this.request("/api/v1/portal-configuration",{method:"PUT",body:JSON.stringify(e)})})}getCustomFields(){return u(this,null,function*(){return this.request("/api/v1/custom-fields")})}createCustomField(e){return u(this,null,function*(){return this.request("/api/v1/custom-fields",{method:"POST",body:JSON.stringify(e)})})}updateCustomField(e,t){return u(this,null,function*(){return this.request(`/api/v1/custom-fields/${e}`,{method:"PUT",body:JSON.stringify(t)})})}getCustomFieldValues(e){return u(this,null,function*(){var t,r;try{return yield this.request(`/api/v1/custom-fields/values/${e}`)}catch(s){return(null==(t=null==s?void 0:s.message)?void 0:t.includes("404"))||(null==(r=null==s?void 0:s.message)?void 0:r.includes("not found"))||console.debug("Custom field values fetch error:",null==s?void 0:s.message),{}}})}updateCustomFieldValues(e,t){return u(this,null,function*(){return this.request(`/api/v1/custom-fields/values/${e}`,{method:"PUT",body:JSON.stringify(t)})})}bulkUpdateCustomFieldValues(e,t,r){return u(this,null,function*(){return this.request("/api/v1/custom-fields/bulk-update",{method:"POST",body:JSON.stringify({reservation_ids:e,field_id:t,value:r})})})}getFinancialData(e){return u(this,null,function*(){const t=new URLSearchParams;return e&&Object.entries(e).forEach(([e,r])=>{void 0!==r&&t.append(e,String(r))}),this.request(`/api/v1/finance/summary?${t}`)})}getRevenueReport(e,t){return u(this,null,function*(){return this.request(`/api/v1/finance/revenue?start=${e}&end=${t}`)})}getSecurityViolations(){return[...this.securityViolations]}getAuthMe(e=!1){return u(this,null,function*(){const t=e?"/api/v1/auth/me?refresh=true":"/api/v1/auth/me";return this.request(t)})}getMyProfile(){return u(this,null,function*(){return this.request("/api/v1/profile")})}getUsersBrief(e){return u(this,null,function*(){const t=e&&e.length?`?ids=${encodeURIComponent(e.join(","))}`:"",r=yield this.request(`/api/v1/users/brief${t}`);return Array.isArray(null==r?void 0:r.users)?r.users:[]})}getRecentUserLogs(e=10){return u(this,null,function*(){const t=yield this.request(`/api/v1/logs/recent?limit=${e}&user_only=true`);return Array.isArray(null==t?void 0:t.data)?t.data:[]})}getDashboardData(){return u(this,null,function*(){return this.request("/api/v1/dashboard/data")})}clearSecurityViolations(){this.securityViolations=[]}getRequestStats(){return{totalRequests:this.requestCount,securityViolations:this.securityViolations.length,backendUrl:this.backendUrl,hasCachedToken:!!this.cachedToken}}verifyTenantIsolation(){return u(this,null,function*(){try{return{isolated:!0,tenantId:(yield this.request("/api/v1/auth/verify-tenant")).tenant_id,message:"Tenant isolation verified successfully"}}catch(e){return{isolated:!1,tenantId:"unknown",message:"Tenant isolation verification failed"}}})}checkConnection(){return u(this,null,function*(){try{return yield this.requestPublic("/api/v1/health"),!0}catch(e){try{return yield this.requestPublic("/health"),!0}catch(t){return!1}}})}checkAuthReady(){return u(this,null,function*(){try{if(!this.cachedToken)return console.log("[SecureAPI] No cached token, auth not ready"),!1;try{return yield this.getAuthMe(),console.log("[SecureAPI] Auth verified successfully"),!0}catch(e){return console.log("[SecureAPI] Auth token invalid or expired:",e),!1}}catch(t){return console.log("[SecureAPI] Auth check failed:",t),!1}})}getPropertyById(e){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}`)})}getPropertiesInRadius(e){return u(this,null,function*(){const t=new URLSearchParams(e);return this.request(`/api/v1/properties/in-radius?${t}`)})}checkPropertyExists(e){return u(this,null,function*(){try{return(yield this.request(`/api/v1/properties/check-exists?hostaway_id=${e}`)).exists}catch(t){return!1}})}createPropertyDraft(e){return u(this,null,function*(){return this.request("/api/v1/property-drafts",{method:"POST",body:JSON.stringify(e)})})}getPropertyDraft(e,t){return u(this,null,function*(){const r=t?`?user_id=${t}`:"";return this.request(`/api/v1/property-drafts/${e}${r}`)})}updatePropertyDraft(e,t){return u(this,null,function*(){return this.request(`/api/v1/property-drafts/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deletePropertyDraft(e){return u(this,null,function*(){return this.request(`/api/v1/property-drafts/${e}`,{method:"DELETE"})})}getMyOrgModules(){return u(this,null,function*(){const e=yield this.request("/api/v1/organizations/my-modules");return Array.isArray(null==e?void 0:e.modules)?e.modules:[]})}getCleaningReports(e,t){return u(this,null,function*(){const r=new URLSearchParams;e.city&&r.append("city",String(e.city)),e.date_from&&r.append("date_from",String(e.date_from)),e.date_to&&r.append("date_to",String(e.date_to)),e.status&&r.append("status",String(e.status)),e.booking_status&&r.append("booking_status",String(e.booking_status)),e.property_id&&r.append("property_id",String(e.property_id)),e.search&&r.append("search",String(e.search)),e.page&&r.append("page",String(e.page)),e.itemsPerPage&&r.append("itemsPerPage",String(e.itemsPerPage));const s=`/api/v1/secure/cleaning/reports?${r}`;try{const r=yield this.request(s,{signal:t});if(r&&"object"==typeof r){const t=r.items||r.data||[],n=r.total||0;0===n&&"overdue"===e.date_from&&console.warn("[SecureAPI] Received empty overdue cleaning data - this may indicate a backend issue"),e.date_from&&e.date_to&&e.date_from===e.date_to&&e.date_from===new Date(Date.now()+864e5).toISOString().split("T")[0]&&(console.log("[SecureAPI] Tomorrow cleaning request completed",{endpoint:s.substring(0,80)+"...",total:n,itemsLength:t.length,dateRequested:e.date_from,city:e.city,cacheKey:yield this.generateCacheKey("GET",s,(yield this.getTenantId())||"unknown")}),0===n&&console.warn("[SecureAPI] Tomorrow returned 0 cleanings - verify this is correct",{filters:e,cacheAge:"fresh_request"})),console.log(`[SecureAPI] Cleaning request completed: ${s.substring(0,80)}... -> ${n} items`)}return r}catch(n){throw console.error(`[SecureAPI] Cleaning request failed: ${s.substring(0,80)}...`,n),n}})}createCleaningReport(e){return u(this,null,function*(){return this.request("/api/v1/secure/cleaning/reports",{method:"POST",body:JSON.stringify(e)})})}updateCleaningReport(e,t){return u(this,null,function*(){return this.request(`/api/v1/secure/cleaning/reports/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deleteCleaningReport(e){return u(this,null,function*(){return this.request(`/api/v1/secure/cleaning/reports/${e}`,{method:"DELETE"})})}getCleaningNotes(e){return u(this,null,function*(){return this.request(`/api/v1/secure/cleaning/notes/${e}`)})}addCleaningNote(e){return u(this,null,function*(){return this.request("/api/v1/secure/cleaning/notes",{method:"POST",body:JSON.stringify(e)})})}createCleaningNote(e){return u(this,null,function*(){return this.request("/api/v1/secure/cleaning/notes",{method:"POST",body:JSON.stringify(e)})})}deleteCleaningsByParentId(e){return u(this,null,function*(){return this.request(`/api/v1/cleaning-reports/by-parent/${e}`,{method:"DELETE"})})}getAnnouncements(e){return u(this,null,function*(){const t=new URLSearchParams;return Object.entries(e).forEach(([e,r])=>{void 0!==r&&t.append(e,String(r))}),this.request(`/api/v1/announcements?${t}`)})}createAnnouncement(e){return u(this,null,function*(){return this.request("/api/v1/announcements",{method:"POST",body:JSON.stringify(e)})})}acknowledgeAnnouncement(e,t){return u(this,null,function*(){return this.request("/api/v1/announcements/acknowledge",{method:"POST",body:JSON.stringify({announcement_id:e,user_id:t})})})}getCleaners(){return u(this,null,function*(){return this.request("/api/v1/secure/cleaning/cleaners")})}createCleaner(e){return u(this,null,function*(){return this.request("/api/v1/secure/cleaning/cleaners",{method:"POST",body:JSON.stringify(e)})})}deleteCleaner(e){return u(this,null,function*(){return this.request(`/api/v1/secure/cleaning/cleaners/${e}`,{method:"DELETE"})})}getContractRecords(e){return u(this,null,function*(){return this.request(`/api/v1/properties/${e}/contracts`)})}createContractRecord(e){return u(this,null,function*(){return this.request("/api/v1/contract-records",{method:"POST",body:JSON.stringify(e)})})}updateContractRecord(e,t){return u(this,null,function*(){return this.request(`/api/v1/contract-records/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deleteContractRecord(e){return u(this,null,function*(){return this.request(`/api/v1/contract-records/${e}`,{method:"DELETE"})})}getAllReservationSubsections(e){return u(this,null,function*(){const t=e?`?${e.toString()}`:"";return this.request(`/api/v1/smart-views${t}`)})}getReservationSubsection(e){return u(this,null,function*(){return this.request(`/api/v1/smart-views/${e}`)})}createReservationSubsection(e){return u(this,null,function*(){return this.request("/api/v1/smart-views",{method:"POST",body:JSON.stringify(e)})})}updateReservationSubsection(e,t){return u(this,null,function*(){return this.request(`/api/v1/smart-views/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deleteReservationSubsection(e){return u(this,null,function*(){return this.request(`/api/v1/smart-views/${e}`,{method:"DELETE"})})}duplicateReservationSubsection(e,t){return u(this,null,function*(){return this.request(`/api/v1/smart-views/${e}/duplicate`,{method:"POST",body:JSON.stringify(t)})})}getVerifications(e="pending"){return u(this,null,function*(){let t="/api/v1/guest-portal/verification-status";return"pending"===e?t+="/pending":"all"===e?t+="/all":e&&(t+=`/${e}`),this.request(t)})}reviewVerification(e,t){return u(this,null,function*(){return this.request(`/api/v1/guest-portal/review-verification/${e}`,{method:"POST",body:JSON.stringify(t)})})}translateEntity(e,t,r,s){return u(this,null,function*(){return this.request(`/api/v1/translations/${e}/${t}/translate`,{method:"POST",body:JSON.stringify({fields:r,languages:s})})})}getFormulas(){return u(this,null,function*(){return this.request("/api/v1/formulas")})}createFormula(e){return u(this,null,function*(){return this.request("/api/v1/formulas",{method:"POST",body:JSON.stringify(e)})})}updateFormula(e,t){return u(this,null,function*(){return this.request(`/api/v1/formulas/${e}`,{method:"PUT",body:JSON.stringify(t)})})}deleteFormula(e){return u(this,null,function*(){return this.request(`/api/v1/formulas/${e}`,{method:"DELETE"})})}};c(De,"instance");const $e=De.getInstance(),Me=class e{constructor(){c(this,"recoveryPromise",null),c(this,"recoveryStartTime",null)}static getInstance(){return e.instance||(e.instance=new e),e.instance}recoverSession(){return u(this,null,function*(){if("undefined"!=typeof window&&window.__isLoggingOut)return console.log("[SessionRecovery] Skipping recovery - logout in progress"),null;if(this.recoveryPromise){const e=Date.now();if(!(this.recoveryStartTime&&e-this.recoveryStartTime>1e4))return console.log("[SessionRecovery] Recovery already in progress, returning existing promise"),this.recoveryPromise;console.log("[SessionRecovery] Recovery timeout - resetting"),this.recoveryPromise=null,this.recoveryStartTime=null}this.recoveryStartTime=Date.now(),this.recoveryPromise=Promise.race([this.performRecovery(),new Promise(e=>{setTimeout(()=>{console.log("[SessionRecovery] Recovery timeout after 10s"),e(null)},1e4)})]);try{return yield this.recoveryPromise}finally{this.recoveryPromise=null,this.recoveryStartTime=null}})}performRecovery(){return u(this,null,function*(){var e;try{console.log("[SessionRecovery] Attempting to recover session from storage...");const{data:{session:r},error:s}=yield ke.auth.getSession();if(s)return console.error("[SessionRecovery] Error getting session:",s),null;if(r){console.log("[SessionRecovery] Session recovered successfully");const{data:{user:e},error:t}=yield ke.auth.getUser(r.access_token);if(t||!e){console.log("[SessionRecovery] Session invalid, attempting refresh...");const{data:{session:e},error:t}=yield ke.auth.refreshSession();return!t&&e?(console.log("[SessionRecovery] Session refreshed successfully"),e):(console.error("[SessionRecovery] Failed to refresh session:",t),null)}return r}console.log("[SessionRecovery] No session from getSession, checking localStorage directly...");const n=`sb-${(void 0).split("//")[1].split(".")[0]}-auth-token`,o=localStorage.getItem(n);if(o)try{const t=JSON.parse(o);if(null==(e=null==t?void 0:t.currentSession)?void 0:e.refresh_token){console.log("[SessionRecovery] Found refresh token in localStorage, attempting to restore...");const{data:{session:e},error:r}=yield ke.auth.setSession({access_token:t.currentSession.access_token,refresh_token:t.currentSession.refresh_token});if(!r&&e)return console.log("[SessionRecovery] Session restored from localStorage"),e;console.error("[SessionRecovery] Failed to restore session:",r)}}catch(t){console.error("[SessionRecovery] Failed to parse stored session:",t)}return console.log("[SessionRecovery] No recoverable session found"),null}catch(r){return console.error("[SessionRecovery] Recovery error:",r),null}})}persistSession(e){return u(this,null,function*(){try{console.log("[SessionRecovery] Persisting session to storage..."),yield ke.auth.setSession({access_token:e.access_token,refresh_token:e.refresh_token}),console.log("[SessionRecovery] Session persisted successfully")}catch(t){console.error("[SessionRecovery] Failed to persist session:",t)}})}clearStoredSession(){try{const e=`sb-${(void 0).split("//")[1].split(".")[0]}-auth-token`;localStorage.removeItem(e),console.log("[SessionRecovery] Stored session cleared")}catch(e){console.error("[SessionRecovery] Failed to clear stored session:",e)}}tryRecover(){return u(this,null,function*(){if("undefined"!=typeof window&&window.__isLoggingOut)return console.log("[SessionRecovery] Skipping tryRecover - logout in progress"),null;try{const e=yield this.recoverSession();return e&&e.user?{user:e.user}:null}catch(e){return console.error("[SessionRecovery] tryRecover failed:",e),null}})}};c(Me,"instance");const qe=Me.getInstance(),Fe=class e{constructor(){c(this,"sessionPromise",null),c(this,"bootstrapPromise",null),c(this,"cachedSession",null),c(this,"cachedBootstrap",null),c(this,"sessionTimestamp",0),c(this,"bootstrapTimestamp",0),c(this,"SESSION_CACHE_MS",3e5),c(this,"BOOTSTRAP_CACHE_MS",3e5),c(this,"REQUEST_TIMEOUT_MS",1e4)}static getInstance(){return e.instance||(e.instance=new e),e.instance}getSession(e=!1){return u(this,null,function*(){var t,r;if("undefined"!=typeof window&&window.__isLoggingOut)return console.log("[AuthOptimizer] Skipping getSession - logout in progress"),null;const s=Date.now();if(!e&&this.cachedSession&&s-this.sessionTimestamp{setTimeout(()=>{console.warn("[AuthOptimizer] Session fetch timeout, using cached session if available"),e(this.cachedSession)},this.REQUEST_TIMEOUT_MS)}),t=(()=>u(this,null,function*(){console.log("[AuthOptimizer] Fetching session...");const e=Date.now();try{if(!this.cachedSession&&"undefined"!=typeof window){const e=`sb-${(void 0).split("//")[1].split(".")[0]}-auth-token`;localStorage.getItem(e)&&(console.log("[AuthOptimizer] Found stored session, waiting for Supabase to initialize..."),yield new Promise(e=>setTimeout(e,100)))}const{quickSessionCheck:t}=yield P(()=>u(this,null,function*(){const{quickSessionCheck:e}=yield import("./quickSessionCheck-CDz9td7h.js");return{quickSessionCheck:e}}),__vite__mapDeps([7,1,2,3,4,5,6])),r=yield t();if(r.hasSession&&r.session){const t=Date.now()-e;return console.log(`[AuthOptimizer] Session found via quick check in ${t}ms`),$e.setAccessToken(r.session.access_token),r.session}const s=yield qe.recoverSession(),n=Date.now()-e;return s?(console.log(`[AuthOptimizer] Session recovered successfully in ${n}ms`),$e.setAccessToken(s.access_token),s):(console.log(`[AuthOptimizer] No session found after ${n}ms - user may not be logged in`),null)}catch(t){return console.error("[AuthOptimizer] Session fetch failed:",t),this.cachedSession}}))();return yield Promise.race([t,e])})}fetchBootstrapWithTimeout(e){return u(this,null,function*(){const t=new Promise(t=>{setTimeout(()=>{console.warn("[AuthOptimizer] Bootstrap fetch timeout, using fallback"),t(this.createFallbackBootstrap(e))},this.REQUEST_TIMEOUT_MS)}),r=(()=>u(this,null,function*(){console.log("[AuthOptimizer] Fetching bootstrap data...");const t=Date.now();try{$e.setAccessToken(e.access_token);const r=yield $e.getAuthMe(),s=Date.now()-t;return console.log(`[AuthOptimizer] Bootstrap fetched in ${s}ms`),r}catch(r){return console.error("[AuthOptimizer] Bootstrap fetch failed:",r),this.createFallbackBootstrap(e)}}))();return Promise.race([r,t])})}createFallbackBootstrap(e){var t,r,s,n;const o=null==e?void 0:e.user;return{user:{id:(null==o?void 0:o.id)||"",email:(null==o?void 0:o.email)||"",role:(null==(t=null==o?void 0:o.app_metadata)?void 0:t.role)||"user",is_admin:"admin"===(null==(r=null==o?void 0:o.app_metadata)?void 0:r.role)},permissions:"admin"===(null==(s=null==o?void 0:o.app_metadata)?void 0:s.role)?[{section:"*",action:"*"}]:[],tenant:null,company_settings:null,modules:[],smart_views:{},subsections:[],metadata:{tenant_id:(null==(n=null==o?void 0:o.app_metadata)?void 0:n.tenant_id)||null,timestamp:(new Date).toISOString(),version:"1.0.0",is_fallback:!0}}}};c(Fe,"instance");const Ue=Fe.getInstance(),ze=class e{constructor(){c(this,"refreshTimer",null),c(this,"lastActivity",Date.now()),c(this,"visibilityChangeHandler",null),c(this,"isRefreshing",!1),console.log("[SessionPersistence] Manager initialized")}static getInstance(){return e.instance||(e.instance=new e),e.instance}start(){console.log("[SessionPersistence] Starting session monitoring..."),this.visibilityChangeHandler=this.handleVisibilityChange.bind(this),document.addEventListener("visibilitychange",this.visibilityChangeHandler),this.refreshTimer=window.setInterval(()=>this.checkAndRefresh(),12e4),["mousedown","keydown","scroll","touchstart"].forEach(e=>{window.addEventListener(e,()=>{this.lastActivity=Date.now()},{passive:!0})}),this.checkAndRefresh()}handleVisibilityChange(){return u(this,null,function*(){if("visible"!==document.visibilityState)return;const e=Date.now()-this.lastActivity;console.log(`[SessionPersistence] Tab visible after ${Math.floor(e/1e3)}s inactive`),yield this.validateAndRecoverSession()})}checkAndRefresh(){return u(this,null,function*(){try{const{data:{session:e},error:t}=yield ke.auth.getSession();if(!e||t)return;const r=1e3*e.expires_at-Date.now(),s=Math.floor(r/6e4);r<6e5&&r>0?(console.log(`[SessionPersistence] Token expiring in ${s} min - refreshing proactively...`),yield this.refreshWithRetry()):r<=0&&(console.warn("[SessionPersistence] Token already expired - attempting recovery..."),yield this.refreshWithRetry())}catch(e){console.error("[SessionPersistence] Error in checkAndRefresh:",e)}})}validateAndRecoverSession(){return u(this,null,function*(){try{const{data:{session:e},error:t}=yield ke.auth.getSession();if(!e||t)return;1e3*e.expires_at-Date.now()<3e5?(console.log("[SessionPersistence] Token expiring soon after inactivity - refreshing..."),yield this.refreshWithRetry()):console.log("[SessionPersistence] ✅ Session still valid")}catch(e){console.error("[SessionPersistence] Error in validateAndRecoverSession:",e)}})}refreshWithRetry(e=3){return u(this,null,function*(){var t,r,s;if(this.isRefreshing)return console.log("[SessionPersistence] Refresh already in progress, skipping..."),!1;this.isRefreshing=!0;try{const{data:{session:o}}=yield ke.auth.getSession();if(!o)return!1;for(let i=1;i<=e;i++)try{console.log(`[SessionPersistence] Refresh attempt ${i}/${e}...`);const{data:n,error:o}=yield ke.auth.refreshSession();if(n.session)return console.log(`[SessionPersistence] ✅ Refresh successful (attempt ${i})`),!0;if(o){if((null==(t=o.message)?void 0:t.includes("Auth session missing"))||(null==(r=o.message)?void 0:r.includes("Invalid Refresh Token"))||(null==(s=o.message)?void 0:s.includes("not found")))return!1;if(console.warn(`[SessionPersistence] Refresh attempt ${i} failed:`,o.message),isetTimeout(t,e))}}}catch(n){const t=(null==n?void 0:n.message)||String(n);if(t.includes("Auth session missing")||t.includes("Invalid Refresh Token"))return!1;if(console.error(`[SessionPersistence] Refresh attempt ${i} exception:`,n),isetTimeout(t,e))}}return console.error("[SessionPersistence] ❌ All refresh attempts failed"),!1}finally{this.isRefreshing=!1}})}stop(){console.log("[SessionPersistence] Stopping session monitoring..."),this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null),this.visibilityChangeHandler&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}manualCheck(){return u(this,null,function*(){console.log("[SessionPersistence] Manual session check triggered"),yield this.validateAndRecoverSession()})}};c(ze,"instance");const Ve=ze.getInstance();"undefined"!=typeof window&&(window.debugSession=()=>{ke.auth.getSession().then(({data:{session:e}})=>{if(e){const t=Math.floor((1e3*e.expires_at-Date.now())/1e3);console.log("Session Debug:",{user:e.user.email,expiresIn:`${Math.floor(t/60)} minutes ${t%60} seconds`,expiresAt:new Date(1e3*e.expires_at).toLocaleTimeString()})}else console.log("No active session")})}),"undefined"!=typeof window&&(window.__isLoggingOut=!1);const He=v.createContext(void 0),Be=()=>{const e=v.useContext(He);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},Je=({children:e})=>{const[t,r]=v.useState(null),[s,n]=v.useState(!0),[o,i]=v.useState(!1),a=v.useCallback(e=>{var t,r;const s=e.user;let n=null;const o=function(e){if(!(null==e?void 0:e.access_token))return null;try{const t=function(e){try{const t=e.split(".");if(3!==t.length)return console.warn("[JWT] Invalid token format"),null;const r=t[1],s=r+"==".substring(0,(4-r.length%4)%4),n=atob(s);return JSON.parse(n)}catch(t){return console.error("[JWT] Failed to decode token payload:",t),null}}(e.access_token);return(null==t?void 0:t.tenant_id)||null}catch(t){return console.error("[JWT] Error extracting tenant from session:",t),null}}(e);return o&&(n=o),!n&&(null==(t=s.app_metadata)?void 0:t.tenant_id)&&(n=s.app_metadata.tenant_id),!n&&(null==(r=s.user_metadata)?void 0:r.tenant_id)&&(n=s.user_metadata.tenant_id),s.tenant_id=n,s},[]),l=v.useCallback(e=>{var t,r;const s=e;let n=null;return(null==(t=s.app_metadata)?void 0:t.tenant_id)?n=s.app_metadata.tenant_id:(null==(r=s.user_metadata)?void 0:r.tenant_id)&&(n=s.user_metadata.tenant_id),s.tenant_id=n,s},[]),c=v.useCallback(()=>u(null,null,function*(){try{const{data:{session:e}}=yield ke.auth.getSession();if(e){const t=a(e);r(t),i(!0)}else r(null),i(!1)}catch(e){console.error("Error refreshing session:",e),r(null),i(!1)}}),[a]),h=v.useCallback(()=>u(null,null,function*(){var e;try{const{data:{session:t}}=yield ke.auth.getSession();return null!=(e=null==t?void 0:t.access_token)?e:null}catch(t){return null}}),[]);return v.useEffect(()=>{console.log("🔍 [AuthContext] Provider MOUNTED via useEffect"),u(null,null,function*(){try{if(window.__isLoggingOut)return console.log("[AuthContext] Skipping auth initialization - logout in progress"),void n(!1);const{data:{session:e}}=yield ke.auth.getSession();if(e){const t=a(e);r(t),i(!0)}else if(!window.__isLoggingOut){const e=yield qe.tryRecover();if(e){const t=l(e.user);r(t),i(!0)}}}catch(e){console.error("Error initializing auth:",e)}finally{n(!1)}}),Ve.start();const e=e=>{const t=e;console.error("[AuthContext] Session expired and could not be recovered:",t.detail),r(null),i(!1)};window.addEventListener("session-expired",e);const{data:{subscription:t}}=ke.auth.onAuthStateChange((e,t)=>{console.log("🔍 [AuthContext] Auth state changed EVENT:",e),console.log("🔍 [AuthContext] Session present:",!!t);try{if(t){console.log("🔍 [AuthContext] Session User Email:",t.user.email);const e=a(t);console.log("🔍 [AuthContext] Enriched User:",e?"SUCCESS":"NULL"),r(e),i(!0),Ue.storeSession(t)}else console.log("🔍 [AuthContext] Session is NULL -> Logging out"),r(null),i(!1),Ue.clearSession()}catch(s){console.error("❌ [AuthContext] CRITICAL ERROR in auth state change handler:",s)}n(!1)});return()=>{t.unsubscribe(),Ve.stop(),window.removeEventListener("session-expired",e)}},[a]),d.jsx(He.Provider,{value:{user:t,isLoading:s,isAuthenticated:o,signIn:(e,t)=>u(null,null,function*(){try{const{data:s,error:n}=yield ke.auth.signInWithPassword({email:e,password:t});if(n)return{error:n};if(s.session){const e=a(s.session);r(e),i(!0),Ue.storeSession(s.session),Ve.start(),console.log("[AuthContext] Session persistence manager restarted after login")}return{error:null}}catch(s){return{error:s}}}),signOut:()=>u(null,null,function*(){try{console.log("[AuthContext] Starting logout process"),window.__isLoggingOut=!0,console.log("[AuthContext] Logout flag set - blocking all session recovery"),localStorage.clear(),sessionStorage.clear(),console.log("[AuthContext] Storage cleared"),Ve.stop(),console.log("[AuthContext] Session persistence manager stopped"),qe.clearStoredSession(),Ue.clearSession(),console.log("[AuthContext] Session recovery cleared"),yield ke.auth.signOut(),console.log("[AuthContext] Supabase sign out completed"),r(null),i(!1),console.log("[AuthContext] Logout completed successfully"),setTimeout(()=>{window.__isLoggingOut=!1,window.location.href="/login"},100)}catch(e){console.error("[AuthContext] Error during logout:",e);try{localStorage.clear(),sessionStorage.clear(),Ve.stop(),qe.clearStoredSession(),Ue.clearSession()}catch(t){console.error("[AuthContext] Error clearing sessions:",t)}r(null),i(!1),setTimeout(()=>{window.__isLoggingOut=!1,window.location.href="/login"},100)}}),refreshSession:c,getAccessToken:h},children:e})},We=v.createContext(null),Ke={},Ge=({children:e})=>{var t,r,s,n;const o=Be(),i={user:o.user,status:o.isLoading?"initializing":o.isAuthenticated?"authenticated":"unauthenticated",permissions:[],modules:[],tenantId:(null==(r=null==(t=o.user)?void 0:t.user_metadata)?void 0:r.tenant_id)||null,companySettings:null,tenant:null,error:null,hasPermission:(e,t)=>!1,hasModule:e=>!1,refreshSession:o.refreshSession},c=o.isLoading,[h,p]=v.useState([]),[g,m]=v.useState(null),[f,y]=v.useState(null),[x,b]=v.useState([]),[S,w]=v.useState(null),[k,_]=v.useState([]),[N,C]=v.useState(null),[j,I]=v.useState(!1),[A,R]=v.useState(!1),P=v.useMemo(()=>{var e;const t=f||i.tenantId||null,r=x.length>0?x:Array.isArray(i.modules)?i.modules:[];return t&&r.length>0?(Ke[t]=r,new Set(r)):t&&(null==(e=Ke[t])?void 0:e.length)?new Set(Ke[t]):new Set(r)},[x,i.modules,i.tenantId,f]),E=v.useMemo(()=>{var e,t,r,s,n;if(null!==N)return console.log("[AppContext] Using is_admin from /me endpoint:",N),N;if((h.length>0?h:i.permissions||[]).some(e=>"*"===e.section&&"*"===e.action))return!0;if("admin"===((null==(t=null==(e=i.user)?void 0:e.app_metadata)?void 0:t.role)||(null==(s=null==(r=i.user)?void 0:r.user_metadata)?void 0:s.role)))return!0;const o=(null==(n=i.user)?void 0:n.email)||"";return["sid@theflexliving.com","raouf@theflexliving.com","michael@theflexliving.com"].includes(o)},[N,h,i.permissions,i.user]);v.useEffect(()=>{try{Object.keys(Ke).forEach(e=>delete Ke[e])}catch(e){}b([]),w(null),y(null),p([]),_([]),C(null),I(!1),R(!1),console.log("[AppContext] User changed – state reset")},[null==(s=i.user)?void 0:s.id]),v.useEffect(()=>{if("authenticated"!==i.status)return;let e=!1;return u(null,null,function*(){var t,r,s,n,o,a,l,c;try{if(!h.length)try{let o=null,a=0;for(let e=0;ea&&(a=s,o=t)}}if(o){const a=localStorage.getItem(o),l=JSON.parse(a),c=(null==l?void 0:l.data)||{},u=Array.isArray(c.permissions)?c.permissions:[],d=(null==(t=null==c?void 0:c.metadata)?void 0:t.tenant_id)||(null==(r=null==c?void 0:c.tenant)?void 0:r.id)||null,h=Array.isArray(c.modules)?c.modules:[],g=c.company_settings||null,m=Array.isArray(c.departments)?c.departments:Array.isArray(null==(s=null==c?void 0:c.metadata)?void 0:s.departments)?c.metadata.departments:[];if(!e){if(u.length&&p(u),d){const e=i.tenantId,t=null==(n=i.user)?void 0:n.email,r={"noam@stayhomely.de":"5a382f72-aec3-40f1-9063-89476ae00669"};let s=e||d;if(t&&r[t]){const e=r[t];s!==e&&(console.warn("[AppContext] 🚨 BOOTSTRAP EMERGENCY OVERRIDE:",{user_email:t,wrong_tenant:s,correct_tenant:e}),s=e)}e&&d!==e&&console.warn("[AppContext] 🚨 BOOTSTRAP TENANT CONFLICT:",{jwt_tenant_id:e,bootstrap_tenant_id:d,final_tenant_id:s,resolution:r[t||""]?"emergency_override":"jwt_priority"}),y(s)}h.length&&b(h),g&&w(g),m.length&&_(m)}console.log("[AppContext] Hydrated from bootstrap cache",{perms:u.length,mods:h.length,depts:m.length,tidFromData:d})}}catch(u){console.log("[AppContext] Bootstrap cache parse failed",u)}const g=!j||A;if(j&&!A&&!h.length){const t=f||i.tenantId||"unknown",r=`auth_cache_permissions_${(null==(o=i.user)?void 0:o.id)||"anon"}_${t}`,s=localStorage.getItem(r);if(s){const t=JSON.parse(s);Array.isArray(null==t?void 0:t.data)&&t.data.length>0&&(e||p(t.data),console.log("[AppContext] Loaded permissions from cache (subsequent load)",t.data.length))}}if(g){console.log("[AppContext] Fetching FRESH permissions from backend (page refresh/initial load)",{hasInitialRefresh:j,forceRefreshFlag:A});const t=yield $e.getAuthMe();if(t){if(!e&&Array.isArray(t.permissions)&&(console.log(`[AppContext] ✅ Setting FRESH permissions: ${t.permissions.length} permissions loaded`),p(t.permissions)),!e){const e=i.tenantId,r=t.tenant_id,s=null==(a=i.user)?void 0:a.email,n={"noam@stayhomely.de":"5a382f72-aec3-40f1-9063-89476ae00669"};let o=e||r||null;if(s&&n[s]){const e=n[s];o!==e&&(console.warn("[AppContext] 🚨 EMERGENCY TENANT OVERRIDE:",{user_email:s,wrong_tenant:o,correct_tenant:e,source:"emergency_override"}),o=e)}e&&r&&e!==r&&console.warn("[AppContext] 🚨 TENANT CONFLICT DETECTED:",{jwt_tenant_id:e,api_tenant_id:r,user_email:s,final_tenant_id:o,resolution:n[s||""]?"emergency_override":"jwt_priority"}),y(o),o&&(null==(l=i.user)?void 0:l.id)&&Ae.setContext({tenant_id:o,user_id:i.user.id,email:i.user.email}),console.log("[AppContext] ✅ Tenant resolution completed:",{final_tenant_id:o,source:e?"JWT_prioritized":"API_fallback"})}if(e||(I(!0),R(!1)),t.is_admin){console.log("[AppContext] User is admin - fetching ALL departments");try{const t=yield $e.getDepartments();!e&&Array.isArray(t)&&(_(t),console.log("[AppContext] Admin departments loaded:",t.length))}catch(d){console.error("[AppContext] Failed to fetch all departments for admin:",d),!e&&Array.isArray(t.departments)&&_(t.departments)}}else!e&&Array.isArray(t.departments)&&_(t.departments);e||"boolean"!=typeof t.is_admin||(C(t.is_admin),console.log("[AppContext] Set isAdmin from /me endpoint:",t.is_admin));try{if(Array.isArray(t.permissions)){const e=`auth_cache_permissions_${(null==(c=i.user)?void 0:c.id)||"anon"}_${t.tenant_id||"unknown"}`;localStorage.setItem(e,JSON.stringify({ts:Date.now(),data:t.permissions}))}}catch(u){}}}}catch(u){e||m((null==u?void 0:u.message)||"Failed to load auth context"),console.log("[AppContext] Error during hydration",u)}}),()=>{e=!0}},[i.status,null==(n=i.user)?void 0:n.id,f,i.tenantId,h.length,j,A]);const O=v.useCallback((e,t)=>{const r=(e||"").toLowerCase(),s=h.length>0?h:i.permissions||[];if(!s.length)return!1;if(E)return!0;if(s.some(e=>"*"===e.section&&"*"===e.action))return!0;const n=e=>({reservations:"all_reservations",property:"properties",property_details:"properties",props:"properties"}[e]||e),o=n(r);return s.some(e=>n((e.section||"").toLowerCase())===o&&(e.action===t||"read"===t&&"view"===e.action))},[h,i.permissions,E]);v.useEffect(()=>{const e=f||i.tenantId||null;if("authenticated"!==i.status||!e)return;let t=!1;return u(null,null,function*(){try{const e=yield $e.getCompanySettings();!t&&e&&(w(e),console.log("[AppContext] Company settings refreshed"))}catch(e){}}),()=>{t=!0}},[i.status,f,i.tenantId]);const T=v.useMemo(()=>c||"authenticated"===i.status&&0===h.length&&!g,[c,i.status,h.length,g]),L=v.useMemo(()=>i.user?l(a({},i.user),{tenant_id:f||i.tenantId||null,permissions:h.length>0?h:i.permissions||[],departments:k,modules:Array.from(P),is_admin:null!=N&&N}):null,[i.user,f,i.tenantId,h,i.permissions,k,P,N]);v.useEffect(()=>{L&&console.log("[AppContext] Composed user updated",{id:L.id,email:L.email,is_admin:L.is_admin,tenant_id:L.tenant_id,permissions:L.permissions.length,departmentsCount:L.departments.length,modules:L.modules.length})},[L]);const D={user:L,tenant:f||i.tenantId?{id:f||i.tenantId}:null,companySettings:S||i.companySettings,permissions:h.length?h:i.permissions||[],modules:P,isLoading:T,error:g||i.error,isAdmin:E,hasPermission:O,hasModule:i.hasModule,refreshData:(e=!1)=>u(null,null,function*(){yield i.refreshSession(),e||!j?(console.log("[AppContext] refreshData invoked - forcing permission refresh"),R(!0)):console.log("[AppContext] refreshData invoked - session refresh only")}),refreshDepartments:()=>u(null,null,function*(){console.log("[AppContext] refreshDepartments invoked");try{if(E){console.log("[AppContext] Fetching ALL departments for admin");const e=yield $e.getDepartments();_(e),console.log("[AppContext] Departments refreshed:",e.length)}else{console.log("[AppContext] Fetching assigned departments for non-admin");const e=yield $e.getAuthMe();e&&Array.isArray(e.departments)&&(_(e.departments),console.log("[AppContext] Departments refreshed:",e.departments.length))}}catch(e){console.error("[AppContext] Failed to refresh departments:",e)}}),departments:k};return d.jsx(We.Provider,{value:D,children:e})},Ye=({children:e})=>{const{isAuthenticated:t,isLoading:r}=Be();return console.log(`🛡️ [ProtectedRoute] Rendering. Loading: ${r}, Authenticated: ${t}`),r?d.jsx("div",{className:"flex items-center justify-center min-h-screen",children:d.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})}):t?d.jsx(d.Fragment,{children:e}):(console.warn("🛡️ [ProtectedRoute] Not authenticated -> Redirecting to /login"),d.jsx(x,{to:"/login",replace:!0}))};function Qe({children:e}){var t,r;const s=Be(),{user:n}=s,o="initializing"===s.status,i=b();if(o)return d.jsx("div",{className:"min-h-screen flex items-center justify-center",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})});if(n){const e=(null==(r=null==(t=i.state)?void 0:t.from)?void 0:r.pathname)||"/";return d.jsx(x,{to:e,replace:!0})}return d.jsx(d.Fragment,{children:e})}const Xe=()=>{var e,t;const r=b(),s=S(),{signOut:n,user:o}=Be(),{isCollapsed:i,setIsCollapsed:a,isMobileOpen:l,setIsMobileOpen:c}=qt(),h=w.useMemo(()=>(e=>[{name:"Dashboard",href:"/dashboard",icon:$,section:"dashboard",alwaysShow:!0},{name:"Properties",href:"/properties",icon:$,section:"properties"},{name:"Reservations",href:"/reservations",icon:$,section:"reservations"},{name:"Cleaning",href:"/cleaning",icon:$,section:"cleaning"}].filter(t=>t.alwaysShow||((e,t)=>{var r;return!(!e||!e.permissions)&&(!(!e.isAdmin&&"admin"!==(null==(r=e.app_metadata)?void 0:r.role))||e.permissions.some(e=>!(e.section!==t&&"*"!==e.section||"read"!==e.action&&"*"!==e.action&&"create"!==e.action&&"update"!==e.action&&"delete"!==e.action)))})(e,t.section)))(o),[o]),p=e=>{s(e),c(!1)};return d.jsxs(d.Fragment,{children:[l&&d.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>c(!1)}),d.jsxs("div",{className:`\n fixed inset-y-0 left-0 z-50 flex flex-col bg-white border-r border-gray-200\n transition-all duration-300 ease-in-out\n ${i?"w-16":"w-64"}\n ${l?"translate-x-0":"-translate-x-full"}\n lg:translate-x-0 lg:static lg:h-full\n `,children:[d.jsxs("div",{className:"flex items-center justify-between h-16 px-4 border-b border-gray-200",children:[!i&&d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-blue-600 to-indigo-700 rounded-lg flex items-center justify-center shadow-sm",children:d.jsx("span",{className:"text-white font-bold text-sm",children:"PF"})}),d.jsx("span",{className:"font-bold text-gray-900 tracking-tight",children:"PropertyFlow"})]}),d.jsx("button",{onClick:()=>a(!i),className:"hidden lg:flex p-1.5 rounded-lg hover:bg-gray-100 transition-colors items-center justify-center",title:i?"Expand sidebar":"Collapse sidebar",children:i?d.jsx(E,{className:"w-5 h-5 min-w-[20px] min-h-[20px] shrink-0 text-gray-600"}):d.jsx(O,{className:"w-5 h-5 min-w-[20px] min-h-[20px] shrink-0 text-gray-600"})}),d.jsx("button",{onClick:()=>c(!1),className:"lg:hidden p-1.5 rounded-lg hover:bg-gray-100 flex items-center justify-center",children:d.jsx(T,{className:"w-5 h-5 min-w-[20px] min-h-[20px] shrink-0 text-gray-600"})})]}),d.jsx("nav",{className:"flex-1 overflow-y-auto p-4 space-y-1",children:h.map(e=>{const t=e.icon,s="/dashboard"===(n=e.href)?"/"===r.pathname||"/dashboard"===r.pathname:r.pathname.startsWith(n);var n;return d.jsxs("button",{onClick:()=>p(e.href),className:`\n w-full flex items-center gap-3 px-3 py-2.5 rounded-lg\n transition-colors duration-150\n ${s?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-100"}\n ${i?"justify-center":""}\n `,title:i?e.name:void 0,children:[d.jsx(t,{className:"w-5 h-5 min-w-[20px] min-h-[20px] shrink-0 "+(s?"text-blue-700":"text-gray-500")}),!i&&d.jsx("span",{className:"font-medium",children:e.name})]},e.name)})}),d.jsxs("div",{className:"border-t border-gray-200 p-4",children:[d.jsxs("button",{onClick:()=>p("/profile"),className:`\n w-full flex items-center gap-3 px-3 py-2.5 rounded-lg\n text-gray-700 hover:bg-gray-100 transition-colors mb-2\n ${i?"justify-center":""}\n `,title:i?"Profile":void 0,children:[d.jsx("div",{className:"w-8 h-8 min-w-[32px] min-h-[32px] bg-blue-100 rounded-full flex items-center justify-center shrink-0",children:d.jsx(L,{className:"w-4 h-4 min-w-[16px] min-h-[16px] shrink-0 text-blue-600"})}),!i&&o&&d.jsxs("div",{className:"flex-1 text-left min-w-0",children:[d.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:(null==(e=o.user_metadata)?void 0:e.full_name)||(null==(t=o.user_metadata)?void 0:t.name)||o.email}),d.jsx("p",{className:"text-xs text-gray-500 truncate",children:o.email})]})]}),d.jsxs("button",{onClick:()=>u(null,null,function*(){try{console.log("[Sidebar] Logout clicked"),yield n()}catch(e){console.error("[Sidebar] Logout error:",e)}}),className:`\n w-full flex items-center gap-3 px-3 py-2.5 rounded-lg\n text-red-600 hover:bg-red-50 transition-colors\n ${i?"justify-center":""}\n `,title:i?"Logout":void 0,children:[d.jsx(D,{className:"w-5 h-5 min-w-[20px] min-h-[20px] shrink-0"}),!i&&d.jsx("span",{className:"font-medium",children:"Logout"})]})]})]})]})},Ze=class e{constructor(){c(this,"recoveryInProgress",!1),c(this,"recoveryHistory",[]),c(this,"MAX_RECOVERY_ATTEMPTS",5),c(this,"RECOVERY_COOLDOWN",3e4),c(this,"lastRecoveryTime",0),c(this,"recoveryStrategies",[]),this.initializeRecoveryStrategies(),this.startRecoveryMonitoring()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initializeRecoveryStrategies(){this.recoveryStrategies=[{name:"remove_corrupted_items",severity:"targeted",description:"Remove specific corrupted storage items",applicableIssues:["corruption"],execute:()=>u(this,null,function*(){return this.removeCorruptedItems()})},{name:"clean_expired_items",severity:"targeted",description:"Remove expired storage items",applicableIssues:["size_overflow"],execute:()=>u(this,null,function*(){return this.cleanExpiredItems()})},{name:"resolve_orphaned_data",severity:"targeted",description:"Remove orphaned data from previous sessions",applicableIssues:["orphaned_data"],execute:()=>u(this,null,function*(){return this.resolveOrphanedData()})},{name:"fix_version_mismatches",severity:"targeted",description:"Migrate or remove items with version mismatches",applicableIssues:["version_mismatch"],execute:()=>u(this,null,function*(){return this.fixVersionMismatches()})},{name:"clear_session_conflicts",severity:"aggressive",description:"Resolve conflicting session data",applicableIssues:["session_conflict"],execute:()=>u(this,null,function*(){return this.clearSessionConflicts()})},{name:"rebuild_storage_schema",severity:"aggressive",description:"Rebuild storage with current schema",applicableIssues:["invalid_schema","version_mismatch"],execute:()=>u(this,null,function*(){return this.rebuildStorageSchema()})},{name:"clear_user_cache",severity:"aggressive",description:"Clear all cached data while preserving session",applicableIssues:["corruption","size_overflow"],execute:()=>u(this,null,function*(){return this.clearUserCache()})},{name:"emergency_reset_with_backup",severity:"nuclear",description:"Reset all storage while backing up critical data",applicableIssues:["corruption","critical"],execute:()=>u(this,null,function*(){return this.emergencyResetWithBackup()})},{name:"complete_storage_wipe",severity:"nuclear",description:"Complete storage wipe - absolute last resort",applicableIssues:["critical"],execute:()=>u(this,null,function*(){return this.completeStorageWipe()})}]}attemptRecovery(e){return u(this,null,function*(){if(this.recoveryInProgress)return console.log("[StorageRecoverySystem] Recovery already in progress"),this.createEmptyRecoveryReport();const t=Date.now();if(t-this.lastRecoveryTimee.name));const a=[];let l=t.issues.length;for(const e of i){if(0===l){console.log("[StorageRecoverySystem] All issues resolved, stopping recovery");break}if(a.length>=this.MAX_RECOVERY_ATTEMPTS){console.log("[StorageRecoverySystem] Max recovery attempts reached");break}console.log(`[StorageRecoverySystem] Executing strategy: ${e.name}`);const t=Date.now();let r,n=!1;try{n=yield e.execute()}catch(s){r=s instanceof Error?s.message:String(s),console.error(`[StorageRecoverySystem] Strategy ${e.name} failed:`,r)}const o=(yield Pe.performHealthCheck()).issues.length,i={strategy:e.name,timestamp:t,success:n&&o{var t,r;return"aggressive"===(null==(t=this.recoveryStrategies.find(t=>t.name===e.strategy))?void 0:t.severity)||"nuclear"===(null==(r=this.recoveryStrategies.find(t=>t.name===e.strategy))?void 0:r.severity)});c&&o&&(yield this.restoreCriticalData(o));const u=yield Pe.performHealthCheck(),d={total_attempts:a.length,successful_attempts:a.filter(e=>e.success).length,failed_attempts:a.filter(e=>!e.success).length,recovery_strategies_used:a.map(e=>e.strategy),final_health_status:u.overall_health,critical_data_preserved:!c||!!o,recovery_duration_ms:Date.now()-r,recommendations:this.generateRecoveryRecommendations(a,u)};console.log("[StorageRecoverySystem] Recovery completed:",d);try{Ae.set("last_recovery_report",d,{skipIntegrityCheck:!0,ttl:864e5})}catch(n){console.warn("[StorageRecoverySystem] Failed to store recovery report:",n)}return d}finally{this.recoveryInProgress=!1}})}selectRecoveryStrategies(e){const t=[],r=new Set(e.map(e=>e.type)),s=Math.max(...e.map(e=>"critical"===e.severity?4:"high"===e.severity?3:"medium"===e.severity?2:1));for(const n of this.recoveryStrategies)n.applicableIssues.some(e=>r.has(e))&&(s>=4||s>=3&&"nuclear"!==n.severity||s>=2&&"targeted"===n.severity||1===s&&"targeted"===n.severity)&&t.push(n);if(0===t.length&&e.length>0){const e=this.recoveryStrategies.find(e=>"remove_corrupted_items"===e.name);e&&t.push(e)}return t.sort((e,t)=>{const r={targeted:1,aggressive:2,nuclear:3};return r[e.severity]-r[t.severity]})}backupCriticalData(){return u(this,null,function*(){try{const t={},r=Oe.getCurrentContext();r&&(t.session_context=r);try{const{data:{session:e}}=yield ke.auth.getSession();e&&(t.supabase_session={access_token:e.access_token,refresh_token:e.refresh_token,user_id:e.user.id,expires_at:e.expires_at})}catch(e){console.warn("[StorageRecoverySystem] Failed to backup Supabase session:",e)}try{const e=Ae.get("user_preferences");e&&(t.user_preferences=e)}catch(e){}const s=`emergency_backup_${Date.now()}`;try{return localStorage.setItem(s,JSON.stringify({timestamp:Date.now(),data:t})),console.log("[StorageRecoverySystem] Critical data backed up"),{backup_key:s,data:t}}catch(e){return console.warn("[StorageRecoverySystem] Failed to store backup:",e),t}}catch(t){return console.error("[StorageRecoverySystem] Failed to backup critical data:",t),null}})}restoreCriticalData(e){return u(this,null,function*(){try{if(!e||!e.data)return void console.log("[StorageRecoverySystem] No backup data to restore");const{data:r}=e;if(r.session_context)try{yield Oe.setSessionContext(r.session_context),console.log("[StorageRecoverySystem] Session context restored")}catch(t){console.warn("[StorageRecoverySystem] Failed to restore session context:",t)}if(r.supabase_session)try{yield ke.auth.setSession({access_token:r.supabase_session.access_token,refresh_token:r.supabase_session.refresh_token}),console.log("[StorageRecoverySystem] Supabase session restored")}catch(t){console.warn("[StorageRecoverySystem] Failed to restore Supabase session:",t)}if(r.user_preferences)try{Ae.set("user_preferences",r.user_preferences),console.log("[StorageRecoverySystem] User preferences restored")}catch(t){console.warn("[StorageRecoverySystem] Failed to restore user preferences:",t)}if(e.backup_key)try{localStorage.removeItem(e.backup_key)}catch(t){}}catch(r){console.error("[StorageRecoverySystem] Failed to restore critical data:",r)}})}removeCorruptedItems(){return u(this,null,function*(){try{let t=0;for(let r=localStorage.length-1;r>=0;r--){const s=localStorage.key(r);if(s)try{const e=localStorage.getItem(s);e&&JSON.parse(e)}catch(e){localStorage.removeItem(s),t++}}return console.log(`[StorageRecoverySystem] Removed ${t} corrupted items`),t>0}catch(e){return console.error("[StorageRecoverySystem] Failed to remove corrupted items:",e),!1}})}cleanExpiredItems(){return u(this,null,function*(){try{let t=0;const r=Date.now();for(let s=localStorage.length-1;s>=0;s--){const n=localStorage.key(s);if(n)try{const e=localStorage.getItem(n);if(!e)continue;const s=JSON.parse(e);s.expires_at&&r>s.expires_at&&(localStorage.removeItem(n),t++)}catch(e){}}return console.log(`[StorageRecoverySystem] Removed ${t} expired items`),t>0}catch(e){return console.error("[StorageRecoverySystem] Failed to clean expired items:",e),!1}})}resolveOrphanedData(){return u(this,null,function*(){try{const e=Oe.getCurrentContext();if(!e)return!1;let t=0;for(let r=localStorage.length-1;r>=0;r--){const s=localStorage.key(r);if(!s)continue;const n=s.split("::");if(n.length>=2){const r=n[1],o=n[0];r===e.user_id&&o===e.tenant_id||(localStorage.removeItem(s),t++)}}return console.log(`[StorageRecoverySystem] Resolved ${t} orphaned items`),t>0}catch(e){return console.error("[StorageRecoverySystem] Failed to resolve orphaned data:",e),!1}})}fixVersionMismatches(){return u(this,null,function*(){try{let t=0;const r="2.0.0";for(let s=localStorage.length-1;s>=0;s--){const n=localStorage.key(s);if(n)try{const e=localStorage.getItem(n);if(!e)continue;const s=JSON.parse(e);s.version&&s.version!==r&&(localStorage.removeItem(n),t++)}catch(e){}}return console.log(`[StorageRecoverySystem] Fixed ${t} version mismatches`),t>0}catch(e){return console.error("[StorageRecoverySystem] Failed to fix version mismatches:",e),!1}})}clearSessionConflicts(){return u(this,null,function*(){try{const e=Oe.getCurrentContext();let t=0;for(let r=localStorage.length-1;r>=0;r--){const s=localStorage.key(r);s&&(s.includes("session")||s.includes("auth"))&&(e&&s.includes(e.user_id)||(localStorage.removeItem(s),t++))}return console.log(`[StorageRecoverySystem] Cleared ${t} session conflicts`),t>0}catch(e){return console.error("[StorageRecoverySystem] Failed to clear session conflicts:",e),!1}})}rebuildStorageSchema(){return u(this,null,function*(){try{return console.log("[StorageRecoverySystem] Schema rebuild not yet implemented"),!0}catch(e){return console.error("[StorageRecoverySystem] Failed to rebuild storage schema:",e),!1}})}clearUserCache(){return u(this,null,function*(){try{const e=Oe.getCurrentContext();if(e){const t=Ae.clearUserData(e);return console.log(`[StorageRecoverySystem] Cleared user cache: ${t} items`),t>0}return!1}catch(e){return console.error("[StorageRecoverySystem] Failed to clear user cache:",e),!1}})}emergencyResetWithBackup(){return u(this,null,function*(){try{console.log("[StorageRecoverySystem] Performing emergency reset with backup");const e=[];for(let t=0;t{}),console.log("[StorageRecoverySystem] Emergency reset completed with backup preservation"),!0}catch(e){return console.error("[StorageRecoverySystem] Emergency reset failed:",e),!1}})}completeStorageWipe(){return u(this,null,function*(){try{if(console.log("[StorageRecoverySystem] Performing complete storage wipe"),Ae.clearAll(),sessionStorage.clear(),"indexedDB"in window)try{const e=yield indexedDB.databases();for(const t of e)t.name&&(yield indexedDB.deleteDatabase(t.name))}catch(e){console.warn("[StorageRecoverySystem] Failed to clear IndexedDB:",e)}return console.log("[StorageRecoverySystem] Complete storage wipe completed"),!0}catch(t){return console.error("[StorageRecoverySystem] Complete storage wipe failed:",t),!1}})}generateRecoveryRecommendations(e,t){const r=[],s=e.filter(e=>!e.success),n=e.filter(e=>e.success);return"healthy"===t.overall_health?r.push("Recovery successful - storage is now healthy"):"degraded"===t.overall_health?r.push("Partial recovery - monitor storage health closely"):r.push("Recovery incomplete - manual intervention may be required"),s.length>0&&r.push(`${s.length} recovery strategies failed - check browser console for details`),0===n.length&&r.push("No recovery strategies succeeded - consider using incognito mode temporarily"),t.issues.some(e=>"corruption"===e.type)&&r.push("Corruption still detected - avoid storing sensitive data until resolved"),t.issues.some(e=>"size_overflow"===e.type)&&r.push("Storage size issues persist - clear old data manually"),r}createEmptyRecoveryReport(){return{total_attempts:0,successful_attempts:0,failed_attempts:0,recovery_strategies_used:[],final_health_status:"unknown",critical_data_preserved:!0,recovery_duration_ms:0,recommendations:["Recovery was not performed"]}}createSuccessRecoveryReport(e,t){return{total_attempts:t.length,successful_attempts:t.filter(e=>e.success).length,failed_attempts:t.filter(e=>!e.success).length,recovery_strategies_used:t.map(e=>e.strategy),final_health_status:"healthy",critical_data_preserved:!0,recovery_duration_ms:Date.now()-e,recommendations:["Storage is healthy - no action required"]}}startRecoveryMonitoring(){setInterval(()=>u(this,null,function*(){if(!this.recoveryInProgress){const e=yield Pe.performHealthCheck();("critical"===e.overall_health||"corrupted"===e.overall_health&&e.issues.some(e=>"critical"===e.severity))&&(console.log("[StorageRecoverySystem] Critical storage issues detected, attempting automatic recovery"),yield this.attemptRecovery(e))}}),6e4)}getRecoveryHistory(){return[...this.recoveryHistory]}getDiagnostics(){return{recovery_in_progress:this.recoveryInProgress,last_recovery_time:this.lastRecoveryTime,recovery_history_count:this.recoveryHistory.length,available_strategies:this.recoveryStrategies.length,max_recovery_attempts:this.MAX_RECOVERY_ATTEMPTS,recovery_cooldown_ms:this.RECOVERY_COOLDOWN}}};c(Ze,"instance");const et=Ze.getInstance();"undefined"!=typeof window&&(window.storageRecoverySystem=et,window.attemptStorageRecovery=()=>et.attemptRecovery());const tt="app_storage_version",rt="2.0.0",st=class e{constructor(){this.initialize()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initialize(){try{const e=localStorage.getItem(tt);e&&e===rt||(console.log(`LocalStorage version mismatch. Current: ${rt}, Stored: ${e}`),this.migrateStorage(e)),localStorage.setItem(tt,rt)}catch(e){console.error("Failed to initialize localStorage:",e),this.clearCorruptedStorage()}}migrateStorage(e){console.log(`Migrating localStorage from version ${e} to ${rt}`);const t={null:()=>{this.clearAllExceptEssentials()},"1.0.0":()=>{this.migrateV1ToV2()},"1.1.0":()=>{this.migrateV1ToV2()},"1.2.0":()=>{this.migrateV1ToV2()},"2.0.0":()=>{this.migrateV1ToV2()}}[e||"null"];t?t():(console.warn(`Unknown storage version: ${e}. Clearing non-essential data.`),this.clearAllExceptEssentials())}migrateV1ToV2(){try{const t=["selectedCity","user_permissions","tenant_id","organization_id"],r={};for(let e=0;e{const t=localStorage.getItem(e);if(t)if("user_permissions"===e)try{JSON.parse(t),r[e]=t}catch(s){console.warn(`Corrupted JSON in ${e}, skipping preservation`)}else r[e]=t});const s=["cache_","temp_","old_","_legacy","undefined","null"],n=[];for(let o=0;or.startsWith(e)||r===e)&&n.push(r);try{const e=localStorage.getItem(r);(e&&e.startsWith("{")||(null==e?void 0:e.startsWith("[")))&&JSON.parse(e)}catch(e){t.includes(r)||(console.warn(`Removing corrupted JSON key: ${r}`),n.push(r))}}}n.forEach(e=>{r.hasOwnProperty(e)||localStorage.removeItem(e)}),Object.entries(r).forEach(([e,t])=>{localStorage.setItem(e,t)}),this.updateDataStructures(),console.log("Migration from v1 to v2 completed successfully",{preservedKeys:Object.keys(r).length,removedKeys:n.length})}catch(t){console.error("Migration failed:",t),this.clearCorruptedStorage()}}updateDataStructures(){const e=localStorage.getItem("filterPresets");if(e)try{const t=JSON.parse(e);localStorage.setItem("filterPresets",JSON.stringify(t))}catch(r){localStorage.removeItem("filterPresets")}const t=localStorage.getItem("reservation_cache");if(t)try{const e=JSON.parse(t);e.timestamp&&Date.now()-e.timestamp>864e5&&localStorage.removeItem("reservation_cache")}catch(r){localStorage.removeItem("reservation_cache")}}clearAllExceptEssentials(){const e={};for(let r=0;r{localStorage.setItem(e,t)}),console.log("Cleared localStorage except essential keys",{preservedKeys:Object.keys(e)})}clearCorruptedStorage(){console.warn("Clearing corrupted localStorage");try{localStorage.clear(),localStorage.setItem(tt,rt)}catch(e){console.error("Failed to clear corrupted storage:",e)}}validateStoredData(e,t){try{const r=localStorage.getItem(e);if(!r)return null;const s=JSON.parse(r);return t(s)?s:(console.warn(`Invalid data structure for key: ${e}. Removing.`),localStorage.removeItem(e),null)}catch(r){return console.error(`Failed to validate data for key: ${e}`,r),localStorage.removeItem(e),null}}getItem(e){return console.warn(`[LocalStorageManager] DEPRECATED: getItem(${e}) - Use storageManager.get() instead`),Ae.get(e,{skipIntegrityCheck:!0})}setItem(e,t){console.warn(`[LocalStorageManager] DEPRECATED: setItem(${e}) - Use storageManager.set() instead`),Ae.set(e,t,{skipIntegrityCheck:!0})||(console.error(`Failed to set item: ${e}`),et.attemptRecovery().catch(e=>{console.error("Failed to recover storage:",e)}))}clearCacheData(){const e=["reservation_cache","properties_cache","cache_","temp_"];for(let t=localStorage.length-1;t>=0;t--){const r=localStorage.key(t);r&&e.some(e=>r.startsWith(e))&&localStorage.removeItem(r)}console.log("Cleared cache data from localStorage")}forceReset(){console.warn("[LocalStorageManager] DEPRECATED: forceReset() - Use storageManager.clearAll() instead"),Ae.clearAll(),localStorage.setItem(tt,rt),window.location.reload()}getStorageInfo(){console.warn("[LocalStorageManager] DEPRECATED: getStorageInfo() - Use storageManager.getDiagnostics() instead");const e=Ae.getDiagnostics();return{version:localStorage.getItem(tt)||"unknown",itemCount:e.item_count,approximateSize:e.total_size,keys:[]}}};c(st,"instance");let nt=st;nt.getInstance();class ot extends v.Component{constructor(e){super(e),c(this,"handleClearStorage",()=>{try{console.warn("[LocalStorageManager] DEPRECATED: resetLocalStorage() - Use storageManager.clearAll() instead"),Ae.clearAll()}catch(e){console.error("Failed to reset localStorage:",e),localStorage.clear(),window.location.reload()}}),c(this,"handleReload",()=>{window.location.reload()}),this.state={hasError:!1,errorMessage:""}}static getDerivedStateFromError(e){if(e.message.includes("localStorage")||e.message.includes("QuotaExceededError")||e.message.includes("storage")||"QuotaExceededError"===e.name)return{hasError:!0,errorMessage:e.message};throw e}componentDidCatch(e,t){console.error("LocalStorage Error:",e,t)}render(){return this.state.hasError?d.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:d.jsx("div",{className:"max-w-md w-full bg-white rounded-lg shadow-lg p-6",children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-red-100",children:d.jsx("svg",{className:"h-6 w-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),d.jsx("h2",{className:"mt-4 text-xl font-semibold text-gray-900",children:"Storage Error Detected"}),d.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"We've detected an issue with your browser's local storage. This might be due to:"}),d.jsxs("ul",{className:"mt-3 text-left text-sm text-gray-600 list-disc list-inside",children:[d.jsx("li",{children:"Outdated or corrupted storage data"}),d.jsx("li",{children:"Storage quota exceeded"}),d.jsx("li",{children:"Browser storage disabled or blocked"}),d.jsx("li",{children:"Incompatible data from a previous version"})]}),d.jsxs("div",{className:"mt-6 space-y-3",children:[d.jsx("button",{onClick:this.handleClearStorage,className:"w-full inline-flex justify-center items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:"Clear Storage & Reload"}),d.jsx("button",{onClick:this.handleReload,className:"w-full inline-flex justify-center items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:"Try Reload Only"})]}),d.jsxs("p",{className:"mt-4 text-xs text-gray-500",children:["Error: ",this.state.errorMessage]})]})})}):this.props.children}}class it extends v.Component{constructor(e){super(e),c(this,"retryTimeoutId"),c(this,"memoryCheckInterval"),c(this,"handleOnline",()=>{this.setState({isOffline:!1}),this.state.hasError&&this.state.retryCount<(this.props.maxRetries||3)&&this.handleRetryWithDelay()}),c(this,"handleOffline",()=>{this.setState({isOffline:!0})}),c(this,"handleUnhandledRejection",e=>{var t;console.error("Unhandled promise rejection:",e.reason),e.preventDefault();const r=new Error(`Unhandled Promise Rejection: ${(null==(t=e.reason)?void 0:t.message)||e.reason}`);this.componentDidCatch(r,{componentStack:"Promise rejection"})}),c(this,"startMemoryMonitoring",()=>{this.memoryCheckInterval=setInterval(()=>{if("memory"in performance){const e=performance.memory,t=e.usedJSHeapSize/e.jsHeapSizeLimit*100;t>80?(console.warn(`High memory usage detected: ${t.toFixed(1)}%`),this.setState({memoryWarning:!0}),"gc"in window&&window.gc()):t<60&&this.setState({memoryWarning:!1})}},3e4)}),c(this,"logErrorDetails",(e,t)=>{const r={message:e.message,stack:e.stack,componentStack:t.componentStack,timestamp:(new Date).toISOString(),url:window.location.href,userAgent:navigator.userAgent,retryCount:this.state.retryCount,isOffline:this.state.isOffline,memoryWarning:this.state.memoryWarning,memory:"memory"in performance?performance.memory:null};console.error("Detailed error information:",r),this.sendErrorToMonitoring(r)}),c(this,"sendErrorToMonitoring",e=>{try{fetch("/api/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(e=>console.error("Failed to send error to monitoring:",e))}catch(t){console.error("Error sending to monitoring service:",t)}}),c(this,"shouldAutoRetry",e=>{const t=this.props.maxRetries||3;return!(this.state.retryCount>=t)&&["ChunkLoadError","NetworkError","Failed to fetch","Loading chunk","Script error"].some(t=>e.message.includes(t)||e.name.includes(t))}),c(this,"handleRetryWithDelay",()=>{const e=this.props.retryDelay||1e3+500*this.state.retryCount;this.setState({isRetrying:!0}),this.retryTimeoutId=setTimeout(()=>{this.handleRetry()},e)}),c(this,"handleRetry",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0,isRetrying:!1})}),c(this,"handleReload",()=>{window.location.reload()}),this.state={hasError:!1,retryCount:0,isRetrying:!1,isOffline:!navigator.onLine,memoryWarning:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidMount(){this.props.enableOfflineSupport&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline)),this.props.enableMemoryMonitoring&&this.startMemoryMonitoring(),window.addEventListener("unhandledrejection",this.handleUnhandledRejection)}componentWillUnmount(){window.removeEventListener("online",this.handleOnline),window.removeEventListener("offline",this.handleOffline),window.removeEventListener("unhandledrejection",this.handleUnhandledRejection),this.retryTimeoutId&&clearTimeout(this.retryTimeoutId),this.memoryCheckInterval&&clearInterval(this.memoryCheckInterval)}componentDidCatch(e,t){console.error("CrashPrevention caught an error:",e,t),this.setState({errorInfo:t,retryCount:this.state.retryCount+1}),this.logErrorDetails(e,t),this.props.onError&&this.props.onError(e,t),this.shouldAutoRetry(e)&&this.handleRetryWithDelay()}componentDidUpdate(e){this.props.resetOnPropsChange&&e.children!==this.props.children&&this.state.hasError&&this.setState({hasError:!1,error:void 0,errorInfo:void 0,retryCount:0,isRetrying:!1})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:d.jsx("div",{className:"min-h-[400px] flex items-center justify-center bg-gray-50 rounded-lg border border-gray-200",children:d.jsxs("div",{className:"text-center p-8 max-w-lg",children:[d.jsxs("div",{className:"flex justify-center gap-2 mb-4",children:[d.jsx("div",{className:"w-3 h-3 rounded-full "+(this.state.isOffline?"bg-red-500":"bg-green-500"),title:this.state.isOffline?"Offline":"Online"}),this.state.memoryWarning&&d.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500",title:"High memory usage"})]}),d.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:this.state.isRetrying?d.jsx(M,{className:"w-8 h-8 text-blue-600 animate-spin"}):d.jsx(q,{className:"w-8 h-8 text-red-600"})}),d.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:this.state.isRetrying?"Retrying...":"Something went wrong"}),d.jsx("p",{className:"text-sm text-gray-600 mb-4",children:this.state.isOffline?"You appear to be offline. Please check your connection.":"We encountered an unexpected error. Please try again or contact support if the problem persists."}),this.state.retryCount>0&&d.jsxs("p",{className:"text-xs text-gray-500 mb-4",children:["Retry attempt: ",this.state.retryCount,"/",this.props.maxRetries||3]}),this.props.enableOfflineSupport&&d.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[this.state.isOffline?d.jsx(F,{className:"w-4 h-4 text-red-500"}):d.jsx(U,{className:"w-4 h-4 text-green-500"}),d.jsx("span",{className:"text-sm text-gray-600",children:this.state.isOffline?"Offline":"Online"})]}),!1,d.jsxs("div",{className:"flex gap-3 justify-center",children:[d.jsxs("button",{onClick:this.handleRetry,disabled:this.state.isRetrying||this.state.retryCount>=(this.props.maxRetries||3),className:"inline-flex items-center px-4 py-2 bg-indigo-600 text-white text-sm font-medium rounded-lg hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[d.jsx(M,{className:"w-4 h-4 mr-2 "+(this.state.isRetrying?"animate-spin":"")}),this.state.isRetrying?"Retrying...":"Try Again"]}),d.jsxs("button",{onClick:this.handleReload,className:"inline-flex items-center px-4 py-2 bg-gray-600 text-white text-sm font-medium rounded-lg hover:bg-gray-700 transition-colors",children:[d.jsx(z,{className:"w-4 h-4 mr-2"}),"Reload Page"]})]})]})}):this.props.children}}const at=class e{constructor(){c(this,"sessionId"),c(this,"userActions",[]),c(this,"isMonitoring",!1),c(this,"reportQueue",[]),c(this,"maxReports",50),c(this,"maxUserActions",20),c(this,"lastReportTime",0),c(this,"reportCount",0),c(this,"RATE_LIMIT_WINDOW",6e4),c(this,"MAX_REPORTS_PER_WINDOW",10),this.sessionId=this.generateSessionId(),this.initializeMonitoring()}static getInstance(){return e.instance||(e.instance=new e),e.instance}generateSessionId(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}initializeMonitoring(){this.isMonitoring||(this.isMonitoring=!0,window.addEventListener("error",this.handleError.bind(this)),window.addEventListener("unhandledrejection",this.handlePromiseRejection.bind(this)),this.initializePerformanceMonitoring(),this.initializeMemoryMonitoring(),this.initializeUserActionTracking(),this.initializeNetworkMonitoring())}handleError(e){var t;const r={id:this.generateReportId(),timestamp:Date.now(),type:"error",severity:this.classifyErrorSeverity(e.error),message:e.message,stack:null==(t=e.error)?void 0:t.stack,url:window.location.href,userAgent:navigator.userAgent,sessionId:this.sessionId,userId:this.getCurrentUserId(),tenantId:this.getCurrentTenantId(),buildVersion:this.getBuildVersion(),context:this.gatherContext()};this.addReport(r)}handlePromiseRejection(e){var t,r;const s={id:this.generateReportId(),timestamp:Date.now(),type:"error",severity:"medium",message:`Unhandled Promise Rejection: ${(null==(t=e.reason)?void 0:t.message)||e.reason}`,stack:null==(r=e.reason)?void 0:r.stack,url:window.location.href,userAgent:navigator.userAgent,sessionId:this.sessionId,userId:this.getCurrentUserId(),tenantId:this.getCurrentTenantId(),buildVersion:this.getBuildVersion(),context:this.gatherContext()};this.addReport(s)}initializePerformanceMonitoring(){if("PerformanceObserver"in window){const t=new PerformanceObserver(e=>{const t=e.getEntries(),r=t[t.length-1];r.startTime>4e3&&this.reportPerformanceIssue("lcp",r.startTime,"high")});try{t.observe({entryTypes:["largest-contentful-paint"]})}catch(e){}const r=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{e.processingStart-e.startTime>100&&this.reportPerformanceIssue("fid",e.processingStart-e.startTime,"medium")})});try{r.observe({entryTypes:["first-input"]})}catch(e){}const s=new PerformanceObserver(e=>{let t=0;e.getEntries().forEach(e=>{e.hadRecentInput||(t+=e.value)}),t>.25&&this.reportPerformanceIssue("cls",t,"medium")});try{s.observe({entryTypes:["layout-shift"]})}catch(e){}}if("PerformanceObserver"in window){const t=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{e.duration>50&&this.reportPerformanceIssue("long-task",e.duration,"low")})});try{t.observe({entryTypes:["longtask"]})}catch(e){}}}initializeMemoryMonitoring(){"memory"in performance&&setInterval(()=>{const e=performance.memory,t=Math.round(e.usedJSHeapSize/1048576),r=Math.round(e.totalJSHeapSize/1048576),s=Math.round(e.jsHeapSizeLimit/1048576),n=e.usedJSHeapSize/e.jsHeapSizeLimit*100;n>90?this.reportMemoryIssue("critical",{usedMB:t,totalMB:r,limitMB:s,usedPercent:Math.round(n)}):n>80&&this.reportMemoryIssue("high",{usedMB:t,totalMB:r,limitMB:s,usedPercent:Math.round(n)})},3e4)}initializeUserActionTracking(){document.addEventListener("click",e=>{const t=e.target,r=`Click: ${t.tagName}${t.className?"."+t.className.split(" ").join("."):""}${t.id?"#"+t.id:""}`;this.addUserAction(r)});let e=window.location.pathname;setInterval(()=>{window.location.pathname!==e&&(e=window.location.pathname,this.addUserAction(`Navigation: ${e}`))},1e3),document.addEventListener("submit",e=>{const t=e.target,r=`Form Submit: ${t.action||t.id||"unnamed"}`;this.addUserAction(r)})}initializeNetworkMonitoring(){window.addEventListener("online",()=>{this.addUserAction("Network: Back online")}),window.addEventListener("offline",()=>{this.reportNetworkIssue("offline")})}addUserAction(e){this.userActions.push(`${(new Date).toISOString()}: ${e}`),this.userActions.length>this.maxUserActions&&(this.userActions=this.userActions.slice(-this.maxUserActions))}gatherContext(){return{memoryUsage:"memory"in performance?performance.memory:null,networkStatus:navigator.onLine,viewportSize:{width:window.innerWidth,height:window.innerHeight},timestamp:(new Date).toISOString(),route:window.location.pathname,userActions:[...this.userActions]}}classifyErrorSeverity(e){var t,r;if(!e)return"low";const s=(null==(t=e.message)?void 0:t.toLowerCase())||"",n=(null==(r=e.stack)?void 0:r.toLowerCase())||"";return s.includes("chunk")&&s.includes("load")||s.includes("out of memory")||s.includes("maximum call stack")?"critical":n.includes("auth")||s.includes("network")||s.includes("fetch")||s.includes("permission")||s.includes("unauthorized")||n.includes("payment")||n.includes("billing")?"high":s.includes("validation")||s.includes("invalid")||s.includes("timeout")?"medium":"low"}reportPerformanceIssue(e,t,r){const s={id:this.generateReportId(),timestamp:Date.now(),type:"performance",severity:r,message:`Performance issue: ${e} = ${t.toFixed(2)}ms`,url:window.location.href,userAgent:navigator.userAgent,sessionId:this.sessionId,userId:this.getCurrentUserId(),tenantId:this.getCurrentTenantId(),buildVersion:this.getBuildVersion(),context:this.gatherContext()};this.addReport(s)}reportMemoryIssue(e,t){const r={id:this.generateReportId(),timestamp:Date.now(),type:"memory",severity:e,message:`High memory usage: ${t.usedPercent}% (${t.usedMB}MB/${t.limitMB}MB)`,url:window.location.href,userAgent:navigator.userAgent,sessionId:this.sessionId,userId:this.getCurrentUserId(),tenantId:this.getCurrentTenantId(),buildVersion:this.getBuildVersion(),context:l(a({},this.gatherContext()),{memoryDetails:t})};this.addReport(r)}reportNetworkIssue(e,t){var r,s;if((null==(r=null==t?void 0:t.url)?void 0:r.includes("/api/crash-reports"))||(null==(s=null==t?void 0:t.url)?void 0:s.includes("crash-reports")))return;const n={id:this.generateReportId(),timestamp:Date.now(),type:"error",severity:"offline"===e?"high":"medium",message:`Network issue: ${e}`,url:window.location.href,userAgent:navigator.userAgent,sessionId:this.sessionId,userId:this.getCurrentUserId(),tenantId:this.getCurrentTenantId(),buildVersion:this.getBuildVersion(),context:l(a({},this.gatherContext()),{networkDetails:t})};this.addReport(n)}addReport(e){if("critical"!==e.severity)return;const t=Date.now();t-this.lastReportTime>this.RATE_LIMIT_WINDOW&&(this.reportCount=0,this.lastReportTime=t),this.reportCount>=this.MAX_REPORTS_PER_WINDOW||(this.reportCount++,this.reportQueue.push(e),this.reportQueue.length>this.maxReports&&(this.reportQueue=this.reportQueue.slice(-this.maxReports)),this.isProductionEnvironment()&&this.sendReportToService(e))}isProductionEnvironment(){const e="http://localhost:8000",t=e.endsWith("://pms.base360.ai");return e.includes("localhost")&&console.debug(`[CrashMonitor] Environment check - URL: ${e}, isProduction: ${t}`),t}sendReportToService(e){return u(this,null,function*(){if(!e.message||!e.message.toLowerCase().includes("crash-reports"))try{if(!this.isProductionEnvironment()||"critical"!==e.severity)return;yield fetch("/api/crash-reports",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(5e3)})}catch(t){}})}generateReportId(){return`crash_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}getCurrentUserId(){var e;try{const t=localStorage.getItem("auth_session");if(t)return null==(e=JSON.parse(t).user)?void 0:e.id}catch(t){}}getCurrentTenantId(){var e;try{const t=localStorage.getItem("auth_session");if(t)return null==(e=JSON.parse(t).user)?void 0:e.tenant_id}catch(t){}}getBuildVersion(){return'"1.0.0"'}reportError(e,t){const r={id:this.generateReportId(),timestamp:Date.now(),type:"error",severity:this.classifyErrorSeverity(e),message:t?`${t}: ${e.message}`:e.message,stack:e.stack,url:window.location.href,userAgent:navigator.userAgent,sessionId:this.sessionId,userId:this.getCurrentUserId(),tenantId:this.getCurrentTenantId(),buildVersion:this.getBuildVersion(),context:this.gatherContext()};this.addReport(r)}getReports(){return[...this.reportQueue]}clearReports(){this.reportQueue=[]}exportReports(){return JSON.stringify({sessionId:this.sessionId,exportTime:(new Date).toISOString(),reports:this.reportQueue},null,2)}};function lt(){const[e,t]=v.useState(""),[r,s]=v.useState(""),[n,o]=v.useState(!1),[i,a]=v.useState(null),{user:l,signIn:c}=Be(),h=S(),p=b();return v.useEffect(()=>{var e;if(l){const t=(null==(e=p.state)?void 0:e.from)||"/";h(t,{replace:!0})}},[l,h,p]),d.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[d.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[d.jsx("div",{className:"flex justify-center",children:d.jsx(V,{className:"h-12 w-12 text-primary"})}),d.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:"Sign in to your account"})]}),d.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:d.jsxs("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10",children:[i&&d.jsxs("div",{className:"mb-4 p-4 bg-red-50 border border-red-200 rounded-md flex items-start",children:[d.jsx(H,{className:"h-5 w-5 text-red-400 mt-0.5 mr-3"}),d.jsx("p",{className:"text-sm text-red-600",children:i})]}),d.jsxs("form",{onSubmit:t=>u(null,null,function*(){t.preventDefault();try{o(!0),a(null);const{error:t}=yield c(e,r);if(t)throw t}catch(s){console.error("Login error:",s);const e=s instanceof Error?s.message:"Authentication failed";a(e)}finally{o(!1)}}),className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700",children:"Email address"}),d.jsxs("div",{className:"mt-1 relative rounded-md shadow-sm",children:[d.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:d.jsx(B,{className:"h-5 w-5 text-gray-400"})}),d.jsx("input",{id:"email",type:"email",required:!0,value:e,onChange:e=>t(e.target.value),className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-primary focus:border-primary",placeholder:"you@example.com"})]})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:"Password"}),d.jsxs("div",{className:"mt-1 relative rounded-md shadow-sm",children:[d.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:d.jsx(J,{className:"h-5 w-5 text-gray-400"})}),d.jsx("input",{id:"password",type:"password",required:!0,value:r,onChange:e=>s(e.target.value),className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-primary focus:border-primary",placeholder:"••••••••"})]})]}),d.jsx("div",{children:d.jsx("button",{type:"submit",disabled:n,className:"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary disabled:opacity-50",children:n?d.jsxs("div",{className:"flex items-center",children:[d.jsx(W,{className:"h-5 w-5 animate-spin mr-2"}),"Signing in..."]}):"Sign in"})})]})]})})]})}c(at,"instance"),at.getInstance();const ct=({propertyId:e="prop-001",debugTenant:t,showRaw:r})=>{const[s,n]=v.useState(null),[o,i]=v.useState(!0),[a,l]=v.useState(""),c=t||"candidate";if(v.useEffect(()=>{u(null,null,function*(){i(!0);try{const t=yield $e.getDashboardSummary(e,{simulatedTenant:c,timestamp:Date.now()});n(t)}catch(t){l("Failed to load revenue data"),console.error(t)}finally{i(!1)}})},[e,c]),o)return d.jsx("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:d.jsxs("div",{className:"animate-pulse space-y-4",children:[d.jsx("div",{className:"h-4 bg-gray-100 rounded w-1/4"}),d.jsx("div",{className:"h-8 bg-gray-100 rounded w-1/2"}),d.jsxs("div",{className:"flex gap-4 pt-4",children:[d.jsx("div",{className:"h-12 bg-gray-100 rounded flex-1"}),d.jsx("div",{className:"h-12 bg-gray-100 rounded flex-1"})]})]})});if(a)return d.jsx("div",{className:"p-4 text-red-500 bg-red-50 rounded-lg",children:a});if(!s)return null;const h=Math.round(100*s.total_revenue)/100;return d.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden hover:shadow-md transition-shadow duration-300",children:[r&&d.jsxs("div",{className:"p-3 bg-gray-50 text-xs font-mono border-b border-gray-100 overflow-auto max-h-32",children:[d.jsx("strong",{className:"block mb-1 text-gray-500 uppercase tracking-wider text-[10px]",children:"Raw API Response"}),d.jsx("pre",{className:"text-gray-700",children:JSON.stringify(s,null,2)})]}),d.jsxs("div",{className:"p-6",children:[d.jsx("div",{className:"flex items-center justify-between mb-6",children:d.jsxs("div",{children:[d.jsx("h2",{className:"text-sm font-medium text-gray-500 uppercase tracking-wide",children:"Total Revenue"}),d.jsxs("div",{className:"flex items-baseline gap-2 mt-1",children:[d.jsxs("span",{className:"text-3xl font-bold text-gray-900 tracking-tight",children:[s.currency," ",h.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),d.jsxs("span",{className:"inline-flex items-baseline px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 md:mt-2 lg:mt-0",children:[d.jsx("svg",{className:"-ml-1 mr-0.5 h-3 w-3 flex-shrink-0 self-center text-green-500",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",children:d.jsx("path",{fillRule:"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),"12%"]})]})]})}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4 border-t border-gray-100",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-gray-500 font-medium uppercase tracking-wider",children:"Property ID"}),d.jsx("p",{className:"text-sm font-semibold text-gray-700 font-mono mt-1",children:s.property_id})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-gray-500 font-medium uppercase tracking-wider",children:"Reservations"}),d.jsxs("p",{className:"text-sm font-semibold text-gray-700 mt-1",children:[s.reservations_count," ",d.jsx("span",{className:"font-normal text-gray-400",children:"bookings"})]})]})]}),d.jsx("div",{className:"mt-4 h-6",children:Math.abs(s.total_revenue-h)>1e-6&&r&&d.jsxs("div",{className:"flex items-center text-xs text-amber-600 bg-amber-50 px-2 py-1 rounded",children:[d.jsx("svg",{className:"h-4 w-4 mr-1.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Precision Mismatch Detected"]})})]})]})},ut=[{id:"prop-001",name:"Beach House Alpha"},{id:"prop-002",name:"City Apartment Downtown"},{id:"prop-003",name:"Country Villa Estate"},{id:"prop-004",name:"Lakeside Cottage"},{id:"prop-005",name:"Urban Loft Modern"}],dt=()=>{const[e,t]=v.useState("prop-001");return d.jsx("div",{className:"p-4 lg:p-6 min-h-full",children:d.jsxs("div",{className:"max-w-7xl mx-auto",children:[d.jsx("h1",{className:"text-2xl font-bold mb-6 text-gray-900",children:"Property Management Dashboard"}),d.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4 lg:p-6",children:[d.jsx("div",{className:"mb-6",children:d.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-lg lg:text-xl font-medium text-gray-900 mb-2",children:"Revenue Overview"}),d.jsx("p",{className:"text-sm lg:text-base text-gray-600",children:"Monthly performance insights for your properties"})]}),d.jsxs("div",{className:"flex flex-col sm:items-end",children:[d.jsx("label",{className:"text-xs font-medium text-gray-700 mb-1",children:"Select Property"}),d.jsx("select",{value:e,onChange:e=>t(e.target.value),className:"block w-full sm:w-auto min-w-[200px] px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 text-sm",children:ut.map(e=>d.jsx("option",{value:e.id,children:e.name},e.id))})]})]})}),d.jsx("div",{className:"space-y-6",children:d.jsx(ct,{propertyId:e})})]})]})})};function ht(){return d.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[d.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[d.jsx("div",{className:"flex justify-center",children:d.jsx(K,{className:"h-12 w-12 text-red-600"})}),d.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900",children:"Access Denied"}),d.jsx("p",{className:"mt-2 text-center text-sm text-gray-600",children:"You don't have permission to access this resource"})]}),d.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:d.jsx("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10",children:d.jsx("div",{className:"text-center",children:d.jsx(k,{to:"/",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",children:"Return to Dashboard"})})})})]})}function pt(){const e=Be(),{user:t}=e;return"initializing"===e.status?d.jsx("div",{className:"min-h-screen flex items-center justify-center",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):t?d.jsx(x,{to:"/dashboard",replace:!0}):d.jsx(x,{to:"/login",replace:!0})}function gt(){const e=b(),t=_(),r=[];let s=Object.keys(mt).filter(t=>N({path:t,end:!1},e.pathname)).sort((e,t)=>t.length-e.length)[0];for(;s;){const e=mt[s];if(!e)break;const{label:n,parent:o,dynamicLabel:i}=e,a=i?i(t):n;r.unshift({path:s,label:a}),s=o}return r}const mt={"/hr":{label:"Employees management"},"/hr/people":{label:"People",parent:"/hr"},"/hr/my-profile/:id":{label:"My Profile",parent:"/hr"},"/hr/people/:id":{label:"Profile",parent:"/hr"},"/hr/away":{label:"Who's Away",parent:"/hr"},"/hr/time-away-requests":{label:"Requests",parent:"/hr"},"/hr/settings":{label:"Settings",parent:"/hr"},"/hr/settings/company":{label:"Company",parent:"/hr/settings"},"/hr/settings/time-away":{label:"Time Away",parent:"/hr/settings"},"/pricing":{label:"Pricing management"},"/pricing/listings":{label:"Listings pricing",parent:"/pricing"},"/pricing/listings/:id":{label:"Listing details",parent:"/pricing/listings"},"/pricing/groups":{label:"Groups pricing",parent:"/pricing"}},ft=()=>{const e=gt();return e.length?d.jsx("nav",{className:"flex items-center gap-x-2",children:e.map((t,r)=>d.jsxs("span",{className:"flex items-center gap-x-2",children:[r>0&&d.jsx(G,{size:14,color:"#64748B"}),r===e.length-1?d.jsx("p",{className:"text-sm text-[#09090B]",children:t.label}):d.jsx("p",{className:"text-sm text-[#64748B]",children:t.label})]},t.path))}):null};function yt(){const{setIsMobileOpen:e,isCollapsed:t}=qt(),{user:r,signOut:s}=Be();S();const[n,o]=v.useState(!1),i=v.useRef(null),a=gt();return v.useEffect(()=>{const e=e=>{i.current&&!i.current.contains(e.target)&&o(!1)};return n&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[n]),d.jsxs("header",{className:"bg-white border-b border-gray-200 h-16 flex items-center justify-between px-4 lg:px-6",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("button",{onClick:()=>e(!0),className:"lg:hidden p-2 rounded-lg hover:bg-gray-100 transition-colors","aria-label":"Open menu",children:d.jsx(Y,{className:"w-5 h-5 text-gray-600"})}),d.jsx("div",{className:"hidden md:block",children:d.jsx(ft,{crumbs:a})})]}),d.jsx("div",{className:"flex items-center gap-3",children:d.jsxs("div",{className:"relative",ref:i,children:[d.jsxs("button",{onClick:()=>o(!n),className:"flex items-center gap-2 p-2 rounded-lg hover:bg-gray-100 transition-colors","aria-label":"User menu",children:[d.jsx("div",{className:"w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center",children:d.jsx(L,{className:"w-4 h-4 text-blue-600"})}),d.jsx("span",{className:"hidden md:block text-sm font-medium text-gray-700",children:(null==r?void 0:r.full_name)||(null==r?void 0:r.email)||"User"})]}),n&&d.jsxs("div",{className:"absolute right-0 mt-2 w-56 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50",children:[d.jsxs("div",{className:"px-4 py-3 border-b border-gray-200",children:[d.jsx("p",{className:"text-sm font-medium text-gray-900",children:(null==r?void 0:r.full_name)||"User"}),d.jsx("p",{className:"text-xs text-gray-500 truncate",children:null==r?void 0:r.email})]}),d.jsxs(k,{to:"/profile",onClick:()=>o(!1),className:"flex items-center gap-3 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",children:[d.jsx(Q,{className:"w-4 h-4"}),"Profile"]}),d.jsx("div",{className:"border-t border-gray-200 mt-1 pt-1",children:d.jsxs("button",{onClick:()=>u(null,null,function*(){try{o(!1),yield s()}catch(e){console.error("Error signing out:",e)}}),className:"flex items-center gap-3 px-4 py-2 text-sm text-red-600 hover:bg-red-50 transition-colors w-full",children:[d.jsx(D,{className:"w-4 h-4"}),"Sign out"]})})]})]})})]})}const vt=new class{getAuthHeaders(){return u(this,null,function*(){const{data:{session:e}}=yield ke.auth.getSession();if(!(null==e?void 0:e.access_token))throw new Error("No active session");return{Authorization:`Bearer ${e.access_token}`,"Content-Type":"application/json"}})}getProfile(){return u(this,null,function*(){const e=yield fetch("http://localhost:8000/api/v1/profile",{method:"GET",headers:yield this.getAuthHeaders()});if(!e.ok)throw new Error(`Failed to fetch profile: ${e.statusText}`);return e.json()})}updateProfile(e){return u(this,null,function*(){const t=yield fetch("http://localhost:8000/api/v1/profile",{method:"PUT",headers:yield this.getAuthHeaders(),body:JSON.stringify(e)});if(!t.ok)throw new Error(`Failed to update profile: ${t.statusText}`);return t.json()})}updatePreferences(e){return u(this,null,function*(){const t=yield fetch("http://localhost:8000/api/v1/profile/preferences",{method:"PUT",headers:yield this.getAuthHeaders(),body:JSON.stringify(e)});if(!t.ok)throw new Error(`Failed to update preferences: ${t.statusText}`);return t.json()})}updateNotificationPreference(e,t){return u(this,null,function*(){const r=yield fetch(`http://localhost:8000/api/v1/profile/notification-preferences/${e}`,{method:"PUT",headers:yield this.getAuthHeaders(),body:JSON.stringify(t)});if(!r.ok)throw new Error(`Failed to update notification preference: ${r.statusText}`);return r.json()})}uploadAvatar(e){return u(this,null,function*(){try{const t=yield this.getAuthHeaders(),r=new FormData;r.append("file",e);const s=yield fetch("http://localhost:8000/api/v1/profile/avatar",{method:"POST",headers:{Authorization:t.Authorization},body:r});if(!s.ok)throw new Error(`Upload failed: ${s.status} ${s.statusText}`);return s.json()}catch(t){throw console.error("Avatar upload error:",t),t}})}deleteAvatar(){return u(this,null,function*(){try{const e=yield fetch("http://localhost:8000/api/v1/profile/avatar",{method:"DELETE",headers:yield this.getAuthHeaders()});if(!e.ok)throw new Error(`Failed to delete avatar: ${e.statusText}`);return e.json()}catch(e){throw console.error("Avatar delete error:",e),e}})}},xt=({currentAvatarUrl:e,onAvatarUpdate:t,size:r="md"})=>{const[s,n]=v.useState(!1),[o,i]=v.useState(null),[a,l]=v.useState(!1),[c,h]=v.useState(null),[p,g]=v.useState(null),m=v.useRef(null),f=v.useRef(null),y=e=>u(null,null,function*(){const r=(e=>["image/jpeg","image/jpg","image/png","image/webp","image/gif"].includes(e.type)?e.size>5242880?"File size must be less than 5MB":null:"Please select a valid image file (JPEG, PNG, WebP, or GIF)")(e);if(r)return void h(r);const s=new FileReader;s.onload=e=>{var t;i(null==(t=e.target)?void 0:t.result)},s.readAsDataURL(e),n(!0),h(null);try{const r=yield vt.uploadAvatar(e);t(r.avatar_url),g("Avatar updated successfully!"),i(null),setTimeout(()=>g(null),3e3)}catch(o){console.error("Error uploading avatar:",o);const e=o instanceof Error?o.message:"Failed to upload avatar. Please try again.";h(e),i(null)}finally{n(!1)}}),x=()=>u(null,null,function*(){try{yield vt.deleteAvatar(),t(null),i(null),g("Avatar removed successfully!"),setTimeout(()=>g(null),3e3)}catch(e){console.error("Error deleting avatar:",e);const t=e instanceof Error?e.message:"Failed to remove avatar";h(t)}}),b=()=>{var e;null==(e=m.current)||e.click()},S=()=>{h(null),g(null)},w=o||e;return d.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[c&&d.jsxs("div",{className:"w-full max-w-sm bg-red-50 border border-red-200 rounded-lg p-3 flex items-start gap-2",children:[d.jsx(H,{className:"h-4 w-4 text-red-600 flex-shrink-0 mt-0.5"}),d.jsx("div",{className:"flex-1",children:d.jsx("span",{className:"text-red-800 text-xs font-medium",children:c})}),d.jsx("button",{onClick:S,className:"text-red-600 hover:text-red-800",children:d.jsx(T,{className:"h-3 w-3"})})]}),p&&d.jsxs("div",{className:"w-full max-w-sm bg-green-50 border border-green-200 rounded-lg p-3 flex items-start gap-2",children:[d.jsx(X,{className:"h-4 w-4 text-green-600 flex-shrink-0 mt-0.5"}),d.jsx("div",{className:"flex-1",children:d.jsx("span",{className:"text-green-800 text-xs font-medium",children:p})}),d.jsx("button",{onClick:S,className:"text-green-600 hover:text-green-800",children:d.jsx(T,{className:"h-3 w-3"})})]}),d.jsxs("div",{className:"relative group",children:[d.jsxs("div",{ref:f,onDrop:e=>{e.preventDefault(),l(!1);const t=e.dataTransfer.files;t.length>0&&y(t[0])},onDragOver:e=>{e.preventDefault(),l(!0)},onDragLeave:e=>{e.preventDefault(),l(!1)},className:`${{sm:"w-16 h-16",md:"w-24 h-24",lg:"w-32 h-32"}[r]} rounded-full overflow-hidden bg-gray-100 border-4 ${a?"border-primary":"border-gray-200"} flex items-center justify-center relative transition-all duration-200 ${s?"opacity-60":"hover:border-gray-300 cursor-pointer"}`,onClick:b,children:[w?d.jsx("img",{src:w,alt:"Profile",className:"w-full h-full object-cover avatar-image"}):d.jsx(L,{className:`${{sm:"w-6 h-6",md:"w-8 h-8",lg:"w-10 h-10"}[r]} text-gray-400`}),d.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-60 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity "+(s?"opacity-100":""),children:s?d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-white"}),d.jsx("span",{className:"text-white text-xs font-medium",children:"Uploading..."})]}):d.jsxs("div",{className:"flex flex-col items-center gap-1",children:[d.jsx(Z,{className:"w-6 h-6 text-white"}),d.jsx("span",{className:"text-white text-xs font-medium",children:"Change"})]})}),a&&!s&&d.jsx("div",{className:"absolute inset-0 bg-primary bg-opacity-80 flex items-center justify-center",children:d.jsxs("div",{className:"flex flex-col items-center gap-1",children:[d.jsx(ee,{className:"w-6 h-6 text-white"}),d.jsx("span",{className:"text-white text-xs font-medium",children:"Drop here"})]})})]}),e&&!s&&d.jsx("button",{onClick:e=>{e.stopPropagation(),x()},className:"absolute -top-1 -right-1 bg-red-500 text-white rounded-full p-1.5 shadow-lg hover:bg-red-600 transition-colors border-2 border-white",title:"Remove avatar",children:d.jsx(T,{className:"w-3 h-3"})})]}),d.jsxs("div",{className:"text-center space-y-3",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 justify-center",children:[d.jsxs("button",{onClick:b,disabled:s,className:"inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-lg text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[d.jsx(ee,{className:"w-4 h-4 mr-2"}),s?"Uploading...":e?"Change Photo":"Upload Photo"]}),e&&!s&&d.jsxs("button",{onClick:x,className:"inline-flex items-center px-4 py-2 border border-red-300 shadow-sm text-sm font-medium rounded-lg text-red-700 bg-red-50 hover:bg-red-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 transition-colors",children:[d.jsx(T,{className:"w-4 h-4 mr-2"}),"Remove"]})]}),d.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[d.jsxs("div",{className:"flex items-center justify-center gap-1",children:[d.jsx(te,{className:"w-3 h-3"}),d.jsx("span",{children:"Max 5MB • JPEG, PNG, WebP, GIF"})]}),d.jsx("p",{children:"Click, drag & drop, or paste from clipboard"})]})]}),d.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:e=>{var t;const r=null==(t=e.target.files)?void 0:t[0];r&&y(r)},className:"hidden"})]})},bt=()=>{const[e,t]=v.useState(null),[r,s]=v.useState(!0),[n,o]=v.useState(!1),[i,c]=v.useState("profile"),[h,p]=v.useState(!1),[g,m]=v.useState(null),[f,y]=v.useState({}),[x,b]=v.useState({});v.useEffect(()=>{S()},[]),v.useEffect(()=>{if(!e)return;const t=Object.keys(f).some(t=>{const r=t;return f[r]!==e.profile[r]}),r=Object.keys(x).some(t=>{const r=t;return x[r]!==e.preferences[r]});p(t||r)},[f,x,e]);const S=()=>u(null,null,function*(){try{s(!0),m(null);const e=yield vt.getProfile();t(e),y({display_name:e.profile.display_name||"",bio:e.profile.bio||"",phone:e.profile.phone||"",department:e.profile.department||"",job_title:e.profile.job_title||"",location:e.profile.location||"",timezone:e.profile.timezone,language:e.profile.language,theme:e.profile.theme}),b({notification_email:e.preferences.notification_email,notification_push:e.preferences.notification_push,notification_desktop:e.preferences.notification_desktop,notification_sound:e.preferences.notification_sound,auto_refresh:e.preferences.auto_refresh,compact_view:e.preferences.compact_view,sidebar_collapsed:e.preferences.sidebar_collapsed})}catch(e){console.error("Error loading profile:",e),m("Failed to load profile data"),ye.error("Failed to load profile")}finally{s(!1)}}),w=(e,r,s)=>u(null,null,function*(){try{yield vt.updateNotificationPreference(e,{[r]:s}),t(t=>{if(!t)return null;const n=t.notification_preferences.map(t=>t.category===e?l(a({},t),{[r]:s}):t);return l(a({},t),{notification_preferences:n})}),ye.success("Notification preference updated")}catch(n){console.error("Error updating notification preference:",n),ye.error("Failed to update notification preference")}});if(r)return d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsxs("div",{className:"flex items-center gap-3 text-gray-500",children:[d.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"}),d.jsx("span",{className:"text-sm font-medium",children:"Loading profile..."})]})});if(!e)return d.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:d.jsxs("div",{className:"text-center",children:[d.jsx(H,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),d.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Failed to Load Profile"}),d.jsx("p",{className:"text-gray-600 mb-4",children:"There was an error loading your profile data."}),d.jsx("button",{onClick:S,className:"px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary-dark transition-colors",children:"Try Again"})]})});const k=[{id:"profile",label:"Profile",icon:L,description:"Personal information and settings"},{id:"preferences",label:"Preferences",icon:ne,description:"App preferences and display options"},{id:"notifications",label:"Notifications",icon:oe,description:"Notification settings by category"}];return d.jsx("div",{className:"min-h-screen bg-gray-50",children:d.jsxs("div",{className:"max-w-5xl mx-auto py-8 px-4 sm:px-6 lg:px-8",children:[d.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 mb-8 overflow-hidden",children:[d.jsx("div",{className:"bg-gradient-to-r from-primary/10 to-primary/5 px-8 py-6",children:d.jsxs("div",{className:"flex items-center gap-6",children:[d.jsx("div",{className:"relative",children:d.jsx("div",{className:"w-20 h-20 rounded-full overflow-hidden bg-gray-100 border-4 border-white shadow-lg",children:e.profile.avatar_url?d.jsx("img",{src:e.profile.avatar_url,alt:"Profile",className:"w-full h-full object-cover"}):d.jsx("div",{className:"w-full h-full flex items-center justify-center",children:d.jsx(L,{className:"w-8 h-8 text-gray-400"})})})}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:e.profile.display_name||"User Profile"}),d.jsxs("div",{className:"flex items-center gap-4 mt-2 text-sm text-gray-600",children:[e.profile.job_title&&d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(re,{className:"w-4 h-4"}),e.profile.job_title]}),e.profile.department&&d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(z,{className:"w-4 h-4"}),e.profile.department]}),e.profile.location&&d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(se,{className:"w-4 h-4"}),e.profile.location]})]})]})]})}),d.jsx("div",{className:"border-b border-gray-200",children:d.jsx("nav",{className:"flex",role:"tablist",children:k.map(e=>{const t=e.icon;return d.jsxs("button",{onClick:()=>c(e.id),role:"tab","aria-selected":i===e.id,className:"flex-1 flex flex-col items-center px-6 py-4 text-sm font-medium border-b-2 transition-all duration-200 "+(i===e.id?"border-primary text-primary bg-primary/5":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 hover:bg-gray-50"),children:[d.jsx(t,{className:"w-5 h-5 mb-1"}),d.jsx("span",{className:"font-semibold",children:e.label}),d.jsx("span",{className:"text-xs text-gray-500 mt-1 hidden sm:block",children:e.description})]},e.id)})})})]}),g&&d.jsxs("div",{className:"mb-6 bg-red-50 border border-red-200 rounded-lg p-4 flex items-start gap-3",children:[d.jsx(H,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),d.jsx("div",{className:"flex-1",children:d.jsx("span",{className:"text-red-800 text-sm font-medium",children:g})}),d.jsx("button",{onClick:()=>m(null),className:"text-red-600 hover:text-red-800 transition-colors",children:d.jsx(T,{className:"h-4 w-4"})})]}),d.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100",children:d.jsxs("div",{className:"p-8",children:["profile"===i&&d.jsxs("div",{className:"space-y-8",children:[d.jsxs("div",{className:"text-center",children:[d.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center justify-center gap-2",children:[d.jsx(Z,{className:"w-5 h-5"}),"Profile Picture"]}),d.jsx(xt,{currentAvatarUrl:e.profile.avatar_url,onAvatarUpdate:e=>{t(t=>t?l(a({},t),{profile:l(a({},t.profile),{avatar_url:e})}):null)},size:"lg"})]}),d.jsxs("div",{children:[d.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-6 flex items-center gap-2",children:[d.jsx(ie,{className:"w-5 h-5"}),"Basic Information"]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[d.jsxs("div",{children:[d.jsx("label",{htmlFor:"display-name",className:"block text-sm font-semibold text-gray-700 mb-2",children:"Display Name"}),d.jsx("input",{id:"display-name",type:"text",value:f.display_name||"",onChange:e=>y(t=>l(a({},t),{display_name:e.target.value})),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",placeholder:"Your display name"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Phone Number"}),d.jsxs("div",{className:"relative",children:[d.jsx(ae,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),d.jsx("input",{type:"tel",value:f.phone||"",onChange:e=>y(t=>l(a({},t),{phone:e.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",placeholder:"+1 (555) 000-0000"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Job Title"}),d.jsxs("div",{className:"relative",children:[d.jsx(re,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),d.jsx("input",{type:"text",value:f.job_title||"",onChange:e=>y(t=>l(a({},t),{job_title:e.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",placeholder:"Software Engineer"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Department"}),d.jsxs("div",{className:"relative",children:[d.jsx(z,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),d.jsx("input",{type:"text",value:f.department||"",onChange:e=>y(t=>l(a({},t),{department:e.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",placeholder:"Engineering"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Location"}),d.jsxs("div",{className:"relative",children:[d.jsx(se,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),d.jsx("input",{type:"text",value:f.location||"",onChange:e=>y(t=>l(a({},t),{location:e.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",placeholder:"London, UK"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Timezone"}),d.jsxs("div",{className:"relative",children:[d.jsx(le,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),d.jsxs("select",{value:f.timezone||"UTC",onChange:e=>y(t=>l(a({},t),{timezone:e.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",children:[d.jsx("option",{value:"UTC",children:"UTC"}),d.jsx("option",{value:"Europe/London",children:"London (GMT)"}),d.jsx("option",{value:"Europe/Paris",children:"Paris (CET)"}),d.jsx("option",{value:"Africa/Algiers",children:"Algiers (CET)"}),d.jsx("option",{value:"Europe/Lisbon",children:"Lisbon (WET)"})]})]})]})]}),d.jsxs("div",{className:"mt-6",children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Bio"}),d.jsx("textarea",{value:f.bio||"",onChange:e=>y(t=>l(a({},t),{bio:e.target.value})),rows:4,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",placeholder:"Tell us about yourself..."})]})]}),d.jsxs("div",{children:[d.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-6 flex items-center gap-2",children:[d.jsx(ce,{className:"w-5 h-5"}),"App Settings"]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Language"}),d.jsxs("div",{className:"relative",children:[d.jsx(ue,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),d.jsxs("select",{value:f.language||"en",onChange:e=>y(t=>l(a({},t),{language:e.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",children:[d.jsx("option",{value:"en",children:"English"}),d.jsx("option",{value:"fr",children:"Français"}),d.jsx("option",{value:"ar",children:"العربية"}),d.jsx("option",{value:"es",children:"Español"}),d.jsx("option",{value:"pt",children:"Português"})]})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Theme"}),d.jsxs("div",{className:"relative",children:[d.jsx(de,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),d.jsxs("select",{value:f.theme||"light",onChange:e=>y(t=>l(a({},t),{theme:e.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",children:[d.jsx("option",{value:"light",children:"Light"}),d.jsx("option",{value:"dark",children:"Dark"}),d.jsx("option",{value:"auto",children:"Auto"})]})]})]})]})]}),d.jsxs("div",{className:"flex items-center justify-between pt-6 border-t border-gray-200",children:[d.jsxs("button",{onClick:()=>{e&&(y({display_name:e.profile.display_name||"",bio:e.profile.bio||"",phone:e.profile.phone||"",department:e.profile.department||"",job_title:e.profile.job_title||"",location:e.profile.location||"",timezone:e.profile.timezone,language:e.profile.language,theme:e.profile.theme}),b({notification_email:e.preferences.notification_email,notification_push:e.preferences.notification_push,notification_desktop:e.preferences.notification_desktop,notification_sound:e.preferences.notification_sound,auto_refresh:e.preferences.auto_refresh,compact_view:e.preferences.compact_view,sidebar_collapsed:e.preferences.sidebar_collapsed}),m(null))},disabled:!h||n,className:"px-4 py-2 text-gray-600 hover:text-gray-800 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2 text-sm font-medium",children:[d.jsx(M,{className:"h-4 w-4"}),"Reset Changes"]}),d.jsxs("div",{className:"flex items-center gap-3",children:[h&&d.jsx("span",{className:"text-xs text-amber-600 bg-amber-50 px-2 py-1 rounded font-medium",children:"Unsaved changes"}),d.jsx("button",{onClick:()=>u(null,null,function*(){if(e){o(!0);try{m(null);const r={};if(Object.keys(f).forEach(t=>{const s=t;f[s]!==e.profile[s]&&(r[s]=f[s])}),0===Object.keys(r).length)return void ye.success("No changes to save");const s=yield vt.updateProfile(r);t(e=>e?l(a({},e),{profile:s}):null),ye.success("Profile updated successfully!")}catch(r){console.error("Error updating profile:",r),m("Failed to update profile"),ye.error("Failed to update profile")}finally{o(!1)}}}),disabled:!h||n,className:"px-6 py-2.5 bg-primary text-white rounded-lg hover:bg-primary-dark focus:ring-2 focus:ring-primary/20 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center gap-2 font-medium text-sm shadow-sm",children:n?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),"Saving..."]}):d.jsxs(d.Fragment,{children:[d.jsx(he,{className:"h-4 w-4"}),"Save Changes"]})})]})]})]}),"preferences"===i&&d.jsxs("div",{className:"space-y-8",children:[d.jsxs("div",{children:[d.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-6 flex items-center gap-2",children:[d.jsx(ne,{className:"w-5 h-5"}),"General Preferences"]}),d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:d.jsx(M,{className:"w-5 h-5 text-blue-600"})}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-semibold text-gray-900",children:"Auto Refresh"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Automatically refresh data in real-time"})]})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:x.auto_refresh||!1,onChange:e=>b(t=>l(a({},t),{auto_refresh:e.target.checked})),className:"sr-only peer"}),d.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary"})]})]}),d.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-green-100 rounded-lg",children:d.jsx(pe,{className:"w-5 h-5 text-green-600"})}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-semibold text-gray-900",children:"Compact View"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Use compact layout for lists and tables"})]})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:x.compact_view||!1,onChange:e=>b(t=>l(a({},t),{compact_view:e.target.checked})),className:"sr-only peer"}),d.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary"})]})]}),d.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:d.jsx(ge,{className:"w-5 h-5 text-purple-600"})}),d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-semibold text-gray-900",children:"Collapsed Sidebar"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Keep sidebar collapsed by default"})]})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:x.sidebar_collapsed||!1,onChange:e=>b(t=>l(a({},t),{sidebar_collapsed:e.target.checked})),className:"sr-only peer"}),d.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary"})]})]})]})]}),d.jsx("div",{className:"flex justify-end pt-6 border-t border-gray-200",children:d.jsx("button",{onClick:()=>u(null,null,function*(){if(e){o(!0);try{m(null);const r={};if(Object.keys(x).forEach(t=>{const s=t;x[s]!==e.preferences[s]&&(r[s]=x[s])}),0===Object.keys(r).length)return void ye.success("No changes to save");const s=yield vt.updatePreferences(r);t(e=>e?l(a({},e),{preferences:s}):null),ye.success("Preferences updated successfully!")}catch(r){console.error("Error updating preferences:",r),m("Failed to update preferences"),ye.error("Failed to update preferences")}finally{o(!1)}}}),disabled:!h||n,className:"px-6 py-2.5 bg-primary text-white rounded-lg hover:bg-primary-dark focus:ring-2 focus:ring-primary/20 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 flex items-center gap-2 font-medium text-sm shadow-sm",children:n?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),"Saving..."]}):d.jsxs(d.Fragment,{children:[d.jsx(he,{className:"h-4 w-4"}),"Save Preferences"]})})})]}),"notifications"===i&&d.jsx("div",{className:"space-y-8",children:d.jsxs("div",{children:[d.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-6 flex items-center gap-2",children:[d.jsx(oe,{className:"w-5 h-5"}),"Notification Settings"]}),d.jsx("div",{className:"space-y-6",children:e.notification_preferences.map(e=>d.jsxs("div",{className:"border border-gray-200 rounded-lg p-6 bg-gray-50",children:[d.jsxs("h4",{className:"text-base font-semibold text-gray-900 mb-4 capitalize flex items-center gap-2",children:[d.jsx(oe,{className:"w-4 h-4"}),e.category," Notifications"]}),d.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[d.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(B,{className:"w-4 h-4 text-gray-500"}),d.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Email"})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:e.email_enabled,onChange:t=>w(e.category,"email_enabled",t.target.checked),className:"sr-only peer"}),d.jsx("div",{className:"w-9 h-5 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-primary"})]})]}),d.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(me,{className:"w-4 h-4 text-gray-500"}),d.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Push"})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:e.push_enabled,onChange:t=>w(e.category,"push_enabled",t.target.checked),className:"sr-only peer"}),d.jsx("div",{className:"w-9 h-5 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-primary"})]})]}),d.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(de,{className:"w-4 h-4 text-gray-500"}),d.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Desktop"})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:e.desktop_enabled,onChange:t=>w(e.category,"desktop_enabled",t.target.checked),className:"sr-only peer"}),d.jsx("div",{className:"w-9 h-5 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-primary"})]})]}),d.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-lg border border-gray-200",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(fe,{className:"w-4 h-4 text-gray-500"}),d.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Sound"})]}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:e.sound_enabled,onChange:t=>w(e.category,"sound_enabled",t.target.checked),className:"sr-only peer"}),d.jsx("div",{className:"w-9 h-5 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-primary"})]})]})]})]},e.category))})]})})]})})]})})},St=()=>d.jsxs("div",{className:"p-6",children:[d.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Properties"}),d.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[d.jsx("p",{className:"text-gray-500",children:"Property management and listing details will appear here."}),d.jsx("div",{className:"mt-4 p-4 bg-yellow-50 text-yellow-800 rounded-md",children:"🚧 This feature is currently under development."})]})]}),wt=()=>d.jsxs("div",{className:"p-6",children:[d.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Reservations"}),d.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[d.jsx("p",{className:"text-gray-500",children:"Reservation calendar and booking details will appear here."}),d.jsx("div",{className:"mt-4 p-4 bg-yellow-50 text-yellow-800 rounded-md",children:"🚧 This feature is currently under development."})]})]}),kt=()=>d.jsxs("div",{className:"p-6",children:[d.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Cleaning Assignments"}),d.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[d.jsx("p",{className:"text-gray-500",children:"Cleaning assignments and reports will appear here."}),d.jsx("div",{className:"mt-4 p-4 bg-yellow-50 text-yellow-800 rounded-md",children:"🚧 This feature is currently under development."})]})]}),_t=({children:e})=>{const{isLoading:t,modules:r,permissions:s,refreshData:n}=(()=>{const e=v.useContext(We);if(!e)throw new Error("useAppContext must be used within AppProvider");return e})(),o="initializing"===Be().status,[i,a]=v.useState(!0),[l,c]=v.useState(!1),[u,h]=v.useState(!1),p=s.length>0||r.size>0;v.useEffect(()=>{const e=setTimeout(()=>{i&&!p&&(console.warn("[AppLoadingGate] Loading timeout after 5s, forcing display"),h(!0),n(!1).catch(e=>{console.error("[AppLoadingGate] Failed to refresh on timeout:",e)}))},5e3);return()=>clearTimeout(e)},[i,p,n]),v.useEffect(()=>{!p&&!u||l||(console.log("[AppLoadingGate] Initial load complete - has essential data or timeout"),c(!0),setTimeout(()=>{a(!1)},300))},[p,l,u]);const g=i&&!u&&(o||t&&!p);return v.useEffect(()=>{console.log("[AppLoadingGate] Loading state:",{authLoading:o,appLoading:t,hasEssentialData:p,isInitialLoad:i,hasLoadedOnce:l,shouldShowLoading:g,modulesCount:r.size,permissionsCount:s.length})},[o,t,p,i,l,g,r.size,s.length]),d.jsx(d.Fragment,{children:e})},Nt=v.createContext(void 0),Ct=({children:e})=>{const[t,r]=v.useState({open:!1,kind:"info",title:"",subtitle:"",key:0});return d.jsx(Nt.Provider,{value:{showToast:(e,t,s)=>{r({open:!0,kind:e,title:t,subtitle:s,key:Date.now()})},hideToast:()=>{r(e=>l(a({},e),{open:!1}))},toastInfo:t},children:e})},jt=()=>{const{toastInfo:e,hideToast:t}=(()=>{const e=v.useContext(Nt);if(!e)throw new Error("useToast must be used within a ToastProvider");return e})(),[r,s]=v.useState(!1),[n,o]=v.useState(!1);if(v.useEffect(()=>{if(e.open){o(!0),setTimeout(()=>s(!0),10);const e=setTimeout(()=>{s(!1),setTimeout(()=>{o(!1),t()},300)},3e3);return()=>clearTimeout(e)}s(!1),setTimeout(()=>o(!1),300)},[e.open,t]),!n)return null;if("loading"===e.kind)return d.jsxs("div",{className:"fixed top-4 right-4 z-[9999] bg-white border border-gray-200 shadow-lg rounded-xl px-6 py-4 flex items-center gap-4 transition-all duration-300 "+(r?"opacity-100 scale-100":"opacity-0 scale-95"),style:{pointerEvents:r?"auto":"none"},children:[d.jsxs("svg",{className:"animate-spin h-6 w-6 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}),d.jsxs("div",{children:[d.jsx("h5",{className:"text-base font-semibold text-gray-900 m-0",children:e.title}),d.jsx("p",{className:"text-sm text-gray-600 m-0",children:e.subtitle})]})]});const i={success:"bg-green-50 border-green-200 text-green-800",error:"bg-red-50 border-red-200 text-red-800",warning:"bg-yellow-50 border-yellow-200 text-yellow-800",info:"bg-blue-50 border-blue-200 text-blue-800"}[e.kind]||"bg-white border-gray-200 text-gray-900";return d.jsxs("div",{className:`fixed top-4 right-4 z-[9999] border shadow-lg rounded-xl px-6 py-4 flex items-start gap-4 transition-all duration-300 ${i} ${r?"opacity-100 scale-100":"opacity-0 scale-95"}`,role:"alert",style:{pointerEvents:r?"auto":"none"},children:[d.jsx("button",{onClick:()=>{s(!1),setTimeout(()=>{o(!1),t()},300)},className:"absolute top-2 right-2 text-gray-400 hover:text-gray-700 p-1 rounded-full focus:outline-none","aria-label":"Close notification",children:d.jsx("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),d.jsxs("div",{children:[d.jsx("h5",{className:"text-base font-semibold m-0",children:e.title}),d.jsx("p",{className:"text-sm m-0",children:e.subtitle})]})]})};var It=["added","removed","updated"];function At(e){return It.includes(e)}function Rt(e){return u(this,arguments,function*({queryClient:e,persister:t,buster:r="",dehydrateOptions:s}){const n={buster:r,timestamp:Date.now(),clientState:p(e,s)};yield t.persistClient(n)})}var Pt=e=>{var t=e,{children:r,persistOptions:i,onSuccess:c,onError:p}=t,f=((e,t)=>{var r={};for(var i in e)n.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&s)for(var i of s(e))t.indexOf(i)<0&&o.call(e,i)&&(r[i]=e[i]);return r})(t,["children","persistOptions","onSuccess","onError"]);const[y,x]=v.useState(!0),b=v.useRef({persistOptions:i,onSuccess:c,onError:p}),S=v.useRef(!1);return v.useEffect(()=>{b.current={persistOptions:i,onSuccess:c,onError:p}}),v.useEffect(()=>{const e=l(a({},b.current.persistOptions),{queryClient:f.client});return S.current||(S.current=!0,function(e){return u(this,arguments,function*({queryClient:e,persister:t,maxAge:r=864e5,buster:s="",hydrateOptions:n}){try{const o=yield t.restoreClient();if(o){if(!o.timestamp)return t.removeClient();{const i=Date.now()-o.timestamp>r,a=o.buster!==s;if(i||a)return t.removeClient();h(e,o.clientState,n)}}}catch(o){throw yield t.removeClient(),o}})}(e).then(()=>{var e,t;return null==(t=(e=b.current).onSuccess)?void 0:t.call(e)}).catch(()=>{var e,t;return null==(t=(e=b.current).onError)?void 0:t.call(e)}).finally(()=>{x(!1)})),y?void 0:function(e){const t=e.queryClient.getQueryCache().subscribe(t=>{At(t.type)&&Rt(e)}),r=e.queryClient.getMutationCache().subscribe(t=>{At(t.type)&&Rt(e)});return()=>{t(),r()}}(e)},[f.client,y]),d.jsx(g,l(a({},f),{children:d.jsx(m,{value:y,children:r})}))};function Et(){}function Ot(e,t=100){let r,s=null;return function(...n){r=n,null===s&&(s=f.setTimeout(()=>{e(...r),s=null},t))}}function Tt(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Lt,Dt={exports:{}};const $t=R((Lt||(Lt=1,Dt.exports=function e(t,r,s){function n(i,a){if(!r[i]){if(!t[i]){if(!a&&Tt)return Tt(i);if(o)return o(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[i]={exports:{}};t[i][0].call(c.exports,function(e){return n(t[i][1][e]||e)},c,c.exports,e,t,r,s)}return r[i].exports}for(var o=Tt,i=0;i=43)}}).catch(function(){return!1})}(e).then(function(e){return h=e})}function x(e){var t=p[e.name],r={};r.promise=new i(function(e,t){r.resolve=e,r.reject=t}),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then(function(){return r.promise}):t.dbReady=r.promise}function b(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var r=p[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function w(e,t){return new i(function(r,s){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);x(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var i=n.open.apply(n,o);t&&(i.onupgradeneeded=function(t){var r=i.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(d)}catch(s){if("ConstraintError"!==s.name)throw s;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(e){e.preventDefault(),s(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},r(t),b(e)}})}function k(e){return w(e,!1)}function _(e){return w(e,!0)}function N(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),s=e.versione.db.version;if(s&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||r){if(r){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function C(e){return o([y(atob(e.data))],{type:e.type})}function j(e){return e&&e.__local_forage_encoded_blob}function I(e){var t=this,r=t._initReady().then(function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return l(r,e,e),r}function A(e,t,r,s){void 0===s&&(s=1);try{var n=e.db.transaction(e.storeName,t);r(null,n)}catch(o){if(s>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return i.resolve().then(function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),_(e)}).then(function(){return function(e){x(e);for(var t=p[e.name],r=t.forages,s=0;s>4,u[l++]=(15&s)<<4|n>>2,u[l++]=(3&n)<<6|63&o;return c}function W(e){var t,r=new Uint8Array(e),s="";for(t=0;t>2],s+=P[(3&r[t])<<4|r[t+1]>>4],s+=P[(15&r[t+1])<<2|r[t+2]>>6],s+=P[63&r[t+2]];return r.length%3==2?s=s.substring(0,s.length-1)+"=":r.length%3==1&&(s=s.substring(0,s.length-2)+"=="),s}var K={serialize:function(e,t){var r="";if(e&&(r=B.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===B.call(e.buffer))){var s,n=O;e instanceof ArrayBuffer?(s=e,n+=T):(s=e.buffer,"[object Int8Array]"===r?n+=D:"[object Uint8Array]"===r?n+=$:"[object Uint8ClampedArray]"===r?n+=M:"[object Int16Array]"===r?n+=q:"[object Uint16Array]"===r?n+=U:"[object Int32Array]"===r?n+=F:"[object Uint32Array]"===r?n+=z:"[object Float32Array]"===r?n+=V:"[object Float64Array]"===r?n+=H:t(new Error("Failed to get type for BinaryArray"))),t(n+W(s))}else if("[object Blob]"===r){var o=new FileReader;o.onload=function(){var r="~~local_forage_type~"+e.type+"~"+W(this.result);t(O+L+r)},o.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(i){console.error("Couldn't convert value into a JSON string: ",e),t(null,i)}},deserialize:function(e){if(e.substring(0,9)!==O)return JSON.parse(e);var t,r=e.substring(13),s=e.substring(9,13);if(s===L&&E.test(r)){var n=r.match(E);t=n[1],r=r.substring(n[0].length)}var i=J(r);switch(s){case T:return i;case L:return o([i],{type:t});case D:return new Int8Array(i);case $:return new Uint8Array(i);case M:return new Uint8ClampedArray(i);case q:return new Int16Array(i);case U:return new Uint16Array(i);case F:return new Int32Array(i);case z:return new Uint32Array(i);case V:return new Float32Array(i);case H:return new Float64Array(i);default:throw new Error("Unkown type: "+s)}},stringToBuffer:J,bufferToString:W};function G(e,t,r,s){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,s)}function Y(e,t,r,s,n,o){e.executeSql(r,s,n,function(e,i){i.code===i.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(e,a){a.rows.length?o(e,i):G(e,t,function(){e.executeSql(r,s,n,o)},o)},o):o(e,i)},o)}function Q(e,t,r,s){var n=this;e=c(e);var o=new i(function(o,i){n.ready().then(function(){void 0===t&&(t=null);var a=t,l=n._dbInfo;l.serializer.serialize(t,function(t,c){c?i(c):l.db.transaction(function(r){Y(r,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],function(){o(a)},function(e,t){i(t)})},function(t){if(t.code===t.QUOTA_ERR){if(s>0)return void o(Q.apply(n,[e,a,r,s-1]));i(t)}})})}).catch(i)});return a(o,r),o}var X={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var s in e)r[s]="string"!=typeof e[s]?e[s].toString():e[s];var n=new i(function(e,s){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(n){return s(n)}r.db.transaction(function(n){G(n,r,function(){t._dbInfo=r,e()},function(e,t){s(t)})},s)});return r.serializer=K,n},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,s=new i(function(t,s){r.ready().then(function(){var n=r._dbInfo;n.db.transaction(function(r){Y(r,n,"SELECT * FROM "+n.storeName,[],function(r,s){for(var o=s.rows,i=o.length,a=0;a '__WebKitDatabaseInfoTable__'",[],function(r,s){for(var n=[],o=0;o0}var te={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=Z(e,this._defaultConfig),ee()?(this._dbInfo=t,t.serializer=K,i.resolve()):i.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,s=r.ready().then(function(){for(var t=r._dbInfo,s=t.keyPrefix,n=s.length,o=localStorage.length,i=1,a=0;a=0;r--){var s=localStorage.key(r);0===s.indexOf(e)&&localStorage.removeItem(s)}});return a(r,e),r},length:function(e){var t=this.keys().then(function(e){return e.length});return a(t,e),t},key:function(e,t){var r=this,s=r.ready().then(function(){var t,s=r._dbInfo;try{t=localStorage.key(e)}catch(n){t=null}return t&&(t=t.substring(s.keyPrefix.length)),t});return a(s,t),s},keys:function(e){var t=this,r=t.ready().then(function(){for(var e=t._dbInfo,r=localStorage.length,s=[],n=0;n=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}}):i.reject("Invalid arguments"),t),s}},re=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},se=function(e,t){for(var r=e.length,s=0;s{},isMobileOpen:!1,setIsMobileOpen:()=>{},submenuOpen:null,setSubmenuOpen:()=>{}}),qt=()=>v.useContext(Mt)||{isCollapsed:!1,setIsCollapsed:()=>{},isMobileOpen:!1,setIsMobileOpen:()=>{},submenuOpen:null,setSubmenuOpen:()=>{}},Ft=new y({defaultOptions:{queries:{gcTime:864e5,staleTime:3e5,refetchOnWindowFocus:!0,refetchOnMount:!0,retry:1}}}),Ut=function({storage:e,key:t="REACT_QUERY_OFFLINE_CACHE",throttleTime:r=1e3,serialize:s=JSON.stringify,deserialize:n=JSON.parse,retry:o}){if(e){const i=r=>{try{return void e.setItem(t,s(r))}catch(n){return n}};return{persistClient:Ot(e=>{let t=e,r=i(t),s=0;for(;r&&t;)s++,t=null==o?void 0:o({persistedClient:t,error:r,errorCount:s}),t&&(r=i(t))},r),restoreClient:()=>{const r=e.getItem(t);if(r)return n(r)},removeClient:()=>{e.removeItem(t)}}}return{persistClient:Et,restoreClient:Et,removeClient:Et}}({storage:$t});function zt(){return v.useEffect(()=>{try{(()=>{const e=localStorage.getItem("sb-auth-token");if(e)try{const t=JSON.parse(e);t.expires_at&&new Date(1e3*t.expires_at)"true"===localStorage.getItem("sidebarCollapsed")),[r,s]=v.useState(!1),[n,o]=v.useState(null);return v.useEffect(()=>{localStorage.setItem("sidebarCollapsed",e.toString())},[e]),d.jsx(Mt.Provider,{value:{isCollapsed:e,setIsCollapsed:t,isMobileOpen:r,setIsMobileOpen:s,submenuOpen:n,setSubmenuOpen:o},children:d.jsxs(_t,{children:[d.jsxs(j,{children:[d.jsx(I,{path:"/login",element:d.jsx(Qe,{children:d.jsx(lt,{})})}),d.jsx(I,{path:"/unauthorized",element:d.jsx(ht,{})}),d.jsx(I,{path:"/",element:d.jsx(pt,{})}),d.jsx(I,{path:"/*",element:d.jsx(Ye,{children:d.jsxs("div",{className:"flex h-screen overflow-hidden bg-gray-50",children:[d.jsx(Xe,{}),d.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[d.jsx(yt,{}),d.jsx("main",{className:"flex-1 overflow-y-auto",children:d.jsxs(j,{children:[d.jsx(I,{path:"/dashboard",element:d.jsx(dt,{})}),d.jsx(I,{path:"/properties",element:d.jsx(St,{})}),d.jsx(I,{path:"/reservations",element:d.jsx(wt,{})}),d.jsx(I,{path:"/cleaning",element:d.jsx(kt,{})}),d.jsx(I,{path:"/profile",element:d.jsx(bt,{})}),d.jsx(I,{path:"*",element:d.jsx(x,{to:"/dashboard",replace:!0})})]})})]})]})})})]}),d.jsx(ve,{position:"top-right"})]})})}function Ht(){return d.jsx(zt,{})}const Bt=e=>"string"==typeof e,Jt=()=>{let e,t;const r=new Promise((r,s)=>{e=r,t=s});return r.resolve=e,r.reject=t,r},Wt=e=>null==e?"":""+e,Kt=/###/g,Gt=e=>e&&e.indexOf("###")>-1?e.replace(Kt,"."):e,Yt=e=>!e||Bt(e),Qt=(e,t,r)=>{const s=Bt(t)?t.split("."):t;let n=0;for(;n{const{obj:s,k:n}=Qt(e,t,Object);if(void 0!==s||1===t.length)return void(s[n]=r);let o=t[t.length-1],i=t.slice(0,t.length-1),a=Qt(e,i,Object);for(;void 0===a.obj&&i.length;)o=`${i[i.length-1]}.${o}`,i=i.slice(0,i.length-1),a=Qt(e,i,Object),a&&a.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=r},Zt=(e,t)=>{const{obj:r,k:s}=Qt(e,t);if(r)return r[s]},er=(e,t,r)=>{for(const s in t)"__proto__"!==s&&"constructor"!==s&&(s in e?Bt(e[s])||e[s]instanceof String||Bt(t[s])||t[s]instanceof String?r&&(e[s]=t[s]):er(e[s],t[s],r):e[s]=t[s]);return e},tr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var rr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const sr=e=>Bt(e)?e.replace(/[&<>"'\/]/g,e=>rr[e]):e,nr=[" ",",","?","!",";"],or=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),ir=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const s=t.split(r);let n=e;for(let o=0;o-1&&ie&&e.replace("_","-"),lr={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class cr{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||lr,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),r=0;r{this.observers[e]||(this.observers[e]=new Map);const r=this.observers[e].get(t)||0;this.observers[e].set(t,r+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s{let[t,s]=e;for(let n=0;n{let[s,n]=t;for(let o=0;o1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],r&&(Array.isArray(r)?i.push(...r):Bt(r)&&n?i.push(...r.split(n)):i.push(r)));const a=Zt(this.data,i);return!a&&!t&&!r&&e.indexOf(".")>-1&&(e=i[0],t=i[1],r=i.slice(2).join(".")),!a&&o&&Bt(r)?ir(this.data&&this.data[e]&&this.data[e][t],r,n):a}addResource(e,t,r,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator;let i=[e,t];r&&(i=i.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(i=e.split("."),s=t,t=i[1]),this.addNamespaces(t),Xt(this.data,i,s),n.silent||this.emit("added",e,t,r,s)}addResources(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const n in r)(Bt(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{silent:!0});s.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,s,n){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),s=r,r=t,t=i[1]),this.addNamespaces(t);let l=Zt(this.data,i)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?er(l,r,n):l=a(a({},l),r),Xt(this.data,i,l),o.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?a(a({},{}),this.getResource(e,t)):this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var pr={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,s,n){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,r,s,n))}),t}};const gr={};class mr extends dr{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r,s;super(),r=e,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{r[e]&&(s[e]=r[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=ur.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const r=this.resolve(e,t);return r&&void 0!==r.res}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");const s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let n=t.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,r)=>{t=t||"",r=r||"";const s=nr.filter(e=>t.indexOf(e)<0&&r.indexOf(e)<0);if(0===s.length)return!0;const n=or.getRegExp(`(${s.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!n.test(e);if(!o){const t=e.indexOf(r);t>0&&!n.test(e.substring(0,t))&&(o=!0)}return o})(e,r,s));if(o&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Bt(n)?[n]:n};const o=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(o[0])>-1)&&(n=o.shift()),e=o.join(s)}return{key:e,namespaces:Bt(n)?[n]:n}}translate(e,t,r){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t=a({},t)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const s=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:o,namespaces:i}=this.extractFromKey(e[e.length-1],t),c=i[i.length-1],u=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(d){const e=t.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(t)}:`${c}${e}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(t)}:o}const h=this.resolve(e,t);let p=h&&h.res;const g=h&&h.usedKey||o,m=h&&h.exactUsedKey||o,f=Object.prototype.toString.apply(p),y=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,x=!Bt(p)&&"boolean"!=typeof p&&"number"!=typeof p;if(!(v&&p&&x&&["[object Number]","[object Function]","[object RegExp]"].indexOf(f)<0)||Bt(y)&&Array.isArray(p))if(v&&Bt(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,e,t,r));else{let s=!1,i=!1;const d=void 0!==t.count&&!Bt(t.count),g=mr.hasDefaultValue(t),m=d?this.pluralResolver.getSuffix(u,t.count,t):"",f=t.ordinal&&d?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",y=d&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=y&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${m}`]||t[`defaultValue${f}`]||t.defaultValue;!this.isValidLookup(p)&&g&&(s=!0,p=v),this.isValidLookup(p)||(i=!0,p=o);const x=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:p,b=g&&v!==p&&this.options.updateMissing;if(i||s||b){if(this.logger.log(b?"updateKey":"missingKey",u,c,o,b?v:p),n){const e=this.resolve(o,l(a({},t),{keySeparator:!1}));e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const r=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&r&&r[0])for(let t=0;t{const n=g&&s!==p?s:x;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,r,n,b,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,c,r,n,b,t),this.emit("missingKey",e,c,r,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&d?e.forEach(e=>{const r=this.pluralResolver.getSuffixes(e,t);y&&t[`defaultValue${this.options.pluralSeparator}zero`]&&r.indexOf(`${this.options.pluralSeparator}zero`)<0&&r.push(`${this.options.pluralSeparator}zero`),r.forEach(r=>{s([e],o+r,t[`defaultValue${r}`]||v)})}):s(e,o,v))}p=this.extendTranslation(p,e,t,h,r),i&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${c}:${o}`),(i||s)&&this.options.parseMissingKeyHandler&&(p="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,s?p:void 0):this.options.parseMissingKeyHandler(p))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,p,l(a({},t),{ns:i})):`key '${o} (${this.language})' returned an object instead of string.`;return s?(h.res=e,h.usedParams=this.getUsedParamsDetails(t),h):e}if(n){const e=Array.isArray(p),r=e?[]:{},s=e?m:g;for(const o in p)if(Object.prototype.hasOwnProperty.call(p,o)){const e=`${s}${n}${o}`;r[o]=this.translate(e,a(a({},t),{joinArrays:!1,ns:i})),r[o]===e&&(r[o]=p[o])}p=r}}return s?(h.res=p,h.usedParams=this.getUsedParamsDetails(t),h):p}extendTranslation(e,t,r,s,n){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,a(a({},this.options.interpolation.defaultVariables),r),r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(a(a({},r),{interpolation:a(a({},this.options.interpolation),r.interpolation)}));const i=Bt(e)&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(i){const t=e.match(this.interpolator.nestingRegexp);l=t&&t.length}let c=r.replace&&!Bt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(c=a(a({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,r.lng||this.language||s.usedLng,r),i){const t=e.match(this.interpolator.nestingRegexp);l<(t&&t.length)&&(r.nest=!1)}!r.lng&&"v1"!==this.options.compatibilityAPI&&s&&s.res&&(r.lng=this.language||s.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,s=new Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return Bt(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,i),l=a.key;r=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==i.count&&!Bt(i.count),d=u&&!i.ordinal&&0===i.count&&this.pluralResolver.shouldUseIntlApi(),h=void 0!==i.context&&(Bt(i.context)||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);c.forEach(e=>{this.isValidLookup(t)||(o=e,!gr[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(gr[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{if(this.isValidLookup(t))return;n=r;const o=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,r,e,i);else{let e;u&&(e=this.pluralResolver.getSuffix(r,i.count,i));const t=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(o.push(l+e),i.ordinal&&0===e.indexOf(s)&&o.push(l+e.replace(s,this.options.pluralSeparator)),d&&o.push(l+t)),h){const r=`${l}${this.options.contextSeparator}${i.context}`;o.push(r),u&&(o.push(r+e),i.ordinal&&0===e.indexOf(s)&&o.push(r+e.replace(s,this.options.pluralSeparator)),d&&o.push(r+t))}}let a;for(;a=o.pop();)this.isValidLookup(t)||(s=a,t=this.getResource(r,e,a,i))}))})}),{res:t,usedKey:r,exactUsedKey:s,usedLng:n,usedNS:o}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,s):this.resourceStore.getResource(e,t,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!Bt(e.replace);let s=r?e.replace:e;if(r&&void 0!==e.count&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s=a(a({},this.options.interpolation.defaultVariables),s)),!r){s=a({},s);for(const e of t)delete s[e]}return s}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}const fr=e=>e.charAt(0).toUpperCase()+e.slice(1);class yr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ur.create("languageUtils")}getScriptPartFromCode(e){if(!(e=ar(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ar(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Bt(e)&&e.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(t){}const r=["hans","hant","latn","cyrl","cans","mong","arab"];let s=e.split("-");return this.options.lowerCaseLng?s=s.map(e=>e.toLowerCase()):2===s.length?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),r.indexOf(s[1].toLowerCase())>-1&&(s[1]=fr(s[1].toLowerCase()))):3===s.length&&(s[0]=s[0].toLowerCase(),2===s[1].length&&(s[1]=s[1].toUpperCase()),"sgn"!==s[0]&&2===s[2].length&&(s[2]=s[2].toUpperCase()),r.indexOf(s[1].toLowerCase())>-1&&(s[1]=fr(s[1].toLowerCase())),r.indexOf(s[2].toLowerCase())>-1&&(s[2]=fr(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const r=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(r)||(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Bt(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){const r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],n=e=>{e&&(this.isSupportedCode(e)?s.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Bt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&n(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&n(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&n(this.getLanguagePartFromCode(e))):Bt(e)&&n(this.formatLanguageCode(e)),r.forEach(e=>{s.indexOf(e)<0&&n(this.formatLanguageCode(e))}),s}}let vr=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],xr={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const br=["v1","v2","v3"],Sr=["v4"],wr={zero:0,one:1,two:2,few:3,many:4,other:5};class kr{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=ur.create("pluralResolver"),this.options.compatibilityJSON&&!Sr.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return vr.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:xr[t.fc]}})}),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const s=ar("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:s,type:n});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(s,{type:n})}catch(r){if(!e.match(/-|_/))return;const s=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(s,t)}return this.pluralRulesCache[o]=i,i}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=this.getRule(e,t);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((e,t)=>wr[e]-wr[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):r.numbers.map(r=>this.getSuffix(e,r,t)):[]}getSuffix(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getRule(e,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:this.getSuffixRetroCompatible(s,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let s=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===s?s="plural":1===s&&(s=""));const n=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return"v1"===this.options.compatibilityJSON?1===s?"":"number"==typeof s?`_plural_${s.toString()}`:n():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?n():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!br.includes(this.options.compatibilityJSON)}}const _r=function(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=((e,t,r)=>{const s=Zt(e,r);return void 0!==s?s:Zt(t,r)})(e,t,r);return!o&&n&&Bt(r)&&(o=ir(e,r,s),void 0===o&&(o=ir(t,r,s))),o},Nr=e=>e.replace(/\$/g,"$$$$");class Cr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=ur.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:r,useRawValueToEscape:s,prefix:n,prefixEscaped:o,suffix:i,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:m,maxReplaces:f,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:sr,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==s&&s,this.prefix=n?tr(n):o||"{{",this.suffix=i?tr(i):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?tr(d):h||tr("$t("),this.nestingSuffix=p?tr(p):g||tr(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=f||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,r,s){let n,o,i;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const n=_r(t,c,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(n,void 0,r,l(a(a({},s),t),{interpolationkey:e})):n}const n=e.split(this.formatSeparator),o=n.shift().trim(),i=n.join(this.formatSeparator).trim();return this.format(_r(t,c,o,this.options.keySeparator,this.options.ignoreJSONStructure),i,r,l(a(a({},s),t),{interpolationkey:o}))};this.resetRegExp();const d=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,h=s&&s.interpolation&&void 0!==s.interpolation.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Nr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Nr(this.escape(e)):Nr(e)}].forEach(t=>{for(i=0;n=t.regex.exec(e);){const r=n[1].trim();if(o=u(r),void 0===o)if("function"==typeof d){const t=d(e,n,s);o=Bt(t)?t:""}else if(s&&Object.prototype.hasOwnProperty.call(s,r))o="";else{if(h){o=n[0];continue}this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),o=""}else Bt(o)||this.useRawValueToEscape||(o=Wt(o));const a=t.safeValue(o);if(e=e.replace(n[0],a),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t){let r,s,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=(e,t)=>{const r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;const s=e.split(new RegExp(`${r}[ ]*{`));let o=`{${s[1]}`;e=s[0],o=this.interpolate(o,n);const i=o.match(/'/g),l=o.match(/"/g);(i&&i.length%2==0&&!l||l.length%2!=0)&&(o=o.replace(/'/g,'"'));try{n=JSON.parse(o),t&&(n=a(a({},t),n))}catch(c){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,c),`${e}${r}${o}`}return n.defaultValue&&n.defaultValue.indexOf(this.prefix)>-1&&delete n.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let c=[];n=a({},o),n=n.replace&&!Bt(n.replace)?n.replace:n,n.applyPostProcessor=!1,delete n.defaultValue;let u=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){const e=r[1].split(this.formatSeparator).map(e=>e.trim());r[1]=e.shift(),c=e,u=!0}if(s=t(i.call(this,r[1].trim(),n),n),s&&r[0]===e&&!Bt(s))return s;Bt(s)||(s=Wt(s)),s||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),s=""),u&&(s=c.reduce((e,t)=>this.format(e,t,o.lng,l(a({},o),{interpolationkey:r[1].trim()})),s.trim())),e=e.replace(r[0],s),this.regexp.lastIndex=0}return e}}const jr=e=>{const t={};return(r,s,n)=>{let o=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(o=l(a({},o),{[n.interpolationkey]:void 0}));const i=s+JSON.stringify(o);let c=t[i];return c||(c=e(ar(s),n),t[i]=c),c(r)}};class Ir{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=ur.create("formatter"),this.options=e,this.formats={number:jr((e,t)=>{const r=new Intl.NumberFormat(e,a({},t));return e=>r.format(e)}),currency:jr((e,t)=>{const r=new Intl.NumberFormat(e,l(a({},t),{style:"currency"}));return e=>r.format(e)}),datetime:jr((e,t)=>{const r=new Intl.DateTimeFormat(e,a({},t));return e=>r.format(e)}),relativetime:jr((e,t)=>{const r=new Intl.RelativeTimeFormat(e,a({},t));return e=>r.format(e,t.range||"day")}),list:jr((e,t)=>{const r=new Intl.ListFormat(e,a({},t));return e=>r.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=jr(t)}format(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const n=t.split(this.formatSeparator);if(n.length>1&&n[0].indexOf("(")>1&&n[0].indexOf(")")<0&&n.find(e=>e.indexOf(")")>-1)){const e=n.findIndex(e=>e.indexOf(")")>-1);n[0]=[n[0],...n.splice(1,e)].join(this.formatSeparator)}return n.reduce((e,t)=>{const{formatName:n,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const n=s[1].substring(0,s[1].length-1);"currency"===t&&n.indexOf(":")<0?r.currency||(r.currency=n.trim()):"relativetime"===t&&n.indexOf(":")<0?r.range||(r.range=n.trim()):n.split(";").forEach(e=>{if(e){const[t,...s]=e.split(":"),n=s.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();r[o]||(r[o]=n),"false"===n&&(r[o]=!1),"true"===n&&(r[o]=!0),isNaN(n)||(r[o]=parseInt(n,10))}})}return{formatName:t,formatOptions:r}})(t);if(this.formats[n]){let t=e;try{const i=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},l=i.locale||i.lng||s.locale||s.lng||r;t=this.formats[n](e,l,a(a(a({},o),s),i))}catch(i){this.logger.warn(i)}return t}return this.logger.warn(`there was no format function for ${n}`),e},e)}}class Ar extends dr{constructor(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=ur.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(e,t,r,s){const n={},o={},i={},a={};return e.forEach(e=>{let s=!0;t.forEach(t=>{const i=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===o[i]&&(o[i]=!0):(this.state[i]=1,s=!1,void 0===o[i]&&(o[i]=!0),void 0===n[i]&&(n[i]=!0),void 0===a[t]&&(a[t]=!0)))}),s||(i[e]=!0)}),(Object.keys(n).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(n),pending:Object.keys(o),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(a)}}loaded(e,t,r){const s=e.split("|"),n=s[0],o=s[1];t&&this.emit("failedLoading",n,o,t),!t&&r&&this.store.addResourceBundle(n,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);const i={};this.queue.forEach(r=>{((e,t,r)=>{const{obj:s,k:n}=Qt(e,t,Object);s[n]=s[n]||[],s[n].push(r)})(r.loaded,[n],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{i[e]||(i[e]={});const t=r.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:s,wait:n,callback:o});this.readingCalls++;const i=(i,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&a&&s{this.read.call(this,e,t,r,s+1,2*n,o)},n):o(i,a)},a=this.backend[r].bind(this.backend);if(2!==a.length)return a(e,t,i);try{const r=a(e,t);r&&"function"==typeof r.then?r.then(e=>i(null,e)).catch(i):i(null,r)}catch(l){i(l)}}prepareLoading(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Bt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Bt(t)&&(t=[t]);const n=this.queueLoad(e,t,r,s);if(!n.toLoad.length)return n.pending.length||s(),null;n.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=e.split("|"),s=r[0],n=r[1];this.read(s,n,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${t}loading namespace ${n} for language ${s} failed`,r),!r&&o&&this.logger.log(`${t}loaded namespace ${n} for language ${s}`,o),this.loaded(e,r,o)})}saveMissing(e,t,r,s,n){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=r&&""!==r){if(this.backend&&this.backend.create){const u=l(a({},o),{isUpdate:n}),d=this.backend.create.bind(this.backend);if(d.length<6)try{let n;n=5===d.length?d(e,t,r,s,u):d(e,t,r,s),n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(c){i(c)}else d(e,t,r,s,i,u)}e&&e[0]&&this.store.addResource(e[0],t,r,s)}}}const Rr=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Bt(e[1])&&(t.defaultValue=e[1]),Bt(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Pr=e=>(Bt(e.ns)&&(e.ns=[e.ns]),Bt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Bt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Er=()=>{};class Or extends dr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var r;if(super(),this.options=Pr(e),this.services={},this.logger=ur,this.modules={external:[]},r=this,Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(e=>{"function"==typeof r[e]&&(r[e]=r[e].bind(r))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(Bt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=Rr();this.options=a(a(a({},s),this.options),Pr(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=a(a({},s.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?ur.init(n(this.modules.logger),this.options):ur.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=Ir);const r=new yr(this.options);this.store=new hr(this.options.resources,this.options);const o=this.services;o.logger=ur,o.resourceStore=this.store,o.languageUtils=r,o.pluralResolver=new kr(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(o.formatter=n(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new Cr(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new Ar(n(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",function(t){for(var r=arguments.length,s=new Array(r>1?r-1:0),n=1;n1?r-1:0),n=1;n{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Er),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});const o=Jt(),i=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(t),r(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?i():setTimeout(i,0),o}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Er;const r=Bt(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],s=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};r?s(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>s(e)),this.options.preload&&this.options.preload.forEach(e=>s(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,r){const s=Jt();return"function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=Er),this.services.backendConnector.reload(e,t,e=>{s.resolve(),r(e)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&pr.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var r=this;this.isLanguageChangingTo=e;const s=Jt();this.emit("languageChanging",e);const n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(e,o)=>{o?(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),t&&t(e,function(){return r.t(...arguments)})},i=t=>{e||t||!this.services.languageDetector||(t=[]);const r=Bt(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);r&&(this.language||n(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(r)),this.loadResources(r,e=>{o(e,r)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),s}getFixedT(e,t,r){var s=this;const n=function(e,t){let o;if("object"!=typeof t){for(var i=arguments.length,l=new Array(i>2?i-2:0),c=2;c`${o.keyPrefix}${u}${e}`):o.keyPrefix?`${o.keyPrefix}${u}${e}`:e,s.t(d,o)};return Bt(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=r,n}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=t.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,n=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;const o=(e,t)=>{const r=this.services.backendConnector.state[`${e}|${t}`];return-1===r||0===r||2===r};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!(!this.hasResourceBundle(r,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(r,e)||s&&!o(n,e)))}loadNamespaces(e,t){const r=Jt();return this.options.ns?(Bt(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){const r=Jt();Bt(e)&&(e=[e]);const s=this.options.preload||[],n=e.filter(e=>s.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return n.length?(this.options.preload=s.concat(n),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new yr(Rr());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Or(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Er;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s=a(a(a({},this.options),e),{isClone:!0}),n=new Or(s);return void 0===e.debug&&void 0===e.prefix||(n.logger=n.logger.clone(e)),["store","services","language"].forEach(e=>{n[e]=this[e]}),n.services=a({},this.services),n.services.utils={hasLoadedNamespace:n.hasLoadedNamespace.bind(n)},r&&(n.store=new hr(this.store.data,s),n.services.resourceStore=n.store),n.translator=new mr(n.services,s),n.translator.on("*",function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},$r=e=>Dr[e];let Mr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Lr,$r)};const qr={type:"3rdParty",init(e){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Mr=a(a({},Mr),e)}(e.options.react)}};function Fr(e){return(Fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ur(e){var t=function(e){if("object"!=Fr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Fr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fr(t)?t:t+""}var zr=[],Vr=zr.forEach,Hr=zr.slice,Br=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Jr={name:"cookie",lookup:function(e){var t;if(e.lookupCookie&&"undefined"!=typeof document){var r=function(e){for(var t="".concat(e,"="),r=document.cookie.split(";"),s=0;s4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};r&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+60*r*1e3)),s&&(n.domain=s),document.cookie=function(e,t,r){var s=r||{};s.path=s.path||"/";var n=encodeURIComponent(t),o="".concat(e,"=").concat(n);if(s.maxAge>0){var i=s.maxAge-0;if(Number.isNaN(i))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(i))}if(s.domain){if(!Br.test(s.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(s.domain)}if(s.path){if(!Br.test(s.path))throw new TypeError("option path is invalid");o+="; Path=".concat(s.path)}if(s.expires){if("function"!=typeof s.expires.toUTCString)throw new TypeError("option expires is invalid");o+="; Expires=".concat(s.expires.toUTCString())}if(s.httpOnly&&(o+="; HttpOnly"),s.secure&&(o+="; Secure"),s.sameSite)switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o}(e,encodeURIComponent(t),n)}(t.lookupCookie,e,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},Wr={name:"querystring",lookup:function(e){var t;if("undefined"!=typeof window){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var s=r.substring(1).split("&"),n=0;n0&&s[n].substring(0,o)===e.lookupQuerystring&&(t=s[n].substring(o+1))}}return t}},Kr=null,Gr=function(){if(null!==Kr)return Kr;try{Kr="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(t){Kr=!1}return Kr},Yr={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&Gr()){var r=window.localStorage.getItem(e.lookupLocalStorage);r&&(t=r)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&Gr()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Qr=null,Xr=function(){if(null!==Qr)return Qr;try{Qr="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(t){Qr=!1}return Qr},Zr={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&Xr()){var r=window.sessionStorage.getItem(e.lookupSessionStorage);r&&(t=r)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&Xr()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},es={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var r=0;r0?t:void 0}},ts={name:"htmlTag",lookup:function(e){var t,r=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return r&&"function"==typeof r.getAttribute&&(t=r.getAttribute("lang")),t}},rs={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof r[e.lookupFromPathIndex])return;t=r[e.lookupFromPathIndex].replace("/","")}else t=r[0].replace("/","")}return t}},ss={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,r="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[t]}},ns=!1;try{document.cookie,ns=!0}catch(as){}var os=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];ns||os.splice(1,1);var is=function(){return e=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)},t=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=function(e){return Vr.call(Hr.call(arguments,1),function(t){if(t)for(var r in t)void 0===e[r]&&(e[r]=t[r])}),e}(t,this.options||{},{order:os,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(e){return e}}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(e){return e.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Jr),this.addDetector(Wr),this.addDetector(Yr),this.addDetector(Zr),this.addDetector(es),this.addDetector(ts),this.addDetector(rs),this.addDetector(ss)}},{key:"addDetector",value:function(e){return this.detectors[e.name]=e,this}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var r=[];return e.forEach(function(e){if(t.detectors[e]){var s=t.detectors[e].lookup(t.options);s&&"string"==typeof s&&(s=[s]),s&&(r=r.concat(s))}}),r=r.map(function(e){return t.options.convertDetectedLanguage(e)}),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var r=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(function(t){r.detectors[t]&&r.detectors[t].cacheUserLanguage(e,r.options)}))}}],t&&function(e,t){for(var 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 diff --git a/frontend/dist/assets/quickSessionCheck-CDz9td7h.js b/frontend/dist/assets/quickSessionCheck-CDz9td7h.js deleted file mode 100644 index 33264879ed..0000000000 --- a/frontend/dist/assets/quickSessionCheck-CDz9td7h.js +++ /dev/null @@ -1 +0,0 @@ -import{s as r}from"./index-qvxZ5pjb.js";import"./data-query-DIoVICGX.js";import"./react-router-qpxRsT6p.js";import"./react-core-B2bfBmQ1.js";import"./data-api-Bj79fh9f.js";import"./ui-icons-kyIJ9IOi.js";import"./ui-utils-CaKPsBzZ.js";const t=()=>{return t=function*(){try{const{data:{session:t}}=yield r.auth.getSession();return!!t}catch(t){return console.error("[quickSessionCheck] Error checking session:",t),!1}},new Promise((r,e)=>{var o=r=>{try{i(t.next(r))}catch(o){e(o)}},s=r=>{try{i(t.throw(r))}catch(o){e(o)}},i=t=>t.done?r(t.value):Promise.resolve(t.value).then(o,s);i((t=t.apply(null,null)).next())});var t};export{t as quickSessionCheck}; diff --git a/frontend/dist/assets/react-core-B2bfBmQ1.js b/frontend/dist/assets/react-core-B2bfBmQ1.js deleted file mode 100644 index 02514f9870..0000000000 --- a/frontend/dist/assets/react-core-B2bfBmQ1.js +++ /dev/null @@ -1 +0,0 @@ -function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,t,r={exports:{}},l={};function a(){if(n)return l;n=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator,m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function v(e,n,t){this.props=e,this.context=n,this.refs=g,this.updater=t||m}function y(){}function b(e,n,t){this.props=e,this.context=n,this.refs=g,this.updater=t||m}v.prototype.isReactComponent={},v.prototype.setState=function(e,n){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var k=b.prototype=new y;k.constructor=b,h(k,v.prototype),k.isPureReactComponent=!0;var w=Array.isArray,S=Object.prototype.hasOwnProperty,x={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function C(n,t,r){var l,a={},u=null,o=null;if(null!=t)for(l in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(u=""+t.key),t)S.call(t,l)&&!E.hasOwnProperty(l)&&(a[l]=t[l]);var i=arguments.length-2;if(1===i)a.children=r;else if(1>>1,a=e[r];if(!(0>>1;rl(i,t))sl(c,i)?(e[r]=c,e[s]=t,r=s):(e[r]=i,e[o]=t,r=o);else{if(!(sl(c,t)))break e;e[r]=c,e[s]=t,r=s}}}return n}function l(e,n){var t=e.sortIndex-n.sortIndex;return 0!==t?t:e.id-n.id}if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var i=[],s=[],c=1,f=null,d=3,p=!1,m=!1,h=!1,g="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var l=t(s);null!==l;){if(null===l.callback)r(s);else{if(!(l.startTime<=e))break;r(s),l.sortIndex=l.expirationTime,n(i,l)}l=t(s)}}function k(e){if(h=!1,b(e),!m)if(null!==t(i))m=!0,R(w);else{var n=t(s);null!==n&&M(k,n.startTime-e)}}function w(n,l){m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=d;try{for(b(l),f=t(i);null!==f&&(!(f.expirationTime>l)||n&&!N());){var u=f.callback;if("function"==typeof u){f.callback=null,d=f.priorityLevel;var o=u(f.expirationTime<=l);l=e.unstable_now(),"function"==typeof o?f.callback=o:f===t(i)&&r(i),b(l)}else r(i);f=t(i)}if(null!==f)var c=!0;else{var g=t(s);null!==g&&M(k,g.startTime-l),c=!1}return c}finally{f=null,d=a,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,x=!1,E=null,C=-1,_=5,P=-1;function N(){return!(e.unstable_now()-P<_)}function z(){if(null!==E){var n=e.unstable_now();P=n;var t=!0;try{t=E(!0,n)}finally{t?S():(x=!1,E=null)}}else x=!1}if("function"==typeof y)S=function(){y(z)};else if("undefined"!=typeof MessageChannel){var T=new MessageChannel,L=T.port2;T.port1.onmessage=z,S=function(){L.postMessage(null)}}else S=function(){g(z,0)};function R(e){E=e,x||(x=!0,S())}function M(n,t){C=g(function(){n(e.unstable_now())},t)}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(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,R(w))},e.unstable_forceFrameRate=function(e){0>e||125u?(r.sortIndex=a,n(s,r),null===t(i)&&r===t(s)&&(h?(v(C),C=-1):h=!0,M(k,a-u))):(r.sortIndex=o,n(i,r),m||p||(m=!0,R(w))),r},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(e){var n=d;return function(){var t=d;d=n;try{return e.apply(this,arguments)}finally{d=t}}}}(m)),m)),p.exports);function t(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t