1import{_ as x}from"./BSS67al9.js";import{_ as F}from"./fY7odCkn.js";import{_ as N}from"./Cob3d7YH.js";import{_ as V}from"./CPOkjfV5.js";import{u as T}from"./Dek6Ww68.js";import{ba as C,e as I,b as A,Q as E,cu as O,o as R,f as $,g as B,k as r,w as a,V as S,h as f,q as h,t as u,n as y,l as W,L as c,M as H,aw as M}from"./DkI6cOfr.js";import"./COVwTYNU.js";import"./Bq0SJq0f.js";import"./DQdvHCcE.js";import"./C9lMfmWk.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new s.Error().stack;l&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[l]="359e54a6-3ce6-4826-bdd7-f310a8c5d556",s._sentryDebugIdIdentifier="sentry-dbid-359e54a6-3ce6-4826-bdd7-f310a8c5d556")}catch{}})();const P={class:"text-subtitle-2 font-weight-medium"},q={class:"font-weight-medium"},Z=C({__name:"orders",setup(s){I({title:"Domain Reseller - Domain Orders"});const{$apiFetch:l}=A(),{formatDate:_}=T();E(),O();const b=[{title:"Order #",key:"order_id",sortable:!0},{title:"Domain",key:"domain",sortable:!0},{title:"Date",key:"date",sortable:!0},{title:"Status",key:"status",sortable:!0},{title:"Payment",key:"payment_status",sortable:!1},{title:"Amount",key:"amount",align:"end",sortable:!0}],m=c(null),i=c(!0),p=c(null),v=H(()=>m.value?.data?.orders||[]),w=o=>!o||o.startsWith("0000-00-00")||o.startsWith("-")?"N/A":_(o),g=async()=>{const n=M("reseller-domain-orders");if(n.data.value?.lastFetched&&Date.now()-new Date(n.data.value.lastFetched).getTime()<6e4){m.value=n.data.value,i.value=!1;return}i.value=!0,p.value=null;try{const t=await l("/api/resellers/domain/orders",{method:"GET"});if(t?.result==="success"){const d={...t,lastFetched:new Date};m.value=d,n.data.value=d}else throw new Error(t?.message||"Failed to fetch orders")}catch(t){console.error("Failed to fetch orders:",t),p.value=t}finally{i.value=!1}};return R(async()=>{await g()}),(o,n)=>{const t=x,d=F,D=N,k=V;return $(),B("div",null,[r(t,{title:"Domain Orders",subtitle:"View your domain reseller orders","show-divider":!1}),r(W,null,{default:a(()=>[r(S,{cols:"12"},{default:a(()=>[r(k,{plain:"","no-actions":"",headers:b,items:f(v),loading:f(i),"items-per-page":15,"item-value":"order_id",hover:"","show-search":"","search-placeholder":"Search orders...","empty-state-icon":"$receiptIcon","empty-state-title":"No orders found","empty-state-message":"You haven't placed any domain orders yet."},{"item.order_id":a(({item:e})=>[y("span",P,u(e.order_id),1)]),"item.domain":a(({item:e})=>[y("span",q,u(e.domain),1)]),"item.date":a(({item:e})=>[h(u(w(e.date)),1)]),"item.status":a(({item:e})=>[r(d,{status:e.status},null,8,["status"])]),"item.payment_status":a(({item:e})=>[h(u(e.payment_status||"N/A"),1)]),"item.amount":a(({item:e})=>[r(D,{value:e.amount},null,8,["value"])]),_:1},8,["items","loading"])]),_:1})]),_:1})])}}});export{Z 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.