1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26469,e=>{"use strict";e.s(["CartProvider",()=>n,"useCart",()=>a]);var t=e.i(43476),r=e.i(71645);let s=(0,r.createContext)();function n(e){let{children:n}=e,[a,i]=(0,r.useState)([]),[l,o]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=localStorage.getItem("cart");if(e){let t=JSON.parse(e);i(t),o(t.reduce((e,t)=>e+t.quantity,0))}},[]),(0,r.useEffect)(()=>{localStorage.setItem("cart",JSON.stringify(a)),o(a.reduce((e,t)=>e+t.quantity,0))},[a]);let c=(0,r.useCallback)((e,t,r)=>{let s="".concat(e.id,"_").concat(Date.now(),"_").concat(Math.random().toString(36).substr(2,9));i(n=>[...n,{...e,cartItemId:s,originalId:e.id,quantity:t,specialInstructions:r}])},[]),d=(0,r.useCallback)(e=>{i(t=>t.filter(t=>t.cartItemId!==e))},[]),u=(0,r.useCallback)((e,t)=>{if(t<=0)return void d(e);i(a.map(r=>r.cartItemId===e?{...r,quantity:t}:r))},[d,a]),m=(0,r.useCallback)(()=>{i([])},[]),h=(0,r.useCallback)(()=>a.reduce((e,t)=>e+t.price*t.quantity,0),[a]);return(0,t.jsx)(s.Provider,{value:{cartItems:a,cartCount:l,addToCart:c,removeFromCart:d,updateQuantity:u,clearCart:m,getTotalPrice:h,getCartTotal:h},children:n})}function a(){return(0,r.useContext)(s)}},18566,(e,t,r)=>{t.exports=e.r(76562)},75254,e=>{"use strict";e.s(["default",()=>i],75254);var t=e.i(71645);let r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},s=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,t.forwardRef)((e,r)=>{let{color:a="currentColor",size:i=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:u,...m}=e;return(0,t.createElement)("svg",{ref:r,...n,width:i,height:i,stroke:a,strokeWidth:o?24*Number(l)/Number(i):l,className:s("lucide",c),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(m)&&{"aria-hidden":"true"},...m},[...u.map(e=>{let[r,s]=e;return(0,t.createElement)(r,s)}),...Array.isArray(d)?d:[d]])}),i=(e,n)=>{let i=(0,t.forwardRef)((i,l)=>{let{className:o,...c}=i;return(0,t.createElement)(a,{ref:l,iconNode:n,className:s("lucide-".concat(r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),o),...c})});return i.displayName=r(e),i}},88653,e=>{"use strict";e.s(["AnimatePresence",()=>v],88653),e.i(47167);var t=e.i(43476),r=e.i(71645),s=e.i(31178),n=e.i(47414),a=e.i(74008),i=e.i(21476),l=e.i(72846),o=r,c=e.i(37806);function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class u extends o.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,r=(0,l.isHTMLElement)(e)&&e.offsetWidth||0,s=this.props.sizeRef.current;s.height=t.offsetHeight||0,s.width=t.offsetWidth||0,s.top=t.offsetTop,s.left=t.offsetLeft,s.right=r-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function m(e){let{children:s,isPresent:n,anchorX:a,root:i}=e,l=(0,o.useId)(),m=(0,o.useRef)(null),h=(0,o.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:x}=(0,o.useContext)(c.MotionConfigContext),f=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return r.useCallback(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return e=>{let r=!1,s=t.map(t=>{let s=d(t,e);return r||"function"!=typeof s||(r=!0),s});if(r)return()=>{for(let e=0;e<s.length;e++){let r=s[e];"function"==typeof r?r():d(t[e],null)}}}}(...t),t)}(m,null==s?void 0:s.ref);return(0,o.useInsertionEffect)(()=>{let{width:e,height:t,top:r,left:s,right:o}=h.current;if(n||!m.current||!e||!t)return;m.current.dataset.motionPopId=l;let c=document.createElement("style");x&&(c.nonce=x);let d=null!=i?i:document.head;return d.appendChild(c),c.sheet&&c.sheet.insertRule('\n [data-motion-pop-id="'.concat(l,'"] {\n position: absolute !important;\n width: ').concat(e,"px !important;\n height: ").concat(t,"px !important;\n ").concat("left"===a?"left: ".concat(s):"right: ".concat(o),"px !important;\n top: ").concat(r,"px !important;\n }\n ")),()=>{d.contains(c)&&d.removeChild(c)}},[n]),(0,t.jsx)(u,{isPresent:n,childRef:m,sizeRef:h,children:o.cloneElement(s,{ref:f})})}let h=e=>{let{children:s,initial:a,isPresent:l,onExitComplete:o,custom:c,presenceAffectsLayout:d,mode:u,anchorX:h,root:f}=e,g=(0,n.useConstant)(x),p=(0,r.useId)(),v=!0,y=(0,r.useMemo)(()=>
1(v=!1,{id:p,initial:a,isPresent:l,custom:c,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;o&&o()},register:e=>(g.set(e,!1),()=>g.delete(e))}),[l,g,o]);return d&&v&&(y={...y}),(0,r.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[l]),r.useEffect(()=>{l||g.size||!o||o()},[l]),"popLayout"===u&&(s=(0,t.jsx)(m,{isPresent:l,anchorX:h,root:f,children:s})),(0,t.jsx)(i.PresenceContext.Provider,{value:y,children:s})};function x(){return new Map}var f=e.i(64978);let g=e=>e.key||"";function p(e){let t=[];return r.Children.forEach(e,e=>{(0,r.isValidElement)(e)&&t.push(e)}),t}let v=e=>{let{children:i,custom:l,initial:o=!0,onExitComplete:c,presenceAffectsLayout:d=!0,mode:u="sync",propagate:m=!1,anchorX:x="left",root:v}=e,[y,b]=(0,f.usePresence)(m),w=(0,r.useMemo)(()=>p(i),[i]),j=m&&!y?[]:w.map(g),N=(0,r.useRef)(!0),k=(0,r.useRef)(w),C=(0,n.useConstant)(()=>new Map),[S,E]=(0,r.useState)(w),[I,P]=(0,r.useState)(w);(0,a.useIsomorphicLayoutEffect)(()=>{N.current=!1,k.current=w;for(let e=0;e<I.length;e++){let t=g(I[e]);j.includes(t)?C.delete(t):!0!==C.get(t)&&C.set(t,!1)}},[I,j.length,j.join("-")]);let L=[];if(w!==S){let e=[...w];for(let t=0;t<I.length;t++){let r=I[t],s=g(r);j.includes(s)||(e.splice(t,0,r),L.push(r))}return"wait"===u&&L.length&&(e=L),P(p(e)),E(w),null}let{forceRender:D}=(0,r.useContext)(s.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:I.map(e=>{let r=g(e),s=(!m||!!y)&&(w===I||j.includes(r));return(0,t.jsx)(h,{isPresent:s,initial:(!N.current||!!o)&&void 0,custom:l,presenceAffectsLayout:d,mode:u,root:v,onExitComplete:s?void 0:()=>{if(!C.has(r))return;C.set(r,!0);let e=!0;C.forEach(t=>{t||(e=!1)}),e&&(null==D||D(),P(k.current),m&&(null==b||b()),c&&c())},anchorX:x,children:e},r)})})}},67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let s=e.r(32061);function n(e){let{reason:t,children:r}=e;if("undefined"==typeof window)throw Object.defineProperty(new s.BailoutToCSRError(t),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}},9885,(e,t,r)=>{"use strict";function s(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return s}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return l}});let s=e.r(43476),n=e.r(74080),a=e.r(63599),i=e.r(9885);function l(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let r=a.workAsyncStorage.getStore();if(void 0===r)return null;let l=[];if(r.reactLoadableManifest&&t){let e=r.reactLoadableManifest;for(let r of t){if(!e[r])continue;let t=e[r].files;l.push(...t)}}return 0===l.length?null:(0,s.jsx)(s.Fragment,{children:l.map(e=>{let t=r.assetPrefix+"/_next/"+(0,i.encodeURIPath)(e);return e.endsWith(".css")?(0,s.jsx)("link",{precedence:"dynamic",href:t,rel:"stylesheet",as:"style"},e):((0,n.preload)(t,{as:"script",fetchPriority:"low"}),null)})})}},84848,e=>{"use strict";e.s(["default",()=>i]);var t=e.i(43476),r=e.i(57688),s=e.i(22016);e.i(71645);var n=e.i(46932);let a={sm:{image:"w-10",text:"text-xl"},md:{image:"w-14",text:"text-2xl lg:text-3xl"},lg:{image:"w-16",text:"text-4xl lg:text-5xl"}};function i(e){let{size:i="md",theme:l="light",className:o=""}=e,c=a[i]||a.md;return(0,t.jsxs)(s.default,{href:"/",className:"flex items-center gap-2 ".concat(o),children:[(0,t.jsx)(n.motion.div,{whileHover:{rotate:15},children:(0,t.jsx)(r.default,{src:"/fastFeastLogo.png",width:70,height:70,alt:"FastFeast logo",priority:!0,className:"h-auto ".concat(c.image)})}),(0,t.jsx)("div",{className:"".concat(c.text," font-bold"),children:"light"===l?(0,t.jsx)("h1",{className:"bg-gradient-to-r from-orange-600 to-orange-400 bg-clip-text text-transparent",children:"FastFeast"}):(0,t.jsx)("h1",{className:"text-gray-100",children:"FastFeast"})})]})}},63178,e=>{"use strict";e.s(["ThemeProvider",()=>c,"useTheme",()=>o]);var t=e.i(71645),r=(e,t,r,s,n,a,i,l)=>{let o=document.documentElement,c=["light","dark"];function d(t){var r;
1(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,s=r&&a?n.map(e=>a[e]||e):n;r?(o.classList.remove(...s),o.classList.add(a&&a[t]?a[t]:t)):o.setAttribute(e,t)}),r=t,l&&c.includes(r)&&(o.style.colorScheme=r)}if(s)d(s);else try{let e=localStorage.getItem(t)||r,s=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(s)}catch(e){}},s=["light","dark"],n="(prefers-color-scheme: dark)",a="undefined"==typeof window,i=t.createContext(void 0),l={setTheme:e=>{},themes:[]},o=()=>{var e;return null!=(e=t.useContext(i))?e:l},c=e=>t.useContext(i)?t.createElement(t.Fragment,null,e.children):t.createElement(u,{...e}),d=["light","dark"],u=e=>{let{forcedTheme:r,disableTransitionOnChange:a=!1,enableSystem:l=!0,enableColorScheme:o=!0,storageKey:c="theme",themes:u=d,defaultTheme:g=l?"system":"light",attribute:p="data-theme",value:v,children:y,nonce:b,scriptProps:w}=e,[j,N]=t.useState(()=>h(c,g)),[k,C]=t.useState(()=>"system"===j?f():j),S=v?Object.values(v):u,E=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&l&&(t=f());let r=v?v[t]:t,n=a?x(b):null,i=document.documentElement,c=e=>{"class"===e?(i.classList.remove(...S),r&&i.classList.add(r)):e.startsWith("data-")&&(r?i.setAttribute(e,r):i.removeAttribute(e))};if(Array.isArray(p)?p.forEach(c):c(p),o){let e=s.includes(g)?g:null,r=s.includes(t)?t:e;i.style.colorScheme=r}null==n||n()},[b]),I=t.useCallback(e=>{let t="function"==typeof e?e(j):e;N(t);try{localStorage.setItem(c,t)}catch(e){}},[j]),P=t.useCallback(e=>{C(f(e)),"system"===j&&l&&!r&&E("system")},[j,r]);t.useEffect(()=>{let e=window.matchMedia(n);return e.addListener(P),P(e),()=>e.removeListener(P)},[P]),t.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?N(e.newValue):I(g))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[I]),t.useEffect(()=>{E(null!=r?r:j)},[r,j]);let L=t.useMemo(()=>({theme:j,setTheme:I,forcedTheme:r,resolvedTheme:"system"===j?k:j,themes:l?[...u,"system"]:u,systemTheme:l?k:void 0}),[j,I,r,k,l,u]);return t.createElement(i.Provider,{value:L},t.createElement(m,{forcedTheme:r,storageKey:c,attribute:p,enableSystem:l,enableColorScheme:o,defaultTheme:g,value:v,themes:u,nonce:b,scriptProps:w}),y)},m=t.memo(e=>{let{forcedTheme:s,storageKey:n,attribute:a,enableSystem:i,enableColorScheme:l,defaultTheme:o,value:c,themes:d,nonce:u,scriptProps:m}=e,h=JSON.stringify([a,n,o,s,d,c,i,l]).slice(1,-1);return t.createElement("script",{...m,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?u:"",dangerouslySetInnerHTML:{__html:"(".concat(r.toString(),")(").concat(h,")")}})}),h=(e,t)=>{let r;if(!a){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},x=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},f=e=>(e||(e=window.matchMedia(n)),e.matches?"dark":"light")},99749,e=>{"use strict";function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.s(["_",()=>t])},14595,(e,t,r)=>{"use strict";var s=e.r(71645),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=s.useSyncExternalStore,i=s.useRef,l=s.useEffect,o=s.useMemo,c=s.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,s,d){var u=i(null);if(null===u.current){var m={hasValue:!1,value:null};u.current=m}else m=u.current;var h=a(e,(u=o(function(){function e(e){if(!l){if(l=!0,a=e,e=s(e),void 0!==d&&m.hasValue){var t=m.value;if(d(t,e))return i=t}return i=e}if(t=i,n(a,e))return t;var r=s(e);return void 0!==d&&d(t,r)?(a=e,t):(a=e,i=r)}var a,i,l=!1,o=void 0===r?null:r;return[function(){return e(t())},null===o?void 0:function(){return e(o())}]},[t,r,s,d]))[0],u[1]);return l(function(){m.hasValue=!0,m.value=h},[h]),c(h),h}},13027,(e,t,r)=>{"use strict";
1t.exports=e.r(14595)},55487,e=>{"use strict";e.s(["Provider",()=>d,"useDispatch",()=>f,"useSelector",()=>p]);var t=e.i(71645),r=e.i(13027),s={notify(){},get:()=>[]},n="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,a="undefined"!=typeof navigator&&"ReactNative"===navigator.product,i=n||a?t.useLayoutEffect:t.useEffect;Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var l=Symbol.for("react-redux-context"),o="undefined"!=typeof globalThis?globalThis:{},c=function(){var e;if(!t.createContext)return{};let r=null!=(e=o[l])?e:o[l]=new Map,s=r.get(t.createContext);return s||(s=t.createContext(null),r.set(t.createContext,s)),s}(),d=function(e){let{children:r,context:n,serverState:a,store:l}=e,o=t.useMemo(()=>{let e=function(e,t){let r,n=s,a=0,i=!1;function l(){d.onStateChange&&d.onStateChange()}function o(){if(a++,!r){let t,s;r=e.subscribe(l),t=null,s=null,n={clear(){t=null,s=null},notify(){let e=t;for(;e;)e.callback(),e=e.next},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let r=!0,n=s={callback:e,next:null,prev:s};return n.prev?n.prev.next=n:t=n,function(){r&&null!==t&&(r=!1,n.next?n.next.prev=n.prev:s=n.prev,n.prev?n.prev.next=n.next:t=n.next)}}}}}function c(){a--,r&&0===a&&(r(),r=void 0,n.clear(),n=s)}let d={addNestedSub:function(e){o();let t=n.subscribe(e),r=!1;return()=>{r||(r=!0,t(),c())}},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:l,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,o())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>n};return d}(l);return{store:l,subscription:e,getServerState:a?()=>a:void 0}},[l,a]),d=t.useMemo(()=>l.getState(),[l]);i(()=>{let{subscription:e}=o;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),d!==l.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[o,d]);let u=n||c;return t.createElement(u.Provider,{value:o},r)};function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return function(){return t.useContext(e)}}var m=u();function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=e===c?m:u(e),r=()=>{let{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var x=h(),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=e===c?x:h(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}(),g=(e,t)=>e===t,p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,s=e===c?m:u(e),n=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{equalityFn:a=g}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:l,getServerState:o}=s();t.useRef(!0);let c=t.useCallback({[e.name]:t=>e(t)}[e.name],[e]),d=(0,r.useSyncExternalStoreWithSelector)(l.addNestedSub,i.getState,o||i.getState,c,a);return t.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}()},53704,e=>{"use strict";e.s(["default",()=>i],53704);var t=e.i(43476);e.i(71645);var r=e.i(55487),s=e.i(64645),n=e.i(52313);let a=(0,s.configureStore)({reducer:{filters:n.default},middleware:e=>e({serializableCheck:{ignoredActions:["persist/PERSIST","persist/REHYDRATE"]}})});function i(e){let{children:s}=e;return(0,t.jsx)(r.Provider,{store:a,children:s})}},60499,e=>{"use strict";e.s(["default",()=>x],60499);var t=e.i(43476),r=e.i(71645),s=e.i(92199),n=e.i(18566),a=e.i(5766);e.i(47167);var i=e.i(57688);let l=e=>{var n;let{isOpen:l,onClose:o,order:c,onSubmit:d}=e,[u,m]=(0,r.useState)(0),[h,x]=(0,r.useState)(""),[f,g]=(0,r.useState)({}),[p,v]=(0,r.useState)({}),[y,b]=(0,r.useState)(!1),[w,j]=(0,r.useState)({}),N=async e=>{try{let t=await fetch("".concat("https://fastfeastt.netlify.app","/api/menus")),r=await t.json(),s=[];if(Array.isArray(r))s=r;else if(r.success&&Array.isArray(r.menus))s=r.menus;else{if(!Array.isArray(r.data))return{};s=r.data}let n={};return s.forEach(e=>{e.title&&e._id&&(n[e.title]=e._id)}),e.forEach(e=>{}),n}catch(e){return{}}},k=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r[e.title]?r[e.title]:"".concat(e.title,"-").concat(t)};(0,r.useEffect)(()=>{let e=async()=>
1{if(c&&c.items){let e=c.items.map(e=>e.title),t=await N(e),r={},s={};c.items.forEach((e,n)=>{let a=k(e,n,t);r[a]=0,s[a]=""}),j(t),g(r),v(s)}};l&&e()},[c,l]);let C=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;"rider"===t?m(e):"item"===t&&r&&g(t=>({...t,[r]:e}))},S=async e=>{e.preventDefault();let t=u>0,r=Object.values(f).some(e=>e>0);if(!t&&!r)return void a.default.error("Please provide at least one rating");b(!0);try{let e=c.items.map((e,t)=>{let r=k(e,t,w),s=f[r]||0,n=p[r]||"";return{itemId:r,rating:s,comment:n,itemName:e.title}}).filter(e=>e.rating>0),r={riderReview:t?{riderId:c.riderInfo.riderId,rating:u,comment:h}:null,itemReviews:e},s=await d(r);if(s.success){a.default.success("Review submitted successfully!"),m(0),x("");let e={},t={};c.items.forEach((r,s)=>{let n=k(r,s,w);e[n]=0,t[n]=""}),g(e),v(t),o()}else throw Error(s.message||"Failed to submit review")}catch(e){a.default.error(e.message||"Failed to submit review")}finally{b(!1)}};return l&&c?(0,t.jsx)("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-black/30 flex items-center justify-center p-4",children:(0,t.jsx)("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Rate Your Order"}),(0,t.jsx)("button",{type:"button",className:"text-gray-400 hover:text-gray-500",onClick:o,children:(0,t.jsx)(s.FiX,{className:"h-6 w-6"})})]}),(0,t.jsxs)("form",{onSubmit:S,children:[c.riderInfo&&(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:"Rate Delivery Rider"}),(0,t.jsxs)("div",{className:"relative flex items-center mb-3",children:[(0,t.jsx)(i.default,{className:"h-10 w-10 rounded-full object-cover mr-3",src:c.riderInfo.photoUrl||"/user.png",alt:c.riderInfo.name||"rider image",width:40,height:40,onError:e=>{e.target.src="/placeholder-image.jpg"}}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-gray-800",children:c.riderInfo.name}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Delivery Rider"})]})]}),(0,t.jsxs)("div",{className:"flex items-center mb-3",children:[(0,t.jsx)("span",{className:"mr-3 text-gray-700",children:"Rating:"}),(0,t.jsx)("div",{className:"flex",children:[1,2,3,4,5].map(e=>(0,t.jsx)("button",{type:"button",className:"text-gray-300 hover:text-yellow-400 focus:outline-none transition-colors",onClick:()=>C(e,"rider"),children:(0,t.jsx)(s.FiStar,{className:"h-6 w-6 ".concat(e<=u?"text-yellow-400 fill-current":"text-gray-300")})},"rider-star-".concat(e)))}),u>0&&(0,t.jsxs)("span",{className:"ml-2 text-sm text-gray-600",children:["(",u,"/5)"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"riderComment",className:"block text-sm font-medium text-gray-700 mb-1",children:"Comment (optional)"}),(0,t.jsx)("textarea",{id:"riderComment",rows:"3",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent transition-colors text-black",value:h,onChange:e=>x(e.target.value),placeholder:"Share your experience with the delivery rider..."})]})]}),(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:"Rate Food Items"}),c.items&&c.items.length>0?(0,t.jsx)("div",{className:"space-y-4",children:c.items.map((e,r)=>{let n=k(e,r,w),a=f[n]||0;return(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 bg-gray-50",children:[(0,t.jsxs)("div",{className:"relative flex items-center mb-3",children:[(0,t.jsx)(i.default,{className:"h-12 w-12 rounded-md object-cover mr-3",src:(e=>e&&(e.startsWith("http")||e.startsWith("/"))?e:"/placeholder-image.jpg")(e.image),width:40,height:40,alt:e.title||"item image",onError:e=>{e.target.src="/placeholder-image.jpg"}}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-medium text-gray-800",children:e.title}),(0,t.jsxs)("p",{className:"text-sm text-gray-500",children:["৳",e.price," ",e.quantity>1&&"à ".concat(e.quantity)]})]}),a>0&&(0,t.jsxs)("div",{className:"bg-green-100 text-green-800 px-2 py-1 rounded-full text-xs font-medium",children:["Rated ",a,"/5"]})]}),(0,t.jsxs)("div",{className:"flex items-center mb-3",children:[(0,t.jsx)("span",{className:"mr-3 text-gray-700 text-sm",children:"Your Rating:"}),(0,t.jsx)("div",{className:"flex",children:[1,2,3,4,5].map(e=>(0,t.jsx)("button",{type:"button",className:"text-gray-300 hover:text-yellow-400 focus:outline-none transition-colors mr-1",onClick:()=>C(e,"item",n),children:(0,t.jsx)(s.FiStar,{className:"h-5 w-5 ".concat(e<=a?"text-yellow-400 fill-current":"text-gray-300")})},"".concat(n,"-star-").concat(e)))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"itemComment-".concat(n),className:"block text-sm font-medium text-gray-700 mb-1",children:"Comment (optional)"}),(0,t.jsx)("textarea",{id:"itemComment-".concat(n),rows:"2",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent transition-colors text-black",value:p[n]||"",onChange:e=>v(t=>({...t,[n]:e.target.value})),placeholder:"Share your thoughts on this item..."})]})]},n)})}):(0,t.jsx)("p",{className:"text-gray-500 text-center py-4",children:"No items in this order"})]}),(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:[(0,t.jsx)("h4",{className:"font-medium text-blue-900 mb-2",children:"Review Summary"}),(0,t.jsxs)("div",{className:"text-sm text-blue-800",children:[(0,t.jsxs)("p",{children:["⢠Rider:"," ",u>0?"".concat(u,"/5 stars"):"Not rated"]}),(0,t.jsxs)("p",{children:["⢠Items:"," ",Object.values(f).filter(e=>e>0).length," ","of ",(null==(n=c.items)?void 0:n.length)||0," rated"]}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:u>0||Object.values(f).some(e=>e>0)?"Ready to submit!":"Please rate at least one item or the rider"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,t.jsx)("button",{type:"button",className:"px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-orange-500 transition-colors",onClick:o,disabled:y,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:"px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 focus:outline-none focus:ring-2 focus:ring-orange-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",disabled:y||0===u&&!Object.values(f).some(e=>e>0),children:y?(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Submitting..."]}):"Submit Review"})]})]})]})})}):null};var o=e.i(17255);let c=e=>{let t=String(e||"").trim().toLowerCase();return"complete"===t||"completed"===t||"delivery-completed"===t?"delivered":"out for delivery"===t||"out_for_delivery"===t?"out-for-delivery":"assign to rider"===t||"assigned_to_rider"===t||"assigned"===t?"assigned":t}
1,d={pending:10,confirmed:25,preparing:50,ready:75,assigned:80,"out-for-delivery":90,delivered:100,cancelled:0},u=e=>{var r,s;let{status:n}=e,a=c(n),i={pending:"bg-yellow-100 text-yellow-800",confirmed:"bg-blue-100 text-blue-800",preparing:"bg-purple-100 text-purple-800",ready:"bg-indigo-100 text-indigo-800",assigned:"bg-cyan-100 text-cyan-800","out-for-delivery":"bg-orange-100 text-orange-800",delivered:"bg-green-100 text-green-800",cancelled:"bg-red-100 text-red-800",unknown:"bg-gray-100 text-gray-800"},l=null!=(r=({pending:"Pending",confirmed:"Confirmed",preparing:"Preparing",ready:"Ready",assigned:"Assigned to Rider","out-for-delivery":"Out for Delivery",delivered:"Delivered",cancelled:"Cancelled",unknown:"Unknown"})[a])?r:"Unknown",o=null!=(s=i[a])?s:i.unknown;return(0,t.jsx)("span",{className:"px-2 py-1 text-xs font-medium rounded-full ".concat(o),children:l})},m=e=>{let{status:r}=e;switch(c(r)){case"pending":return(0,t.jsx)(s.FiClock,{className:"text-yellow-600"});case"confirmed":return(0,t.jsx)(s.FiCheck,{className:"text-blue-600"});case"preparing":return(0,t.jsx)(s.FiPackage,{className:"text-purple-600"});case"ready":return(0,t.jsx)(s.FiPackage,{className:"text-indigo-600"});case"assigned":return(0,t.jsx)(s.FiUser,{className:"text-cyan-600"});case"out-for-delivery":return(0,t.jsx)(s.FiTruck,{className:"text-orange-600"});case"delivered":return(0,t.jsx)(s.FiCheck,{className:"text-green-600"});case"cancelled":return(0,t.jsx)(s.FiX,{className:"text-red-600"});default:return null}},h=e=>new Date(e||Date.now()).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),x=e=>{let{isOpen:x,onClose:f,userEmail:g}=e,p=(0,n.useRouter)(),[v,y]=(0,r.useState)([]),[b,w]=(0,r.useState)([]),[j,N]=(0,r.useState)(""),[k,C]=(0,r.useState)(!0),[S,E]=(0,r.useState)(null),[I,P]=(0,r.useState)(null),[L,D]=(0,r.useState)(!1),[M,T]=(0,r.useState)(null),{data:R}=(0,o.useSession)(),F=(null==R?void 0:R.user)||{},O=async()=>{if(g)try{C(!0),P(null);let e=await fetch("/api/orders?userEmail=".concat(encodeURIComponent(g)));if(!e.ok)throw Error("Failed to fetch orders: ".concat(e.status));let t=((await e.json()).orders||[]).map(e=>{var t,r;return{...e,id:String(e._id||e.id||""),status:c(e.status),orderDate:null!=(r=null!=(t=e.orderDate)?t:e.createdAt)?r:Date.now(),pricing:e.pricing||{},items:Array.isArray(e.items)?e.items:e.items?[e.items]:[],riderInfo:e.riderInfo?{...e.riderInfo,id:e.riderInfo.riderId||e.riderInfo.id||e.riderInfo._id||"",name:e.riderInfo.riderName||e.riderInfo.name||"Unknown Rider"}:null}});y(t),w(A(t,j))}catch(e){P(e.message),a.default.error("Failed to load orders. Please try again.")}finally{C(!1)}};(0,r.useEffect)(()=>{x&&g&&O()},[x,g]);let A=(e,t)=>{let r=(t||"").trim().toLowerCase();return r?e.filter(e=>(e.id||"").toLowerCase().includes(r)||c(e.status).includes(r)):e};(0,r.useEffect)(()=>{w(A(v,j))},[j,v]);let U=(e,t,r)=>{if(r&&r.stopPropagation(),!e)return void a.default.error("Rider information is not available");p.push("/riders/".concat(e)),f()},z=async e=>{try{let t={...e,orderId:M._id,userId:null==F?void 0:F.id},r=await fetch("/api/reviews",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await r.json();return s.success||a.default.error("Failed to submit review"),O(),s}catch(e){throw e}};return x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-black/30 flex items-center justify-center p-4",onClick:f,children:(0,t.jsxs)("div",{className:"align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-4xl sm:w-full max-h-[90vh] flex flex-col",onClick:e=>{e.stopPropagation()},children:[(0,t.jsxs)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)("h3",{className:"text-xl leading-6 font-medium text-gray-900",children:"Order Status Tracking"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:O,disabled:k,className:"p-2 text-gray-500 bg-gray-100 rounded-full hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 disabled:opacity-50",title:"Refresh Orders",children:(0,t.jsx)(s.FiRefreshCw,{className:"h-5 w-5 ".concat(k?"animate-spin":"")})}),(0,t.jsxs)("button",{type:"button",className:"text-gray-400 hover:text-gray-500 focus:outline-none",onClick:f,children:[(0,t.jsx)("span",{className:"sr-only",children:"Close"}),(0,t.jsx)(s.FiX,{className:"h-6 w-6"})]})]})]}),(0,t.jsxs)("div",{className:"relative mb-6",children:[(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,t.jsx)(s.FiSearch,{className:"text-gray-400"})}),(0,t.jsx)("input",{type:"text",placeholder:"Search by order ID or status...",className:"pl-10 pr-4 py-2 w-full border border-gray-300 rounded-lg focus:ring-2 focus:ring-orange-500 focus:border-transparent",value:j,onChange:e=>N(e.target.value)})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto px-4 sm:px-6",children:k?(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-orange-500"})}):I?(0,t.jsxs)("div",{className:"text-center py-8",children:[(0,t.jsx)("p",{className:"text-red-500 mb-4",children:I}),(0,t.jsx)("button",{onClick:O,className:"px-4 py-2 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors",children:"Try Again"})]}):b.length>0?(0,t.jsx)("div",{className:"space-y-4 pb-4",children:b.map(e=>{var r,n,l,o;let x=(e=>{var t;return null!=(t=d[c(e)])?t:0})(e.status);return(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"font-medium text-gray-900",children:["Order #",e.orderId||e.id]}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:h(e.orderDate)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m,{status:e.status}),(0,t.jsx)(u,{status:e.status})]})]}),(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 mb-1",children:[(0,t.jsx)("span",{children:"Order Progress"}),(0,t.jsxs)("span",{children:[x,"%"]})]}),(0,t.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,t.jsx)("div",{className:"bg-orange-500 h-2 rounded-full transition-all duration-300",style:{width:"".concat(x,"%")}
1})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm mb-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Items:"}),(0,t.jsx)("span",{className:"ml-2 font-medium",children:null!=(l=null==(r=e.items)?void 0:r.length)?l:0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Total:"}),(0,t.jsxs)("span",{className:"ml-2 font-medium",children:["à§³",null!=(o=null==(n=e.pricing)?void 0:n.total)?o:0]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Delivery:"}),(0,t.jsx)("span",{className:"ml-2 font-medium",children:h(e.estimatedDelivery)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-gray-500",children:"Payment:"}),(0,t.jsx)("span",{className:"ml-2 font-medium",children:"cash"===e.paymentMethod?"Cash on Delivery":"Card"})]})]}),(e=>{let t=c(e.status);return e.riderInfo&&["assigned","out-for-delivery","delivered"].includes(t)})(e)&&(0,t.jsxs)("div",{className:"mt-3 p-3 bg-white rounded-lg",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(s.FiUser,{className:"text-cyan-500 mr-2"}),(0,t.jsxs)("span",{className:"text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline cursor-pointer flex items-center gap-1",onClick:t=>U(e.riderInfo.id,e.riderInfo.name,t),children:[e.riderInfo.name,(0,t.jsx)(s.FiExternalLink,{className:"h-3 w-3"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{className:"text-blue-600 hover:text-blue-800 text-sm flex items-center gap-1",onClick:t=>U(e.riderInfo.id,e.riderInfo.name,t),children:[(0,t.jsx)(s.FiUser,{className:"h-4 w-4"}),"Profile"]}),(0,t.jsxs)("button",{className:"text-blue-600 hover:text-blue-800 text-sm",onClick:()=>E(S===e.id?null:e.id),children:[S===e.id?"Hide":"Show"," ","Details"]})]})]}),S===e.id&&(0,t.jsx)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:"relative h-10 w-10",children:(0,t.jsx)(i.default,{className:"rounded-full object-cover",src:e.riderInfo.photoUrl||"https://avatar.vercel.sh/".concat(e.riderInfo.riderEmail||e.riderInfo.email),alt:e.riderInfo.name,fill:!0,onError:t=>{t.target.src="https://avatar.vercel.sh/".concat(e.riderInfo.name||"rider")}})}),(0,t.jsxs)("div",{className:"flex-grow",children:[(0,t.jsx)("div",{className:"font-medium",children:e.riderInfo.name}),(0,t.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,t.jsx)(s.FiPhone,{className:"mr-1"}),e.riderInfo.riderPhone||e.riderInfo.phone||"Not provided"]}),(0,t.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,t.jsx)(s.FiMapPin,{className:"mr-1"}),e.riderInfo.currentLocation?"Lat: ".concat(e.riderInfo.currentLocation.lat,", Lng: ").concat(e.riderInfo.currentLocation.lng):"Location not available"]}),(0,t.jsxs)("div",{className:"text-sm text-gray-500",children:["Vehicle:"," ",e.riderInfo.vehicleType||"Not specified"]})]}),(0,t.jsxs)("button",{className:"px-3 py-1 bg-blue-500 text-white text-sm rounded hover:bg-blue-600 transition-colors flex items-center gap-1",onClick:t=>U(e.riderInfo.id,e.riderInfo.name,t),children:[(0,t.jsx)(s.FiExternalLink,{className:"h-3 w-3"}),"View Profile"]})]})})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{className:"flex-1 py-2 px-4 bg-orange-500 text-white rounded-md hover:bg-orange-600 transition-colors",onClick:()=>(e=>{if(!e.id)return void a.default.error("Order ID is missing");p.push("/orders/".concat(e.id)),f()})(e),children:"View Full Details"}),"delivered"===e.status&&(0,t.jsxs)("button",{className:"flex-1 py-2 px-4 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition-colors flex items-center justify-center gap-1",onClick:()=>{T(e),D(!0)},children:[(0,t.jsx)(s.FiStar,{className:"h-4 w-4"}),"Rate Order"]})]})]},e.id)})}):(0,t.jsx)("div",{className:"text-center py-8",children:(0,t.jsx)("p",{className:"text-gray-500",children:j?"No orders found matching your search.":"You have no orders yet."})})}),(0,t.jsx)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse flex-shrink-0",children:(0,t.jsx)("button",{type:"button",className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-orange-600 text-base font-medium text-white hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 sm:ml-3 sm:w-auto
1sm:text-sm",onClick:f,children:"Close"})})]})}),(0,t.jsx)(l,{isOpen:L,onClose:()=>{D(!1),T(null)},order:M,onSubmit:z})]}):null}},83990,e=>{"use strict";e.s(["default",()=>r]);var t=e.i(71645);let r=()=>((0,t.useEffect)(()=>{let e=async()=>{if("serviceWorker"in navigator)try{let e=await navigator.serviceWorker.register("/sw.js",{scope:"/"});e.addEventListener("updatefound",()=>{e.installing.addEventListener("statechange",()=>{})}),e.active}catch(e){}};"complete"===document.readyState?e():window.addEventListener("load",e)},[]),null)},82379,e=>{"use strict";e.s(["default",()=>n]);var t=e.i(43476),r=e.i(71645),s=e.i(92199);let n=()=>{let[e,n]=(0,r.useState)(!0);return((0,r.useEffect)(()=>{let e=()=>{n(!0)},t=()=>{n(!1)};return n(navigator.onLine),window.addEventListener("online",e),window.addEventListener("offline",t),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}},[]),e)?null:(0,t.jsx)("div",{className:"fixed top-16 left-0 right-0 z-40 bg-yellow-500 text-white py-3 px-4 shadow-lg",children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-center gap-3 text-sm font-medium",children:[(0,t.jsx)(s.FiWifiOff,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsx)("span",{children:"You are currently offline. Some features may be limited."})]})})}},81114,e=>{"use strict";e.s(["default",()=>n],81114);var t=e.i(43476),r=e.i(71645);let s=(0,e.i(75254).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function n(){let[e,n]=(0,r.useState)(!1),[a,i]=(0,r.useState)(0);if((0,r.useEffect)(()=>{let e=()=>{let e=window.pageYOffset||document.documentElement.scrollTop,t=document.documentElement.scrollHeight-window.innerHeight;if(t<=0){i(0),n(!1);return}i(Math.round(100*Math.min(e/t,1))),n(e>300)};return window.addEventListener("scroll",e),e(),()=>window.removeEventListener("scroll",e)},[]),!e)return null;let l=2*Math.PI*8;return(0,t.jsxs)("button",{onClick:()=>{new Audio("/audio/back-to-top.mp3").play(),window.scrollTo({top:0,behavior:"smooth"})},className:"fixed bottom-20 right-6 z-50 w-10 h-10 bg-white rounded-full shadow-xl hover:shadow-2xl transition-all duration-300 hover:scale-110 group","aria-label":"Scroll to top - ".concat(a,"% scrolled"),children:[(0,t.jsxs)("svg",{className:"absolute inset-0 w-full h-full transform -rotate-90",viewBox:"0 0 20 20",children:[(0,t.jsx)("circle",{cx:"10",cy:"10",r:8,stroke:"#fed7aa",strokeWidth:"2",fill:"none"}),(0,t.jsx)("circle",{cx:"10",cy:"10",r:8,stroke:"url(#progressGradient)",strokeWidth:"2",fill:"none",strokeDasharray:l,strokeDashoffset:l-a/100*l,strokeLinecap:"round",className:"transition-all duration-150 ease-out"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"progressGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#f97316"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#ef4444"})]})})]}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center -space-y-1",children:[(0,t.jsx)(s,{size:12,className:"text-orange-600 font-bold group-hover:-translate-y-0.5 transition-transform"}),(0,t.jsx)(s,{size:12,className:"text-orange-600 font-bold group-hover:-translate-y-0.5 transition-transform"})]})})]})}},9392,e=>{"use strict";e.s(["default",()=>n]);var t=e.i(43476),r=e.i(71645),s=e.i(92199);let n=()=>{let[e,n]=(0,r.useState)(null),[a,i]=(0,r.useState)(!1),[l,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://"))return void o(!0);let e=e=>{e.preventDefault(),n(e),setTimeout(()=>{let e=localStorage.getItem("pwaPromptDismissed"),t=e?parseInt(e):0,r=Date.now()-6048e5;(!e||t<r)&&i(!0)},3e3)},t=()=>{o(!0),i(!1),localStorage.removeItem("pwaPromptDismissed")};return window.addEventListener("beforeinstallprompt",e),window.addEventListener("appinstalled",t),()=>{window.removeEventListener("beforeinstallprompt",e),window.removeEventListener("appinstalled",t)}},[]);let c=async()=>
1{if(e)try{e.prompt();let{outcome:t}=await e.userChoice;"accepted"===t&&(n(null),i(!1),localStorage.removeItem("pwaPromptDismissed"))}catch(e){}},d=()=>{i(!1),localStorage.setItem("pwaPromptDismissed",Date.now().toString())};return l||!a?null:(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center p-4 sm:items-center sm:p-0 bg-black/30 animate-fade-in",children:(0,t.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-xl max-w-sm w-full mx-auto overflow-hidden animate-slide-up",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-orange-400 to-orange-500 p-6 text-white text-center",children:[(0,t.jsx)("div",{className:"w-16 h-16 bg-white bg-opacity-20 rounded-full flex items-center justify-center mx-auto mb-3",children:(0,t.jsx)(s.FiSmartphone,{className:"h-8 w-8"})}),(0,t.jsx)("h3",{className:"text-xl font-bold",children:"Install FastFeast"}),(0,t.jsx)("p",{className:"text-orange-100 mt-1",children:"Get the full app experience"})]}),(0,t.jsxs)("div",{className:"p-6",children:[(0,t.jsxs)("div",{className:"space-y-3 mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 bg-green-100 rounded-full flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(s.FiCheck,{className:"h-4 w-4 text-green-600"})}),(0,t.jsx)("span",{className:"text-sm text-gray-700",children:"Fast loading & offline access"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 bg-green-100 rounded-full flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(s.FiCheck,{className:"h-4 w-4 text-green-600"})}),(0,t.jsx)("span",{className:"text-sm text-gray-700",children:"Home screen shortcut"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-8 h-8 bg-green-100 rounded-full flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(s.FiCheck,{className:"h-4 w-4 text-green-600"})}),(0,t.jsx)("span",{className:"text-sm text-gray-700",children:"App-like experience"})]})]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("button",{onClick:d,className:"flex-1 py-3 px-4 border border-gray-300 text-gray-700 rounded-lg font-medium hover:bg-gray-50 transition-colors",children:"Later"}),(0,t.jsxs)("button",{onClick:c,className:"flex-1 py-3 px-4 bg-orange-500 text-white rounded-lg font-medium hover:bg-orange-600 transition-colors flex items-center justify-center gap-2",children:[(0,t.jsx)(s.FiDownload,{className:"h-4 w-4"}),"Install"]})]})]}),(0,t.jsx)("button",{onClick:d,className:"absolute top-4 right-4 text-white hover:text-orange-200 transition-colors",children:(0,t.jsx)(s.FiX,{className:"h-5 w-5"})})]})})}},44042,e=>{"use strict";e.s(["default",()=>l],44042);var t=e.i(43476),r=e.i(71645),s=e.i(46932),n=e.i(88653);let a=e=>{let{message:r}=e;return(0,t.jsx)(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex mb-4 ".concat(r.isUser?"justify-end":"justify-start"),children:(0,t.jsxs)("div",{className:"flex max-w-xs lg:max-w-md ".concat(r.isUser?"flex-row-reverse":"flex-row"," items-end space-x-2"),children:[(0,t.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center ".concat(r.isUser?"bg-orange-500":"bg-gray-300"),children:r.isUser?(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}):(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),(0,t.jsxs)("div",{className:"rounded-2xl px-4 py-2 ".concat(r.isUser?"bg-orange-500 text-white rounded-br-none":"bg-gray-200 text-gray-800 rounded-bl-none"),children:[(0,t.jsx)("p",{className:"text-sm",children:r.text}),(0,t.jsx)("p",{className:"text-xs mt-1 ".concat(r.isUser?"text-orange-200":"text-gray-500"),children:new Date(r.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})})]})]})})},i=e=>{let{onSendMessage:n}=e,[a,i]=(0,r.useState)(""),l=e=>{e.preventDefault(),a.trim()&&(n(a.trim()),i(""))};return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:["What's on the menu?","Delivery time?","Vegetarian options?","Payment methods?"].map((e,r)=>(0,t.jsx)(s.motion.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>n(e),className:"text-xs bg-orange-100 hover:bg-orange-200 text-orange-700 px-2 py-1 rounded-full transition-colors",children:e},r))}),(0,t.jsxs)("form",{onSubmit:l,className:"flex space-x-2",children:[(0,t.jsx)("input",{type:"text",value:a,onChange:e=>i(e.target.value),onKeyPress:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),l(e))},placeholder:"Type your message...",className:"flex-1 border border-gray-300 rounded-full px-4 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent"}),(0,t.jsx)(s.motion.button,{type:"submit",whileHover:{scale:1.05},whileTap:{scale:.95},disabled:!a.trim(),className:"bg-orange-500 hover:bg-orange-600 disabled:bg-gray-400 text-white rounded-full w-10 h-10 flex items-center justify-center transition-colors",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]})]})},l=()=>{let[e,l]=(0,r.useState)(!1),[o,c]=(0,r.useState)([{id:1,text:"Hello! I'm your FastFeast assistant. How can I help you with food ordering today?",isUser:!1,timestamp:new Date}]),[d,u]=(0,r.useState)(!1),m=(0,r.useRef)(null);(0,r.useEffect)(()=>{(()=>{var e;null==(e=m.current)||e.scrollIntoView({behavior:"smooth"})})()},[o]);let h=async e=>{let t={id:Date.now(),text:e,isUser:!0,timestamp:new Date};c(e=>[...e,t]),u(!0);try{let t=(e=>{let t=e.toLowerCase();return t.includes("menu")||t.includes("food")||t.includes("dish")||t.includes("what can i order")?"We have a wide variety of cuisines! ð½ï¸\n⢠Indian: Curries, Biryani, Tandoori\n⢠Thai: Pad Thai, Tom Yum, Green Curry\n⢠Italian: Pizza, Pasta, Risotto\n⢠Chinese: Noodles, Fried Rice, Dim Sum\n⢠Japanese: Sushi, Ramen, Tempura\n⢠And much more! Browse our menu to see everything.":t.includes("indian")?"We have delicious Indian cuisine! ð\nPopular dishes: Butter Chicken, Palak Paneer, Biryani, Samosas, Naan bread. Many vegetarian options available!":t.includes("thai")?"Love Thai food! ð\nWe offer: Pad Thai, Tom Yum Soup, Green/Red Curry, Satay, Papaya Salad. Perfect balance of sweet, sour, and spicy!":t.includes("pizza")||t.includes("italian")?"Our pizzas are amazing! ð\nWe have Margherita, Pepperoni, BBQ Chicken, Vegetarian, and Supreme. All pizzas come with crispy crust and fresh toppings!":t.includes("delivery")||t.includes("time")||t.includes("how long")?"ð Delivery times:\n⢠Standard: 30-45 minutes\n⢠Peak hours: 45-60 minutes\n⢠Express delivery available for +à§³50 (25-35 minutes)\nWe'll send real-time tracking updates!":t.includes("area")||t.includes("location")||t.includes("deliver to")?"ð We deliver to: Dhanmondi, Mirpur, Uttara, Banani, Gulshan, and surrounding areas. Enter your address at checkout to confirm delivery availability!":t.includes("price")||t.includes("cost")||t.includes("expensive")||t.includes("how much")?"ð° Price ranges:\n⢠Appetizers: à§³150-à§³300\n⢠Main dishes: à§³250-à§³500\n⢠Combos: à§³400-à§³700\n⢠Desserts: à§³100-à§³250\nCheck our 'Special Offers' for great discounts!":t.includes("discount")||t.includes("offer")||t.includes("promo")||t.includes("coupon")?"ð Current offers:\n⢠20% off on first order\n⢠Free delivery over à§³500\n⢠Combo meal discounts\n⢠Happy hour specials (3 PM - 6 PM)\n⢠Weekend family deals":t.includes("vegetarian")||t.includes("veg")?"ð± Vegetarian options:\n⢠Palak Paneer, Veg Biryani, Paneer Butter Masala\n⢠Margherita Pizza, Veg Pasta\n⢠Thai Veg Curry, Tofu dishes\n⢠Salads, Soups, Appetizers\nLook for the 'Vegetarian' tag on menu items!":t.includes("vegan")?"ð¿ Vegan options available!\n⢠Dal Tadka, Veg Curry, Rice dishes\n⢠Thai Veg dishes (request no fish sauce)\n⢠Salads, Soups, Spring Rolls\n⢠Specify 'vegan' in order notes for customization":t.includes("spicy")||t.includes("hot")?"ð¶ï¸ Spice levels:\n⢠Mild: Little to no spice\n⢠Medium: Balanced flavor\n⢠Hot: Authentic spicy\n⢠Extra Hot: Very spicy\nYou can specify your preferred spice level when ordering!":t.includes("order")||t.includes("how to order")||t.includes("place order")?"ð± How to order:\n1. Browse menu & add items to cart\n2. Choose delivery address\n3. Select payment method\n4. Confirm order\n5. Track delivery in real-time!\nMinimum order: à§³200":t.includes("track")||t.includes("where is my order")||t.includes("status")?"ð¦ Order tracking:\n⢠Go to 'My Orders' in your profile\n⢠View real-time delivery status\n⢠See estimated delivery time\n⢠Contact rider directly if needed\nNeed help with a specific order?":t.includes("payment")||t.includes("pay")||t.includes("card")||t.includes("cash")?"ð³ Payment options:\n⢠Cash on Delivery\n⢠Credit/Debit Cards\n⢠bKash, Nagad, Rocket\n⢠Bank Transfer\nAll online payments are secure!":t.includes("contact")||t.includes("phone")||t.includes("number")||t.includes("help")?"ð Customer support:\n⢠Phone: +880 XXXX-XXXXXX\n⢠Email: [email protected]\n⢠Live chat: Available 9 AM - 11 PM\n⢠Emergency: 24/7 for order issues":t.includes("complaint")||t.includes("problem")||t.includes("issue")?"ð Sorry to hear you're having issues! Please contact our support team directly at +880 XXXX-XXXXXX or email [email protected] for immediate assistance.":t.includes("hello")||t.includes("hi")||t.includes("hey")?"ð Hello! Welcome to FastFeast! I'm here to help you with:\n⢠Menu recommendations\n⢠Delivery information\n⢠Pricing & offers\n⢠Dietary requirements\n⢠Order tracking\nWhat would you like to know?":t.includes("thank")||t.includes("thanks")?"You're welcome! ð Happy to help! Is there anything else you'd like to know about our food or delivery service?":t.includes("bye")||t.includes("goodbye")?"Goodbye! ð Enjoy your meal and feel free to chat again if you need anything!":"I'm here to help with your food delivery needs! ð You can ask me about:\n⢠Menu items & cuisines\n⢠Delivery times & areas\n⢠Pricing & special offers\n⢠Vegetarian/vegan options\n⢠How to place orders\n⢠Payment methods\n⢠Order tracking\nWhat would you like to know?"})(e);setTimeout(()=>
1{let e={id:Date.now()+1,text:t,isUser:!1,timestamp:new Date};c(t=>[...t,e]),u(!1)},1e3)}catch(t){let e={id:Date.now()+1,text:"I'm sorry, I'm having trouble responding right now. Please try again later.",isUser:!1,timestamp:new Date};c(t=>[...t,e]),u(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.motion.button,{className:"fixed bottom-6 right-6 z-50 w-12 h-12 bg-orange-500 hover:bg-orange-600 rounded-full shadow-lg flex items-center justify-center text-white transition-all duration-300",whileHover:{scale:1.1},whileTap:{scale:.9},onClick:()=>l(!e),children:e?(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[" ",(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})]}):(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[" ",(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})]})}),(0,t.jsx)(n.AnimatePresence,{children:e&&(0,t.jsxs)(s.motion.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},className:"fixed bottom-20 right-6 z-50 w-72 h-80 bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden border border-gray-200",children:[(0,t.jsxs)("div",{className:"bg-orange-500 px-3 py-2 flex items-center justify-between",children:[" ",(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})," ",(0,t.jsx)("h3",{className:"text-white font-semibold text-sm",children:"FastFeast Assistant"})," "]}),(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,t.jsx)("button",{onClick:()=>{c([{id:1,text:"Hello! I'm your FastFeast assistant. How can I help you with food ordering today?",isUser:!1,timestamp:new Date}])},className:"text-white hover:text-orange-200 transition-colors",title:"Clear chat",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[" ",(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})]})}),(0,t.jsx)("button",{onClick:()=>l(!1),className:"text-white hover:text-orange-200 transition-colors",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[" ",(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})]})})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-3 bg-gray-50",children:[" ",o.map(e=>(0,t.jsx)(a,{message:e},e.id)),d&&(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[" ",(0,t.jsxs)("div",{className:"w-6 h-6 bg-orange-100 rounded-full flex items-center justify-center",children:[" ",(0,t.jsx)("div",{className:"w-1.5 h-1.5 bg-orange-500 rounded-full animate-bounce"})," "]}),(0,t.jsxs)("div",{className:"bg-gray-200 rounded-2xl px-3 py-1.5 max-w-xs",children:[" ",(0,t.jsxs)("div",{className:"flex space-x-1",children:[(0,t.jsx)("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-pulse"})," ",(0,t.jsx)("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,t.jsx)("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]})]})]}),(0,t.jsx)("div",{ref:m})]}),(0,t.jsxs)("div",{className:"border-t border-gray-200 p-2 bg-white",children:[" ",(0,t.jsx)(i,{onSendMessage:h})]})]})})]})}},36662,e=>{"use strict";e.s(["default",()=>s]);var t=e.i(43476),r=e.i(71645);let s=()=>{let[e,s]=(0,r.useState)(!1),[n,a]=(0,r.useState)({activeUsers:0,loggedInUsers:0,anonymousUsers:0,ordersInProgress:0,deliveriesActive:0,popularItems:[]}),[i,l]=(0,r.useState)(!0),[o,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(new Date),[m,h]=(0,r.useState)({x:0,y:0}),[x,f]=(0,r.useState)(!1),[g,p]=(0,r.useState)(!1),[v,y]=(0,r.useState)(!1),b=(0,r.useRef)(0),w=(0,r.useRef)({x:0,y:0}),j=(0,r.useRef)(null),N=(0,r.useRef)(null),k=(0,r.useRef)(!1),C=(0,r.useRef)(!1),S=(0,r.useRef)(!1),E=async()=>
1{if(i&&S.current){c(!0);try{let e=await fetch("/api/live-traffic?t=".concat(Date.now()));if(!e.ok)throw Error("Network response was not ok");let t=await e.json();t.success&&(a(t.data),u(new Date),b.current+=1)}catch(e){}finally{c(!1)}}},I=async()=>{if(S.current)try{let e=(()=>{let e=localStorage.getItem("ff_sessionId");return e||(e="ff_"+Math.random().toString(36).substr(2,16)+"_"+Date.now(),localStorage.setItem("ff_sessionId",e)),e})();if(!e)return;await fetch("/api/track-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e})})}catch(e){}};(0,r.useLayoutEffect)(()=>{let e=()=>{h({x:window.innerWidth-40-20,y:84}),p(!0)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let P=e=>{var t,r;if(!x)return;let s=e.clientX-w.current.x,n=e.clientY-w.current.y,a=(null==(t=j.current)?void 0:t.offsetWidth)||40,i=(null==(r=j.current)?void 0:r.offsetHeight)||40,l=window.innerWidth-a;h({x:Math.max(0,Math.min(s,l)),y:Math.max(74,Math.min(n,window.innerHeight-i))})},L=()=>f(!1);return(0,r.useEffect)(()=>(x&&(document.addEventListener("mousemove",P),document.addEventListener("mouseup",L),document.body.style.userSelect="none",document.body.style.cursor="grabbing"),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",L),document.body.style.userSelect="",document.body.style.cursor=""}),[x]),(0,r.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]),(0,r.useEffect)(()=>{!k.current&&S.current&&(E(),k.current=!0),!C.current&&S.current&&(I(),C.current=!0)},[]),(0,r.useEffect)(()=>{e&&S.current&&(E(),I())},[e]),(0,r.useEffect)(()=>{let t=()=>{l(!0),e&&S.current&&(E(),I())},r=()=>l(!1);return window.addEventListener("online",t),window.addEventListener("offline",r),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}},[e]),(0,t.jsx)(t.Fragment,{children:g&&(0,t.jsxs)("div",{ref:j,className:"fixed z-[60] cursor-move",style:{left:"".concat(m.x,"px"),top:"".concat(m.y,"px"),transform:x?"scale(1.1)":"scale(1)",transition:x?"none":"transform 0.2s ease, left 0.2s ease, top 0.2s ease"},children:[(0,t.jsxs)("button",{onMouseDown:e=>{0===e.button&&(f(!0),w.current={x:e.clientX-m.x,y:e.clientY-m.y},e.preventDefault())},onClick:()=>{x||(e?(y(!0),setTimeout(()=>{s(!1),y(!1)},200)):(s(!0),y(!0),E(),I(),setTimeout(()=>y(!1),300)))},className:"relative flex items-center justify-center w-10 h-10 rounded-full shadow-lg transition-all duration-300 ".concat(e?"bg-red-500":"bg-green-500 hover:bg-green-600"," ").concat(x?"shadow-2xl cursor-grabbing":"cursor-pointer"," text-white group"),children:[(0,t.jsxs)("span",{className:"absolute -top-1 -right-1 flex h-3 w-3",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-3 w-3 ".concat(o?"bg-yellow-500":"bg-red-500")})]}),(0,t.jsx)("div",{className:"absolute -bottom-1 -left-1 text-white opacity-60 transition-opacity ".concat(x?"opacity-100":"group-hover:opacity-100 opacity-0"),children:(0,t.jsx)("svg",{className:"w-2 h-2",fill:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M20 9H4v2h16V9zM4 15h16v-2H4v2z"})})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-sm font-bold ".concat(o?"animate-pulse":""),children:o?"...":n.activeUsers}),(0,t.jsx)("div",{className:"text-[8px] leading-tight mt-[-1px] opacity-90",children:"Online"})]}),(0,t.jsx)("div",{className:"absolute right-full mr-2 top-1/2 transform -translate-y-1/2 px-2 py-1 bg-gray-800 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none",children:x?"Dragging...":"Click to ".concat(e?"close":"open"," ⢠Drag to move")})]}),(e||v)&&(0,t.jsxs)("div",{ref:N,className:"absolute top-12 right-0 w-80 bg-white rounded-lg shadow-xl border border-gray-200 overflow-hidden ".concat(v?e?"animate-in slide-in-from-top-2 fade-in duration-300 ease-out":"animate-out slide-out-to-top-2 fade-out duration-200 ease-in":"animate-in slide-in-from-top-2 fade-in duration-300 ease-out"),children:[(0,t.jsx)("div",{className:"bg-gradient-to-r from-green-500 to-blue-500 p-4 rounded-t-lg text-white",children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-bold text-lg",children:"Live Traffic"}),(0,t.jsx)("p",{className:"text-sm opacity-90 mt-1",children:"Real-time platform activity"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("button",{onClick:E,className:"p-1 hover:bg-white/20 rounded transition-colors ".concat(o?"animate-spin":""),title:"Refresh data",children:(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full ".concat(o?"bg-yellow-300":i?"bg-green-300":"bg-red-300")}),(0,t.jsx)("span",{className:"text-sm",children:o?"Updating...":i?"Live":"Offline"})]})]})]})}),(0,t.jsxs)("div",{className:"p-4 space-y-4 max-h-96 overflow-y-auto",children:[(0,t.jsxs)("div",{className:"bg-blue-50 border-2 border-blue-200 rounded-lg p-4 transition-all duration-300 hover:shadow-md",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h4",{className:"font-bold text-lg text-blue-800",children:"Active Users"}),(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),(0,t.jsx)("span",{className:"text-xs text-blue-600",children:"Live"})]})]}),(0,t.jsxs)("div",{className:"text-center mb-4",children:[(0,t.jsx)("div",{className:"text-3xl font-bold text-blue-700 mb-1 transition-all duration-300",children:o?"...":n.activeUsers}),(0,t.jsx)("div",{className:"text-sm text-blue-600",children:"Currently Online"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-center",children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg p-2 border border-blue-100 transition-all duration-300 hover:scale-105",children:[(0,t.jsx)("div",{className:"text-lg font-bold text-green-600",children:o?"...":n.loggedInUsers}),(0,t.jsx)("div",{className:"text-xs text-gray-600",children:"Logged In"})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg p-2 border border-blue-100 transition-all duration-300 hover:scale-105",children:[(0,t.jsx)("div",{className:"text-lg font-bold text-purple-600",children:o?"...":n.anonymousUsers}),(0,t.jsx)("div",{className:"text-xs text-gray-600",children:"Guest Users"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h4",{className:"font-bold text-gray-700 text-sm uppercase tracking-wide",children:"Platform Activity"}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-orange-50 border border-orange-200 rounded-lg transition-all duration-300 hover:shadow-md",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 bg-orange-100 rounded-full flex items-center justify-center transition-all duration-300 hover:scale-110",children:(0,t.jsx)("span",{className:"text-lg",children:"ð¦"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-gray-600",children:"Orders in Progress"}),(0,t.jsx)("div",{className:"text-xl font-bold text-orange-700 transition-all duration-300",children:o?"...":n.ordersInProgress})]})]}),(0,t.jsx)("div",{className:"text-xs text-orange-600 bg-orange-100 px-2 py-1 rounded-full transition-all duration-300 hover:scale-105",children:"Active"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-green-50 border border-green-200 rounded-lg transition-all duration-300 hover:shadow-md",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 bg-green-100 rounded-full flex items-center justify-center transition-all duration-300 hover:scale-110",children:(0,t.jsx)("span",{className:"text-lg",children:"ð"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-gray-600",children:"Active Deliveries"}),(0,t.jsx)("div",{className:"text-xl font-bold text-green-700 transition-all duration-300",children:o?"...":n.deliveriesActive})]})]}),(0,t.jsx)("div",{className:"text-xs text-green-600 bg-green-100 px-2 py-1 rounded-full transition-all duration-300 hover:scale-105",children:"On Route"})]})]}),(0,t.jsxs)("div",{className:"pt-3 border-t border-gray-200",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,t.jsx)("h4",{className:"font-bold text-gray-700 text-sm uppercase tracking-wide",children:"Trending Now"}),(0,t.jsx)("span",{className:"text-xs ".concat(o?"text-yellow-500 animate-pulse":"text-gray-500"),children:o?"Updating...":"Live"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[n.popularItems.map((e,r)=>(0,t.jsx)("span",{className:"px-3 py-2 bg-gradient-to-r from-purple-100 to-pink-100 text-purple-800 rounded-lg text-sm font-medium border border-purple-200 transition-all duration-300 hover:scale-105 hover:shadow-md ".concat(o?"opacity-70":""),children:e},r)),0===n.popularItems.length&&(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"No trending items"})]})]}),(0,t.jsxs)("div",{className:"pt-3 border-t border-gray-200",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs text-gray-500",children:[(0,t.jsx)("span",{children:o?"Updating...":"Updated ".concat(d.toLocaleTimeString())}),(0,t.jsxs)("span",{children:["Update #",b.current]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-2 mt-3 text-center",children:[(0,t.jsxs)("div",{className:"bg-gray-50 rounded p-2 transition-all duration-300 hover:shadow-sm",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Users"}),(0,t.jsx)("div",{className:"text-sm font-bold text-gray-700",children:o?"...":n.activeUsers})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded p-2 transition-all duration-300 hover:shadow-sm",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Orders"}),(0,t.jsx)("div",{className:"text-sm font-bold text-gray-700",children:o?"...":n.ordersInProgress})]}),(0,t.jsxs)("div",{className:"bg-gray-50 rounded p-2 transition-all duration-300 hover:shadow-sm",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Deliveries"}),(0,t.jsx)("div",{className:"text-sm font-bold text-gray-700",children:o?"...":n.deliveriesActive})]})]}),(0,t.jsx)("div",{className:"mt-2 text-center",children:(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"ð¡ Drag the button to move it anywhere"})})]})]})]})]})})}},57214,e=>{e.v(e=>Promise.resolve().then(()=>e(60499)))},67968,e=>{e.v(t=>Promise.all(["static/chunks/2c5732a5e9bf41fe.js"].map(t=>e.l(t))).then(()=>t(92599)))}]);
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.