1import{r,j as e,L as U,t as G}from"./index-CAG7YFZd.js";import{a as N}from"./index-BTR0BB7t.js";import{D as Ce,a as Se,b as De,c as Fe,d as Ie,e as k}from"./dropdown-menu-CfBNnlBC.js";import{D as Ae,a as Te,d as Ee,b as Re}from"./dialog-GAffG_et.js";import{e as Oe,a as _e,b as Pe,c as Me}from"./reportsExportUtils-D-C_hyhP.js";import{A as Le}from"./AdminListPagination-CZIi3EDx.js";import{s as ze,e as Be}from"./image9-D5ryKycw.js";import{C as Ve}from"./chart-column-DLv6I3WE.js";import{C as f}from"./chevron-down-C3dIF40-.js";import{R as He}from"./refresh-cw-mBJxYJSp.js";import{F as K}from"./file-text-7Q36_7-K.js";import{F as We}from"./file-spreadsheet-CLzZZJ2P.js";import{C as Ze}from"./code-BaqM25-r.js";import{S as X}from"./settings-Dn_VLM_1.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 $e="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23FEF3C7'/%3e%3ccircle%20cx='32'%20cy='32'%20r='16'%20fill='%23F59E0B'/%3e%3cpath%20d='M32%2024V32L38%2036'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M32%2012V16'%20stroke='%23D97706'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e",qe="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23DBEAFE'/%3e%3ccircle%20cx='32'%20cy='32'%20r='16'%20fill='%233B82F6'/%3e%3cpath%20d='M26%2032L30%2036L38%2028'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Je="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23DCFCE7'/%3e%3ccircle%20cx='32'%20cy='32'%20r='16'%20fill='%2322C55E'/%3e%3cpath%20d='M24%2032L30%2038L41%2026'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Qe="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23EDE9FE'/%3e%3ccircle%20cx='32'%20cy='32'%20r='16'%20fill='%238B5CF6'/%3e%3cpath%20d='M32%2023V32'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'/%3e%3ccircle%20cx='32'%20cy='39'%20r='2'%20fill='white'/%3e%3c/svg%3e",Ye="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23E0F2FE'/%3e%3cpath%20d='M16%2036H39L45%2029H53V39H49C48.4%2042.4%2045.5%2045%2042%2045C38.5%2045%2035.6%2042.4%2035%2039H27C26.4%2042.4%2023.5%2045%2020%2045C16.5%2045%2013.6%2042.4%2013%2039H11V34C11%2032.9%2011.9%2032%2013%2032H16V36Z'%20fill='%230284C7'/%3e%3ccircle%20cx='20'%20cy='39'%20r='4'%20fill='white'/%3e%3ccircle%20cx='42'%20cy='39'%20r='4'%20fill='white'/%3e%3c/svg%3e",Ue="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23D1FAE5'/%3e%3ccircle%20cx='32'%20cy='32'%20r='16'%20fill='%23059669'/%3e%3cpath%20d='M24%2032L30%2038L41%2026'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Ge="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23FEE2E2'/%3e%3ccircle%20cx='32'%20cy='32'%20r='16'%20fill='%23EF4444'/%3e%3cpath%20d='M26%2026L38%2038'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'/%3e%3cpath%20d='M38%2026L26%2038'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c/svg%3e",Ke="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23FFEDD5'/%3e%3ccircle%20cx='32'%20cy='32'%20r='16'%20fill='%23F97316'/%3e%3cpath%20d='M32%2024V34'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'/%3e%3ccircle%20cx='32'%20cy='40'%20r='2'%20fill='white'/%3e%3c/svg%3e",Xe="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4'%20y='4'%20width='56'%20height='56'%20rx='14'%20fill='%23CCFBF1'/%3e%3ccircle%20cx='32'%20cy='32'%20r='16'%20fill='%2314B8A6'/%3e%3cpath%20d='M40%2028V22L24%2022L28%2018M24%2022L28%2026'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M24%2034C24%2038.4%2027.6%2042%2032%2042C36.4%2042%2040%2038.4%2040%2034'%20stroke='white'%20stroke-width='3'%20stroke-linecap='round'/%3e%3c/svg%3e",et={Scheduled:{label:"Scheduled Orders",color:"text-amber-600",bg:"bg-amber-50",icon:$e},Pending:{label:"Pending Orders",color:"text-blue-600",bg:"bg-blue-50",icon:qe},Accepted:{label:"Accepted Orders",color:"text-sky-600",bg:"bg-sky-50",icon:Je},Processing:{label:"Processing Orders",color:"text-indigo-600",bg:"bg-indigo-50",icon:Qe},"Food On The Way":{label:"Food On The Way",color:"text-cyan-600",bg:"bg-cyan-50",icon:Ye},Delivered:{label:"Delivered",color:"text-emerald-600",bg:"bg-emerald-50",icon:Ue},Canceled:{label:"Canceled",color:"text-red-600",bg:"bg-red-50",icon:Ge},"Payment Failed":{label:"Payment Failed",color:"text-orange-600",bg:"bg-orange-50",icon:Ke},Refunded:{label:"Refunded",color:"text-teal-600",bg:"bg-teal-50",icon:Xe}};function Dt(){const[d,ee]=r.useState([]),[E,R]=r.useState(!0),[C,O]=r.useState(!1),[_,S]=r.useState(null),[te,se]=r.useState([]),[D,ae]=r.useState([]),[re,le]=r.useState([]),[ne,oe]=r.useState(0),[P,M]=r.useState({total:0,Scheduled:0,Pending:0,Accepted:0,Processing:0,"Food On The Way":0,Delivered:0,Canceled:0,"Payment Failed":0,Refunded:0}),[l,L]=r.useState({zone:"All Zones",restaurant:"All restaurants",customer:"All customers",time:"All Time"}),[F,z]=r.useState(""),[I,B]=r.useState(""),[w,p]=r.useState(1),[b,ie]=r.useState(()=>Number(localStorage.getItem("admin_order_report_pageSize"))||20),[ce,de]=r.useState(0),[xe,A]=r.useState(!1);r.useEffect(()=>{const t=setTimeout(()=>B(F.trim()),300);return()=>clearTimeout(t)},[F]),r.useEffect(()=>{p(1)},[I,l]),r.useEffect(()=>{(async()=>{try{const s=await N.getZones({limit:1e3,isActive:!0});s.data?.success&&se(s.data.data.zones||[]);const n=await N.getRestaurants({limit:1e3});n.data?.success&&ae(n.data.data.restaurants||[]);const x=await N.getCustomers({limit:1e3});x.data?.success&&le(x.data.data.customers||[])}catch{}})()},[]);const me=()=>{const t=new Date;let s=null,n=null;switch(l.time){case"Today":s=new Date(t.setHours(0,0,0,0)),n=new Date(t.setHours(23,59,59,999));break;case"This Week":const x=new Date(t);x.setDate(t.getDate()-t.getDay()),x.setHours(0,0,0,0),s=x,n=new Date(t.setHours(23,59,59,999));break;case"This Month":s=new Date(t.getFullYear(),t.getMonth(),1),n=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999);break}return{fromDate:s,toDate:n}};r.useEffect(()=>{(async()=>{d.length===0?R(!0):O(!0),S(null);try{const{fromDate:s,toDate:n}=me(),x={page:w,limit:b,includeStatusCounts:1,startDate:s?s.toISOString().split("T")[0]:void 0,endDate:n?n.toISOString().split("T")[0]:void 0,search:I||void 0,restaurantId:l.restaurant!=="All restaurants"?l.restaurant:void 0,userId:l.customer!=="All customers"?l.customer:void 0,zoneId:l.zone!=="All Zones"?l.zone:void 0},c=await N.getOrders(x);if(c.data?.success){const V=c.data.data.orders||[],ue=c.data.data.meta||c.data.data.pagination||{},T=Number(ue.total??c.data.data.total??V.length)||0;oe(T),c.data.data.statusCounts?M({Scheduled:0,Pending:0,Accepted:0,Processing:0,"Food On The Way":0,Delivered:0,Canceled:0,"Payment Failed":0,Refunded:0,...c.data.data.statusCounts,total:T}):M(a=>({...a,total:T}));const ge=V.map(a=>{const m=a.pricing||{},H=(Array.isArray(a.items)?a.items:[]).reduce((g,v)=>{const Ne=Number(v.quantity||1),ke=Number(v.price||0);return g+Ne*ke},0),W=H>0?H:Number(m.subtotal||0),Z=Number(m.deliveryFee||0),$=Number(m.platformFee||0),q=Number(m.tax||0),J=Number(m.discount||0),fe=W+Z+$+q-J,we=m.total!=null?Number(m.total):fe,be=a.restaurantId?.restaurantName||a.restaurantName||"",Q=a.restaurantId?._id||a.restaurantId?.id||a.restaurantId||"",je=a.userId?.name||a.customerName||"N/A",ye=a.userId?._id||a.userId?.id||a.userId||"",Y=D.find(g=>{const v=g?._id||g?.id||g?.restaurantId;return String(v||"")===String(Q||"")}),ve=a.zoneId?._id||a.zoneId?.id||a.zoneId||Y?.zoneId?._id||Y?.zoneId||"",o=String(a.orderStatus||"").toLowerCase();let h=a.orderStatus;return!o||o==="created"||o==="confirmed"?h="Pending":o==="preparing"||o==="ready_for_pickup"?h="Processing":o==="picked_up"?h="Food On The Way":o==="delivered"?h="Delivered":(o==="cancelled_by_restaurant"||o==="c
1ancelled_by_user"||o==="cancelled_by_admin")&&(h="Canceled"),{orderId:a.orderId,restaurantId:String(Q||""),restaurant:be,customerId:String(ye||""),customerName:je,zoneId:String(ve||""),totalItemAmount:W,couponDiscount:J,vatTax:q,deliveryCharge:Z,platformFee:$,totalAmount:we,orderStatus:h}});ee(ge)}else S(c.data?.message||"Failed to fetch orders"),G.error(c.data?.message||"Failed to fetch orders")}catch(s){S(s.response?.data?.message||"Failed to fetch orders"),G.error(s.response?.data?.message||"Failed to fetch orders")}finally{R(!1),O(!1)}})()},[l,I,w,b,D,ce]);const j=t=>{if(d.length===0){alert("No data to export");return}const s=[{key:"orderId",label:"Order ID"},{key:"restaurant",label:"Restaurant"},{key:"customerName",label:"Customer Name"},{key:"totalItemAmount",label:"Total Item Amount"},{key:"couponDiscount",label:"Coupon Discount"},{key:"vatTax",label:"VAT/Tax"},{key:"deliveryCharge",label:"Delivery Charge"},{key:"platformFee",label:"Platform Fee"},{key:"totalAmount",label:"Order Amount"},{key:"orderStatus",label:"Status"}];switch(t){case"csv":Me(d,s,"regular_order_report");break;case"excel":Pe(d,s,"regular_order_report");break;case"pdf":_e(d,s,"regular_order_report","Regular Order Report");break;case"json":Oe(d,"regular_order_report");break}},he=()=>{de(t=>t+1)},pe=()=>{L({zone:"All Zones",restaurant:"All restaurants",customer:"All customers",time:"All Time"}),z(""),B(""),p(1)},u=t=>`â¹${Number(t||0).toLocaleString("en-IN",{minimumFractionDigits:2,maximumFractionDigits:2})}`,y=(t,s)=>{L(n=>({...n,[t]:s})),p(1)},i=t=>{const s=et[t];return s?e.jsxs("div",{className:"flex items-center justify-between bg-white rounded-lg border border-slate-200 px-3 py-2 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg ${s.bg} flex items-center justify-center overflow-hidden`,children:e.jsx("img",{src:s.icon,alt:s.label,className:"w-5 h-5 object-contain"})}),e.jsx("span",{className:"text-[11px] font-medium text-slate-800",children:s.label})]}),e.jsx("span",{className:`text-xs font-semibold ${s.color}`,children:P[t]||0})]},t):null};return E?e.jsx("div",{className:"p-2 lg:p-3 bg-slate-50 min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(U,{className:"w-8 h-8 animate-spin text-blue-500"}),e.jsx("p",{className:"text-gray-600",children:"Loading orders..."})]})}):_?e.jsx("div",{className:"p-2 lg:p-3 bg-slate-50 min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-red-600 mb-2",children:["Error: ",_]}),e.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700",children:"Retry"})]})}):e.jsxs("div",{className:"p-2 lg:p-3 bg-slate-50 min-h-screen",children:[e.jsxs("div",{className:"w-full mx-auto",children:[e.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-3 mb-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-blue-600 flex items-center justify-center",children:e.jsx(Ve,{className:"w-3.5 h-3.5 text-white"})}),e.jsx("h1",{className:"text-lg font-bold text-slate-900",children:"Order Report"})]})}),e.jsx("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-3 mb-3",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsxs("select",{value:l.zone,onChange:t=>y("zone",t.target.value),className:"w-full px-2.5 py-1.5 pr-5 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 text-xs appearance-none cursor-pointer",children:[e.jsx("option",{value:"All Zones",children:"All Zones"}),te.map(t=>e.jsx("option",{value:t._id,children:t.zoneName||t.name},t._id))]}),e.jsx(f,{className:"absolute right-1.5 top-1/2 -translate-y-1/2 w-3 h-3 text-slate-500 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsxs("select",{value:l.restaurant,onChange:t=>y("restaurant",t.target.value),className:"w-full px-2.5 py-1.5 pr-5 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 text-xs appearance-none cursor-pointer",children:[e.jsx("option",{value:"All restaurants",children:"All restaurants"}),D.map(t=>e.jsx("option",{value:t._id,children:t.restaurantName||t.name},t._id))]}),e.jsx(f,{className:"absolute right-1.5 top-1/2 -translate-y-1/2 w-3 h-3 text-slate-500 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsxs("select",{value:l.customer,onChange:t=>y("customer",t.target.value),className:"w-full px-2.5 py-1.5 pr-5 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 text-xs appearance-none cursor-pointer",children:[e.jsx("option",{value:"All customers",children:"All customers"}),re.map(t=>e.jsx("option",{value:t._id,children:t.name},t._id))]}),e.jsx(f,{className:"absolute right-1.5 top-1/2 -translate-y-1/2 w-3 h-3 text-slate-500 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsxs("select",{value:l.time,onChange:t=>y("time",t.target.value),className:"w-full px-2.5 py-1.5 pr-5 border border-slate-300 rounded-lg bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 text-xs appearance-none cursor-pointer",children:[e.jsx("option",{value:"All Time",children:"All Time"},"all-time"),e.jsx("option",{value:"Today",children:"Today"},"today"),e.jsx("option",{value:"This Week",children:"This Week"},"this-week"),e.jsx("option",{value:"This Month",children:"This Month"},"this-month")]}),e.jsx(f,{className:"absolute right-1.5 top-1/2 -translate-y-1/2 w-3 h-3 text-slate-500 pointer-events-none"})]}),e.jsx("button",{type:"button",onClick:he,disabled:C||E,title:"Refresh","aria-label":"Refresh",className:"p-1.5 rounded-lg border border-slate-300 bg-white text-slate-700 hover:bg-slate-50 transition-all disabled:opacity-50",children:e.jsx(He,{className:`w-3.5 h-3.5 ${C?"animate-spin":""}`})}),e.jsx("button",{type:"button",onClick:pe,className:"px-3 py-1.5 text-xs font-medium rounded-lg border border-slate-300 bg-white text-slate-700 hover:bg-slate-50 transition-all whitespace-nowrap",children:"Reset"})]})}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2 mb-3",children:[i("Scheduled"),i("Pending"),i("Processing"),i("Food On The Way"),i("Accepted"),i("Delivered"),i("Canceled"),i("Payment Failed"),i("Refunded")]}),e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-3",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 mb-3",children:[e.jsxs("h2",{className:"text-base font-bold text-slate-900",children:["Total Orders ",e.jsx("span",{className:"text-blue-600",children:P.total})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-initial min-w-[180px]",children:[e.jsx("input",{type:"text",placeholder:"Search by Order ID, customer, restaurant",value:F,onChange:t=>{z(t.target.value),p(1)},className:"pl-7 pr-2 py-1.5 w-full text-[11px] rounded-lg border border-slate-300 bg-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}),e.jsx("img",{src:ze,alt:"Search",className:"absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3"})]}),e.jsxs(Ce,{children:[e.jsx(Se,{asChild:!0,children:e.jsxs("button",{className:"px-2.5 py-1.5 text-[11px] font-medium rounded-lg bg-blue-600 text-white hover:bg-blue-700 flex items-center gap-1 transition-all",children:[e.jsx("img",{src:Be,alt:"Export",className:"w-3 h-3"}),e.jsx("span",{children:"Export"}),e.jsx(f,{className:"w-2.5 h-2.5"})]})}),e.jsxs(De,{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(Fe,{children:"Export Format"}),e.jsx(Ie,{}),e.jsxs(k,{onClick:()=>j("csv"),className:"cursor-pointer",children:[e.jsx(K,{className:"w-4 h-4 mr-2"}),"Export as CSV"]}),e.jsxs(k,{onClick:()=>j("excel"),className:"cursor-pointer",children:[e.jsx(We,{className:"w-4 h-4 mr-2"}),"Export as Excel"]}),e.jsxs(k,{onClick:()=>j("pdf"),className:"cursor-pointer",children:[e.jsx(K,{className:"w-4 h-4 mr-2"}),"Export as PDF"]}),e.jsxs(k,{onClick:()=>j("json"),className:"cursor-pointer",children:[e.jsx(Ze,{className:"w-4 h-4 mr-2"}),"Export as JSON"]})]})]}),e.jsx("button",{onClick:()=>A(!0),className:"p-1.5 rounded-lg border border-slate-300 bg-white hover:bg-slate-50 text-slate-700 transition-all",children:e.jsx(X,{className:"w-3 h-3"})})]})]}),C&&e.jsxs("div",{className:"mb-3 flex items-center gap-2 text-[11px] text-slate-500",children:[e.jsx(U,{className:"w-3.5 h-3.5 animate-spin text-blue-500"}),"Updating report..."]}),e.jsx("div",{className:"overflow-x-auto scrollbar-hide",children:e.jsxs("table",{className:"w-full",style:{tableLayout:"fixed",width:"100%"},children:[e.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"3%"},children:"SI"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"8%"},children:"Order Id"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"12%"},children:"Restaurant"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"12%"},children:"Customer Name"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"8%"},children:"Total Item Amount"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"7%"},children:"Coupon Discount"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"6%"},children:"Vat/Tax"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"7%"},children:"Delivery Charge"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"7%"},children:"Platform Fee"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"8%"},children:"Order Amount"}),e.jsx("th",{className:"px-1.5 py-1 text-left text-[8px] font-bold text-slate-700 uppercase tracking-wider",style:{width:"5%"},children:"Status"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-slate-100",children:d.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:11,className:"px-6 py-20 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("p",{className:"text-lg font-semibold text-slate-700 mb-1",children:"No Data Found"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No orders match your filters"})]})})}):d.map((t,s)=>e.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] font-medium text-slate-700",children:(w-1)*b+s+1})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] text-blue-600 hover:underline cursor-pointer",children:t.orderId})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] text-slate-700 truncate block",children:t.restaurant})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] text-slate-700 truncate block",children:t.customerName})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] text-slate-700",children:u(t.totalAmount)})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] text-slate-700",children:u(t.couponDiscount)})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] text-slate-700",children:u(t.vatTax)})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] text-slate-700",children:u(t.deliveryCharge)})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] text-slate-700",children:u(t.platformFee)})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"text-[10px] font-medium text-slate-900",children:u(t.totalAmount||t.totalItemAmount)})}),e.jsx("td",{className:"px-1.5 py-1",children:e.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[9px] font-medium bg-slate-100 text-slate-700",children:t.orderStatus})})]},t.orderId))})]})}),e.jsx(Le,{currentPage:w,pageSize:b,totalItems:ne,itemLabel:"orders",onPageChange:p,onPageSizeChange:t=>{ie(t),localStorage.setItem("admin_order_report_pageSize",String(t)),p(1)}})]})]}),e.jsx(Ae,{open:xe,onOpenChange:A,children:e.jsxs(Te,{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(Ee,{className:"px-6 pt-6 pb-4",children:e.jsxs(Re,{className:"flex items-center gap-2",children:[e.jsx(X,{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:"Regular order 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:()=>A(!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{Dt 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.