import{jsxs as n,jsx as t}from"react/jsx-runtime";import{u as b,d,e as l,S as y,f as v,g as T,h as w,i as k,A as C,j as N,N as A,k as M,l as x,m as I,n as D,o as L}from"./app-sidebar-header-BX2s-HO_.js";import{LayoutGrid as P,UsersRound as c,Wallet as U,Gamepad2 as j,Server as F,Shield as G,Swords as R,Newspaper as B,Download as E,Ticket as H,ShoppingCart as V,Gift as z,CalendarDays as W,Settings as _}from"lucide-react";import{usePage as p,Link as q}from"@inertiajs/react";import{useEffect as h}from"react";import{T as J}from"./toaster-DuLpwsc2.js";import{toast as a}from"sonner";const K=(r,i)=>r.filter(e=>i.includes(e.permission)).map(e=>e.item),O=[{title:"Dashboard",href:"/admin",icon:P},{title:"Manage",href:"#",icon:c,items:[{title:"Users",href:"/admin/manage/users"},{title:"Characters",href:"/admin/manage/characters"},{title:"Factions",href:"/admin/manage/factions"},{title:"GM",href:"/admin/manage/gm"},{title:"Streamer",href:"/admin/manage/streamer"},{title:"Item Templates",href:"/admin/manage/item-template"}]},{title:"Top Up",href:"#",icon:U,items:[{title:"All Transactions",href:"/admin/topup/transaction"},{title:"Ipaymu",href:"/admin/topup/ipaymu"},{title:"Duitku",href:"/admin/topup/duitku"},{title:"Tripay",href:"/admin/topup/tripay"},{title:"Pakasir",href:"/admin/topup/pakasir"},{title:"Promo Codes",href:"/admin/topup/promo"}]},{title:"Ingame Service",href:"#",icon:j,items:[{title:"Settings",href:"/admin/manage-ingame"}]},{title:"Server Control",href:"/admin/servercontrol",icon:F},{title:"Backup",href:"/admin/backup",icon:G},{title:"System",href:"#",icon:R,items:[{title:"PVP",href:"/admin/system/pvp"},{title:"Broadcast",href:"/admin/system/broadcast"},{title:"Refine",href:"/admin/system/refine"},{title:"Chat",href:"/admin/system/chat"},{title:"Logs",href:"/admin/system/logs"}]},{title:"News",href:"/admin/news",icon:B},{title:"Download",href:"/admin/download",icon:E},{title:"Voucher",href:"/admin/vouchers",icon:H},{title:"Shop",href:"/admin/shop",icon:V},{title:"Reward",href:"#",icon:z,items:[{title:"Top Spender",href:"/admin/reward/topspender"}]},{title:"Event",href:"/admin/event",icon:W},{title:"Settings",href:"#",icon:_,items:[{title:"Server",href:"/admin/settings/server"},{title:"Server Rates",href:"/admin/settings/exprate"},{title:"Menu",href:"/admin/settings/apps"},{title:"Theme",href:"/admin/settings/theme"},{title:"File Upload",href:"/admin/settings/upload"}]}],Q=[{permission:"manage_users",item:{title:"Manage Users",href:"/admin/manage/users",icon:c}}];function X(){const{auth:r}=p().props,{theme:i}=b(),e=typeof r?.user?.role=="object"&&r?.user?.role?.permissions?r.user.role.permissions.map(g=>g.name):[],f=K(Q,e),u=[...O,...f];h(()=>{i?.colors?d(i.colors,i.respectsSystemTheme):d(l,!0)},[i]);const s=i?.colors??l,o=i?.respectsSystemTheme??!0,S=o?{}:{backgroundColor:s.background,color:s.foreground},m=o?{}:{borderColor:s.border};return n(y,{collapsible:"icon",variant:"sidebar",style:S,children:[t(v,{style:m,children:t(T,{children:t(w,{children:t(k,{size:"lg",asChild:!0,children:t(q,{href:"/admin",prefetch:!0,children:t(C,{})})})})})}),t(N,{children:t(A,{items:u})}),t(M,{style:m,children:t(x,{})})]})}function Y({children:r,breadcrumbs:i=[]}){const{flash:e}=p().props;return h(()=>{e?.success&&a.success(e.success),e?.error&&a.error(e.error),e?.info&&a.info(e.info),e?.warning&&a.warning(e.warning)},[e]),n(I,{variant:"sidebar",children:[t(X,{}),n(D,{variant:"sidebar",children:[t(J,{}),t(L,{breadcrumbs:i}),t("div",{className:"flex flex-1 flex-col p-4 md:p-6",children:r})]})]})}const se=({children:r,breadcrumbs:i,...e})=>t(Y,{breadcrumbs:i,...e,children:r});export{se as A};
