<script setup lang="ts">
import { watch } from 'vue';
import { useRoute } from 'vue-router';
import { RouterLink } from 'vue-router'
import Icon from '@/assets/images/pln-with-text.png';
import { ref } from 'vue'
import {
    Dialog,
    DialogPanel,
    Disclosure,
    DisclosureButton,
    DisclosurePanel,
    TransitionChild,
    TransitionRoot,
} from '@headlessui/vue'

import {
    BoltIcon,
    Cog6ToothIcon,
    ComputerDesktopIcon,
    DocumentDuplicateIcon,
    DocumentTextIcon,
    FolderArrowDownIcon,
    FolderOpenIcon,
    ShieldCheckIcon,
    XMarkIcon
} from '@heroicons/vue/24/solid'

const navigation = [

    {
        name: 'Daftar Transaksi',
        icon: DocumentDuplicateIcon,
        href: '/daftar-transaksi',
        children: [
            { name: 'Transaksi Aktif Individual', href: '/daftar-transaksi/aktif-bulanan', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Transaksi Aktif PLN Mobile', href: '/daftar-transaksi/aktif-pln-mobile', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Transaksi Aktif Periksa dan Return Order', href: '/daftar-transaksi/periksa-return-order', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Transaksi Aktif TM', href: '/daftar-transaksi/aktif-tm', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Transaksi Aktif Historis', href: '/daftar-transaksi/aktif-historis', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring Alih Unit', href: '/daftar-transaksi/monitoring-alih-unit', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring All', href: '/daftar-transaksi/monitoring-all', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring Tiket', href: '/daftar-transaksi/monitoring-tiket', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring History', href: '/daftar-transaksi/monitoring-history', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring Aktif', href: '/daftar-transaksi/monitoring-aktif', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring Close di CC', href: '/daftar-transaksi/monitoring-close-cc', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring Log AutoDispatch', href: '/daftar-transaksi/monitoring-log-autodispatch', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring Yang Perlu Diperhatikan', href: '/daftar-transaksi/monitoring-perlu-diperhatikan', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring Log Break Regu', href: '/daftar-transaksi/monitoring-log-break-regu', icon: DocumentDuplicateIcon, children: [], },
            { name: 'Monitoring Log Alih Regu', href: '/daftar-transaksi/monitoring-log-alih-regu', icon: DocumentDuplicateIcon, children: [], },
        ],
    },
    {
        name: 'Administration',
        icon: ShieldCheckIcon,
        href: '/administration',
        children: [
            {
                name: 'Audit Trails',
                icon: ShieldCheckIcon,
                href: '/administration/audit-trails',
                children: [
                    {
                        name: 'Log Login',
                        href: '/administration/audit-trails/log-login',
                        icon: ShieldCheckIcon,
                        children: [],
                    },
                    {
                        name: 'Log Activity',
                        href: '/administration/audit-trails/log-aktivity',
                        icon: ShieldCheckIcon,
                        children: [],
                    },
                    {
                        name: 'Log Error',
                        href: '/administration/audit-trails/log-error',
                        icon: ShieldCheckIcon,
                        children: [],
                    },
                ],
            },
            {
                name: 'Task Management',
                icon: ShieldCheckIcon,
                href: '/administration/task-management',
                children: [
                    { name: 'Menu Management', href: '/administration/task-management/menu-management', icon: ShieldCheckIcon, children: [], },
                    { name: 'System Parameter', href: '/administration/task-management/system-parameter', icon: ShieldCheckIcon, children: [], },
                    { name: 'User Profile Manager', href: '/administration/task-management/ubah-profile-manager', icon: ShieldCheckIcon, children: [], },
                    { name: 'Security Projek', href: '/administration/task-management/security-projek', icon: ShieldCheckIcon, children: [], },
                    { name: 'User Role Manager', href: '/administration/task-management/user-role-manager', icon: ShieldCheckIcon, children: [], },
                    { name: 'Menu Authorization', href: '/administration/task-management/menu-authorization', icon: ShieldCheckIcon, children: [], },
                    { name: 'Workflow Designer', href: '/administration/task-management/workflow-designer', icon: ShieldCheckIcon, children: [], },
                    { name: 'APKT News', href: '/administration/task-management/apkt-news', icon: ShieldCheckIcon, children: [], },
                ],
            },
            {
                name: 'Master Borderless',
                icon: ShieldCheckIcon,
                href: '/administration/master-borderless',
                children: [
                    { name: 'Zone Borderless', href: '/administration/master-borderless/zone-borderless', icon: ShieldCheckIcon, children: [], },
                    { name: 'User Zone Borderless', href: '/administration/master-borderless/user-zone-borderless', icon: ShieldCheckIcon, children: [], },
                ],
            },
        ],
    },
    {
        name: 'Master Yantek',
        icon: FolderOpenIcon,
        href: '/master-yantek',
        children: [
            { name: 'Unit', href: '/master-yantek/unit', icon: FolderOpenIcon, children: [], },
            { name: 'Unit Jaringan', href: '/master-yantek/unit-jaringan', icon: FolderOpenIcon, children: [], },
            { name: 'Unit Pelayanan', href: '/master-yantek/unit-pelayanan', icon: FolderOpenIcon, children: [], },
            { name: 'Regu Yantek', href: '/master-yantek/regu-yantek', icon: FolderOpenIcon, children: [], },
            { name: 'Gardu Induk', href: '/master-yantek/gardu-induk', icon: FolderOpenIcon, children: [], },
            { name: 'Gardu Penyulang TM', href: '/master-yantek/gardu-penyulang-tm', icon: FolderOpenIcon, children: [], },
            { name: 'Gardu Distribusi', href: '/master-yantek/gardu-distribusi', icon: FolderOpenIcon, children: [], },
            { name: 'Group Gangguan', href: '/master-yantek/group-gangguan', icon: FolderOpenIcon, children: [], },
            { name: 'Wilayah Yantek', href: '/master-yantek/wilayah-yantek', icon: FolderOpenIcon, children: [], },
            { name: 'Material', href: '/master-yantek/material', icon: FolderOpenIcon, children: [], },
        ],
    },
    {
        name: 'Transaksi',
        icon: DocumentTextIcon,
        href: '/transaksi',
        children: [
            { name: 'Gangguan dan Keluhan', href: '/transaksi/gangguan-dan-keluhan', icon: DocumentTextIcon, children: [], },
            { name: 'Gangguan Tegangan Menengah', href: '/transaksi/gangguan-tegangan-menengah', icon: DocumentTextIcon, children: [], },
            { name: 'Pemadaman Terencana', href: '/transaksi/pemadaman-terencana', icon: DocumentTextIcon, children: [], },
            { name: 'Aplikasi Off-Line', href: '/transaksi/aplikasi-off-line', icon: DocumentTextIcon, children: [], },
            { name: 'Penugasan Khusus', href: '/transaksi/penugasan-khusus', icon: DocumentTextIcon, children: [], },
            { name: 'Mutasi Pengaduan', href: '/transaksi/mutasi-pengaduan', icon: DocumentTextIcon, children: [], },
        ],
    },
    {
        name: 'Saidi Saifi',
        icon: ComputerDesktopIcon,
        href: '/saidi-saifi',
        children: [
            {
                name: 'Monitor Jaringan',
                icon: ComputerDesktopIcon,
                href: '/saidi-saifi/monitor-jaringan',
                children: [
                    {
                        name: 'Dashboard Asset',
                        href: '/saidi-saifi/monitor-jaringan/dashboard-asset',
                        icon: ComputerDesktopIcon,
                        children: [],
                    },
                    {
                        name: 'Manuver Topologi Jaringan',
                        href: '/saidi-saifi/monitor-jaringan/manuver-topologi-jaringan',
                        icon: ComputerDesktopIcon,
                        children: [],
                    },
                    {
                        name: 'Pencarian Segment Jaringan',
                        href: '/saidi-saifi/monitor-jaringan/pencarian-segment-jaringan',
                        icon: ComputerDesktopIcon,
                        children: [],
                    },
                    {
                        name: 'Penormalan Manuver Jaringan',
                        href: '/saidi-saifi/monitor-jaringan/penormalan-manuver-jaringan',
                        icon: ComputerDesktopIcon,
                        children: [],
                    },
                    {
                        name: 'Pindah Jaringan',
                        href: '/saidi-saifi/monitor-jaringan/pindah-jaringan',
                        icon: ComputerDesktopIcon,
                        children: [],
                    },
                ],
            },
            {
                name: 'Monitoring SCADA',
                icon: ComputerDesktopIcon,
                href: '/saidi-saifi/monitor-scada/',
                children: [
                    { name: 'Monitoring Mapping Database', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Monitoring Log SCADA', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Gardu Induk', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Feeder', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Zona', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Lateral', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Section', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Segment', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Sub Lateral', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Gardu Distribusi', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Trafo', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Mapping Jurusan', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Monitoring Integrasi ????', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Monitoring Integrasi per No Tiang', href: '/saidi-saifi/monitor-scada/', icon: ComputerDesktopIcon, children: [], },
                ],
            },
            {
                name: 'Master Jaringan',
                icon: ComputerDesktopIcon,
                href: '/saidi-saifi/master-jaringan/',
                children: [
                    { name: 'Master Gardu Induk', href: '/saidi-saifi/master-jaringan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Feeder', href: '/saidi-saifi/master-jaringan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Zona', href: '/saidi-saifi/master-jaringan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Section', href: '/saidi-saifi/master-jaringan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Segement', href: '/saidi-saifi/master-jaringan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Lateral', href: '/saidi-saifi/master-jaringan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Gardu Distribusi', href: '/saidi-saifi/master-jaringan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Switch', href: '/saidi-saifi/master-jaringan/', icon: ComputerDesktopIcon, children: [], },
                ],
            },
            {
                name: 'Master Perhitungan',
                icon: ComputerDesktopIcon,
                href: '/saidi-saifi/master-perhitungan/',
                children: [
                    { name: 'Master Asumsi', href: '/saidi-saifi/master-perhitungan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Asumsi Salatiga', href: '/saidi-saifi/master-perhitungan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Master Faktor Daya & Beban', href: '/saidi-saifi/master-perhitungan/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Data III-09', href: '/saidi-saifi/master-perhitungan/', icon: ComputerDesktopIcon, children: [], },
                ],
            },
            {
                name: 'Laporan Saidi Saifi',
                icon: ComputerDesktopIcon,
                href: '/saidi-saifi/laporan-saidi-saifi/',
                children: [
                    { name: 'Laporan Saidi Saifi per Penyulang', href: '/saidi-saifi/laporan-saidi-saifi/', icon: ComputerDesktopIcon, children: [], },
                ],
            },
            {
                name: 'Pelanggan Prioritas',
                icon: ComputerDesktopIcon,
                href: '/saidi-saifi/pelanggan-prioritas/',
                children: [
                    { name: 'Daftar Pelanggan Prioritas', href: '/saidi-saifi/pelanggan-prioritas/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Monitoring Pelanggan Prioritas', href: '/saidi-saifi/pelanggan-prioritas/', icon: ComputerDesktopIcon, children: [], },
                ],
            },
            {
                name: 'Koreksi dan Cleansing',
                icon: ComputerDesktopIcon,
                href: '/saidi-saifi/koreksi-dan-cleansing/',
                children: [
                    { name: 'Monitoring Koreksi dan Cleansing', href: '/saidi-saifi/koreksi-dan-cleansing/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Koreksi Transaksi Individual', href: '/saidi-saifi/koreksi-dan-cleansing/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Koreksi dan Cleansing TM', href: '/saidi-saifi/koreksi-dan-cleansing/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Koreksi Kode Gangguan dan ANEV', href: '/saidi-saifi/koreksi-dan-cleansing/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Laporan Koreksi dan Cleansing', href: '/saidi-saifi/koreksi-dan-cleansing/', icon: ComputerDesktopIcon, children: [], },
                    { name: 'Delegasi Koreksi dan Cleansing', href: '/saidi-saifi/koreksi-dan-cleansing/', icon: ComputerDesktopIcon, children: [], },
                ],
            },
        ],
    },
    {
        name: 'Utility',
        icon: BoltIcon,
        href: '/utility',
        children: [
            { name: 'Piket Obank', href: '/utility/piket-obank', icon: BoltIcon, children: [], },
        ],
    },
    {
        name: 'EIS',
        icon: FolderArrowDownIcon,
        href: '/eis',
        children: [],
    },
    {
        name: 'Pengaturan',
        icon: Cog6ToothIcon,
        href: '/pengaturan',
        children: [
            { name: 'Ganti Password', href: '/pengaturan/gantu-password', icon: Cog6ToothIcon, children: [], },
        ],
    },
]

const route = useRoute();
const menuSelected = ref(route.fullPath);

watch(route, (to, _) => {
    menuSelected.value = to.fullPath
});

const isMenu = (name: string) => {
    return menuSelected.value === name
}

const props = defineProps({
    sideBarStatus: Boolean,
});
const emits = defineEmits(['onChangeSideBarStatus']);
const localSideBarStatus = ref(props.sideBarStatus)

function closeSideBar() {
    localSideBarStatus.value = false;
    emits('onChangeSideBarStatus', false);
};
</script>
<template>
    <TransitionRoot as="template" :show="sideBarStatus">
        <Dialog as="div" class="relative z-40 md:hidden" @close="closeSideBar">
            <TransitionChild as="template" enter="transition-opacity ease-linear duration-300" enter-from="opacity-0"
                enter-to="opacity-100" leave="transition-opacity ease-linear duration-300" leave-from="opacity-100"
                leave-to="opacity-0">
                <div class="fixed inset-0 bg-gray-600 bg-opacity-75" />
            </TransitionChild>

            <div class="fixed inset-0 z-40 flex">
                <TransitionChild as="template" enter="transition ease-in-out duration-300 transform"
                    enter-from="-translate-x-full" enter-to="translate-x-0"
                    leave="transition ease-in-out duration-300 transform" leave-from="translate-x-0"
                    leave-to="-translate-x-full">
                    <DialogPanel class="relative flex flex-col flex-1 w-full max-w-xs pt-5 pb-4 bg-white">
                        <TransitionChild as="template" enter="ease-in-out duration-300" enter-from="opacity-0"
                            enter-to="opacity-100" leave="ease-in-out duration-300" leave-from="opacity-100"
                            leave-to="opacity-0">
                            <div class="absolute top-0 right-0 pt-2 -mr-12">
                                <button type="button"
                                    class="flex items-center justify-center w-10 h-10 ml-1 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white"
                                    @click="closeSideBar">
                                    <span class="sr-only">Close sidebar</span>
                                    <XMarkIcon class="w-6 h-6 text-white" aria-hidden="true" />
                                </button>
                            </div>
                        </TransitionChild>
                        <div class="flex items-center flex-shrink-0 px-4">
                            <img class="w-auto h-16" :src="Icon" alt="PLN" />
                        </div>
                        <div class="flex-1 h-0 mt-5 overflow-y-auto">
                            <nav class="px-2 space-y-1">
                                <RouterLink v-for="item in navigation" :key="item.name" :to="item.href"
                                    :class="[isMenu(item.href) ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', 'group flex items-center px-2 py-2 text-base font-medium rounded-md']">
                                    <component :is="item.icon"
                                        :class="[isMenu(item.href) ? 'text-gray-500' : 'text-gray-400 group-hover:text-gray-500', 'mr-4 flex-shrink-0 h-6 w-6']"
                                        aria-hidden="true" />
                                    {{ item.name }}
                                </RouterLink>
                            </nav>
                        </div>
                    </DialogPanel>
                </TransitionChild>
                <div class="flex-shrink-0 w-14" aria-hidden="true">
                    <!-- Dummy element to force sidebar to shrink to fit close icon -->
                </div>
            </div>
        </Dialog>
    </TransitionRoot>
    <!-- Static sidebar for desktop -->
    <div class="z-10 hidden bg-gray-600 md:fixed md:inset-y-0 md:flex md:w-80 md:flex-col">
        <!-- Sidebar component, swap this element with another sidebar if you like -->
        <div class="flex items-center flex-shrink-0 h-16 px-5">
            <img class="w-auto h-11" :src="Icon" alt="PLN" />
        </div>
        <div class="flex flex-col flex-grow bg-gray-600 hover:overflow-y-auto">
            <div class="flex flex-col flex-grow mt-5 ">
                <nav class="flex-1 px-2 pb-4 space-y-1">
                    <template v-for="item in navigation" :key="item.name">
                        <div v-if="!item.children || item.children.length === 0">
                            <!-- Single-level item -->
                            <RouterLink :to="item.href"
                                :class="[isMenu(item.href) ? 'bg-primary-500 text-white font-medium' : 'text-gray-500 hover:bg-primary-100 hover:text-gray-900', 'group w-full flex items-center pl-2 py-2 text-xs font-medium rounded-md']">
                                <component :is="item.icon"
                                    :class="[isMenu(item.href) ? 'text-white' : 'text-gray-500 group-hover:text-gray-900', 'mr-3 flex-shrink-0 h-6 w-6']"
                                    aria-hidden="true" />
                                {{ item.name }}
                            </RouterLink>
                        </div>

                        <Disclosure v-else
                            v-bind:default-open="item.children.find((d) => d.href === menuSelected) || item.children.find((d) => d.children.find((e) => e.href === menuSelected)) ? true : false">
                            <!-- Nested item with children -->
                            <template v-slot="{ open }">
                                <DisclosureButton
                                    :class="[item.children.find((d) => d.href === menuSelected) || item.children.find((d) => d.children.find((e) => e.href === menuSelected)) ? 'text-primary-500 font-medium' : 'text-gray-500 hover:bg-primary-100 hover:text-gray-900', 'group w-full flex items-center pl-2 pr-1 py-2 text-left text-xs font-medium rounded-md focus:outline-none focus:ring-0 focus:ring-indigo-500']">
                                    <component :is="item.icon"
                                        :class="[item.children.find((d: any) => d.href === menuSelected) || item.children.find((d) => d.children.find((e) => e.href === menuSelected)) ? 'text-primary-500' : 'text-gray-400 group-hover:text-gray-500', 'flex-shrink-0 w-6 h-6 mr-3']"
                                        aria-hidden="true" />
                                    <span class="flex-1">{{ item.name }}</span>

                                    <svg :class="[item.children.find((d: any) => d.href === menuSelected) || item.children.find((d) => d.children.find((e) => e.href === menuSelected)) ? 'text-primary-500' : 'text-gray-300 group-hover:text-gray-500', open ? 'rotate-180' : '', 'ml-3 flex-shrink-0 transform transition-colors duration-150 ease-in-out ']"
                                        width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true">
                                        <path
                                            d="M4.44002 8.9399C4.72127 8.659 5.10252 8.50122 5.50002 8.50122C5.89752 8.50122 6.27877 8.659 6.56002 8.9399L12 14.3799L17.44 8.9399C17.7244 8.67494 18.1005 8.53069 18.4891 8.53755C18.8777 8.54441 19.2484 8.70183 19.5233 8.97666C19.7981 9.25148 19.9555 9.62225 19.9624 10.0109C19.9692 10.3995 19.825 10.7756 19.56 11.0599L13.06 17.5599C12.7788 17.8408 12.3975 17.9986 12 17.9986C11.6025 17.9986 11.2213 17.8408 10.94 17.5599L4.44002 11.0599C4.15912 10.7787 4.00134 10.3974 4.00134 9.9999C4.00134 9.6024 4.15912 9.22115 4.44002 8.9399Z"
                                            :fill="item.children.find((d: any) => d.href === menuSelected) || item.children.find((d) => d.children.find((e) => e.href === menuSelected)) ? '#14A2BA' : '#647375'" />
                                    </svg>
                                </DisclosureButton>

                                <DisclosurePanel class="space-y-1">
                                    <!-- Nested children -->
                                    <template v-for="subItem in item.children" :key="subItem.name">
                                        <div v-if="!subItem.children || subItem.children.length === 0">
                                            <!-- Single-level child -->
                                            <RouterLink :to="subItem.href"
                                                :class="[isMenu(subItem.href) ? 'text-white font-medium bg-primary-500' : 'text-gray-500 hover:bg-primary-100 hover:text-gray-900', 'flex items-center w-11/12 py-2 px-2 text-xs font-medium rounded-md group ml-auto']">
                                                {{ subItem.name }}
                                            </RouterLink>
                                        </div>
                                        <Disclosure v-else
                                            :default-open="subItem.children.find((d: any) => d.href === menuSelected) ? true : false">
                                            <!-- Nested child with children -->
                                            <template v-slot="{ open }">
                                                <DisclosureButton
                                                    :class="[subItem.children.find((d: any) => d.href === menuSelected) ? 'text-primary-500 font-medium' : 'text-gray-500 hover:bg-primary-100 hover:text-gray-900', 'group w-11/12 flex items-center px-2 py-2 text-left text-xs font-medium rounded-md focus:outline-none focus:ring-0 focus:ring-indigo-500 ml-auto']">

                                                    <span class="flex-1">{{ subItem.name }}</span>

                                                    <svg :class="[subItem.children.find((d: any) => d.href === menuSelected) ? 'text-primary-500' : 'text-gray-300 group-hover:text-gray-500', open ? 'rotate-180' : '', 'ml-3 flex-shrink-0 transform transition-colors duration-150 ease-in-out ']"
                                                        width="16" height="16" viewBox="0 0 24 24" fill="none"
                                                        aria-hidden="true">
                                                        <path
                                                            d="M4.44002 8.9399C4.72127 8.659 5.10252 8.50122 5.50002 8.50122C5.89752 8.50122 6.27877 8.659 6.56002 8.9399L12 14.3799L17.44 8.9399C17.7244 8.67494 18.1005 8.53069 18.4891 8.53755C18.8777 8.54441 19.2484 8.70183 19.5233 8.97666C19.7981 9.25148 19.9555 9.62225 19.9624 10.0109C19.9692 10.3995 19.825 10.7756 19.56 11.0599L13.06 17.5599C12.7788 17.8408 12.3975 17.9986 12 17.9986C11.6025 17.9986 11.2213 17.8408 10.94 17.5599L4.44002 11.0599C4.15912 10.7787 4.00134 10.3974 4.00134 9.9999C4.00134 9.6024 4.15912 9.22115 4.44002 8.9399Z"
                                                            :fill="subItem.children.find((d: any) => d.href === menuSelected) ? '#14A2BA' : '#647375'" />
                                                    </svg>
                                                </DisclosureButton>
                                                <DisclosurePanel class="space-y-1 pl-11">
                                                    <!-- Nested children of nested child -->
                                                    <RouterLink v-for="nestedSubItem in subItem.children"
                                                        :key="nestedSubItem.name" :to="nestedSubItem.href"
                                                        :class="[isMenu(nestedSubItem.href) ? 'text-white font-medium bg-primary-500' : 'text-gray-500 hover:bg-primary-100 hover:text-gray-900', 'flex items-center w-12/12 py-2 px-2 text-xs font-medium rounded-md group ml-auto']">
                                                        {{ nestedSubItem.name }}
                                                    </RouterLink>
                                                </DisclosurePanel>
                                            </template>

                                        </Disclosure>
                                    </template>
                                </DisclosurePanel>
                            </template>
                        </Disclosure>


                    </template>

                </nav>
            </div>
        </div>
    </div>
</template>