<?php
use App\Models\Setting;
use App\Models\CustomScript;
use App\Models\Contacts;
use Illuminate\Support\Carbon;

$customScripts = CustomScript::all();
$setting = Setting::first();
$contacts = Contacts::first();
$cf_error = Carbon::now()->format("Y-m-d H:i:s");
?>
<html lang="id-ID">
<head>
  <title>{{ $setting->after_nama_web }}</title>

  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta name="description"
content="{{ $setting->meta_description }}" />
<meta name="keywords"
content="{{ $setting->meta_keyword }}" />
<meta name="twitter:title" content="{{ $setting->meta_description }}">
<meta name="twitter:description"
content="{{ $setting->meta_description }}">
<meta property="og:title" content="{{ $setting->after_nama_web }}">
<meta property="og:description"
content="{{ $setting->meta_description }}">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta name="robots" content="INDEX, FOLLOW">
<meta name="Content-Type" content="text/html">
<meta name="twitter:card" content="summary">
<meta name="og:type" content="website">
<meta name="author" content="{{ $setting->nama_web }}">
<meta property="og:image" content="https://panel.royalkingz.top/storage/logo/ogimage/{{ $setting->ogimage }}">

<link rel="icon" href="https://panel.royalkingz.top/storage/logo/favicon/{{ $setting->favicon }}" type="image/gif">

<meta property="og:site_name" content="{{ $setting->nama_web }}">
<meta name="twitter:site" content="{{ $setting->nama_web }}">
<meta name="twitter:image" content="https://panel.royalkingz.top/storage/logo/ogimage/{{ $setting->ogimage }}">
<meta property="og:image:alt" content="{{ $setting->nama_web }}">
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, user-scalable=no">

<meta property="og:url" content="index.html">
<link rel="canonical" href="{{ URL::to('/') }}" />

@foreach($customScripts as $script)
{!! $script->content !!}
@endforeach

</head>
@php
$setting = Setting::first();
@endphp


@if($setting->maintenance_mode == 0)
{{-- Konten normal ketika tidak dalam mode maintenance --}}

@else
{{-- Redirect ke route /maintenance --}}
<script>
window.location.href = "{{ route('maintenance') }}";
</script>
@endif
@if(Agent::isMobile())
<!-- Mobile Views -->
@extends('layouts.main-mobile')
@else
<!-- Desktop Views -->
@extends('layouts.main-desktop')
@endif
</html>