@dispatchEvent('afterMetaTags') @php // Cache-buster: the filenames only change per app version, so rebuilds of // the SAME version were served stale from browser cache (no query hash in // the mix manifest — core mix does not version() the css). The bundle's // mtime changes on every build, which busts exactly when needed. $mainCssPath = APP_ROOT.'/public/dist/css/main.'.$version.'.min.css'; $cssBust = is_file($mainCssPath) ? filemtime($mainCssPath) : $version; @endphp @if($tpl->needsComponent('tiptap')) @endif @dispatchEvent('afterLinkTags') {{-- Feature-component libraries are leaf bundles used only inside controller functions that run on/after DOMContentLoaded (e.g. initCalendar()), never at module-load. Deferring them keeps these heavy bundles (the tiptap editor alone is ~6.8MB) from blocking first render; deferred scripts still execute before DOMContentLoaded, so the init handlers find them ready. --}} @if($tpl->needsComponent('calendar')) @endif @if($tpl->needsComponent('table')) @endif @if($tpl->needsComponent('tiptap')) @endif @if($tpl->needsComponent('gantt')) @endif @if($tpl->needsComponent('chart')) @endif @dispatchEvent('afterScriptLibTags') @dispatchEvent('afterMainScriptTag') @foreach ($themeScripts as $script) @endforeach @foreach ($themeStyles as $style) @endforeach @dispatchEvent('afterScriptsAndStyles') @php // The nav bar sets white controls on the accent gradient. A light accent is // a mid-tone that fails WCAG AA for white text; detect that per-theme and // enable a dark scrim only then, so dark-accent themes stay fully vivid. $navNeedsScrim = false; foreach ($accents as $accentColor) { // No usable accent value here — nothing to reason about, skip. if ($accentColor === false || $accentColor === null || $accentColor === '') { continue; } // A real accent we can't parse as 6-digit hex (e.g. rgb()/hsl()/named // colors): we can't measure its luminance, so fail closed and enable the // scrim to protect white nav-text contrast rather than assuming it's safe. if (! is_string($accentColor) || ! preg_match('/^#?([0-9a-fA-F]{6})$/', $accentColor, $accentHex)) { $navNeedsScrim = true; break; } [$ar, $ag, $ab] = sscanf($accentHex[1], '%02x%02x%02x'); $linChannel = static fn ($v) => ($v /= 255) <= 0.03928 ? $v / 12.92 : (($v + 0.055) / 1.055) ** 2.4; $accentLum = 0.2126 * $linChannel($ar) + 0.7152 * $linChannel($ag) + 0.0722 * $linChannel($ab); if (1.05 / ($accentLum + 0.05) < 4.5) { // white-on-accent below AA $navNeedsScrim = true; break; } } @endphp @dispatchEvent('afterThemeColors') @include('global::components.pdfPreview')