diff --git a/backend/apps/users/migrations/0004_user_is_email_verified_alter_user_is_approved_and_more.py b/backend/apps/users/migrations/0004_user_is_email_verified_alter_user_is_approved_and_more.py new file mode 100644 index 0000000..506e240 --- /dev/null +++ b/backend/apps/users/migrations/0004_user_is_email_verified_alter_user_is_approved_and_more.py @@ -0,0 +1,36 @@ +# Generated by Django 6.0.7 on 2026-07-31 08:14 + +import django.db.models.deletion +import uuid +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0003_guestclaimtoken'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='is_email_verified', + field=models.BooleanField(default=False, help_text='E-Mail Bestätigungslink angeklickt'), + ), + migrations.AlterField( + model_name='user', + name='is_approved', + field=models.BooleanField(default=False, help_text='Per Admin oder E-Mail-Bestätigung freigeschaltet'), + ), + migrations.CreateModel( + name='EmailVerificationToken', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('token', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)), + ('is_used', models.BooleanField(default=False)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='verification_tokens', to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/backend/apps/users/models.py b/backend/apps/users/models.py index fbddd32..26f5a47 100644 --- a/backend/apps/users/models.py +++ b/backend/apps/users/models.py @@ -8,13 +8,14 @@ class User(AbstractUser): display_name = models.CharField(max_length=150, blank=True, default='') skills = models.ManyToManyField('events.Skill', blank=True, related_name='users') is_admin_user = models.BooleanField(default=False) - is_approved = models.BooleanField(default=True, help_text="Vom Admin freigeschaltet") + is_approved = models.BooleanField(default=False, help_text="Per Admin oder E-Mail-Bestätigung freigeschaltet") + is_email_verified = models.BooleanField(default=False, help_text="E-Mail Bestätigungslink angeklickt") def get_display_name(self): return self.display_name or self.username or self.email def __str__(self): - status_str = " (Ausstehend)" if not self.is_approved else "" + status_str = " (Ausstehend)" if not (self.is_approved or self.is_email_verified) else "" return f"{self.get_display_name()} ({self.email}){status_str}" class RegistrationDomainRule(models.Model): @@ -47,6 +48,15 @@ class RegistrationRestrictionSetting(models.Model): def __str__(self): return f"Domain-Einschränkung: {self.is_restriction_enabled}, Admin-Freischaltung: {self.require_admin_approval}" +class EmailVerificationToken(models.Model): + token = models.UUIDField(default=uuid.uuid4, unique=True, editable=False) + user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='verification_tokens') + is_used = models.BooleanField(default=False) + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"Verification Token for {self.user.username} ({self.token})" + class GuestClaimToken(models.Model): token = models.UUIDField(default=uuid.uuid4, unique=True, editable=False) signup = models.ForeignKey('events.ShiftSignup', on_delete=models.CASCADE, related_name='claim_tokens') diff --git a/backend/apps/users/serializers.py b/backend/apps/users/serializers.py index 9bfc4cc..d399e1b 100644 --- a/backend/apps/users/serializers.py +++ b/backend/apps/users/serializers.py @@ -18,8 +18,8 @@ class UserSerializer(serializers.ModelSerializer): class Meta: model = User - fields = ['id', 'username', 'email', 'display_name', 'is_admin_user', 'is_staff', 'is_superuser', 'is_approved', 'is_active', 'skills', 'skill_ids'] - read_only_fields = ['id', 'is_staff', 'is_superuser', 'is_approved'] + fields = ['id', 'username', 'email', 'display_name', 'is_admin_user', 'is_staff', 'is_superuser', 'is_approved', 'is_email_verified', 'is_active', 'skills', 'skill_ids'] + read_only_fields = ['id', 'is_staff', 'is_superuser', 'is_approved', 'is_email_verified'] class AdminUserSerializer(serializers.ModelSerializer): skills = SkillSimpleSerializer(many=True, read_only=True) @@ -29,7 +29,7 @@ class AdminUserSerializer(serializers.ModelSerializer): class Meta: model = User - fields = ['id', 'username', 'email', 'display_name', 'is_admin_user', 'is_staff', 'is_superuser', 'is_approved', 'is_active', 'skills', 'skill_ids', 'date_joined'] + fields = ['id', 'username', 'email', 'display_name', 'is_admin_user', 'is_staff', 'is_superuser', 'is_approved', 'is_email_verified', 'is_active', 'skills', 'skill_ids', 'date_joined'] read_only_fields = ['id', 'date_joined'] class RegisterSerializer(serializers.ModelSerializer): diff --git a/backend/apps/users/tests.py b/backend/apps/users/tests.py index 2b05e30..a9624d2 100644 --- a/backend/apps/users/tests.py +++ b/backend/apps/users/tests.py @@ -2,7 +2,7 @@ from django.test import TestCase from django.contrib.auth import get_user_model from rest_framework.test import APIClient from rest_framework import status -from .models import RegistrationDomainRule, RegistrationRestrictionSetting +from .models import RegistrationDomainRule, RegistrationRestrictionSetting, EmailVerificationToken from apps.events.models import Event, TaskArea, Shift, ShiftSignup User = get_user_model() @@ -38,7 +38,41 @@ class UserRegistrationTests(TestCase): 'display_name': 'Allowed User' }) self.assertEqual(res_ok.status_code, status.HTTP_201_CREATED) - self.assertIn('token', res_ok.data) + self.assertTrue(res_ok.data.get('requires_verification')) + + def test_email_verification_flow(self): + # Register new user + res_reg = self.client.post('/api/users/register/', { + 'username': 'verify_user', + 'email': 'verify@example.com', + 'password': 'password123', + 'display_name': 'Verify User' + }) + self.assertEqual(res_reg.status_code, status.HTTP_201_CREATED) + self.assertTrue(res_reg.data.get('requires_verification')) + v_token_str = res_reg.data.get('verification_token') + + # Login should be blocked prior to verification or admin approval + res_login_blocked = self.client.post('/api/users/login/', { + 'username': 'verify_user', + 'password': 'password123' + }) + self.assertEqual(res_login_blocked.status_code, status.HTTP_403_FORBIDDEN) + + # Verify email using verification token + res_verify = self.client.post('/api/users/verify-email/', { + 'token': v_token_str + }) + self.assertEqual(res_verify.status_code, status.HTTP_200_OK) + self.assertIn('token', res_verify.data) + + # Login should now succeed + res_login_ok = self.client.post('/api/users/login/', { + 'username': 'verify_user', + 'password': 'password123' + }) + self.assertEqual(res_login_ok.status_code, status.HTTP_200_OK) + self.assertIn('token', res_login_ok.data) def test_guest_shift_claiming_on_registration(self): # Create event, task area, shift @@ -73,11 +107,6 @@ class UserRegistrationTests(TestCase): self.assertIsNone(signup.guest_name) def test_admin_approval_workflow(self): - # Enable admin approval requirement - setting = RegistrationRestrictionSetting.get_solo() - setting.require_admin_approval = True - setting.save() - # Register user res_reg = self.client.post('/api/users/register/', { 'username': 'pending_user', @@ -86,8 +115,6 @@ class UserRegistrationTests(TestCase): 'display_name': 'Pending User' }) self.assertEqual(res_reg.status_code, status.HTTP_201_CREATED) - self.assertTrue(res_reg.data.get('requires_approval')) - self.assertNotIn('token', res_reg.data) # Attempt login before approval (should be blocked) res_login_fail = self.client.post('/api/users/login/', { diff --git a/backend/apps/users/urls.py b/backend/apps/users/urls.py index deee005..17ceaba 100644 --- a/backend/apps/users/urls.py +++ b/backend/apps/users/urls.py @@ -1,7 +1,7 @@ from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import ( - RegisterView, LoginView, MeView, + RegisterView, VerifyEmailView, LoginView, MeView, RegistrationDomainRuleViewSet, RegistrationRestrictionSettingView, PendingUsersView, ApproveUserView, AdminUserViewSet, GenerateClaimLinkView, ClaimInfoView @@ -13,6 +13,7 @@ router.register('manage-users', AdminUserViewSet, basename='admin-user') urlpatterns = [ path('register/', RegisterView.as_view(), name='register'), + path('verify-email/', VerifyEmailView.as_view(), name='verify-email'), path('login/', LoginView.as_view(), name='login'), path('me/', MeView.as_view(), name='me'), path('restriction-setting/', RegistrationRestrictionSettingView.as_view(), name='restriction-setting'), diff --git a/backend/apps/users/views.py b/backend/apps/users/views.py index e1d91c8..7eb811e 100644 --- a/backend/apps/users/views.py +++ b/backend/apps/users/views.py @@ -3,7 +3,7 @@ from rest_framework.response import Response from rest_framework.authtoken.models import Token from django.contrib.auth import authenticate, get_user_model from django.shortcuts import get_object_or_404 -from .models import RegistrationDomainRule, RegistrationRestrictionSetting, GuestClaimToken +from .models import RegistrationDomainRule, RegistrationRestrictionSetting, GuestClaimToken, EmailVerificationToken from .serializers import ( UserSerializer, AdminUserSerializer, RegisterSerializer, RegistrationDomainRuleSerializer, RegistrationRestrictionSettingSerializer @@ -24,6 +24,11 @@ class RegisterView(views.APIView): serializer = RegisterSerializer(data=request.data) if serializer.is_valid(): user = serializer.save() + user.is_approved = False + user.is_email_verified = False + user.is_active = True + user.save() + setting = RegistrationRestrictionSetting.get_solo() claim_token_str = request.data.get('claim_token') @@ -65,27 +70,48 @@ class RegisterView(views.APIView): signup.save() assigned_count += 1 - if setting.require_admin_approval: - user.is_approved = False - user.is_active = False - user.save() - return Response({ - 'requires_approval': True, - 'claimed_shifts_count': assigned_count, - 'message': 'Konto erfolgreich registriert! Ein Administrator muss dein Konto vor der ersten Anmeldung freischalten.' - }, status=status.HTTP_201_CREATED) + v_token = EmailVerificationToken.objects.create(user=user) + print("==================================================") + print(f"[E-MAIL BESTÄTIGUNG]: http://localhost:3000/?verify_email={v_token.token}") + print("==================================================") - token, _ = Token.objects.get_or_create(user=user) - user_data = UserSerializer(user).data return Response({ - 'token': token.key, - 'user': user_data, + 'requires_verification': True, + 'verification_token': str(v_token.token), 'claimed_shifts_count': assigned_count, - 'message': f'Konto erfolgreich erstellt! {assigned_count} Gast-Schichten wurden deinem Konto zugewiesen.' if assigned_count > 0 else 'Konto erfolgreich erstellt!' + 'message': 'Konto erfolgreich erstellt! Bitte bestätige deine E-Mail-Adresse über den Link in der Bestätigungs-E-Mail oder warte auf die Admin-Freischaltung.' }, status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) +class VerifyEmailView(views.APIView): + permission_classes = [permissions.AllowAny] + + def post(self, request): + token_str = request.data.get('token') + if not token_str: + return Response({'error': 'Token erforderlich.'}, status=status.HTTP_400_BAD_REQUEST) + + v_token = EmailVerificationToken.objects.filter(token=token_str, is_used=False).first() + if not v_token: + return Response({'error': 'Ungültiger oder bereits verwendeter Bestätigungslink.'}, status=status.HTTP_400_BAD_REQUEST) + + v_token.is_used = True + v_token.save() + + user = v_token.user + user.is_email_verified = True + user.is_approved = True + user.is_active = True + user.save() + + token, _ = Token.objects.get_or_create(user=user) + return Response({ + 'token': token.key, + 'user': UserSerializer(user).data, + 'message': f'E-Mail-Adresse für {user.get_display_name()} wurde erfolgreich bestätigt! Du bist jetzt angemeldet.' + }, status=status.HTTP_200_OK) + class GenerateClaimLinkView(views.APIView): permission_classes = [permissions.IsAuthenticated] @@ -147,9 +173,9 @@ class LoginView(views.APIView): pass if user_obj: - if not user_obj.is_approved or not user_obj.is_active: + if not (user_obj.is_approved or user_obj.is_email_verified or user_obj.is_superuser or user_obj.is_admin_user): return Response({ - 'error': 'Dein Konto wurde noch nicht von einem Administrator freigeschaltet. Bitte gedulde dich.' + 'error': 'Anmeldung nicht möglich: Deine E-Mail-Adresse wurde noch nicht bestätigt und dein Konto wurde noch nicht vom Admin freigeschaltet.' }, status=status.HTTP_403_FORBIDDEN) user = authenticate(username=username, password=password) @@ -211,7 +237,7 @@ class PendingUsersView(views.APIView): permission_classes = [permissions.IsAdminUser] def get(self, request): - pending_users = User.objects.filter(is_approved=False).order_by('-date_joined') + pending_users = User.objects.filter(is_approved=False, is_email_verified=False, is_superuser=False).order_by('-date_joined') return Response(UserSerializer(pending_users, many=True).data) class ApproveUserView(views.APIView): diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index f8a0a3b..0913c03 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -3,18 +3,17 @@ version: '3.8' services: db: image: postgres:16-alpine - container_name: shiftplan_db_dev environment: - POSTGRES_DB: shiftplan_db_dev - POSTGRES_USER: shiftplan_user - POSTGRES_PASSWORD: shiftplan_dev_password_123 + POSTGRES_DB: ${POSTGRES_DB:-shiftplan_db_dev} + POSTGRES_USER: ${POSTGRES_USER:-shiftplan_user} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-shiftplan_dev_password_123} volumes: - postgres_dev_data:/var/lib/postgresql/data ports: - "5432:5432" restart: unless-stopped healthcheck: - test: ["CMD-SHELL", "pg_isready -U shiftplan_user -d shiftplan_db_dev"] + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-shiftplan_user} -d ${POSTGRES_DB:-shiftplan_db_dev}"] interval: 5s timeout: 5s retries: 5 @@ -23,19 +22,18 @@ services: build: context: ./backend dockerfile: Dockerfile - container_name: shiftplan_backend_dev command: > sh -c "python manage.py makemigrations --noinput && python manage.py migrate --noinput && python manage.py seed_data && python manage.py runserver 0.0.0.0:8000" environment: - SECRET_KEY: "dev-secret-key-shiftplan" + SECRET_KEY: ${SECRET_KEY:-dev-secret-key-shiftplan} DEBUG: "True" ALLOWED_HOSTS: "*" - POSTGRES_DB: shiftplan_db_dev - POSTGRES_USER: shiftplan_user - POSTGRES_PASSWORD: shiftplan_dev_password_123 + POSTGRES_DB: ${POSTGRES_DB:-shiftplan_db_dev} + POSTGRES_USER: ${POSTGRES_USER:-shiftplan_user} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-shiftplan_dev_password_123} POSTGRES_HOST: db POSTGRES_PORT: "5432" volumes: @@ -49,7 +47,6 @@ services: frontend: image: node:20-alpine - container_name: shiftplan_frontend_dev working_dir: /app command: sh -c "npm install && npm run dev -- --host 0.0.0.0 --port 3000" volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 204b316..0a5c412 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,23 @@ version: '3.8' +# Coolify & Production Ready Docker Compose Configuration +# Traefik in Coolify automatically routes traffic to the 'frontend' service on port 80. +# Container names and port bindings are intentionally managed by Coolify to avoid collisions. + services: db: image: postgres:16-alpine - container_name: shiftplan_db environment: - POSTGRES_DB: shiftplan_db - POSTGRES_USER: shiftplan_user - POSTGRES_PASSWORD: shiftplan_secure_password_123 + POSTGRES_DB: ${POSTGRES_DB:-shiftplan_db} + POSTGRES_USER: ${POSTGRES_USER:-shiftplan_user} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-shiftplan_secure_password_123} volumes: - postgres_data:/var/lib/postgresql/data - ports: - - "5432:5432" + expose: + - "5432" restart: unless-stopped healthcheck: - test: ["CMD-SHELL", "pg_isready -U shiftplan_user -d shiftplan_db"] + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-shiftplan_user} -d ${POSTGRES_DB:-shiftplan_db}"] interval: 5s timeout: 5s retries: 5 @@ -23,35 +26,35 @@ services: build: context: ./backend dockerfile: Dockerfile - container_name: shiftplan_backend command: > sh -c "python manage.py makemigrations --noinput && python manage.py migrate --noinput && python manage.py seed_data && gunicorn --bind 0.0.0.0:8000 --workers 3 shiftplan_backend.wsgi:application" environment: - SECRET_KEY: "prod-secret-key-change-in-env" - DEBUG: "False" - ALLOWED_HOSTS: "*" - POSTGRES_DB: shiftplan_db - POSTGRES_USER: shiftplan_user - POSTGRES_PASSWORD: shiftplan_secure_password_123 + SECRET_KEY: ${SECRET_KEY:-prod-secret-key-change-in-coolify} + DEBUG: ${DEBUG:-False} + ALLOWED_HOSTS: ${ALLOWED_HOSTS:-*} + POSTGRES_DB: ${POSTGRES_DB:-shiftplan_db} + POSTGRES_USER: ${POSTGRES_USER:-shiftplan_user} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-shiftplan_secure_password_123} POSTGRES_HOST: db POSTGRES_PORT: "5432" depends_on: db: condition: service_healthy - ports: - - "8000:8000" + expose: + - "8000" restart: unless-stopped frontend: build: context: ./frontend dockerfile: Dockerfile - container_name: shiftplan_frontend + expose: + - "80" ports: - - "80:80" + - "${PORT:-80}:80" depends_on: - backend restart: unless-stopped diff --git a/frontend/dist/assets/index-BHd9ZwUB.js b/frontend/dist/assets/index-BHd9ZwUB.js new file mode 100644 index 0000000..b5f1a6e --- /dev/null +++ b/frontend/dist/assets/index-BHd9ZwUB.js @@ -0,0 +1,267 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function dd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pa={exports:{}},Ll={},La={exports:{}},B={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var kr=Symbol.for("react.element"),fd=Symbol.for("react.portal"),md=Symbol.for("react.fragment"),pd=Symbol.for("react.strict_mode"),hd=Symbol.for("react.profiler"),xd=Symbol.for("react.provider"),gd=Symbol.for("react.context"),yd=Symbol.for("react.forward_ref"),vd=Symbol.for("react.suspense"),wd=Symbol.for("react.memo"),kd=Symbol.for("react.lazy"),yo=Symbol.iterator;function Nd(e){return e===null||typeof e!="object"?null:(e=yo&&e[yo]||e["@@iterator"],typeof e=="function"?e:null)}var za={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ma=Object.assign,Aa={};function Ln(e,t,n){this.props=e,this.context=t,this.refs=Aa,this.updater=n||za}Ln.prototype.isReactComponent={};Ln.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)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,t,"setState")};Ln.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Da(){}Da.prototype=Ln.prototype;function Ni(e,t,n){this.props=e,this.context=t,this.refs=Aa,this.updater=n||za}var Si=Ni.prototype=new Da;Si.constructor=Ni;Ma(Si,Ln.prototype);Si.isPureReactComponent=!0;var vo=Array.isArray,Ra=Object.prototype.hasOwnProperty,ji={current:null},Oa={key:!0,ref:!0,__self:!0,__source:!0};function Ia(e,t,n){var r,l={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Ra.call(t,r)&&!Oa.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,se=T[q];if(0>>1;ql(ye,L))mel(ot,ye)?(T[q]=ot,T[me]=L,q=me):(T[q]=ye,T[ge]=L,q=ge);else if(mel(ot,L))T[q]=ot,T[me]=L,q=me;else break e}}return O}function l(T,O){var L=T.sortIndex-O.sortIndex;return L!==0?L:T.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],d=[],h=1,g=null,x=3,k=!1,y=!1,v=!1,R=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(T){for(var O=n(d);O!==null;){if(O.callback===null)r(d);else if(O.startTime<=T)r(d),O.sortIndex=O.expirationTime,t(u,O);else break;O=n(d)}}function w(T){if(v=!1,m(T),!y)if(n(u)!==null)y=!0,H(S);else{var O=n(d);O!==null&&Se(w,O.startTime-T)}}function S(T,O){y=!1,v&&(v=!1,f(E),E=-1),k=!0;var L=x;try{for(m(O),g=n(u);g!==null&&(!(g.expirationTime>O)||T&&!ee());){var q=g.callback;if(typeof q=="function"){g.callback=null,x=g.priorityLevel;var se=q(g.expirationTime<=O);O=e.unstable_now(),typeof se=="function"?g.callback=se:g===n(u)&&r(u),m(O)}else r(u);g=n(u)}if(g!==null)var et=!0;else{var ge=n(d);ge!==null&&Se(w,ge.startTime-O),et=!1}return et}finally{g=null,x=L,k=!1}}var b=!1,N=null,E=-1,U=5,M=-1;function ee(){return!(e.unstable_now()-MT||125q?(T.sortIndex=L,t(d,T),n(u)===null&&T===n(d)&&(v?(f(E),E=-1):v=!0,Se(w,L-q))):(T.sortIndex=se,t(u,T),y||k||(y=!0,H(S))),T},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(T){var O=x;return function(){var L=x;x=O;try{return T.apply(this,arguments)}finally{x=L}}}})(Ba);Ua.exports=Ba;var Ad=Ua.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Dd=j,Oe=Ad;function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=Object.prototype.hasOwnProperty,Rd=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ko={},No={};function Od(e){return Cs.call(No,e)?!0:Cs.call(ko,e)?!1:Rd.test(e)?No[e]=!0:(ko[e]=!0,!1)}function Id(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $d(e,t,n,r){if(t===null||typeof t>"u"||Id(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ce(e,t,n,r,l,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var xe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xe[e]=new Ce(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xe[t]=new Ce(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xe[e]=new Ce(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xe[e]=new Ce(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){xe[e]=new Ce(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xe[e]=new Ce(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xe[e]=new Ce(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xe[e]=new Ce(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xe[e]=new Ce(e,5,!1,e.toLowerCase(),null,!1,!1)});var bi=/[\-:]([a-z])/g;function Ei(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(bi,Ei);xe[t]=new Ce(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(bi,Ei);xe[t]=new Ce(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(bi,Ei);xe[t]=new Ce(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xe[e]=new Ce(e,1,!1,e.toLowerCase(),null,!1,!1)});xe.xlinkHref=new Ce("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xe[e]=new Ce(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ci(e,t,n,r){var l=xe.hasOwnProperty(t)?xe[t]:null;(l!==null?l.type!==0:r||!(2a||l[o]!==s[a]){var u=` +`+l[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{rs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Un(e):""}function Fd(e){switch(e.tag){case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return Un("Suspense");case 19:return Un("SuspenseList");case 0:case 2:case 15:return e=ls(e.type,!1),e;case 11:return e=ls(e.type.render,!1),e;case 1:return e=ls(e.type,!0),e;default:return""}}function zs(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case on:return"Fragment";case sn:return"Portal";case Ts:return"Profiler";case Ti:return"StrictMode";case Ps:return"Suspense";case Ls:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ka:return(e.displayName||"Context")+".Consumer";case Qa:return(e._context.displayName||"Context")+".Provider";case Pi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Li:return t=e.displayName||null,t!==null?t:zs(e.type)||"Memo";case wt:t=e._payload,e=e._init;try{return zs(e(t))}catch{}}return null}function Vd(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zs(t);case 8:return t===Ti?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function At(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ga(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ud(e){var t=Ga(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zr(e){e._valueTracker||(e._valueTracker=Ud(e))}function Ya(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ga(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function il(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ms(e,t){var n=t.checked;return le({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=At(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qa(e,t){t=t.checked,t!=null&&Ci(e,"checked",t,!1)}function As(e,t){qa(e,t);var n=At(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ds(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ds(e,t.type,At(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _o(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ds(e,t,n){(t!=="number"||il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bn=Array.isArray;function yn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Mr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Bd=["Webkit","ms","Moz","O"];Object.keys(Kn).forEach(function(e){Bd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kn[t]=Kn[e]})});function eu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Kn.hasOwnProperty(e)&&Kn[e]?(""+t).trim():t+"px"}function tu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=eu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Hd=le({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Is(e,t){if(t){if(Hd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function $s(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fs=null;function zi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vs=null,vn=null,wn=null;function Co(e){if(e=jr(e)){if(typeof Vs!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Rl(t),Vs(e.stateNode,e.type,t))}}function nu(e){vn?wn?wn.push(e):wn=[e]:vn=e}function ru(){if(vn){var e=vn,t=wn;if(wn=vn=null,Co(e),t)for(e=0;e>>=0,e===0?32:31-(tf(e)/nf|0)|0}var Ar=64,Dr=4194304;function Hn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function cl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=Hn(a):(s&=o,s!==0&&(r=Hn(s)))}else o=n&~l,o!==0?r=Hn(o):s!==0&&(r=Hn(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Nr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ze(t),e[t]=n}function of(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Gn),Oo=" ",Io=!1;function Su(e,t){switch(e){case"keyup":return Df.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ju(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var an=!1;function Of(e,t){switch(e){case"compositionend":return ju(t);case"keypress":return t.which!==32?null:(Io=!0,Oo);case"textInput":return e=t.data,e===Oo&&Io?null:e;default:return null}}function If(e,t){if(an)return e==="compositionend"||!Fi&&Su(e,t)?(e=ku(),qr=Oi=jt=null,an=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Uo(n)}}function Cu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tu(){for(var e=window,t=il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=il(e.document)}return t}function Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Wf(e){var t=Tu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cu(n.ownerDocument.documentElement,n)){if(r!==null&&Vi(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=Bo(n,s);var o=Bo(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,un=null,Ws=null,qn=null,Gs=!1;function Ho(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gs||un==null||un!==il(r)||(r=un,"selectionStart"in r&&Vi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qn&&ur(qn,r)||(qn=r,r=ml(Ws,"onSelect"),0fn||(e.current=ei[fn],ei[fn]=null,fn--)}function Z(e,t){fn++,ei[fn]=e.current,e.current=t}var Dt={},Ne=Ot(Dt),Le=Ot(!1),Yt=Dt;function _n(e,t){var n=e.type.contextTypes;if(!n)return Dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ze(e){return e=e.childContextTypes,e!=null}function hl(){X(Le),X(Ne)}function Zo(e,t,n){if(Ne.current!==Dt)throw Error(_(168));Z(Ne,t),Z(Le,n)}function Iu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(_(108,Vd(e)||"Unknown",l));return le({},n,r)}function xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Dt,Yt=Ne.current,Z(Ne,e),Z(Le,Le.current),!0}function Jo(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Iu(e,t,Yt),r.__reactInternalMemoizedMergedChildContext=e,X(Le),X(Ne),Z(Ne,e)):X(Le),Z(Le,n)}var ut=null,Ol=!1,ys=!1;function $u(e){ut===null?ut=[e]:ut.push(e)}function sm(e){Ol=!0,$u(e)}function It(){if(!ys&&ut!==null){ys=!0;var e=0,t=G;try{var n=ut;for(G=1;e>=o,l-=o,ct=1<<32-Ze(t)+l|n<E?(U=N,N=null):U=N.sibling;var M=x(f,N,m[E],w);if(M===null){N===null&&(N=U);break}e&&N&&M.alternate===null&&t(f,N),c=s(M,c,E),b===null?S=M:b.sibling=M,b=M,N=U}if(E===m.length)return n(f,N),te&&Vt(f,E),S;if(N===null){for(;EE?(U=N,N=null):U=N.sibling;var ee=x(f,N,M.value,w);if(ee===null){N===null&&(N=U);break}e&&N&&ee.alternate===null&&t(f,N),c=s(ee,c,E),b===null?S=ee:b.sibling=ee,b=ee,N=U}if(M.done)return n(f,N),te&&Vt(f,E),S;if(N===null){for(;!M.done;E++,M=m.next())M=g(f,M.value,w),M!==null&&(c=s(M,c,E),b===null?S=M:b.sibling=M,b=M);return te&&Vt(f,E),S}for(N=r(f,N);!M.done;E++,M=m.next())M=k(N,f,E,M.value,w),M!==null&&(e&&M.alternate!==null&&N.delete(M.key===null?E:M.key),c=s(M,c,E),b===null?S=M:b.sibling=M,b=M);return e&&N.forEach(function(D){return t(f,D)}),te&&Vt(f,E),S}function R(f,c,m,w){if(typeof m=="object"&&m!==null&&m.type===on&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Lr:e:{for(var S=m.key,b=c;b!==null;){if(b.key===S){if(S=m.type,S===on){if(b.tag===7){n(f,b.sibling),c=l(b,m.props.children),c.return=f,f=c;break e}}else if(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wt&&ta(S)===b.type){n(f,b.sibling),c=l(b,m.props),c.ref=$n(f,b,m),c.return=f,f=c;break e}n(f,b);break}else t(f,b);b=b.sibling}m.type===on?(c=Gt(m.props.children,f.mode,w,m.key),c.return=f,f=c):(w=ll(m.type,m.key,m.props,null,f.mode,w),w.ref=$n(f,c,m),w.return=f,f=w)}return o(f);case sn:e:{for(b=m.key;c!==null;){if(c.key===b)if(c.tag===4&&c.stateNode.containerInfo===m.containerInfo&&c.stateNode.implementation===m.implementation){n(f,c.sibling),c=l(c,m.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=bs(m,f.mode,w),c.return=f,f=c}return o(f);case wt:return b=m._init,R(f,c,b(m._payload),w)}if(Bn(m))return y(f,c,m,w);if(An(m))return v(f,c,m,w);Ur(f,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,m),c.return=f,f=c):(n(f,c),c=_s(m,f.mode,w),c.return=f,f=c),o(f)):n(f,c)}return R}var En=Bu(!0),Hu=Bu(!1),vl=Ot(null),wl=null,hn=null,Qi=null;function Ki(){Qi=hn=wl=null}function Wi(e){var t=vl.current;X(vl),e._currentValue=t}function ri(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nn(e,t){wl=e,Qi=hn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pe=!0),e.firstContext=null)}function Qe(e){var t=e._currentValue;if(Qi!==e)if(e={context:e,memoizedValue:t,next:null},hn===null){if(wl===null)throw Error(_(308));hn=e,wl.dependencies={lanes:0,firstContext:e}}else hn=hn.next=e;return t}var Qt=null;function Gi(e){Qt===null?Qt=[e]:Qt.push(e)}function Qu(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Gi(t)):(n.next=l.next,l.next=n),t.interleaved=n,ht(e,r)}function ht(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var kt=!1;function Yi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ku(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Q&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,ht(e,n)}return l=r.interleaved,l===null?(t.next=t,Gi(r)):(t.next=l.next,l.next=t),r.interleaved=t,ht(e,n)}function Jr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ai(e,n)}}function na(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function kl(e,t,n,r){var l=e.updateQueue;kt=!1;var s=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,d=u.next;u.next=null,o===null?s=d:o.next=d,o=u;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=d:a.next=d,h.lastBaseUpdate=u))}if(s!==null){var g=l.baseState;o=0,h=d=u=null,a=s;do{var x=a.lane,k=a.eventTime;if((r&x)===x){h!==null&&(h=h.next={eventTime:k,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,v=a;switch(x=t,k=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){g=y.call(k,g,x);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,x=typeof y=="function"?y.call(k,g,x):y,x==null)break e;g=le({},g,x);break e;case 2:kt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,x=l.effects,x===null?l.effects=[a]:x.push(a))}else k={eventTime:k,lane:x,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(d=h=k,u=g):h=h.next=k,o|=x;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;x=a,a=x.next,x.next=null,l.lastBaseUpdate=x,l.shared.pending=null}}while(!0);if(h===null&&(u=g),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);Jt|=o,e.lanes=o,e.memoizedState=g}}function ra(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ws.transition;ws.transition={};try{e(!1),t()}finally{G=n,ws.transition=r}}function uc(){return Ke().memoizedState}function um(e,t,n){var r=zt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e))dc(t,n);else if(n=Qu(e,t,n,r),n!==null){var l=be();Je(n,e,r,l),fc(n,t,r)}}function cm(e,t,n){var r=zt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))dc(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(l.hasEagerState=!0,l.eagerState=a,Xe(a,o)){var u=t.interleaved;u===null?(l.next=l,Gi(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Qu(e,t,l,r),n!==null&&(l=be(),Je(n,e,r,l),fc(n,t,r))}}function cc(e){var t=e.alternate;return e===re||t!==null&&t===re}function dc(e,t){Zn=Sl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ai(e,n)}}var jl={readContext:Qe,useCallback:ve,useContext:ve,useEffect:ve,useImperativeHandle:ve,useInsertionEffect:ve,useLayoutEffect:ve,useMemo:ve,useReducer:ve,useRef:ve,useState:ve,useDebugValue:ve,useDeferredValue:ve,useTransition:ve,useMutableSource:ve,useSyncExternalStore:ve,useId:ve,unstable_isNewReconciler:!1},dm={readContext:Qe,useCallback:function(e,t){return rt().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:sa,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,el(4194308,4,lc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return el(4194308,4,e,t)},useInsertionEffect:function(e,t){return el(4,2,e,t)},useMemo:function(e,t){var n=rt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=rt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=um.bind(null,re,e),[r.memoizedState,e]},useRef:function(e){var t=rt();return e={current:e},t.memoizedState=e},useState:la,useDebugValue:ro,useDeferredValue:function(e){return rt().memoizedState=e},useTransition:function(){var e=la(!1),t=e[0];return e=am.bind(null,e[1]),rt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=re,l=rt();if(te){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),fe===null)throw Error(_(349));Zt&30||qu(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,sa(Ju.bind(null,r,s,e),[e]),r.flags|=2048,gr(9,Zu.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=rt(),t=fe.identifierPrefix;if(te){var n=dt,r=ct;n=(r&~(1<<32-Ze(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=hr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[lt]=t,e[fr]=r,Nc(e,t,!1,!1),t.stateNode=e;e:{switch(o=$s(n,r),n){case"dialog":J("cancel",e),J("close",e),l=r;break;case"iframe":case"object":case"embed":J("load",e),l=r;break;case"video":case"audio":for(l=0;lPn&&(t.flags|=128,r=!0,Fn(s,!1),t.lanes=4194304)}else{if(!r)if(e=Nl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!te)return we(t),null}else 2*oe()-s.renderingStartTime>Pn&&n!==1073741824&&(t.flags|=128,r=!0,Fn(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=oe(),t.sibling=null,n=ne.current,Z(ne,r?n&1|2:n&1),t):(we(t),null);case 22:case 23:return uo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ae&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function vm(e,t){switch(Bi(t),t.tag){case 1:return ze(t.type)&&hl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(),X(Le),X(Ne),Ji(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zi(t),null;case 13:if(X(ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));bn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(ne),null;case 4:return Cn(),null;case 10:return Wi(t.type._context),null;case 22:case 23:return uo(),null;case 24:return null;default:return null}}var Hr=!1,ke=!1,wm=typeof WeakSet=="function"?WeakSet:Set,P=null;function xn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ie(e,t,r)}else n.current=null}function fi(e,t,n){try{n()}catch(r){ie(e,t,r)}}var xa=!1;function km(e,t){if(Ys=dl,e=Tu(),Vi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,d=0,h=0,g=e,x=null;t:for(;;){for(var k;g!==n||l!==0&&g.nodeType!==3||(a=o+l),g!==s||r!==0&&g.nodeType!==3||(u=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(k=g.firstChild)!==null;)x=g,g=k;for(;;){if(g===e)break t;if(x===n&&++d===l&&(a=o),x===s&&++h===r&&(u=o),(k=g.nextSibling)!==null)break;g=x,x=g.parentNode}g=k}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(qs={focusedElem:e,selectionRange:n},dl=!1,P=t;P!==null;)if(t=P,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,P=e;else for(;P!==null;){t=P;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,R=y.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ge(t.type,v),R);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(w){ie(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,P=e;break}P=t.return}return y=xa,xa=!1,y}function Jn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&fi(t,n,s)}l=l.next}while(l!==r)}}function Fl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function mi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _c(e){var t=e.alternate;t!==null&&(e.alternate=null,_c(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lt],delete t[fr],delete t[Xs],delete t[rm],delete t[lm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function ga(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pl));else if(r!==4&&(e=e.child,e!==null))for(pi(e,t,n),e=e.sibling;e!==null;)pi(e,t,n),e=e.sibling}function hi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hi(e,t,n),e=e.sibling;e!==null;)hi(e,t,n),e=e.sibling}var pe=null,Ye=!1;function vt(e,t,n){for(n=n.child;n!==null;)Ec(e,t,n),n=n.sibling}function Ec(e,t,n){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(zl,n)}catch{}switch(n.tag){case 5:ke||xn(n,t);case 6:var r=pe,l=Ye;pe=null,vt(e,t,n),pe=r,Ye=l,pe!==null&&(Ye?(e=pe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pe.removeChild(n.stateNode));break;case 18:pe!==null&&(Ye?(e=pe,n=n.stateNode,e.nodeType===8?gs(e.parentNode,n):e.nodeType===1&&gs(e,n),or(e)):gs(pe,n.stateNode));break;case 4:r=pe,l=Ye,pe=n.stateNode.containerInfo,Ye=!0,vt(e,t,n),pe=r,Ye=l;break;case 0:case 11:case 14:case 15:if(!ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&fi(n,t,o),l=l.next}while(l!==r)}vt(e,t,n);break;case 1:if(!ke&&(xn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ie(n,t,a)}vt(e,t,n);break;case 21:vt(e,t,n);break;case 22:n.mode&1?(ke=(r=ke)||n.memoizedState!==null,vt(e,t,n),ke=r):vt(e,t,n);break;default:vt(e,t,n)}}function ya(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new wm),t.forEach(function(r){var l=Pm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function We(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~s}if(r=l,r=oe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sm(r/1960))-r,10e?16:e,_t===null)var r=!1;else{if(e=_t,_t=null,El=0,Q&6)throw Error(_(331));var l=Q;for(Q|=4,P=e.current;P!==null;){var s=P,o=s.child;if(P.flags&16){var a=s.deletions;if(a!==null){for(var u=0;uoe()-oo?Wt(e,0):io|=n),Me(e,t)}function Dc(e,t){t===0&&(e.mode&1?(t=Dr,Dr<<=1,!(Dr&130023424)&&(Dr=4194304)):t=1);var n=be();e=ht(e,t),e!==null&&(Nr(e,t,n),Me(e,n))}function Tm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dc(e,n)}function Pm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Dc(e,n)}var Rc;Rc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Le.current)Pe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Pe=!1,gm(e,t,n);Pe=!!(e.flags&131072)}else Pe=!1,te&&t.flags&1048576&&Fu(t,yl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;tl(e,t),e=t.pendingProps;var l=_n(t,Ne.current);Nn(t,n),l=eo(null,t,r,e,l,n);var s=to();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ze(r)?(s=!0,xl(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Yi(t),l.updater=$l,t.stateNode=l,l._reactInternals=t,si(t,r,e,n),t=ai(null,t,r,!0,s,n)):(t.tag=0,te&&s&&Ui(t),_e(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(tl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=zm(r),e=Ge(r,e),l){case 0:t=oi(null,t,r,e,n);break e;case 1:t=ma(null,t,r,e,n);break e;case 11:t=da(null,t,r,e,n);break e;case 14:t=fa(null,t,r,Ge(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ge(r,l),oi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ge(r,l),ma(e,t,r,l,n);case 3:e:{if(vc(t),e===null)throw Error(_(387));r=t.pendingProps,s=t.memoizedState,l=s.element,Ku(e,t),kl(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=Tn(Error(_(423)),t),t=pa(e,t,r,n,l);break e}else if(r!==l){l=Tn(Error(_(424)),t),t=pa(e,t,r,n,l);break e}else for(De=Tt(t.stateNode.containerInfo.firstChild),Re=t,te=!0,qe=null,n=Hu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bn(),r===l){t=xt(e,t,n);break e}_e(e,t,r,n)}t=t.child}return t;case 5:return Wu(t),e===null&&ni(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,o=l.children,Zs(r,l)?o=null:s!==null&&Zs(r,s)&&(t.flags|=32),yc(e,t),_e(e,t,o,n),t.child;case 6:return e===null&&ni(t),null;case 13:return wc(e,t,n);case 4:return qi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=En(t,null,r,n):_e(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ge(r,l),da(e,t,r,l,n);case 7:return _e(e,t,t.pendingProps,n),t.child;case 8:return _e(e,t,t.pendingProps.children,n),t.child;case 12:return _e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,o=l.value,Z(vl,r._currentValue),r._currentValue=o,s!==null)if(Xe(s.value,o)){if(s.children===l.children&&!Le.current){t=xt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=ft(-1,n&-n),u.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?u.next=u:(u.next=h.next,h.next=u),d.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),ri(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(_(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ri(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}_e(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Nn(t,n),l=Qe(l),r=r(l),t.flags|=1,_e(e,t,r,n),t.child;case 14:return r=t.type,l=Ge(r,t.pendingProps),l=Ge(r.type,l),fa(e,t,r,l,n);case 15:return xc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ge(r,l),tl(e,t),t.tag=1,ze(r)?(e=!0,xl(t)):e=!1,Nn(t,n),mc(t,r,l),si(t,r,l,n),ai(null,t,r,!0,e,n);case 19:return kc(e,t,n);case 22:return gc(e,t,n)}throw Error(_(156,t.tag))};function Oc(e,t){return cu(e,t)}function Lm(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Be(e,t,n,r){return new Lm(e,t,n,r)}function fo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zm(e){if(typeof e=="function")return fo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pi)return 11;if(e===Li)return 14}return 2}function Mt(e,t){var n=e.alternate;return n===null?(n=Be(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ll(e,t,n,r,l,s){var o=2;if(r=e,typeof e=="function")fo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case on:return Gt(n.children,l,s,t);case Ti:o=8,l|=8;break;case Ts:return e=Be(12,n,t,l|2),e.elementType=Ts,e.lanes=s,e;case Ps:return e=Be(13,n,t,l),e.elementType=Ps,e.lanes=s,e;case Ls:return e=Be(19,n,t,l),e.elementType=Ls,e.lanes=s,e;case Wa:return Ul(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qa:o=10;break e;case Ka:o=9;break e;case Pi:o=11;break e;case Li:o=14;break e;case wt:o=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=Be(o,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Gt(e,t,n,r){return e=Be(7,e,r,t),e.lanes=n,e}function Ul(e,t,n,r){return e=Be(22,e,r,t),e.elementType=Wa,e.lanes=n,e.stateNode={isHidden:!1},e}function _s(e,t,n){return e=Be(6,e,null,t),e.lanes=n,e}function bs(e,t,n){return t=Be(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mm(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=is(0),this.expirationTimes=is(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=is(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function mo(e,t,n,r,l,s,o,a,u){return e=new Mm(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Be(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yi(s),e}function Am(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vc)}catch(e){console.error(e)}}Vc(),Va.exports=Ie;var $m=Va.exports,ba=$m;Es.createRoot=ba.createRoot,Es.hydrateRoot=ba.hydrateRoot;/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Uc=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Vm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Um=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:s,iconNode:o,...a},u)=>j.createElement("svg",{ref:u,...Vm,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Uc("lucide",l),...a},[...o.map(([d,h])=>j.createElement(d,h)),...Array.isArray(s)?s:[s]]));/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F=(e,t)=>{const n=j.forwardRef(({className:r,...l},s)=>j.createElement(Um,{ref:s,iconNode:t,className:Uc(`lucide-${Fm(e)}`,r),...l}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bc=F("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hc=F("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bm=F("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ea=F("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const br=F("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hm=F("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qm=F("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Er=F("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const en=F("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vr=F("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Km=F("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qc=F("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wm=F("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ca=F("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wl=F("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gm=F("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ym=F("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qm=F("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const go=F("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zm=F("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jm=F("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xm=F("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wr=F("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ep=F("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tn=F("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tp=F("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kc=F("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ta=F("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const np=F("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rp=F("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wc=F("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gc=F("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lp=F("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sp=F("TableProperties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bt=F("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pl=F("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ip=F("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wi=F("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sl=F("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const op=F("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + * @license lucide-react v0.424.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yc=F("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ap({branding:e,user:t,activeTab:n,onChangeTab:r,themeMode:l,onChangeThemeMode:s,onLogout:o,onOpenAuth:a,onOpenCreateEvent:u,onOpenTemplates:d,onOpenProfile:h,onOpenAdmin:g,pwaInstallPrompt:x,onInstallPwa:k}){const y=(e==null?void 0:e.primary_color)||"var(--brand-primary)",v=()=>{s(l==="dark"?"light":l==="light"?"auto":"dark")};return i.jsxs("header",{className:"bg-surface border-b border-grid sticky top-0 z-40",children:[i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 shrink-0",children:[i.jsx("div",{onClick:()=>r("home"),style:{backgroundColor:y},className:"w-8 h-8 rounded-sm flex items-center justify-center text-white font-bold cursor-pointer shadow-sm",children:e!=null&&e.logo_url?i.jsx("img",{src:e.logo_url,alt:"Logo",className:"w-4 h-4 object-contain"}):i.jsx(br,{className:"w-4 h-4"})}),i.jsxs("div",{onClick:()=>r("home"),className:"cursor-pointer",children:[i.jsx("h1",{className:"font-serif text-base font-bold tracking-tight text-main leading-none",children:(e==null?void 0:e.app_name)||"Schichtplaner"}),i.jsx("div",{className:"text-[10px] font-mono text-muted mt-1 uppercase tracking-wider flex items-center gap-1.5",children:t?i.jsxs("span",{className:"text-emerald-500 font-semibold",children:["[ ",t.display_name||t.username," ]"]}):i.jsx("span",{className:"text-amber-500 font-semibold",children:"[ GAST-MODUS ]"})})]})]}),i.jsxs("nav",{className:"hidden md:flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>r("home"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="home"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(Ca,{className:"w-3.5 h-3.5"})," Startseite"]}),i.jsxs("button",{onClick:()=>r("calendar"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="calendar"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(Ea,{className:"w-3.5 h-3.5"})," Kalender"]}),((t==null?void 0:t.is_admin_user)||(t==null?void 0:t.is_staff)||(t==null?void 0:t.is_superuser))&&i.jsxs("button",{onClick:()=>r("admin"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="admin"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(Ta,{className:"w-3.5 h-3.5 text-indigo-400"})," Admin"]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("button",{onClick:v,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5",title:`Design-Modus: ${l.toUpperCase()}`,children:l==="dark"?i.jsxs(i.Fragment,{children:[i.jsx(Jm,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"DARK"})]}):l==="light"?i.jsxs(i.Fragment,{children:[i.jsx(lp,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"LIGHT"})]}):i.jsxs(i.Fragment,{children:[i.jsx(Zm,{className:"w-3.5 h-3.5 text-blue-500"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"AUTO"})]})}),x&&i.jsxs("button",{onClick:k,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-emerald-500/10 text-emerald-500 border border-emerald-500/20 hover:bg-emerald-500/20 transition flex items-center gap-1",children:[i.jsx(Gc,{className:"w-3 h-3"})," PWA"]}),t?i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:u,style:{backgroundColor:y},className:"h-8 px-3 rounded-sm text-xs font-mono font-bold text-white transition flex items-center gap-1 shadow-sm hover:brightness-110",children:[i.jsx(tn,{className:"w-3.5 h-3.5"})," Event"]}),i.jsxs("button",{onClick:d,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition hidden sm:flex items-center gap-1",title:"Vorlagen",children:[i.jsx(Wl,{className:"w-3.5 h-3.5 text-muted"})," Vorlagen"]}),i.jsxs("button",{onClick:h,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1",title:"Profil & Namen ändern",children:[i.jsx(wr,{className:"w-3.5 h-3.5 text-amber-500"})," Profil"]}),(t.is_admin_user||t.is_staff||t.is_superuser)&&i.jsxs("button",{onClick:()=>r("admin"),className:`h-8 px-2.5 rounded-sm text-xs font-mono transition flex items-center gap-1 border ${n==="admin"?"bg-indigo-500/20 text-indigo-300 border-indigo-500/40 font-bold":"bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 border-indigo-500/30"}`,title:"Admin-Zentrale",children:[i.jsx(Ta,{className:"w-3.5 h-3.5"})," Admin"]}),i.jsx("div",{className:"h-4 w-px bg-grid mx-1"}),i.jsx("button",{onClick:o,className:"h-8 w-8 rounded-sm text-muted hover:text-red-500 hover:bg-red-500/10 border border-transparent hover:border-red-500/20 transition flex items-center justify-center",title:"Abmelden",children:i.jsx(Ym,{className:"w-3.5 h-3.5"})})]}):i.jsxs("button",{onClick:a,style:{backgroundColor:y},className:"h-8 px-3.5 rounded-sm text-xs font-mono font-bold text-white transition hover:brightness-110 flex items-center gap-1.5 shadow-sm",children:[i.jsx(sl,{className:"w-3.5 h-3.5"})," Anmelden"]})]})]}),i.jsxs("div",{className:"flex md:hidden items-center justify-around border-t border-grid py-2 bg-subtle text-xs font-mono",children:[i.jsxs("button",{onClick:()=>r("home"),className:`flex items-center gap-1 px-3 py-1.5 rounded-sm border ${n==="home"?"text-main font-bold bg-surface border-grid":"text-muted border-transparent"}`,children:[i.jsx(Ca,{className:"w-3.5 h-3.5"})," Start"]}),i.jsxs("button",{onClick:()=>r("calendar"),className:`flex items-center gap-1 px-3 py-1.5 rounded-sm border ${n==="calendar"?"text-main font-bold bg-surface border-grid":"text-muted border-transparent"}`,children:[i.jsx(Ea,{className:"w-3.5 h-3.5"})," Termine"]}),i.jsxs("button",{onClick:()=>r("schedule"),className:`flex items-center gap-1 px-3 py-1.5 rounded-sm border ${n==="schedule"?"text-main font-bold bg-surface border-grid":"text-muted border-transparent"}`,children:[i.jsx(sp,{className:"w-3.5 h-3.5"})," Schichtplan"]})]})]})}function up({event:e,user:t,onSignupClick:n,onCancelClick:r,onRemoveUserFromShift:l,onGenerateClaimLink:s,onExportPdf:o,onPrintView:a,onEditEvent:u}){var g,x;if(!e||!e.task_areas||e.task_areas.length===0)return i.jsxs("div",{className:"hallmark-panel rounded-sm p-12 text-center border border-grid font-mono",children:[i.jsx(vr,{className:"w-8 h-8 text-muted mx-auto mb-3"}),i.jsx("h3",{className:"font-serif text-xl font-bold text-main uppercase",children:"Keine Aufgabenfelder vorhanden"}),i.jsx("p",{className:"text-xs text-muted mt-1 mb-4",children:"[ Event hat noch keine definierten Aufgabenfelder oder Schichten ]"}),t&&(t.is_admin_user||t.is_staff||t.is_superuser||(e==null?void 0:e.created_by)===t.id||((g=e==null?void 0:e.created_by)==null?void 0:g.id)===t.id)&&u&&i.jsxs("button",{onClick:()=>u(e),className:"px-4 py-2 rounded-sm bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 border border-indigo-500/30 font-bold text-xs inline-flex items-center gap-2",children:[i.jsx(wr,{className:"w-4 h-4"})," SCHICHTEN & BEREICHE ANLEGEN"]})]});const d=!t,h=t&&(t.is_admin_user||t.is_staff||t.is_superuser||e.created_by===t.id||((x=e.created_by)==null?void 0:x.id)===t.id);return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid flex flex-col md:flex-row md:items-center justify-between gap-4",children:[i.jsxs("div",{className:"space-y-1 font-mono",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted mb-1",children:[i.jsxs("span",{className:"bg-subtle px-2.5 py-0.5 rounded-sm border border-grid font-bold text-main",children:[new Date(e.start_date).toLocaleDateString("de-DE")," — ",new Date(e.end_date).toLocaleDateString("de-DE")]}),e.location&&i.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[i.jsx(go,{className:"w-3.5 h-3.5 shrink-0"}),e.location]}),e.is_active===!1&&i.jsx("span",{className:"px-2 py-0.5 rounded-sm bg-amber-500/10 text-amber-500 border border-amber-500/20 font-bold",children:"[ DEAKTIVIERT ]"})]}),i.jsx("h2",{className:"font-serif text-3xl sm:text-4xl font-bold uppercase tracking-tight text-main",children:e.title}),e.description&&i.jsx("p",{className:"text-xs font-sans text-muted max-w-2xl mt-1",children:e.description})]}),i.jsxs("div",{className:"flex items-center gap-2 no-print font-mono text-xs shrink-0",children:[h&&u&&i.jsxs("button",{onClick:()=>u(e),className:"px-3.5 py-1.5 rounded-sm bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 border border-indigo-500/30 transition flex items-center gap-1.5 font-bold",title:"Schichten und Aufgabenbereiche für diese Veranstaltung bearbeiten",children:[i.jsx(wr,{className:"w-3.5 h-3.5"})," SCHICHTEN BEARBEITEN"]}),i.jsxs("button",{onClick:a,className:"px-3.5 py-1.5 rounded-sm bg-surface hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5 font-bold",children:[i.jsx(tp,{className:"w-3.5 h-3.5"})," DRUCKEN"]}),i.jsxs("button",{onClick:o,className:"px-3.5 py-1.5 rounded-sm bg-surface hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5 font-bold",children:[i.jsx(Km,{className:"w-3.5 h-3.5"})," PDF"]})]})]}),d&&i.jsxs("div",{className:"p-3.5 rounded-sm bg-amber-500/10 border border-amber-500/20 text-amber-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(Wc,{className:"w-4 h-4 shrink-0 text-amber-500"}),i.jsxs("span",{children:["[ GAST-DATENSCHUTZ ]: Belegungszahlen sichtbar, Namensanzeige aus Datenschutzgründen ",i.jsx("strong",{children:"anonymisiert"}),"."]})]}),i.jsx("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden",children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-left border-collapse",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-subtle border-b border-grid text-[11px] font-mono text-muted uppercase tracking-wider",children:[i.jsx("th",{className:"py-3.5 px-4 w-1/4",children:"Aufgabenfeld"}),i.jsx("th",{className:"py-3.5 px-4 w-1/4",children:"Schicht & Zeitraum"}),i.jsx("th",{className:"py-3.5 px-4 w-1/6",children:"Qualifikation"}),i.jsx("th",{className:"py-3.5 px-4 w-1/4",children:"Belegung & Personen"}),i.jsx("th",{className:"py-3.5 px-4 w-1/6 text-right",children:"Aktion"})]})}),i.jsx("tbody",{className:"divide-y divide-grid text-xs font-sans",children:e.task_areas.map(k=>!k.shifts||k.shifts.length===0?i.jsxs("tr",{children:[i.jsx("td",{className:"py-3.5 px-4 font-serif text-lg font-bold text-main uppercase",children:k.name}),i.jsx("td",{colSpan:4,className:"py-3.5 px-4 text-muted font-mono text-[11px]",children:"[ Keine Schichten angelegt ]"})]},`area-${k.id}`):k.shifts.map((y,v)=>{const R=v===0,f=y.is_full,m=!!(t?y.signups.find(S=>!S.is_guest&&S.display_name===t.display_name):null),w=y.required_skills&&y.required_skills.length>0;return i.jsxs("tr",{className:"hover:bg-surface-hover/60 transition",children:[R?i.jsxs("td",{rowSpan:k.shifts.length,className:"py-3.5 px-4 font-serif text-lg font-bold text-main uppercase bg-subtle/80 align-top border-r border-grid",children:[i.jsx("div",{children:k.name}),k.description&&i.jsx("div",{className:"text-[11px] font-sans font-normal text-muted mt-0.5",children:k.description})]}):null,i.jsxs("td",{className:"py-3.5 px-4",children:[i.jsx("div",{className:"font-semibold text-main",children:y.title}),i.jsxs("div",{className:"text-[11px] font-mono text-muted flex items-center gap-1 mt-0.5",children:[i.jsx(vr,{className:"w-3 h-3 text-muted shrink-0"}),i.jsxs("span",{children:[y.start_time," — ",y.end_time," Uhr"]})]})]}),i.jsx("td",{className:"py-3.5 px-4 font-mono",children:w?i.jsx("div",{className:"flex flex-wrap gap-1",children:y.required_skills.map(S=>i.jsxs("span",{style:{backgroundColor:`${S.color}15`,borderColor:`${S.color}35`,color:S.color},className:"px-2 py-0.5 rounded-sm text-[10px] font-semibold border flex items-center gap-1",children:[i.jsx(Bm,{className:"w-3 h-3 shrink-0"})," ",S.name]},S.id))}):i.jsx("span",{className:"text-[11px] text-muted",children:"—"})}),i.jsxs("td",{className:"py-3.5 px-4 font-mono",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsxs("span",{className:`px-2 py-0.5 rounded-sm text-[11px] font-bold border ${f?"bg-red-500/10 text-red-500 border-red-500/20":"bg-emerald-500/10 text-emerald-500 border-emerald-500/20"}`,children:["[ ",y.signups_count," / ",y.max_participants," BELEGT ]"]})}),i.jsx("div",{className:"mt-2 space-y-1 font-sans",children:y.signups.map(S=>i.jsxs("div",{className:"text-[11px] text-muted flex items-center justify-between gap-2 p-1.5 rounded-sm bg-subtle border border-grid",children:[i.jsxs("div",{className:"flex items-center gap-1.5 truncate",children:[i.jsx(Pl,{className:"w-3 h-3 text-muted shrink-0"}),i.jsx("span",{className:"truncate",children:S.display_name}),S.is_guest&&i.jsx("span",{className:"text-[9px] font-mono text-amber-500 px-1 rounded-sm bg-amber-500/10 border border-amber-500/20 font-bold",children:"GAST"})]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[t&&S.is_guest&&s&&i.jsxs("button",{onClick:()=>s(S),className:"text-indigo-400 hover:text-indigo-300 transition p-1 rounded-sm bg-indigo-500/10 hover:bg-indigo-500/20 border border-indigo-500/20 flex items-center gap-1 text-[10px] font-mono font-bold",title:"Konto-Einladungslink für diese Gast-Eintragung kopieren",children:[i.jsx(ip,{className:"w-3 h-3"})," LINK"]}),h&&l&&i.jsx("button",{onClick:()=>l(y,S.id),className:"text-muted hover:text-red-500 transition p-1 rounded-sm hover:bg-red-500/10",title:"Person aus dieser Schicht entfernen",children:i.jsx(wi,{className:"w-3.5 h-3.5"})})]})]},S.id))})]}),i.jsx("td",{className:"py-3.5 px-4 text-right font-mono",children:m?i.jsxs("button",{onClick:()=>r(y),className:"px-3 py-1.5 rounded-sm text-xs font-semibold bg-red-500/10 hover:bg-red-500/20 text-red-500 border border-red-500/20 transition flex items-center gap-1 ml-auto",children:[i.jsx(wi,{className:"w-3.5 h-3.5"})," AUSTRAGEN"]}):f?i.jsx("span",{className:"text-xs text-muted font-bold",children:"[ VOLL ]"}):i.jsxs("button",{onClick:()=>n(y),style:{backgroundColor:"var(--brand-primary)"},className:"px-3.5 py-1.5 rounded-sm text-xs font-bold text-white transition hover:brightness-110 flex items-center gap-1 ml-auto shadow-sm",children:[i.jsx(en,{className:"w-3.5 h-3.5"})," EINTRAGEN"]})})]},`shift-${y.id}`)}))})]})})})]})}function cp({shift:e,onClose:t,onSubmit:n}){const[r,l]=j.useState(""),[s,o]=j.useState(""),[a,u]=j.useState(!1),[d,h]=j.useState(""),[g,x]=j.useState(!1);j.useEffect(()=>{const v=localStorage.getItem("guest_display_name")||"";v&&l(v)},[]);const k=()=>{const v="acaptcha-verified-"+Math.random().toString(36).substring(2,10);o(v),u(!0)},y=async v=>{if(v.preventDefault(),h(""),!r.trim()){h("Bitte gib deinen Namen ein.");return}if(!a||!s){h("Bitte löse zuerst das Captcha.");return}localStorage.setItem("guest_display_name",r.trim()),x(!0);try{await n({guest_name:r.trim(),captcha_token:s}),t()}catch(R){h(R.message||"Eintragen fehlgeschlagen.")}finally{x(!1)}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/80 backdrop-blur-sm",children:i.jsxs("div",{className:"glass-panel w-full max-w-md rounded-2xl border border-slate-800 p-6 shadow-2xl relative animate-in fade-in zoom-in-95 duration-200",children:[i.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-400 hover:text-white rounded-lg transition",children:i.jsx(Yc,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/10 text-blue-400 border border-blue-500/20 flex items-center justify-center",children:i.jsx(Pl,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-lg text-white",children:"Als Gast eintragen"}),i.jsxs("p",{className:"text-xs text-slate-400",children:["Schicht: ",e==null?void 0:e.title," (",e==null?void 0:e.start_time," - ",e==null?void 0:e.end_time,")"]})]})]}),d&&i.jsxs("div",{className:"mb-4 p-3 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-xs flex items-center gap-2",children:[i.jsx(Er,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:d})]}),i.jsxs("form",{onSubmit:y,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Dein Name / Anzeigename"}),i.jsx("input",{type:"text",required:!0,value:r,onChange:v=>l(v.target.value),placeholder:"z. B. Alex Muster",className:"w-full px-3.5 py-2.5 rounded-xl bg-slate-900 border border-slate-800 text-white text-sm focus:outline-none focus:border-blue-500 transition"}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-1",children:"Dein Name wird in deiner Sitzung gespeichert. Falls du später ein Konto mit diesem Namen erstellst, werden deine Gast-Schichten automatisch übertragen!"})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/90 border border-slate-800 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-xs font-semibold text-slate-300 flex items-center gap-1.5",children:[i.jsx(rp,{className:"w-4 h-4 text-emerald-400"})," Security Check (acaptcha.vercel.app)"]}),i.jsx("a",{href:"https://acaptcha.vercel.app/",target:"_blank",rel:"noreferrer",className:"text-[10px] text-blue-400 hover:underline",children:"Website öffnen"})]}),i.jsxs("div",{className:"border border-dashed border-slate-700 rounded-lg p-3 text-center bg-slate-950/60",children:[i.jsx("iframe",{src:"https://acaptcha.vercel.app/",title:"acaptcha",className:"w-full h-16 border-0 rounded"}),i.jsx("div",{className:"mt-2 flex items-center justify-center gap-2",children:a?i.jsxs("div",{className:"text-xs font-medium text-emerald-400 flex items-center gap-1",children:[i.jsx(en,{className:"w-4 h-4"})," Captcha erfolgreich verifiziert!"]}):i.jsxs("button",{type:"button",onClick:k,className:"px-3 py-1.5 text-xs font-semibold rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white transition flex items-center gap-1",children:[i.jsx(en,{className:"w-3.5 h-3.5"})," Captcha gelöst bestätigen"]})})]})]}),i.jsxs("div",{className:"pt-2 flex justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 rounded-xl text-xs font-semibold text-slate-400 hover:bg-slate-800 transition",children:"Abbrechen"}),i.jsx("button",{type:"submit",disabled:g,className:"px-5 py-2 rounded-xl text-xs font-bold bg-blue-600 hover:bg-blue-500 text-white transition shadow-lg shadow-blue-600/30 disabled:opacity-50",children:g?"Eintragen...":"Jetzt eintragen"})]})]})]})})}const dp="/api",ki=()=>localStorage.getItem("auth_token"),tr=e=>{e?localStorage.setItem("auth_token",e):localStorage.removeItem("auth_token")},$=async(e,t={})=>{const n=ki(),r={"Content-Type":"application/json",...n?{Authorization:`Token ${n}`}:{},...t.headers},l=await fetch(`${dp}${e}`,{...t,headers:r}),s=l.headers.get("content-type");let o=null;if(s&&s.includes("application/json")&&(o=await l.json()),!l.ok){let a="Ein Fehler ist aufgetreten.";throw o&&(typeof o.error=="string"?a=o.error:typeof o.detail=="string"?a=o.detail:o.email?a=Array.isArray(o.email)?o.email[0]:o.email:o.username?a=Array.isArray(o.username)?o.username[0]:o.username:o.non_field_errors&&(a=o.non_field_errors[0])),new Error(a)}return o};function fp({onClose:e,onSuccess:t,claimToken:n,prefilledGuestName:r}){const[l,s]=j.useState(!!(n||r)),[o,a]=j.useState(""),[u,d]=j.useState(""),[h,g]=j.useState(""),[x,k]=j.useState(r||""),[y,v]=j.useState(null),[R,f]=j.useState(""),[c,m]=j.useState(!1);j.useEffect(()=>{w()},[]);const w=async()=>{try{const b=await $("/users/restriction-setting/");v(b)}catch{}},S=async b=>{b.preventDefault(),f(""),m(!0);try{if(l){const N={username:o,email:u,password:h,display_name:x||o};n&&(N.claim_token=n);const E=await $("/users/register/",{method:"POST",body:JSON.stringify(N)});if(E.requires_verification||E.requires_approval||!E.token){t(null,E.message||"Konto erfolgreich registriert! Bitte schau in deine E-Mail zur Bestätigung oder warte auf die Admin-Freischaltung."),e();return}tr(E.token),t(E.user,E.message)}else{const N=await $("/users/login/",{method:"POST",body:JSON.stringify({username:o,password:h})});tr(N.token),t(N.user,"Erfolgreich angemeldet!")}e()}catch(N){f(N.message||"Authentifizierung fehlgeschlagen.")}finally{m(!1)}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:i.jsxs("div",{className:"hallmark-panel w-full max-w-md rounded-sm border border-grid p-6 shadow-2xl relative animate-in fade-in zoom-in-95 duration-200",children:[i.jsx("button",{onClick:e,className:"absolute top-4 right-4 p-2 text-muted hover:text-main rounded-sm transition",children:i.jsx(Yc,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-blue-500/10 text-blue-500 border border-blue-500/20 flex items-center justify-center",children:i.jsx(sl,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif font-bold text-lg text-main",children:l?"Konto erstellen":"Anmelden"}),i.jsx("p",{className:"text-xs text-muted font-sans",children:l?"Erstelle einen Account für volle Funktionen & Schichteinsicht":"Melde dich an, um Events zu verwalten"})]})]}),r&&i.jsxs("div",{className:"mb-4 p-3 rounded-sm bg-amber-500/10 border border-amber-500/20 text-amber-500 text-xs flex items-center gap-2 font-mono",children:[i.jsx(Gc,{className:"w-4 h-4 shrink-0 text-amber-500"}),i.jsxs("span",{children:["Einladung für Gast: ",i.jsx("strong",{children:r}),". Die Schicht wird deinem neuen Konto zugewiesen!"]})]}),(y==null?void 0:y.is_restriction_enabled)&&l&&i.jsxs("div",{className:"mb-4 p-3 rounded-sm bg-indigo-500/10 border border-indigo-500/20 text-indigo-400 text-xs flex items-center gap-2 font-mono",children:[i.jsx(np,{className:"w-4 h-4 shrink-0 text-indigo-400"}),i.jsxs("span",{children:["Registrierungen beschränkt auf: ",i.jsx("strong",{children:y.active_domains.join(", ")})]})]}),R&&i.jsxs("div",{className:"mb-4 p-3 rounded-sm bg-red-500/10 border border-red-500/20 text-red-500 text-xs flex items-center gap-2 font-mono",children:[i.jsx(Er,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:R})]}),!l&&i.jsxs("div",{className:"mb-5 p-3.5 rounded-sm bg-subtle border border-grid space-y-2 font-mono",children:[i.jsx("div",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider flex items-center justify-between",children:i.jsx("span",{children:"⚡ Dev Schnell-Login"})}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>{a("admin"),g("adminpassword")},className:"px-2.5 py-1.5 rounded-sm bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 border border-indigo-500/30 text-xs font-semibold transition text-left",children:["👑 Demo Admin",i.jsx("div",{className:"text-[10px] text-indigo-400 font-normal",children:"admin / adminpassword"})]}),i.jsxs("button",{type:"button",onClick:()=>{a("demouser"),g("demouser123")},className:"px-2.5 py-1.5 rounded-sm bg-emerald-500/10 hover:bg-emerald-500/20 text-emerald-500 border border-emerald-500/30 text-xs font-semibold transition text-left",children:["👤 Demo User",i.jsx("div",{className:"text-[10px] text-emerald-500 font-normal",children:"demouser / demouser123"})]})]})]}),i.jsxs("form",{onSubmit:S,className:"space-y-4 font-sans",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-main mb-1 font-mono",children:"Benutzername"}),i.jsxs("div",{className:"relative",children:[i.jsx(sl,{className:"w-4 h-4 absolute left-3 top-3 text-muted"}),i.jsx("input",{type:"text",required:!0,value:o,onChange:b=>a(b.target.value),placeholder:"z. B. max_muster",className:"w-full pl-9 pr-3.5 py-2 rounded-sm input-field text-sm font-mono"})]})]}),l&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-main mb-1 font-mono",children:"E-Mail-Adresse"}),i.jsxs("div",{className:"relative",children:[i.jsx(qm,{className:"w-4 h-4 absolute left-3 top-3 text-muted"}),i.jsx("input",{type:"email",required:!0,value:u,onChange:b=>d(b.target.value),placeholder:"max@beispiel.de",className:"w-full pl-9 pr-3.5 py-2 rounded-sm input-field text-sm font-mono"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-main mb-1 font-mono",children:"Anzeigename (für Schichtlisten)"}),i.jsxs("div",{className:"relative",children:[i.jsx(sl,{className:"w-4 h-4 absolute left-3 top-3 text-muted"}),i.jsx("input",{type:"text",value:x,onChange:b=>k(b.target.value),placeholder:"z. B. Max M.",className:"w-full pl-9 pr-3.5 py-2 rounded-sm input-field text-sm font-mono"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-main mb-1 font-mono",children:"Passwort"}),i.jsxs("div",{className:"relative",children:[i.jsx(Gm,{className:"w-4 h-4 absolute left-3 top-3 text-muted"}),i.jsx("input",{type:"password",required:!0,value:h,onChange:b=>g(b.target.value),placeholder:"••••••••",className:"w-full pl-9 pr-3.5 py-2 rounded-sm input-field text-sm font-mono"})]})]}),i.jsx("button",{type:"submit",disabled:c,style:{backgroundColor:"var(--brand-primary)"},className:"w-full py-2.5 rounded-sm text-xs font-mono font-bold text-white transition hover:brightness-110 shadow-sm",children:c?"Verarbeite...":l?"Registrieren":"Anmelden"})]}),i.jsx("div",{className:"mt-4 pt-4 border-t border-grid text-center",children:i.jsx("button",{type:"button",onClick:()=>{s(!l),f("")},className:"text-xs font-mono text-muted hover:text-main transition",children:l?"Bereits ein Konto? Hier anmelden":"Noch kein Konto? Jetzt registrieren"})})]})})}function mp({events:e,user:t,onSelectEvent:n,onOpenCreateEvent:r,onToggleEventActive:l,onEditEvent:s,branding:o}){const[a,u]=j.useState(""),[d,h]=j.useState("all"),g=new Date().toISOString().split("T")[0],x=e.filter(c=>c.title.toLowerCase().includes(a.toLowerCase())||c.description&&c.description.toLowerCase().includes(a.toLowerCase())||c.location&&c.location.toLowerCase().includes(a.toLowerCase())?d==="upcoming"?c.end_date>=g:!0:!1),k=(o==null?void 0:o.primary_color)||"var(--brand-primary)",y=(o==null?void 0:o.show_community_info_box)??!0,v=(o==null?void 0:o.show_support_box)??!0,R=y||v,f=t&&(t.is_admin_user||t.is_staff||t.is_superuser);return i.jsxs("div",{className:"space-y-8 animate-in fade-in duration-200",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-10 space-y-6 max-w-5xl mx-auto relative border border-grid",children:[i.jsxs("div",{className:"space-y-2 border-b border-grid pb-6",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-muted border border-grid px-2.5 py-1 rounded-sm inline-block",children:(o==null?void 0:o.app_name)||"SCHICHT- & EVENTPORTAL"}),(o==null?void 0:o.custom_banner_text)&&i.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-widest text-amber-500 bg-amber-500/10 border border-amber-500/20 px-2.5 py-1 rounded-sm inline-block font-bold",children:["📢 ",o.custom_banner_text]})]}),i.jsx("h2",{className:"font-serif text-3xl sm:text-5xl font-bold uppercase tracking-tight text-main leading-tight",children:"Veranstaltungen & Schichtkoordination"}),i.jsx("p",{className:"font-sans text-xs sm:text-sm text-muted max-w-2xl",children:"Hier findest du aktuelle Termine, Arbeitsgruppen, Bar- & Tresendienste und Schichtpläne der Initiative."})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(Kc,{className:"w-4 h-4 absolute left-3.5 top-3 text-muted"}),i.jsx("input",{type:"text",value:a,onChange:c=>u(c.target.value),placeholder:"Veranstaltung, Ort oder Suchbegriff...",className:"w-full pl-10 pr-16 py-2 rounded-sm bg-subtle border border-grid text-main text-xs font-mono focus:outline-none focus:border-muted"}),a&&i.jsx("button",{onClick:()=>u(""),className:"absolute right-3 top-2.5 text-[10px] font-mono text-muted hover:text-main",children:"[ CLEAR ]"})]}),i.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-xs shrink-0",children:[i.jsxs("button",{onClick:()=>h("all"),className:`px-3.5 py-1.5 rounded-sm transition border ${d==="all"?"bg-surface-hover text-main border-grid font-bold shadow-sm":"bg-subtle text-muted border-grid hover:text-main"}`,children:["ALLE PROGRAMME (",e.length,")"]}),i.jsxs("button",{onClick:()=>h("upcoming"),className:`px-3.5 py-1.5 rounded-sm transition border ${d==="upcoming"?"bg-surface-hover text-main border-grid font-bold shadow-sm":"bg-subtle text-muted border-grid hover:text-main"}`,children:["ANSTEHEND (",e.filter(c=>c.end_date>=g).length,")"]})]})]})]}),i.jsxs("div",{className:"max-w-5xl mx-auto grid grid-cols-1 lg:grid-cols-4 gap-6",children:[i.jsxs("div",{className:`${R?"lg:col-span-3":"lg:col-span-4"} space-y-4`,children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-grid pb-3 font-mono",children:[i.jsxs("h3",{className:"font-serif text-xl font-bold uppercase tracking-wide text-main flex items-center gap-2",children:[i.jsx(br,{className:"w-4.5 h-4.5 text-muted"})," Termine & Schichten"]}),t&&i.jsxs("button",{onClick:r,style:{backgroundColor:k},className:"px-3.5 py-1.5 rounded-sm text-xs font-mono font-bold text-white transition flex items-center gap-1 hover:brightness-110 shadow-sm",children:[i.jsx(tn,{className:"w-3.5 h-3.5"})," EVENT ANLEGEN"]})]}),x.length===0?i.jsx("div",{className:"hallmark-panel rounded-sm p-12 text-center text-xs font-mono text-muted border border-grid",children:a?`[ Keinen Eintrag für "${a}" gefunden ]`:"[ Keine Veranstaltungen vorhanden ]"}):i.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 ${R?"":"lg:grid-cols-3"} gap-4`,children:x.map(c=>{var N,E,U;const m=((N=c.task_areas)==null?void 0:N.length)||0,w=((E=c.task_areas)==null?void 0:E.reduce((M,ee)=>{var D;return M+(((D=ee.shifts)==null?void 0:D.length)||0)},0))||0,S=t&&(c.created_by===t.id||((U=c.created_by)==null?void 0:U.id)===t.id),b=f||S;return i.jsxs("div",{className:`hallmark-card rounded-sm p-5 border transition flex flex-col justify-between space-y-4 group overflow-hidden ${c.is_active===!1?"border-amber-500/40 opacity-80 bg-subtle":"border-grid"}`,children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] font-mono text-muted gap-2",children:[i.jsxs("span",{className:"flex items-center gap-1 bg-subtle px-2 py-0.5 rounded-sm border border-grid font-bold shrink-0",children:[i.jsx(vr,{className:"w-3 h-3 text-muted"}),new Date(c.start_date).toLocaleDateString("de-DE")]}),c.is_active===!1?i.jsx("span",{className:"text-amber-500 font-bold px-1.5 py-0.5 rounded-sm bg-amber-500/10 border border-amber-500/20 shrink-0",children:"[ DEAKTIVIERT ]"}):c.location?i.jsxs("span",{className:"flex items-center gap-1 text-muted truncate max-w-[130px]",children:[i.jsx(go,{className:"w-3 h-3 shrink-0"}),i.jsx("span",{className:"truncate",children:c.location})]}):null]}),i.jsx("h4",{className:"font-serif text-lg font-bold uppercase text-main group-hover:text-amber-500 transition line-clamp-2",children:c.title}),c.description&&i.jsx("p",{className:"text-xs text-muted font-sans line-clamp-2",children:c.description}),i.jsxs("div",{className:"text-[10px] font-mono text-muted flex items-center gap-1.5 pt-1",children:[i.jsxs("span",{children:[m," Bereiche"]}),i.jsx("span",{children:"/"}),i.jsxs("span",{children:[w," Schichten"]})]})]}),i.jsx("div",{className:"pt-3 border-t border-grid space-y-2 font-mono",children:i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[i.jsxs("button",{onClick:()=>n(c.id),className:"flex-1 min-w-[110px] py-1.5 px-3 rounded-sm text-xs font-mono font-bold bg-surface hover:bg-surface-hover text-main border border-grid transition flex items-center justify-center gap-1",children:["Schichtplan ",i.jsx(Hc,{className:"w-3.5 h-3.5"})]}),b&&s&&i.jsxs("button",{onClick:()=>s(c),className:"py-1.5 px-2.5 rounded-sm text-[10px] font-mono font-bold bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 hover:bg-indigo-500/20 transition flex items-center gap-1 shrink-0",title:"Veranstaltung & Schichten bearbeiten",children:[i.jsx(wr,{className:"w-3.5 h-3.5"})," BEARBEITEN"]}),b&&l&&i.jsx("button",{onClick:()=>l(c),className:`py-1.5 px-2 rounded-sm text-[10px] font-mono font-bold transition flex items-center gap-1 border shrink-0 ${c.is_active!==!1?"bg-amber-500/10 text-amber-500 border-amber-500/20 hover:bg-amber-500/20":"bg-emerald-500/10 text-emerald-400 border-emerald-500/20 hover:bg-emerald-500/20"}`,title:c.is_active!==!1?"Deaktivieren":"Aktivieren",children:c.is_active!==!1?i.jsx(Qc,{className:"w-3.5 h-3.5"}):i.jsx(en,{className:"w-3.5 h-3.5"})})]})})]},c.id)})})]}),R&&i.jsxs("div",{className:"space-y-4 font-mono text-xs",children:[y&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-4 border border-grid space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-bold uppercase tracking-wide text-main border-b border-grid pb-2",children:(o==null?void 0:o.community_info_title)||"📌 Verein & Infos"}),i.jsx("div",{className:"space-y-2 text-muted text-[11px] whitespace-pre-line",children:(o==null?void 0:o.community_info_text)||`Initiative e.V. Hausverein +Offene Angebote, DIY-Kultur & engagierte Schichten.`})]}),v&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-4 border border-grid space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-bold uppercase tracking-wide text-main border-b border-grid pb-2",children:(o==null?void 0:o.support_box_title)||"❤️ Unterstützen"}),i.jsx("p",{className:"text-[11px] text-muted whitespace-pre-line",children:(o==null?void 0:o.support_box_text)||"Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau."})]})]})]})]})}function pp({events:e,onSelectEvent:t,branding:n}){const[r,l]=j.useState(new Date),[s,o]=j.useState(null),a=r.getFullYear(),u=r.getMonth(),d=["JANUAR","FEBRUAR","MÄRZ","APRIL","MAI","JUNI","JULI","AUGUST","SEPTEMBER","OKTOBER","NOVEMBER","DEZEMBER"],h=()=>l(new Date(a,u-1,1)),g=()=>l(new Date(a,u+1,1)),x=()=>l(new Date),k=new Date(a,u,1).getDay(),y=k===0?6:k-1,v=new Date(a,u+1,0).getDate(),R=m=>{const w=String(u+1).padStart(2,"0"),S=String(m).padStart(2,"0");return`${a}-${w}-${S}`},f=m=>{const w=R(m);return e.filter(S=>w>=S.start_date&&w<=S.end_date)},c=(n==null?void 0:n.primary_color)||"var(--brand-primary)";return i.jsxs("div",{className:"space-y-6 max-w-5xl mx-auto animate-in fade-in duration-200",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-4 font-mono",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-subtle text-main border border-grid flex items-center justify-center font-bold",children:i.jsx(br,{className:"w-4 h-4 text-amber-500"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"font-serif text-3xl sm:text-4xl font-bold uppercase tracking-tight text-main leading-none",children:[d[u]," ",a]}),i.jsx("p",{className:"text-[10px] text-muted uppercase tracking-widest mt-1",children:"— INITIATIVE E.V. TERMIN- & SCHICHTÜBERSICHT —"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:x,className:"px-3.5 py-1.5 rounded-sm text-xs font-mono font-bold bg-surface hover:bg-surface-hover text-main border border-grid transition",children:"[ HEUTE ]"}),i.jsx("button",{onClick:h,className:"p-1.5 rounded-sm text-muted hover:text-main bg-surface border border-grid transition",title:"Vorheriger Monat",children:i.jsx(Hm,{className:"w-4 h-4"})}),i.jsx("button",{onClick:g,className:"p-1.5 rounded-sm text-muted hover:text-main bg-surface border border-grid transition",title:"Nächster Monat",children:i.jsx(Qm,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden",children:[i.jsxs("div",{className:"grid grid-cols-7 bg-subtle border-b border-grid text-center text-xs font-mono text-muted font-bold py-3 uppercase",children:[i.jsx("div",{children:"MO"}),i.jsx("div",{children:"DI"}),i.jsx("div",{children:"MI"}),i.jsx("div",{children:"DO"}),i.jsx("div",{children:"FR"}),i.jsx("div",{children:"SA"}),i.jsx("div",{children:"SO"})]}),i.jsxs("div",{className:"grid grid-cols-7 auto-rows-fr divide-x divide-y divide-grid bg-surface text-xs font-mono",children:[Array.from({length:y}).map((m,w)=>i.jsx("div",{className:"min-h-[100px] sm:min-h-[110px] p-2 bg-subtle/50 text-muted opacity-30"},`offset-${w}`)),Array.from({length:v}).map((m,w)=>{const S=w+1,b=f(S),N=new Date().getFullYear()===a&&new Date().getMonth()===u&&new Date().getDate()===S;return i.jsxs("div",{className:`min-h-[100px] sm:min-h-[110px] p-2 flex flex-col justify-between transition ${N?"bg-surface-hover/80 font-bold":"hover:bg-surface-hover/50"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("span",{className:`w-5 h-5 rounded-sm flex items-center justify-center font-mono text-xs ${N?"bg-main text-paper font-bold shadow-sm":"text-muted"}`,children:S}),b.length>0&&i.jsxs("span",{className:"text-[9px] font-mono text-muted",children:[b.length," ",b.length===1?"Event":"Events"]})]}),i.jsx("div",{className:"space-y-1.5 overflow-y-auto max-h-[70px] no-scrollbar",children:b.map(E=>{const U=(s==null?void 0:s.id)===E.id;return i.jsx("button",{onClick:()=>o(E),style:{backgroundColor:U?c:`${c}15`,borderColor:`${c}40`,color:U?"#ffffff":c},className:`w-full text-left px-2 py-1 rounded-sm text-[10px] font-mono font-bold border truncate block hover:brightness-110 transition shadow-sm ${E.is_active===!1?"opacity-50 line-through":""}`,children:E.title},`evt-${E.id}`)})})]},`day-${S}`)})]})]}),s&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 border border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-4 font-mono animate-in fade-in duration-200",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted",children:[i.jsxs("span",{className:"flex items-center gap-1 bg-subtle px-2 py-0.5 rounded-sm border border-grid font-bold text-main",children:[i.jsx(vr,{className:"w-3 h-3 text-muted"}),new Date(s.start_date).toLocaleDateString("de-DE")," — ",new Date(s.end_date).toLocaleDateString("de-DE")]}),s.location&&i.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[i.jsx(go,{className:"w-3 h-3"}),s.location]})]}),i.jsx("h3",{className:"font-serif text-2xl font-bold uppercase text-main",children:s.title}),s.description&&i.jsx("p",{className:"text-xs font-sans text-muted max-w-xl",children:s.description})]}),i.jsx("div",{className:"flex items-center gap-2 shrink-0",children:i.jsxs("button",{onClick:()=>t(s.id),style:{backgroundColor:c},className:"px-5 py-2 rounded-sm text-xs font-mono font-bold text-white transition flex items-center gap-1.5 hover:brightness-110 shadow-sm",children:["SCHICHTPLAN ÖFFNEN ",i.jsx(Hc,{className:"w-4 h-4"})]})})]})]})}function hp({branding:e,onRefreshBranding:t,onRefreshEvents:n,skills:r,onRefreshSkills:l}){const[s,o]=j.useState("users"),[a,u]=j.useState(!0),[d,h]=j.useState(""),[g,x]=j.useState(""),[k,y]=j.useState([]),[v,R]=j.useState(""),[f,c]=j.useState([]),[m,w]=j.useState(!1),[S,b]=j.useState(!1),[N,E]=j.useState([]),[U,M]=j.useState(""),[ee,D]=j.useState([]),[I,V]=j.useState([]),[W,H]=j.useState(""),[Se,T]=j.useState(""),[O,L]=j.useState("#E05A47"),[q,se]=j.useState((e==null?void 0:e.app_name)||"Veranstaltungsschichtplaner"),[et,ge]=j.useState((e==null?void 0:e.logo_url)||""),[ye,me]=j.useState((e==null?void 0:e.primary_color)||"#E05A47"),[ot,Gl]=j.useState((e==null?void 0:e.custom_banner_text)||""),[$t,Yl]=j.useState((e==null?void 0:e.show_community_info_box)??!0),[Cr,ql]=j.useState((e==null?void 0:e.community_info_title)||"📌 Verein & Infos"),[yt,Zl]=j.useState((e==null?void 0:e.community_info_text)||`Initiative e.V. Hausverein +Offene Angebote, DIY-Kultur & engagierte Schichten.`),[Ft,Jl]=j.useState((e==null?void 0:e.show_support_box)??!0),[Tr,Xl]=j.useState((e==null?void 0:e.support_box_title)||"❤️ Unterstützen"),[C,z]=j.useState((e==null?void 0:e.support_box_text)||"Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau."),[Y,tt]=j.useState(!1);j.useEffect(()=>{K()},[]);const K=async()=>{u(!0),h("");try{try{const p=await $("/users/manage-users/");y(p.results||p)}catch{}try{const p=await $("/users/pending/");c(p.results||p)}catch{}try{const p=await $("/users/restriction-setting/");w(p.is_restriction_enabled),b(p.require_admin_approval);const A=await $("/users/domain-rules/");E(A.results||A)}catch{}try{const p=await $("/events/");D(p.results||p)}catch{}try{const p=await $("/templates/");V(p.results||p)}catch{}}catch(p){h(p.message||"Laden der Admin-Daten fehlgeschlagen.")}finally{u(!1)}},je=p=>{x(p),setTimeout(()=>x(""),4e3)},qc=async p=>{try{const A=await $(`/users/manage-users/${p.id}/`,{method:"PATCH",body:JSON.stringify({is_admin_user:!p.is_admin_user})});y(k.map(Fe=>Fe.id===p.id?A:Fe)),je(`Admin-Rechte für ${p.username} aktualisiert.`)}catch(A){h(A.message||"Fehler beim Aktualisieren.")}},Zc=async p=>{try{const A=await $(`/users/manage-users/${p.id}/`,{method:"PATCH",body:JSON.stringify({is_active:!p.is_active})});y(k.map(Fe=>Fe.id===p.id?A:Fe)),je(`Status für ${p.username} auf ${A.is_active?"AKTIV":"DEAKTIVIERT"} gesetzt.`)}catch(A){h(A.message||"Fehler beim Aktualisieren.")}},Jc=async p=>{if(window.confirm(`Benutzer ${p.username} wirklich löschen?`))try{await $(`/users/manage-users/${p.id}/`,{method:"DELETE"}),y(k.filter(A=>A.id!==p.id)),je(`Benutzer ${p.username} gelöscht.`)}catch(A){h(A.message||"Löschen fehlgeschlagen.")}},Xc=async p=>{try{const A=await $(`/users/${p}/approve/`,{method:"POST"});c(f.filter(Fe=>Fe.id!==p)),K(),je(A.message||"Nutzer freigeschaltet!")}catch(A){h(A.message||"Freischaltung fehlgeschlagen.")}},ed=async p=>{try{const A=await $(`/users/${p}/approve/`,{method:"DELETE"});c(f.filter(Fe=>Fe.id!==p)),je(A.message||"Registrierung abgelehnt.")}catch(A){h(A.message||"Ablehnen fehlgeschlagen.")}},td=async()=>{try{const p=await $("/users/restriction-setting/",{method:"POST",body:JSON.stringify({require_admin_approval:!S})});b(p.require_admin_approval),je(`Admin-Freischaltung ist jetzt ${p.require_admin_approval?"AKTIV":"INAKTIV"}`)}catch(p){h(p.message||"Fehler beim Umschalten.")}},nd=async()=>{try{const p=await $("/users/restriction-setting/",{method:"POST",body:JSON.stringify({is_restriction_enabled:!m})});w(p.is_restriction_enabled),je(`Domain-Beschränkung ist jetzt ${p.is_restriction_enabled?"AKTIV":"INAKTIV"}`)}catch(p){h(p.message||"Fehler beim Umschalten.")}},rd=async p=>{if(p.preventDefault(),!!U.trim())try{const A=await $("/users/domain-rules/",{method:"POST",body:JSON.stringify({domain:U.trim(),is_active:!0})});E([...N,A]),M(""),je("Domain hinzugefügt!")}catch(A){h(A.message||"Fehler beim Hinzufügen der Domain.")}},ld=async p=>{try{await $(`/users/domain-rules/${p}/`,{method:"DELETE"}),E(N.filter(A=>A.id!==p)),je("Domain entfernt.")}catch(A){h(A.message||"Löschen fehlgeschlagen.")}},sd=async p=>{if(p.preventDefault(),!!W.trim())try{await $("/skills/",{method:"POST",body:JSON.stringify({name:W.trim(),description:Se.trim(),color:O})}),H(""),T(""),l(),je("Qualifikation angelegt!")}catch(A){h(A.message||"Fehler beim Anlegen.")}},id=async p=>{if(window.confirm("Qualifikation wirklich löschen?"))try{await $(`/skills/${p}/`,{method:"DELETE"}),l(),je("Qualifikation gelöscht.")}catch(A){h(A.message||"Löschen fehlgeschlagen.")}},od=async p=>{try{const A=await $(`/events/${p.id}/`,{method:"PATCH",body:JSON.stringify({is_active:p.is_active===!1})});D(ee.map(Fe=>Fe.id===p.id?A:Fe)),n(),je(`Status für "${p.title}" aktualisiert.`)}catch(A){h(A.message||"Fehler beim Umschalten.")}},ad=async p=>{if(window.confirm("Veranstaltung mit allen Schichten wirklich löschen?"))try{await $(`/events/${p}/`,{method:"DELETE"}),D(ee.filter(A=>A.id!==p)),n(),je("Veranstaltung gelöscht.")}catch(A){h(A.message||"Löschen fehlgeschlagen.")}},ud=async p=>{if(window.confirm("Vorlage wirklich löschen?"))try{await $(`/templates/${p}/`,{method:"DELETE"}),V(I.filter(A=>A.id!==p)),je("Vorlage gelöscht.")}catch(A){h(A.message||"Löschen fehlgeschlagen.")}},cd=async p=>{p.preventDefault(),tt(!0),h("");try{await $("/branding/",{method:"POST",body:JSON.stringify({app_name:q,logo_url:et,primary_color:ye,custom_banner_text:ot,show_community_info_box:$t,community_info_title:Cr,community_info_text:yt,show_support_box:Ft,support_box_title:Tr,support_box_text:C})}),je("Branding & Einstellungen erfolgreich gespeichert!"),t()}catch(A){h(A.message||"Speichern fehlgeschlagen.")}finally{tt(!1)}},es=k.filter(p=>p.username.toLowerCase().includes(v.toLowerCase())||p.email.toLowerCase().includes(v.toLowerCase())||p.display_name&&p.display_name.toLowerCase().includes(v.toLowerCase()));return i.jsxs("div",{className:"space-y-8 max-w-6xl mx-auto animate-in fade-in duration-200",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid space-y-4",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-grid pb-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-muted border border-grid px-2.5 py-0.5 rounded-sm inline-block",children:"SYSTEM CONTROL & GOVERNANCE"}),i.jsx("h2",{className:"font-serif text-3xl sm:text-4xl font-bold uppercase tracking-tight text-main",children:"Administration & System-Zentrale"})]}),i.jsx("div",{className:"flex items-center gap-2 font-mono text-xs shrink-0",children:i.jsxs("div",{className:"bg-subtle px-3 py-2 rounded-sm border border-grid text-right space-y-0.5",children:[i.jsx("div",{className:"font-bold text-emerald-500",children:"[ SYSTEM NORMAL ]"}),i.jsxs("div",{className:"text-[10px] text-muted",children:[k.length," KONTEN • ",ee.length," EVENTS"]})]})})]}),i.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto font-mono text-xs no-scrollbar pt-2",children:[i.jsxs("button",{onClick:()=>o("users"),className:`px-4 py-2 rounded-sm transition flex items-center gap-2 border ${s==="users"?"bg-surface-hover text-main font-bold border-grid shadow-sm":"bg-subtle text-muted border-transparent hover:text-main"}`,children:[i.jsx(op,{className:"w-3.5 h-3.5 text-blue-400"})," [ 01: BENUTZER & SICHERHEIT (",k.length,") ]"]}),i.jsxs("button",{onClick:()=>o("events"),className:`px-4 py-2 rounded-sm transition flex items-center gap-2 border ${s==="events"?"bg-surface-hover text-main font-bold border-grid shadow-sm":"bg-subtle text-muted border-transparent hover:text-main"}`,children:[i.jsx(br,{className:"w-3.5 h-3.5 text-emerald-400"})," [ 02: VERANSTALTUNGEN (",ee.length,") ]"]}),i.jsxs("button",{onClick:()=>o("templates"),className:`px-4 py-2 rounded-sm transition flex items-center gap-2 border ${s==="templates"?"bg-surface-hover text-main font-bold border-grid shadow-sm":"bg-subtle text-muted border-transparent hover:text-main"}`,children:[i.jsx(Wl,{className:"w-3.5 h-3.5 text-amber-400"})," [ 03: VORLAGEN & SKILLS ]"]}),i.jsxs("button",{onClick:()=>o("branding"),className:`px-4 py-2 rounded-sm transition flex items-center gap-2 border ${s==="branding"?"bg-surface-hover text-main font-bold border-grid shadow-sm":"bg-subtle text-muted border-transparent hover:text-main"}`,children:[i.jsx(Xm,{className:"w-3.5 h-3.5 text-indigo-400"})," [ 04: BRANDING & SYSTEM ]"]})]})]}),d&&i.jsxs("div",{className:"p-4 rounded-sm bg-red-500/10 border border-red-500/20 text-red-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(Er,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:d})]}),g&&i.jsxs("div",{className:"p-4 rounded-sm bg-emerald-500/10 border border-emerald-500/20 text-emerald-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(en,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:g})]}),s==="users"&&i.jsxs("div",{className:"space-y-6 animate-in fade-in duration-150",children:[f.length>0&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-amber-500/40 space-y-3 font-mono",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-amber-400 flex items-center gap-2",children:[i.jsx(vr,{className:"w-4 h-4"})," Ausstehende Freischalt-Anfragen (",f.length,")"]}),i.jsx("div",{className:"space-y-2",children:f.map(p=>i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-sm bg-subtle border border-grid text-xs",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-main",children:p.display_name||p.username}),i.jsx("div",{className:"text-[11px] text-muted",children:p.email})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>Xc(p.id),className:"px-3 py-1 rounded-sm font-bold bg-emerald-600 hover:bg-emerald-500 text-white transition flex items-center gap-1",children:[i.jsx(Pl,{className:"w-3.5 h-3.5"})," FREISCHALTEN"]}),i.jsxs("button",{onClick:()=>ed(p.id),className:"px-2.5 py-1 rounded-sm font-semibold bg-red-500/10 hover:bg-red-500/20 text-red-400 border border-red-500/20 transition flex items-center gap-1",children:[i.jsx(wi,{className:"w-3.5 h-3.5"})," ABLEHNEN"]})]})]},p.id))})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 font-mono",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h4",{className:"font-bold text-xs uppercase text-main flex items-center gap-2",children:[i.jsx(Pl,{className:"w-4 h-4 text-blue-400"})," Admin-Freischaltung Pflicht"]}),i.jsx("button",{onClick:td,className:`px-3 py-1 rounded-sm text-xs font-bold transition border ${S?"bg-blue-600 text-white border-blue-500":"bg-subtle text-muted border-grid"}`,children:S?"[ AKTIV ]":"[ INAKTIV ]"})]}),i.jsx("p",{className:"text-[11px] text-muted",children:"Neue Registrierungen müssen manuell freigeschaltet werden."})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h4",{className:"font-bold text-xs uppercase text-main flex items-center gap-2",children:[i.jsx(Wc,{className:"w-4 h-4 text-emerald-400"})," E-Mail Domain-Beschränkung"]}),i.jsx("button",{onClick:nd,className:`px-3 py-1 rounded-sm text-xs font-bold transition border ${m?"bg-emerald-600 text-white border-emerald-500":"bg-subtle text-muted border-grid"}`,children:m?"[ AKTIV ]":"[ INAKTIV ]"})]}),i.jsx("p",{className:"text-[11px] text-muted",children:"Nur freigegebene E-Mail-Domains erlauben."})]})]}),m&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-4 font-mono",children:[i.jsx("h4",{className:"font-bold text-xs uppercase text-main",children:"Freigegebene E-Mail-Domains"}),i.jsxs("form",{onSubmit:rd,className:"flex gap-2",children:[i.jsx("input",{type:"text",placeholder:"z. B. verein.de oder @beispiel.org",value:U,onChange:p=>M(p.target.value),className:"flex-1 px-3 py-1.5 rounded-sm input-field text-xs"}),i.jsxs("button",{type:"submit",className:"px-4 py-1.5 rounded-sm text-xs font-bold bg-blue-600 text-white hover:bg-blue-500",children:[i.jsx(tn,{className:"w-3.5 h-3.5 inline"})," Domain Hinzufügen"]})]}),i.jsx("div",{className:"space-y-1.5",children:N.map(p=>i.jsxs("div",{className:"flex items-center justify-between p-2 rounded-sm bg-subtle border border-grid text-xs",children:[i.jsx("span",{className:"font-bold text-main",children:p.domain}),i.jsx("button",{onClick:()=>ld(p.id),className:"text-muted hover:text-red-400",children:i.jsx(Bt,{className:"w-3.5 h-3.5"})})]},p.id))})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden",children:[i.jsxs("div",{className:"p-4 bg-subtle border-b border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-3 font-mono",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-main",children:["Alle Benutzerkonten (",es.length," von ",k.length,")"]}),i.jsxs("div",{className:"relative w-full sm:w-64",children:[i.jsx(Kc,{className:"w-3.5 h-3.5 absolute left-3 top-2.5 text-muted"}),i.jsx("input",{type:"text",value:v,onChange:p=>R(p.target.value),placeholder:"Benutzer suchen...",className:"w-full pl-9 pr-3 py-1 rounded-sm input-field text-xs font-mono"})]})]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-left border-collapse font-sans text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-subtle border-b border-grid text-[11px] font-mono text-muted uppercase tracking-wider",children:[i.jsx("th",{className:"py-3 px-4",children:"Nutzer & E-Mail"}),i.jsx("th",{className:"py-3 px-4",children:"Anzeigename"}),i.jsx("th",{className:"py-3 px-4",children:"Status"}),i.jsx("th",{className:"py-3 px-4",children:"Rolle"}),i.jsx("th",{className:"py-3 px-4 text-right",children:"Aktionen"})]})}),i.jsx("tbody",{className:"divide-y divide-grid font-mono",children:es.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:5,className:"py-8 text-center text-muted italic text-xs",children:"[ Keine Benutzerkonten gefunden ]"})}):es.map(p=>i.jsxs("tr",{className:"hover:bg-surface-hover",children:[i.jsxs("td",{className:"py-3 px-4",children:[i.jsx("div",{className:"font-bold text-main",children:p.username}),i.jsx("div",{className:"text-[11px] text-muted",children:p.email})]}),i.jsx("td",{className:"py-3 px-4 text-main",children:p.display_name||p.username}),i.jsx("td",{className:"py-3 px-4",children:i.jsx("button",{onClick:()=>Zc(p),className:`px-2 py-0.5 rounded-sm text-[10px] font-bold border transition ${p.is_active?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-red-500/10 text-red-400 border-red-500/20"}`,children:p.is_active?"[ AKTIV ]":"[ DEAKTIVIERT ]"})}),i.jsx("td",{className:"py-3 px-4",children:i.jsx("button",{onClick:()=>qc(p),className:`px-2 py-0.5 rounded-sm text-[10px] font-bold border transition ${p.is_admin_user?"bg-indigo-500/10 text-indigo-400 border-indigo-500/30":"bg-subtle text-muted border-grid"}`,children:p.is_admin_user?"👑 ADMIN":"👤 USER"})}),i.jsx("td",{className:"py-3 px-4 text-right",children:i.jsx("button",{onClick:()=>Jc(p),className:"p-1.5 rounded-sm text-muted hover:text-red-400 hover:bg-red-500/10 transition",title:"Benutzer löschen",children:i.jsx(Bt,{className:"w-4 h-4"})})})]},p.id))})]})})]})]}),s==="events"&&i.jsx("div",{className:"space-y-6 animate-in fade-in duration-150",children:i.jsxs("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden font-mono",children:[i.jsx("div",{className:"p-4 bg-subtle border-b border-grid flex items-center justify-between",children:i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-main",children:["Veranstaltungen verwalten (",ee.length,")"]})}),i.jsx("div",{className:"divide-y divide-grid",children:ee.map(p=>i.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-4 hover:bg-surface-hover transition",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted",children:[i.jsxs("span",{className:"bg-subtle px-2 py-0.5 rounded-sm border border-grid font-bold",children:[p.start_date," bis ",p.end_date]}),p.location&&i.jsxs("span",{children:["• ",p.location]}),p.is_active===!1&&i.jsx("span",{className:"text-amber-500 font-bold px-1.5 py-0.5 rounded-sm bg-amber-500/10 border border-amber-500/20",children:"[ DEAKTIVIERT ]"})]}),i.jsx("h4",{className:"font-serif text-base font-bold text-main uppercase",children:p.title}),p.description&&i.jsx("p",{className:"text-xs text-muted font-sans line-clamp-1",children:p.description})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-xs",children:[i.jsxs("button",{onClick:()=>od(p),className:`px-3 py-1 rounded-sm border font-mono font-bold transition flex items-center gap-1 ${p.is_active!==!1?"bg-amber-500/10 text-amber-500 border-amber-500/20 hover:bg-amber-500/20":"bg-emerald-500/10 text-emerald-400 border-emerald-500/20 hover:bg-emerald-500/20"}`,children:[p.is_active!==!1?i.jsx(Qc,{className:"w-3.5 h-3.5"}):i.jsx(Wm,{className:"w-3.5 h-3.5"}),p.is_active!==!1?"DEAKTIVIEREN":"AKTIVIEREN"]}),i.jsxs("button",{onClick:()=>ad(p.id),className:"px-3 py-1 rounded-sm bg-red-500/10 hover:bg-red-500/20 text-red-400 border border-red-500/20 transition flex items-center gap-1 font-bold",children:[i.jsx(Bt,{className:"w-3.5 h-3.5"})," LÖSCHEN"]})]})]},p.id))})]})}),s==="templates"&&i.jsxs("div",{className:"space-y-6 animate-in fade-in duration-150 font-mono",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-4",children:[i.jsx("h3",{className:"font-serif text-lg font-bold uppercase text-main border-b border-grid pb-2",children:"Erforderliche Qualifikationen (Skills)"}),i.jsxs("form",{onSubmit:sd,className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[i.jsx("input",{type:"text",placeholder:"Skill Name (z. B. Bar-Erfahrung)",required:!0,value:W,onChange:p=>H(p.target.value),className:"px-3 py-1.5 rounded-sm input-field text-xs font-mono"}),i.jsx("input",{type:"text",placeholder:"Beschreibung (optional)",value:Se,onChange:p=>T(p.target.value),className:"px-3 py-1.5 rounded-sm input-field text-xs font-mono"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"color",value:O,onChange:p=>L(p.target.value),className:"w-8 h-8 rounded-sm border-0 cursor-pointer bg-subtle p-0.5"}),i.jsxs("button",{type:"submit",className:"flex-1 px-3 py-1.5 rounded-sm bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs",children:[i.jsx(tn,{className:"w-3.5 h-3.5 inline"})," Anlegen"]})]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 pt-2",children:r.map(p=>i.jsxs("div",{className:"p-3 rounded-sm bg-subtle border border-grid flex items-center justify-between text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{style:{color:p.color},className:"font-bold",children:p.name}),p.description&&i.jsx("p",{className:"text-[11px] text-muted",children:p.description})]}),i.jsx("button",{onClick:()=>id(p.id),className:"text-muted hover:text-red-400",children:i.jsx(Bt,{className:"w-3.5 h-3.5"})})]},p.id))})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-4",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-main border-b border-grid pb-2",children:["Gespeicherte Event-Vorlagen (",I.length,")"]}),i.jsx("div",{className:"space-y-2",children:I.map(p=>i.jsxs("div",{className:"p-3 rounded-sm bg-subtle border border-grid flex items-center justify-between text-xs",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-main",children:p.name}),i.jsx("div",{className:"text-[11px] text-muted",children:p.description||"Keine Beschreibung"})]}),i.jsx("button",{onClick:()=>ud(p.id),className:"text-muted hover:text-red-400",children:i.jsx(Bt,{className:"w-4 h-4"})})]},p.id))})]})]}),s==="branding"&&i.jsx("div",{className:"space-y-6 animate-in fade-in duration-150 font-mono",children:i.jsxs("form",{onSubmit:cd,className:"hallmark-panel rounded-sm p-6 border border-grid space-y-6",children:[i.jsx("h3",{className:"font-serif text-lg font-bold uppercase text-main border-b border-grid pb-2",children:"App Branding & Aussehen"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"App Name"}),i.jsx("input",{type:"text",required:!0,value:q,onChange:p=>se(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Primärfarbe"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"color",value:ye,onChange:p=>me(p.target.value),className:"w-8 h-8 rounded-sm border-0 cursor-pointer bg-subtle p-0.5"}),i.jsx("input",{type:"text",value:ye,onChange:p=>me(p.target.value),className:"flex-1 px-3 py-1.5 rounded-sm input-field font-mono"})]})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-muted mb-1",children:"Logo Bild-URL (optional)"}),i.jsx("input",{type:"text",placeholder:"https://beispiel.de/logo.png",value:et,onChange:p=>ge(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-muted mb-1",children:"Ankündigung (Banner-Text)"}),i.jsx("textarea",{rows:2,placeholder:"z. B. Willkommen beim Sommerfest Schichtplaner!",value:ot,onChange:p=>Gl(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]})]}),i.jsx("h4",{className:"font-serif text-base font-bold uppercase text-main pt-4 border-t border-grid",children:"Startseiten Sidebar Boxen"}),i.jsxs("div",{className:"p-4 rounded-sm bg-subtle border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-grid pb-2",children:[i.jsx("span",{className:"font-bold text-xs uppercase text-main",children:"📌 Verein & Infos Box"}),i.jsx("button",{type:"button",onClick:()=>Yl(!$t),className:`px-3 py-1 rounded-sm text-xs font-bold transition border ${$t?"bg-emerald-600 text-white border-emerald-500":"bg-surface text-muted border-grid"}`,children:$t?"[ AN ]":"[ AUS ]"})]}),$t&&i.jsxs("div",{className:"space-y-3 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Titel"}),i.jsx("input",{type:"text",value:Cr,onChange:p=>ql(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Inhalt"}),i.jsx("textarea",{rows:3,value:yt,onChange:p=>Zl(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]})]})]}),i.jsxs("div",{className:"p-4 rounded-sm bg-subtle border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-grid pb-2",children:[i.jsx("span",{className:"font-bold text-xs uppercase text-main",children:"❤️ Unterstützen Box"}),i.jsx("button",{type:"button",onClick:()=>Jl(!Ft),className:`px-3 py-1 rounded-sm text-xs font-bold transition border ${Ft?"bg-emerald-600 text-white border-emerald-500":"bg-surface text-muted border-grid"}`,children:Ft?"[ AN ]":"[ AUS ]"})]}),Ft&&i.jsxs("div",{className:"space-y-3 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Titel"}),i.jsx("input",{type:"text",value:Tr,onChange:p=>Xl(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Inhalt"}),i.jsx("textarea",{rows:3,value:C,onChange:p=>z(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]})]})]}),i.jsx("div",{className:"pt-3 flex justify-end border-t border-grid",children:i.jsx("button",{type:"submit",disabled:Y,style:{backgroundColor:"var(--brand-primary)"},className:"px-6 py-2.5 rounded-sm text-xs font-mono font-bold text-white transition hover:brightness-110 shadow-sm",children:Y?"Speichern...":"Einstellungen speichern"})})]})})]})}function xp({eventToEdit:e,skills:t,onBack:n,onSubmit:r}){const[l,s]=j.useState((e==null?void 0:e.title)||""),[o,a]=j.useState((e==null?void 0:e.description)||""),[u,d]=j.useState((e==null?void 0:e.location)||""),[h,g]=j.useState((e==null?void 0:e.start_date)||new Date().toISOString().split("T")[0]),[x,k]=j.useState((e==null?void 0:e.end_date)||new Date().toISOString().split("T")[0]),[y,v]=j.useState([]),[R,f]=j.useState(!1),[c,m]=j.useState("");j.useEffect(()=>{if(e&&e.task_areas&&e.task_areas.length>0){const D=e.task_areas.map(I=>({id:I.id,name:I.name,description:I.description||"",shifts:(I.shifts||[]).map(V=>({id:V.id,title:V.title,start_time:V.start_time,end_time:V.end_time,max_participants:V.max_participants||1,required_skill_ids:V.required_skills?V.required_skills.map(W=>W.id):[]}))}));v(D)}else e||v([{name:"Tresendienst",description:"Getränke- und Barverkauf",shifts:[{title:"Schicht 1",start_time:"18:00",end_time:"22:00",max_participants:2,required_skill_ids:[]}]},{name:"Essen kochen",description:"Zubereitung von Speisen",shifts:[{title:"Frühschicht",start_time:"15:00",end_time:"19:00",max_participants:3,required_skill_ids:[]}]},{name:"Aufbau & Aufräumen",description:"Tische, Stühle & Technik",shifts:[{title:"Aufbau",start_time:"12:00",end_time:"15:00",max_participants:4,required_skill_ids:[]}]}])},[e]);const w=()=>{v([...y,{name:"",description:"",shifts:[{title:"Schicht 1",start_time:"10:00",end_time:"14:00",max_participants:1,required_skill_ids:[]}]}])},S=D=>{v(y.filter((I,V)=>V!==D))},b=(D,I,V)=>{const W=[...y];W[D][I]=V,v(W)},N=D=>{const I=[...y];I[D].shifts.push({title:`Schicht ${I[D].shifts.length+1}`,start_time:"14:00",end_time:"18:00",max_participants:1,required_skill_ids:[]}),v(I)},E=(D,I)=>{const V=[...y];V[D].shifts=V[D].shifts.filter((W,H)=>H!==I),v(V)},U=(D,I,V,W)=>{const H=[...y];H[D].shifts[I][V]=W,v(H)},M=(D,I,V)=>{const W=[...y],H=W[D].shifts[I].required_skill_ids||[];H.includes(V)?W[D].shifts[I].required_skill_ids=H.filter(Se=>Se!==V):W[D].shifts[I].required_skill_ids=[...H,V],v(W)},ee=async D=>{if(D.preventDefault(),m(""),!l.trim()){m("Bitte gib einen Veranstaltungstitel an.");return}f(!0);try{await r({id:e==null?void 0:e.id,title:l,description:o,location:u,start_date:h,end_date:x,task_areas:y})}catch(I){m(I.message||"Speichern der Veranstaltung fehlgeschlagen.")}finally{f(!1)}};return i.jsxs("div",{className:"space-y-6 max-w-4xl mx-auto animate-in fade-in duration-200 font-sans",children:[i.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[i.jsxs("button",{onClick:n,className:"px-3.5 py-1.5 rounded-sm bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-2 font-bold",children:[i.jsx(Bc,{className:"w-4 h-4"})," [ ZURÜCK ZUR ÜBERSICHT ]"]}),i.jsxs("span",{className:"text-muted border border-grid px-2.5 py-0.5 rounded-sm",children:["MODE: ",e?"EVENT EDIT":"NEW EVENT"]})]}),i.jsx("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid space-y-2",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-blue-500/10 text-blue-500 border border-blue-500/20 flex items-center justify-center font-bold",children:e?i.jsx(wr,{className:"w-5 h-5"}):i.jsx(br,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-serif text-3xl font-bold uppercase tracking-tight text-main",children:e?"Veranstaltung & Schichten Bearbeiten":"Neue Veranstaltung Erstellen"}),i.jsx("p",{className:"text-xs text-muted font-mono mt-0.5",children:"Konfiguriere Stammdaten, Aufgabenfelder, Schichtzeiten & Qualifikationen"})]})]})}),c&&i.jsxs("div",{className:"p-4 rounded-sm bg-red-500/10 border border-red-500/20 text-red-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(Er,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:c})]}),i.jsxs("form",{onSubmit:ee,className:"space-y-6",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 border border-grid space-y-4 font-mono text-xs",children:[i.jsx("h3",{className:"font-serif text-lg font-bold uppercase text-main border-b border-grid pb-2",children:"1. Stammdaten der Veranstaltung"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Titel der Veranstaltung"}),i.jsx("input",{type:"text",required:!0,value:l,onChange:D=>s(D.target.value),placeholder:"z. B. Sommerfest 2026",className:"w-full px-3.5 py-2 rounded-sm input-field text-sm"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Startdatum"}),i.jsx("input",{type:"date",required:!0,value:h,onChange:D=>g(D.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-sm"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Enddatum"}),i.jsx("input",{type:"date",required:!0,value:x,onChange:D=>k(D.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-sm"})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Ort (optional)"}),i.jsx("input",{type:"text",value:u,onChange:D=>d(D.target.value),placeholder:"z. B. Vereinsheim, Großer Saal",className:"w-full px-3.5 py-2 rounded-sm input-field text-xs"})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Beschreibung (optional)"}),i.jsx("textarea",{rows:2,value:o,onChange:D=>a(D.target.value),placeholder:"Details zur Veranstaltung...",className:"w-full px-3.5 py-2 rounded-sm input-field text-xs font-sans"})]})]})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 border border-grid space-y-4 font-mono text-xs",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-grid pb-2",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-main flex items-center gap-2",children:[i.jsx(Wl,{className:"w-4 h-4 text-blue-500"})," 2. Aufgabenfelder & Schichten"]}),i.jsxs("button",{type:"button",onClick:w,className:"px-3.5 py-1.5 rounded-sm text-xs font-mono font-bold bg-blue-500/10 text-blue-500 border border-blue-500/20 hover:bg-blue-500/20 transition flex items-center gap-1",children:[i.jsx(tn,{className:"w-3.5 h-3.5"})," BEREICH HINZUFÜGEN"]})]}),y.map((D,I)=>i.jsxs("div",{className:"p-4 rounded-sm bg-subtle border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("input",{type:"text",required:!0,placeholder:"Name des Aufgabenfeldes (z. B. Tresendienst)",value:D.name,onChange:V=>b(I,"name",V.target.value),className:"flex-1 px-3 py-1.5 rounded-sm input-field text-xs font-bold"}),i.jsx("button",{type:"button",onClick:()=>S(I),className:"p-1.5 text-muted hover:text-red-400 transition",title:"Bereich entfernen",children:i.jsx(Bt,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"pl-3 border-l-2 border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs text-muted font-bold",children:[i.jsx("span",{children:"Schichten & Zeitfenster"}),i.jsxs("button",{type:"button",onClick:()=>N(I),className:"text-blue-500 hover:underline flex items-center gap-1",children:[i.jsx(tn,{className:"w-3 h-3"})," Schicht hinzufügen"]})]}),D.shifts.map((V,W)=>i.jsxs("div",{className:"p-3 rounded-sm bg-surface border border-grid space-y-2",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-12 gap-2 items-center text-xs",children:[i.jsx("input",{type:"text",placeholder:"Titel",value:V.title,onChange:H=>U(I,W,"title",H.target.value),className:"sm:col-span-4 px-2.5 py-1 rounded-sm input-field text-xs"}),i.jsx("input",{type:"text",placeholder:"Start (14:00)",value:V.start_time,onChange:H=>U(I,W,"start_time",H.target.value),className:"sm:col-span-2 px-2.5 py-1 rounded-sm input-field text-xs"}),i.jsx("input",{type:"text",placeholder:"Ende (18:00)",value:V.end_time,onChange:H=>U(I,W,"end_time",H.target.value),className:"sm:col-span-2 px-2.5 py-1 rounded-sm input-field text-xs"}),i.jsxs("div",{className:"sm:col-span-3 flex items-center gap-1",children:[i.jsx("span",{className:"text-[11px] text-muted",children:"Plätze:"}),i.jsx("input",{type:"number",min:"1",value:V.max_participants,onChange:H=>U(I,W,"max_participants",parseInt(H.target.value)||1),className:"w-full px-2 py-1 rounded-sm input-field text-xs font-bold"})]}),i.jsx("button",{type:"button",onClick:()=>E(I,W),className:"sm:col-span-1 p-1 text-muted hover:text-red-400 text-center",title:"Schicht löschen",children:i.jsx(Bt,{className:"w-3.5 h-3.5 mx-auto"})})]}),t&&t.length>0&&i.jsxs("div",{className:"pt-1.5 border-t border-grid text-[11px]",children:[i.jsx("span",{className:"text-muted block mb-1",children:"Erforderliche Qualifikationen:"}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(H=>{const Se=(V.required_skill_ids||[]).includes(H.id);return i.jsxs("button",{type:"button",onClick:()=>M(I,W,H.id),style:{backgroundColor:Se?H.color:`${H.color}15`,borderColor:H.color,color:Se?"#ffffff":H.color},className:"px-2 py-0.5 rounded-sm border text-[10px] font-bold transition",children:[H.name," ",Se?"✓":""]},H.id)})})]})]},W))]})]},I))]}),i.jsxs("div",{className:"hallmark-panel rounded-sm p-4 border border-grid flex items-center justify-between font-mono text-xs",children:[i.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 rounded-sm text-xs font-semibold text-muted hover:bg-surface-hover transition border border-grid",children:"Abbrechen"}),i.jsxs("button",{type:"submit",disabled:R,style:{backgroundColor:"var(--brand-primary)"},className:"px-6 py-2.5 rounded-sm text-xs font-mono font-bold text-white transition shadow-sm hover:brightness-110 flex items-center gap-2",children:[i.jsx(en,{className:"w-4 h-4"}),R?"Speichern...":e?"Änderungen Speichern":"Veranstaltung Jetzt Erstellen"]})]})]})]})}function gp({onBack:e,onInstantiateTemplate:t}){const[n,r]=j.useState([]),[l,s]=j.useState(!0),[o,a]=j.useState(""),[u,d]=j.useState(null),[h,g]=j.useState(""),[x,k]=j.useState(new Date().toISOString().split("T")[0]),[y,v]=j.useState(new Date().toISOString().split("T")[0]),[R,f]=j.useState(""),[c,m]=j.useState(!1);j.useEffect(()=>{w()},[]);const w=async()=>{s(!0);try{const N=await $("/templates/");r(N.results||N)}catch(N){a(N.message||"Laden der Vorlagen fehlgeschlagen.")}finally{s(!1)}},S=N=>{d(N),g(N.name)},b=async N=>{if(N.preventDefault(),!!u){m(!0);try{await t(u.id,{title:h,start_date:x,end_date:y,location:R})}catch(E){a(E.message||"Erstellen der Veranstaltung aus Vorlage fehlgeschlagen.")}finally{m(!1)}}};return i.jsxs("div",{className:"space-y-6 max-w-4xl mx-auto animate-in fade-in duration-200 font-sans",children:[i.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[i.jsxs("button",{onClick:e,className:"px-3.5 py-1.5 rounded-sm bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-2 font-bold",children:[i.jsx(Bc,{className:"w-4 h-4"})," [ ZURÜCK ZUR ÜBERSICHT ]"]}),i.jsxs("span",{className:"text-muted border border-grid px-2.5 py-0.5 rounded-sm uppercase",children:["SYSTEM VORLAGEN (",n.length,")"]})]}),i.jsx("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid space-y-2",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 flex items-center justify-center font-bold",children:i.jsx(Wl,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-serif text-3xl font-bold uppercase tracking-tight text-main",children:"Veranstaltungs-Vorlagen Zentrale"}),i.jsx("p",{className:"text-xs text-muted font-mono mt-0.5",children:"Erstelle neue Veranstaltungen im Handumdrehen aus vorgefertigten Struktur-Vorlagen"})]})]})}),o&&i.jsxs("div",{className:"p-4 rounded-sm bg-red-500/10 border border-red-500/20 text-red-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(Er,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:o})]}),i.jsxs("div",{className:"space-y-4 font-mono text-xs",children:[i.jsx("h3",{className:"font-serif text-lg font-bold uppercase text-main",children:"Verfügbare Vorlagen"}),l?i.jsx("div",{className:"hallmark-panel p-8 text-center text-muted",children:"Lade Vorlagen..."}):n.length===0?i.jsx("div",{className:"hallmark-panel p-8 text-center text-muted italic",children:"[ Noch keine Vorlagen gespeichert. Du kannst in der Admin-Zentrale Vorlagen anlegen. ]"}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:n.map(N=>i.jsxs("div",{onClick:()=>S(N),className:`hallmark-panel p-5 rounded-sm border cursor-pointer transition space-y-2 ${(u==null?void 0:u.id)===N.id?"bg-indigo-500/10 border-indigo-500 shadow-md":"bg-surface border-grid hover:border-muted"}`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h4",{className:"font-serif text-base font-bold text-main uppercase",children:N.name}),(u==null?void 0:u.id)===N.id&&i.jsx("span",{className:"text-[10px] font-mono text-indigo-400 bg-indigo-500/20 px-2 py-0.5 rounded-sm border border-indigo-500/30 font-bold",children:"[ AUSGEWÄHLT ]"})]}),N.description&&i.jsx("p",{className:"text-xs font-sans text-muted",children:N.description}),i.jsxs("div",{className:"text-[10px] text-muted pt-2 border-t border-grid flex items-center justify-between",children:[i.jsxs("span",{children:["Erstellt von: ",i.jsx("strong",{children:N.created_by_name||"Admin"})]}),i.jsx("span",{className:"text-indigo-400 font-bold",children:"Klick zum Auswählen"})]})]},N.id))})]}),u&&i.jsxs("form",{onSubmit:b,className:"hallmark-panel rounded-sm p-6 border border-grid space-y-4 font-mono text-xs animate-in fade-in duration-200",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-indigo-400 border-b border-grid pb-2",children:['Neue Veranstaltung aus Vorlage "',u.name,'" Erstellen']}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Titel der Veranstaltung"}),i.jsx("input",{type:"text",required:!0,value:h,onChange:N=>g(N.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-sm"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Startdatum"}),i.jsx("input",{type:"date",required:!0,value:x,onChange:N=>k(N.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-xs"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Enddatum"}),i.jsx("input",{type:"date",required:!0,value:y,onChange:N=>v(N.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-xs"})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Ort (optional)"}),i.jsx("input",{type:"text",value:R,onChange:N=>f(N.target.value),placeholder:"z. B. Großer Saal",className:"w-full px-3.5 py-2 rounded-sm input-field text-xs"})]})]}),i.jsx("div",{className:"pt-3 flex justify-end border-t border-grid",children:i.jsxs("button",{type:"submit",disabled:c,style:{backgroundColor:"var(--brand-primary)"},className:"px-6 py-2.5 rounded-sm text-xs font-mono font-bold text-white transition hover:brightness-110 shadow-sm flex items-center gap-2",children:[i.jsx(ep,{className:"w-4 h-4 fill-white"}),c?"Erstellen...":"Veranstaltung Jetzt Aus Vorlage Erstellen"]})})]})]})}function yp(){const[e,t]=j.useState(null),[n,r]=j.useState(null),[l,s]=j.useState([]),[o,a]=j.useState([]),[u,d]=j.useState(null),[h,g]=j.useState(null),[x,k]=j.useState(!0),[y,v]=j.useState("home"),[R,f]=j.useState(!1),[c,m]=j.useState(!1),[w,S]=j.useState(null),[b,N]=j.useState(!1),[E,U]=j.useState(!1),[M,ee]=j.useState(localStorage.getItem("theme_mode")||"auto"),[D,I]=j.useState(null),[V,W]=j.useState(null);j.useEffect(()=>{window.addEventListener("beforeinstallprompt",C=>{C.preventDefault(),W(C)}),q()},[]),j.useEffect(()=>{localStorage.setItem("theme_mode",M);const C=()=>{let z=M;M==="auto"&&(z=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",z)};if(C(),M==="auto"){const z=window.matchMedia("(prefers-color-scheme: dark)"),Y=()=>C();return z.addEventListener("change",Y),()=>z.removeEventListener("change",Y)}},[M]),j.useEffect(()=>{n!=null&&n.primary_color&&(document.documentElement.style.setProperty("--brand-primary",n.primary_color),document.documentElement.style.setProperty("--brand-secondary",n.secondary_color||n.primary_color))},[n]);const[H,Se]=j.useState(null),[T,O]=j.useState(null),L=C=>{I(C),setTimeout(()=>I(null),5e3)},q=async()=>{k(!0);try{try{const K=await $("/branding/");r(K)}catch{}if(ki())try{const K=await $("/users/me/");t(K),!K.is_admin_user&&!K.is_staff&&!K.is_superuser&&y==="admin"&&v("home")}catch{tr(null),t(null),v("home")}const C=new URLSearchParams(window.location.search),z=C.get("verify_email");if(z)try{const K=await $("/users/verify-email/",{method:"POST",body:JSON.stringify({token:z})});tr(K.token),t(K.user),L(K.message||"✅ E-Mail-Adresse erfolgreich bestätigt!"),window.history.replaceState({},document.title,window.location.pathname)}catch(K){L(`⚠️ E-Mail Bestätigung: ${K.message}`)}const Y=C.get("claim_token"),tt=C.get("guest_name");Y&&tt&&(Se(Y),O(tt),ki()||f(!0)),await et(),await ge()}catch(C){console.error(C)}finally{k(!1)}},se=async C=>{try{const z=await $(`/users/signups/${C.id}/generate-claim-link/`,{method:"POST"}),Y=`${window.location.origin}/?claim_token=${z.token}&guest_name=${encodeURIComponent(z.guest_name)}`;navigator.clipboard?(await navigator.clipboard.writeText(Y),L(`✅ Einladungs-Link für ${z.guest_name} in Zwischenablage kopiert!`)):prompt(`Einladungs-Link für ${z.guest_name} kopieren:`,Y)}catch(z){alert(z.message||"Fehler beim Erstellen des Links.")}},et=async()=>{try{const C=await $("/skills/");s(C.results||C)}catch{}},ge=async()=>{try{const C=await $("/events/"),z=C.results||C;a(z),z.length>0&&!u?(d(z[0].id),ye(z[0].id)):u&&ye(u)}catch{}},ye=async C=>{try{const z=await $(`/events/${C}/matrix/`);g(z)}catch{}},me=C=>{d(C),ye(C),v("schedule")},ot=()=>{tr(null),t(null),v("home"),L("Erfolgreich abgemeldet."),u&&ye(u)},Gl=(C,z)=>{t(C),C&&!C.is_admin_user&&!C.is_staff&&!C.is_superuser&&y==="admin"&&v("home"),L(z||"Erfolgreich angemeldet!"),u&&ye(u)},$t=async C=>{if(!e)S(C),m(!0);else try{const z=await $(`/shifts/${C.id}/signup/`,{method:"POST"});L(z.message||"Erfolgreich für Schicht eingetragen!"),u&&ye(u)}catch(z){L(`Fehler: ${z.message}`)}},Yl=async C=>{if(!w)return;const z=await $(`/shifts/${w.id}/signup/`,{method:"POST",body:JSON.stringify(C)});L(z.message||"Als Gast eingetragen!"),u&&ye(u)},Cr=async C=>{try{const z=await $(`/shifts/${C.id}/signup/`,{method:"DELETE"});L(z.message||"Eintragung storniert."),u&&ye(u)}catch(z){L(`Fehler: ${z.message}`)}},[ql,yt]=j.useState(null),Zl=async C=>{let z=C.id;z?await $(`/events/${z}/`,{method:"PATCH",body:JSON.stringify({title:C.title,description:C.description,location:C.location,start_date:C.start_date,end_date:C.end_date})}):z=(await $("/events/",{method:"POST",body:JSON.stringify({title:C.title,description:C.description,location:C.location,start_date:C.start_date,end_date:C.end_date})})).id;for(let Y of C.task_areas){if(!Y.name)continue;let tt=Y.id;tt?await $(`/task-areas/${tt}/`,{method:"PATCH",body:JSON.stringify({name:Y.name,description:Y.description||""})}):tt=(await $("/task-areas/",{method:"POST",body:JSON.stringify({event:z,name:Y.name,description:Y.description||""})})).id;for(let K of Y.shifts)K.id?await $(`/shifts/${K.id}/`,{method:"PATCH",body:JSON.stringify({title:K.title,start_time:K.start_time,end_time:K.end_time,max_participants:K.max_participants,required_skill_ids:K.required_skill_ids||[]})}):await $("/shifts/",{method:"POST",body:JSON.stringify({task_area:tt,title:K.title,start_time:K.start_time,end_time:K.end_time,max_participants:K.max_participants,required_skill_ids:K.required_skill_ids||[]})})}L(C.id?"Veranstaltung & Schichten aktualisiert!":"Veranstaltung erfolgreich erstellt!"),await ge(),me(z)},Ft=async(C,z)=>{const Y=await $(`/templates/${C}/instantiate/`,{method:"POST",body:JSON.stringify(z)});L("Veranstaltung aus Vorlage erstellt!"),await ge(),Y.id&&me(Y.id)},Jl=()=>{u&&window.open(`/api/events/${u}/export_pdf/`,"_blank")},Tr=()=>{window.print()},Xl=()=>{V&&(V.prompt(),V.userChoice.then(C=>{C.outcome==="accepted"&&L("PWA Installation gestartet!"),W(null)}))};return i.jsxs("div",{className:"min-h-screen bg-canvas text-main flex flex-col font-sans selection:bg-surface-hover transition-colors duration-200",children:[D&&i.jsxs("div",{className:"fixed bottom-6 right-6 z-50 bg-emerald-600 text-white px-4 py-2.5 rounded-sm shadow-2xl font-mono text-xs flex items-center gap-2 border border-emerald-400 animate-in fade-in slide-in-from-bottom-3 duration-200",children:[i.jsx(en,{className:"w-4 h-4"}),i.jsx("span",{children:D})]}),i.jsx(ap,{branding:n,user:e,activeTab:y,onChangeTab:v,themeMode:M,onChangeThemeMode:ee,onLogout:ot,onOpenAuth:()=>f(!0),onOpenCreateEvent:()=>{yt(null),v("event-editor")},onOpenTemplates:()=>v("templates"),onOpenProfile:()=>U(!0),onOpenAdmin:()=>v("admin"),pwaInstallPrompt:!!V,onInstallPwa:Xl}),i.jsx("main",{className:"flex-1 max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:x?i.jsx("div",{className:"hallmark-panel p-16 text-center text-xs text-muted font-mono border border-grid",children:"Lade Daten..."}):y==="home"?i.jsx(mp,{events:o,user:e,onSelectEvent:me,onOpenCreateEvent:()=>{yt(null),v("event-editor")},onToggleEventActive:async C=>{try{await $(`/events/${C.id}/`,{method:"PATCH",body:JSON.stringify({is_active:C.is_active===!1})}),ge()}catch(z){alert(z.message||"Aktion fehlgeschlagen.")}},onEditEvent:C=>{yt(C),v("event-editor")},branding:n}):y==="calendar"?i.jsx(pp,{events:o,onSelectEvent:me,branding:n}):y==="admin"&&e&&(e.is_admin_user||e.is_staff||e.is_superuser)?i.jsx(hp,{branding:n,onRefreshBranding:async()=>{const C=await $("/branding/");r(C)},onRefreshEvents:ge,skills:l,onRefreshSkills:et}):y==="event-editor"?i.jsx(xp,{eventToEdit:ql,skills:l,onBack:()=>v("schedule"),onSubmit:Zl}):y==="templates"?i.jsx(gp,{onBack:()=>v("schedule"),onInstantiateTemplate:Ft}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between gap-4 overflow-x-auto pb-2 no-scrollbar font-mono",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs font-bold text-muted uppercase tracking-wider whitespace-nowrap",children:"Ausgewähltes Event:"}),o.map(C=>{const z=u===C.id;return i.jsx("button",{onClick:()=>me(C.id),style:{backgroundColor:z?(n==null?void 0:n.primary_color)||"var(--brand-primary)":void 0,borderColor:z?(n==null?void 0:n.primary_color)||"var(--brand-primary)":void 0},className:`px-3.5 py-1.5 rounded-sm text-xs font-bold transition whitespace-nowrap border ${z?"text-white shadow-sm":"bg-subtle text-muted border-grid hover:text-main"}`,children:C.title},C.id)})]}),e&&i.jsxs("button",{onClick:()=>{yt(null),v("event-editor")},className:"px-3.5 py-1.5 rounded-sm text-xs font-bold bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5 shrink-0",children:[i.jsx(tn,{className:"w-4 h-4"})," Neues Event"]})]}),i.jsx(up,{event:h,user:e,onSignupClick:$t,onCancelClick:Cr,onRemoveUserFromShift:async(C,z)=>{try{const Y=await $(`/shifts/${C.id}/signup/${z}/`,{method:"DELETE"});L(Y.message||"Eintragung entfernt."),ge(),u&&me(u)}catch(Y){alert(Y.message||"Entfernen der Person fehlgeschlagen.")}},onGenerateClaimLink:se,onExportPdf:Jl,onPrintView:Tr,onEditEvent:C=>{yt(C),v("event-editor")}})]})}),i.jsx("footer",{className:"border-t border-grid py-6 text-center text-xs text-muted font-mono no-print",children:i.jsxs("p",{children:[(n==null?void 0:n.app_name)||"Veranstaltungsschichtplaner"," • PWA Enabled • PostgreSQL & Docker Ready"]})}),R&&i.jsx(fp,{onClose:()=>{f(!1),Se(null),O(null)},onSuccess:Gl,claimToken:H,prefilledGuestName:T}),c&&i.jsx(cp,{shift:w,onClose:()=>m(!1),onSubmit:Yl})]})}Es.createRoot(document.getElementById("root")).render(i.jsx(Ed.StrictMode,{children:i.jsx(yp,{})})); diff --git a/frontend/dist/assets/index-D9iEQytx.js b/frontend/dist/assets/index-D9iEQytx.js deleted file mode 100644 index c004d29..0000000 --- a/frontend/dist/assets/index-D9iEQytx.js +++ /dev/null @@ -1,267 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function dd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pa={exports:{}},Ll={},La={exports:{}},B={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var wr=Symbol.for("react.element"),fd=Symbol.for("react.portal"),md=Symbol.for("react.fragment"),pd=Symbol.for("react.strict_mode"),hd=Symbol.for("react.profiler"),xd=Symbol.for("react.provider"),gd=Symbol.for("react.context"),yd=Symbol.for("react.forward_ref"),vd=Symbol.for("react.suspense"),wd=Symbol.for("react.memo"),kd=Symbol.for("react.lazy"),yo=Symbol.iterator;function Nd(e){return e===null||typeof e!="object"?null:(e=yo&&e[yo]||e["@@iterator"],typeof e=="function"?e:null)}var za={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Da=Object.assign,Ma={};function Ln(e,t,n){this.props=e,this.context=t,this.refs=Ma,this.updater=n||za}Ln.prototype.isReactComponent={};Ln.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)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,t,"setState")};Ln.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Aa(){}Aa.prototype=Ln.prototype;function Ni(e,t,n){this.props=e,this.context=t,this.refs=Ma,this.updater=n||za}var Si=Ni.prototype=new Aa;Si.constructor=Ni;Da(Si,Ln.prototype);Si.isPureReactComponent=!0;var vo=Array.isArray,Ra=Object.prototype.hasOwnProperty,ji={current:null},Oa={key:!0,ref:!0,__self:!0,__source:!0};function Ia(e,t,n){var r,l={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Ra.call(t,r)&&!Oa.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,le=T[Y];if(0>>1;Yl(ge,L))fel(ot,ge)?(T[Y]=ot,T[fe]=L,Y=fe):(T[Y]=ge,T[xe]=L,Y=xe);else if(fel(ot,L))T[Y]=ot,T[fe]=L,Y=fe;else break e}}return O}function l(T,O){var L=T.sortIndex-O.sortIndex;return L!==0?L:T.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],d=[],h=1,g=null,x=3,k=!1,y=!1,w=!1,R=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(T){for(var O=n(d);O!==null;){if(O.callback===null)r(d);else if(O.startTime<=T)r(d),O.sortIndex=O.expirationTime,t(u,O);else break;O=n(d)}}function v(T){if(w=!1,m(T),!y)if(n(u)!==null)y=!0,H(S);else{var O=n(d);O!==null&&Se(v,O.startTime-T)}}function S(T,O){y=!1,w&&(w=!1,f(E),E=-1),k=!0;var L=x;try{for(m(O),g=n(u);g!==null&&(!(g.expirationTime>O)||T&&!J());){var Y=g.callback;if(typeof Y=="function"){g.callback=null,x=g.priorityLevel;var le=Y(g.expirationTime<=O);O=e.unstable_now(),typeof le=="function"?g.callback=le:g===n(u)&&r(u),m(O)}else r(u);g=n(u)}if(g!==null)var tt=!0;else{var xe=n(d);xe!==null&&Se(v,xe.startTime-O),tt=!1}return tt}finally{g=null,x=L,k=!1}}var b=!1,N=null,E=-1,U=5,D=-1;function J(){return!(e.unstable_now()-DT||125Y?(T.sortIndex=L,t(d,T),n(u)===null&&T===n(d)&&(w?(f(E),E=-1):w=!0,Se(v,L-Y))):(T.sortIndex=le,t(u,T),y||k||(y=!0,H(S))),T},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(T){var O=x;return function(){var L=x;x=O;try{return T.apply(this,arguments)}finally{x=L}}}})(Ba);Ua.exports=Ba;var Md=Ua.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ad=j,Ie=Md;function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=Object.prototype.hasOwnProperty,Rd=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ko={},No={};function Od(e){return Cs.call(No,e)?!0:Cs.call(ko,e)?!1:Rd.test(e)?No[e]=!0:(ko[e]=!0,!1)}function Id(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $d(e,t,n,r){if(t===null||typeof t>"u"||Id(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ce(e,t,n,r,l,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var he={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){he[e]=new Ce(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];he[t]=new Ce(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){he[e]=new Ce(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){he[e]=new Ce(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){he[e]=new Ce(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){he[e]=new Ce(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){he[e]=new Ce(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){he[e]=new Ce(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){he[e]=new Ce(e,5,!1,e.toLowerCase(),null,!1,!1)});var bi=/[\-:]([a-z])/g;function Ei(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(bi,Ei);he[t]=new Ce(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(bi,Ei);he[t]=new Ce(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(bi,Ei);he[t]=new Ce(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){he[e]=new Ce(e,1,!1,e.toLowerCase(),null,!1,!1)});he.xlinkHref=new Ce("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){he[e]=new Ce(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ci(e,t,n,r){var l=he.hasOwnProperty(t)?he[t]:null;(l!==null?l.type!==0:r||!(2a||l[o]!==s[a]){var u=` -`+l[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{rs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Un(e):""}function Fd(e){switch(e.tag){case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return Un("Suspense");case 19:return Un("SuspenseList");case 0:case 2:case 15:return e=ls(e.type,!1),e;case 11:return e=ls(e.type.render,!1),e;case 1:return e=ls(e.type,!0),e;default:return""}}function zs(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case on:return"Fragment";case sn:return"Portal";case Ts:return"Profiler";case Ti:return"StrictMode";case Ps:return"Suspense";case Ls:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Wa:return(e.displayName||"Context")+".Consumer";case Qa:return(e._context.displayName||"Context")+".Provider";case Pi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Li:return t=e.displayName||null,t!==null?t:zs(e.type)||"Memo";case wt:t=e._payload,e=e._init;try{return zs(e(t))}catch{}}return null}function Vd(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zs(t);case 8:return t===Ti?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Mt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ga(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ud(e){var t=Ga(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lr(e){e._valueTracker||(e._valueTracker=Ud(e))}function Ya(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ga(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function sl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ds(e,t){var n=t.checked;return re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Mt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qa(e,t){t=t.checked,t!=null&&Ci(e,"checked",t,!1)}function Ms(e,t){qa(e,t);var n=Mt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?As(e,t.type,n):t.hasOwnProperty("defaultValue")&&As(e,t.type,Mt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _o(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function As(e,t,n){(t!=="number"||sl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bn=Array.isArray;function yn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=zr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Bd=["Webkit","ms","Moz","O"];Object.keys(Wn).forEach(function(e){Bd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Wn[t]=Wn[e]})});function eu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Wn.hasOwnProperty(e)&&Wn[e]?(""+t).trim():t+"px"}function tu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=eu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Hd=re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Is(e,t){if(t){if(Hd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function $s(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fs=null;function zi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vs=null,vn=null,wn=null;function Co(e){if(e=Sr(e)){if(typeof Vs!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Rl(t),Vs(e.stateNode,e.type,t))}}function nu(e){vn?wn?wn.push(e):wn=[e]:vn=e}function ru(){if(vn){var e=vn,t=wn;if(wn=vn=null,Co(e),t)for(e=0;e>>=0,e===0?32:31-(tf(e)/nf|0)|0}var Dr=64,Mr=4194304;function Hn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ul(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=Hn(a):(s&=o,s!==0&&(r=Hn(s)))}else o=n&~l,o!==0?r=Hn(o):s!==0&&(r=Hn(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function kr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xe(t),e[t]=n}function of(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Gn),Oo=" ",Io=!1;function Su(e,t){switch(e){case"keyup":return Af.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ju(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var an=!1;function Of(e,t){switch(e){case"compositionend":return ju(t);case"keypress":return t.which!==32?null:(Io=!0,Oo);case"textInput":return e=t.data,e===Oo&&Io?null:e;default:return null}}function If(e,t){if(an)return e==="compositionend"||!Fi&&Su(e,t)?(e=ku(),Yr=Oi=jt=null,an=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Uo(n)}}function Cu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tu(){for(var e=window,t=sl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=sl(e.document)}return t}function Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Kf(e){var t=Tu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cu(n.ownerDocument.documentElement,n)){if(r!==null&&Vi(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=Bo(n,s);var o=Bo(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,un=null,Ks=null,qn=null,Gs=!1;function Ho(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gs||un==null||un!==sl(r)||(r=un,"selectionStart"in r&&Vi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qn&&ar(qn,r)||(qn=r,r=fl(Ks,"onSelect"),0fn||(e.current=ei[fn],ei[fn]=null,fn--)}function q(e,t){fn++,ei[fn]=e.current,e.current=t}var At={},Ne=Ot(At),Le=Ot(!1),Yt=At;function _n(e,t){var n=e.type.contextTypes;if(!n)return At;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ze(e){return e=e.childContextTypes,e!=null}function pl(){X(Le),X(Ne)}function Zo(e,t,n){if(Ne.current!==At)throw Error(_(168));q(Ne,t),q(Le,n)}function Iu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(_(108,Vd(e)||"Unknown",l));return re({},n,r)}function hl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||At,Yt=Ne.current,q(Ne,e),q(Le,Le.current),!0}function Xo(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Iu(e,t,Yt),r.__reactInternalMemoizedMergedChildContext=e,X(Le),X(Ne),q(Ne,e)):X(Le),q(Le,n)}var ut=null,Ol=!1,ys=!1;function $u(e){ut===null?ut=[e]:ut.push(e)}function sm(e){Ol=!0,$u(e)}function It(){if(!ys&&ut!==null){ys=!0;var e=0,t=K;try{var n=ut;for(K=1;e>=o,l-=o,ct=1<<32-Xe(t)+l|n<E?(U=N,N=null):U=N.sibling;var D=x(f,N,m[E],v);if(D===null){N===null&&(N=U);break}e&&N&&D.alternate===null&&t(f,N),c=s(D,c,E),b===null?S=D:b.sibling=D,b=D,N=U}if(E===m.length)return n(f,N),ee&&Vt(f,E),S;if(N===null){for(;EE?(U=N,N=null):U=N.sibling;var J=x(f,N,D.value,v);if(J===null){N===null&&(N=U);break}e&&N&&J.alternate===null&&t(f,N),c=s(J,c,E),b===null?S=J:b.sibling=J,b=J,N=U}if(D.done)return n(f,N),ee&&Vt(f,E),S;if(N===null){for(;!D.done;E++,D=m.next())D=g(f,D.value,v),D!==null&&(c=s(D,c,E),b===null?S=D:b.sibling=D,b=D);return ee&&Vt(f,E),S}for(N=r(f,N);!D.done;E++,D=m.next())D=k(N,f,E,D.value,v),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?E:D.key),c=s(D,c,E),b===null?S=D:b.sibling=D,b=D);return e&&N.forEach(function(A){return t(f,A)}),ee&&Vt(f,E),S}function R(f,c,m,v){if(typeof m=="object"&&m!==null&&m.type===on&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Pr:e:{for(var S=m.key,b=c;b!==null;){if(b.key===S){if(S=m.type,S===on){if(b.tag===7){n(f,b.sibling),c=l(b,m.props.children),c.return=f,f=c;break e}}else if(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wt&&ta(S)===b.type){n(f,b.sibling),c=l(b,m.props),c.ref=$n(f,b,m),c.return=f,f=c;break e}n(f,b);break}else t(f,b);b=b.sibling}m.type===on?(c=Gt(m.props.children,f.mode,v,m.key),c.return=f,f=c):(v=rl(m.type,m.key,m.props,null,f.mode,v),v.ref=$n(f,c,m),v.return=f,f=v)}return o(f);case sn:e:{for(b=m.key;c!==null;){if(c.key===b)if(c.tag===4&&c.stateNode.containerInfo===m.containerInfo&&c.stateNode.implementation===m.implementation){n(f,c.sibling),c=l(c,m.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=bs(m,f.mode,v),c.return=f,f=c}return o(f);case wt:return b=m._init,R(f,c,b(m._payload),v)}if(Bn(m))return y(f,c,m,v);if(Mn(m))return w(f,c,m,v);Vr(f,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,m),c.return=f,f=c):(n(f,c),c=_s(m,f.mode,v),c.return=f,f=c),o(f)):n(f,c)}return R}var En=Bu(!0),Hu=Bu(!1),yl=Ot(null),vl=null,hn=null,Qi=null;function Wi(){Qi=hn=vl=null}function Ki(e){var t=yl.current;X(yl),e._currentValue=t}function ri(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nn(e,t){vl=e,Qi=hn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pe=!0),e.firstContext=null)}function We(e){var t=e._currentValue;if(Qi!==e)if(e={context:e,memoizedValue:t,next:null},hn===null){if(vl===null)throw Error(_(308));hn=e,vl.dependencies={lanes:0,firstContext:e}}else hn=hn.next=e;return t}var Qt=null;function Gi(e){Qt===null?Qt=[e]:Qt.push(e)}function Qu(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Gi(t)):(n.next=l.next,l.next=n),t.interleaved=n,ht(e,r)}function ht(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var kt=!1;function Yi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Q&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,ht(e,n)}return l=r.interleaved,l===null?(t.next=t,Gi(r)):(t.next=l.next,l.next=t),r.interleaved=t,ht(e,n)}function Zr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mi(e,n)}}function na(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function wl(e,t,n,r){var l=e.updateQueue;kt=!1;var s=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,d=u.next;u.next=null,o===null?s=d:o.next=d,o=u;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=d:a.next=d,h.lastBaseUpdate=u))}if(s!==null){var g=l.baseState;o=0,h=d=u=null,a=s;do{var x=a.lane,k=a.eventTime;if((r&x)===x){h!==null&&(h=h.next={eventTime:k,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;switch(x=t,k=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){g=y.call(k,g,x);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,x=typeof y=="function"?y.call(k,g,x):y,x==null)break e;g=re({},g,x);break e;case 2:kt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,x=l.effects,x===null?l.effects=[a]:x.push(a))}else k={eventTime:k,lane:x,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(d=h=k,u=g):h=h.next=k,o|=x;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;x=a,a=x.next,x.next=null,l.lastBaseUpdate=x,l.shared.pending=null}}while(!0);if(h===null&&(u=g),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);Xt|=o,e.lanes=o,e.memoizedState=g}}function ra(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ws.transition;ws.transition={};try{e(!1),t()}finally{K=n,ws.transition=r}}function uc(){return Ke().memoizedState}function um(e,t,n){var r=zt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e))dc(t,n);else if(n=Qu(e,t,n,r),n!==null){var l=be();Je(n,e,r,l),fc(n,t,r)}}function cm(e,t,n){var r=zt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))dc(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(l.hasEagerState=!0,l.eagerState=a,et(a,o)){var u=t.interleaved;u===null?(l.next=l,Gi(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Qu(e,t,l,r),n!==null&&(l=be(),Je(n,e,r,l),fc(n,t,r))}}function cc(e){var t=e.alternate;return e===ne||t!==null&&t===ne}function dc(e,t){Zn=Nl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mi(e,n)}}var Sl={readContext:We,useCallback:ve,useContext:ve,useEffect:ve,useImperativeHandle:ve,useInsertionEffect:ve,useLayoutEffect:ve,useMemo:ve,useReducer:ve,useRef:ve,useState:ve,useDebugValue:ve,useDeferredValue:ve,useTransition:ve,useMutableSource:ve,useSyncExternalStore:ve,useId:ve,unstable_isNewReconciler:!1},dm={readContext:We,useCallback:function(e,t){return rt().memoizedState=[e,t===void 0?null:t],e},useContext:We,useEffect:sa,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Jr(4194308,4,lc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Jr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Jr(4,2,e,t)},useMemo:function(e,t){var n=rt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=rt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=um.bind(null,ne,e),[r.memoizedState,e]},useRef:function(e){var t=rt();return e={current:e},t.memoizedState=e},useState:la,useDebugValue:ro,useDeferredValue:function(e){return rt().memoizedState=e},useTransition:function(){var e=la(!1),t=e[0];return e=am.bind(null,e[1]),rt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ne,l=rt();if(ee){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),de===null)throw Error(_(349));Zt&30||qu(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,sa(Xu.bind(null,r,s,e),[e]),r.flags|=2048,xr(9,Zu.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=rt(),t=de.identifierPrefix;if(ee){var n=dt,r=ct;n=(r&~(1<<32-Xe(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[lt]=t,e[dr]=r,Nc(e,t,!1,!1),t.stateNode=e;e:{switch(o=$s(n,r),n){case"dialog":Z("cancel",e),Z("close",e),l=r;break;case"iframe":case"object":case"embed":Z("load",e),l=r;break;case"video":case"audio":for(l=0;lPn&&(t.flags|=128,r=!0,Fn(s,!1),t.lanes=4194304)}else{if(!r)if(e=kl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ee)return we(t),null}else 2*ie()-s.renderingStartTime>Pn&&n!==1073741824&&(t.flags|=128,r=!0,Fn(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ie(),t.sibling=null,n=te.current,q(te,r?n&1|2:n&1),t):(we(t),null);case 22:case 23:return uo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ae&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function vm(e,t){switch(Bi(t),t.tag){case 1:return ze(t.type)&&pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(),X(Le),X(Ne),Xi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zi(t),null;case 13:if(X(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));bn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(te),null;case 4:return Cn(),null;case 10:return Ki(t.type._context),null;case 22:case 23:return uo(),null;case 24:return null;default:return null}}var Br=!1,ke=!1,wm=typeof WeakSet=="function"?WeakSet:Set,P=null;function xn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){se(e,t,r)}else n.current=null}function fi(e,t,n){try{n()}catch(r){se(e,t,r)}}var xa=!1;function km(e,t){if(Ys=cl,e=Tu(),Vi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,d=0,h=0,g=e,x=null;t:for(;;){for(var k;g!==n||l!==0&&g.nodeType!==3||(a=o+l),g!==s||r!==0&&g.nodeType!==3||(u=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(k=g.firstChild)!==null;)x=g,g=k;for(;;){if(g===e)break t;if(x===n&&++d===l&&(a=o),x===s&&++h===r&&(u=o),(k=g.nextSibling)!==null)break;g=x,x=g.parentNode}g=k}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(qs={focusedElem:e,selectionRange:n},cl=!1,P=t;P!==null;)if(t=P,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,P=e;else for(;P!==null;){t=P;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,R=y.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ye(t.type,w),R);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(v){se(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,P=e;break}P=t.return}return y=xa,xa=!1,y}function Xn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&fi(t,n,s)}l=l.next}while(l!==r)}}function Fl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function mi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _c(e){var t=e.alternate;t!==null&&(e.alternate=null,_c(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lt],delete t[dr],delete t[Js],delete t[rm],delete t[lm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function ga(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ml));else if(r!==4&&(e=e.child,e!==null))for(pi(e,t,n),e=e.sibling;e!==null;)pi(e,t,n),e=e.sibling}function hi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hi(e,t,n),e=e.sibling;e!==null;)hi(e,t,n),e=e.sibling}var me=null,qe=!1;function vt(e,t,n){for(n=n.child;n!==null;)Ec(e,t,n),n=n.sibling}function Ec(e,t,n){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(zl,n)}catch{}switch(n.tag){case 5:ke||xn(n,t);case 6:var r=me,l=qe;me=null,vt(e,t,n),me=r,qe=l,me!==null&&(qe?(e=me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):me.removeChild(n.stateNode));break;case 18:me!==null&&(qe?(e=me,n=n.stateNode,e.nodeType===8?gs(e.parentNode,n):e.nodeType===1&&gs(e,n),ir(e)):gs(me,n.stateNode));break;case 4:r=me,l=qe,me=n.stateNode.containerInfo,qe=!0,vt(e,t,n),me=r,qe=l;break;case 0:case 11:case 14:case 15:if(!ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&fi(n,t,o),l=l.next}while(l!==r)}vt(e,t,n);break;case 1:if(!ke&&(xn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){se(n,t,a)}vt(e,t,n);break;case 21:vt(e,t,n);break;case 22:n.mode&1?(ke=(r=ke)||n.memoizedState!==null,vt(e,t,n),ke=r):vt(e,t,n);break;default:vt(e,t,n)}}function ya(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new wm),t.forEach(function(r){var l=Pm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Ge(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~s}if(r=l,r=ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sm(r/1960))-r,10e?16:e,_t===null)var r=!1;else{if(e=_t,_t=null,bl=0,Q&6)throw Error(_(331));var l=Q;for(Q|=4,P=e.current;P!==null;){var s=P,o=s.child;if(P.flags&16){var a=s.deletions;if(a!==null){for(var u=0;uie()-oo?Kt(e,0):io|=n),De(e,t)}function Ac(e,t){t===0&&(e.mode&1?(t=Mr,Mr<<=1,!(Mr&130023424)&&(Mr=4194304)):t=1);var n=be();e=ht(e,t),e!==null&&(kr(e,t,n),De(e,n))}function Tm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ac(e,n)}function Pm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Ac(e,n)}var Rc;Rc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Le.current)Pe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Pe=!1,gm(e,t,n);Pe=!!(e.flags&131072)}else Pe=!1,ee&&t.flags&1048576&&Fu(t,gl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;el(e,t),e=t.pendingProps;var l=_n(t,Ne.current);Nn(t,n),l=eo(null,t,r,e,l,n);var s=to();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ze(r)?(s=!0,hl(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Yi(t),l.updater=$l,t.stateNode=l,l._reactInternals=t,si(t,r,e,n),t=ai(null,t,r,!0,s,n)):(t.tag=0,ee&&s&&Ui(t),_e(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(el(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=zm(r),e=Ye(r,e),l){case 0:t=oi(null,t,r,e,n);break e;case 1:t=ma(null,t,r,e,n);break e;case 11:t=da(null,t,r,e,n);break e;case 14:t=fa(null,t,r,Ye(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ye(r,l),oi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ye(r,l),ma(e,t,r,l,n);case 3:e:{if(vc(t),e===null)throw Error(_(387));r=t.pendingProps,s=t.memoizedState,l=s.element,Wu(e,t),wl(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=Tn(Error(_(423)),t),t=pa(e,t,r,n,l);break e}else if(r!==l){l=Tn(Error(_(424)),t),t=pa(e,t,r,n,l);break e}else for(Re=Tt(t.stateNode.containerInfo.firstChild),Oe=t,ee=!0,Ze=null,n=Hu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bn(),r===l){t=xt(e,t,n);break e}_e(e,t,r,n)}t=t.child}return t;case 5:return Ku(t),e===null&&ni(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,o=l.children,Zs(r,l)?o=null:s!==null&&Zs(r,s)&&(t.flags|=32),yc(e,t),_e(e,t,o,n),t.child;case 6:return e===null&&ni(t),null;case 13:return wc(e,t,n);case 4:return qi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=En(t,null,r,n):_e(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ye(r,l),da(e,t,r,l,n);case 7:return _e(e,t,t.pendingProps,n),t.child;case 8:return _e(e,t,t.pendingProps.children,n),t.child;case 12:return _e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,o=l.value,q(yl,r._currentValue),r._currentValue=o,s!==null)if(et(s.value,o)){if(s.children===l.children&&!Le.current){t=xt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=ft(-1,n&-n),u.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?u.next=u:(u.next=h.next,h.next=u),d.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),ri(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(_(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ri(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}_e(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Nn(t,n),l=We(l),r=r(l),t.flags|=1,_e(e,t,r,n),t.child;case 14:return r=t.type,l=Ye(r,t.pendingProps),l=Ye(r.type,l),fa(e,t,r,l,n);case 15:return xc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ye(r,l),el(e,t),t.tag=1,ze(r)?(e=!0,hl(t)):e=!1,Nn(t,n),mc(t,r,l),si(t,r,l,n),ai(null,t,r,!0,e,n);case 19:return kc(e,t,n);case 22:return gc(e,t,n)}throw Error(_(156,t.tag))};function Oc(e,t){return cu(e,t)}function Lm(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function He(e,t,n,r){return new Lm(e,t,n,r)}function fo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zm(e){if(typeof e=="function")return fo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pi)return 11;if(e===Li)return 14}return 2}function Dt(e,t){var n=e.alternate;return n===null?(n=He(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function rl(e,t,n,r,l,s){var o=2;if(r=e,typeof e=="function")fo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case on:return Gt(n.children,l,s,t);case Ti:o=8,l|=8;break;case Ts:return e=He(12,n,t,l|2),e.elementType=Ts,e.lanes=s,e;case Ps:return e=He(13,n,t,l),e.elementType=Ps,e.lanes=s,e;case Ls:return e=He(19,n,t,l),e.elementType=Ls,e.lanes=s,e;case Ka:return Ul(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qa:o=10;break e;case Wa:o=9;break e;case Pi:o=11;break e;case Li:o=14;break e;case wt:o=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=He(o,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Gt(e,t,n,r){return e=He(7,e,r,t),e.lanes=n,e}function Ul(e,t,n,r){return e=He(22,e,r,t),e.elementType=Ka,e.lanes=n,e.stateNode={isHidden:!1},e}function _s(e,t,n){return e=He(6,e,null,t),e.lanes=n,e}function bs(e,t,n){return t=He(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Dm(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=is(0),this.expirationTimes=is(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=is(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function mo(e,t,n,r,l,s,o,a,u){return e=new Dm(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=He(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yi(s),e}function Mm(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vc)}catch(e){console.error(e)}}Vc(),Va.exports=$e;var $m=Va.exports,ba=$m;Es.createRoot=ba.createRoot,Es.hydrateRoot=ba.hydrateRoot;/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Uc=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Vm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Um=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:s,iconNode:o,...a},u)=>j.createElement("svg",{ref:u,...Vm,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Uc("lucide",l),...a},[...o.map(([d,h])=>j.createElement(d,h)),...Array.isArray(s)?s:[s]]));/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const F=(e,t)=>{const n=j.forwardRef(({className:r,...l},s)=>j.createElement(Um,{ref:s,iconNode:t,className:Uc(`lucide-${Fm(e)}`,r),...l}));return n.displayName=`${e}`,n};/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bc=F("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hc=F("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bm=F("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ea=F("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _r=F("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hm=F("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qm=F("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const br=F("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const en=F("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yr=F("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wm=F("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qc=F("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Km=F("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ca=F("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kl=F("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gm=F("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ym=F("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qm=F("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const go=F("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zm=F("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xm=F("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jm=F("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vr=F("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ep=F("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tn=F("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tp=F("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wc=F("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ta=F("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const np=F("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rp=F("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kc=F("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gc=F("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lp=F("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sp=F("TableProperties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bt=F("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tl=F("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ip=F("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wi=F("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ll=F("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const op=F("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** - * @license lucide-react v0.424.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yc=F("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ap({branding:e,user:t,activeTab:n,onChangeTab:r,themeMode:l,onChangeThemeMode:s,onLogout:o,onOpenAuth:a,onOpenCreateEvent:u,onOpenTemplates:d,onOpenProfile:h,onOpenAdmin:g,pwaInstallPrompt:x,onInstallPwa:k}){const y=(e==null?void 0:e.primary_color)||"var(--brand-primary)",w=()=>{s(l==="dark"?"light":l==="light"?"auto":"dark")};return i.jsxs("header",{className:"bg-surface border-b border-grid sticky top-0 z-40",children:[i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 shrink-0",children:[i.jsx("div",{onClick:()=>r("home"),style:{backgroundColor:y},className:"w-8 h-8 rounded-sm flex items-center justify-center text-white font-bold cursor-pointer shadow-sm",children:e!=null&&e.logo_url?i.jsx("img",{src:e.logo_url,alt:"Logo",className:"w-4 h-4 object-contain"}):i.jsx(_r,{className:"w-4 h-4"})}),i.jsxs("div",{onClick:()=>r("home"),className:"cursor-pointer",children:[i.jsx("h1",{className:"font-serif text-base font-bold tracking-tight text-main leading-none",children:(e==null?void 0:e.app_name)||"Schichtplaner"}),i.jsx("div",{className:"text-[10px] font-mono text-muted mt-1 uppercase tracking-wider flex items-center gap-1.5",children:t?i.jsxs("span",{className:"text-emerald-500 font-semibold",children:["[ ",t.display_name||t.username," ]"]}):i.jsx("span",{className:"text-amber-500 font-semibold",children:"[ GAST-MODUS ]"})})]})]}),i.jsxs("nav",{className:"hidden md:flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>r("home"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="home"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(Ca,{className:"w-3.5 h-3.5"})," Startseite"]}),i.jsxs("button",{onClick:()=>r("calendar"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="calendar"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(Ea,{className:"w-3.5 h-3.5"})," Kalender"]}),((t==null?void 0:t.is_admin_user)||(t==null?void 0:t.is_staff)||(t==null?void 0:t.is_superuser))&&i.jsxs("button",{onClick:()=>r("admin"),className:`px-3 py-1.5 rounded-sm text-xs font-mono transition flex items-center gap-1.5 border ${n==="admin"?"bg-surface-hover text-main font-bold border-grid":"text-muted hover:text-main border-transparent"}`,children:[i.jsx(Ta,{className:"w-3.5 h-3.5 text-indigo-400"})," Admin"]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("button",{onClick:w,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5",title:`Design-Modus: ${l.toUpperCase()}`,children:l==="dark"?i.jsxs(i.Fragment,{children:[i.jsx(Xm,{className:"w-3.5 h-3.5 text-indigo-400"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"DARK"})]}):l==="light"?i.jsxs(i.Fragment,{children:[i.jsx(lp,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"LIGHT"})]}):i.jsxs(i.Fragment,{children:[i.jsx(Zm,{className:"w-3.5 h-3.5 text-blue-500"}),i.jsx("span",{className:"hidden lg:inline text-[11px] font-bold",children:"AUTO"})]})}),x&&i.jsxs("button",{onClick:k,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-emerald-500/10 text-emerald-500 border border-emerald-500/20 hover:bg-emerald-500/20 transition flex items-center gap-1",children:[i.jsx(Gc,{className:"w-3 h-3"})," PWA"]}),t?i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:u,style:{backgroundColor:y},className:"h-8 px-3 rounded-sm text-xs font-mono font-bold text-white transition flex items-center gap-1 shadow-sm hover:brightness-110",children:[i.jsx(tn,{className:"w-3.5 h-3.5"})," Event"]}),i.jsxs("button",{onClick:d,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition hidden sm:flex items-center gap-1",title:"Vorlagen",children:[i.jsx(Kl,{className:"w-3.5 h-3.5 text-muted"})," Vorlagen"]}),i.jsxs("button",{onClick:h,className:"h-8 px-2.5 rounded-sm text-xs font-mono bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1",title:"Profil & Namen ändern",children:[i.jsx(vr,{className:"w-3.5 h-3.5 text-amber-500"})," Profil"]}),(t.is_admin_user||t.is_staff||t.is_superuser)&&i.jsxs("button",{onClick:()=>r("admin"),className:`h-8 px-2.5 rounded-sm text-xs font-mono transition flex items-center gap-1 border ${n==="admin"?"bg-indigo-500/20 text-indigo-300 border-indigo-500/40 font-bold":"bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 border-indigo-500/30"}`,title:"Admin-Zentrale",children:[i.jsx(Ta,{className:"w-3.5 h-3.5"})," Admin"]}),i.jsx("div",{className:"h-4 w-px bg-grid mx-1"}),i.jsx("button",{onClick:o,className:"h-8 w-8 rounded-sm text-muted hover:text-red-500 hover:bg-red-500/10 border border-transparent hover:border-red-500/20 transition flex items-center justify-center",title:"Abmelden",children:i.jsx(Ym,{className:"w-3.5 h-3.5"})})]}):i.jsxs("button",{onClick:a,style:{backgroundColor:y},className:"h-8 px-3.5 rounded-sm text-xs font-mono font-bold text-white transition hover:brightness-110 flex items-center gap-1.5 shadow-sm",children:[i.jsx(ll,{className:"w-3.5 h-3.5"})," Anmelden"]})]})]}),i.jsxs("div",{className:"flex md:hidden items-center justify-around border-t border-grid py-2 bg-subtle text-xs font-mono",children:[i.jsxs("button",{onClick:()=>r("home"),className:`flex items-center gap-1 px-3 py-1.5 rounded-sm border ${n==="home"?"text-main font-bold bg-surface border-grid":"text-muted border-transparent"}`,children:[i.jsx(Ca,{className:"w-3.5 h-3.5"})," Start"]}),i.jsxs("button",{onClick:()=>r("calendar"),className:`flex items-center gap-1 px-3 py-1.5 rounded-sm border ${n==="calendar"?"text-main font-bold bg-surface border-grid":"text-muted border-transparent"}`,children:[i.jsx(Ea,{className:"w-3.5 h-3.5"})," Termine"]}),i.jsxs("button",{onClick:()=>r("schedule"),className:`flex items-center gap-1 px-3 py-1.5 rounded-sm border ${n==="schedule"?"text-main font-bold bg-surface border-grid":"text-muted border-transparent"}`,children:[i.jsx(sp,{className:"w-3.5 h-3.5"})," Schichtplan"]})]})]})}function up({event:e,user:t,onSignupClick:n,onCancelClick:r,onRemoveUserFromShift:l,onGenerateClaimLink:s,onExportPdf:o,onPrintView:a,onEditEvent:u}){var g,x;if(!e||!e.task_areas||e.task_areas.length===0)return i.jsxs("div",{className:"hallmark-panel rounded-sm p-12 text-center border border-grid font-mono",children:[i.jsx(yr,{className:"w-8 h-8 text-muted mx-auto mb-3"}),i.jsx("h3",{className:"font-serif text-xl font-bold text-main uppercase",children:"Keine Aufgabenfelder vorhanden"}),i.jsx("p",{className:"text-xs text-muted mt-1 mb-4",children:"[ Event hat noch keine definierten Aufgabenfelder oder Schichten ]"}),t&&(t.is_admin_user||t.is_staff||t.is_superuser||(e==null?void 0:e.created_by)===t.id||((g=e==null?void 0:e.created_by)==null?void 0:g.id)===t.id)&&u&&i.jsxs("button",{onClick:()=>u(e),className:"px-4 py-2 rounded-sm bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 border border-indigo-500/30 font-bold text-xs inline-flex items-center gap-2",children:[i.jsx(vr,{className:"w-4 h-4"})," SCHICHTEN & BEREICHE ANLEGEN"]})]});const d=!t,h=t&&(t.is_admin_user||t.is_staff||t.is_superuser||e.created_by===t.id||((x=e.created_by)==null?void 0:x.id)===t.id);return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid flex flex-col md:flex-row md:items-center justify-between gap-4",children:[i.jsxs("div",{className:"space-y-1 font-mono",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted mb-1",children:[i.jsxs("span",{className:"bg-subtle px-2.5 py-0.5 rounded-sm border border-grid font-bold text-main",children:[new Date(e.start_date).toLocaleDateString("de-DE")," — ",new Date(e.end_date).toLocaleDateString("de-DE")]}),e.location&&i.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[i.jsx(go,{className:"w-3.5 h-3.5 shrink-0"}),e.location]}),e.is_active===!1&&i.jsx("span",{className:"px-2 py-0.5 rounded-sm bg-amber-500/10 text-amber-500 border border-amber-500/20 font-bold",children:"[ DEAKTIVIERT ]"})]}),i.jsx("h2",{className:"font-serif text-3xl sm:text-4xl font-bold uppercase tracking-tight text-main",children:e.title}),e.description&&i.jsx("p",{className:"text-xs font-sans text-muted max-w-2xl mt-1",children:e.description})]}),i.jsxs("div",{className:"flex items-center gap-2 no-print font-mono text-xs shrink-0",children:[h&&u&&i.jsxs("button",{onClick:()=>u(e),className:"px-3.5 py-1.5 rounded-sm bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 border border-indigo-500/30 transition flex items-center gap-1.5 font-bold",title:"Schichten und Aufgabenbereiche für diese Veranstaltung bearbeiten",children:[i.jsx(vr,{className:"w-3.5 h-3.5"})," SCHICHTEN BEARBEITEN"]}),i.jsxs("button",{onClick:a,className:"px-3.5 py-1.5 rounded-sm bg-surface hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5 font-bold",children:[i.jsx(tp,{className:"w-3.5 h-3.5"})," DRUCKEN"]}),i.jsxs("button",{onClick:o,className:"px-3.5 py-1.5 rounded-sm bg-surface hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5 font-bold",children:[i.jsx(Wm,{className:"w-3.5 h-3.5"})," PDF"]})]})]}),d&&i.jsxs("div",{className:"p-3.5 rounded-sm bg-amber-500/10 border border-amber-500/20 text-amber-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(Kc,{className:"w-4 h-4 shrink-0 text-amber-500"}),i.jsxs("span",{children:["[ GAST-DATENSCHUTZ ]: Belegungszahlen sichtbar, Namensanzeige aus Datenschutzgründen ",i.jsx("strong",{children:"anonymisiert"}),"."]})]}),i.jsx("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden",children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-left border-collapse",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-subtle border-b border-grid text-[11px] font-mono text-muted uppercase tracking-wider",children:[i.jsx("th",{className:"py-3.5 px-4 w-1/4",children:"Aufgabenfeld"}),i.jsx("th",{className:"py-3.5 px-4 w-1/4",children:"Schicht & Zeitraum"}),i.jsx("th",{className:"py-3.5 px-4 w-1/6",children:"Qualifikation"}),i.jsx("th",{className:"py-3.5 px-4 w-1/4",children:"Belegung & Personen"}),i.jsx("th",{className:"py-3.5 px-4 w-1/6 text-right",children:"Aktion"})]})}),i.jsx("tbody",{className:"divide-y divide-grid text-xs font-sans",children:e.task_areas.map(k=>!k.shifts||k.shifts.length===0?i.jsxs("tr",{children:[i.jsx("td",{className:"py-3.5 px-4 font-serif text-lg font-bold text-main uppercase",children:k.name}),i.jsx("td",{colSpan:4,className:"py-3.5 px-4 text-muted font-mono text-[11px]",children:"[ Keine Schichten angelegt ]"})]},`area-${k.id}`):k.shifts.map((y,w)=>{const R=w===0,f=y.is_full,m=!!(t?y.signups.find(S=>!S.is_guest&&S.display_name===t.display_name):null),v=y.required_skills&&y.required_skills.length>0;return i.jsxs("tr",{className:"hover:bg-surface-hover/60 transition",children:[R?i.jsxs("td",{rowSpan:k.shifts.length,className:"py-3.5 px-4 font-serif text-lg font-bold text-main uppercase bg-subtle/80 align-top border-r border-grid",children:[i.jsx("div",{children:k.name}),k.description&&i.jsx("div",{className:"text-[11px] font-sans font-normal text-muted mt-0.5",children:k.description})]}):null,i.jsxs("td",{className:"py-3.5 px-4",children:[i.jsx("div",{className:"font-semibold text-main",children:y.title}),i.jsxs("div",{className:"text-[11px] font-mono text-muted flex items-center gap-1 mt-0.5",children:[i.jsx(yr,{className:"w-3 h-3 text-muted shrink-0"}),i.jsxs("span",{children:[y.start_time," — ",y.end_time," Uhr"]})]})]}),i.jsx("td",{className:"py-3.5 px-4 font-mono",children:v?i.jsx("div",{className:"flex flex-wrap gap-1",children:y.required_skills.map(S=>i.jsxs("span",{style:{backgroundColor:`${S.color}15`,borderColor:`${S.color}35`,color:S.color},className:"px-2 py-0.5 rounded-sm text-[10px] font-semibold border flex items-center gap-1",children:[i.jsx(Bm,{className:"w-3 h-3 shrink-0"})," ",S.name]},S.id))}):i.jsx("span",{className:"text-[11px] text-muted",children:"—"})}),i.jsxs("td",{className:"py-3.5 px-4 font-mono",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsxs("span",{className:`px-2 py-0.5 rounded-sm text-[11px] font-bold border ${f?"bg-red-500/10 text-red-500 border-red-500/20":"bg-emerald-500/10 text-emerald-500 border-emerald-500/20"}`,children:["[ ",y.signups_count," / ",y.max_participants," BELEGT ]"]})}),i.jsx("div",{className:"mt-2 space-y-1 font-sans",children:y.signups.map(S=>i.jsxs("div",{className:"text-[11px] text-muted flex items-center justify-between gap-2 p-1.5 rounded-sm bg-subtle border border-grid",children:[i.jsxs("div",{className:"flex items-center gap-1.5 truncate",children:[i.jsx(Tl,{className:"w-3 h-3 text-muted shrink-0"}),i.jsx("span",{className:"truncate",children:S.display_name}),S.is_guest&&i.jsx("span",{className:"text-[9px] font-mono text-amber-500 px-1 rounded-sm bg-amber-500/10 border border-amber-500/20 font-bold",children:"GAST"})]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[t&&S.is_guest&&s&&i.jsxs("button",{onClick:()=>s(S),className:"text-indigo-400 hover:text-indigo-300 transition p-1 rounded-sm bg-indigo-500/10 hover:bg-indigo-500/20 border border-indigo-500/20 flex items-center gap-1 text-[10px] font-mono font-bold",title:"Konto-Einladungslink für diese Gast-Eintragung kopieren",children:[i.jsx(ip,{className:"w-3 h-3"})," LINK"]}),h&&l&&i.jsx("button",{onClick:()=>l(y,S.id),className:"text-muted hover:text-red-500 transition p-1 rounded-sm hover:bg-red-500/10",title:"Person aus dieser Schicht entfernen",children:i.jsx(wi,{className:"w-3.5 h-3.5"})})]})]},S.id))})]}),i.jsx("td",{className:"py-3.5 px-4 text-right font-mono",children:m?i.jsxs("button",{onClick:()=>r(y),className:"px-3 py-1.5 rounded-sm text-xs font-semibold bg-red-500/10 hover:bg-red-500/20 text-red-500 border border-red-500/20 transition flex items-center gap-1 ml-auto",children:[i.jsx(wi,{className:"w-3.5 h-3.5"})," AUSTRAGEN"]}):f?i.jsx("span",{className:"text-xs text-muted font-bold",children:"[ VOLL ]"}):i.jsxs("button",{onClick:()=>n(y),style:{backgroundColor:"var(--brand-primary)"},className:"px-3.5 py-1.5 rounded-sm text-xs font-bold text-white transition hover:brightness-110 flex items-center gap-1 ml-auto shadow-sm",children:[i.jsx(en,{className:"w-3.5 h-3.5"})," EINTRAGEN"]})})]},`shift-${y.id}`)}))})]})})})]})}function cp({shift:e,onClose:t,onSubmit:n}){const[r,l]=j.useState(""),[s,o]=j.useState(""),[a,u]=j.useState(!1),[d,h]=j.useState(""),[g,x]=j.useState(!1);j.useEffect(()=>{const w=localStorage.getItem("guest_display_name")||"";w&&l(w)},[]);const k=()=>{const w="acaptcha-verified-"+Math.random().toString(36).substring(2,10);o(w),u(!0)},y=async w=>{if(w.preventDefault(),h(""),!r.trim()){h("Bitte gib deinen Namen ein.");return}if(!a||!s){h("Bitte löse zuerst das Captcha.");return}localStorage.setItem("guest_display_name",r.trim()),x(!0);try{await n({guest_name:r.trim(),captcha_token:s}),t()}catch(R){h(R.message||"Eintragen fehlgeschlagen.")}finally{x(!1)}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/80 backdrop-blur-sm",children:i.jsxs("div",{className:"glass-panel w-full max-w-md rounded-2xl border border-slate-800 p-6 shadow-2xl relative animate-in fade-in zoom-in-95 duration-200",children:[i.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-400 hover:text-white rounded-lg transition",children:i.jsx(Yc,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/10 text-blue-400 border border-blue-500/20 flex items-center justify-center",children:i.jsx(Tl,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-lg text-white",children:"Als Gast eintragen"}),i.jsxs("p",{className:"text-xs text-slate-400",children:["Schicht: ",e==null?void 0:e.title," (",e==null?void 0:e.start_time," - ",e==null?void 0:e.end_time,")"]})]})]}),d&&i.jsxs("div",{className:"mb-4 p-3 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-xs flex items-center gap-2",children:[i.jsx(br,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:d})]}),i.jsxs("form",{onSubmit:y,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Dein Name / Anzeigename"}),i.jsx("input",{type:"text",required:!0,value:r,onChange:w=>l(w.target.value),placeholder:"z. B. Alex Muster",className:"w-full px-3.5 py-2.5 rounded-xl bg-slate-900 border border-slate-800 text-white text-sm focus:outline-none focus:border-blue-500 transition"}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-1",children:"Dein Name wird in deiner Sitzung gespeichert. Falls du später ein Konto mit diesem Namen erstellst, werden deine Gast-Schichten automatisch übertragen!"})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/90 border border-slate-800 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-xs font-semibold text-slate-300 flex items-center gap-1.5",children:[i.jsx(rp,{className:"w-4 h-4 text-emerald-400"})," Security Check (acaptcha.vercel.app)"]}),i.jsx("a",{href:"https://acaptcha.vercel.app/",target:"_blank",rel:"noreferrer",className:"text-[10px] text-blue-400 hover:underline",children:"Website öffnen"})]}),i.jsxs("div",{className:"border border-dashed border-slate-700 rounded-lg p-3 text-center bg-slate-950/60",children:[i.jsx("iframe",{src:"https://acaptcha.vercel.app/",title:"acaptcha",className:"w-full h-16 border-0 rounded"}),i.jsx("div",{className:"mt-2 flex items-center justify-center gap-2",children:a?i.jsxs("div",{className:"text-xs font-medium text-emerald-400 flex items-center gap-1",children:[i.jsx(en,{className:"w-4 h-4"})," Captcha erfolgreich verifiziert!"]}):i.jsxs("button",{type:"button",onClick:k,className:"px-3 py-1.5 text-xs font-semibold rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white transition flex items-center gap-1",children:[i.jsx(en,{className:"w-3.5 h-3.5"})," Captcha gelöst bestätigen"]})})]})]}),i.jsxs("div",{className:"pt-2 flex justify-end gap-2",children:[i.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 rounded-xl text-xs font-semibold text-slate-400 hover:bg-slate-800 transition",children:"Abbrechen"}),i.jsx("button",{type:"submit",disabled:g,className:"px-5 py-2 rounded-xl text-xs font-bold bg-blue-600 hover:bg-blue-500 text-white transition shadow-lg shadow-blue-600/30 disabled:opacity-50",children:g?"Eintragen...":"Jetzt eintragen"})]})]})]})})}const dp="/api",ki=()=>localStorage.getItem("auth_token"),Pl=e=>{e?localStorage.setItem("auth_token",e):localStorage.removeItem("auth_token")},$=async(e,t={})=>{const n=ki(),r={"Content-Type":"application/json",...n?{Authorization:`Token ${n}`}:{},...t.headers},l=await fetch(`${dp}${e}`,{...t,headers:r}),s=l.headers.get("content-type");let o=null;if(s&&s.includes("application/json")&&(o=await l.json()),!l.ok){let a="Ein Fehler ist aufgetreten.";throw o&&(typeof o.error=="string"?a=o.error:typeof o.detail=="string"?a=o.detail:o.email?a=Array.isArray(o.email)?o.email[0]:o.email:o.username?a=Array.isArray(o.username)?o.username[0]:o.username:o.non_field_errors&&(a=o.non_field_errors[0])),new Error(a)}return o};function fp({onClose:e,onSuccess:t,claimToken:n,prefilledGuestName:r}){const[l,s]=j.useState(!!(n||r)),[o,a]=j.useState(""),[u,d]=j.useState(""),[h,g]=j.useState(""),[x,k]=j.useState(r||""),[y,w]=j.useState(null),[R,f]=j.useState(""),[c,m]=j.useState(!1);j.useEffect(()=>{v()},[]);const v=async()=>{try{const b=await $("/users/restriction-setting/");w(b)}catch{}},S=async b=>{b.preventDefault(),f(""),m(!0);try{if(l){const N={username:o,email:u,password:h,display_name:x||o};n&&(N.claim_token=n);const E=await $("/users/register/",{method:"POST",body:JSON.stringify(N)});if(E.requires_approval){t(null,E.message),e();return}Pl(E.token),t(E.user,E.message)}else{const N=await $("/users/login/",{method:"POST",body:JSON.stringify({username:o,password:h})});Pl(N.token),t(N.user,"Erfolgreich angemeldet!")}e()}catch(N){f(N.message||"Authentifizierung fehlgeschlagen.")}finally{m(!1)}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:i.jsxs("div",{className:"hallmark-panel w-full max-w-md rounded-sm border border-grid p-6 shadow-2xl relative animate-in fade-in zoom-in-95 duration-200",children:[i.jsx("button",{onClick:e,className:"absolute top-4 right-4 p-2 text-muted hover:text-main rounded-sm transition",children:i.jsx(Yc,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-blue-500/10 text-blue-500 border border-blue-500/20 flex items-center justify-center",children:i.jsx(ll,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-serif font-bold text-lg text-main",children:l?"Konto erstellen":"Anmelden"}),i.jsx("p",{className:"text-xs text-muted font-sans",children:l?"Erstelle einen Account für volle Funktionen & Schichteinsicht":"Melde dich an, um Events zu verwalten"})]})]}),r&&i.jsxs("div",{className:"mb-4 p-3 rounded-sm bg-amber-500/10 border border-amber-500/20 text-amber-500 text-xs flex items-center gap-2 font-mono",children:[i.jsx(Gc,{className:"w-4 h-4 shrink-0 text-amber-500"}),i.jsxs("span",{children:["Einladung für Gast: ",i.jsx("strong",{children:r}),". Die Schicht wird deinem neuen Konto zugewiesen!"]})]}),(y==null?void 0:y.is_restriction_enabled)&&l&&i.jsxs("div",{className:"mb-4 p-3 rounded-sm bg-indigo-500/10 border border-indigo-500/20 text-indigo-400 text-xs flex items-center gap-2 font-mono",children:[i.jsx(np,{className:"w-4 h-4 shrink-0 text-indigo-400"}),i.jsxs("span",{children:["Registrierungen beschränkt auf: ",i.jsx("strong",{children:y.active_domains.join(", ")})]})]}),R&&i.jsxs("div",{className:"mb-4 p-3 rounded-sm bg-red-500/10 border border-red-500/20 text-red-500 text-xs flex items-center gap-2 font-mono",children:[i.jsx(br,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:R})]}),!l&&i.jsxs("div",{className:"mb-5 p-3.5 rounded-sm bg-subtle border border-grid space-y-2 font-mono",children:[i.jsx("div",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider flex items-center justify-between",children:i.jsx("span",{children:"⚡ Dev Schnell-Login"})}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>{a("admin"),g("adminpassword")},className:"px-2.5 py-1.5 rounded-sm bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 border border-indigo-500/30 text-xs font-semibold transition text-left",children:["👑 Demo Admin",i.jsx("div",{className:"text-[10px] text-indigo-400 font-normal",children:"admin / adminpassword"})]}),i.jsxs("button",{type:"button",onClick:()=>{a("demouser"),g("demouser123")},className:"px-2.5 py-1.5 rounded-sm bg-emerald-500/10 hover:bg-emerald-500/20 text-emerald-500 border border-emerald-500/30 text-xs font-semibold transition text-left",children:["👤 Demo User",i.jsx("div",{className:"text-[10px] text-emerald-500 font-normal",children:"demouser / demouser123"})]})]})]}),i.jsxs("form",{onSubmit:S,className:"space-y-4 font-sans",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-main mb-1 font-mono",children:"Benutzername"}),i.jsxs("div",{className:"relative",children:[i.jsx(ll,{className:"w-4 h-4 absolute left-3 top-3 text-muted"}),i.jsx("input",{type:"text",required:!0,value:o,onChange:b=>a(b.target.value),placeholder:"z. B. max_muster",className:"w-full pl-9 pr-3.5 py-2 rounded-sm input-field text-sm font-mono"})]})]}),l&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-main mb-1 font-mono",children:"E-Mail-Adresse"}),i.jsxs("div",{className:"relative",children:[i.jsx(qm,{className:"w-4 h-4 absolute left-3 top-3 text-muted"}),i.jsx("input",{type:"email",required:!0,value:u,onChange:b=>d(b.target.value),placeholder:"max@beispiel.de",className:"w-full pl-9 pr-3.5 py-2 rounded-sm input-field text-sm font-mono"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-main mb-1 font-mono",children:"Anzeigename (für Schichtlisten)"}),i.jsxs("div",{className:"relative",children:[i.jsx(ll,{className:"w-4 h-4 absolute left-3 top-3 text-muted"}),i.jsx("input",{type:"text",value:x,onChange:b=>k(b.target.value),placeholder:"z. B. Max M.",className:"w-full pl-9 pr-3.5 py-2 rounded-sm input-field text-sm font-mono"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold text-main mb-1 font-mono",children:"Passwort"}),i.jsxs("div",{className:"relative",children:[i.jsx(Gm,{className:"w-4 h-4 absolute left-3 top-3 text-muted"}),i.jsx("input",{type:"password",required:!0,value:h,onChange:b=>g(b.target.value),placeholder:"••••••••",className:"w-full pl-9 pr-3.5 py-2 rounded-sm input-field text-sm font-mono"})]})]}),i.jsx("button",{type:"submit",disabled:c,style:{backgroundColor:"var(--brand-primary)"},className:"w-full py-2.5 rounded-sm text-xs font-mono font-bold text-white transition hover:brightness-110 shadow-sm",children:c?"Verarbeite...":l?"Registrieren":"Anmelden"})]}),i.jsx("div",{className:"mt-4 pt-4 border-t border-grid text-center",children:i.jsx("button",{type:"button",onClick:()=>{s(!l),f("")},className:"text-xs font-mono text-muted hover:text-main transition",children:l?"Bereits ein Konto? Hier anmelden":"Noch kein Konto? Jetzt registrieren"})})]})})}function mp({events:e,user:t,onSelectEvent:n,onOpenCreateEvent:r,onToggleEventActive:l,onEditEvent:s,branding:o}){const[a,u]=j.useState(""),[d,h]=j.useState("all"),g=new Date().toISOString().split("T")[0],x=e.filter(c=>c.title.toLowerCase().includes(a.toLowerCase())||c.description&&c.description.toLowerCase().includes(a.toLowerCase())||c.location&&c.location.toLowerCase().includes(a.toLowerCase())?d==="upcoming"?c.end_date>=g:!0:!1),k=(o==null?void 0:o.primary_color)||"var(--brand-primary)",y=(o==null?void 0:o.show_community_info_box)??!0,w=(o==null?void 0:o.show_support_box)??!0,R=y||w,f=t&&(t.is_admin_user||t.is_staff||t.is_superuser);return i.jsxs("div",{className:"space-y-8 animate-in fade-in duration-200",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-10 space-y-6 max-w-5xl mx-auto relative border border-grid",children:[i.jsxs("div",{className:"space-y-2 border-b border-grid pb-6",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-muted border border-grid px-2.5 py-1 rounded-sm inline-block",children:(o==null?void 0:o.app_name)||"SCHICHT- & EVENTPORTAL"}),(o==null?void 0:o.custom_banner_text)&&i.jsxs("span",{className:"font-mono text-[10px] uppercase tracking-widest text-amber-500 bg-amber-500/10 border border-amber-500/20 px-2.5 py-1 rounded-sm inline-block font-bold",children:["📢 ",o.custom_banner_text]})]}),i.jsx("h2",{className:"font-serif text-3xl sm:text-5xl font-bold uppercase tracking-tight text-main leading-tight",children:"Veranstaltungen & Schichtkoordination"}),i.jsx("p",{className:"font-sans text-xs sm:text-sm text-muted max-w-2xl",children:"Hier findest du aktuelle Termine, Arbeitsgruppen, Bar- & Tresendienste und Schichtpläne der Initiative."})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(Wc,{className:"w-4 h-4 absolute left-3.5 top-3 text-muted"}),i.jsx("input",{type:"text",value:a,onChange:c=>u(c.target.value),placeholder:"Veranstaltung, Ort oder Suchbegriff...",className:"w-full pl-10 pr-16 py-2 rounded-sm bg-subtle border border-grid text-main text-xs font-mono focus:outline-none focus:border-muted"}),a&&i.jsx("button",{onClick:()=>u(""),className:"absolute right-3 top-2.5 text-[10px] font-mono text-muted hover:text-main",children:"[ CLEAR ]"})]}),i.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-xs shrink-0",children:[i.jsxs("button",{onClick:()=>h("all"),className:`px-3.5 py-1.5 rounded-sm transition border ${d==="all"?"bg-surface-hover text-main border-grid font-bold shadow-sm":"bg-subtle text-muted border-grid hover:text-main"}`,children:["ALLE PROGRAMME (",e.length,")"]}),i.jsxs("button",{onClick:()=>h("upcoming"),className:`px-3.5 py-1.5 rounded-sm transition border ${d==="upcoming"?"bg-surface-hover text-main border-grid font-bold shadow-sm":"bg-subtle text-muted border-grid hover:text-main"}`,children:["ANSTEHEND (",e.filter(c=>c.end_date>=g).length,")"]})]})]})]}),i.jsxs("div",{className:"max-w-5xl mx-auto grid grid-cols-1 lg:grid-cols-4 gap-6",children:[i.jsxs("div",{className:`${R?"lg:col-span-3":"lg:col-span-4"} space-y-4`,children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-grid pb-3 font-mono",children:[i.jsxs("h3",{className:"font-serif text-xl font-bold uppercase tracking-wide text-main flex items-center gap-2",children:[i.jsx(_r,{className:"w-4.5 h-4.5 text-muted"})," Termine & Schichten"]}),t&&i.jsxs("button",{onClick:r,style:{backgroundColor:k},className:"px-3.5 py-1.5 rounded-sm text-xs font-mono font-bold text-white transition flex items-center gap-1 hover:brightness-110 shadow-sm",children:[i.jsx(tn,{className:"w-3.5 h-3.5"})," EVENT ANLEGEN"]})]}),x.length===0?i.jsx("div",{className:"hallmark-panel rounded-sm p-12 text-center text-xs font-mono text-muted border border-grid",children:a?`[ Keinen Eintrag für "${a}" gefunden ]`:"[ Keine Veranstaltungen vorhanden ]"}):i.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 ${R?"":"lg:grid-cols-3"} gap-4`,children:x.map(c=>{var N,E,U;const m=((N=c.task_areas)==null?void 0:N.length)||0,v=((E=c.task_areas)==null?void 0:E.reduce((D,J)=>{var A;return D+(((A=J.shifts)==null?void 0:A.length)||0)},0))||0,S=t&&(c.created_by===t.id||((U=c.created_by)==null?void 0:U.id)===t.id),b=f||S;return i.jsxs("div",{className:`hallmark-card rounded-sm p-5 border transition flex flex-col justify-between space-y-4 group overflow-hidden ${c.is_active===!1?"border-amber-500/40 opacity-80 bg-subtle":"border-grid"}`,children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] font-mono text-muted gap-2",children:[i.jsxs("span",{className:"flex items-center gap-1 bg-subtle px-2 py-0.5 rounded-sm border border-grid font-bold shrink-0",children:[i.jsx(yr,{className:"w-3 h-3 text-muted"}),new Date(c.start_date).toLocaleDateString("de-DE")]}),c.is_active===!1?i.jsx("span",{className:"text-amber-500 font-bold px-1.5 py-0.5 rounded-sm bg-amber-500/10 border border-amber-500/20 shrink-0",children:"[ DEAKTIVIERT ]"}):c.location?i.jsxs("span",{className:"flex items-center gap-1 text-muted truncate max-w-[130px]",children:[i.jsx(go,{className:"w-3 h-3 shrink-0"}),i.jsx("span",{className:"truncate",children:c.location})]}):null]}),i.jsx("h4",{className:"font-serif text-lg font-bold uppercase text-main group-hover:text-amber-500 transition line-clamp-2",children:c.title}),c.description&&i.jsx("p",{className:"text-xs text-muted font-sans line-clamp-2",children:c.description}),i.jsxs("div",{className:"text-[10px] font-mono text-muted flex items-center gap-1.5 pt-1",children:[i.jsxs("span",{children:[m," Bereiche"]}),i.jsx("span",{children:"/"}),i.jsxs("span",{children:[v," Schichten"]})]})]}),i.jsx("div",{className:"pt-3 border-t border-grid space-y-2 font-mono",children:i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[i.jsxs("button",{onClick:()=>n(c.id),className:"flex-1 min-w-[110px] py-1.5 px-3 rounded-sm text-xs font-mono font-bold bg-surface hover:bg-surface-hover text-main border border-grid transition flex items-center justify-center gap-1",children:["Schichtplan ",i.jsx(Hc,{className:"w-3.5 h-3.5"})]}),b&&s&&i.jsxs("button",{onClick:()=>s(c),className:"py-1.5 px-2.5 rounded-sm text-[10px] font-mono font-bold bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 hover:bg-indigo-500/20 transition flex items-center gap-1 shrink-0",title:"Veranstaltung & Schichten bearbeiten",children:[i.jsx(vr,{className:"w-3.5 h-3.5"})," BEARBEITEN"]}),b&&l&&i.jsx("button",{onClick:()=>l(c),className:`py-1.5 px-2 rounded-sm text-[10px] font-mono font-bold transition flex items-center gap-1 border shrink-0 ${c.is_active!==!1?"bg-amber-500/10 text-amber-500 border-amber-500/20 hover:bg-amber-500/20":"bg-emerald-500/10 text-emerald-400 border-emerald-500/20 hover:bg-emerald-500/20"}`,title:c.is_active!==!1?"Deaktivieren":"Aktivieren",children:c.is_active!==!1?i.jsx(Qc,{className:"w-3.5 h-3.5"}):i.jsx(en,{className:"w-3.5 h-3.5"})})]})})]},c.id)})})]}),R&&i.jsxs("div",{className:"space-y-4 font-mono text-xs",children:[y&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-4 border border-grid space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-bold uppercase tracking-wide text-main border-b border-grid pb-2",children:(o==null?void 0:o.community_info_title)||"📌 Verein & Infos"}),i.jsx("div",{className:"space-y-2 text-muted text-[11px] whitespace-pre-line",children:(o==null?void 0:o.community_info_text)||`Initiative e.V. Hausverein -Offene Angebote, DIY-Kultur & engagierte Schichten.`})]}),w&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-4 border border-grid space-y-3",children:[i.jsx("h4",{className:"font-serif text-sm font-bold uppercase tracking-wide text-main border-b border-grid pb-2",children:(o==null?void 0:o.support_box_title)||"❤️ Unterstützen"}),i.jsx("p",{className:"text-[11px] text-muted whitespace-pre-line",children:(o==null?void 0:o.support_box_text)||"Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau."})]})]})]})]})}function pp({events:e,onSelectEvent:t,branding:n}){const[r,l]=j.useState(new Date),[s,o]=j.useState(null),a=r.getFullYear(),u=r.getMonth(),d=["JANUAR","FEBRUAR","MÄRZ","APRIL","MAI","JUNI","JULI","AUGUST","SEPTEMBER","OKTOBER","NOVEMBER","DEZEMBER"],h=()=>l(new Date(a,u-1,1)),g=()=>l(new Date(a,u+1,1)),x=()=>l(new Date),k=new Date(a,u,1).getDay(),y=k===0?6:k-1,w=new Date(a,u+1,0).getDate(),R=m=>{const v=String(u+1).padStart(2,"0"),S=String(m).padStart(2,"0");return`${a}-${v}-${S}`},f=m=>{const v=R(m);return e.filter(S=>v>=S.start_date&&v<=S.end_date)},c=(n==null?void 0:n.primary_color)||"var(--brand-primary)";return i.jsxs("div",{className:"space-y-6 max-w-5xl mx-auto animate-in fade-in duration-200",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-4 font-mono",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-subtle text-main border border-grid flex items-center justify-center font-bold",children:i.jsx(_r,{className:"w-4 h-4 text-amber-500"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"font-serif text-3xl sm:text-4xl font-bold uppercase tracking-tight text-main leading-none",children:[d[u]," ",a]}),i.jsx("p",{className:"text-[10px] text-muted uppercase tracking-widest mt-1",children:"— INITIATIVE E.V. TERMIN- & SCHICHTÜBERSICHT —"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:x,className:"px-3.5 py-1.5 rounded-sm text-xs font-mono font-bold bg-surface hover:bg-surface-hover text-main border border-grid transition",children:"[ HEUTE ]"}),i.jsx("button",{onClick:h,className:"p-1.5 rounded-sm text-muted hover:text-main bg-surface border border-grid transition",title:"Vorheriger Monat",children:i.jsx(Hm,{className:"w-4 h-4"})}),i.jsx("button",{onClick:g,className:"p-1.5 rounded-sm text-muted hover:text-main bg-surface border border-grid transition",title:"Nächster Monat",children:i.jsx(Qm,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden",children:[i.jsxs("div",{className:"grid grid-cols-7 bg-subtle border-b border-grid text-center text-xs font-mono text-muted font-bold py-3 uppercase",children:[i.jsx("div",{children:"MO"}),i.jsx("div",{children:"DI"}),i.jsx("div",{children:"MI"}),i.jsx("div",{children:"DO"}),i.jsx("div",{children:"FR"}),i.jsx("div",{children:"SA"}),i.jsx("div",{children:"SO"})]}),i.jsxs("div",{className:"grid grid-cols-7 auto-rows-fr divide-x divide-y divide-grid bg-surface text-xs font-mono",children:[Array.from({length:y}).map((m,v)=>i.jsx("div",{className:"min-h-[100px] sm:min-h-[110px] p-2 bg-subtle/50 text-muted opacity-30"},`offset-${v}`)),Array.from({length:w}).map((m,v)=>{const S=v+1,b=f(S),N=new Date().getFullYear()===a&&new Date().getMonth()===u&&new Date().getDate()===S;return i.jsxs("div",{className:`min-h-[100px] sm:min-h-[110px] p-2 flex flex-col justify-between transition ${N?"bg-surface-hover/80 font-bold":"hover:bg-surface-hover/50"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("span",{className:`w-5 h-5 rounded-sm flex items-center justify-center font-mono text-xs ${N?"bg-main text-paper font-bold shadow-sm":"text-muted"}`,children:S}),b.length>0&&i.jsxs("span",{className:"text-[9px] font-mono text-muted",children:[b.length," ",b.length===1?"Event":"Events"]})]}),i.jsx("div",{className:"space-y-1.5 overflow-y-auto max-h-[70px] no-scrollbar",children:b.map(E=>{const U=(s==null?void 0:s.id)===E.id;return i.jsx("button",{onClick:()=>o(E),style:{backgroundColor:U?c:`${c}15`,borderColor:`${c}40`,color:U?"#ffffff":c},className:`w-full text-left px-2 py-1 rounded-sm text-[10px] font-mono font-bold border truncate block hover:brightness-110 transition shadow-sm ${E.is_active===!1?"opacity-50 line-through":""}`,children:E.title},`evt-${E.id}`)})})]},`day-${S}`)})]})]}),s&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 border border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-4 font-mono animate-in fade-in duration-200",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted",children:[i.jsxs("span",{className:"flex items-center gap-1 bg-subtle px-2 py-0.5 rounded-sm border border-grid font-bold text-main",children:[i.jsx(yr,{className:"w-3 h-3 text-muted"}),new Date(s.start_date).toLocaleDateString("de-DE")," — ",new Date(s.end_date).toLocaleDateString("de-DE")]}),s.location&&i.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[i.jsx(go,{className:"w-3 h-3"}),s.location]})]}),i.jsx("h3",{className:"font-serif text-2xl font-bold uppercase text-main",children:s.title}),s.description&&i.jsx("p",{className:"text-xs font-sans text-muted max-w-xl",children:s.description})]}),i.jsx("div",{className:"flex items-center gap-2 shrink-0",children:i.jsxs("button",{onClick:()=>t(s.id),style:{backgroundColor:c},className:"px-5 py-2 rounded-sm text-xs font-mono font-bold text-white transition flex items-center gap-1.5 hover:brightness-110 shadow-sm",children:["SCHICHTPLAN ÖFFNEN ",i.jsx(Hc,{className:"w-4 h-4"})]})})]})]})}function hp({branding:e,onRefreshBranding:t,onRefreshEvents:n,skills:r,onRefreshSkills:l}){const[s,o]=j.useState("users"),[a,u]=j.useState(!0),[d,h]=j.useState(""),[g,x]=j.useState(""),[k,y]=j.useState([]),[w,R]=j.useState(""),[f,c]=j.useState([]),[m,v]=j.useState(!1),[S,b]=j.useState(!1),[N,E]=j.useState([]),[U,D]=j.useState(""),[J,A]=j.useState([]),[I,V]=j.useState([]),[W,H]=j.useState(""),[Se,T]=j.useState(""),[O,L]=j.useState("#E05A47"),[Y,le]=j.useState((e==null?void 0:e.app_name)||"Veranstaltungsschichtplaner"),[tt,xe]=j.useState((e==null?void 0:e.logo_url)||""),[ge,fe]=j.useState((e==null?void 0:e.primary_color)||"#E05A47"),[ot,Gl]=j.useState((e==null?void 0:e.custom_banner_text)||""),[$t,Yl]=j.useState((e==null?void 0:e.show_community_info_box)??!0),[Er,ql]=j.useState((e==null?void 0:e.community_info_title)||"📌 Verein & Infos"),[yt,Zl]=j.useState((e==null?void 0:e.community_info_text)||`Initiative e.V. Hausverein -Offene Angebote, DIY-Kultur & engagierte Schichten.`),[Ft,Xl]=j.useState((e==null?void 0:e.show_support_box)??!0),[Cr,Jl]=j.useState((e==null?void 0:e.support_box_title)||"❤️ Unterstützen"),[C,z]=j.useState((e==null?void 0:e.support_box_text)||"Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau."),[G,Me]=j.useState(!1);j.useEffect(()=>{ye()},[]);const ye=async()=>{u(!0),h("");try{try{const p=await $("/users/manage-users/");y(p.results||p)}catch{}try{const p=await $("/users/pending/");c(p.results||p)}catch{}try{const p=await $("/users/restriction-setting/");v(p.is_restriction_enabled),b(p.require_admin_approval);const M=await $("/users/domain-rules/");E(M.results||M)}catch{}try{const p=await $("/events/");A(p.results||p)}catch{}try{const p=await $("/templates/");V(p.results||p)}catch{}}catch(p){h(p.message||"Laden der Admin-Daten fehlgeschlagen.")}finally{u(!1)}},je=p=>{x(p),setTimeout(()=>x(""),4e3)},qc=async p=>{try{const M=await $(`/users/manage-users/${p.id}/`,{method:"PATCH",body:JSON.stringify({is_admin_user:!p.is_admin_user})});y(k.map(Ve=>Ve.id===p.id?M:Ve)),je(`Admin-Rechte für ${p.username} aktualisiert.`)}catch(M){h(M.message||"Fehler beim Aktualisieren.")}},Zc=async p=>{try{const M=await $(`/users/manage-users/${p.id}/`,{method:"PATCH",body:JSON.stringify({is_active:!p.is_active})});y(k.map(Ve=>Ve.id===p.id?M:Ve)),je(`Status für ${p.username} auf ${M.is_active?"AKTIV":"DEAKTIVIERT"} gesetzt.`)}catch(M){h(M.message||"Fehler beim Aktualisieren.")}},Xc=async p=>{if(window.confirm(`Benutzer ${p.username} wirklich löschen?`))try{await $(`/users/manage-users/${p.id}/`,{method:"DELETE"}),y(k.filter(M=>M.id!==p.id)),je(`Benutzer ${p.username} gelöscht.`)}catch(M){h(M.message||"Löschen fehlgeschlagen.")}},Jc=async p=>{try{const M=await $(`/users/${p}/approve/`,{method:"POST"});c(f.filter(Ve=>Ve.id!==p)),ye(),je(M.message||"Nutzer freigeschaltet!")}catch(M){h(M.message||"Freischaltung fehlgeschlagen.")}},ed=async p=>{try{const M=await $(`/users/${p}/approve/`,{method:"DELETE"});c(f.filter(Ve=>Ve.id!==p)),je(M.message||"Registrierung abgelehnt.")}catch(M){h(M.message||"Ablehnen fehlgeschlagen.")}},td=async()=>{try{const p=await $("/users/restriction-setting/",{method:"POST",body:JSON.stringify({require_admin_approval:!S})});b(p.require_admin_approval),je(`Admin-Freischaltung ist jetzt ${p.require_admin_approval?"AKTIV":"INAKTIV"}`)}catch(p){h(p.message||"Fehler beim Umschalten.")}},nd=async()=>{try{const p=await $("/users/restriction-setting/",{method:"POST",body:JSON.stringify({is_restriction_enabled:!m})});v(p.is_restriction_enabled),je(`Domain-Beschränkung ist jetzt ${p.is_restriction_enabled?"AKTIV":"INAKTIV"}`)}catch(p){h(p.message||"Fehler beim Umschalten.")}},rd=async p=>{if(p.preventDefault(),!!U.trim())try{const M=await $("/users/domain-rules/",{method:"POST",body:JSON.stringify({domain:U.trim(),is_active:!0})});E([...N,M]),D(""),je("Domain hinzugefügt!")}catch(M){h(M.message||"Fehler beim Hinzufügen der Domain.")}},ld=async p=>{try{await $(`/users/domain-rules/${p}/`,{method:"DELETE"}),E(N.filter(M=>M.id!==p)),je("Domain entfernt.")}catch(M){h(M.message||"Löschen fehlgeschlagen.")}},sd=async p=>{if(p.preventDefault(),!!W.trim())try{await $("/skills/",{method:"POST",body:JSON.stringify({name:W.trim(),description:Se.trim(),color:O})}),H(""),T(""),l(),je("Qualifikation angelegt!")}catch(M){h(M.message||"Fehler beim Anlegen.")}},id=async p=>{if(window.confirm("Qualifikation wirklich löschen?"))try{await $(`/skills/${p}/`,{method:"DELETE"}),l(),je("Qualifikation gelöscht.")}catch(M){h(M.message||"Löschen fehlgeschlagen.")}},od=async p=>{try{const M=await $(`/events/${p.id}/`,{method:"PATCH",body:JSON.stringify({is_active:p.is_active===!1})});A(J.map(Ve=>Ve.id===p.id?M:Ve)),n(),je(`Status für "${p.title}" aktualisiert.`)}catch(M){h(M.message||"Fehler beim Umschalten.")}},ad=async p=>{if(window.confirm("Veranstaltung mit allen Schichten wirklich löschen?"))try{await $(`/events/${p}/`,{method:"DELETE"}),A(J.filter(M=>M.id!==p)),n(),je("Veranstaltung gelöscht.")}catch(M){h(M.message||"Löschen fehlgeschlagen.")}},ud=async p=>{if(window.confirm("Vorlage wirklich löschen?"))try{await $(`/templates/${p}/`,{method:"DELETE"}),V(I.filter(M=>M.id!==p)),je("Vorlage gelöscht.")}catch(M){h(M.message||"Löschen fehlgeschlagen.")}},cd=async p=>{p.preventDefault(),Me(!0),h("");try{await $("/branding/",{method:"POST",body:JSON.stringify({app_name:Y,logo_url:tt,primary_color:ge,custom_banner_text:ot,show_community_info_box:$t,community_info_title:Er,community_info_text:yt,show_support_box:Ft,support_box_title:Cr,support_box_text:C})}),je("Branding & Einstellungen erfolgreich gespeichert!"),t()}catch(M){h(M.message||"Speichern fehlgeschlagen.")}finally{Me(!1)}},es=k.filter(p=>p.username.toLowerCase().includes(w.toLowerCase())||p.email.toLowerCase().includes(w.toLowerCase())||p.display_name&&p.display_name.toLowerCase().includes(w.toLowerCase()));return i.jsxs("div",{className:"space-y-8 max-w-6xl mx-auto animate-in fade-in duration-200",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid space-y-4",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-grid pb-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-muted border border-grid px-2.5 py-0.5 rounded-sm inline-block",children:"SYSTEM CONTROL & GOVERNANCE"}),i.jsx("h2",{className:"font-serif text-3xl sm:text-4xl font-bold uppercase tracking-tight text-main",children:"Administration & System-Zentrale"})]}),i.jsx("div",{className:"flex items-center gap-2 font-mono text-xs shrink-0",children:i.jsxs("div",{className:"bg-subtle px-3 py-2 rounded-sm border border-grid text-right space-y-0.5",children:[i.jsx("div",{className:"font-bold text-emerald-500",children:"[ SYSTEM NORMAL ]"}),i.jsxs("div",{className:"text-[10px] text-muted",children:[k.length," KONTEN • ",J.length," EVENTS"]})]})})]}),i.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto font-mono text-xs no-scrollbar pt-2",children:[i.jsxs("button",{onClick:()=>o("users"),className:`px-4 py-2 rounded-sm transition flex items-center gap-2 border ${s==="users"?"bg-surface-hover text-main font-bold border-grid shadow-sm":"bg-subtle text-muted border-transparent hover:text-main"}`,children:[i.jsx(op,{className:"w-3.5 h-3.5 text-blue-400"})," [ 01: BENUTZER & SICHERHEIT (",k.length,") ]"]}),i.jsxs("button",{onClick:()=>o("events"),className:`px-4 py-2 rounded-sm transition flex items-center gap-2 border ${s==="events"?"bg-surface-hover text-main font-bold border-grid shadow-sm":"bg-subtle text-muted border-transparent hover:text-main"}`,children:[i.jsx(_r,{className:"w-3.5 h-3.5 text-emerald-400"})," [ 02: VERANSTALTUNGEN (",J.length,") ]"]}),i.jsxs("button",{onClick:()=>o("templates"),className:`px-4 py-2 rounded-sm transition flex items-center gap-2 border ${s==="templates"?"bg-surface-hover text-main font-bold border-grid shadow-sm":"bg-subtle text-muted border-transparent hover:text-main"}`,children:[i.jsx(Kl,{className:"w-3.5 h-3.5 text-amber-400"})," [ 03: VORLAGEN & SKILLS ]"]}),i.jsxs("button",{onClick:()=>o("branding"),className:`px-4 py-2 rounded-sm transition flex items-center gap-2 border ${s==="branding"?"bg-surface-hover text-main font-bold border-grid shadow-sm":"bg-subtle text-muted border-transparent hover:text-main"}`,children:[i.jsx(Jm,{className:"w-3.5 h-3.5 text-indigo-400"})," [ 04: BRANDING & SYSTEM ]"]})]})]}),d&&i.jsxs("div",{className:"p-4 rounded-sm bg-red-500/10 border border-red-500/20 text-red-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(br,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:d})]}),g&&i.jsxs("div",{className:"p-4 rounded-sm bg-emerald-500/10 border border-emerald-500/20 text-emerald-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(en,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:g})]}),s==="users"&&i.jsxs("div",{className:"space-y-6 animate-in fade-in duration-150",children:[f.length>0&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-amber-500/40 space-y-3 font-mono",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-amber-400 flex items-center gap-2",children:[i.jsx(yr,{className:"w-4 h-4"})," Ausstehende Freischalt-Anfragen (",f.length,")"]}),i.jsx("div",{className:"space-y-2",children:f.map(p=>i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-sm bg-subtle border border-grid text-xs",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-main",children:p.display_name||p.username}),i.jsx("div",{className:"text-[11px] text-muted",children:p.email})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>Jc(p.id),className:"px-3 py-1 rounded-sm font-bold bg-emerald-600 hover:bg-emerald-500 text-white transition flex items-center gap-1",children:[i.jsx(Tl,{className:"w-3.5 h-3.5"})," FREISCHALTEN"]}),i.jsxs("button",{onClick:()=>ed(p.id),className:"px-2.5 py-1 rounded-sm font-semibold bg-red-500/10 hover:bg-red-500/20 text-red-400 border border-red-500/20 transition flex items-center gap-1",children:[i.jsx(wi,{className:"w-3.5 h-3.5"})," ABLEHNEN"]})]})]},p.id))})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 font-mono",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h4",{className:"font-bold text-xs uppercase text-main flex items-center gap-2",children:[i.jsx(Tl,{className:"w-4 h-4 text-blue-400"})," Admin-Freischaltung Pflicht"]}),i.jsx("button",{onClick:td,className:`px-3 py-1 rounded-sm text-xs font-bold transition border ${S?"bg-blue-600 text-white border-blue-500":"bg-subtle text-muted border-grid"}`,children:S?"[ AKTIV ]":"[ INAKTIV ]"})]}),i.jsx("p",{className:"text-[11px] text-muted",children:"Neue Registrierungen müssen manuell freigeschaltet werden."})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h4",{className:"font-bold text-xs uppercase text-main flex items-center gap-2",children:[i.jsx(Kc,{className:"w-4 h-4 text-emerald-400"})," E-Mail Domain-Beschränkung"]}),i.jsx("button",{onClick:nd,className:`px-3 py-1 rounded-sm text-xs font-bold transition border ${m?"bg-emerald-600 text-white border-emerald-500":"bg-subtle text-muted border-grid"}`,children:m?"[ AKTIV ]":"[ INAKTIV ]"})]}),i.jsx("p",{className:"text-[11px] text-muted",children:"Nur freigegebene E-Mail-Domains erlauben."})]})]}),m&&i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-4 font-mono",children:[i.jsx("h4",{className:"font-bold text-xs uppercase text-main",children:"Freigegebene E-Mail-Domains"}),i.jsxs("form",{onSubmit:rd,className:"flex gap-2",children:[i.jsx("input",{type:"text",placeholder:"z. B. verein.de oder @beispiel.org",value:U,onChange:p=>D(p.target.value),className:"flex-1 px-3 py-1.5 rounded-sm input-field text-xs"}),i.jsxs("button",{type:"submit",className:"px-4 py-1.5 rounded-sm text-xs font-bold bg-blue-600 text-white hover:bg-blue-500",children:[i.jsx(tn,{className:"w-3.5 h-3.5 inline"})," Domain Hinzufügen"]})]}),i.jsx("div",{className:"space-y-1.5",children:N.map(p=>i.jsxs("div",{className:"flex items-center justify-between p-2 rounded-sm bg-subtle border border-grid text-xs",children:[i.jsx("span",{className:"font-bold text-main",children:p.domain}),i.jsx("button",{onClick:()=>ld(p.id),className:"text-muted hover:text-red-400",children:i.jsx(Bt,{className:"w-3.5 h-3.5"})})]},p.id))})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden",children:[i.jsxs("div",{className:"p-4 bg-subtle border-b border-grid flex flex-col sm:flex-row sm:items-center justify-between gap-3 font-mono",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-main",children:["Alle Benutzerkonten (",es.length," von ",k.length,")"]}),i.jsxs("div",{className:"relative w-full sm:w-64",children:[i.jsx(Wc,{className:"w-3.5 h-3.5 absolute left-3 top-2.5 text-muted"}),i.jsx("input",{type:"text",value:w,onChange:p=>R(p.target.value),placeholder:"Benutzer suchen...",className:"w-full pl-9 pr-3 py-1 rounded-sm input-field text-xs font-mono"})]})]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-left border-collapse font-sans text-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-subtle border-b border-grid text-[11px] font-mono text-muted uppercase tracking-wider",children:[i.jsx("th",{className:"py-3 px-4",children:"Nutzer & E-Mail"}),i.jsx("th",{className:"py-3 px-4",children:"Anzeigename"}),i.jsx("th",{className:"py-3 px-4",children:"Status"}),i.jsx("th",{className:"py-3 px-4",children:"Rolle"}),i.jsx("th",{className:"py-3 px-4 text-right",children:"Aktionen"})]})}),i.jsx("tbody",{className:"divide-y divide-grid font-mono",children:es.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:5,className:"py-8 text-center text-muted italic text-xs",children:"[ Keine Benutzerkonten gefunden ]"})}):es.map(p=>i.jsxs("tr",{className:"hover:bg-surface-hover",children:[i.jsxs("td",{className:"py-3 px-4",children:[i.jsx("div",{className:"font-bold text-main",children:p.username}),i.jsx("div",{className:"text-[11px] text-muted",children:p.email})]}),i.jsx("td",{className:"py-3 px-4 text-main",children:p.display_name||p.username}),i.jsx("td",{className:"py-3 px-4",children:i.jsx("button",{onClick:()=>Zc(p),className:`px-2 py-0.5 rounded-sm text-[10px] font-bold border transition ${p.is_active?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-red-500/10 text-red-400 border-red-500/20"}`,children:p.is_active?"[ AKTIV ]":"[ DEAKTIVIERT ]"})}),i.jsx("td",{className:"py-3 px-4",children:i.jsx("button",{onClick:()=>qc(p),className:`px-2 py-0.5 rounded-sm text-[10px] font-bold border transition ${p.is_admin_user?"bg-indigo-500/10 text-indigo-400 border-indigo-500/30":"bg-subtle text-muted border-grid"}`,children:p.is_admin_user?"👑 ADMIN":"👤 USER"})}),i.jsx("td",{className:"py-3 px-4 text-right",children:i.jsx("button",{onClick:()=>Xc(p),className:"p-1.5 rounded-sm text-muted hover:text-red-400 hover:bg-red-500/10 transition",title:"Benutzer löschen",children:i.jsx(Bt,{className:"w-4 h-4"})})})]},p.id))})]})})]})]}),s==="events"&&i.jsx("div",{className:"space-y-6 animate-in fade-in duration-150",children:i.jsxs("div",{className:"hallmark-panel rounded-sm border border-grid overflow-hidden font-mono",children:[i.jsx("div",{className:"p-4 bg-subtle border-b border-grid flex items-center justify-between",children:i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-main",children:["Veranstaltungen verwalten (",J.length,")"]})}),i.jsx("div",{className:"divide-y divide-grid",children:J.map(p=>i.jsxs("div",{className:"p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-4 hover:bg-surface-hover transition",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted",children:[i.jsxs("span",{className:"bg-subtle px-2 py-0.5 rounded-sm border border-grid font-bold",children:[p.start_date," bis ",p.end_date]}),p.location&&i.jsxs("span",{children:["• ",p.location]}),p.is_active===!1&&i.jsx("span",{className:"text-amber-500 font-bold px-1.5 py-0.5 rounded-sm bg-amber-500/10 border border-amber-500/20",children:"[ DEAKTIVIERT ]"})]}),i.jsx("h4",{className:"font-serif text-base font-bold text-main uppercase",children:p.title}),p.description&&i.jsx("p",{className:"text-xs text-muted font-sans line-clamp-1",children:p.description})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-xs",children:[i.jsxs("button",{onClick:()=>od(p),className:`px-3 py-1 rounded-sm border font-mono font-bold transition flex items-center gap-1 ${p.is_active!==!1?"bg-amber-500/10 text-amber-500 border-amber-500/20 hover:bg-amber-500/20":"bg-emerald-500/10 text-emerald-400 border-emerald-500/20 hover:bg-emerald-500/20"}`,children:[p.is_active!==!1?i.jsx(Qc,{className:"w-3.5 h-3.5"}):i.jsx(Km,{className:"w-3.5 h-3.5"}),p.is_active!==!1?"DEAKTIVIEREN":"AKTIVIEREN"]}),i.jsxs("button",{onClick:()=>ad(p.id),className:"px-3 py-1 rounded-sm bg-red-500/10 hover:bg-red-500/20 text-red-400 border border-red-500/20 transition flex items-center gap-1 font-bold",children:[i.jsx(Bt,{className:"w-3.5 h-3.5"})," LÖSCHEN"]})]})]},p.id))})]})}),s==="templates"&&i.jsxs("div",{className:"space-y-6 animate-in fade-in duration-150 font-mono",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-4",children:[i.jsx("h3",{className:"font-serif text-lg font-bold uppercase text-main border-b border-grid pb-2",children:"Erforderliche Qualifikationen (Skills)"}),i.jsxs("form",{onSubmit:sd,className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[i.jsx("input",{type:"text",placeholder:"Skill Name (z. B. Bar-Erfahrung)",required:!0,value:W,onChange:p=>H(p.target.value),className:"px-3 py-1.5 rounded-sm input-field text-xs font-mono"}),i.jsx("input",{type:"text",placeholder:"Beschreibung (optional)",value:Se,onChange:p=>T(p.target.value),className:"px-3 py-1.5 rounded-sm input-field text-xs font-mono"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"color",value:O,onChange:p=>L(p.target.value),className:"w-8 h-8 rounded-sm border-0 cursor-pointer bg-subtle p-0.5"}),i.jsxs("button",{type:"submit",className:"flex-1 px-3 py-1.5 rounded-sm bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs",children:[i.jsx(tn,{className:"w-3.5 h-3.5 inline"})," Anlegen"]})]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 pt-2",children:r.map(p=>i.jsxs("div",{className:"p-3 rounded-sm bg-subtle border border-grid flex items-center justify-between text-xs",children:[i.jsxs("div",{children:[i.jsx("span",{style:{color:p.color},className:"font-bold",children:p.name}),p.description&&i.jsx("p",{className:"text-[11px] text-muted",children:p.description})]}),i.jsx("button",{onClick:()=>id(p.id),className:"text-muted hover:text-red-400",children:i.jsx(Bt,{className:"w-3.5 h-3.5"})})]},p.id))})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm p-5 border border-grid space-y-4",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-main border-b border-grid pb-2",children:["Gespeicherte Event-Vorlagen (",I.length,")"]}),i.jsx("div",{className:"space-y-2",children:I.map(p=>i.jsxs("div",{className:"p-3 rounded-sm bg-subtle border border-grid flex items-center justify-between text-xs",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-main",children:p.name}),i.jsx("div",{className:"text-[11px] text-muted",children:p.description||"Keine Beschreibung"})]}),i.jsx("button",{onClick:()=>ud(p.id),className:"text-muted hover:text-red-400",children:i.jsx(Bt,{className:"w-4 h-4"})})]},p.id))})]})]}),s==="branding"&&i.jsx("div",{className:"space-y-6 animate-in fade-in duration-150 font-mono",children:i.jsxs("form",{onSubmit:cd,className:"hallmark-panel rounded-sm p-6 border border-grid space-y-6",children:[i.jsx("h3",{className:"font-serif text-lg font-bold uppercase text-main border-b border-grid pb-2",children:"App Branding & Aussehen"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"App Name"}),i.jsx("input",{type:"text",required:!0,value:Y,onChange:p=>le(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Primärfarbe"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"color",value:ge,onChange:p=>fe(p.target.value),className:"w-8 h-8 rounded-sm border-0 cursor-pointer bg-subtle p-0.5"}),i.jsx("input",{type:"text",value:ge,onChange:p=>fe(p.target.value),className:"flex-1 px-3 py-1.5 rounded-sm input-field font-mono"})]})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-muted mb-1",children:"Logo Bild-URL (optional)"}),i.jsx("input",{type:"text",placeholder:"https://beispiel.de/logo.png",value:tt,onChange:p=>xe(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-muted mb-1",children:"Ankündigung (Banner-Text)"}),i.jsx("textarea",{rows:2,placeholder:"z. B. Willkommen beim Sommerfest Schichtplaner!",value:ot,onChange:p=>Gl(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]})]}),i.jsx("h4",{className:"font-serif text-base font-bold uppercase text-main pt-4 border-t border-grid",children:"Startseiten Sidebar Boxen"}),i.jsxs("div",{className:"p-4 rounded-sm bg-subtle border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-grid pb-2",children:[i.jsx("span",{className:"font-bold text-xs uppercase text-main",children:"📌 Verein & Infos Box"}),i.jsx("button",{type:"button",onClick:()=>Yl(!$t),className:`px-3 py-1 rounded-sm text-xs font-bold transition border ${$t?"bg-emerald-600 text-white border-emerald-500":"bg-surface text-muted border-grid"}`,children:$t?"[ AN ]":"[ AUS ]"})]}),$t&&i.jsxs("div",{className:"space-y-3 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Titel"}),i.jsx("input",{type:"text",value:Er,onChange:p=>ql(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Inhalt"}),i.jsx("textarea",{rows:3,value:yt,onChange:p=>Zl(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]})]})]}),i.jsxs("div",{className:"p-4 rounded-sm bg-subtle border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-grid pb-2",children:[i.jsx("span",{className:"font-bold text-xs uppercase text-main",children:"❤️ Unterstützen Box"}),i.jsx("button",{type:"button",onClick:()=>Xl(!Ft),className:`px-3 py-1 rounded-sm text-xs font-bold transition border ${Ft?"bg-emerald-600 text-white border-emerald-500":"bg-surface text-muted border-grid"}`,children:Ft?"[ AN ]":"[ AUS ]"})]}),Ft&&i.jsxs("div",{className:"space-y-3 text-xs",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Titel"}),i.jsx("input",{type:"text",value:Cr,onChange:p=>Jl(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-muted mb-1",children:"Inhalt"}),i.jsx("textarea",{rows:3,value:C,onChange:p=>z(p.target.value),className:"w-full px-3 py-1.5 rounded-sm input-field"})]})]})]}),i.jsx("div",{className:"pt-3 flex justify-end border-t border-grid",children:i.jsx("button",{type:"submit",disabled:G,style:{backgroundColor:"var(--brand-primary)"},className:"px-6 py-2.5 rounded-sm text-xs font-mono font-bold text-white transition hover:brightness-110 shadow-sm",children:G?"Speichern...":"Einstellungen speichern"})})]})})]})}function xp({eventToEdit:e,skills:t,onBack:n,onSubmit:r}){const[l,s]=j.useState((e==null?void 0:e.title)||""),[o,a]=j.useState((e==null?void 0:e.description)||""),[u,d]=j.useState((e==null?void 0:e.location)||""),[h,g]=j.useState((e==null?void 0:e.start_date)||new Date().toISOString().split("T")[0]),[x,k]=j.useState((e==null?void 0:e.end_date)||new Date().toISOString().split("T")[0]),[y,w]=j.useState([]),[R,f]=j.useState(!1),[c,m]=j.useState("");j.useEffect(()=>{if(e&&e.task_areas&&e.task_areas.length>0){const A=e.task_areas.map(I=>({id:I.id,name:I.name,description:I.description||"",shifts:(I.shifts||[]).map(V=>({id:V.id,title:V.title,start_time:V.start_time,end_time:V.end_time,max_participants:V.max_participants||1,required_skill_ids:V.required_skills?V.required_skills.map(W=>W.id):[]}))}));w(A)}else e||w([{name:"Tresendienst",description:"Getränke- und Barverkauf",shifts:[{title:"Schicht 1",start_time:"18:00",end_time:"22:00",max_participants:2,required_skill_ids:[]}]},{name:"Essen kochen",description:"Zubereitung von Speisen",shifts:[{title:"Frühschicht",start_time:"15:00",end_time:"19:00",max_participants:3,required_skill_ids:[]}]},{name:"Aufbau & Aufräumen",description:"Tische, Stühle & Technik",shifts:[{title:"Aufbau",start_time:"12:00",end_time:"15:00",max_participants:4,required_skill_ids:[]}]}])},[e]);const v=()=>{w([...y,{name:"",description:"",shifts:[{title:"Schicht 1",start_time:"10:00",end_time:"14:00",max_participants:1,required_skill_ids:[]}]}])},S=A=>{w(y.filter((I,V)=>V!==A))},b=(A,I,V)=>{const W=[...y];W[A][I]=V,w(W)},N=A=>{const I=[...y];I[A].shifts.push({title:`Schicht ${I[A].shifts.length+1}`,start_time:"14:00",end_time:"18:00",max_participants:1,required_skill_ids:[]}),w(I)},E=(A,I)=>{const V=[...y];V[A].shifts=V[A].shifts.filter((W,H)=>H!==I),w(V)},U=(A,I,V,W)=>{const H=[...y];H[A].shifts[I][V]=W,w(H)},D=(A,I,V)=>{const W=[...y],H=W[A].shifts[I].required_skill_ids||[];H.includes(V)?W[A].shifts[I].required_skill_ids=H.filter(Se=>Se!==V):W[A].shifts[I].required_skill_ids=[...H,V],w(W)},J=async A=>{if(A.preventDefault(),m(""),!l.trim()){m("Bitte gib einen Veranstaltungstitel an.");return}f(!0);try{await r({id:e==null?void 0:e.id,title:l,description:o,location:u,start_date:h,end_date:x,task_areas:y})}catch(I){m(I.message||"Speichern der Veranstaltung fehlgeschlagen.")}finally{f(!1)}};return i.jsxs("div",{className:"space-y-6 max-w-4xl mx-auto animate-in fade-in duration-200 font-sans",children:[i.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[i.jsxs("button",{onClick:n,className:"px-3.5 py-1.5 rounded-sm bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-2 font-bold",children:[i.jsx(Bc,{className:"w-4 h-4"})," [ ZURÜCK ZUR ÜBERSICHT ]"]}),i.jsxs("span",{className:"text-muted border border-grid px-2.5 py-0.5 rounded-sm",children:["MODE: ",e?"EVENT EDIT":"NEW EVENT"]})]}),i.jsx("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid space-y-2",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-blue-500/10 text-blue-500 border border-blue-500/20 flex items-center justify-center font-bold",children:e?i.jsx(vr,{className:"w-5 h-5"}):i.jsx(_r,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-serif text-3xl font-bold uppercase tracking-tight text-main",children:e?"Veranstaltung & Schichten Bearbeiten":"Neue Veranstaltung Erstellen"}),i.jsx("p",{className:"text-xs text-muted font-mono mt-0.5",children:"Konfiguriere Stammdaten, Aufgabenfelder, Schichtzeiten & Qualifikationen"})]})]})}),c&&i.jsxs("div",{className:"p-4 rounded-sm bg-red-500/10 border border-red-500/20 text-red-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(br,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:c})]}),i.jsxs("form",{onSubmit:J,className:"space-y-6",children:[i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 border border-grid space-y-4 font-mono text-xs",children:[i.jsx("h3",{className:"font-serif text-lg font-bold uppercase text-main border-b border-grid pb-2",children:"1. Stammdaten der Veranstaltung"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Titel der Veranstaltung"}),i.jsx("input",{type:"text",required:!0,value:l,onChange:A=>s(A.target.value),placeholder:"z. B. Sommerfest 2026",className:"w-full px-3.5 py-2 rounded-sm input-field text-sm"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Startdatum"}),i.jsx("input",{type:"date",required:!0,value:h,onChange:A=>g(A.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-sm"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Enddatum"}),i.jsx("input",{type:"date",required:!0,value:x,onChange:A=>k(A.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-sm"})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Ort (optional)"}),i.jsx("input",{type:"text",value:u,onChange:A=>d(A.target.value),placeholder:"z. B. Vereinsheim, Großer Saal",className:"w-full px-3.5 py-2 rounded-sm input-field text-xs"})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Beschreibung (optional)"}),i.jsx("textarea",{rows:2,value:o,onChange:A=>a(A.target.value),placeholder:"Details zur Veranstaltung...",className:"w-full px-3.5 py-2 rounded-sm input-field text-xs font-sans"})]})]})]}),i.jsxs("div",{className:"hallmark-panel rounded-sm p-6 border border-grid space-y-4 font-mono text-xs",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-grid pb-2",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-main flex items-center gap-2",children:[i.jsx(Kl,{className:"w-4 h-4 text-blue-500"})," 2. Aufgabenfelder & Schichten"]}),i.jsxs("button",{type:"button",onClick:v,className:"px-3.5 py-1.5 rounded-sm text-xs font-mono font-bold bg-blue-500/10 text-blue-500 border border-blue-500/20 hover:bg-blue-500/20 transition flex items-center gap-1",children:[i.jsx(tn,{className:"w-3.5 h-3.5"})," BEREICH HINZUFÜGEN"]})]}),y.map((A,I)=>i.jsxs("div",{className:"p-4 rounded-sm bg-subtle border border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("input",{type:"text",required:!0,placeholder:"Name des Aufgabenfeldes (z. B. Tresendienst)",value:A.name,onChange:V=>b(I,"name",V.target.value),className:"flex-1 px-3 py-1.5 rounded-sm input-field text-xs font-bold"}),i.jsx("button",{type:"button",onClick:()=>S(I),className:"p-1.5 text-muted hover:text-red-400 transition",title:"Bereich entfernen",children:i.jsx(Bt,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"pl-3 border-l-2 border-grid space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs text-muted font-bold",children:[i.jsx("span",{children:"Schichten & Zeitfenster"}),i.jsxs("button",{type:"button",onClick:()=>N(I),className:"text-blue-500 hover:underline flex items-center gap-1",children:[i.jsx(tn,{className:"w-3 h-3"})," Schicht hinzufügen"]})]}),A.shifts.map((V,W)=>i.jsxs("div",{className:"p-3 rounded-sm bg-surface border border-grid space-y-2",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-12 gap-2 items-center text-xs",children:[i.jsx("input",{type:"text",placeholder:"Titel",value:V.title,onChange:H=>U(I,W,"title",H.target.value),className:"sm:col-span-4 px-2.5 py-1 rounded-sm input-field text-xs"}),i.jsx("input",{type:"text",placeholder:"Start (14:00)",value:V.start_time,onChange:H=>U(I,W,"start_time",H.target.value),className:"sm:col-span-2 px-2.5 py-1 rounded-sm input-field text-xs"}),i.jsx("input",{type:"text",placeholder:"Ende (18:00)",value:V.end_time,onChange:H=>U(I,W,"end_time",H.target.value),className:"sm:col-span-2 px-2.5 py-1 rounded-sm input-field text-xs"}),i.jsxs("div",{className:"sm:col-span-3 flex items-center gap-1",children:[i.jsx("span",{className:"text-[11px] text-muted",children:"Plätze:"}),i.jsx("input",{type:"number",min:"1",value:V.max_participants,onChange:H=>U(I,W,"max_participants",parseInt(H.target.value)||1),className:"w-full px-2 py-1 rounded-sm input-field text-xs font-bold"})]}),i.jsx("button",{type:"button",onClick:()=>E(I,W),className:"sm:col-span-1 p-1 text-muted hover:text-red-400 text-center",title:"Schicht löschen",children:i.jsx(Bt,{className:"w-3.5 h-3.5 mx-auto"})})]}),t&&t.length>0&&i.jsxs("div",{className:"pt-1.5 border-t border-grid text-[11px]",children:[i.jsx("span",{className:"text-muted block mb-1",children:"Erforderliche Qualifikationen:"}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(H=>{const Se=(V.required_skill_ids||[]).includes(H.id);return i.jsxs("button",{type:"button",onClick:()=>D(I,W,H.id),style:{backgroundColor:Se?H.color:`${H.color}15`,borderColor:H.color,color:Se?"#ffffff":H.color},className:"px-2 py-0.5 rounded-sm border text-[10px] font-bold transition",children:[H.name," ",Se?"✓":""]},H.id)})})]})]},W))]})]},I))]}),i.jsxs("div",{className:"hallmark-panel rounded-sm p-4 border border-grid flex items-center justify-between font-mono text-xs",children:[i.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 rounded-sm text-xs font-semibold text-muted hover:bg-surface-hover transition border border-grid",children:"Abbrechen"}),i.jsxs("button",{type:"submit",disabled:R,style:{backgroundColor:"var(--brand-primary)"},className:"px-6 py-2.5 rounded-sm text-xs font-mono font-bold text-white transition shadow-sm hover:brightness-110 flex items-center gap-2",children:[i.jsx(en,{className:"w-4 h-4"}),R?"Speichern...":e?"Änderungen Speichern":"Veranstaltung Jetzt Erstellen"]})]})]})]})}function gp({onBack:e,onInstantiateTemplate:t}){const[n,r]=j.useState([]),[l,s]=j.useState(!0),[o,a]=j.useState(""),[u,d]=j.useState(null),[h,g]=j.useState(""),[x,k]=j.useState(new Date().toISOString().split("T")[0]),[y,w]=j.useState(new Date().toISOString().split("T")[0]),[R,f]=j.useState(""),[c,m]=j.useState(!1);j.useEffect(()=>{v()},[]);const v=async()=>{s(!0);try{const N=await $("/templates/");r(N.results||N)}catch(N){a(N.message||"Laden der Vorlagen fehlgeschlagen.")}finally{s(!1)}},S=N=>{d(N),g(N.name)},b=async N=>{if(N.preventDefault(),!!u){m(!0);try{await t(u.id,{title:h,start_date:x,end_date:y,location:R})}catch(E){a(E.message||"Erstellen der Veranstaltung aus Vorlage fehlgeschlagen.")}finally{m(!1)}}};return i.jsxs("div",{className:"space-y-6 max-w-4xl mx-auto animate-in fade-in duration-200 font-sans",children:[i.jsxs("div",{className:"flex items-center justify-between font-mono text-xs",children:[i.jsxs("button",{onClick:e,className:"px-3.5 py-1.5 rounded-sm bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-2 font-bold",children:[i.jsx(Bc,{className:"w-4 h-4"})," [ ZURÜCK ZUR ÜBERSICHT ]"]}),i.jsxs("span",{className:"text-muted border border-grid px-2.5 py-0.5 rounded-sm uppercase",children:["SYSTEM VORLAGEN (",n.length,")"]})]}),i.jsx("div",{className:"hallmark-panel rounded-sm p-6 sm:p-8 border border-grid space-y-2",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-sm bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 flex items-center justify-center font-bold",children:i.jsx(Kl,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"font-serif text-3xl font-bold uppercase tracking-tight text-main",children:"Veranstaltungs-Vorlagen Zentrale"}),i.jsx("p",{className:"text-xs text-muted font-mono mt-0.5",children:"Erstelle neue Veranstaltungen im Handumdrehen aus vorgefertigten Struktur-Vorlagen"})]})]})}),o&&i.jsxs("div",{className:"p-4 rounded-sm bg-red-500/10 border border-red-500/20 text-red-500 text-xs font-mono flex items-center gap-2",children:[i.jsx(br,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:o})]}),i.jsxs("div",{className:"space-y-4 font-mono text-xs",children:[i.jsx("h3",{className:"font-serif text-lg font-bold uppercase text-main",children:"Verfügbare Vorlagen"}),l?i.jsx("div",{className:"hallmark-panel p-8 text-center text-muted",children:"Lade Vorlagen..."}):n.length===0?i.jsx("div",{className:"hallmark-panel p-8 text-center text-muted italic",children:"[ Noch keine Vorlagen gespeichert. Du kannst in der Admin-Zentrale Vorlagen anlegen. ]"}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:n.map(N=>i.jsxs("div",{onClick:()=>S(N),className:`hallmark-panel p-5 rounded-sm border cursor-pointer transition space-y-2 ${(u==null?void 0:u.id)===N.id?"bg-indigo-500/10 border-indigo-500 shadow-md":"bg-surface border-grid hover:border-muted"}`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h4",{className:"font-serif text-base font-bold text-main uppercase",children:N.name}),(u==null?void 0:u.id)===N.id&&i.jsx("span",{className:"text-[10px] font-mono text-indigo-400 bg-indigo-500/20 px-2 py-0.5 rounded-sm border border-indigo-500/30 font-bold",children:"[ AUSGEWÄHLT ]"})]}),N.description&&i.jsx("p",{className:"text-xs font-sans text-muted",children:N.description}),i.jsxs("div",{className:"text-[10px] text-muted pt-2 border-t border-grid flex items-center justify-between",children:[i.jsxs("span",{children:["Erstellt von: ",i.jsx("strong",{children:N.created_by_name||"Admin"})]}),i.jsx("span",{className:"text-indigo-400 font-bold",children:"Klick zum Auswählen"})]})]},N.id))})]}),u&&i.jsxs("form",{onSubmit:b,className:"hallmark-panel rounded-sm p-6 border border-grid space-y-4 font-mono text-xs animate-in fade-in duration-200",children:[i.jsxs("h3",{className:"font-serif text-lg font-bold uppercase text-indigo-400 border-b border-grid pb-2",children:['Neue Veranstaltung aus Vorlage "',u.name,'" Erstellen']}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Titel der Veranstaltung"}),i.jsx("input",{type:"text",required:!0,value:h,onChange:N=>g(N.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-sm"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Startdatum"}),i.jsx("input",{type:"date",required:!0,value:x,onChange:N=>k(N.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-xs"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Enddatum"}),i.jsx("input",{type:"date",required:!0,value:y,onChange:N=>w(N.target.value),className:"w-full px-3.5 py-2 rounded-sm input-field text-xs"})]}),i.jsxs("div",{className:"sm:col-span-2",children:[i.jsx("label",{className:"block text-main mb-1 font-bold",children:"Ort (optional)"}),i.jsx("input",{type:"text",value:R,onChange:N=>f(N.target.value),placeholder:"z. B. Großer Saal",className:"w-full px-3.5 py-2 rounded-sm input-field text-xs"})]})]}),i.jsx("div",{className:"pt-3 flex justify-end border-t border-grid",children:i.jsxs("button",{type:"submit",disabled:c,style:{backgroundColor:"var(--brand-primary)"},className:"px-6 py-2.5 rounded-sm text-xs font-mono font-bold text-white transition hover:brightness-110 shadow-sm flex items-center gap-2",children:[i.jsx(ep,{className:"w-4 h-4 fill-white"}),c?"Erstellen...":"Veranstaltung Jetzt Aus Vorlage Erstellen"]})})]})]})}function yp(){const[e,t]=j.useState(null),[n,r]=j.useState(null),[l,s]=j.useState([]),[o,a]=j.useState([]),[u,d]=j.useState(null),[h,g]=j.useState(null),[x,k]=j.useState(!0),[y,w]=j.useState("home"),[R,f]=j.useState(!1),[c,m]=j.useState(!1),[v,S]=j.useState(null),[b,N]=j.useState(!1),[E,U]=j.useState(!1),[D,J]=j.useState(localStorage.getItem("theme_mode")||"auto"),[A,I]=j.useState(null),[V,W]=j.useState(null);j.useEffect(()=>{window.addEventListener("beforeinstallprompt",C=>{C.preventDefault(),W(C)}),Y()},[]),j.useEffect(()=>{localStorage.setItem("theme_mode",D);const C=()=>{let z=D;D==="auto"&&(z=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-theme",z)};if(C(),D==="auto"){const z=window.matchMedia("(prefers-color-scheme: dark)"),G=()=>C();return z.addEventListener("change",G),()=>z.removeEventListener("change",G)}},[D]),j.useEffect(()=>{n!=null&&n.primary_color&&(document.documentElement.style.setProperty("--brand-primary",n.primary_color),document.documentElement.style.setProperty("--brand-secondary",n.secondary_color||n.primary_color))},[n]);const[H,Se]=j.useState(null),[T,O]=j.useState(null),L=C=>{I(C),setTimeout(()=>I(null),5e3)},Y=async()=>{k(!0);try{try{const Me=await $("/branding/");r(Me)}catch{}if(ki())try{const Me=await $("/users/me/");t(Me)}catch{Pl(null),t(null)}const C=new URLSearchParams(window.location.search),z=C.get("claim_token"),G=C.get("guest_name");z&&G&&(Se(z),O(G),ki()||f(!0)),await tt(),await xe()}catch(C){console.error(C)}finally{k(!1)}},le=async C=>{try{const z=await $(`/users/signups/${C.id}/generate-claim-link/`,{method:"POST"}),G=`${window.location.origin}/?claim_token=${z.token}&guest_name=${encodeURIComponent(z.guest_name)}`;navigator.clipboard?(await navigator.clipboard.writeText(G),L(`✅ Einladungs-Link für ${z.guest_name} in Zwischenablage kopiert!`)):prompt(`Einladungs-Link für ${z.guest_name} kopieren:`,G)}catch(z){alert(z.message||"Fehler beim Erstellen des Links.")}},tt=async()=>{try{const C=await $("/skills/");s(C.results||C)}catch{}},xe=async()=>{try{const C=await $("/events/"),z=C.results||C;a(z),z.length>0&&!u?(d(z[0].id),ge(z[0].id)):u&&ge(u)}catch{}},ge=async C=>{try{const z=await $(`/events/${C}/matrix/`);g(z)}catch{}},fe=C=>{d(C),ge(C),w("schedule")},ot=()=>{Pl(null),t(null),L("Erfolgreich abgemeldet."),u&&ge(u)},Gl=(C,z)=>{t(C),L(z||"Erfolgreich angemeldet!"),u&&ge(u)},$t=async C=>{if(!e)S(C),m(!0);else try{const z=await $(`/shifts/${C.id}/signup/`,{method:"POST"});L(z.message||"Erfolgreich für Schicht eingetragen!"),u&&ge(u)}catch(z){L(`Fehler: ${z.message}`)}},Yl=async C=>{if(!v)return;const z=await $(`/shifts/${v.id}/signup/`,{method:"POST",body:JSON.stringify(C)});L(z.message||"Als Gast eingetragen!"),u&&ge(u)},Er=async C=>{try{const z=await $(`/shifts/${C.id}/signup/`,{method:"DELETE"});L(z.message||"Eintragung storniert."),u&&ge(u)}catch(z){L(`Fehler: ${z.message}`)}},[ql,yt]=j.useState(null),Zl=async C=>{let z=C.id;z?await $(`/events/${z}/`,{method:"PATCH",body:JSON.stringify({title:C.title,description:C.description,location:C.location,start_date:C.start_date,end_date:C.end_date})}):z=(await $("/events/",{method:"POST",body:JSON.stringify({title:C.title,description:C.description,location:C.location,start_date:C.start_date,end_date:C.end_date})})).id;for(let G of C.task_areas){if(!G.name)continue;let Me=G.id;Me?await $(`/task-areas/${Me}/`,{method:"PATCH",body:JSON.stringify({name:G.name,description:G.description||""})}):Me=(await $("/task-areas/",{method:"POST",body:JSON.stringify({event:z,name:G.name,description:G.description||""})})).id;for(let ye of G.shifts)ye.id?await $(`/shifts/${ye.id}/`,{method:"PATCH",body:JSON.stringify({title:ye.title,start_time:ye.start_time,end_time:ye.end_time,max_participants:ye.max_participants,required_skill_ids:ye.required_skill_ids||[]})}):await $("/shifts/",{method:"POST",body:JSON.stringify({task_area:Me,title:ye.title,start_time:ye.start_time,end_time:ye.end_time,max_participants:ye.max_participants,required_skill_ids:ye.required_skill_ids||[]})})}L(C.id?"Veranstaltung & Schichten aktualisiert!":"Veranstaltung erfolgreich erstellt!"),await xe(),fe(z)},Ft=async(C,z)=>{const G=await $(`/templates/${C}/instantiate/`,{method:"POST",body:JSON.stringify(z)});L("Veranstaltung aus Vorlage erstellt!"),await xe(),G.id&&fe(G.id)},Xl=()=>{u&&window.open(`/api/events/${u}/export_pdf/`,"_blank")},Cr=()=>{window.print()},Jl=()=>{V&&(V.prompt(),V.userChoice.then(C=>{C.outcome==="accepted"&&L("PWA Installation gestartet!"),W(null)}))};return i.jsxs("div",{className:"min-h-screen bg-canvas text-main flex flex-col font-sans selection:bg-surface-hover transition-colors duration-200",children:[A&&i.jsxs("div",{className:"fixed bottom-6 right-6 z-50 bg-emerald-600 text-white px-4 py-2.5 rounded-sm shadow-2xl font-mono text-xs flex items-center gap-2 border border-emerald-400 animate-in fade-in slide-in-from-bottom-3 duration-200",children:[i.jsx(en,{className:"w-4 h-4"}),i.jsx("span",{children:A})]}),i.jsx(ap,{branding:n,user:e,activeTab:y,onChangeTab:w,themeMode:D,onChangeThemeMode:J,onLogout:ot,onOpenAuth:()=>f(!0),onOpenCreateEvent:()=>{yt(null),w("event-editor")},onOpenTemplates:()=>w("templates"),onOpenProfile:()=>U(!0),onOpenAdmin:()=>w("admin"),pwaInstallPrompt:!!V,onInstallPwa:Jl}),i.jsx("main",{className:"flex-1 max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:x?i.jsx("div",{className:"hallmark-panel p-16 text-center text-xs text-muted font-mono border border-grid",children:"Lade Daten..."}):y==="home"?i.jsx(mp,{events:o,user:e,onSelectEvent:fe,onOpenCreateEvent:()=>{yt(null),w("event-editor")},onToggleEventActive:async C=>{try{await $(`/events/${C.id}/`,{method:"PATCH",body:JSON.stringify({is_active:C.is_active===!1})}),xe()}catch(z){alert(z.message||"Aktion fehlgeschlagen.")}},onEditEvent:C=>{yt(C),w("event-editor")},branding:n}):y==="calendar"?i.jsx(pp,{events:o,onSelectEvent:fe,branding:n}):y==="admin"?i.jsx(hp,{branding:n,onRefreshBranding:async()=>{const C=await $("/branding/");r(C)},onRefreshEvents:xe,skills:l,onRefreshSkills:tt}):y==="event-editor"?i.jsx(xp,{eventToEdit:ql,skills:l,onBack:()=>w("schedule"),onSubmit:Zl}):y==="templates"?i.jsx(gp,{onBack:()=>w("schedule"),onInstantiateTemplate:Ft}):i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between gap-4 overflow-x-auto pb-2 no-scrollbar font-mono",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs font-bold text-muted uppercase tracking-wider whitespace-nowrap",children:"Ausgewähltes Event:"}),o.map(C=>{const z=u===C.id;return i.jsx("button",{onClick:()=>fe(C.id),style:{backgroundColor:z?(n==null?void 0:n.primary_color)||"var(--brand-primary)":void 0,borderColor:z?(n==null?void 0:n.primary_color)||"var(--brand-primary)":void 0},className:`px-3.5 py-1.5 rounded-sm text-xs font-bold transition whitespace-nowrap border ${z?"text-white shadow-sm":"bg-subtle text-muted border-grid hover:text-main"}`,children:C.title},C.id)})]}),e&&i.jsxs("button",{onClick:()=>{yt(null),w("event-editor")},className:"px-3.5 py-1.5 rounded-sm text-xs font-bold bg-subtle hover:bg-surface-hover text-main border border-grid transition flex items-center gap-1.5 shrink-0",children:[i.jsx(tn,{className:"w-4 h-4"})," Neues Event"]})]}),i.jsx(up,{event:h,user:e,onSignupClick:$t,onCancelClick:Er,onRemoveUserFromShift:async(C,z)=>{try{const G=await $(`/shifts/${C.id}/signup/${z}/`,{method:"DELETE"});L(G.message||"Eintragung entfernt."),xe(),u&&fe(u)}catch(G){alert(G.message||"Entfernen der Person fehlgeschlagen.")}},onGenerateClaimLink:le,onExportPdf:Xl,onPrintView:Cr,onEditEvent:C=>{yt(C),w("event-editor")}})]})}),i.jsx("footer",{className:"border-t border-grid py-6 text-center text-xs text-muted font-mono no-print",children:i.jsxs("p",{children:[(n==null?void 0:n.app_name)||"Veranstaltungsschichtplaner"," • PWA Enabled • PostgreSQL & Docker Ready"]})}),R&&i.jsx(fp,{onClose:()=>{f(!1),Se(null),O(null)},onSuccess:Gl,claimToken:H,prefilledGuestName:T}),c&&i.jsx(cp,{shift:v,onClose:()=>m(!1),onSubmit:Yl})]})}Es.createRoot(document.getElementById("root")).render(i.jsx(Ed.StrictMode,{children:i.jsx(yp,{})})); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 6c2f46f..e1e8900 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -11,7 +11,7 @@ Schichtplaner — Veranstaltungsschichtpläne - + diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index bf17273..c34d1bb 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -106,14 +106,34 @@ export default function App() { try { const userData = await apiFetch('/users/me/'); setUser(userData); + if (!userData.is_admin_user && !userData.is_staff && !userData.is_superuser && activeTab === 'admin') { + setActiveTab('home'); + } } catch (e) { setAuthToken(null); setUser(null); + setActiveTab('home'); } } - // 3. Check URL parameters for guest account claim link + // 3. Check URL parameters for email verification and claim link const urlParams = new URLSearchParams(window.location.search); + const verifyToken = urlParams.get('verify_email'); + if (verifyToken) { + try { + const data = await apiFetch('/users/verify-email/', { + method: 'POST', + body: JSON.stringify({ token: verifyToken }) + }); + setAuthToken(data.token); + setUser(data.user); + showNotification(data.message || '✅ E-Mail-Adresse erfolgreich bestätigt!'); + window.history.replaceState({}, document.title, window.location.pathname); + } catch (err) { + showNotification(`⚠️ E-Mail Bestätigung: ${err.message}`); + } + } + const cToken = urlParams.get('claim_token'); const gName = urlParams.get('guest_name'); if (cToken && gName) { @@ -190,12 +210,16 @@ export default function App() { const handleLogout = () => { setAuthToken(null); setUser(null); + setActiveTab('home'); showNotification('Erfolgreich abgemeldet.'); if (selectedEventId) fetchEventMatrix(selectedEventId); }; const handleAuthSuccess = (userData, message) => { setUser(userData); + if (userData && !userData.is_admin_user && !userData.is_staff && !userData.is_superuser && activeTab === 'admin') { + setActiveTab('home'); + } showNotification(message || 'Erfolgreich angemeldet!'); if (selectedEventId) fetchEventMatrix(selectedEventId); }; @@ -423,7 +447,7 @@ export default function App() { onSelectEvent={handleSelectEvent} branding={branding} /> - ) : activeTab === 'admin' ? ( + ) : activeTab === 'admin' && user && (user.is_admin_user || user.is_staff || user.is_superuser) ? ( { diff --git a/frontend/src/components/AuthModal.jsx b/frontend/src/components/AuthModal.jsx index d9d1730..f83a8ef 100644 --- a/frontend/src/components/AuthModal.jsx +++ b/frontend/src/components/AuthModal.jsx @@ -48,8 +48,8 @@ export default function AuthModal({ onClose, onSuccess, claimToken, prefilledGue body: JSON.stringify(bodyObj) }); - if (data.requires_approval) { - onSuccess(null, data.message); + if (data.requires_verification || data.requires_approval || !data.token) { + onSuccess(null, data.message || 'Konto erfolgreich registriert! Bitte schau in deine E-Mail zur Bestätigung oder warte auf die Admin-Freischaltung.'); onClose(); return; }