1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/js/firebase-B8M_PT7r.js","assets/js/index.esm-BzR8oUpF.js","assets/js/tslib.es6-CwyXKlH1.js"])))=>i.map(i=>d[i]); 2import{c as nt,b as it,r as s,P as lt,j as e,t as ae,w as ye,_ as Fe,D as Le}from"./index-CAG7YFZd.js";import{L as ot}from"./lenis-DhnUlvj-.js";import{C as ct,d as dt}from"./card-BvF4UFhC.js";import{D as mt}from"./date-range-calendar-ChBNtibY.js";import{r as be,b as je}from"./index-BTR0BB7t.js";import{f as xt}from"./restaurantLocation-Du8Hbwol.js";import{b as ut}from"./routes-BHmLUkwU.js";import{e as _e,a as se}from"./firebase-B8M_PT7r.js";import{B as ht}from"./BottomNavOrders-BXBgAO3q.js";import{m as r}from"./proxy-CEtNvAea.js";import{A as Me}from"./arrow-left-CpWyexvK.js";import{S as re}from"./search-B8wRtotC.js";import{S as pt}from"./store-D8T1wOda.js";import{M as ze}from"./map-pin-DAIQP7vC.js";import{L as ft}from"./log-out-Bvp0AVy7.js";import{C as we}from"./chevron-right-DFSfj0ll.js";import{T as Ue}from"./trash-2-Qyy0Wnny.js";import{A as j}from"./index-Vzwk4whn.js";import{U as We}from"./user-Dg1P2vFp.js";import{X as q}from"./x-BCVCJpKG.js";import{S as He}from"./square-pen-CEf7Xw1F.js";import{C as ve}from"./calendar-Cj5amzTI.js";import{C as Ne}from"./clock-D2FeoEC9.js";import{C as gt}from"./circle-check-big-BAIqo4vn.js";import{S as $e}from"./shopping-bag-SSBKU-Q3.js";import{T as Ye}from"./triangle-alert-D_HnsuFj.js";import{I as yt}from"./info-D5gXA3ZG.js";import{S as bt}from"./settings-Dn_VLM_1.js";import{T as jt}from"./truck-C1N1ARaS.js";import{F as wt}from"./file-text-7Q36_7-K.js";import{S as vt}from"./star-DO0qEm9j.js";import{M as Nt}from"./message-square-CvM1eZ_A.js";import{L as kt}from"./life-buoy-CL9VTQU0.js";import{I as St}from"./indian-rupee-CxTvjaab.js";import{R as Ct}from"./receipt-B9wNnK0f.js";import{B as Dt}from"./building-2-DtEkGBWP.js";import"./button-BmbZUr43.js";import"./index-CAaHGHf1.js";import"./index-CBAjRXir.js";import"./index-D9HXKLQ9.js";import"./chevron-left-DosUpr3J.js";import"./circle-check-CVZUOHZZ.js";import"./bell-BZL1M968.js";import"./index.esm-BzR8oUpF.js";import"./tslib.es6-CwyXKlH1.js";import"./useNotificationInbox-D1Wuue8I.js";import"./useRestaurantNotifications-fEhoav24.js";import"./index-BkL6vOXg.js";import"./restaurantOrderPricing-mzi3IFXw.js";import"./package-DNWl5qPR.js";const Tt=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Et=nt("user-round",Tt),ne=(...d)=>{};function qe({isOpen:d,onClose:F,initialHour:L,initialMinute:g,initialPeriod:D,onConfirm:U}){const h=Math.max(1,Math.min(12,parseInt(L)||1)),p=Math.max(0,Math.min(59,parseInt(g)||0)),y=D==="am"||D==="pm"?D:"am",[T,E]=s.useState(h),[_,I]=s.useState(p),[W,A]=s.useState(y),f=s.useRef(null),w=s.useRef(null),v=s.useRef(null),M=Array.from({length:12},(n,x)=>x+1),H=Array.from({length:60},(n,x)=>x),B=["am","pm"];s.useEffect(()=>{d&&(E(h),I(p),A(y))},[d,L,g,D,h,p,y]),s.useEffect(()=>{if(d){document.body.style.overflow="hidden";const n=setTimeout(()=>{const k=80+(h-1)*40;f.current&&(f.current.scrollTop=k,E(h),setTimeout(()=>{f.current?.scrollTo({top:k,behavior:"smooth"})},50));const Y=80+p*40;w.current&&(w.current.scrollTop=Y,I(p),setTimeout(()=>{w.current?.scrollTo({top:Y,behavior:"smooth"})},50));const m=80+B.indexOf(y)*40;v.current&&(v.current.scrollTop=m,A(y),setTimeout(()=>{v.current?.scrollTo({top:m,behavior:"smooth"})},50))},150);return()=>{clearTimeout(n),document.body.style.overflow="unset"}}},[d,h,p,y]);const $=(n,x,N,b)=>{if(!n)return;const k=80,z=b/2,S=n.scrollTop+n.clientHeight/2,m=Math.round((S-k-z)/b),C=Math.max(0,Math.min(m,N.length-1)),R=N[C];R!==void 0&&x(R)},O=(n,x,N,b)=>{if(!n)return;const k=80,z=b/2,S=n.scrollTop+n.clientHeight/2,m=Math.round((S-k-z)/b),C=Math.max(0,Math.min(m,N.length-1)),R=k+C*b;n.scrollTo({top:R,behavior:"smooth"}),N[C]!==void 0&&x(N[C])},V=()=>{const n=T.toString(),x=_.toString().padStart(2,"0");U(n,x,W),F()};return d?e.jsx(j,{children:e.jsx(r.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 z-[9999] flex items-center justify-center p-4",onClick:F,children:e.jsxs(r.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},transition:{type:"spring",damping:25,stiffness:300},className:"bg-white rounded-lg shadow-2xl w-full max-w-xs overflow-hidden",onClick:n=>n.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-center py-8 px-4 relative",children:[e.jsx("style",{children:` 3 .time-picker-scroll::-webkit-scrollbar { 4 display: none; 5 } 6 .time-picker-scroll { 7 -ms-overflow-style: none; 8 scrollbar-width: none; 9 } 10 `}),e.jsx("div",{className:"flex-1 flex flex-col items-center",children:e.jsxs("div",{ref:f,className:"w-full h-48 overflow-y-scroll time-picker-scroll snap-y snap-mandatory",style:{scrollSnapType:"y mandatory",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch"},onScroll:()=>$(f.current,E,M,40),onTouchEnd:()=>O(f.current,E,M,40),children:[e.jsx("div",{className:"h-20"}),M.map(n=>e.jsx("div",{className:"h-10 flex items-center justify-center snap-center",style:{minHeight:"40px"},children:e.jsx("span",{className:`text-lg transition-all duration-200 ${T===n?"font-bold text-gray-900 text-xl":"font-normal text-gray-400 text-base"}`,children:n})},n)),e.jsx("div",{className:"h-20"})]})}),e.jsx("div",{className:"px-2",children:e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:":"})}),e.jsx("div",{className:"flex-1 flex flex-col items-center",children:e.jsxs("div",{ref:w,className:"w-full h-48 overflow-y-scroll time-picker-scroll snap-y snap-mandatory",style:{scrollSnapType:"y mandatory",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch"},onScroll:()=>$(w.current,I,H,40),onTouchEnd:()=>O(w.current,I,H,40),children:[e.jsx("div",{className:"h-20"}),H.map(n=>e.jsx("div",{className:"h-10 flex items-center justify-center snap-center",style:{minHeight:"40px"},children:e.jsx("span",{className:`text-lg transition-all duration-200 ${_===n?"font-bold text-gray-900 text-xl":"font-normal text-gray-400 text-base"}`,children:n.toString().padStart(2,"0")})},n)),e.jsx("div",{className:"h-20"})]})}),e.jsx("div",{className:"flex-1 flex flex-col items-center",children:e.jsxs("div",{ref:v,className:"w-full h-48 overflow-y-scroll time-picker-scroll snap-y snap-mandatory",style:{scrollSnapType:"y mandatory",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch"},onScroll:()=>$(v.current,A,B,40),onTouchEnd:()=>O(v.current,A,B,40),children:[e.jsx("div",{className:"h-20"}),B.map(n=>e.jsx("div",{className:"h-10 flex items-center justify-center snap-center",style:{minHeight:"40px"},children:e.jsx("span",{className:`text-lg transition-all duration-200 ${W===n?"font-bold text-gray-900 text-xl":"font-normal text-gray-400 text-base"}`,children:n.toUpperCase()})},n)),e.jsx("div",{className:"h-20"})]})}),e.jsxs("div",{className:"absolute left-0 right-0 top-1/2 -translate-y-1/2 pointer-events-none",children:[e.jsx("div",{className:"border-t border-gray-300 mx-4"}),e.jsx("div",{className:"border-b border-gray-300 mx-4 mt-10"})]})]}),e.jsx("div",{className:"border-t border-gray-200 px-4 py-4 flex justify-center",children:e.jsx("button",{onClick:V,className:"text-[#B80B3D] hover:text-[#6a2f56] font-bold text-base transition-colors",children:"Okay"})})]})})}):null}function Aa(){const d=it(),F=s.useRef(null),[L,g]=s.useState(!1),[D,U]=s.useState(!1),[h,p]=s.useState(""),[y,T]=s.useState(!1),[E,_]=s.useState(!1),[I,W]=s.useState(!1),[A,f]=s.useState(!1),[w,v]=s.useState(null),[M,H]=s.useState(null),[B,$]=s.useState(null),[O,V]=s.useState({hour:"9",minute:"00",period:"am"}),[n,x]=s.useState({hour:"5",minute:"00",period:"pm"}),[N,b]=s.useState(!1),[k,z]=s.useState(!1),[Y,S]=s.useState(!1),[m,C]=s.useState(null),[R,J]=s.useState(!1),[P,ke]=s.useState(!1),[G,Se]=s.useState(!1),[ie,K]=s.useState(!1),[le,oe]=s.useState(""),[Q,Ce]=s.useState(!1),[ce,X]=s.useState(!1),[De,Ge]=s.useState({balance:0,type:"Restaurant Available Balance"}),[de,Te]=s.useState(!1),Ve=async()=>
10{if(!de){Te(!0);try{const t=await je.checkBalance("restaurant"),a=t?.data?.data??t?.data??{},i=Number(a.balance||0),o=a.type||"Restaurant Available Balance";if(oe(""),i>0){Ge({balance:i,type:o}),X(!0);return}K(!0)}catch(t){ae.error(t?.response?.data?.message||"Could not verify your available balance")}finally{Te(!1)}}},[u,Z]=s.useState(!1),[me,xe]=s.useState(!1),ue="restaurant_schedule_off",[l,Ee]=s.useState(null),[he,Ie]=s.useState(!0);s.useEffect(()=>(L||y||E||I||A||D||me||ce||ie||R?(document.body.style.overflow="hidden",F.current?.stop()):(document.body.style.overflow="unset",F.current?.start()),()=>{document.body.style.overflow="unset",F.current?.start()}),[L,y,E,I,A,D,me,ce,ie,R]),s.useEffect(()=>{const t=async()=>{try{Ie(!0);const i=await be.refreshCurrentRestaurant(),o=i?.data?.data?.restaurant||i?.data?.restaurant;o&&Ee(o)}catch(i){i.code!=="ERR_NETWORK"&&i.code!=="ECONNABORTED"&&i.message?.includes("timeout")}finally{Ie(!1)}};t();const a=()=>{t()};return window.addEventListener("ownerDataUpdated",a),window.addEventListener("addressUpdated",a),()=>{window.removeEventListener("ownerDataUpdated",a),window.removeEventListener("addressUpdated",a)}},[]);const pe=s.useMemo(()=>l?xt(l.location,l):"",[l]),c=s.useMemo(()=>{const t=lt("restaurant");return t&&t.name&&t.role?{name:t.name,phone:t.phone||l?.ownerPhone||l?.phone||"N/A",email:t.email||l?.ownerEmail||l?.email||"N/A",role:t.role.toUpperCase(),profileImage:t.profileImage||l?.profileImage}:l?{name:l.ownerName||l.name||"Restaurant Owner",phone:l.ownerPhone||l.phone||"N/A",email:l.ownerEmail||l.email||"N/A",role:"OWNER",profileImage:l.profileImage}:{name:he?"Loading...":"Restaurant Owner",phone:"",email:"",role:"OWNER"}},[l,he]),Je=l?.name||"Loading...",Ae=async()=>{if(!u){Z(!0),g(!1);try{try{await be.logout()}catch(t){ne("Logout API call failed, continuing with local cleanup:",t)}try{const{signOut:t}=await Fe(async()=>{const{signOut:i}=await import("./firebase-B8M_PT7r.js").then(o=>o.i);return{signOut:i}},__vite__mapDeps([0,1,2]));_e({enableAuth:!0,enableRealtimeDb:!1}),se.currentUser&&await t(se)}catch(t){ne("Firebase logout failed, continuing with local cleanup:",t)}ye("restaurant"),localStorage.removeItem("restaurant_onboarding"),localStorage.removeItem("restaurant_accessToken"),localStorage.removeItem("restaurant_authenticated"),localStorage.removeItem("restaurant_user"),sessionStorage.removeItem("restaurantAuthData"),window.dispatchEvent(new Event("restaurantAuthChanged")),setTimeout(()=>{d("/food/restaurant/login",{replace:!0})},300)}catch{ye("restaurant"),localStorage.removeItem("restaurant_onboarding"),localStorage.removeItem("restaurant_accessToken"),localStorage.removeItem("restaurant_authenticated"),localStorage.removeItem("restaurant_user"),sessionStorage.removeItem("restaurantAuthData"),window.dispatchEvent(new Event("restaurantAuthChanged")),d("/food/restaurant/login",{replace:!0})}finally{Z(!1)}}},Be=async()=>{if(!u){Z(!0),g(!1);try{try{await je.logoutFromAllDevices("restaurant")}catch(t){ne("Logout API call failed, continuing with local cleanup:",t)}try{const{signOut:t}=await Fe(async()=>{const{signOut:i}=await import("./firebase-B8M_PT7r.js").then(o=>o.i);return{signOut:i}},__vite__mapDeps([0,1,2]));_e({enableAuth:!0,enableRealtimeDb:!1}),se.currentUser&&await t(se)}catch(t){ne("Firebase logout failed, continuing with local cleanup:",t)}Le(),localStorage.removeItem("restaurant_onboarding"),sessionStorage.removeItem("restaurantAuthData"),sessionStorage.removeItem("adminAuthData"),sessionStorage.removeItem("deliveryAuthData"),sessionStorage.removeItem("userAuthData"),window.dispatchEvent(new Event("restaurantAuthChanged")),window.dispatchEvent(new Event("adminAuthChanged")),window.dispatchEvent(new Event("deliveryAuthChanged")),window.dispatchEvent(new Event("userAuthChanged")),setTimeout(()=>{d("/food/restaurant/login",{replace:!0})},300)}catch{Le(),localStorage.removeItem("restaurant_onboarding"),sessionStorage.removeItem("restaurantAuthData"),sessionStorage.removeItem("adminAuthData"),sessionStorage.removeItem("deliveryAuthData"),sessionStorage.removeItem("userAuthData"),window.dispatchEvent(new Event("restaurantAuthChanged")),d("/food/restaurant/login",{replace:!0})}finally{Z(!1)}}},Ke=["renovation or relocation of restaurant","closed dur to festival","permanently shut","staff avaibility issues","going out of station","other"];s.useEffect(()=>{try{const t=localStorage.getItem(ue);if(t){const a=JSON.parse(t);a.startDate&&(a.startDate=new Date(a.startDate)),a.endDate&&(a.endDate=new Date(a.endDate)),C(a)}}catch{}},[]);const Oe=()=>{try{const t=localStorage.getItem(ue);if(t){const a=JSON.parse(t);a.startDate&&(a.startDate=new Date(a.startDate)),a.endDate&&(a.endDate=new Date(a.endDate)),C(a),f(!0)}else T(!0)}catch{T(!0)}},Qe=()=>{localStorage.removeItem(ue),C(null),f(!1)},Xe=t=>{v(t),T(!1),_(!0)},Ze=(t,a)=>{H(t),$(a)},et=(t,a,i)=>{V({hour:t,minute:a,period:i})},tt=(t,a,i)=>{x({hour:t,minute:a,period:i})},ee=t=>`${t.hour}:${t.minute} ${t.period.toUpperCase()}`,te=t=>t?t.toLocaleDateString("en-US",{day:"numeric",month:"short",year:"numeric"}):"Select date",at=()=>{if(!M||!B){alert("Please select start and end dates");return}_(!1),W(!0)};s.useEffect(()=>{const t=new ot({duration:1.2,easing:i=>Math.min(1,1.001-Math.pow(2,-10*i)),smoothWheel:!0});F.current=t;function a(i){t.raf(i),requestAnimationFrame(a)}return requestAnimationFrame(a),()=>{t.destroy()}},[]);const Re=[{title:"Manage outlet",items:[{id:1,label:"Outlet info",icon:yt,route:"/food/restaurant/outlet
10-info"},{id:2,label:"Outlet timings",icon:Ne,route:"/food/restaurant/outlet-timings"},{id:3,label:"Dining Reservations",icon:ve,route:"/food/restaurant/reservations"},{id:4,label:"Menu categories",icon:bt,route:"/food/restaurant/menu-categories"},{id:6,label:"Takeaway",icon:$e}],key:"manage-outlet"},{title:"Settings",items:[{id:3,label:"Delivery settings",icon:jt,route:"/food/restaurant/delivery-settings"},{id:4,label:"Zone Setup",icon:ze,route:"/food/restaurant/zone-setup"}],key:"settings"},{title:"Orders",items:[{id:1,label:"Order history",icon:wt,route:"/food/restaurant/orders/all"},{id:2,label:"Complaints",icon:vt,route:"/food/restaurant/feedback?tab=complaints"},{id:3,label:"Reviews",icon:Nt,route:"/food/restaurant/feedback"}],key:"orders"},{title:"Help",items:[{id:1,label:"Support",icon:kt,route:"/food/restaurant/help-centre/support"},{id:2,label:"Share your feedback",icon:He,route:"/food/restaurant/Share-Feedback"}],key:"help"},{title:"Finance",items:[{id:1,label:"Payout",icon:St,route:"/food/restaurant/hub-finance"},{id:2,label:"Invoices",icon:Ct,route:"/food/restaurant/hub-finance?tab=invoices"},{id:3,label:"Bank details",icon:Dt,route:"/food/restaurant/update-bank-details"}],key:"accounting"}],fe=()=>{if(!h.trim())return Re;const t=h.toLowerCase();return Re.map(a=>({...a,items:a.items.filter(i=>i.label.toLowerCase().includes(t))})).filter(a=>a.items.length>0)},ge=fe(),st=(t,a,i=0)=>e.jsxs(r.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.3,delay:i,ease:[.25,.1,.25,1]},className:"mb-8",children:[e.jsx(r.h2,{initial:{opacity:0}
10,animate:{opacity:1},transition:{duration:.2,delay:i+.05},className:"text-base font-bold text-gray-900 mb-4",children:t}),e.jsx("div",{className:"grid grid-cols-3 gap-4",children:a.map((o,Pe)=>{const rt=o.icon;return e.jsxs(r.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.25,delay:i+.1+Pe*.02,ease:[.25,.1,.25,1]},className:"flex flex-col items-center",children:[e.jsx(r.button,{whileHover:{scale:1.02,y:-1},whileTap:{scale:.98},onClick:()=>{o.id===5?Oe():o.id===6?(ke(l?.isTakeawayEnabled||!1),J(!0)):o.route&&d(o.route,{state:{from:location.pathname}})},className:"w-full flex items-center justify-center p-6 bg-white rounded-lg shadow-md border-2 border-gray-200 hover:shadow-md transition-shadow duration-200 min-h-[110px]",children:e.jsxs("div",{className:"relative flex items-center justify-center",children:[o.customIcon?e.jsx("div",{className:"w-12 h-12 flex items-center justify-center",children:e.jsx("span",{className:"text-lg font-bold text-gray-900",children:"hp"})}):e.jsx(rt,{className:"w-8 h-8 text-gray-900",strokeWidth:1.5}),o.badge&&e.jsx(r.span,{initial:{scale:0},animate:{scale:1},transition:{delay:i+.15+Pe*.02,type:"spring",stiffness:500},className:"absolute -top-1 -right-1 bg-gradient-to-br from-[#B80B3D] to-[#66001D] text-white text-[10px] font-semibold px-1.5 py-0.5 rounded",children:o.badge})]})}),e.jsx("span",{className:"text-sm text-gray-700 text-center leading-tight font-normal mt-3",children:o.label})]},o.id)})})]});return e.jsxs(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2,ease:[.25,.1,.25,1]},className:"min-h-screen bg-white overflow-x-hidden pb-24",children:[e.jsx(r.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.25,ease:[.25,.1,.25,1]},className:"bg-white border-b border-gray-200 px-4 py-3 sticky top-0 z-50",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("button",{onClick:()=>d("/food/restaurant"),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Go back",children:e.jsx(Me,{className:"w-6 h-6 text-gray-900"})}),e.jsx("h1",{className:"text-lg font-bold text-gray-900",children:"Explore more"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>U(!0),className:"p-2 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Search",children:e.jsx(re,{className:"w-5 h-5 text-gray-900"})}),e.jsx("button",{onClick:()=>g(!0),className:`p-2 transition-all duration-200 rounded-full ${L?"bg-gradient-to-br from-[#B80B3D] to-[#66001D] text-white shadow-lg":"bg-gray-100 hover:bg-gray-200 text-gray-900"}`,"aria-label":"Profile",children:e.jsx(Et,{className:"w-5 h-5"})})]})]})}),e.jsxs("div",{className:"px-4 py-6",children:[e.jsx(r.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.3,delay:.05,ease:[.25,.1,.25,1]},children:e.jsx(ct,{className:"bg-white border-gray-200 py-3 mb-6 rounded-lg shadow-0",children:e.jsx(dt,{className:"px-4",children:e.jsx("div",{className:"w-full flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"p-2 bg-gray-100 rounded-lg",children:e.jsx(pt,{className:"w-5 h-5 text-gray-900"})}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsx("h2",{className:"text-[17px] font-bold text-gray-900 truncate tracking-tight leading-none",children:Je}),pe&&e.jsxs("div",{className:"flex items-start gap-1 mt-1.5 opacity-90",children:[e.jsx(ze,{className:"w-3 h-3 text-[#B80B3D] shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[12px] text-gray-600 font-semibold leading-relaxed",title:pe,children:pe})]})]})]})})})})}),ge.length>0?ge.map((t,a)=>e.jsxs("div",{children:[st(t.title,t.items,.1+a*.05),a<ge.length-1&&e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},transition:{delay:.25+a*.05,duration:.2},className:"border-t border-gray-200 my-6"})]},t.key)):e.jsxs(r.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.3},className:"text-center py-12",children:[e.jsx(re,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No results found"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Try searching with different keywords"})]}),e.jsx(r.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.45,duration:.2},className:"border-t border-gray-200 my-6"}),e.jsxs(r.button,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.5,duration:.25},onClick:()=>xe(!0),className:"w-full flex items-center justify-between gap-3 rounded-[1.2rem] border border-red-100 bg-white px-4 py-4 text-left hover:bg-red-50 transition-all active:scale-[0.99] mb-4 shadow-[0_4px_20px_-4px_rgba(220,38,38,0.05)]",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[e.jsx("div",{className:"flex h-[3.2rem] w-[3.2rem] items-center justify-center rounded-full bg-red-50 shrink-0",children:e.jsx(ft,{className:"w-5 h-5 text-[#FF3131] ml-0.5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[17px] font-bold text-[#FF3131] mb-0.5",children:"Logout"}),e.jsx("p",{className:"text-[13px] text-gray-500 font-medium",children:"Tap to logout from this device"})]})]}),e.jsx(we,{className:"w-[18px] h-[18px] text-gray-300 shrink-0"})]}),e.jsxs(r.button,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.55,duration:.25},onClick:Ve,disabled:de,className:"w-full flex items-center justify-between gap-3 rounded-2xl border border-gray-100 bg-white px-4 py-5 text-left shadow-sm hover:shadow-md transition-all active:scale-[0.99]",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-full bg-[#FFF1F2]",children:de?e.jsx("div",{className:"w-5 h-5 border-2 border-[#FF3131]/30 border-t-[#FF3131] rounded-full animate-spin"}):e.jsx(Ue,{className:"w-5 h-5 text-[#FF3131]"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-base font-bold text-[#FF3131]",children:"Delete Account"}),e.jsx("p",{className:"text-[13px] text-gray-500 font-medium",children:"Tap to delete your account"})]})]}),e.jsx(we,{className:"w-5 h-5 text-[#FF3131]/30 shrink-0"})]})]}),e.jsxs(j,{children:[me&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/50 z-[60]"}),e.jsx(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{duration:.22},className:"fixed inset-0 flex items-center justify-center z-[61] px-4 overflow-y-auto py-10 bg-black/50 backdrop-blur-sm",onClick:()=>{u||xe(!1)},children:e.jsxs("div",{className:"w-full max-w-[340px] rounded-[1.8rem] bg-white p-7 shadow-2xl flex flex-col items-center",onClick:t=>t.stopPropagation(),children:[e.jsx("div",{className:"relative mb-3",children:c.profileImage?e.jsx("img",{src:c.profileImage.url||c.profileImage,alt:"Profile",className:"w-[84px] h-[84px] rounded-full object-cover shadow-sm ring-4 ring-gray-50"}):e.jsx("div",{className:"w-[84px] h-[84px] rounded-full bg-gray-100 flex items-center justify-center ring-4 ring-gray-50",children:e.jsx(We,{className:"w-10 h-10 text-gray-400"})})}),e.jsx("h3",{className:"text-[19px] font-black text-[#1F2937] leading-tight mb-1",children:c.name||"Restaurant"}),c.phone&&e.jsx("p",{className:"text-[13px] font-medium text-gray-500 mb-0.5",children:c.phone}),c.email&&c.email!=="N/A"&&e.jsx("p",{className:"text-[13px] font-medium text-gray-400 mb-6",children:c.email}),e.jsxs("div",{className:"w-full space-y-3",children:[e.jsx("button",{type:"button",onClick:async()=>{await Ae()},disabled:u,className:"w-full rounded-[14px] bg-[#DC2626] py-[14px] text-[15px] font-bold text-white transition-all active:scale-[0.98] disabled:opacity-50",children:u?"Logging out...":"Logout"}),e.jsx("button",{type:"button",onClick:async()=>{await Be()},disabled:u,className:"w-full rounded-[14px] border-[1.5px] border-[#DC2626] bg-white py-[14px] text-[15px] font-bold text-[#DC2626] transition-all active:scale-[0.98] disabled:opacity-50",children:u?"Logging out...":"Logout from all devices"})]}),e.jsx("button",{type:"button",onClick:()=>xe(!1),disabled:u,className:"mt-5 text-[15px] font-bold text-[#6B7280] hover:text-[#374151] transition-colors disabled:opacity-50",children:"Cancel"})]})})]}),D&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/50 z-50",onClick:()=>{U(!1),p("")}}),e.jsxs(r.div,{initial:{y:"-100%"},animate:{y:0},exit:{y:"-100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed top-0 left-0 right-0 bg-white shadow-lg z-50 h-screen",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[e.jsx("button",{onClick:()=>{U(!1),p("")},className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close search",children:e.jsx(Me,{className:"w-6 h-6 text-gray-900"})}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx("input",{type:"text",placeholder:"Search features...",value:h,onChange:t=>p(t.target.value),autoFocus:!0,className:"w-full px-4 py-2 pr-10 bg-gray-100 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#B80B3D] text-gray-900 placeholder-gray-500"}),h&&e.jsx("button",{onClick:()=>p(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-gray-200 rounded-full transition-colors","aria-label":"Clear search",children:e.jsx(q,{className:"w-4 h-4 text-gray-600"})})]})]}),e.jsx("div",{className:"max-h-[70vh] overflow-y-auto",children:h.trim()?fe().length>0?e.jsx("div",{className:"px-4 py-4",children:fe().map(t=>e.jsxs("div",{className:"mb-6 last:mb-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-500 mb-3 uppercase tracking-wide",children:t.title}),e.jsx("div",{className:"space-y-2",children:t.items.map(a=>{const i=a.icon;return e.jsxs("button",{onClick:()=>{a.id===5?Oe():a.route&&d(a.route,{state:{from:location.pathname}}),U(!1),p("")},className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-50 rounded-lg transition-colors text-left",children:[e.jsx("div",{className:"p-2 bg-gray-100 rounded-lg",children:e.jsx(i,{className:"w-5 h-5 text-gray-900"})}),e.jsx("span",{className:"flex-1 text-base text-gray-900",children:a.label}),a.badge&&e.jsx("span",{className:"bg-gradient-to-br from-[#B80B3D] to-[#66001D] text-white text-xs font-semibold px-2 py-1 rounded",children:a.badge}),e.jsx(we,{className:"w-5 h-5 text-gray-400"})]},a.id)})})]},t.key))}):e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx(re,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No results found"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Try searching with different keywords"})]}):e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx(re,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),e.jsx("p",{className:"text-base font-medium text-gray-900 mb-1",children:"Search for features"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Type to search for outlet settings, orders, and more"})]})})]})]})]}),e.jsx(j,{children:L&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/50/60 z-[100] backdrop-blur-[2px]",onClick:()=>g(!1)}),e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},className:"fixed inset-0 m-auto w-[92%] max-w-sm h-fit bg-white rounded-[2.5rem] shadow-[0_20px_60px_-12px_rgba(0,0,0,0.4)] z-[101] overflow-hidden",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 sticky top-0 bg-white z-10",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"My profile"}),e.jsx("button",{onClick:()=>g(!1),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close",children:e.jsx(q,{className:"w-5 h-5 text-gray-900"})})]}),e.jsx("div",{className:"px-6 py-6",children:e.jsxs("div",{className:"w-full flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center shrink-0 overflow-hidden ring-4 ring-gray-50 transition-all",children:c.profileImage?.url?e.jsx("img",{src:c.profileImage.url,alt:c.name,className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-100",children:e.jsx(We,{className:"w-8 h-8 text-gray-400"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-[17px] font-black text-[#1F2937] leading-tight mb-1 truncate",children:he?"Loading...":c.name||"Restaurant"}),c.phone&&e.jsx("p",{className:"text-[13px] font-medium text-gray-500 mb-0.5",children:c.phone}),c.email&&c.email!=="N/A"&&e.jsx("p",{className:"text-[13px] font-medium text-gray-400 truncate",children:c.email})]})]}),e.jsx("button",{onClick:()=>{g(!1),d("/food/restaurant/edit-owner")},className:"p-2 ml-2 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900 rounded-full transition-colors shrink-0","aria-label":"Edit Profile",children:e.jsx(He,{className:"w-4 h-4"})})]})}),e.jsxs("div",{className:"px-6 pb-6 flex flex-col items-center",children:[e.jsxs("div",{className:"w-full space-y-3",children:[e.jsx("button",{type:"button",onClick:async()=>{await Ae()},disabled:u,className:"w-full rounded-[14px] bg-[#DC2626] hover:bg-[#B91C1C] py-[14px] text-[15px] font-bold text-white transition-all active:scale-[0.98] disabled:opacity-50",children:u?"Logging out...":"Logout"}),e.jsx("button",{type:"button",onClick:async()=>{await Be()},disabled:u,className:"w-full rounded-[14px] border-[1.5px] border-[#DC2626] bg-white hover:bg-red-50 py-[14px] text-[15px] font-bold text-[#DC2626] transition-all active:scale-[0.98] disabled:opacity-50",children:u?"Logging out...":"Logout from all devices"})]}),e.jsx("button",{type:"button",onClick:()=>g(!1),disabled:u,className:"mt-5 text-[15px] font-bold text-[#6B7280] hover:text-[#374151] transition-colors disabled:opacity-50",children:"Cancel"})]})]})]})}),e.jsx(j,{children:y&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/50 z-50",onClick:()=>T(!1)}),e.jsxs(r.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-2xl shadow-2xl z-50 max-h-[90vh] overflow-y-auto",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 sticky top-0 bg-white z-10",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"Select reason"}),e.jsx("button",{onClick:()=>T(!1),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close",children:e.jsx(q,{className:"w-5 h-5 text-gray-900"})})]}),e.jsx("div",{className:"px-6 py-4",children:Ke.map((t,a)=>e.jsx("button",{onClick:()=>Xe(t),className:"w-full text-left py-4 px-4 rounded-lg hover:bg-gray-50 transition-colors border-b border-gray-100 last:border-b-0",children:e.jsx("span",{className:"text-base text-gray-900",children:t})},a))})]})]})}),e.jsx(j,{children:E&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/50 z-50",onClick:()=>_(!1)}),e.jsxs(r.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-2xl shadow-2xl z-50 max-h-[90vh] overflow-y-auto",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 sticky top-0 bg-white z-10",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"Schedule off"}),e.jsx("button",{onClick:()=>_(!1),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close",children:e.jsx(q,{className:"w-5 h-5 text-gray-900"})})]}),e.jsxs("div",{className:"px-6 py-6 space-y-6",children:[w&&e.jsxs("div",{className:"pb-4 border-b border-gray-200",children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Reason"}),e.jsx("p",{className:"text-base font-medium text-gray-900",children:w})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700 mb-3",children:"Select dates"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 mb-1 block",children:"Start date"}),e.jsxs("button",{onClick:()=>S(!0),className:"w-full flex items-center justify-between px-4 py-3 border border-gray-300 rounded-lg bg-gray-50 hover:bg-gray-100 transition-colors",children:[e.jsx("span",{className:"text-gray-900",children:te(M)}),e.jsx(ve,{className:"w-5 h-5 text-gray-500"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 mb-1 block",children:"End date"}),e.jsxs("button",{onClick:()=>S(!0),className:"w-full flex items-center justify-between px-4 py-3 border border-gray-300 rounded-lg bg-gray-50 hover:bg-gray-100 transition-colors",children:[e.jsx("span",{className:"text-gray-900",children:te(B)}),e.jsx(ve,{className:"w-5 h-5 text-gray-500"})]})]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700 mb-3",children:"Select times"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 mb-1 block",children:"Start time"}),e.jsxs("button",{onClick:()=>b(!0),className:"w-full flex items-center justify-between px-4 py-3 border border-gray-300 rounded-lg bg-gray-50 hover:bg-gray-100 transition-colors",children:[e.jsx("span",{className:"text-gray-900",children:ee(O)}),e.jsx(Ne,{className:"w-5 h-5 text-gray-500"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-600 mb-1 block",children:"End time"}),e.jsxs("button",{onClick:()=>z(!0),className:"w-full flex items-center justify-between px-4 py-3 border border-gray-300 rounded-lg bg-gray-50 hover:bg-gray-100 transition-colors",children:[e.jsx("span",{className:"text-gray-900",children:ee(n)}),e.jsx(Ne,{className:"w-5 h-5 text-gray-500"})]})]})]})]}),e.jsx("button",{onClick:at,className:"w-full bg-gradient-to-br from-[#B80B3D] to-[#66001D] hover:bg-[#6a2f56] text-white font-bold py-3.5 px-4 rounded-xl transition-all shadow-md active:scale-[0.98] mt-4",children:"Submit"})]})]})]})}),Y&&e.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",onClick:()=>S(!1),children:e.jsx("div",{onClick:t=>t.stopPropagation(),className:"bg-white rounded-lg shadow-lg",children:e.jsx(mt,{startDate:M,endDate:B,onDateRangeChange:Ze,onClose:()=>S(!1)})})}),e.jsx(qe,{isOpen:N,onClose:()=>b(!1),initialHour:O.hour,initialMinute:O.minute,initialPeriod:O.period,onConfirm:et}),e.jsx(qe,{isOpen:k,onClose:()=>z(!1),initialHour:n.hour,initialMinute:n.minute,initialPeriod:n.period,onConfirm:tt}),e.jsx(j,{children:I&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},onClick:()=>W(!1),className:"fixed inset-0 bg-black/50 z-[10000]"}),e.jsx(r.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:300},className:"fixed inset-0 flex items-center justify-center z-[10000] px-4",onClick:t=>t.stopPropagation(),children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl max-w-sm w-full p-6 text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-green-100 flex items-center justify-center",children:e.jsx(gt,{className:"w-10 h-10 text-green-600"})})}),e.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"Success!"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Restaurant is marked offline"}),e.jsx("button",{onClick:()=>{W(!1),v(null),H(null),$(null),V({hour:"9",minute:"00",period:"am"}),x({hour:"5",minute:"00",period:"pm"})},className:"w-full bg-gradient-to-br from-[#B80B3D] to-[#66001D] text-white py-3.5 rounded-xl font-bold text-sm hover:bg-[#6a2f56] transition-all shadow-md active:scale-[0.98]",children:"Done"})]})})]})}),e.jsx(j,{children:A&&m&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/50 z-50",onClick:()=>f(!1)}),e.jsxs(r.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-2xl shadow-2xl z-50 max-h-[90vh] overflow-y-auto",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 sticky top-0 bg-white z-10",children:[e.jsx("h2",{className:"text-lg font-bold text-gray-900",children:"Schedule off"}),e.jsx("button",{onClick:()=>f(!1),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close",children:e.jsx(q,{className:"w-5 h-5 text-gray-900"})})]}),e.jsxs("div",{className:"px-6 py-6",children:[e.jsxs("div",{className:"mb-6 p-4 bg-blue-50 rounded-lg border border-blue-200",children:[e.jsx("p",{className:"text-base font-semibold text-gray-900 mb-1",children:"Restaurant is scheduled off"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Your restaurant is currently marked as offline"})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[m.reason&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Reason"}),e.jsx("p",{className:"text-base font-medium text-gray-900",children:m.reason})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Start date"}),e.jsx("p",{className:"text-base font-medium text-gray-900",children:te(m.startDate)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"End date"}),e.jsx("p",{className:"text-base font-medium text-gray-900",children:te(m.endDate)})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Start time"}),e.jsx("p",{className:"text-base font-medium text-gray-900",children:ee(m.startTime)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"End time"}),e.jsx("p",{className:"text-base font-medium text-gray-900",children:ee(m.endTime)})]})]})]}),e.jsx("button",{onClick:()=>{Qe()},className:"w-full bg-gradient-to-br from-[#B80B3D] to-[#66001D] hover:bg-red-700 text-white font-semibold py-3 px-4 rounded-lg transition-colors",children:"Delete Schedule"})]})]})]})}),e.jsx(j,{children:R&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 bg-black/50 z-[1000] backdrop-blur-sm",onClick:()=>J(!1)}),e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},className:"fixed inset-0 m-auto w-[90%] max-w-sm h-fit bg-white rounded-3xl p-6 shadow-2xl z-[1001]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:"Takeaway"}),e.jsx("button",{onClick:()=>J(!1),className:"p-1.5 hover:bg-gray-100 rounded-full transition-colors",children:e.jsx(q,{className:"w-5 h-5 text-gray-400"})})]}),e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-2xl border mb-6 cursor-pointer ${P?"bg-green-50/50 border-green-100":"bg-gray-50 border-gray-100"}`,onClick:()=>{ke(!P)},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-[44px] h-[44px] flex items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-blue-700 shadow-sm shadow-blue-200 shrink-0",children:e.jsx($e,{className:"w-5 h-5 text-white",strokeWidth:2.5})}),e.jsx("span",{className:"text-base font-bold text-gray-900",children:"Takeaway orders"})]}),e.jsx("div",{className:`relative w-14 h-8 rounded-full transition-colors duration-300 ${P?"bg-green-500":"bg-gray-300"}`,children:e.jsx(r.div,{initial:{x:P?28:4},animate:{x:P?28:4},className:"absolute top-1 left-0 w-6 h-6 bg-white rounded-full shadow-md",transition:{type:"spring",stiffness:400,damping:35}})})]}),e.jsx("p",{className:"text-sm text-gray-500 px-1 mb-6",children:"When enabled, customers can place takeaway orders from your restaurant. You can turn this off anytime."}),e.jsxs("button",{disabled:G,onClick:async()=>{if(!G){Se(!0);try{await be.updateTakeawaySettings({isEnabled:P}),Ee(t=>({...t,isTakeawayEnabled:P})),J(!1),ae.success(`Takeaway ${P?"enabled":"disabled"} successfully`,{duration:2e3})}catch{ae.error("Failed to update takeaway status",{duration:2e3})}finally{Se(!1)}}},className:`w-full bg-gradient-to-br from-[#B80B3D] to-[#66001D] text-white font-bold py-4 rounded-2xl active:scale-[0.98] transition-all flex items-center justify-center gap-2 ${G?"opacity-70 cursor-not-allowed":""}`,children:[G&&e.jsx("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),G?"Saving...":"Save"]})]})]})}),e.jsx(j,{children:ce&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{initial:{opacity:0}
10,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50/60 z-[10000] backdrop-blur-sm",onClick:()=>X(!1)}),e.jsx(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},className:"fixed inset-0 flex items-center justify-center z-[10001] px-4 overflow-y-auto py-10",children:e.jsxs("div",{className:"bg-white rounded-3xl shadow-2xl max-w-sm w-full p-6 text-center border border-orange-100",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-orange-100 flex items-center justify-center",children:e.jsx(Ye,{className:"w-8 h-8 text-orange-600"})})}),e.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"Wait! Balance Found"}),e.jsxs("div",{className:"bg-gray-50 rounded-2xl p-4 mb-5 text-center",children:[e.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-black tracking-widest mb-1",children:De.type}),e.jsxs("p",{className:"text-[#B80B3D]xl font-black text-black",children:["â¹",De.balance.toLocaleString("en-IN")]})]}),e.jsx("p",{className:"text-sm text-gray-500 mb-6 leading-relaxed",children:"You still have unsettled payout available to withdraw. Continue deleting your account or go to Payout to withdraw first."}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("button",{onClick:()=>{X(!1),oe(""),K(!0)},className:"w-full h-12 rounded-xl bg-gray-100 text-gray-700 font-bold hover:bg-gray-200 transition-colors",children:"Continue Anyway"}),e.jsx("button",{onClick:()=>{X(!1),d("/food/restaurant/hub-finance")},className:"w-full h-12 rounded-xl bg-gradient-to-br from-[#B80B3D] to-[#66001D] text-white font-bold hover:bg-gradient-to-br from-[#B80B3D] to-[#66001D] transition-colors",children:"Go to Payout"})]})]})})]})}),e.jsx(j,{children:ie&&e.jsx("div",{className:"fixed inset-0 z-[10000] overflow-y-auto bg-black/60 backdrop-blur-sm",children:e.jsx("div",{className:"flex min-h-screen items-center justify-center p-4 py-10",children:e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},className:"w-full max-w-sm rounded-3xl shadow-2xl bg-white p-6 text-center border border-red-100",onClick:t=>t.stopPropagation(),children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"w-16 h-16 rounded-full bg-red-100 flex items-center justify-center",children:e.jsx(Ue,{className:"w-8 h-8 text-[#B80B3D]"})})}),e.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"Delete Your Account?"}),e.jsx("p",{className:"text-sm text-gray-500 mb-5 leading-relaxed",children:"Are you sure you want to delete your account?"}),e.jsxs("div",{className:"mb-5 bg-red-50 border-l-4 border-red-500 rounded-r-xl p-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Ye,{className:"w-4 h-4 text-[#B80B3D] flex-shrink-0"}),e.jsx("span",{className:"text-xs font-bold text-red-700 uppercase tracking-wider",children:"Warning"})]}),e.jsx("p",{className:"text-[11px] text-red-800 font-medium leading-tight",children:"Your account will be Deleted. Admin will keep your historical records for revenue reporting."})]}),e.jsx("div",{className:"mb-6",children:e.jsx("input",{type:"text",placeholder:"Type DELETE to confirm",value:le,onChange:t=>oe(t.target.value.toUpperCase()),className:"w-full h-12 px-4 rounded-xl border-2 border-gray-100 focus:border-[#B80B3D] focus:ring-4 focus:ring-red-50 outline-none transition-all font-bold text-center tracking-widest placeholder:tracking-normal placeholder:font-medium placeholder:text-gray-400"})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{autoFocus:!0,onClick:()=>K(!1),disabled:Q,className:"flex-1 h-12 rounded-xl border-2 border-gray-200 text-gray-800 font-bold text-sm transition-colors hover:bg-gray-50 disabled:opacity-50",children:"No, Cancel"}),e.jsx("button",{onClick:async()=>{if(!(Q||le!=="DELETE")){Ce(!0);try{await je.deleteAccount("restaurant"),ut(),ye("restaurant"),d("/food/restaurant/login",{replace:!0})}catch(t){ae.error(t?.response?.data?.message||"Failed to delete account")}finally{Ce(!1),K(!1)}}},disabled:Q||le!=="DELETE",className:"flex-1 h-12 rounded-xl bg-gradient-to-br from-[#B80B3D] to-[#66001D] text-white font-bold text-sm transition-all hover:bg-red-700 active:scale-95 disabled:opacity-50",children:Q?"Deleting...":"Delete Account"})]})]})})})}),e.jsx(ht,{})]})}
10export{Aa as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.