1import{c as v,r as n,j as e}from"./index-CAG7YFZd.js";import{q as y,r}from"./adminFallbackData-JeO33_Cp.js";import{D as R,a as C,b as k,c as A,d as T,e as d}from"./dropdown-menu-CfBNnlBC.js";import{D as S,a as D,d as O,b as F}from"./dialog-GAffG_et.js";import{e as M,a as E,b as _,c as V}from"./reportsExportUtils-D-C_hyhP.js";import{C as I}from"./calendar-Cj5amzTI.js";import{C as u}from"./chevron-down-C3dIF40-.js";import{F as L}from"./funnel-C1MWZjMq.js";import{D as z}from"./dollar-sign-Bkg2LpRG.js";import{F as p}from"./file-text-7Q36_7-K.js";import{S as H}from"./search-B8wRtotC.js";import{D as P}from"./download-DJSvN6gr.js";import{F as q}from"./file-spreadsheet-CLzZZJ2P.js";import{C as B}from"./code-BaqM25-r.js";import{S as b}from"./settings-Dn_VLM_1.js";import{C as J}from"./circle-alert-B8aywgyO.js";import"./index-QHXycSr2.js";import"./index-CBAjRXir.js";import"./index-CHqH92X0.js";import"./index-r6P5ANRq.js";import"./index-Cf6hN_Fs.js";import"./tslib.es6-CwyXKlH1.js";import"./index-DnCL3ZlK.js";import"./index-Dc0kaaFU.js";import"./index-gW1jScX8.js";import"./chevron-right-DFSfj0ll.js";import"./x-BCVCJpKG.js";const Q=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],$=v("clipboard-list",Q);function we(){const[o,f]=n.useState(""),[h,G]=n.useState(y),[l,c]=n.useState({dateRange:"",restaurant:"All Restaurants"}),[j,x]=n.useState(!1),a=n.useMemo(()=>{let t=[...h];if(o.trim()){const s=o.toLowerCase().trim();t=t.filter(w=>w.restaurantName?.toLowerCase().includes(s))}return l.restaurant!=="All Restaurants"&&(t=t.filter(s=>s.restaurantName===l.restaurant)),t},[h,o,l]);a.length;const i=t=>{if(a.length===0){alert("No data to export");return}const s=[{key:"sl",label:"SI"},{key:"restaurantName",label:"Restaurant Info"},{key:"totalOrder",label:"Total Order"},{key:"totalOrderAmount",label:"Total Order Amount"},{key:"taxAmount",label:"Tax Amount"}];switch(t){case"csv":V(a,s,"restaurant_vat_report");break;case"excel":_(a,s,"restaurant_vat_report");break;case"pdf":E(a,s,"restaurant_vat_report","Restaurant VAT Report");break;case"json":M(a,"restaurant_vat_report");break}},g=()=>{},N=()=>{c({dateRange:"",restaurant:"All Restaurants"})},m=(l.dateRange?1:0)+(l.restaurant!=="All Restaurants"?1:0);return e.jsxs("div",{className:"p-4 lg:p-6 bg-slate-50 min-h-screen overflow-x-hidden",children:[e.jsxs("div",{className:"w-full max-w-full",children:[e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6 mb-6",children:e.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Restaurant Tax Report"})}),e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6 mb-6",children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-end gap-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 flex-1",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Date Range"}),e.jsxs("div",{className:"relative",children:[e.jsx(I,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),e.jsx("input",{type:"text",value:l.dateRange,onChange:t=>c(s=>({...s,dateRange:t.target.value})),placeholder:"11/27/2025 - 12/03/2025",className:"w-full pl-10 pr-4 py-2.5 text-sm rounded-lg border border-slate-300 bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]}),e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Select Restaurant"}),e.jsxs("select",{value:l.restaurant,onChange:t=>c(s=>({...s,restaurant:t.target.value})),className:"w-full px-4 py-2.5 pr-8 text-sm rounded-lg border border-slate-300 bg-white text-slate-700 appearance-none cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500",children:[e.jsx("option",{value:"All Restaurants",children:"All Restaurants"}),e.jsx("option",{value:"Caf� Monarch",children:"Caf� Monarch"}),e.jsx("option",{value:"Hungry Puppets",children:"Hungry Puppets"}),e.jsx("option",{value:"Cheesy Restaurant",children:"Cheesy Restaurant"}),e.jsx("option",{value:"Cheese Burger",children:"Cheese Burger"}),e.jsx("option",{value:"Frying Nemo",children:"Frying Nemo"})]}),e.jsx(u,{className:"absolute right-2 bottom-2.5 w-4 h-4 text-slate-500 pointer-events-none"})]})]}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx("button",{onClick:N,className:"px-6 py-2.5 text-sm font-medium rounded-lg border border-slate-300 bg-white text-slate-700 hover:bg-slate-50 transition-all",children:"Reset"}),e.jsxs("button",{onClick:g,className:`px-6 py-2.5 text-sm font-medium rounded-lg bg-blue-500 text-white hover:bg-blue-600 transition-all flex items-center gap-2 relative ${m>0?"ring-2 ring-blue-300":""}`,children:[e.jsx(L,{className:"w-4 h-4"}),"Filter",m>0&&e.jsx("span",{className:"absolute -top-1 -right-1 w-5 h-5 bg-emerald-500 text-white rounded-full text-[10px] flex items-center justify-center font-bold",children:m})]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-bold text-slate-900 mb-1",children:"Total Orders"}),e.jsx("p",{className:"text-xs text-slate-600 mb-2",children:"Total Orders"}),e.jsx("p",{className:"text-3xl font-bold text-blue-600",children:r.totalOrders}),e.jsx("p",{className:"text-lg font-semibold text-blue-600 mt-1",children:r.totalOrders})]}),e.jsx("div",{className:"w-12 h-12 rounded-lg bg-blue-100 flex items-center justify-center flex-shrink-0",children:e.jsx($,{className:"w-7 h-7 text-blue-600"})})]})}),e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-bold text-slate-900 mb-1",children:"Total Order Amount"}),e.jsx("p",{className:"text-xs text-slate-600 mb-2",children:"Total Order Amount"}),e.jsx("p",{className:"text-3xl font-bold text-green-600",children:r.totalOrderAmount}),e.jsx("p",{className:"text-lg font-semibold text-green-600 mt-1",children:r.totalOrderAmount})]}),e.jsx("div",{className:"w-12 h-12 rounded-lg bg-yellow-100 flex items-center justify-center flex-shrink-0",children:e.jsx(z,{className:"w-7 h-7 text-yellow-600"})})]})}),e.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-bold text-slate-900 mb-1",children:"Total Tax Amount"}),e.jsx("p",{className:"text-xs text-slate-600 mb-2",children:"Total Tax Amount"}),e.jsx("p",{className:"text-3xl font-bold text-red-600",children:r.totalTaxAmount}),e.jsx("p",{className:"text-lg font-semibold text-red-600 mt-1",children:r.totalTaxAmount})]}),e.jsx("div",{className:"w-12 h-12 rounded-lg bg-purple-100 flex items-center justify-center flex-shrink-0",children:e.jsx(p,{className:"w-7 h-7 text-purple-600"})})]})})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-900",children:"All Restaurant Taxes"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-initial min-w-[200px]",children:[e.jsx("input",{type:"text",placeholder:"Ex: Name",value:o,onChange:t=>f(t.target.value),className:"pl-4 pr-10 py-2.5 w-full text-sm rounded-lg border border-slate-300 bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}),e.jsx(H,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"})]}),e.jsxs(R,{children:[e.jsx(C,{asChild:!0,children:e.jsxs("button",{className:"px-4 py-2.5 text-sm font-medium rounded-lg border border-slate-300 bg-white hover:bg-slate-50 text-slate-700 flex items-center gap-2 transition-all",children:[e.jsx(P,{className:"w-4 h-4"}),e.jsx("span",{className:"text-black font-bold",children:"Export"}),e.jsx(u,{className:"w-3 h-3"})]})}),e.jsxs(k,{align:"end",className:"w-56 bg-white border border-slate-200 rounded-lg shadow-lg z-50 animate-in fade-in-0 zoom-in-95 duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",children:[e.jsx(A,{children:"Export Format"}),e.jsx(T,{}),e.jsxs(d,{onClick:()=>i("csv"),className:"cursor-pointer",children:[e.jsx(p,{className:"w-4 h-4 mr-2"}),"Export as CSV"]}),e.jsxs(d,{onClick:()=>i("excel"),className:"cursor-pointer",children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),"Export as Excel"]}),e.jsxs(d,{onClick:()=>i("pdf"),className:"cursor-pointer",children:[e.jsx(p,{className:"w-4 h-4 mr-2"}),"Export as PDF"]}),e.jsxs(d,{onClick:()=>i("json"),className:"cursor-pointer",children:[e.jsx(B,{className:"w-4 h-4 mr-2"}),"Export as JSON"]})]})]}),e.jsx("button",{onClick:()=>x(!0),className:"p-2.5 rounded-lg border border-slate-300 bg-white hover:bg-slate-50 text-slate-700 transition-all",children:e.jsx(b,{className:"w-5 h-5"})})]})]}),a.length===0?e.jsx("div",{className:"py-20 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-20 h-20 rounded-lg bg-slate-200 flex items-center justify-center mb-4",children:e.jsx(J,{className:"w-12 h-12 text-slate-500"})}),e.jsx("p",{className:"text-lg font-semibold text-slate-700 mb-2",children:"No Data Found"})]})}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:"SI"}),e.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:"Restaurant Info"}),e.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:"Total Order"}),e.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:"Total Order Amount"}),e.jsx("th",{className:"px-4 py-3 text-left text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:"Tax Amount"}),e.jsx("th",{className:"px-4 py-3 text-center text-[10px] font-bold text-slate-700 uppercase tracking-wider",children:"Action"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-slate-100",children:a.map(t=>e.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[e.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:t.sl})}),e.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-3",children:[t.icon&&e.jsx("img",{src:t.icon,alt:t.restaurantName,className:"w-8 h-8 rounded"}),e.jsx("span",{className:"text-sm text-slate-700",children:t.restaurantName})]})}),e.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:e.jsx("span",{className:"text-sm font-medium text-slate-900",children:t.totalOrder})}),e.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:e.jsx("span",{className:"text-sm font-medium text-slate-900",children:t.totalOrderAmount})}),e.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:e.jsx("span",{className:"text-sm font-medium text-slate-900",children:t.taxAmount})}),e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{className:"text-blue-600 hover:text-blue-800 text-sm font-medium",children:"View"})})]},t.sl))})]})})]})]}),e.jsx(S,{open:j,onOpenChange:x,children:e.jsxs(D,{className:"max-w-md bg-white p-0 o
1pacity-0 data-[state=open]:opacity-100 data-[state=closed]:opacity-0 transition-opacity duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:scale-100 data-[state=closed]:scale-100",children:[e.jsx(O,{className:"px-6 pt-6 pb-4",children:e.jsxs(F,{className:"flex items-center gap-2",children:[e.jsx(b,{className:"w-5 h-5"}),"Report Settings"]})}),e.jsx("div",{className:"px-6 pb-6",children:e.jsx("p",{className:"text-sm text-slate-700",children:"Restaurant VAT report settings and preferences will be available here."})}),e.jsx("div",{className:"px-6 pb-6 flex items-center justify-end",children:e.jsx("button",{onClick:()=>x(!1),className:"px-4 py-2 text-sm font-medium rounded-lg bg-emerald-500 text-white hover:bg-emerald-600 transition-all shadow-md",children:"Close"})})]})})]})}export{we 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.