PageSourceSearch

https://sendunlimitedemail.com/sue/mod-VOp3IkBD.js

js sendunlimitedemail.com collected 2026-10-05 06:24:12 UTC 15,180 bytes, 13 lines download raw bytes

1import{r as u,f as $,j as e,H as P,h as d,S as w,L as v,t as f,i as D,P as N,M as O,e as M}from"./edge-BOITG1XR.js";import{o as T}from"./mod-DQMUdorF.js";import{C as h}from"./mod-BMqEiUX-.js";import{S as E}from"./mod-B2Tl8dXI.js";import{C as A}from"./mod-CmjZ4fHE.js";import{T as k}from"./mod-DG_IGVzD.js";import{M as I}from"./mod-TIsvMV2X.js";import{C as L}from"./mod-C-WPWfZM.js";import{D as R}from"./mod-LfxHWGtW.js";import{S as q}from"./mod-CnFQ395x.js";import{R as B}from"./mod-CKYw6KsV.js";import{C}from"./mod-gbHpssdV.js";import{P as U}from"./mod-CjVHpFuL.js";import{R as H}from"./mod-RPxq32x0.js";import{C as F}from"./mod-CdBQyGbT.js";import{C as Q}from"./mod-E2spV6fa.js";const Y=s=>s?new Date(s).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):"—",z=s=>{const r=new Date(s);return r.setDate(r.getDate()+3),r.toLocaleDateString("en-AE",{weekday:"long",month:"short",day:"numeric"})},y={pending:{label:"Pending",color:"bg-amber-100 text-amber-700",dot:"bg-amber-400",icon:Q},paid:{label:"Paid",color:"bg-emerald-100 text-emerald-700",dot:"bg-emerald-500",icon:F},processing:{label:"Processing",color:"bg-blue-100 text-blue-700",dot:"bg-blue-400",icon:H},shipped:{label:"Shipped",color:"bg-violet-100 text-violet-700",dot:"bg-violet-500",icon:k},delivered:{label:"Delivered",color:"bg-emerald-100 text-emerald-700",dot:"bg-emerald-500",icon:U},cancelled:{label:"Cancelled",color:"bg-red-100 text-red-700",dot:"bg-red-400",icon:C}},j=["pending","processing","shipped","delivered"],K=({status:s})=>{const r=y[s]??y.pending;return e.jsxs("span",{className:d("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-semibold",r.color),children:[e.jsx("span",{className:d("h-1.5 w-1.5 rounded-full",r.dot)}),r.label]})},X=()=>e.jsxs("div",{className:"animate-pulse rounded-2xl border border-slate-100 bg-white p-5 space-y-3",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("div",{className:"h-4 w-24 rounded bg-slate-100"}),e.jsx("div",{className:"h-5 w-20 rounded-full bg-slate-100"})]}),e.jsx("div",{className:"h-3 w-40 rounded bg-slate-100"}),e.jsx("div",{className:"h-6 w-28 rounded bg-slate-100"})]}),G={pending:"Order Placed",processing:"Preparing",shipped:"Shipped",delivered:"Delivered"},J=({status:s})=>{const r=j.indexOf(s==="paid"?"processing":s);return s==="cancelled"?e.jsxs("div",{className:"flex items-center gap-2 rounded-xl bg-red-50 px-4 py-3 text-sm font-semibold text-red-600",children:[e.jsx(C,{className:"h-4 w-4"})," Order Cancelled"]}):e.jsx("div",{className:"flex items-center gap-0 overflow-x-auto",children:j.map((o,n)=>{const a=r>=n;return e.jsxs("div",{className:"flex items-center",children:[e.jsxs("div",{className:d("flex flex-col items-center",a?"text-violet-600":"text-gray-300"),children:[e.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold border-2 transition-colors",n<r?"bg-violet-600 border-violet-600 text-white":n===r?"border-violet-600 text-violet-600 bg-violet-50":"border-gray-200 text-gray-300"),children:n<r?"✓":n+1}),e.jsx("span",{className:d("text-[9px] mt-1 whitespace-nowrap font-semibold",a?"text-violet-700":"text-slate-400"),children:G[o]})]}),n<j.length-1&&e.jsx("div",{className:d("h-0.5 w-8 sm:w-14 mx-1 mb-4 transition-colors",n<r?"bg-violet-600":"bg-gray-200")})]},o)})})},i=s=>String(s??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),V=s=>{const r=s.currency_code||"AED",o=`
2        <html><head><title>Invoice #${i(s.id)}</title>
3        <style>body{font-family:sans-serif;padding:20px;} table{width:100%;border-collapse:collapse;} td,th{padding:8px;border:1px solid #ddd;text-align:left;}</style>
4        </head><body>
5        <h2>Invoice #${i(s.order_number||s.id)}</h2>
6        <p>Date: ${i(new Date(s.created_at).toLocaleDateString())}</p>
7        <p>Status: ${i(s.status)}</p>
8        <table><tr><th>Item</th><th>Qty</th><th>Price</th></tr>
9        ${(s.order_items||s.items||[]).map(a=>{const c=a.selected_options||a.options,x=c?` (${Object.entries(c).map(([t,m])=>`${i(t)}: ${i(m)}`).join(", ")})`:"";return`<tr><td>${i(a.name||a.product_name)}${x}</td><td>${i(a.qty??a.quantity)}</td><td>${i(r)} ${i(a.price)}</td></tr>`}).join("")}
10        </table>
11        <p><strong>Total: ${i(r)} ${i(s.total_price)}</strong></p>
12        </body></html>
13    `,n=window.open("","_blank");if(!n){alert("Please allow popups to download your invoice.");return}n.document.write(o),n.document.close(),n.print()},W=({order:s,onCancel:r})=>{const[o,n]=u.useState(!1),a=s.order_items??s.items??[],c=s.shipping_address??{},x=a.length;return e.jsxs("div",{className:"rounded-2xl border border-slate-100 bg-white shadow-sm overflow-hidden",children:[e.jsx("button",{onClick:()=>n(t=>
13!t),className:"w-full text-left px-5 py-4 hover:bg-slate-50 transition",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[e.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl bg-violet-50",children:e.jsx(w,{className:"h-5 w-5 text-violet-600"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"font-mono font-bold text-slate-900",children:["#",s.id]}),e.jsx(K,{status:s.status??"pending"})]}),e.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:[Y(s.created_at)," · ",x," item",x!==1?"s":""]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx(h,{amount:s.total_price,className:"text-lg font-bold text-slate-900",fallbackMode:"code"}),o?e.jsx(A,{className:"h-4 w-4 text-slate-400"}):e.jsx(D,{className:"h-4 w-4 text-slate-400"})]})]})}),o&&e.jsxs("div",{className:"border-t border-slate-100 px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"rounded-xl bg-slate-50 p-4",children:[e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider mb-4",children:"Order Progress"}),e.jsx(J,{status:s.status??"pending"}),s.status==="shipped"&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-emerald-700 bg-emerald-50 rounded-xl px-3 py-2 mt-3",children:[e.jsx(k,{className:"w-4 h-4"}),e.jsxs("span",{children:["Estimated delivery: ",e.jsx("strong",{children:z(s.updated_at)})]})]}),s.status==="shipped"&&s.tracking_number&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-700 bg-blue-50 rounded-xl px-3 py-2 mt-2",children:[e.jsx(N,{className:"w-4 h-4"}),e.jsxs("span",{children:["Tracking: ",e.jsx("strong",{children:s.tracking_number})]}),e.jsx("a",{href:`https://track.aftership.com/${s.tracking_number}`,target:"_blank",rel:"noreferrer",className:"ml-auto text-xs underline hover:text-blue-900",children:"Track Package →"})]})]}),a.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider mb-3",children:"Items"}),e.jsx("div",{className:"space-y-2",children:a.map((t,m)=>{const g=t.name??t.product?.name??"Product",b=t.quantity??t.qty??1,l=Number(t.price??0),p=t.image??t.product?.image;return e.jsxs("div",{className:"flex items-center gap-3 rounded-xl bg-slate-50 p-3",children:[e.jsx("div",{className:"h-12 w-12 flex-shrink-0 rounded-xl overflow-hidden bg-white border border-slate-100",children:p?e.jsx("img",{src:p,alt:g,className:"h-full w-full object-cover"}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(N,{className:"h-5 w-5 text-slate-300"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(v,{to:`/product/${t.slug??t.product}`,className:"font-semibold text-sm text-slate-900 hover:text-violet-700 line-clamp-1 transition",children:g}),(t.selected_options||t.options)&&e.jsx("p",{className:"text-xs text-slate-400",children:Object.entries(t.selected_options??t.options).map(([S,_])=>`${S}: ${_}`).join(", ")}),e.jsxs("p",{className:"text-xs text-slate-400",children:["Qty: ",b," × ",e.jsx(h,{amount:l,fallbackMode:"code"})]})]}),e.jsx(h,{amount:l*b,className:"flex-shrink-0 text-sm font-bold text-slate-900",fallbackMode:"code"})]},m)})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(c.address||c.city)&&e.jsxs("div",{className:"rounded-xl bg-slate-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(I,{className:"h-3.5 w-3.5 text-slate-400"}),e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:"Shipping To"})]}),e.jsx("p",{className:"text-sm text-slate-700",children:c.address}),e.jsx("p",{className:"text-sm text-slate-700",children:[c.city,c.postalCode].filter(Boolean).join(", ")}),e.jsx("p",{className:"text-sm text-slate-700",children:c.country})]}),e.jsxs("div",{className:"rounded-xl bg-slate-50 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(L,{className:"h-3.5 w-3.5 text-slate-400"}),e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:"Payment"})]}),e.jsx("p",{className:"text-sm text-slate-700 capitalize",children:s.payment_method??"N/A"}),e.jsx("p",{className:d("text-xs font-semibold mt-1",s.is_paid?"text-emerald-600":"text-amber-600"),children:s.is_paid?"✓ Paid":"Awaiting Payment"})]})]}),e.jsxs("div",{className:"rounded-xl border border-slate-100 p-4 space-y-1.5",children:[e.jsxs("div",{className:"flex justify-between text-sm text-slate-500",children:[e.jsx("span",{children:"Subtotal"}),e.jsx(h,{amount:s.items_price??s.total_price,fallbackMode:"code"})]}),Number(s.discount_price)>0&&e.jsxs("div",{className:"flex justify-between text-sm text-emerald-600",children:[e.jsxs("span",{children:["Discount",s.coupon_code?` (${s.coupon_code})`:""]}),e.jsxs("span",{children:["-",e.jsx(h,{amount:s.discount_price,fallbackMode:"code"})]})]}),Number(s.payment_fee)>0&&e.jsxs("div",{className:"flex justify-between text-sm text-slate-500",children:[e.jsx("span",{children:"Payment fee"}),e.jsx(h,{amount:s.payment_fee,fallbackMode:"code"})]}),e.jsxs("div",{className:"flex justify-between border-t border-slate-100 pt-2 mt-1 font-bold text-slate-900",children:[e.jsx("span",{children:"Total"}),e.jsx(h,{amount:s.total_price,fallbackMode:"code"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("button",{onClick:()=>V(s),className:"flex items-center gap-1.5 text-xs text-gray-600 hover:text-gray-800 border border-gray-200 hover:border-gray-300 px-3 py-1.5 rounded-xl transition-colors",children:[e.jsx(R,{className:"w-3.5 h-3.5"})," Invoice"]}),e.jsxs("a",{href:"/seller-chat",className:"inline-flex items-center gap-1.5 text-xs text-gray-600 hover:text-gray-800 border border-gray-200 hover:border-gray-300 px-3 py-1.5 rounded-xl transition-colors",children:[e.jsx(O,{className:"w-3.5 h-3.5"})," Contact Seller"]}),s.status==="delivered"&&e.jsx("div",{className:"flex flex-wrap gap-2",children:a.map((t,m)=>e.jsxs("a",{href:`/products/${t.slug||t.product_id}#reviews`,className:"inline-flex items-center gap-1.5 text-xs text-violet-600 hover:text-violet-700 border border-violet-200 hover:border-violet-400 px-3 py-1.5 rounded-xl transition-colors",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Review ",t.name??t.product?.name??"Item"]},m))}),(s.status==="pending"||s.status==="processing")&&e.jsx("button",{onClick:()=>r&&r(s.id),className:"text-sm text-red-600 hover:text-red-700 border border-red-200 hover:border-red-300 px-4 py-2 rounded-xl transition-colors",children:"Cancel Order"})]}),e.jsxs("div",{className:"p-4 bg-gray-50 rounded-xl border border-gray-100",children:[e.jsx("p",{className:"text-sm font-medium text-gray-700 mb-1",children:"Need help with this order?"}),e.jsxs("p",{className:"text-xs text-gray-500",children:["Contact our support team via ",e.jsx("a",{href:"/help",className:"text-violet-600 hover:underline",children:"Help Center"})," or ",e.jsx("a",{href:"/contact",className:"text-violet-600 hover:underline",children:"Contact Us"}),"."]})]})]}),(s.status==="delivered"||s.is_delivered)&&e.jsx("div",{className:"border-t border-slate-100 px-5 py-3 flex justify-end",children:e.jsxs(v,{to:`/order/${s.id}/return`,className:"inline-flex items-center gap-1.5 text-sm text-violet-700 hover:text-violet-900 font-medium hover:underline",children:[e.jsx(B,{className:"h-3.5 w-3.5"})," Request Return"]})})]})},be=()=>{const[s,r]=u.useState([]),[o,n]=u.useState(!0),[a,c]=u.useState("all"),x=$(),t=()=>{T.getMyOrders().then(l=>r(Array.isArray(l)?l:l?.orders??[])).catch(l=>{const p=l?.response?.status;p===401||p===403?x("/auth/login",{state:{from:"/orders"},replace:!0}):f.error("Failed to load orders")}).finally(()=>n(!1))};u.useEffect(()=>{t()},[x]);const m=async l=>{f("Cancel this order?",{action:{label:"Yes, cancel",onClick:async()=>{try{await M.put(`/orders/${l}/cancel`),f.success("Order cancelled successfully"),t()}catch(p){f.error(p.response?.data?.message||"Failed to cancel order")}}},cancel:{label:"Keep order",onClick:()=>{}}})},g=[{key:"all",label:"All"},{key:"pending",label:"Pending"},{key:"shipped",label:"Shipped"},{key:"delivered",label:"Delivered"},{key:"cancelled",label:"Cancelled"}],b=a==="all"?s:s.filter(l=>l.status===a);return e.jsxs("div",{className:"min-h-screen bg-slate-50 py-8",children:[e.jsxs(P,{children:[e.jsx("title",{children:"My Orders | SendUnlimitedEmail"}),e.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),e.jsxs("div",{className:"mx-auto max-w-3xl px-4",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"My Orders"}),!o&&e.jsxs("p",{className:"text-sm text-slate-500 mt-0.5",children:[s.length," order",s.length!==1?"s":""," total"]})]}),e.jsx("div",{className:"flex gap-1 p-1 rounded-xl bg-slate-200 mb-5 overflow-x-auto",children:g.map(l=>e.jsx("button",{onClick:()=>c(l.key),className:d("rounded-lg px-3 py-1.5 text-xs font-semibold transition whitespace-nowrap flex-shrink-0",a===l.key?"bg-white text-violet-700 shadow-sm":"text-slate-500 hover:text-slate-700"),
13children:l.label},l.key))}),o?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(l=>e.jsx(X,{},l))}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-dashed border-slate-200 bg-white py-20 gap-4 text-center",children:[e.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-slate-100",children:e.jsx(w,{className:"h-8 w-8 text-slate-400"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-slate-700",children:a==="all"?"No orders yet":`No ${a} orders`}),e.jsx("p",{className:"text-sm text-slate-400 mt-1",children:a==="all"?"Your orders will appear here once you shop":"Switch tabs to see other orders"})]}),a==="all"&&e.jsxs(v,{to:"/shop",className:"flex items-center gap-2 rounded-xl bg-violet-600 px-5 py-2.5 text-sm font-bold text-white hover:bg-violet-700 transition",children:[e.jsx(E,{className:"h-4 w-4"})," Start Shopping"]})]}):e.jsx("div",{className:"space-y-4",children:b.map(l=>e.jsx(W,{order:l,onCancel:m},l.id))})]})]})};export{be 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.