<!DOCTYPE html>

<!-- 言語属性を指定 -->
<html lang="ja">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>@yield('title') | So-Manager管理パネル</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">

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

    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <!-- daterange picker -->
    <link rel="stylesheet" href="{{ asset('plugins/daterangepicker/daterangepicker-bs3.css') }}">
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="{{ asset('plugins/iCheck/all.css') }}">
    <!-- Bootstrap Color Picker -->
    <link rel="stylesheet" href="{{ asset('plugins/colorpicker/bootstrap-colorpicker.min.css') }}">
    <!-- Bootstrap time Picker -->
    <link rel="stylesheet" href="{{ asset('plugins/timepicker/bootstrap-timepicker.min.css') }}">
    <link rel="stylesheet" href="{{ asset('plugins/datepicker/datepicker3.css') }}">
    <!-- Select2 -->
    <link rel="stylesheet" href="{{ asset('plugins/select2/select2.min.css') }}">
    <!-- Theme style -->
    <link rel="stylesheet" href="{{ asset('dist/css/adminlte.min.css') }}">
    <link rel="stylesheet" href="{{ asset('plugins/datatables/dataTables.bootstrap4.css') }}">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

    <link rel="stylesheet" href="{{ asset('assets/css/style.css') }}">
    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
    <!-- kin 追加 -->
    <link href="{{ asset('assets/css/app.css') }}" rel="stylesheet">

</head>

<body class="hold-transition sidebar-mini">
    <div class="wrapper">
        <!-- Navbar -->
        <nav class="main-header navbar navbar-expand bg-white navbar-light border-bottom">
            <!-- Left navbar links -->
            <ul class="navbar-nav">
                <li class="nav-item d-lg-none">
                    <a class="nav-link" data-widget="pushmenu" href="#"><i class="fa fa-bars"></i></a>
                </li>
                <li class="nav-item d-none d-sm-inline-block">
                    <a class="nav-link" style="margin-left:20px;">
                        {{ __('ようこそ、:ope_name様', ['ope_name' => Auth::user()->ope_name]) }}
                    </a>
                </li>
            </ul>

            <!-- SEARCH FORM -->
            <!--
        <form class="form-inline ml-3">
          <div class="input-group input-group-sm">
            <input class="form-control form-control-navbar" type="search" placeholder="Search" aria-label="Search">
            <div class="input-group-append">
              <button class="btn btn-navbar" type="submit">
                <i class="fa fa-search"></i>
              </button>
            </div>
          </div>
        </form>
        -->

            <!-- Right navbar links -->
            <ul class="navbar-nav ml-auto">
                <!-- ハード異常 件数表示（ドロップダウン任意表示：ここでは件数バッジのみ簡易） -->
                <li class="nav-item dropdown">
                    <a class="nav-link text-danger" data-toggle="dropdown" href="#">
                        <i class="fa fa-exclamation-circle"></i>
                        <span class="d-none d-md-inline">ハード異常:</span>
                        {{ $hardCount ?? 0 }}件
                        @if(!empty($hardLatest))
                            <small class="d-none d-md-inline">
                                最新:{{ \Carbon\Carbon::parse($hardLatest)->format('Y/m/d H:i') }}
                            </small>
                        @endif
                    </a>
                    @if(!empty($latestHards) && count($latestHards))
                        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                            <span class="dropdown-header">
                                ハード異常 {{ $hardCount }}件（未/進行中）
                            </span>
                            <div class="dropdown-divider"></div>
                            @foreach($latestHards as $hq)
                                <a href="{{ route('information', ['type' => 'hard', 'status' => 'untreated', 'period' => 'all']) }}"
                                    class="dropdown-item" style="white-space:normal;">
                                    {{ Str::limit($hq->que_comment ?? 'ハード異常', 40) }}
                                    <span class="float-right text-muted text-sm">
                                        {{ \Carbon\Carbon::parse($hq->created_at)->diffForHumans() }}
                                    </span>
                                </a>
                                <div class="dropdown-divider"></div>
                            @endforeach
                            <a href="{{ route('information', ['type' => 'hard', 'period' => 'all']) }}"
                                class="dropdown-item dropdown-footer">
                                すべてを見る
                            </a>
                        </div>
                    @endif
                </li>

                <!-- タスク 件数 + ドロップダウン最新5件 -->
                <li class="nav-item dropdown">
                    <a class="nav-link" data-toggle="dropdown" href="#">
                        <i class="fa fa-bell-o"></i>
                        <span class="d-none d-md-inline">タスク:</span>
                        {{ $taskCount ?? 0 }}件
                        @if(!empty($taskLatest))
                            <small class="d-none d-md-inline">
                                最新:{{ \Carbon\Carbon::parse($taskLatest)->format('Y/m/d H:i') }}
                            </small>
                        @endif
                    </a>
                    @if(!empty($latestTasks) && count($latestTasks))
                        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                            <span class="dropdown-header">
                                タスク {{ $taskCount }}件（未/進行中）
                            </span>
                            <div class="dropdown-divider"></div>
                            @foreach($latestTasks as $tq)
                                <a href="{{ route('information', ['type' => 'task', 'status' => 'untreated', 'period' => 'all']) }}"
                                    class="dropdown-item" style="white-space:normal;">
                                    {{ Str::limit($tq->que_comment ?? 'タスク', 40) }}
                                    <span class="float-right text-muted text-sm">
                                        {{ \Carbon\Carbon::parse($tq->created_at)->diffForHumans() }}
                                    </span>
                                </a>
                                <div class="dropdown-divider"></div>
                            @endforeach
                            <a href="{{ route('information', ['type' => 'task', 'period' => 'all']) }}"
                                class="dropdown-item dropdown-footer">
                                過去のタスクを全て見る
                            </a>
                        </div>
                    @endif
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/logout"><i class="fa fa-sign-out"></i> {{ __('ログアウト') }}</a>
                </li>
            </ul>
        </nav>
        <!-- /.navbar -->

        <!-- Main Sidebar Container -->
        <aside class="main-sidebar sidebar-dark-primary bg-success elevation-4">
            <!-- Brand Logo -->
            <a href="/home" class="brand-link">
                <img src="{{asset('assets/img/so-rin_logo.png')}}" alt="Logo" class="brand-image" style="opacity: .8">
                <span class="brand-text font-weight-light">So-Manager</span>
            </a>
            <div class="sidebar">
                @php
                    // タグ・シール管理
                    $tagRoutes = [
                        'tags', // 例: タグ・シール管理のroute名
                    ];
                    // 集計業務
                    $aggregateRoutes = [
                        'aggregate', // 例: 集計業務のroute名
                    ];
                    // 決済マスタ
                    $settlementRoutes = [
                        'settlement1',
                        'settlement2', // 決済マスタの各route名
                    ];
                    // システムマスタ
                    $systemRoutes = [
                        'system1',
                        'system2', // システムマスタの各route名
                    ];

                @endphp

                <!-- Sidebar Menu -->
                <nav class="mt-2">
                    <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
                        data-accordion="false">
                        <!-- OU START -->
                        <!-- ホーム（親） -->
                        <li class="nav-item has-treeview {{ request()->routeIs('information') ? 'menu-open' : '' }}">
                            <a href="#" class="nav-link {{ request()->routeIs('information') ? 'active' : '' }}">
                                <i class="nav-icon fa fa-home"></i>
                                <p>
                                    ホーム
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview"
                                style="{{ request()->routeIs('information') ? 'display:block;' : 'display:none;' }}">
                                <li class="nav-item">
                                    <a href="#" class="nav-link">
                                        <span style="margin-left:20px;">ハードウェア異常表示</span>
                                    </a>
                                </li>

                                <li class="nav-item">
                                    <a href="{{ route('information') }}"
                                        class="nav-link {{ request()->routeIs('information') ? 'active' : '' }}">
                                        <span style="margin-left:20px;">常時表示インフォメーション</span>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        @php
                            // <!-- タグ・シール管理 -->
                            $webRoutes = [
                                'tagissue',   // タグ発行キュー処理、履歴表示
                                'seals',    // タグシール管理
                            ];
                        @endphp
                        <li
                            class="nav-item has-treeview @if(in_array(app('router')->currentRouteName(), $webRoutes)) menu-open @endif">
                            <a href="#"
                                class="nav-link @if(in_array(app('router')->currentRouteName(), $webRoutes)) active @endif">
                                <i class="nav-icon fa fa-repeat"></i>
                                <p>タグ・シール管理
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('tagissue') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'tagissue') active @endif">
                                        <span style="margin-left:20px;">タグ発行キュー処理、履歴表示</span>
                                    </a>
                                </li>
                            </ul>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('seals') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'seals') active @endif">

                                        <span style="margin-left:20px;">シール発行履歴</span>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        @php
                            // 定期駐輪管理：ルート名がここに含まれている場合、展開＆ハイライト
                            $parkingRoutes = [
                                'periodical', // 定期利用・契約状況
                                'contractor', // 契約者一覧
                                'contractor_List', // 未更新者一覧
                                'update_candidate', // 更新予定者一覧
                                'reservation', // 予約者一覧
                                'personal', // 本人確認手動処理
                                'using_status', // 区画別利用率状況
                            ];
                        @endphp

                        <li
                            class="nav-item has-treeview @if(in_array(app('router')->currentRouteName(), $parkingRoutes)) menu-open @endif">
                            <a href="#"
                                class="nav-link @if(in_array(app('router')->currentRouteName(), $parkingRoutes)) active @endif">
                                <i class="nav-icon fa fa-repeat"></i>
                                <p>
                                    定期駐輪管理
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>

                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('periodical') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'periodical') active @endif">

                                        <span style="margin-left:20px;">定期利用・契約状況</span>
                                    </a>
                                </li>
                            </ul>

                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('contractor') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'contractor') active @endif">

                                        <span style="margin-left:20px;">契約者一覧</span>
                                    </a>
                                </li>
                            </ul>

                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('contractor_List') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'contractor_List') active @endif">

                                        <span style="margin-left:20px;">未更新者一覧</span>
                                    </a>
                                </li>
                            </ul>

                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('update_candidate') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'update_candidate') active @endif">

                                        <span style="margin-left:20px;">更新予定者一覧</span>
                                    </a>
                                </li>
                            </ul>

                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('reservation') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'reservation') active @endif">

                                        <span style="margin-left:20px;">予約者一覧</span>
                                    </a>
                                </li>
                            </ul>

                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('personal') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'personal') active @endif">

                                        <span style="margin-left:20px;">本人確認手動処理</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('using_status') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'using_status') active @endif">
                                        <span style="margin-left:20px;">区画別利用率状況</span>
                                    </a>
                                </li>
                            </ul>

                        </li>
                        <!-- 集計業務 -->
                        <li class="nav-item">
                            <a href="#" class="nav-link">
                                <i class="nav-icon fa fa-calculator"></i>
                                <p>集計業務</p>
                            </a>

                            @php
                                // 一般ウェブ管理：ルート名がここに含まれている場合、展開＆ハイライト
                                $webRoutes = [
                                    'news',   // 最新ニュース登録
                                ];
                            @endphp
                        <li
                            class="nav-item has-treeview @if(in_array(app('router')->currentRouteName(), $webRoutes)) menu-open @endif">
                            <a href="#"
                                class="nav-link @if(in_array(app('router')->currentRouteName(), $webRoutes)) active @endif">
                                <i class="nav-icon fa fa-dashboard"></i>
                                <p>
                                    一般ウェブ管理
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="{{ route('news') }}"
                                        class="nav-link @if(app('router')->currentRouteName() === 'news`') active @endif">
                                        <span style="margin-left:20px;">最新ニュース登録</span>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        @php
                            // 利用者マスタ：ルート名がここに含まれている場合、展開＆ハイライト
                            $userGroupRoutes = [
                                'users',            // 利用者マスタ
                                'regularcontracts', // 定期契約マスタ
                                'reserves', // 定期予約マスタ
                                'usertypes', // 定期予約マスタ
                            ];
                        @endphp

                        <li
                            class="nav-item has-treeview @if(in_array(app('router')->currentRouteName(), $userGroupRoutes)) menu-open @endif">
                            <a href="#"
                                class="nav-link @if(in_array(app('router')->currentRouteName(), $userGroupRoutes)) active @endif">
                                <i class="nav-icon fa fa-dashboard"></i>
                                <p>
                                    利用者マスタ
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>

                            <ul class="nav nav-treeview" @if(in_array(app('router')->currentRouteName(), $userGroupRoutes)) style="display: block;" @else style="display: none;" @endif>

                                <li class="nav-item">
                                    <a href="{{ route('users') }}"
                                        class="nav-link @if(app('router')->is('users')) active @endif">
                                        <span style="margin-left:20px;">利用者マスタ</span>
                                    </a>
                                </li>

                                <li class="nav-item">
                                    <a href="{{ route('regularcontracts') }}"
                                        class="nav-link @if(app('router')->is('regularcontracts')) active @endif">
                                        <span style="margin-left:20px;">定期契約マスタ</span>
                                    </a>
                                </li>

                                <li class="nav-item">
                                    <a href="{{ route('reserves') }}"
                                        class="nav-link @if(app('router')->is('reserves')) active @endif">
                                        <span style="margin-left:20px;">定期予約マスタ</span>
                                    </a>
                                </li>

                                <li class="nav-item">
                                    <a href="{{ route('usertypes') }}"
                                        class="nav-link @if(app('router')->is('usertypes')) active @endif">
                                        <span style="margin-left:20px;">利用者分類マスタ</span>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        <!-- 駐輪場マスタ -->
                        @php
                            // 駐輪場マスタ：ルート名がここに含まれている場合、展開＆ハイライト
                            $parkingRoutes = [
                                'ptypes',
                                'parks',
                                'managers',
                                'print_areas',
                                'regular_types',
                                'jurisdiction_parkings',
                                'city',
                                'pricelist',
                                'prices',
                                'psections',
                                'price_add',
                                'price_info',
                                'price_edit',
                                'zones',
                                'stations',
                                'terms',
                                'contract_allowable_cities',
                                'pplaces',
                            ];
                            $current = app('router')->currentRouteName();
                        @endphp

                        <!-- 駐輪場マスタ -->
                        <li class="nav-item has-treeview @if(in_array($current, $parkingRoutes)) menu-open @endif">
                            <a href="#" class="nav-link @if(in_array($current, $parkingRoutes)) active @endif">
                                <i class="nav-icon fa fa-th"></i>
                                <p>
                                    {{ __("駐輪場マスタ") }}
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview"
                                style="display: @if(in_array($current, $parkingRoutes)) block @else none @endif;">
                                <li class="nav-item">
                                    <a href="{{ route('parks') }}"
                                        class="nav-link @if($current === 'parks') active @endif">
                                        <span style="margin-left:20px;">{{ __("駐輪場マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('city') }}"
                                        class="nav-link @if($current === 'city') active @endif">
                                        <span style="margin-left:20px;">{{ __("市区マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('pricelist') }}"
                                        class="nav-link @if($current === 'pricelist') active @endif">
                                        <span style="margin-left:20px;">{{ __("料金一覧表") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('prices') }}"
                                        class="nav-link @if($current === 'prices') active @endif">
                                        <span style="margin-left:20px;">{{ __("駐輪場所、料金マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('psections') }}"
                                        class="nav-link @if($current === 'psections') active @endif">
                                        <span style="margin-left:20px;">{{ __("車種区分マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('ptypes') }}"
                                        class="nav-link @if($current === 'ptypes') active @endif">
                                        <span style="margin-left:20px;">{{ __("駐輪分類マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('zones') }}"
                                        class="nav-link @if($current === 'zones') active @endif">
                                        <span style="margin-left:20px;">{{ __("ゾーンマスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('pplaces') }}"
                                        class="nav-link @if($current === 'pplaces') active @endif">
                                        <span style="margin-left:20px;">{{ __("駐輪車室マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('stations') }}"
                                        class="nav-link @if($current === 'stations') active @endif">
                                        <span style="margin-left:20px;">{{ __("近傍駅マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('regular_types') }}"
                                        class="nav-link @if($current === 'regular_types') active @endif">
                                        <span style="margin-left:20px;">{{ __("定期種別マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('terms') }}"
                                        class="nav-link @if($current === 'terms') active @endif">
                                        <span style="margin-left:20px;">{{ __("利用規約マスタ") }}</span>
                                    </a>
                                </li>
                                <!-- <li class="nav-item">
                                    <a href="{{ route('jurisdiction_parkings') }}" class="nav-link @if($current === 'jurisdiction_parkings') active @endif">
                                        <span style="margin-left:20px;">{{ __("管轄駐輪場") }}</span>
                                    </a>
                                </li> -->
                                <li class="nav-item">
                                    <a href="{{ route('print_areas') }}"
                                        class="nav-link @if($current === 'print_areas') active @endif">
                                        <span style="margin-left:20px;">{{ __("シール印刷範囲マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('contract_allowable_cities') }}"
                                        class="nav-link @if($current === 'contract_allowable_cities') active @endif">
                                        <span style="margin-left:20px;">{{ __("契約許容市区マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('managers') }}"
                                        class="nav-link @if($current === 'managers') active @endif">
                                        <span style="margin-left:20px;">{{ __("駐輪場管理者マスタ") }}</span>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        @php
                            // 決済マスタ：ルート名がここに含まれている場合、展開＆ハイライト
                            $paymentRoutes = [
                                'tax',                     // 消費税マスタ
                                'payments',                // 決済情報マスタ
                                'settlement_transactions', // 決済トランザクション
                            ];
                            $current = app('router')->currentRouteName();
                        @endphp

                        <!-- 決済マスタ -->
                        <li class="nav-item has-treeview @if(in_array($current, $paymentRoutes)) menu-open @endif">
                            <a href="#" class="nav-link @if(in_array($current, $paymentRoutes)) active @endif">
                                <i class="nav-icon fa fa-crop"></i>
                                <p>
                                    {{ __("決済マスタ") }}
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>

                            <ul class="nav nav-treeview"
                                style="display: @if(in_array($current, $paymentRoutes)) block @else none @endif;">
                                <li class="nav-item">
                                    <a href="{{ route('tax') }}" class="nav-link @if($current === 'tax') active @endif">
                                        <span style="margin-left:20px;">{{ __('消費税マスタ') }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('payments') }}"
                                        class="nav-link @if($current === 'payments') active @endif">
                                        <span style="margin-left:20px;">{{ __("決済情報マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('settlement_transactions') }}"
                                        class="nav-link @if($current === 'settlement_transactions') active @endif">
                                        <span style="margin-left:20px;">{{ __("決済トランザクション") }}</span>
                                    </a>
                                </li>
                            </ul>
                        </li>


                        @php
                            // システムマスタ：ルート名がここに含まれている場合、展開＆ハイライト
                            $systemRoutes = [
                                'opes',
                                'devices',
                                'operator_ques',
                                'settings',
                                'mail_templates',
                            ];
                            $current = app('router')->currentRouteName();
                        @endphp

                        <!-- システムマスタ -->
                        <li class="nav-item has-treeview @if(in_array($current, $systemRoutes)) menu-open @endif">
                            <a href="#" class="nav-link @if(in_array($current, $systemRoutes)) active @endif">
                                <i class="nav-icon fa fa-cogs"></i>
                                <p>
                                    {{ __("システムマスタ") }}
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview"
                                style="display: @if(in_array($current, $systemRoutes)) block @else none @endif;">
                                <li class="nav-item">
                                    <a href="{{ route('opes') }}"
                                        class="nav-link @if($current === 'opes') active @endif">
                                        <span style="margin-left:20px;">{{ __("オペレータマスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('devices') }}"
                                        class="nav-link @if($current === 'devices') active @endif">
                                        <span style="margin-left:20px;">{{ __("デバイス管理マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('operator_ques') }}"
                                        class="nav-link @if($current === 'operator_ques') active @endif">
                                        <i class="nav-icon"></i>
                                        <span style="margin-left:20px;">{{ __("オペレータキュー") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('settings') }}"
                                        class="nav-link @if($current === 'settings') active @endif">
                                        <i class="nav-icon"></i>
                                        <span style="margin-left:20px;">{{ __("設定マスタ") }}</span>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="{{ route('mail_templates') }}"
                                        class="nav-link @if($current === 'mail_templates') active @endif">
                                        <span style="margin-left:20px;">{{ __("メール送信テンプレート") }}</span>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        @php
                            // マスタ管理：ルート名がここに含まれている場合、展開＆ハイライト
                            $masterRoutes = [
                                'inv_settings',
                            ];
                            $current = app('router')->currentRouteName();
                        @endphp

                        <!-- マスタ管理 -->
                        <li class="nav-item has-treeview @if(in_array($current, $masterRoutes)) menu-open @endif">
                            <a href="#" class="nav-link @if(in_array($current, $masterRoutes)) active @endif">
                                <i class="nav-icon fa fa-object-group"></i>
                                <p>
                                    {{ __("マスタ管理") }}
                                    <i class="right fa fa-angle-down"></i>
                                </p>
                            </a>
                            <ul class="nav nav-treeview"
                                style="display: @if(in_array($current, $masterRoutes)) block @else none @endif;">
                                <li class="nav-item">
                                    <a href="{{ route('inv_settings') }}"
                                        class="nav-link @if($current === 'inv_settings') active @endif">
                                        <span style="margin-left:20px;">{{ __("インボイス設定") }}</span>
                                    </a>
                                </li>
                            </ul>
                        </li>

                        <!-- kin end -->
                        <!-- OU END -->

                    </ul>
                    </li>

                    </ul>
                </nav>
                <!-- /.sidebar-menu -->
            </div>
            <!-- /.sidebar -->
        </aside>

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            @yield('content')
        </div>
        <!-- /.content-wrapper -->

        @stack('scripts')

        <!-- Main Footer -->
        <footer class="main-footer" style="margin-left:270px;">
            <strong>Copyright &copy; 2018 <a href="./index2.html">So-Manager for back office by so-rin
                    Co.,Ltd.</a></strong> All rights reserved.
        </footer>

        <!-- Control Sidebar -->
        <aside class="control-sidebar control-sidebar-dark">
            <!-- Control sidebar content goes here -->
        </aside>
        <!-- /.control-sidebar -->
    </div>
    <!-- ./wrapper -->

    <!-- jQuery -->
    <script src="{{ asset('plugins/jquery/jquery.min.js') }}"></script>
    <!-- Bootstrap 4 -->
    <script src="{{ asset('plugins/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
    <!-- Select2 -->
    <script src="{{ asset('plugins/select2/select2.full.min.js') }}"></script>
    <!-- InputMask -->
    <script src="{{ asset('plugins/input-mask/jquery.inputmask.js') }}"></script>
    <script src="{{ asset('plugins/input-mask/jquery.inputmask.date.extensions.js') }}"></script>
    <script src="{{ asset('plugins/input-mask/jquery.inputmask.extensions.js') }}"></script>
    <!-- date-range-picker -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
    <script src="{{ asset('plugins/daterangepicker/daterangepicker.js') }}"></script>
    <script src="{{ asset('plugins/datepicker/bootstrap-datepicker.js') }}"></script>
    <script src="{{ asset('plugins/datepicker/locales/bootstrap-datepicker.ja.js') }}"></script>

    <!-- bootstrap color picker -->
    <script src="{{ asset('plugins/colorpicker/bootstrap-colorpicker.min.js') }}"></script>
    <!-- bootstrap time picker -->
    <script src="{{ asset('plugins/timepicker/bootstrap-timepicker.min.js') }}"></script>
    <!-- SlimScroll 1.3.0 -->
    <script src="{{ asset('plugins/slimScroll/jquery.slimscroll.min.js') }}"></script>
    <!-- iCheck 1.0.1 -->
    <script src="{{ asset('plugins/iCheck/icheck.min.js') }}"></script>
    <!-- FastClick -->
    <script src="{{ asset('plugins/fastclick/fastclick.js') }}"></script>
    <!-- AdminLTE App -->
    <script src="{{ asset('dist/js/adminlte.min.js') }}"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="{{ asset('dist/js/demo.js') }}"></script>
    <!-- Page script -->
    <script>
        $(function () {
            //Initialize Select2 Elements
            $('.select2').select2();

            //Datemask dd/mm/yyyy
            $('#datemask').inputmask('dd/mm/yyyy', { 'placeholder': 'dd/mm/yyyy' })
            //Datemask2 mm/dd/yyyy
            $('#datemask2').inputmask('mm/dd/yyyy', { 'placeholder': 'mm/dd/yyyy' })
            //Money Euro
            $('[data-mask]').inputmask()

            //Date range picker
            $('#reservation').daterangepicker()
            //Date range picker with time picker
            $('#reservationtime').daterangepicker({
                timePicker: true,
                timePickerIncrement: 30,
                format: 'MM/DD/YYYY h:mm A'
            })
            //Date range as a button
            $('#daterange-btn').daterangepicker(
                {
                    ranges: {
                        '今日': [moment(), moment()],
                        '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                        '最新の１週間': [moment().subtract(6, 'days'), moment()],
                        '最新の30日': [moment().subtract(29, 'days'), moment()],
                        '今月': [moment().startOf('month'), moment().endOf('month')],
                        '先月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
                    },
                    startDate: moment().subtract(29, 'days'),
                    endDate: moment()
                },
                function (start, end) {
                    $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'))
                }
            )

            //iCheck for checkbox and radio inputs
            $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
                checkboxClass: 'icheckbox_minimal-blue',
                radioClass: 'iradio_minimal-blue'
            })
            //Red color scheme for iCheck
            $('input[type="checkbox"].minimal-red, input[type="radio"].minimal-red').iCheck({
                checkboxClass: 'icheckbox_minimal-red',
                radioClass: 'iradio_minimal-red'
            })
            //Flat red color scheme for iCheck
            $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
                checkboxClass: 'icheckbox_flat-green',
                radioClass: 'iradio_flat-green'
            })

            //Colorpicker
            $('.my-colorpicker1').colorpicker()
            //color picker with addon
            $('.my-colorpicker2').colorpicker()

            //Timepicker
            $('.timepicker').timepicker({
                showInputs: false
            })
        });
    </script>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}" defer></script>

    <style>
        .main-sidebar {
            width: 280px;
        }

        .content-wrapper {
            margin-left: 280px;
        }
    </style>
</body>

</html>