PageSourceSearch

https://draftframes.com/_nuxt/Lb7tCC6p.js

js draftframes.com collected 2026-10-06 19:43:09 UTC 3,482 bytes, 1 lines download raw bytes

1import{d as f,m as y,l as _,p as b,c as n,a as s,e as m,j as v,t as d,F as h,r as w,o,n as k,h as C,w as S,g as B,_ as j}from"./Ct_uNemJ.js";const N={class:"container mx-auto py-10 px-4 sm:px-6 lg:px-8 font-barlow"},V={class:"max-w-5xl mx-auto"},D={key:0,class:"space-y-4"},F={key:1},O={key:0,class:"rounded-md bg-red-50 p-4 mb-4 text-red-700"},T={key:1,class:"rounded-3xl border border-gray-200 bg-white p-8 text-center"},z={key:2,class:"space-y-4"},A={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},E={class:"text-xl font-semibold"},L={class:"text-right"},U={class:"text-right"},$={class:"font-medium"},M={class:"mt-4 flex flex-wrap gap-3"},I=f({__name:"index",setup(P){const r=y(),c=m([]),u=m(!0),i=m(""),p=a=>{const e=(a?.status||a?.order_status||"Unknown").toString().toLowerCase();return e.includes("pending")?{label:"Pending",classes:"bg-yellow-100 text-yellow-800"}:e.includes("processing")||e.includes("confirmed")?{label:"Processing",classes:"bg-blue-100 text-blue-800"}:e.includes("completed")||e.includes("delivered")||e.includes("shipped")?{label:"Completed",classes:"bg-green-100 text-green-800"}:e.includes("cancel")||e.includes("failed")||e.includes("declined")?{label:"Cancelled",classes:"bg-red-100 text-red-800"}:{label:a?.status||a?.order_status||"Unknown",classes:"bg-gray-100 text-gray-700"}},{apiBaseUrl:x}=_(),g=async()=>{u.value=!0,i.value="",r.sessionData||r.initializeFromStorage();try{const a={"Content-Type":"application/json",Accept:"application/json"};r.sessionData?.auth_token&&(a.Authorization=`Bearer ${r.sessionData.auth_token}`);const e=await fetch(`${x}/nuxt-orders`,{method:"GET",headers:a}),l=await e.json();if(!e.ok)throw new Error(l.message||"Failed to fetch orders");c.value=l.orders??l.data??[]}catch(a){i.value=a.message||"Could not load orders"}finally{u.value=!1}};return b(async()=>{await g()}),(a,e)=>{const l=j;return o(),n("div",N,[s("div",V,[e[6]||(e[6]=s("div",{class:"mb-8 flex items-center justify-between"},[s("div",null,[s("h1",{class:"text-3xl font-semibold"},"My Orders"),s("p",{class:"text-gray-600"},"Review your recent order history.")])],-1)),u.value?(o(),n("div",D,[...e[0]||(e[0]=[s("div",{class:"h-16 bg-gray-100 rounded animate-pulse"},null,-1),s("div",{class:"h-16 bg-gray-100 rounded animate-pulse"},null,-1)])])):(o(),n("div",F,[i.value?(o(),n("div",O,d(i.value),1)):v("",!0),c.value.length===0?(o(),n("div",T,[...e[1]||(e[1]=[s("p",{class:"text-lg font-medium"},"No orders found yet.",-1),s("p",{class:"text-gray-500 mt-2"},"Once you place an order, it will appear here.",-1)])])):(o(),n("div",z,[(o(!0),n(h,null,w(c.value,t=>(o(),n("div",{key:t.id||t.order_number,class:"rounded-3xl border border-gray-200 bg-white p-6 shadow-sm hover:shadow-md transition"},[s("div",A,[s("div",null,[e[2]||(e[2]=s("p",{class:"text-sm text-gray-500"},"Order",-1)),s("p",E,d(t.order_number||t.id),1)]),s("div",L,[e[3]||(e[3]=s("p",{class:"text-sm text-gray-500"},"Status",-1)),s("span",{class:k(["inline-flex items-center rounded-full px-3 py-1 text-sm font-semibold",p(t).classes])},d(p(t).label),3)]),s("div",U,[e[4]||(e[4]=s("p",{class:"text-sm text-gray-500"},"Items",-1)),s("p",$,d(t.items_count??t.item_count??t.items?.length??0),1)])]),s("div",M,[C(l,{to:`/account/orders/${t.id||t.order_number}`,class:"px-4 py-2 bg-theme-primary-color text-white rounded-full text-sm"},{default:S(()=>[...e[5]||(e[5]=[B(" View details ",-1)])]),_:1},8,["to"])])]))),128))]))]))])])}}});export{I 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.