(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28175,(e,l,s)=>{l.exports=e.r(37073)},64240,e=>{"use strict";var l=e.i(2732),s=e.i(52313),t=e.i(28175);function r({children:e}){let r=(0,t.useRouter)(),a=(0,t.usePathname)(),[n,i]=(0,s.useState)(!1),[o,c]=(0,s.useState)(null),[d,b]=(0,s.useState)(null),[m,h]=(0,s.useState)(!1),x=(0,s.useMemo)(()=>o?.name||o?.sellerId||"Seller",[o]);(0,s.useEffect)(()=>{try{let e=localStorage.getItem("seller_session_v1");c(e?JSON.parse(e):null),b(localStorage.getItem("seller_token_v1"))}catch{c(null),b(null)}finally{i(!0)}},[]),(0,s.useEffect)(()=>{!n||"/seller/login"!==a&&(o&&d||r.replace("/seller/login"))},[n,o,d,a,r]),(0,s.useEffect)(()=>{h(!1)},[a]);let u=()=>{localStorage.removeItem("seller_session_v1"),localStorage.removeItem("seller_token_v1"),document.cookie="seller_token_v1=; Max-Age=0; path=/",document.cookie="seller_session_v1=; Max-Age=0; path=/",r.replace("/seller/login")};if(!n)return(0,l.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."});if("/seller/login"===a)return(0,l.jsx)(l.Fragment,{children:e});let p=(0,l.jsxs)("div",{className:"h-full bg-white border-r border-black/10",children:[(0,l.jsxs)("div",{className:"p-2 border-b border-black/10",children:[(0,l.jsx)("div",{className:"text-lg font-bold",children:"Seller Panel"}),(0,l.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:x})]}),(0,l.jsx)("nav",{className:"p-3 space-y-2",children:(0,l.jsx)("a",{href:"/seller/inbox",className:"block px-4 py-3 rounded hover:bg-black hover:text-white transition",children:"📥 Inbox"})}),(0,l.jsx)("div",{className:"p-3",children:(0,l.jsx)("button",{onClick:u,className:"w-full px-4 py-3 rounded border border-black/20 hover:bg-black hover:text-white transition",children:"Logout"})})]});return(0,l.jsxs)("div",{className:"min-h-screen bg-gray-100",children:[(0,l.jsx)("div",{className:"md:hidden sticky top-0 z-40 border-b bg-white",children:(0,l.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,l.jsx)("button",{type:"button",onClick:()=>h(!0),className:"inline-flex items-center gap-2 rounded-md border border-black/10 px-3 py-2 text-sm hover:bg-black hover:text-white transition","aria-label":"Open menu",children:"☰ Menu"}),(0,l.jsx)("div",{className:"text-sm font-semibold",children:"Seller Panel"}),(0,l.jsx)("button",{type:"button",onClick:u,className:"inline-flex items-center gap-2 rounded-md border border-black/10 px-3 py-2 text-sm hover:bg-black hover:text-white transition",children:"Logout"})]})}),m&&(0,l.jsxs)("div",{className:"md:hidden fixed inset-0 z-50",children:[(0,l.jsx)("div",{className:"absolute inset-0 bg-black/40",onClick:()=>h(!1)}),(0,l.jsxs)("div",{className:"absolute left-0 top-0 h-full w-[82%] max-w-[340px] bg-white shadow-xl border-r border-black/10",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-black/10",children:[(0,l.jsx)("div",{className:"text-sm font-semibold",children:"Menu"}),(0,l.jsx)("button",{type:"button",onClick:()=>h(!1),className:"rounded-md border border-black/10 px-3 py-2 text-sm hover:bg-black hover:text-white transition","aria-label":"Close menu",children:"✕"})]}),(0,l.jsx)("div",{className:"h-[calc(100%-52px)] overflow-y-auto",children:p})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-12",children:[(0,l.jsx)("aside",{className:"hidden md:block md:col-span-3 lg:col-span-2 bg-white border-r border-black/10 min-h-screen sticky top-0",children:(0,l.jsx)("div",{className:"h-screen overflow-y-auto",children:p})}),(0,l.jsx)("main",{className:"col-span-12 md:col-span-9 lg:col-span-10",children:e})]})]})}e.s(["default",()=>r])}]);