<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8"/>
    <meta name="apple-mobile-web-app-title" content="{{ config('meta_application_name') }}"/>
    @if($metaViewport = config('meta_viewport'))
        <meta name="viewport" content="{{ $metaViewport }}"/>
    @else
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
    @endif
    @if($metaRobots = config('meta_robots'))
        <meta name="robots" content="{{ $metaRobots }}"/>
    @endif
    @if($metaAuthor = config('meta_author'))
        <meta name="author" content="{{ $metaAuthor }}"/>
    @endif
    @if($metaKeywords = config('meta_keywords'))
        <meta name="keywords" content="{{ $metaKeywords }}"/>
    @endif
    @if($metaDescription = config('meta_description'))
        <meta name="description" content="{{ $metaDescription }}"/>
    @endif
    {!! config('meta_adds_info') !!}

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}"/>

    <title>{{ config('site_title', config('app.name')) }}</title>

    @vite(['resources/sass/app.scss', 'resources/js/app.js'])
    <link rel="stylesheet" href="{{ asset('css/common/layout.css') }}"/>
    @stack('styles')

    <script>
        // 자바스크립트에서 사용하는 전역변수 선언
        var BASE_URL = "{{ BASE_URL }}";
        var FULL_URL = "{{ FULL_URL }}";
        var ADMIN_URL = "{{ ADMIN_URL }}";
        var CHARSET = "{{ CHARSET }}";
        var DATE = "{{ DATE }}";
        var DATETIME = "{{ DATETIME }}";
        var IP_ADDRESS = "{{ IP_ADDRESS }}";
        var REFERER = "{{ REFERER }}";
        var USER_AGENT = "{{ USER_AGENT }}";
        var DEVICE = "{{ DEVICE }}";
        var PLATFORM = "{{ PLATFORM }}";
        var BROWSER = "{{ BROWSER }}";
        var IS_USER = {{ IS_USER }};
        var IS_ADMIN = {{ IS_ADMIN }};
        var IS_FRONT = 1;
        var CSRF = "{{ csrf_token() }}";
    </script>

    <!--[if lt IE 9]>
    <script src="{{ asset('js/common/html5shiv.min.js') }}"></script>
    <script src="{{ asset('js/common/respond.min.js') }}"></script>
    <script src="{{ asset('js/common/ie8-responsive-file-warning.js') }}"></script>
    <![endif]-->

    <script src="{{ asset('/js/common/common.js') }}" defer></script>
    <script src="{{ asset('/js/common/jquery.validate.extension.js') }}" defer></script>
    <script src="{{ asset('/js/front.js') }}" defer></script>
</head>
<body id="app">
    @yield('content')

    {{-- 처리중 1 --}}
    <div id="loading">
        <figure class="figure">
            <img src="/images/default/loading.gif" class="figure-img img-fluid"/>
            <figcaption class="figure-caption">처리 중...</figcaption>
        </figure>
    </div>

    @stack('scripts')

    @if(Session::has('message'))
        <script>alert(("{!! addslashes(Session::get('message')) !!}"));</script>
    @endif
    @if ($errors->any())
        <script>alert(("{{ addslashes($errors->first()) }}"));</script>
    @endif
</body>
</html>
