diff --git a/hifi-src/src/App.jsx b/hifi-src/src/App.jsx index ad657d6..94fa77e 100644 --- a/hifi-src/src/App.jsx +++ b/hifi-src/src/App.jsx @@ -90,6 +90,7 @@ const ExportImportSettings = lazyPage(() => import('./pages/admin/settings/Expor const MaintenanceSettings = lazyPage(() => import('./pages/admin/settings/MaintenanceSettings.jsx')); const CountdownSettings = lazyPage(() => import('./pages/admin/settings/CountdownSettings.jsx')); const ConnectionSettings = lazyPage(() => import('./pages/admin/settings/ConnectionSettings.jsx')); +const HiggsfieldSettings = lazyPage(() => import('./pages/admin/settings/HiggsfieldSettings.jsx')); const ResetSettings = lazyPage(() => import('./pages/admin/settings/ResetSettings.jsx')); const blankScreen =
; @@ -171,6 +172,7 @@ export default function App() {+ Bilder per KI erzeugen: zuerst unter{' '} + KI-Modellbilder{' '} + den Higgsfield-Zugang einrichten. +
+ ) : null; + } + + const running = job && (job.status === 'queued' || job.status === 'in_progress'); + + return ( +Bild mit KI erzeugen
+Kein Referenzbild hinterlegt – die Bilder können im Stil voneinander abweichen.
+ )} + {error &&{error}
} + + {job?.status === 'completed' && job.images.length > 0 && ( ++ Ergebnis anklicken, um es als Modellbild zu übernehmen{hasImage ? ' (ersetzt das aktuelle Bild)' : ''}. Nicht passend? Einfach neu erzeugen. +
+Lädt…
; + + return ( + + ); +} diff --git a/hifi-src/src/pages/admin/settings/SettingsLayout.jsx b/hifi-src/src/pages/admin/settings/SettingsLayout.jsx index 08ad5f1..b3c8c3f 100644 --- a/hifi-src/src/pages/admin/settings/SettingsLayout.jsx +++ b/hifi-src/src/pages/admin/settings/SettingsLayout.jsx @@ -12,7 +12,8 @@ const PAGES = { countdown: ['Launch-Countdown', 'Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst.'], email: ['E-Mail-Versand', 'Zugangsdaten des Mail-Servers und die Texte der automatischen E-Mails.'], google: ['Google-Dienste', 'Google Analytics und Google-Bewertungen anbinden. Nur für Techniker.'], - connections: ['Verbindungstest', 'Prüft auf Knopfdruck, ob Google, Mail-Server, Datenbank, Update-Server und Audio4Cars erreichbar sind und richtig eingerichtet.'], + 'ai-images': ['KI-Modellbilder', 'Modellbilder über Higgsfield erzeugen lassen: Zugang, Prompt und Referenzbild. Generiert wird danach direkt beim Modell (Modelle > Modell bearbeiten).'], + connections: ['Verbindungstest', 'Prüft auf Knopfdruck, ob Google, Mail-Server, Datenbank, Update-Server, Audio4Cars und Higgsfield erreichbar sind und richtig eingerichtet.'], database: ['Datenbank', 'Verbindung und Struktur der Datenbank. Nur für Techniker.'], 'export-import': ['Export & Import', 'Sicherung herunterladen oder auf einem anderen Server einspielen.'], update: ['Updates', 'Neue Versionen der Website installieren.'], diff --git a/hifi/api/public/index.php b/hifi/api/public/index.php index 8e723d8..591c11e 100644 --- a/hifi/api/public/index.php +++ b/hifi/api/public/index.php @@ -22,6 +22,7 @@ use App\Controllers\GalleryBrandController; use App\Controllers\GalleryPhotoController; use App\Controllers\GalleryProjectController; use App\Controllers\GoogleReviewsController; +use App\Controllers\HiggsfieldController; use App\Controllers\MailSettingsController; use App\Controllers\MaintenanceController; use App\Controllers\ModelController; @@ -155,6 +156,10 @@ $router->get('/models', $anyPerm(['models.manage', 'packages.manage'], fn($p) => $router->post('/models', $perm('models.manage', fn($p) => ModelController::store())); $router->put('/models/{id}', $perm('models.manage', fn($p) => ModelController::update($p))); $router->delete('/models/{id}', $perm('models.manage', fn($p) => ModelController::destroy($p))); +$router->get('/ai-images/availability', $perm('models.manage', fn($p) => HiggsfieldController::availability())); +$router->get('/ai-images/requests/{request_id}', $perm('models.manage', fn($p) => HiggsfieldController::requestStatus($p))); +$router->post('/models/{id}/ai-image', $perm('models.manage', fn($p) => HiggsfieldController::generate($p))); +$router->post('/models/{id}/ai-image/apply', $perm('models.manage', fn($p) => HiggsfieldController::apply($p))); // Fahrzeug-Vorlage: legt Marken und Modelle an, braucht deshalb beide Rechte. $router->get('/vehicle-catalog', $anyPerm(['brands.manage', 'models.manage'], fn($p) => VehicleCatalogController::index())); $router->post('/vehicle-catalog/align-styles', $perm('brands.manage', $perm('models.manage', fn($p) => VehicleCatalogController::alignStylesAction()))); @@ -303,6 +308,8 @@ $router->post('/settings/analytics', $perm('system.admin', fn($p) => AnalyticsCo $router->get('/settings/google-reviews', $perm('system.admin', fn($p) => GoogleReviewsController::show())); $router->post('/settings/google-reviews', $perm('system.admin', fn($p) => GoogleReviewsController::update())); $router->post('/settings/google-reviews/refresh', $perm('system.admin', fn($p) => GoogleReviewsController::refresh())); +$router->get('/settings/higgsfield', $perm('system.admin', fn($p) => HiggsfieldController::show())); +$router->post('/settings/higgsfield', $perm('system.admin', fn($p) => HiggsfieldController::update())); $router->post('/settings/connection-test', $perm('system.admin', fn($p) => ConnectionTestController::test())); $router->get('/analytics/report', $admin(fn($p) => AnalyticsController::report())); $router->get('/analytics/traffic', $perm('system.admin', fn($p) => AnalyticsController::traffic())); diff --git a/hifi/api/src/Controllers/ConnectionTestController.php b/hifi/api/src/Controllers/ConnectionTestController.php index 1b13fdc..677ae05 100644 --- a/hifi/api/src/Controllers/ConnectionTestController.php +++ b/hifi/api/src/Controllers/ConnectionTestController.php @@ -6,6 +6,7 @@ use App\Config\Database; use App\Services\Audio4CarsScraper; use App\Services\GitUpdateService; use App\Services\GooglePlacesReviewsFetcher; +use App\Services\HiggsfieldClient; use App\Support\GoogleAnalyticsReporting; use App\Support\Http; use App\Support\Mailer; @@ -28,6 +29,7 @@ class ConnectionTestController 'database' => 'testDatabase', 'update_server' => 'testUpdateServer', 'audio4cars' => 'testAudio4Cars', + 'higgsfield' => 'testHiggsfield', ]; public static function test(): void @@ -244,6 +246,24 @@ class ConnectionTestController // ---- Hilfsfunktionen ---- + private static function testHiggsfield(): array + { + $settings = HiggsfieldClient::settings(); + if ($settings['api_key'] === '') { + return self::result('not_configured', 'Kein API-Key eingetragen.', 'Unter KI-Modellbilder den Key aus der Higgsfield-Cloud eintragen (KEY_ID:KEY_SECRET).'); + } + + HiggsfieldClient::checkCredentials($settings['api_key']); + + if ($settings['endpoint'] === '') { + return self::result('warning', 'Key wird angenommen, aber es ist noch kein Modell-Endpunkt eingetragen.', 'Unter KI-Modellbilder den Endpunkt des gewünschten Higgsfield-Modells eintragen.'); + } + return self::result('ok', 'Higgsfield erreichbar, Key wird angenommen.', null, [ + 'Modell' => $settings['endpoint'], + 'Referenzbild' => $settings['reference_path'] !== '' ? 'hinterlegt' : '–', + ]); + } + private static function result(string $status, string $message, ?string $hint = null, array $details = []): array { return [ diff --git a/hifi/api/src/Controllers/HiggsfieldController.php b/hifi/api/src/Controllers/HiggsfieldController.php new file mode 100644 index 0000000..670b31d --- /dev/null +++ b/hifi/api/src/Controllers/HiggsfieldController.php @@ -0,0 +1,203 @@ + KI-Modellbilder, system.admin) + * und Generieren/Uebernehmen im Modell-Panel (models.manage). Der API-Key geht nie zurueck + * an den Browser. + */ +class HiggsfieldController +{ + private const MAX_DOWNLOAD_BYTES = 20 * 1024 * 1024; + private const ALLOWED_MIME = ['image/jpeg' => 'jpg', 'image/png' => 'png', 'image/webp' => 'webp']; + + public static function show(): void + { + $settings = HiggsfieldClient::settings(); + $key = $settings['api_key']; + + Http::send([ + 'has_api_key' => $key !== '', + // Nur die letzten Zeichen, damit man erkennt, welcher Key hinterlegt ist. + 'api_key_hint' => $key !== '' ? '…' . substr($key, -4) : null, + 'endpoint' => $settings['endpoint'], + 'image_field' => $settings['image_field'], + 'image_format' => $settings['image_format'], + 'prompt' => $settings['prompt'], + 'params' => $settings['params'], + 'reference_path' => $settings['reference_path'], + 'default_prompt' => HiggsfieldClient::DEFAULT_PROMPT, + 'default_params' => HiggsfieldClient::DEFAULT_PARAMS, + ]); + } + + /** Leeres Key-Feld = bestehenden Key behalten, remove_api_key = Key loeschen. */ + public static function update(): void + { + $body = Http::jsonBody(); + $params = trim((string) ($body['params'] ?? '')); + if ($params !== '' && !is_array(json_decode($params, true))) { + Http::error('Zusätzliche Parameter: kein gültiges JSON-Objekt, z. B. {"aspect_ratio": "4:3"}.', 422); + } + $format = (string) ($body['image_format'] ?? 'urls'); + if (!in_array($format, HiggsfieldClient::IMAGE_FORMATS, true)) { + $format = 'urls'; + } + $field = trim((string) ($body['image_field'] ?? '')); + if ($field !== '' && !preg_match('/^[A-Za-z0-9_]{1,50}$/', $field)) { + Http::error('Feldname für Referenzbilder: nur Buchstaben, Ziffern und _.', 422); + } + $endpoint = trim((string) ($body['endpoint'] ?? ''), " /"); + if ($endpoint !== '' && !preg_match('#^[A-Za-z0-9._\-/]{1,255}$#', $endpoint)) { + Http::error('Modell-Endpunkt: nur der Pfad, z. B. "bytedance/seedream/v4/edit" – ohne https://api.higgsfield.ai.', 422); + } + $prompt = trim((string) ($body['prompt'] ?? '')); + + $db = Database::connection(); + $db->exec('INSERT IGNORE INTO app_settings (id) VALUES (1)'); + $old = HiggsfieldClient::settings(); + $referencePath = trim((string) ($body['reference_path'] ?? '')) ?: null; + + $stmt = $db->prepare( + 'UPDATE app_settings SET higgsfield_endpoint = ?, higgsfield_image_field = ?, higgsfield_image_format = ?, + higgsfield_prompt = ?, higgsfield_params = ?, higgsfield_reference_path = ? WHERE id = 1' + ); + $stmt->execute([ + $endpoint ?: null, + $field ?: null, + $format, + $prompt !== '' && $prompt !== HiggsfieldClient::DEFAULT_PROMPT ? $prompt : null, + $params !== '' ? $params : null, + $referencePath, + ]); + + $apiKey = trim((string) ($body['api_key'] ?? '')); + if ($apiKey !== '' || !empty($body['remove_api_key'])) { + $db->prepare('UPDATE app_settings SET higgsfield_api_key = ? WHERE id = 1')->execute([$apiKey ?: null]); + } + + Uploads::deleteIfOrphaned($old['reference_path'] ?: null, $referencePath); + + self::show(); + } + + /** Fuers Modell-Panel: ist die Anbindung eingerichtet? (ohne Details) */ + public static function availability(): void + { + $settings = HiggsfieldClient::settings(); + Http::send(['configured' => HiggsfieldClient::isConfigured($settings), 'has_reference' => $settings['reference_path'] !== '']); + } + + /** Body: use_current (aktuelles Modellbild als weitere Vorlage), extra_prompt. */ + public static function generate(array $params): void + { + $model = self::model((int) $params['id']); + $body = Http::jsonBody(); + $extraReference = !empty($body['use_current']) && $model['image_path'] ? $model['image_path'] : null; + + @set_time_limit(120); + try { + $requestId = HiggsfieldClient::submitForModel($model, $extraReference, (string) ($body['extra_prompt'] ?? '')); + } catch (\Throwable $e) { + Http::error($e->getMessage(), 502); + } + + Http::send(['request_id' => $requestId], 201); + } + + public static function requestStatus(array $params): void + { + try { + Http::send(HiggsfieldClient::status((string) $params['request_id'])); + } catch (\Throwable $e) { + Http::error($e->getMessage(), 502); + } + } + + /** + * Uebernimmt Bild Nr. index eines fertigen Auftrags als Modellbild. Die Bild-URL kommt + * absichtlich nicht vom Browser, sondern wird erneut bei Higgsfield abgefragt - so laedt + * der Server nur Bilder, die Higgsfield selbst geliefert hat. + */ + public static function apply(array $params): void + { + $model = self::model((int) $params['id']); + $body = Http::jsonBody(); + $index = max(0, (int) ($body['index'] ?? 0)); + + @set_time_limit(120); + try { + $result = HiggsfieldClient::status((string) ($body['request_id'] ?? '')); + if ($result['status'] !== 'completed' || !isset($result['images'][$index])) { + Http::error('Das Bild ist (noch) nicht fertig.', 409); + } + $path = self::download($result['images'][$index]); + } catch (\Throwable $e) { + Http::error($e->getMessage(), 502); + } + + $db = Database::connection(); + $db->prepare('UPDATE car_models SET image_path = ? WHERE id = ?')->execute([$path, $model['id']]); + Uploads::deleteIfOrphaned($model['image_path'] ?: null, $path); + + Http::send(['image_path' => $path]); + } + + private static function model(int $id): array + { + $stmt = Database::connection()->prepare( + 'SELECT m.id, m.name, m.image_path, b.name AS brand_name FROM car_models m JOIN brands b ON b.id = m.brand_id WHERE m.id = ?' + ); + $stmt->execute([$id]); + $model = $stmt->fetch(); + if (!$model) { + Http::error('Modell nicht gefunden', 404); + } + return $model; + } + + private static function download(string $url): string + { + $tmp = tempnam(sys_get_temp_dir(), 'hf'); + $handle = fopen($tmp, 'wb'); + $ch = curl_init($url); + curl_setopt_array($ch, [ + CURLOPT_FILE => $handle, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_MAXREDIRS => 3, + CURLOPT_PROTOCOLS => CURLPROTO_HTTPS, + CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTPS, + CURLOPT_TIMEOUT => 90, + CURLOPT_NOPROGRESS => false, + CURLOPT_PROGRESSFUNCTION => fn($ch, $total, $done) => $done > self::MAX_DOWNLOAD_BYTES ? 1 : 0, + ]); + $ok = curl_exec($ch); + $status = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + fclose($handle); + + $mime = $ok && $status === 200 ? (mime_content_type($tmp) ?: '') : ''; + if (!isset(self::ALLOWED_MIME[$mime])) { + @unlink($tmp); + throw new \RuntimeException($ok ? 'Higgsfield hat kein JPG/PNG/WebP-Bild geliefert.' : 'Bild konnte nicht von Higgsfield geladen werden.'); + } + + $filename = bin2hex(random_bytes(16)) . '.' . self::ALLOWED_MIME[$mime]; + $destination = __DIR__ . '/../../uploads/' . $filename; + if (!@rename($tmp, $destination) && !(@copy($tmp, $destination) && @unlink($tmp))) { + @unlink($tmp); + throw new \RuntimeException('Bild konnte nicht gespeichert werden.'); + } + @chmod($destination, 0644); + Uploads::compressImage($destination); + + $config = require __DIR__ . '/../../config/config.php'; + return rtrim($config['app']['base_path'], '/') . '/api/uploads/' . $filename; + } +} diff --git a/hifi/api/src/Controllers/SettingsController.php b/hifi/api/src/Controllers/SettingsController.php index cd8ec4d..0679c71 100644 --- a/hifi/api/src/Controllers/SettingsController.php +++ b/hifi/api/src/Controllers/SettingsController.php @@ -27,7 +27,7 @@ class SettingsController 'gallery_brands' => ['id', 'name', 'slug', 'cover_image_path', 'sort_order', 'created_at', 'updated_at'], 'gallery_projects' => ['id', 'gallery_brand_id', 'name', 'slug', 'cover_image_path', 'sort_order', 'created_at', 'updated_at'], 'gallery_photos' => ['id', 'gallery_project_id', 'image_path', 'caption', 'sort_order', 'created_at', 'updated_at'], - // Absichtlich OHNE mail_password und google_places_api_key (echte Zugangsdaten/API-Keys - + // Absichtlich OHNE mail_password, google_places_api_key und higgsfield_api_key (echte Zugangsdaten/API-Keys - // sollen nie in einer portablen Export-Datei landen, muessen pro Umgebung neu eingetragen // werden), ohne die reinen Google-Reviews-Cache-Felder (google_rating, google_rating_count, // google_reviews_updated_at, google_reviews_error - aktualisieren sich nach einem Umzug von @@ -51,6 +51,8 @@ class SettingsController 'price_note', 'price_note_en', 'countdown_enabled', 'countdown_launch_at', 'countdown_title', 'countdown_title_en', 'countdown_message', 'countdown_message_en', 'site_images', + 'higgsfield_endpoint', 'higgsfield_image_field', 'higgsfield_image_format', + 'higgsfield_prompt', 'higgsfield_params', 'higgsfield_reference_path', 'mail_host', 'mail_port', 'mail_username', 'mail_encryption', 'mail_from_email', 'mail_from_name', 'mail_notify_email', 'mail_customer_subject', 'mail_customer_body', 'mail_owner_subject', 'mail_owner_body', @@ -106,7 +108,7 @@ class SettingsController 'brands' => ['image_path'], 'car_models' => ['image_path'], 'partners' => ['logo_path'], - 'app_settings' => ['hero_image_path', 'logo_path', 'logo_dark_path'], + 'app_settings' => ['hero_image_path', 'logo_path', 'logo_dark_path', 'higgsfield_reference_path'], ]; /** Bild-Pfade einer Zeile - inkl. der als JSON gespeicherten app_settings.site_images. */ diff --git a/hifi/api/src/Services/HiggsfieldClient.php b/hifi/api/src/Services/HiggsfieldClient.php new file mode 100644 index 0000000..d341689 --- /dev/null +++ b/hifi/api/src/Services/HiggsfieldClient.php @@ -0,0 +1,276 @@ + mit den Eingaben als JSON reiht eine + * Generierung ein und liefert request_id; GET /requests/${l.innerHTML.replace(/\n/g,"
")}
${l.innerHTML.replace(/\n/g,"
")}
${n("home.heroSubtitle")}
`:"";return{eyebrow:i.getValue("home_sections",L,"eyebrow",r,$[`eyebrow_${r}`]||""),title:i.getValue("home_sections",L,"title",r,$[`title_${r}`]||Qe),bodyHtml:i.getValue("home_sections",L,"body_html",r,$[`body_html_${r}`]||Hn),align:$.text_align||"center",alignX:$.text_align_x,alignY:$.text_align_y,buttonLabel:i.getValue("home_sections",L,"button_label",r,$[`button_label_${r}`]||""),buttonUrl:i.getValue("home_sections",L,"button_url","de",$.button_url||""),fontFamily:$.font_family||void 0}},N=We("home_sections.hero.eyebrow"),P=We("home_sections.hero.title"),F=We("home_sections.youtube.eyebrow"),B=We("home_sections.youtube.title"),se=We("home_sections.youtube.button_label"),ne=We("home_sections.craft.eyebrow"),q=We("home_sections.craft.title"),G=We("home_sections.advice.eyebrow"),V=We("home_sections.advice.title"),T=We("home_sections.insights.eyebrow"),M=We("home_sections.insights.title"),A=We("home_sections.more.eyebrow"),R=We("home_sections.more.title"),H=We("home_sections.more.button_label");m.useEffect(()=>{ae.get("/home-sections").then(v).catch(()=>E(!0))},[]),m.useEffect(()=>{ae.get("/partners").then(j).catch(()=>{})},[]);const[_,I]=m.useState(null),Y=_?_.reviews.filter(L=>L.review_text).map(L=>({name:L.author_name,text:L.review_text,rating:L.rating,photo:L.profile_photo_url})):n("home.testimonials");m.useEffect(()=>{ae.get("/faqs").then(L=>{p(L.map($=>({id:$.id,question:r==="de"?$.question_de:$.question_en,answer:r==="de"?$.answer_de:$.answer_en})))}).catch(()=>{})},[r]),m.useEffect(()=>{ae.get("/google-reviews").then(L=>{L.rating!=null&&L.reviews.some($=>$.review_text)&&I(L)}).catch(()=>{})},[]),gr({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),m.useEffect(()=>{if(w.length===0||s("home.faq"))return;const L=document.createElement("script");return L.type="application/ld+json",L.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:w.map($=>({"@type":"Question",name:$.question,acceptedAnswer:{"@type":"Answer",text:$.answer}}))}),document.head.appendChild(L),()=>document.head.removeChild(L)},[w]),m.useEffect(()=>{var L;w.length>0&&window.location.hash==="#faq"&&((L=document.getElementById("faq"))==null||L.scrollIntoView())},[w]);const Z=m.useRef(null);m.useEffect(()=>{var uf,cf,df;const L=Z.current;if(!L)return;const $=(uf=window.matchMedia)==null?void 0:uf.call(window,"(prefers-reduced-motion: reduce)").matches,Qe=(cf=navigator.connection)==null?void 0:cf.saveData;if($||Qe)return;const Nv=((df=window.matchMedia)==null?void 0:df.call(window,"(max-width: 767px), (pointer: coarse)").matches)?XN:YN,lf=new IntersectionObserver(([_v])=>{_v.isIntersecting?(L.getAttribute("src")||(L.src=Nv),L.play().catch(()=>{})):L.paused||L.pause()},{rootMargin:"300px 0px"});return lf.observe(L),()=>lf.disconnect()},[]);const ue=m.useRef(null),{scrollYProgress:Q}=Hy({target:ue,offset:["start start","end start"]}),ke=IC(),De=gn(Q,[0,1],ke?["0%","0%"]:["-6%","6%"]),Ze=gn(Q,[0,1],ke?["0%","0%"]:["0%","60%"]),dt=gn(Q,[0,.8],[1,0]),he=gn(Q,[.5,1],[0,1]),ft=gn(he,L=>L>.05?"auto":"none"),W=gn(Q,[.5,1],[16,0]);return o.jsxs("div",{children:[o.jsx(nn.div,{style:{opacity:he,pointerEvents:ft,y:W},className:"fixed inset-x-0 bottom-0 z-20 border-t border-neutral-200 bg-white/95 px-4 py-3 shadow-[0_-8px_24px_rgba(0,0,0,0.08)] backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:px-6",children:o.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[o.jsx(Ge,{k:"home.stickyCta",as:"p",className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block"}),o.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[l&&o.jsx(K,{to:"/fahrzeuge",className:"flex-1 rounded-md bg-brand-500 px-5 py-2.5 text-center text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 sm:flex-none",children:o.jsx(Ge,{k:"home.selectVehicle"})}),o.jsx(K,{to:"/kontakt",className:"flex-1 rounded-md border border-neutral-300 px-5 py-2.5 text-center text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800 sm:flex-none",children:o.jsx(Ge,{k:"home.getInTouch"})})]})]})}),o.jsxs("section",{ref:ue,className:"relative -mt-[89px] h-svh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[o.jsx(nn.img,{style:{y:De,scale:1.15},src:t,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),o.jsx(nn.div,{style:{y:Ze,opacity:dt},className:"absolute inset-0",children:o.jsx("div",{className:"absolute w-full max-w-2xl px-4 text-center sm:px-6",style:{...wp(S("hero").alignX,S("hero").alignY,{x:50,y:50}),fontFamily:S("hero").fontFamily},children:o.jsxs(nn.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[(S("hero").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"hero",field:"eyebrow",value:S("hero").eyebrow,as:"p",className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",style:N,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"hero",field:"title",value:S("hero").title,as:"h1",className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",style:P,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"hero",field:"body_html",value:S("hero").bodyHtml,label:"Text",className:"legal-content mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg"}),o.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[l&&o.jsx(K,{to:"/fahrzeuge",className:"rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 hover:shadow-lg",children:o.jsx(Ge,{k:"home.selectVehicle"})}),o.jsx(K,{to:"/kontakt",className:"rounded-md border border-white/30 bg-white/10 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:-translate-y-0.5 hover:bg-white/20",children:o.jsx(Ge,{k:"home.getInTouch"})})]})]})})})]}),!s("home.stats")&&o.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:o.jsx("div",{className:"mx-auto grid max-w-6xl grid-cols-2 gap-6 px-4 text-center sm:grid-cols-4 sm:px-6",children:u.map((L,$)=>o.jsxs(Ue,{index:$,children:[o.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:L.value}),o.jsx("p",{className:"text-sm text-neutral-400",children:L.label})]},L.label))})}),!s("home.partners")&&o.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:o.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[o.jsx(Ge,{k:"home.brandsHeading",as:"p",className:"mb-4 block text-center text-xs font-semibold uppercase tracking-wide text-neutral-400"}),o.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:C.map((L,$)=>o.jsx(Ue,{index:$,children:L.logo_path?o.jsx("img",{src:L.logo_path,alt:L.name,className:"h-8 max-w-[8rem] object-contain opacity-70 grayscale transition hover:opacity-100 hover:grayscale-0"}):o.jsx(ce,{entity:"partners",id:L.id,field:"name",lang:"de",value:L.name,className:"text-lg font-bold text-neutral-400 dark:text-neutral-600"})},L.id))})]})}),!s("home.youtube")&&o.jsxs("section",{className:"relative min-h-[70vh] overflow-hidden sm:min-h-[85vh]",children:[o.jsx("video",{ref:Z,loop:!0,muted:!0,playsInline:!0,preload:"none",poster:h.src,className:"absolute inset-0 h-full w-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-black/55"}),o.jsx(ws,{id:"youtube_poster",value:h.custom,label:Zt.youtube_poster.label,aspect:Zt.youtube_poster.aspect,buttonLabel:"Video-Standbild tauschen",className:"absolute left-0 top-0 h-12 w-64"}),o.jsx("div",{className:"absolute w-full max-w-3xl px-4 text-center sm:px-6",style:{...wp(S("youtube").alignX,S("youtube").alignY,{x:50,y:50}),fontFamily:S("youtube").fontFamily},children:o.jsxs(Ue,{children:[(S("youtube").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"youtube",field:"eyebrow",value:S("youtube").eyebrow,as:"p",className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",style:F,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"youtube",field:"title",value:S("youtube").title,as:"h2",className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",style:B,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"youtube",field:"body_html",value:S("youtube").bodyHtml,label:"Text",className:"legal-content mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm"}),o.jsx(bp,{slug:"youtube",label:S("youtube").buttonLabel,url:S("youtube").buttonUrl,className:"mt-8 inline-flex items-center justify-center rounded-full bg-white px-8 py-3 text-xs font-bold uppercase tracking-wide text-neutral-900 transition hover:-translate-y-0.5 hover:bg-neutral-100",style:se})]})})]}),!s("home.craft")&&o.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:o.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[o.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[o.jsx(Ue,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:o.jsx(ws,{id:"craft",value:d.custom,label:Zt.craft.label,aspect:Zt.craft.aspect,children:o.jsx("img",{src:d.src,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})}),o.jsxs(Ue,{direction:"right",index:1,className:Zi[S("craft").align],style:{fontFamily:S("craft").fontFamily},children:[(S("craft").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"craft",field:"eyebrow",value:S("craft").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:ne,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"craft",field:"title",value:S("craft").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:q,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"craft",field:"body_html",value:S("craft").bodyHtml,label:"Text",className:"legal-content text-neutral-600 dark:text-neutral-300"})]})]}),o.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[o.jsxs(Ue,{direction:"left",className:`order-2 md:order-1 ${Zi[S("advice").align]}`,style:{fontFamily:S("advice").fontFamily},children:[(S("advice").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"advice",field:"eyebrow",value:S("advice").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:G,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"advice",field:"title",value:S("advice").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:V,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"advice",field:"body_html",value:S("advice").bodyHtml,label:"Text",className:"legal-content text-neutral-600 dark:text-neutral-300"})]}),o.jsx(Ue,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:o.jsx(ws,{id:"advice",value:f.custom,label:Zt.advice.label,aspect:Zt.advice.aspect,children:o.jsx("img",{src:f.src,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})})]})]})}),!s("home.insights")&&o.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[o.jsxs(Ue,{className:`mb-8 ${Zi[S("insights").align]}`,style:{fontFamily:S("insights").fontFamily},children:[(S("insights").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"insights",field:"eyebrow",value:S("insights").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:T,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"insights",field:"title",value:S("insights").title,as:"h2",className:"text-2xl font-bold text-neutral-900 dark:text-white",style:M,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"insights",field:"body_html",value:S("insights").bodyHtml,label:"Text",className:"legal-content mt-2 text-neutral-600 dark:text-neutral-300"})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:b.map((L,$)=>o.jsx(Ue,{index:$%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:o.jsx(ws,{id:L.id,value:L.custom,label:`Einblicke: Foto ${$+1}`,aspect:1,className:"h-full w-full",children:o.jsx("img",{src:L.src,alt:L.alt,width:L.width,height:L.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},L.id))})]}),!s("home.reviews")&&o.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:o.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[o.jsxs(Ue,{className:"mb-10 text-center",children:[o.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:o.jsx(Pv,{className:"h-6 w-6",count:_?Math.round(_.rating):5})}),o.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:_?n("home.reviewsRatingDynamic")(_.rating,_.rating_count):n("home.reviewsRating")}),o.jsx(Ge,{k:"home.reviewsText",as:"p",className:"mt-1 text-neutral-600 dark:text-neutral-300"}),o.jsx("a",{href:"https://www.google.com/maps/search/?api=1&query=Hifi+Planet+Amorbach+Boxbrunner+Stra%C3%9Fe+20a",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-block text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:o.jsx(Ge,{k:"home.reviewsLink"})})]}),o.jsx(Ue,{children:o.jsx(KN,{testimonials:Y})})]})}),!s("home.more")&&o.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:o.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[o.jsx(Ue,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:o.jsx(ws,{id:"more",value:g.custom,label:Zt.more.label,aspect:Zt.more.aspect,className:"h-full w-full",children:o.jsx("img",{src:g.src,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})})}),o.jsxs(Ue,{direction:"right",index:1,className:`rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 ${Zi[S("more").align]}`,style:{fontFamily:S("more").fontFamily},children:[(S("more").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"more",field:"eyebrow",value:S("more").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:A,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"more",field:"title",value:S("more").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:R,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"more",field:"body_html",value:S("more").bodyHtml,label:"Text",className:`legal-content mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 ${ZN[S("more").align]}`}),o.jsx(bp,{slug:"more",label:S("more").buttonLabel,url:S("more").buttonUrl,className:"inline-block rounded-md border border-neutral-300 px-6 py-3 text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",style:H})]})]})}),!s("home.faq")&&o.jsx("section",{id:"faq",className:"scroll-mt-20 border-t border-neutral-300 py-16 dark:border-neutral-700",children:o.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[o.jsx(Ue,{className:"mb-8 text-center",children:o.jsx(Ge,{k:"home.faqHeading",as:"h2",className:"text-2xl font-bold text-neutral-900 dark:text-white"})}),o.jsx(Ue,{index:1,children:o.jsx(WN,{items:w})})]})})]})}function zo(e,t){return e?e.code==="rate_limited"||e.status===429?t("errors.rateLimited"):e.code==="invalid_input"||e.status===422?t("errors.invalidInput"):e.status===404?t("errors.notFound"):e.status===503?t("errors.maintenance"):e.status>=500?t("errors.server"):e.status?t("errors.generic"):t("errors.network"):""}const kp={vw:"volkswagen",mercedes:"mercedes-benz",benz:"mercedes-benz",mb:"mercedes-benz",chevy:"chevrolet",alfa:"alfa romeo"},e5=8,$s=e=>String(e||"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/ß/g,"ss").replace(/[-_./]+/g," ").replace(/\s+/g," ").trim(),lo=e=>e.replace(/\s/g,"");function t5(e,t){const n=(e||[]).map(s=>{const i=$s(s.name);return{key:`b${s.id}`,type:"brand",label:s.name,to:`/fahrzeuge/${s.slug}`,text:i,flat:lo(i)}}),r=(t||[]).map(s=>{const i=$s(`${s.brand_name} ${s.name}`);return{key:`m${s.id}`,type:"model",label:s.name,brand:s.brand_name,image:s.image_path,to:`/fahrzeuge/${s.brand_slug}/${s.slug}`,text:i,flat:lo(i),modelText:$s(s.name)}});return[...n,...r]}function n5(e,t){const n=$s(t).split(" ").filter(Boolean);if(n.length===0)return[];const r=n.map(a=>kp[a]?[a,$s(kp[a])]:[a]),s=lo(n.join("")),i=[];for(const a of e){const l=c=>a.text.includes(c)||a.flat.includes(lo(c));if(!r.every(c=>c.some(l))&&!a.flat.includes(s))continue;let u=0;for(const c of r)c.some(d=>a.text.startsWith(d))?u+=3:c.some(d=>` ${a.text}`.includes(` ${d}`))&&(u+=2),c.some(d=>{var f;return(f=a.modelText)==null?void 0:f.startsWith(d)})&&(u+=2);a.type==="brand"&&(u+=1),i.push({entry:a,score:u})}return i.sort((a,l)=>l.score-a.score||a.entry.text.localeCompare(l.entry.text,void 0,{numeric:!0})),i.slice(0,e5).map(a=>a.entry)}function r5({brands:e,width:t}){const{t:n}=xe(),r=pr(),s=m.useId(),i=m.useRef(null),[a,l]=m.useState(null),[u,c]=m.useState(""),[d,f]=m.useState(!1),[h,g]=m.useState(0),y=m.useRef(!1),b=()=>{a||y.current||(y.current=!0,ae.get("/vehicle-search").then(l).catch(()=>l([])).finally(()=>{y.current=!1}))},w=m.useMemo(()=>t5(e,a),[e,a]),p=m.useMemo(()=>n5(w,u),[w,u]),x=d&&u.trim()!=="",v=p.some(j=>j.image);m.useEffect(()=>g(0),[u]),m.useEffect(()=>{if(!x)return;const j=S=>{var N;(N=i.current)!=null&&N.contains(S.target)||f(!1)};return document.addEventListener("pointerdown",j),()=>document.removeEventListener("pointerdown",j)},[x]);const k=j=>{f(!1),r(j.to)},E=j=>{j.key==="ArrowDown"&&p.length?(j.preventDefault(),f(!0),g(S=>(S+1)%p.length)):j.key==="ArrowUp"&&p.length?(j.preventDefault(),g(S=>(S-1+p.length)%p.length)):j.key==="Enter"&&x&&p[h]?(j.preventDefault(),k(p[h])):j.key==="Escape"&&(x?f(!1):c(""))},C=a===null&&u.trim()!=="";return o.jsxs("div",{ref:i,className:"relative mb-8 max-w-full",style:{width:t?`${t}px`:"100%"},children:[o.jsx("label",{htmlFor:`${s}-input`,className:"sr-only",children:n("vehicleSearch.label")}),o.jsxs("div",{className:"relative flex items-center",children:[o.jsx(GT,{className:"pointer-events-none absolute left-4 h-[18px] w-[18px] text-neutral-400","aria-hidden":"true"}),o.jsx("input",{id:`${s}-input`,type:"search",role:"combobox","aria-expanded":x,"aria-controls":`${s}-list`,"aria-autocomplete":"list","aria-activedescendant":x&&p[h]?`${s}-${p[h].key}`:void 0,autoComplete:"off",spellCheck:!1,value:u,placeholder:n("vehicleSearch.placeholder"),onFocus:()=>{b(),f(!0)},onChange:j=>{b(),c(j.target.value),f(!0)},onKeyDown:E,className:"vehicle-search-input w-full rounded-xl border border-neutral-300 bg-gradient-to-b from-white to-neutral-50 py-3.5 pl-11 pr-11 text-[15px] text-neutral-900 outline-none transition-[border-color,box-shadow] duration-200 placeholder:text-neutral-400 focus:border-brand-500 dark:border-neutral-700 dark:from-neutral-800 dark:to-neutral-900 dark:text-white dark:placeholder:text-neutral-500 [&::-webkit-search-cancel-button]:hidden"}),u&&o.jsx("button",{type:"button",onClick:()=>c(""),"aria-label":n("vehicleSearch.clear"),className:"absolute right-3 rounded-md p-1 text-neutral-400 transition hover:text-neutral-700 dark:hover:text-neutral-200",children:o.jsx(Si,{className:"h-4 w-4"})})]}),x&&o.jsx("div",{className:"absolute inset-x-0 top-full z-30 mt-2 overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-lg dark:border-neutral-800 dark:bg-neutral-900",children:p.length>0?o.jsx("ul",{id:`${s}-list`,role:"listbox",className:"max-h-[360px] overflow-y-auto py-1",children:p.map((j,S)=>o.jsx("li",{id:`${s}-${j.key}`,role:"option","aria-selected":S===h,children:o.jsxs(K,{to:j.to,onClick:()=>f(!1),onMouseEnter:()=>g(S),className:`flex items-center gap-3 px-4 py-2.5 text-[15px] ${S===h?"bg-neutral-100 dark:bg-neutral-800":""}`,children:[j.type==="model"?o.jsxs(o.Fragment,{children:[j.image?o.jsx("img",{src:j.image,alt:"",loading:"lazy",className:"h-9 w-14 shrink-0 rounded object-cover"}):v&&o.jsx("span",{className:"h-9 w-14 shrink-0 rounded bg-neutral-100 dark:bg-neutral-800"}),o.jsxs("span",{className:"min-w-0 flex-1 truncate text-neutral-900 dark:text-white",children:[o.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:j.brand})," ",j.label]})]}):o.jsxs("span",{className:"min-w-0 flex-1 truncate text-neutral-900 dark:text-white",children:[j.label,o.jsx("span",{className:"ml-2 text-xs uppercase tracking-wider text-neutral-500 dark:text-neutral-400",children:n("vehicleSearch.allModels")})]}),o.jsx(JC,{className:`h-4 w-4 shrink-0 text-brand-500 transition-opacity ${S===h?"opacity-100":"opacity-0"}`,"aria-hidden":"true"})]})},j.key))}):o.jsx("div",{id:`${s}-list`,className:"px-4 py-3 text-sm text-neutral-500 dark:text-neutral-400",children:C?n("vehicleSearch.loading"):o.jsxs(o.Fragment,{children:[n("vehicleSearch.noResults")," ",o.jsx(K,{to:"/kontakt",className:"font-semibold text-brand-500 hover:underline",children:n("vehicleSearch.contact")})]})})})]})}function s5(){const[e,t]=m.useState(null),[n,r]=m.useState(null),s=Io(),{t:i}=xe(),a=nf(),{vehicle_tile_width:l,vehicle_tile_height:u}=Pt(),c={width:`${l}px`,height:`${u}px`},d=m.useRef(null),[f,h]=m.useState(0);m.useEffect(()=>{const p=d.current;if(!p)return;const x=new ResizeObserver(([v])=>h(v.contentRect.width));return x.observe(p),()=>x.disconnect()},[]);const g=16,y=e?e.length:6,b=Math.max(1,Math.min(y,Math.floor((f+g)/(Number(l)+g)))),w=f&&y?b*Number(l)+(b-1)*g:void 0;return gr({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),m.useEffect(()=>{s.vehicles.enabled&&!s.bypass||ae.get("/brands").then(t).catch(p=>r(p))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?o.jsx(ji,{message:s.vehicles.message}):o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[o.jsx("div",{ref:d}),s.vehicles.enabled&&s.bypass&&o.jsx(Ei,{inline:!0}),o.jsx(Ge,{k:"vehicleSelect.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),o.jsx(Ge,{k:"vehicleSelect.intro",as:"p",className:"mb-6 block text-neutral-600 dark:text-neutral-300"}),o.jsx(r5,{brands:e,width:w}),n&&o.jsx("p",{className:"text-red-600",children:typeof n=="string"?n:zo(n,i)}),e===null&&!n&&o.jsx("div",{className:"flex flex-wrap gap-4","aria-busy":"true","aria-label":i("vehicleSelect.loading"),children:Array.from({length:6},(p,x)=>o.jsx("div",{style:c,className:"shrink-0 animate-pulse rounded-xl bg-neutral-200 dark:bg-neutral-800"},x))}),(e==null?void 0:e.length)===0&&!n&&o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),o.jsx("div",{className:"flex flex-wrap gap-4",children:(e||[]).map(p=>p.image_path?o.jsxs(K,{to:`/fahrzeuge/${p.slug}`,style:c,className:"group relative block shrink-0 overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[o.jsx("img",{src:p.image_path,alt:"",loading:"lazy",decoding:"async",width:l,height:u,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),o.jsx(ce,{entity:"brands",id:p.id,field:"name",lang:"de",value:p.name,className:"absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white",style:fr(a,`brands.${p.id}.name`)})]},p.id):o.jsx(K,{to:`/fahrzeuge/${p.slug}`,style:c,className:"flex shrink-0 flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:o.jsx(ce,{entity:"brands",id:p.id,field:"name",lang:"de",value:p.name,style:fr(a,`brands.${p.id}.name`)})},p.id))})]})}function of(){const{t:e}=xe(),{phone:t}=Pt(),n=Do();return gr({title:e("notFound.metaTitle"),noindex:!0}),o.jsxs("div",{className:"mx-auto max-w-2xl px-4 py-20 text-center sm:px-6",children:[o.jsx("p",{className:"text-sm font-semibold uppercase tracking-[4px] text-brand-500",children:"404"}),o.jsx("h1",{className:"mt-3 text-3xl font-bold text-neutral-900 dark:text-white sm:text-4xl",children:e("notFound.title")}),o.jsx("p",{className:"mx-auto mt-4 max-w-md text-neutral-600 dark:text-neutral-300",children:e("notFound.text")}),o.jsxs("div",{className:"mt-10 flex flex-wrap justify-center gap-3",children:[!n("page.vehicles")&&o.jsxs(K,{to:"/fahrzeuge",className:"inline-flex items-center gap-2 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:[o.jsx(io,{className:"h-4 w-4"}),e("notFound.toVehicles")]}),o.jsxs(K,{to:"/kontakt",className:"inline-flex items-center gap-2 rounded-md border border-neutral-300 px-5 py-3 text-sm font-semibold text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:[o.jsx(pc,{className:"h-4 w-4"}),e("notFound.toContact")]}),t&&o.jsxs("a",{href:fi(t),className:"inline-flex items-center gap-2 rounded-md border border-neutral-300 px-5 py-3 text-sm font-semibold text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:[o.jsx(dr,{className:"h-4 w-4"}),t]})]}),o.jsx(K,{to:"/",className:"mt-8 inline-block text-sm text-neutral-500 underline hover:text-brand-500",children:e("notFound.toHome")})]})}function i5(){const{brandSlug:e}=xd(),[t,n]=m.useState(null),[r,s]=m.useState(null),i=Io(),{t:a}=xe(),l=nf(),u=We(t?`brands.${t.brand.id}.name`:""),{vehicle_tile_width:c,vehicle_tile_height:d}=Pt(),f={width:`${c}px`,height:`${d}px`};return m.useEffect(()=>{i.vehicles.enabled&&!i.bypass||ae.get(`/brands/${e}/models`).then(n).catch(h=>s(h))},[e,i.vehicles.enabled,i.bypass]),gr({title:t?`${t.brand.name} ${a("brandPage.titleSuffix")}`:a("brandPage.metaTitleFallback"),description:t?a("brandPage.metaDescription")(t.brand.name):void 0,path:`/fahrzeuge/${e}`}),i.vehicles.enabled&&!i.bypass?o.jsx(ji,{message:i.vehicles.message}):r?r.status===404?o.jsx(of,{}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:zo(r,a)}):t?o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&o.jsx(Ei,{inline:!0}),o.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[o.jsx("span",{style:u,children:t.brand.name})," – ",a("brandPage.titleSuffix")]}),t.models.length===0&&o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a("brandPage.empty")}),o.jsx("div",{className:"flex flex-wrap gap-4",children:t.models.map(h=>h.image_path?o.jsxs(K,{to:`/fahrzeuge/${e}/${h.slug}`,style:f,className:"group relative block shrink-0 overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[o.jsx("img",{src:h.image_path,alt:"",loading:"lazy",decoding:"async",width:c,height:d,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),o.jsx(ce,{entity:"car_models",id:h.id,field:"name",lang:"de",value:h.name,className:"absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white",style:fr(l,`car_models.${h.id}.name`)})]},h.id):o.jsx(K,{to:`/fahrzeuge/${e}/${h.slug}`,style:f,className:"flex shrink-0 flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:o.jsx(ce,{entity:"car_models",id:h.id,field:"name",lang:"de",value:h.name,style:fr(l,`car_models.${h.id}.name`)})},h.id))})]}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:a("brandPage.loading")})}function a5({text:e}){return e?e.split(/(\*\*[^*]+\*\*)/g).map((n,r)=>{const s=n.match(/^\*\*([^*]+)\*\*$/);return s?o.jsx("strong",{children:s[1]},r):o.jsx("span",{children:n},r)}):null}const Sp="data:image/webp;base64,UklGRmoNAABXRUJQVlA4IF4NAAAQjACdASrgAVYDPlEok0ajoqGhIRK4IHAKCWlu/F+5xDCoDux8VXNtc99B5Uf715Q+k/+V6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41i1PuJx382C0zTWGT243ZhLnyOIlreUrMQAfwR/oYt+ljnDFKqa5PEczDPa+u/vWmR6UM+Q/lLFiIlgBJTfaekWoeLpPd9FPN4gIHzK1ZS8kDHyq3lh/e6FQ84a4Zg6JlfQC/qhAAAAA==";function Dn(e,t,n){if(!e)return"";if(n==="en"){const r=e[`${t}_en`];if(r)return r}return e[t]}const o5=(e,t,n)=>{t/=100,n/=100;const r=a=>(a+e/30)%12,s=t*Math.min(n,1-n),i=a=>n-s*Math.max(-1,Math.min(r(a)-3,Math.min(9-r(a),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},zl=(e,t,n)=>`rgb(${o5(e,t,n).join(", ")})`,jp=e=>e.map(([t,n,r,s,i,a])=>({bgTop:zl(t,n,r),border:zl(t,n,r+8),accent:zl(s,i,a),img:null})),Ep={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:fv},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:hv},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:mv},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:pv},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:gv},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:xv},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:yv},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:vv}],"deep-blue":jp([[215,18,11,210,15,60],[212,25,11,208,32,60],[210,38,12,206,46,60],[212,46,12,205,56,61],[214,52,12,205,63,62],[216,58,12,205,68,63],[220,62,12,212,73,65],[226,66,12,216,78,68]]),"warm-bronze":jp([[30,15,11,34,22,60],[34,32,11,34,46,60],[32,46,12,30,58,60],[26,52,12,24,65,60],[20,55,12,18,68,60],[14,55,12,12,68,61],[8,52,12,6,64,62],[2,50,12,358,60,63]])},l5="#f2f2f2",Cp="#8a8a8a",Tp="#c4c4c4",Pp=5,u5=3,c5={recommended:{Icon:eP,className:"bg-brand-500 text-white"},popular:{Icon:jT,className:"bg-amber-400 text-neutral-950"},tip:{Icon:PT,className:"bg-sky-500 text-white"},coming_soon:{Icon:Yy,className:"bg-white text-neutral-900"},custom:{Icon:null,className:"bg-brand-500 text-white"}};function d5({pkg:e,tier:t,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:a,priceNote:l,t:u}){const[c,d]=m.useState(!1),f=Xe().canEdit("packages"),[h,g]=m.useState(!1),y=m.useRef(null),b=s.length-Pp,w=c?s:s.slice(0,Pp);m.useLayoutEffect(()=>{const N=y.current;if(!N||c){g(!1);return}const P=()=>g([...N.querySelectorAll("[data-clamp]")].some(B=>B.scrollHeight>B.clientHeight+1));P();const F=new ResizeObserver(P);return F.observe(N),()=>F.disconnect()},[c,s.length,e.description]);const p=nf(),x=fr(p,`packages.${e.id}.description`),v=fr(p,`packages.${e.id}.price_text`),{package_card_height:k}=Pt(),E=c5[e.badge],C=r!=="grid",j=e.badge==="custom"?e.badge_text:e.badge&&u(`modelPage.badges.${e.badge}`),S=t.img?null:{backgroundColor:t.accent,WebkitMaskImage:`url(${Sp})`,maskImage:`url(${Sp})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return o.jsxs("div",{style:{borderColor:t.border,background:`linear-gradient(180deg, ${t.bgTop} 0%, #0b0b0b 55%, #080808 100%)`,...C?{gridRow:"span 4",gridTemplateRows:"subgrid",gridTemplateColumns:"minmax(0, 1fr)",rowGap:0}:{minHeight:`${k}px`}},className:r==="strip"?"relative grid snap-start overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40":r==="coverflow"?"relative grid snap-center overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40":"relative flex flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40",children:[t.img?o.jsx("img",{src:t.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...S,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),o.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...S,opacity:.55+n*.45},"aria-hidden":"true"})]}),E&&j&&o.jsxs("span",{className:`absolute top-2 left-1/2 z-10 flex max-w-[calc(100%-16px)] -translate-x-1/2 items-center gap-1 whitespace-nowrap rounded-full px-3 py-1 text-xs font-bold shadow ${E.className}`,children:[E.Icon&&o.jsx(E.Icon,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:j})]}),o.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0",gridRow:1},children:[o.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:t.accent,textTransform:"uppercase",lineHeight:1.1},children:o.jsx(ce,{entity:"packages",id:e.id,field:"name",lang:"de",value:e.name,placeholder:"Paketname"})}),o.jsx("div",{style:{width:"44px",height:"2px",margin:"14px auto 0",background:`linear-gradient(90deg, rgba(255,255,255,0) 0%, ${t.accent} 50%, rgba(255,255,255,0) 100%)`}})]}),s.length>0&&o.jsxs("div",{className:"relative z-10",style:{gridRow:2,padding:"18px 20px 14px",background:c?"linear-gradient(180deg, rgba(8,8,8,0.7) 0%, rgba(8,8,8,0.62) 94%, rgba(8,8,8,0) 100%)":"linear-gradient(180deg, rgba(8,8,8,0.55) 0%, rgba(8,8,8,0.48) 92%, rgba(8,8,8,0) 100%)"},children:[o.jsx(yc,{entity:"packages",id:e.id,field:"description",value:e.description,label:"Zusätzliche Stichpunkte",hint:"Eine Zeile = ein Stichpunkt (unter den Produkten). **fett** wird fett dargestellt. Die Produkte selbst pflegst du im Admin unter Pakete.",children:o.jsx("ul",{ref:y,className:"space-y-1.5 text-left",children:w.map((N,P)=>o.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:Tp,...N.fromDescription?x:null},children:[o.jsx(qy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:t.accent}}),o.jsx("span",{"data-clamp":!0,className:"min-w-0 leading-snug",style:c?{overflowWrap:"anywhere",hyphens:"auto"}:{overflowWrap:"anywhere",hyphens:"auto",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:u5,overflow:"hidden"},children:N.fromDescription?o.jsx(a5,{text:N.text}):N.text.replace(/\//g,"/")})]},P))})}),(c||b>0||h)&&o.jsxs("button",{type:"button",onClick:()=>d(N=>!N),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:t.accent},children:[c?u("modelPage.lessBullets"):b>0?u("modelPage.moreBullets")(b):u("modelPage.showMore"),c?o.jsx(pT,{className:"h-3.5 w-3.5"}):o.jsx(uT,{className:"h-3.5 w-3.5"})]})]}),s.length===0&&f&&o.jsx(yc,{entity:"packages",id:e.id,field:"description",value:e.description,label:"Zusätzliche Stichpunkte",hint:"Eine Zeile = ein Stichpunkt. **fett** wird fett dargestellt.",className:"relative z-10 mx-5 mt-4 text-center text-xs",style:{gridRow:2,color:Tp},children:"+ Stichpunkte hinzufügen"}),o.jsx("div",{className:"relative z-10 flex-1",style:{gridRow:3}}),o.jsx("div",{className:"relative z-10",style:{gridRow:4,padding:"20px 20px 28px",background:"linear-gradient(180deg, rgba(8,8,8,0) 0%, rgba(8,8,8,0.85) 45%, rgba(8,8,8,0.95) 100%)"},children:o.jsxs("div",{className:"text-center",children:[!e.price_text&&o.jsx("div",{style:{fontSize:"13px",color:Cp},children:u("modelPage.totalPrice")}),o.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:l5,...e.price_text?v:null},children:f?o.jsx(ce,{entity:"packages",id:e.id,field:"price_text",value:e.price_text,placeholder:i(e.total_price),title:"Leer lassen = Preis automatisch aus den Produkten"}):e.price_text||i(e.total_price)}),!e.price_text&&l&&o.jsx("div",{style:{marginTop:"2px",fontSize:"11px",color:Cp},children:l}),o.jsx(K,{to:a(e),onClick:()=>An("select_package",{package_name:e.name,value:Number(e.total_price)||void 0,currency:"EUR"}),className:"mt-4 inline-block rounded-md bg-brand-500 px-4 py-2 text-center text-sm font-semibold text-white shadow-lg shadow-brand-500/30 hover:bg-brand-400",children:u("modelPage.requestContact")}),e.video_url&&o.jsx("div",{className:"mt-3",children:o.jsxs("a",{href:e.video_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full border border-white/15 bg-white/5 px-3 py-1 text-xs font-semibold text-white transition hover:bg-white/15",children:[o.jsx(xT,{className:"h-4 w-4 text-red-500","aria-hidden":"true"}),u("modelPage.videoLink")]})})]})})]})}function f5(){const{brandSlug:e,modelSlug:t}=xd(),[n,r]=m.useState(null),[s,i]=m.useState(null),a=Io(),{t:l,language:u}=xe(),c=Xe(),{package_card_theme:d,package_card_layout:f,package_wheel_hint_interval:h,package_card_width:g,package_card_height:y,phone:b,whatsapp:w,price_note:p,price_note_en:x}=Pt(),v=u==="en"&&x||p,k=Ro(),E=(Ep[d]||Ep.graphite).map((_,I)=>{const{custom:Y}=k.packageTier(I);return Y?{..._,img:Y}:_}),C=["grid","strip","coverflow"].includes(f)?f:"strip",j=Math.max(2,Number(h)||8)*1e3,S=m.useRef(null),N=m.useRef(null),P=m.useRef(null),[F,B]=m.useState(!1),se=_=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(_);m.useEffect(()=>{a.vehicles.enabled&&!a.bypass||ae.get(`/models/${e}/${t}/packages`).then(r).catch(_=>i(_))},[e,t,a.vehicles.enabled,a.bypass]),m.useEffect(()=>{const _=S.current;if(C!=="coverflow"||!_)return;let I=0;const Y=()=>{I=0;const Q=_.scrollLeft+_.clientWidth/2;for(const ke of _.children){const De=ke.offsetLeft+ke.offsetWidth/2,Ze=Math.max(-1,Math.min(1,(De-Q)/(ke.offsetWidth*1.4))),dt=Math.abs(Ze);ke.style.transform=`rotateY(${(-Ze*35).toFixed(2)}deg) scale(${(1-dt*.13).toFixed(3)}) translateZ(${(-dt*60).toFixed(1)}px)`,ke.style.zIndex=String(100-Math.round(dt*50))}},Z=()=>{I||(I=requestAnimationFrame(Y))};Y(),_.addEventListener("scroll",Z,{passive:!0});const ue=new ResizeObserver(Z);return ue.observe(_),()=>{_.removeEventListener("scroll",Z),ue.disconnect(),cancelAnimationFrame(I)}},[C,n]),m.useEffect(()=>{const _=S.current;if(C==="grid"||!_)return;const I=window.matchMedia("(pointer: coarse)").matches;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let Z=[],ue=0;const Q=()=>{const De=Math.min(_.clientWidth*.4,160);Z.push(setTimeout(()=>_.scrollTo({left:De,behavior:"smooth"}),500)),Z.push(setTimeout(()=>_.scrollTo({left:0,behavior:"smooth"}),1250)),I||(Z.push(setTimeout(()=>B(!0),450)),Z.push(setTimeout(()=>B(!1),1700)))},ke=new IntersectionObserver(([De])=>{De.isIntersecting&&(ke.disconnect(),Q(),ue=setInterval(()=>{_.scrollLeft<=1&&Q()},j))},{threshold:.35});return ke.observe(_),()=>{ke.disconnect(),clearInterval(ue),Z.forEach(clearTimeout)}},[C,n,j]),m.useEffect(()=>{const _=S.current;if(C==="grid"||!_)return;let I=0,Y=0,Z=!1,ue=0,Q=0;const ke=()=>[..._.children].map(he=>he.offsetLeft+he.offsetWidth/2),De=(he,ft)=>{let W=0,L=1/0;return he.forEach(($,Qe)=>{const Hn=Math.abs($-ft);Hn${n("home.heroSubtitle")}
`:"";return{eyebrow:i.getValue("home_sections",L,"eyebrow",r,$[`eyebrow_${r}`]||""),title:i.getValue("home_sections",L,"title",r,$[`title_${r}`]||Qe),bodyHtml:i.getValue("home_sections",L,"body_html",r,$[`body_html_${r}`]||Hn),align:$.text_align||"center",alignX:$.text_align_x,alignY:$.text_align_y,buttonLabel:i.getValue("home_sections",L,"button_label",r,$[`button_label_${r}`]||""),buttonUrl:i.getValue("home_sections",L,"button_url","de",$.button_url||""),fontFamily:$.font_family||void 0}},N=We("home_sections.hero.eyebrow"),P=We("home_sections.hero.title"),F=We("home_sections.youtube.eyebrow"),B=We("home_sections.youtube.title"),se=We("home_sections.youtube.button_label"),ne=We("home_sections.craft.eyebrow"),q=We("home_sections.craft.title"),G=We("home_sections.advice.eyebrow"),V=We("home_sections.advice.title"),T=We("home_sections.insights.eyebrow"),M=We("home_sections.insights.title"),A=We("home_sections.more.eyebrow"),R=We("home_sections.more.title"),U=We("home_sections.more.button_label");m.useEffect(()=>{ae.get("/home-sections").then(v).catch(()=>E(!0))},[]),m.useEffect(()=>{ae.get("/partners").then(j).catch(()=>{})},[]);const[_,I]=m.useState(null),X=_?_.reviews.filter(L=>L.review_text).map(L=>({name:L.author_name,text:L.review_text,rating:L.rating,photo:L.profile_photo_url})):n("home.testimonials");m.useEffect(()=>{ae.get("/faqs").then(L=>{p(L.map($=>({id:$.id,question:r==="de"?$.question_de:$.question_en,answer:r==="de"?$.answer_de:$.answer_en})))}).catch(()=>{})},[r]),m.useEffect(()=>{ae.get("/google-reviews").then(L=>{L.rating!=null&&L.reviews.some($=>$.review_text)&&I(L)}).catch(()=>{})},[]),gr({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),m.useEffect(()=>{if(w.length===0||s("home.faq"))return;const L=document.createElement("script");return L.type="application/ld+json",L.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:w.map($=>({"@type":"Question",name:$.question,acceptedAnswer:{"@type":"Answer",text:$.answer}}))}),document.head.appendChild(L),()=>document.head.removeChild(L)},[w]),m.useEffect(()=>{var L;w.length>0&&window.location.hash==="#faq"&&((L=document.getElementById("faq"))==null||L.scrollIntoView())},[w]);const Q=m.useRef(null);m.useEffect(()=>{var uf,cf,df;const L=Q.current;if(!L)return;const $=(uf=window.matchMedia)==null?void 0:uf.call(window,"(prefers-reduced-motion: reduce)").matches,Qe=(cf=navigator.connection)==null?void 0:cf.saveData;if($||Qe)return;const Nv=((df=window.matchMedia)==null?void 0:df.call(window,"(max-width: 767px), (pointer: coarse)").matches)?XN:YN,lf=new IntersectionObserver(([_v])=>{_v.isIntersecting?(L.getAttribute("src")||(L.src=Nv),L.play().catch(()=>{})):L.paused||L.pause()},{rootMargin:"300px 0px"});return lf.observe(L),()=>lf.disconnect()},[]);const ue=m.useRef(null),{scrollYProgress:J}=Hy({target:ue,offset:["start start","end start"]}),ke=IC(),De=gn(J,[0,1],ke?["0%","0%"]:["-6%","6%"]),Ze=gn(J,[0,1],ke?["0%","0%"]:["0%","60%"]),dt=gn(J,[0,.8],[1,0]),he=gn(J,[.5,1],[0,1]),ft=gn(he,L=>L>.05?"auto":"none"),W=gn(J,[.5,1],[16,0]);return o.jsxs("div",{children:[o.jsx(nn.div,{style:{opacity:he,pointerEvents:ft,y:W},className:"fixed inset-x-0 bottom-0 z-20 border-t border-neutral-200 bg-white/95 px-4 py-3 shadow-[0_-8px_24px_rgba(0,0,0,0.08)] backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:px-6",children:o.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[o.jsx(Ge,{k:"home.stickyCta",as:"p",className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block"}),o.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[l&&o.jsx(K,{to:"/fahrzeuge",className:"flex-1 rounded-md bg-brand-500 px-5 py-2.5 text-center text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 sm:flex-none",children:o.jsx(Ge,{k:"home.selectVehicle"})}),o.jsx(K,{to:"/kontakt",className:"flex-1 rounded-md border border-neutral-300 px-5 py-2.5 text-center text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800 sm:flex-none",children:o.jsx(Ge,{k:"home.getInTouch"})})]})]})}),o.jsxs("section",{ref:ue,className:"relative -mt-[89px] h-svh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[o.jsx(nn.img,{style:{y:De,scale:1.15},src:t,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),o.jsx(nn.div,{style:{y:Ze,opacity:dt},className:"absolute inset-0",children:o.jsx("div",{className:"absolute w-full max-w-2xl px-4 text-center sm:px-6",style:{...wp(S("hero").alignX,S("hero").alignY,{x:50,y:50}),fontFamily:S("hero").fontFamily},children:o.jsxs(nn.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[(S("hero").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"hero",field:"eyebrow",value:S("hero").eyebrow,as:"p",className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",style:N,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"hero",field:"title",value:S("hero").title,as:"h1",className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",style:P,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"hero",field:"body_html",value:S("hero").bodyHtml,label:"Text",className:"legal-content mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg"}),o.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[l&&o.jsx(K,{to:"/fahrzeuge",className:"rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 hover:shadow-lg",children:o.jsx(Ge,{k:"home.selectVehicle"})}),o.jsx(K,{to:"/kontakt",className:"rounded-md border border-white/30 bg-white/10 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:-translate-y-0.5 hover:bg-white/20",children:o.jsx(Ge,{k:"home.getInTouch"})})]})]})})})]}),!s("home.stats")&&o.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:o.jsx("div",{className:"mx-auto grid max-w-6xl grid-cols-2 gap-6 px-4 text-center sm:grid-cols-4 sm:px-6",children:u.map((L,$)=>o.jsxs(Ue,{index:$,children:[o.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:L.value}),o.jsx("p",{className:"text-sm text-neutral-400",children:L.label})]},L.label))})}),!s("home.partners")&&o.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:o.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[o.jsx(Ge,{k:"home.brandsHeading",as:"p",className:"mb-4 block text-center text-xs font-semibold uppercase tracking-wide text-neutral-400"}),o.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:C.map((L,$)=>o.jsx(Ue,{index:$,children:L.logo_path?o.jsx("img",{src:L.logo_path,alt:L.name,className:"h-8 max-w-[8rem] object-contain opacity-70 grayscale transition hover:opacity-100 hover:grayscale-0"}):o.jsx(ce,{entity:"partners",id:L.id,field:"name",lang:"de",value:L.name,className:"text-lg font-bold text-neutral-400 dark:text-neutral-600"})},L.id))})]})}),!s("home.youtube")&&o.jsxs("section",{className:"relative min-h-[70vh] overflow-hidden sm:min-h-[85vh]",children:[o.jsx("video",{ref:Q,loop:!0,muted:!0,playsInline:!0,preload:"none",poster:h.src,className:"absolute inset-0 h-full w-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-black/55"}),o.jsx(ws,{id:"youtube_poster",value:h.custom,label:Zt.youtube_poster.label,aspect:Zt.youtube_poster.aspect,buttonLabel:"Video-Standbild tauschen",className:"absolute left-0 top-0 h-12 w-64"}),o.jsx("div",{className:"absolute w-full max-w-3xl px-4 text-center sm:px-6",style:{...wp(S("youtube").alignX,S("youtube").alignY,{x:50,y:50}),fontFamily:S("youtube").fontFamily},children:o.jsxs(Ue,{children:[(S("youtube").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"youtube",field:"eyebrow",value:S("youtube").eyebrow,as:"p",className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",style:F,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"youtube",field:"title",value:S("youtube").title,as:"h2",className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",style:B,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"youtube",field:"body_html",value:S("youtube").bodyHtml,label:"Text",className:"legal-content mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm"}),o.jsx(bp,{slug:"youtube",label:S("youtube").buttonLabel,url:S("youtube").buttonUrl,className:"mt-8 inline-flex items-center justify-center rounded-full bg-white px-8 py-3 text-xs font-bold uppercase tracking-wide text-neutral-900 transition hover:-translate-y-0.5 hover:bg-neutral-100",style:se})]})})]}),!s("home.craft")&&o.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:o.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[o.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[o.jsx(Ue,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:o.jsx(ws,{id:"craft",value:d.custom,label:Zt.craft.label,aspect:Zt.craft.aspect,children:o.jsx("img",{src:d.src,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})}),o.jsxs(Ue,{direction:"right",index:1,className:Zi[S("craft").align],style:{fontFamily:S("craft").fontFamily},children:[(S("craft").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"craft",field:"eyebrow",value:S("craft").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:ne,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"craft",field:"title",value:S("craft").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:q,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"craft",field:"body_html",value:S("craft").bodyHtml,label:"Text",className:"legal-content text-neutral-600 dark:text-neutral-300"})]})]}),o.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[o.jsxs(Ue,{direction:"left",className:`order-2 md:order-1 ${Zi[S("advice").align]}`,style:{fontFamily:S("advice").fontFamily},children:[(S("advice").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"advice",field:"eyebrow",value:S("advice").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:G,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"advice",field:"title",value:S("advice").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:V,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"advice",field:"body_html",value:S("advice").bodyHtml,label:"Text",className:"legal-content text-neutral-600 dark:text-neutral-300"})]}),o.jsx(Ue,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:o.jsx(ws,{id:"advice",value:f.custom,label:Zt.advice.label,aspect:Zt.advice.aspect,children:o.jsx("img",{src:f.src,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})})]})]})}),!s("home.insights")&&o.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[o.jsxs(Ue,{className:`mb-8 ${Zi[S("insights").align]}`,style:{fontFamily:S("insights").fontFamily},children:[(S("insights").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"insights",field:"eyebrow",value:S("insights").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:T,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"insights",field:"title",value:S("insights").title,as:"h2",className:"text-2xl font-bold text-neutral-900 dark:text-white",style:M,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"insights",field:"body_html",value:S("insights").bodyHtml,label:"Text",className:"legal-content mt-2 text-neutral-600 dark:text-neutral-300"})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:b.map((L,$)=>o.jsx(Ue,{index:$%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:o.jsx(ws,{id:L.id,value:L.custom,label:`Einblicke: Foto ${$+1}`,aspect:1,className:"h-full w-full",children:o.jsx("img",{src:L.src,alt:L.alt,width:L.width,height:L.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},L.id))})]}),!s("home.reviews")&&o.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:o.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[o.jsxs(Ue,{className:"mb-10 text-center",children:[o.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:o.jsx(Pv,{className:"h-6 w-6",count:_?Math.round(_.rating):5})}),o.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:_?n("home.reviewsRatingDynamic")(_.rating,_.rating_count):n("home.reviewsRating")}),o.jsx(Ge,{k:"home.reviewsText",as:"p",className:"mt-1 text-neutral-600 dark:text-neutral-300"}),o.jsx("a",{href:"https://www.google.com/maps/search/?api=1&query=Hifi+Planet+Amorbach+Boxbrunner+Stra%C3%9Fe+20a",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-block text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:o.jsx(Ge,{k:"home.reviewsLink"})})]}),o.jsx(Ue,{children:o.jsx(KN,{testimonials:X})})]})}),!s("home.more")&&o.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:o.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[o.jsx(Ue,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:o.jsx(ws,{id:"more",value:g.custom,label:Zt.more.label,aspect:Zt.more.aspect,className:"h-full w-full",children:o.jsx("img",{src:g.src,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})})}),o.jsxs(Ue,{direction:"right",index:1,className:`rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 ${Zi[S("more").align]}`,style:{fontFamily:S("more").fontFamily},children:[(S("more").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"more",field:"eyebrow",value:S("more").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:A,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"more",field:"title",value:S("more").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:R,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"more",field:"body_html",value:S("more").bodyHtml,label:"Text",className:`legal-content mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 ${ZN[S("more").align]}`}),o.jsx(bp,{slug:"more",label:S("more").buttonLabel,url:S("more").buttonUrl,className:"inline-block rounded-md border border-neutral-300 px-6 py-3 text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",style:U})]})]})}),!s("home.faq")&&o.jsx("section",{id:"faq",className:"scroll-mt-20 border-t border-neutral-300 py-16 dark:border-neutral-700",children:o.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[o.jsx(Ue,{className:"mb-8 text-center",children:o.jsx(Ge,{k:"home.faqHeading",as:"h2",className:"text-2xl font-bold text-neutral-900 dark:text-white"})}),o.jsx(Ue,{index:1,children:o.jsx(WN,{items:w})})]})})]})}function zo(e,t){return e?e.code==="rate_limited"||e.status===429?t("errors.rateLimited"):e.code==="invalid_input"||e.status===422?t("errors.invalidInput"):e.status===404?t("errors.notFound"):e.status===503?t("errors.maintenance"):e.status>=500?t("errors.server"):e.status?t("errors.generic"):t("errors.network"):""}const kp={vw:"volkswagen",mercedes:"mercedes-benz",benz:"mercedes-benz",mb:"mercedes-benz",chevy:"chevrolet",alfa:"alfa romeo"},e5=8,$s=e=>String(e||"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/ß/g,"ss").replace(/[-_./]+/g," ").replace(/\s+/g," ").trim(),lo=e=>e.replace(/\s/g,"");function t5(e,t){const n=(e||[]).map(s=>{const i=$s(s.name);return{key:`b${s.id}`,type:"brand",label:s.name,to:`/fahrzeuge/${s.slug}`,text:i,flat:lo(i)}}),r=(t||[]).map(s=>{const i=$s(`${s.brand_name} ${s.name}`);return{key:`m${s.id}`,type:"model",label:s.name,brand:s.brand_name,image:s.image_path,to:`/fahrzeuge/${s.brand_slug}/${s.slug}`,text:i,flat:lo(i),modelText:$s(s.name)}});return[...n,...r]}function n5(e,t){const n=$s(t).split(" ").filter(Boolean);if(n.length===0)return[];const r=n.map(a=>kp[a]?[a,$s(kp[a])]:[a]),s=lo(n.join("")),i=[];for(const a of e){const l=c=>a.text.includes(c)||a.flat.includes(lo(c));if(!r.every(c=>c.some(l))&&!a.flat.includes(s))continue;let u=0;for(const c of r)c.some(d=>a.text.startsWith(d))?u+=3:c.some(d=>` ${a.text}`.includes(` ${d}`))&&(u+=2),c.some(d=>{var f;return(f=a.modelText)==null?void 0:f.startsWith(d)})&&(u+=2);a.type==="brand"&&(u+=1),i.push({entry:a,score:u})}return i.sort((a,l)=>l.score-a.score||a.entry.text.localeCompare(l.entry.text,void 0,{numeric:!0})),i.slice(0,e5).map(a=>a.entry)}function r5({brands:e,width:t}){const{t:n}=xe(),r=pr(),s=m.useId(),i=m.useRef(null),[a,l]=m.useState(null),[u,c]=m.useState(""),[d,f]=m.useState(!1),[h,g]=m.useState(0),y=m.useRef(!1),b=()=>{a||y.current||(y.current=!0,ae.get("/vehicle-search").then(l).catch(()=>l([])).finally(()=>{y.current=!1}))},w=m.useMemo(()=>t5(e,a),[e,a]),p=m.useMemo(()=>n5(w,u),[w,u]),x=d&&u.trim()!=="",v=p.some(j=>j.image);m.useEffect(()=>g(0),[u]),m.useEffect(()=>{if(!x)return;const j=S=>{var N;(N=i.current)!=null&&N.contains(S.target)||f(!1)};return document.addEventListener("pointerdown",j),()=>document.removeEventListener("pointerdown",j)},[x]);const k=j=>{f(!1),r(j.to)},E=j=>{j.key==="ArrowDown"&&p.length?(j.preventDefault(),f(!0),g(S=>(S+1)%p.length)):j.key==="ArrowUp"&&p.length?(j.preventDefault(),g(S=>(S-1+p.length)%p.length)):j.key==="Enter"&&x&&p[h]?(j.preventDefault(),k(p[h])):j.key==="Escape"&&(x?f(!1):c(""))},C=a===null&&u.trim()!=="";return o.jsxs("div",{ref:i,className:"relative mb-8 max-w-full",style:{width:t?`${t}px`:"100%"},children:[o.jsx("label",{htmlFor:`${s}-input`,className:"sr-only",children:n("vehicleSearch.label")}),o.jsxs("div",{className:"relative flex items-center",children:[o.jsx(GT,{className:"pointer-events-none absolute left-4 h-[18px] w-[18px] text-neutral-400","aria-hidden":"true"}),o.jsx("input",{id:`${s}-input`,type:"search",role:"combobox","aria-expanded":x,"aria-controls":`${s}-list`,"aria-autocomplete":"list","aria-activedescendant":x&&p[h]?`${s}-${p[h].key}`:void 0,autoComplete:"off",spellCheck:!1,value:u,placeholder:n("vehicleSearch.placeholder"),onFocus:()=>{b(),f(!0)},onChange:j=>{b(),c(j.target.value),f(!0)},onKeyDown:E,className:"vehicle-search-input w-full rounded-xl border border-neutral-300 bg-gradient-to-b from-white to-neutral-50 py-3.5 pl-11 pr-11 text-[15px] text-neutral-900 outline-none transition-[border-color,box-shadow] duration-200 placeholder:text-neutral-400 focus:border-brand-500 dark:border-neutral-700 dark:from-neutral-800 dark:to-neutral-900 dark:text-white dark:placeholder:text-neutral-500 [&::-webkit-search-cancel-button]:hidden"}),u&&o.jsx("button",{type:"button",onClick:()=>c(""),"aria-label":n("vehicleSearch.clear"),className:"absolute right-3 rounded-md p-1 text-neutral-400 transition hover:text-neutral-700 dark:hover:text-neutral-200",children:o.jsx(Si,{className:"h-4 w-4"})})]}),x&&o.jsx("div",{className:"absolute inset-x-0 top-full z-30 mt-2 overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-lg dark:border-neutral-800 dark:bg-neutral-900",children:p.length>0?o.jsx("ul",{id:`${s}-list`,role:"listbox",className:"max-h-[360px] overflow-y-auto py-1",children:p.map((j,S)=>o.jsx("li",{id:`${s}-${j.key}`,role:"option","aria-selected":S===h,children:o.jsxs(K,{to:j.to,onClick:()=>f(!1),onMouseEnter:()=>g(S),className:`flex items-center gap-3 px-4 py-2.5 text-[15px] ${S===h?"bg-neutral-100 dark:bg-neutral-800":""}`,children:[j.type==="model"?o.jsxs(o.Fragment,{children:[j.image?o.jsx("img",{src:j.image,alt:"",loading:"lazy",className:"h-9 w-14 shrink-0 rounded object-cover"}):v&&o.jsx("span",{className:"h-9 w-14 shrink-0 rounded bg-neutral-100 dark:bg-neutral-800"}),o.jsxs("span",{className:"min-w-0 flex-1 truncate text-neutral-900 dark:text-white",children:[o.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:j.brand})," ",j.label]})]}):o.jsxs("span",{className:"min-w-0 flex-1 truncate text-neutral-900 dark:text-white",children:[j.label,o.jsx("span",{className:"ml-2 text-xs uppercase tracking-wider text-neutral-500 dark:text-neutral-400",children:n("vehicleSearch.allModels")})]}),o.jsx(JC,{className:`h-4 w-4 shrink-0 text-brand-500 transition-opacity ${S===h?"opacity-100":"opacity-0"}`,"aria-hidden":"true"})]})},j.key))}):o.jsx("div",{id:`${s}-list`,className:"px-4 py-3 text-sm text-neutral-500 dark:text-neutral-400",children:C?n("vehicleSearch.loading"):o.jsxs(o.Fragment,{children:[n("vehicleSearch.noResults")," ",o.jsx(K,{to:"/kontakt",className:"font-semibold text-brand-500 hover:underline",children:n("vehicleSearch.contact")})]})})})]})}function s5(){const[e,t]=m.useState(null),[n,r]=m.useState(null),s=Io(),{t:i}=xe(),a=nf(),{vehicle_tile_width:l,vehicle_tile_height:u}=Pt(),c={width:`${l}px`,height:`${u}px`},d=m.useRef(null),[f,h]=m.useState(0);m.useEffect(()=>{const p=d.current;if(!p)return;const x=new ResizeObserver(([v])=>h(v.contentRect.width));return x.observe(p),()=>x.disconnect()},[]);const g=16,y=e?e.length:6,b=Math.max(1,Math.min(y,Math.floor((f+g)/(Number(l)+g)))),w=f&&y?b*Number(l)+(b-1)*g:void 0;return gr({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),m.useEffect(()=>{s.vehicles.enabled&&!s.bypass||ae.get("/brands").then(t).catch(p=>r(p))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?o.jsx(ji,{message:s.vehicles.message}):o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[o.jsx("div",{ref:d}),s.vehicles.enabled&&s.bypass&&o.jsx(Ei,{inline:!0}),o.jsx(Ge,{k:"vehicleSelect.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),o.jsx(Ge,{k:"vehicleSelect.intro",as:"p",className:"mb-6 block text-neutral-600 dark:text-neutral-300"}),o.jsx(r5,{brands:e,width:w}),n&&o.jsx("p",{className:"text-red-600",children:typeof n=="string"?n:zo(n,i)}),e===null&&!n&&o.jsx("div",{className:"flex flex-wrap gap-4","aria-busy":"true","aria-label":i("vehicleSelect.loading"),children:Array.from({length:6},(p,x)=>o.jsx("div",{style:c,className:"shrink-0 animate-pulse rounded-xl bg-neutral-200 dark:bg-neutral-800"},x))}),(e==null?void 0:e.length)===0&&!n&&o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),o.jsx("div",{className:"flex flex-wrap gap-4",children:(e||[]).map(p=>p.image_path?o.jsxs(K,{to:`/fahrzeuge/${p.slug}`,style:c,className:"group relative block shrink-0 overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[o.jsx("img",{src:p.image_path,alt:"",loading:"lazy",decoding:"async",width:l,height:u,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),o.jsx(ce,{entity:"brands",id:p.id,field:"name",lang:"de",value:p.name,className:"absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white",style:fr(a,`brands.${p.id}.name`)})]},p.id):o.jsx(K,{to:`/fahrzeuge/${p.slug}`,style:c,className:"flex shrink-0 flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:o.jsx(ce,{entity:"brands",id:p.id,field:"name",lang:"de",value:p.name,style:fr(a,`brands.${p.id}.name`)})},p.id))})]})}function of(){const{t:e}=xe(),{phone:t}=Pt(),n=Do();return gr({title:e("notFound.metaTitle"),noindex:!0}),o.jsxs("div",{className:"mx-auto max-w-2xl px-4 py-20 text-center sm:px-6",children:[o.jsx("p",{className:"text-sm font-semibold uppercase tracking-[4px] text-brand-500",children:"404"}),o.jsx("h1",{className:"mt-3 text-3xl font-bold text-neutral-900 dark:text-white sm:text-4xl",children:e("notFound.title")}),o.jsx("p",{className:"mx-auto mt-4 max-w-md text-neutral-600 dark:text-neutral-300",children:e("notFound.text")}),o.jsxs("div",{className:"mt-10 flex flex-wrap justify-center gap-3",children:[!n("page.vehicles")&&o.jsxs(K,{to:"/fahrzeuge",className:"inline-flex items-center gap-2 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:[o.jsx(io,{className:"h-4 w-4"}),e("notFound.toVehicles")]}),o.jsxs(K,{to:"/kontakt",className:"inline-flex items-center gap-2 rounded-md border border-neutral-300 px-5 py-3 text-sm font-semibold text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:[o.jsx(pc,{className:"h-4 w-4"}),e("notFound.toContact")]}),t&&o.jsxs("a",{href:fi(t),className:"inline-flex items-center gap-2 rounded-md border border-neutral-300 px-5 py-3 text-sm font-semibold text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:[o.jsx(dr,{className:"h-4 w-4"}),t]})]}),o.jsx(K,{to:"/",className:"mt-8 inline-block text-sm text-neutral-500 underline hover:text-brand-500",children:e("notFound.toHome")})]})}function i5(){const{brandSlug:e}=xd(),[t,n]=m.useState(null),[r,s]=m.useState(null),i=Io(),{t:a}=xe(),l=nf(),u=We(t?`brands.${t.brand.id}.name`:""),{vehicle_tile_width:c,vehicle_tile_height:d}=Pt(),f={width:`${c}px`,height:`${d}px`};return m.useEffect(()=>{i.vehicles.enabled&&!i.bypass||ae.get(`/brands/${e}/models`).then(n).catch(h=>s(h))},[e,i.vehicles.enabled,i.bypass]),gr({title:t?`${t.brand.name} ${a("brandPage.titleSuffix")}`:a("brandPage.metaTitleFallback"),description:t?a("brandPage.metaDescription")(t.brand.name):void 0,path:`/fahrzeuge/${e}`}),i.vehicles.enabled&&!i.bypass?o.jsx(ji,{message:i.vehicles.message}):r?r.status===404?o.jsx(of,{}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:zo(r,a)}):t?o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&o.jsx(Ei,{inline:!0}),o.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[o.jsx("span",{style:u,children:t.brand.name})," – ",a("brandPage.titleSuffix")]}),t.models.length===0&&o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a("brandPage.empty")}),o.jsx("div",{className:"flex flex-wrap gap-4",children:t.models.map(h=>h.image_path?o.jsxs(K,{to:`/fahrzeuge/${e}/${h.slug}`,style:f,className:"group relative block shrink-0 overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[o.jsx("img",{src:h.image_path,alt:"",loading:"lazy",decoding:"async",width:c,height:d,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),o.jsx(ce,{entity:"car_models",id:h.id,field:"name",lang:"de",value:h.name,className:"absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white",style:fr(l,`car_models.${h.id}.name`)})]},h.id):o.jsx(K,{to:`/fahrzeuge/${e}/${h.slug}`,style:f,className:"flex shrink-0 flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:o.jsx(ce,{entity:"car_models",id:h.id,field:"name",lang:"de",value:h.name,style:fr(l,`car_models.${h.id}.name`)})},h.id))})]}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:a("brandPage.loading")})}function a5({text:e}){return e?e.split(/(\*\*[^*]+\*\*)/g).map((n,r)=>{const s=n.match(/^\*\*([^*]+)\*\*$/);return s?o.jsx("strong",{children:s[1]},r):o.jsx("span",{children:n},r)}):null}const Sp="data:image/webp;base64,UklGRmoNAABXRUJQVlA4IF4NAAAQjACdASrgAVYDPlEok0ajoqGhIRK4IHAKCWlu/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gEEqCWlXAFlY8pW0zIm16gqSPiwRUgH41i1PuJx382C0zTWGT243ZhLnyOIlreUrMQAfwR/oYt+ljnDFKqa5PEczDPa+u/vWmR6UM+Q/lLFiIlgBJTfaekWoeLpPd9FPN4gIHzK1ZS8kDHyq3lh/e6FQ84a4Zg6JlfQC/qhAAAAA==";function Dn(e,t,n){if(!e)return"";if(n==="en"){const r=e[`${t}_en`];if(r)return r}return e[t]}const o5=(e,t,n)=>{t/=100,n/=100;const r=a=>(a+e/30)%12,s=t*Math.min(n,1-n),i=a=>n-s*Math.max(-1,Math.min(r(a)-3,Math.min(9-r(a),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},zl=(e,t,n)=>`rgb(${o5(e,t,n).join(", ")})`,jp=e=>e.map(([t,n,r,s,i,a])=>({bgTop:zl(t,n,r),border:zl(t,n,r+8),accent:zl(s,i,a),img:null})),Ep={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:fv},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:hv},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:mv},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:pv},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:gv},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:xv},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:yv},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:vv}],"deep-blue":jp([[215,18,11,210,15,60],[212,25,11,208,32,60],[210,38,12,206,46,60],[212,46,12,205,56,61],[214,52,12,205,63,62],[216,58,12,205,68,63],[220,62,12,212,73,65],[226,66,12,216,78,68]]),"warm-bronze":jp([[30,15,11,34,22,60],[34,32,11,34,46,60],[32,46,12,30,58,60],[26,52,12,24,65,60],[20,55,12,18,68,60],[14,55,12,12,68,61],[8,52,12,6,64,62],[2,50,12,358,60,63]])},l5="#f2f2f2",Cp="#8a8a8a",Tp="#c4c4c4",Pp=5,u5=3,c5={recommended:{Icon:eP,className:"bg-brand-500 text-white"},popular:{Icon:jT,className:"bg-amber-400 text-neutral-950"},tip:{Icon:PT,className:"bg-sky-500 text-white"},coming_soon:{Icon:Yy,className:"bg-white text-neutral-900"},custom:{Icon:null,className:"bg-brand-500 text-white"}};function d5({pkg:e,tier:t,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:a,priceNote:l,t:u}){const[c,d]=m.useState(!1),f=Xe().canEdit("packages"),[h,g]=m.useState(!1),y=m.useRef(null),b=s.length-Pp,w=c?s:s.slice(0,Pp);m.useLayoutEffect(()=>{const N=y.current;if(!N||c){g(!1);return}const P=()=>g([...N.querySelectorAll("[data-clamp]")].some(B=>B.scrollHeight>B.clientHeight+1));P();const F=new ResizeObserver(P);return F.observe(N),()=>F.disconnect()},[c,s.length,e.description]);const p=nf(),x=fr(p,`packages.${e.id}.description`),v=fr(p,`packages.${e.id}.price_text`),{package_card_height:k}=Pt(),E=c5[e.badge],C=r!=="grid",j=e.badge==="custom"?e.badge_text:e.badge&&u(`modelPage.badges.${e.badge}`),S=t.img?null:{backgroundColor:t.accent,WebkitMaskImage:`url(${Sp})`,maskImage:`url(${Sp})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return o.jsxs("div",{style:{borderColor:t.border,background:`linear-gradient(180deg, ${t.bgTop} 0%, #0b0b0b 55%, #080808 100%)`,...C?{gridRow:"span 4",gridTemplateRows:"subgrid",gridTemplateColumns:"minmax(0, 1fr)",rowGap:0}:{minHeight:`${k}px`}},className:r==="strip"?"relative grid snap-start overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40":r==="coverflow"?"relative grid snap-center overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40":"relative flex flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40",children:[t.img?o.jsx("img",{src:t.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...S,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),o.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...S,opacity:.55+n*.45},"aria-hidden":"true"})]}),E&&j&&o.jsxs("span",{className:`absolute top-2 left-1/2 z-10 flex max-w-[calc(100%-16px)] -translate-x-1/2 items-center gap-1 whitespace-nowrap rounded-full px-3 py-1 text-xs font-bold shadow ${E.className}`,children:[E.Icon&&o.jsx(E.Icon,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:j})]}),o.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0",gridRow:1},children:[o.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:t.accent,textTransform:"uppercase",lineHeight:1.1},children:o.jsx(ce,{entity:"packages",id:e.id,field:"name",lang:"de",value:e.name,placeholder:"Paketname"})}),o.jsx("div",{style:{width:"44px",height:"2px",margin:"14px auto 0",background:`linear-gradient(90deg, rgba(255,255,255,0) 0%, ${t.accent} 50%, rgba(255,255,255,0) 100%)`}})]}),s.length>0&&o.jsxs("div",{className:"relative z-10",style:{gridRow:2,padding:"18px 20px 14px",background:c?"linear-gradient(180deg, rgba(8,8,8,0.7) 0%, rgba(8,8,8,0.62) 94%, rgba(8,8,8,0) 100%)":"linear-gradient(180deg, rgba(8,8,8,0.55) 0%, rgba(8,8,8,0.48) 92%, rgba(8,8,8,0) 100%)"},children:[o.jsx(yc,{entity:"packages",id:e.id,field:"description",value:e.description,label:"Zusätzliche Stichpunkte",hint:"Eine Zeile = ein Stichpunkt (unter den Produkten). **fett** wird fett dargestellt. Die Produkte selbst pflegst du im Admin unter Pakete.",children:o.jsx("ul",{ref:y,className:"space-y-1.5 text-left",children:w.map((N,P)=>o.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:Tp,...N.fromDescription?x:null},children:[o.jsx(qy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:t.accent}}),o.jsx("span",{"data-clamp":!0,className:"min-w-0 leading-snug",style:c?{overflowWrap:"anywhere",hyphens:"auto"}:{overflowWrap:"anywhere",hyphens:"auto",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:u5,overflow:"hidden"},children:N.fromDescription?o.jsx(a5,{text:N.text}):N.text.replace(/\//g,"/")})]},P))})}),(c||b>0||h)&&o.jsxs("button",{type:"button",onClick:()=>d(N=>!N),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:t.accent},children:[c?u("modelPage.lessBullets"):b>0?u("modelPage.moreBullets")(b):u("modelPage.showMore"),c?o.jsx(pT,{className:"h-3.5 w-3.5"}):o.jsx(uT,{className:"h-3.5 w-3.5"})]})]}),s.length===0&&f&&o.jsx(yc,{entity:"packages",id:e.id,field:"description",value:e.description,label:"Zusätzliche Stichpunkte",hint:"Eine Zeile = ein Stichpunkt. **fett** wird fett dargestellt.",className:"relative z-10 mx-5 mt-4 text-center text-xs",style:{gridRow:2,color:Tp},children:"+ Stichpunkte hinzufügen"}),o.jsx("div",{className:"relative z-10 flex-1",style:{gridRow:3}}),o.jsx("div",{className:"relative z-10",style:{gridRow:4,padding:"20px 20px 28px",background:"linear-gradient(180deg, rgba(8,8,8,0) 0%, rgba(8,8,8,0.85) 45%, rgba(8,8,8,0.95) 100%)"},children:o.jsxs("div",{className:"text-center",children:[!e.price_text&&o.jsx("div",{style:{fontSize:"13px",color:Cp},children:u("modelPage.totalPrice")}),o.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:l5,...e.price_text?v:null},children:f?o.jsx(ce,{entity:"packages",id:e.id,field:"price_text",value:e.price_text,placeholder:i(e.total_price),title:"Leer lassen = Preis automatisch aus den Produkten"}):e.price_text||i(e.total_price)}),!e.price_text&&l&&o.jsx("div",{style:{marginTop:"2px",fontSize:"11px",color:Cp},children:l}),o.jsx(K,{to:a(e),onClick:()=>An("select_package",{package_name:e.name,value:Number(e.total_price)||void 0,currency:"EUR"}),className:"mt-4 inline-block rounded-md bg-brand-500 px-4 py-2 text-center text-sm font-semibold text-white shadow-lg shadow-brand-500/30 hover:bg-brand-400",children:u("modelPage.requestContact")}),e.video_url&&o.jsx("div",{className:"mt-3",children:o.jsxs("a",{href:e.video_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full border border-white/15 bg-white/5 px-3 py-1 text-xs font-semibold text-white transition hover:bg-white/15",children:[o.jsx(xT,{className:"h-4 w-4 text-red-500","aria-hidden":"true"}),u("modelPage.videoLink")]})})]})})]})}function f5(){const{brandSlug:e,modelSlug:t}=xd(),[n,r]=m.useState(null),[s,i]=m.useState(null),a=Io(),{t:l,language:u}=xe(),c=Xe(),{package_card_theme:d,package_card_layout:f,package_wheel_hint_interval:h,package_card_width:g,package_card_height:y,phone:b,whatsapp:w,price_note:p,price_note_en:x}=Pt(),v=u==="en"&&x||p,k=Ro(),E=(Ep[d]||Ep.graphite).map((_,I)=>{const{custom:X}=k.packageTier(I);return X?{..._,img:X}:_}),C=["grid","strip","coverflow"].includes(f)?f:"strip",j=Math.max(2,Number(h)||8)*1e3,S=m.useRef(null),N=m.useRef(null),P=m.useRef(null),[F,B]=m.useState(!1),se=_=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(_);m.useEffect(()=>{a.vehicles.enabled&&!a.bypass||ae.get(`/models/${e}/${t}/packages`).then(r).catch(_=>i(_))},[e,t,a.vehicles.enabled,a.bypass]),m.useEffect(()=>{const _=S.current;if(C!=="coverflow"||!_)return;let I=0;const X=()=>{I=0;const J=_.scrollLeft+_.clientWidth/2;for(const ke of _.children){const De=ke.offsetLeft+ke.offsetWidth/2,Ze=Math.max(-1,Math.min(1,(De-J)/(ke.offsetWidth*1.4))),dt=Math.abs(Ze);ke.style.transform=`rotateY(${(-Ze*35).toFixed(2)}deg) scale(${(1-dt*.13).toFixed(3)}) translateZ(${(-dt*60).toFixed(1)}px)`,ke.style.zIndex=String(100-Math.round(dt*50))}},Q=()=>{I||(I=requestAnimationFrame(X))};X(),_.addEventListener("scroll",Q,{passive:!0});const ue=new ResizeObserver(Q);return ue.observe(_),()=>{_.removeEventListener("scroll",Q),ue.disconnect(),cancelAnimationFrame(I)}},[C,n]),m.useEffect(()=>{const _=S.current;if(C==="grid"||!_)return;const I=window.matchMedia("(pointer: coarse)").matches;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let Q=[],ue=0;const J=()=>{const De=Math.min(_.clientWidth*.4,160);Q.push(setTimeout(()=>_.scrollTo({left:De,behavior:"smooth"}),500)),Q.push(setTimeout(()=>_.scrollTo({left:0,behavior:"smooth"}),1250)),I||(Q.push(setTimeout(()=>B(!0),450)),Q.push(setTimeout(()=>B(!1),1700)))},ke=new IntersectionObserver(([De])=>{De.isIntersecting&&(ke.disconnect(),J(),ue=setInterval(()=>{_.scrollLeft<=1&&J()},j))},{threshold:.35});return ke.observe(_),()=>{ke.disconnect(),clearInterval(ue),Q.forEach(clearTimeout)}},[C,n,j]),m.useEffect(()=>{const _=S.current;if(C==="grid"||!_)return;let I=0,X=0,Q=!1,ue=0,J=0;const ke=()=>[..._.children].map(he=>he.offsetLeft+he.offsetWidth/2),De=(he,ft)=>{let W=0,L=1/0;return he.forEach(($,Qe)=>{const Hn=Math.abs($-ft);Hn