<?php
    $brandVersion = $settings?->updated_at?->timestamp ?? $settings?->logo_media_id ?? $settings?->favicon_media_id ?? '1';
    $siteLogo = ($settings?->logo_url ?? asset('uploads/placeholders/default-logo.png')) . '?v=' . $brandVersion;
    $siteFavicon = ($settings?->favicon_url ?? asset('uploads/placeholders/saleem-sial-favicon.png')) . '?v=' . $brandVersion;
    $metaTitle = trim($__env->yieldContent('title', $settings->site_name ?? config('app.name', 'Saleem Sial Analytics')));
    $metaDescription = trim($__env->yieldContent('meta_description', $settings->footer_text ?? 'Saleem Sial Analytics builds reliable tracking, analytics, and reporting systems.'));
    $metaImage = trim($__env->yieldContent('meta_image', $siteLogo));
    $canonicalUrl = trim($__env->yieldContent('canonical', url()->current()));
    $frontendCssVersion = file_exists(public_path('assets/css/frontend.css')) ? filemtime(public_path('assets/css/frontend.css')) : '1';
    $frontendJsVersion = file_exists(public_path('assets/js/frontend.js')) ? filemtime(public_path('assets/js/frontend.js')) : '1';
    $schema = [
        '@context' => 'https://schema.org',
        '@type' => 'ProfessionalService',
        'name' => $settings->site_name ?? config('app.name', 'Saleem Sial Analytics'),
        'url' => url('/'),
        'logo' => $siteLogo,
        'image' => $metaImage,
        'description' => $metaDescription,
        'email' => $settings?->contact_email,
        'telephone' => $settings?->contact_phone,
        'sameAs' => array_values($settings?->social_links ?? []),
    ];
?>
<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">

    <title><?php echo e($metaTitle); ?></title>
    <meta name="description" content="<?php echo e($metaDescription); ?>" />
    <meta name="robots" content="<?php echo $__env->yieldContent('robots', 'index,follow'); ?>" />
    <link rel="canonical" href="<?php echo e($canonicalUrl); ?>">
    <meta property="og:type" content="<?php echo $__env->yieldContent('og_type', 'website'); ?>">
    <meta property="og:title" content="<?php echo e($metaTitle); ?>">
    <meta property="og:description" content="<?php echo e($metaDescription); ?>">
    <meta property="og:url" content="<?php echo e($canonicalUrl); ?>">
    <meta property="og:image" content="<?php echo e($metaImage); ?>">
    <meta property="og:site_name" content="<?php echo e($settings->site_name ?? config('app.name', 'Saleem Sial Analytics')); ?>">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="<?php echo e($metaTitle); ?>">
    <meta name="twitter:description" content="<?php echo e($metaDescription); ?>">
    <meta name="twitter:image" content="<?php echo e($metaImage); ?>">
    <link rel="icon" href="<?php echo e($siteFavicon); ?>">
    <script type="application/ld+json"><?php echo json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); ?></script>

    <?php if(filled($settings?->gtm_container_id)): ?>
        <script>
            (function(w, d, s, l, i) {
                w[l] = w[l] || [];
                w[l].push({
                    'gtm.start': new Date().getTime(),
                    event: 'gtm.js'
                });
                var f = d.getElementsByTagName(s)[0],
                    j = d.createElement(s),
                    dl = l != 'dataLayer' ? '&l=' + l : '';
                j.async = true;
                j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
                f.parentNode.insertBefore(j, f);
            })(window, document, 'script', 'dataLayer', <?php echo \Illuminate\Support\Js::from($settings->gtm_container_id)->toHtml() ?>);
        </script>
    <?php elseif(filled($settings?->ga_measurement_id)): ?>
        <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo e($settings->ga_measurement_id); ?>"></script>
        <script>
            window.dataLayer = window.dataLayer || [];
            function gtag() {
                dataLayer.push(arguments);
            }
            gtag('js', new Date());
            gtag('config', <?php echo \Illuminate\Support\Js::from($settings->ga_measurement_id)->toHtml() ?>);
        </script>
    <?php endif; ?>

    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>

    <link rel="stylesheet" href="<?php echo e(asset('assets/themes/prespa/assets/css/core-add.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('assets/themes/prespa/build/css/main.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('assets/themes/prespa-saas/style.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('assets/css/frontend.css') . '?v=' . $frontendCssVersion); ?>">

    <?php echo $__env->yieldPushContent('styles'); ?>
</head>
<body class="frontend-site <?php echo e(trim($__env->yieldContent('body_class'))); ?>">
    <?php if(filled($settings?->gtm_container_id)): ?>
        <noscript>
            <iframe src="https://www.googletagmanager.com/ns.html?id=<?php echo e($settings->gtm_container_id); ?>" height="0" width="0" style="display:none;visibility:hidden"></iframe>
        </noscript>
    <?php endif; ?>

    <div id="page" class="site">
        <?php echo $__env->make('partials.header', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

        <main id="primary" class="site-main">
            <?php echo $__env->yieldContent('content'); ?>
        </main>

        <?php echo $__env->make('partials.footer', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

        <?php echo $__env->make('partials.support-chat', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    </div>

    <script src="<?php echo e(asset('assets/js/frontend.js') . '?v=' . $frontendJsVersion); ?>"></script>
    <?php echo $__env->yieldPushContent('scripts'); ?>
</body>
</html>
<?php /**PATH /home/xsoftdev/saleemsail.xsoftdevelop.com/resources/views/layouts/app.blade.php ENDPATH**/ ?>