PageSourceSearch

https://account.tias.com/_nuxt/Db_tXpme.js

js tias.com collected 2026-10-09 22:11:28 UTC 48,627 bytes, 1 lines download raw bytes

1import{o as r,m as D,c as o,a as t,n as P,z as Y,f as e,A as le,w as I,D as Ae,s as y,t as i,p as l,_ as Ee,T as tt,v as st,x as v,r as x,k as zt,M as We,Q as qt,F as H,q as se,R as Zt,u as Ht,d as Yt,l as Wt,g as Kt,b as Ke,ah as Gt,Y as Jt,h as Ge,a3 as Je,K as ie,a5 as Qt,a9 as Xt,y as es}from"./DKEtgErO.js";import{_ as rt,u as ts,a as ss,b as rs,c as os,d as ns,e as is}from"./DbY_95Gf.js";import{o as ot,s as ae,a as nt,_ as it,f as Qe,c as ls}from"./CyAKU1mK.js";import{g as as,u as ds}from"./mX8vx2Ie.js";import{_ as us}from"./NLQ5SRFc.js";import{I as cs}from"./DoZ_SiSq.js";import{g as de,h as Xe}from"./DswkDhCG.js";import{Z as ps}from"./CdxHGTtd.js";import{b as ms,c as bs}from"./CJl1UbH6.js";import{g as hs}from"./K3MWatS2.js";import"./BJqQGppZ.js";var De={exports:{}},et;function fs(){return et||(et=1,(function(K,A){var T={amazon:{patterns:[new RegExp(/^TB[A-D][0-9]{12}/)]},ups:{patterns:[new RegExp(/\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|T\d{3} ?\d{4} ?\d{3})\b/i)],tracking_url:"http://wwwapps.ups.com/WebTracking/processInputRequest?TypeOfInquiryNumber=T&InquiryNumber1="},usps:{patterns:[new RegExp(/\b((420 ?\d{5} ?)?(91|92|93|94|95|01|03|04|70|23|13)\d{2} ?\d{4} ?\d{4} ?\d{4} ?\d{4}( ?\d{2,6})?)\b/i),new RegExp(/\b((M|P[A-Z]?|D[C-Z]|LK|E[A-C]|V[A-Z]|R[A-Z]|CP|CJ|LC|LJ) ?\d{3} ?\d{3} ?\d{3} ?[A-Z]?[A-Z]?)\b/i),new RegExp(/\b(82 ?\d{3} ?\d{3} ?\d{2})\b/i)],tracking_url:"https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1="},ontrac:{patterns:[new RegExp(/\b(C\d{14})\b/i)],tracking_url:"http://www.ontrac.com/trackres.asp?tracking_number="},dhl:{patterns:[new RegExp(/\b(\d{4}[- ]?\d{4}[- ]?\d{2}|\d{3}[- ]?\d{8}|[A-Z]{3}\d{7})\b/i)],tracking_url:"http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB="},fedex:{patterns:[new RegExp(/\b(((96\d\d|6\d)\d{3} ?\d{4}|96\d{2}|\d{4}) ?\d{4} ?\d{4}( ?\d{3})?)\b/i)],tracking_url:"http://www.fedex.com/Tracking?language=english&cntry_code=us&tracknumbers="}},C=function(m){return Object.keys(T).filter(function(a){return T[a].patterns.filter(function(k){return k.test(m)}).length>0})},G=function(m){return C(m)[0]},g=function(m,a){return C(m).indexOf(a.toLowerCase())>-1},p=function(m,a){var k=null;if(a)k=T[a.toLowerCase()].tracking_url+m;else{var S=C(m)[0];S&&T[S].tracking_url&&(k=T[S].tracking_url+m)}return k},B=function(m,a){return!m||!T[m.toLowerCase()]?!1:T[m.toLowerCase()].patterns.push(new RegExp(a))},U=function(m){return C(m).length>0},E={getCourier:C,getCourierOne:G,isCourier:g,getTrackingUrl:p,injectPatterns:B,isValid:U,couriers:T};K.exports=E})(De)),De.exports}var _s=fs();const Pe=as(_s),gs={key:0,class:"modal-overlay modal-overlay--inset"},ys={class:"modal-content modal-content--dialog",role:"dialog","aria-modal":"true","aria-labelledby":"mark-shipped-heading"},vs={class:"flex flex-col gap-16"},xs=["aria-invalid"],ws={key:0,class:"text-sm text-grey-700"},ks={class:"fw-semi text-grey-900"},Cs={key:1,class:"tui-feedback tui-feedback--error",role:"alert"},Ss={class:"flex gap-12 justify-end"},Rs=["disabled"],$s=["disabled"],Ts={__name:"MarkAsShippedModal",props:{show:{type:Boolean,required:!0}},emits:["close","submit"],setup(K,{expose:A,emit:T}){const C=T,G=ot({trackingNumber:ae().min(1,"Tracking number is required").transform(m=>m.trim()),service:ae().optional().default("")}).superRefine((m,a)=>{if(!m.trackingNumber)return;Pe.isValid(m.trackingNumber)||a.addIssue({code:"custom",path:["trackingNumber"],message:"Invalid tracking number format. Please check the number and try again."})}),g=x(null),p=st({trackingNumber:"",service:""}),B=v(()=>{const m=p.trackingNumber.trim();if(!m||!Pe.isValid(m))return null;const a=Pe.getCourierOne(m);return a?a.toUpperCase():null});function U(){g.value?.setSubmitting(!0),C("submit",{trackingNumber:p.trackingNumber.trim(),carrier:B.value||null,service:p.service.trim()||null})}function E(m){g.value?.context?.setGeneralError(m),g.value?.setSubmitting(!1)}function c(){p.trackingNumber="",p.service="",g.value?.context?.clearErrors(),g.value?.setSubmitting(!1)}return A({resetForm:c,setError:E}),(m,a)=>{const k=nt,S=Ee,j=it;return r(),D(tt,{to:"body"},[K.show?(r(),o("div",gs,[t("div",ys,[a[4]||(a[4]=t("h2",{id:"mark-shipped-heading",class:"fw-semi text-lg mb-16"},"Mark as Shipped",-1)),P(j,{ref_key:"formRef",ref:g,schema:e(G),state:e(p),onSubmit:U},{default:Y(({isSubmitting:b,generalError:O})=>[t("div",vs,[P(k,{name:"trackingNumber","model-value":e(p).trackingNumber,label:"Tracking Number",required:"","label-class":"block text-sm fw-semi mb-8"},{default:Y(({hasError:L})=>[le(t("input",{id:"trackingNumber","onUpdate:modelValue":a[0]||(a[0]=N=>e(p).trackingNumber=N),type:"text",class:I(["width-fill px-12 py-8 border-1 border-solid border-grey-300 rounded-md",{"border-red-500":L}]),"aria-invalid":L?"true":"false",placeholder:"1Z999AA10123456784"},null,10,xs),[[Ae,e(p).trackingNumber]])]),_:1},8,["model-value"]),e(B)?(r(),o("p",ws,[a[3]||(a[3]=y(" Carrier: ",-1)),t("span",ks,i(e(B)),1)])):l("",!0),P(k,{name:"service","model-value":e(p).service,label:"Service Level","label-class":"block text-sm fw-semi mb-8"},{default:Y(()=>[le(t("input",{id:"service","onUpdate:modelValue":a[1]||(a[1]=L=>e(p).service=L),type:"text",class:"width-fill px-12 py-8 border-1 border-solid border-grey-300 rounded-md",placeholder:"Ground, Express, etc. (optional)"}
1,null,512),[[Ae,e(p).service]])]),_:1},8,["model-value"]),O?(r(),o("div",Cs,[t("p",null,i(O),1)])):l("",!0),t("div",Ss,[t("button",{type:"button",onClick:a[2]||(a[2]=L=>m.$emit("close")),class:"px-16 py-8 border-1 border-solid border-grey-300 rounded-md text-sm fw-semi hover:bg-grey-50",disabled:b}," Cancel ",8,Rs),t("button",{type:"submit",class:"px-16 py-8 bg-black text-white rounded-md text-sm fw-semi hover:bg-grey-800 disabled:opacity-50 flex items-center justify-center gap-8",disabled:b||!e(p).trackingNumber.trim()},[b?(r(),D(S,{key:0,color:"light",size:"xs"})):l("",!0),t("span",null,i(b?"Processing...":"Mark as Shipped"),1)],8,$s)])])]),_:1},8,["schema","state"])])])):l("",!0)])}}},Ms={key:0,class:"modal-overlay modal-overlay--inset"},Is={class:"modal-content modal-content--dialog",role:"dialog","aria-modal":"true","aria-labelledby":"report-issue-heading",style:{"max-width":"540px"}},Ds={class:"flex flex-col gap-16"},Ps={class:"tui-select"},As=["aria-invalid"],Es={key:0,value:"not_shipped"},Ls={key:1,value:"buyers_remorse"},Fs={key:2,value:"not_as_described"},Bs={key:3,value:"arrived_damaged"},js=["value"],Os=["src"],Us={class:"flex-grow min-w-0"},Ns={class:"text-sm fw-semi truncate mb-0"},Vs={class:"text-xs text-grey-500 mb-0"},zs=["aria-invalid"],qs={class:"text-xs text-grey-600 mb-8"},Zs={key:3,class:"tui-feedback tui-feedback--error",role:"alert"},Hs={class:"flex gap-12 justify-end pt-8"},Ys=["disabled"],Ws=["disabled"],Ks={class:"pt-12 border-top-1 border-solid border-grey-200 flex justify-center"}
1,be=8,Gs={__name:"ReportIssueModal",props:{show:{type:Boolean,required:!0},shipments:{type:Array,default:()=>[]},lines:{type:Array,default:()=>[]},getRefundPreview:{type:Function,default:null},notShippedEligible:{type:Boolean,default:!1}},emits:["close","submit"],setup(K,{expose:A,emit:T}){const C=K,G=T,g=["not_as_described","arrived_damaged"],{user:p}=zt(),B=v(()=>p.value?.id||null),U=ot({dispute_type:ls(["buyers_remorse","not_as_described","arrived_damaged","not_shipped"],{required_error:"Please select an issue type",invalid_type_error:"Please select an issue type"}),description:ae().min(10,"Please provide at least 10 characters"),selectedItems:Qe(ae().uuid()).min(1,"Select at least one item"),photo_urls:Qe(ae().url()).max(be)}).superRefine((f,h)=>{g.includes(f.dispute_type)&&f.photo_urls.length===0&&h.addIssue({code:ps.custom,path:["photo_urls"],message:"Please upload at least one photo of the issue"})}),E=x(null),c=st({dispute_type:"",description:"",selectedItems:[],photo_urls:[]}),m=v(()=>g.includes(c.dispute_type)),a=v(()=>m.value?"Photo evidence":"Photo evidence (optional)"),k=v(()=>m.value?`Upload up to ${be} photos showing the issue. This helps the seller respond and our team review your claim.`:`Optional — add up to ${be} photos if helpful.`);function S(f,h){const _=h?.url;_&&!c.photo_urls.includes(_)&&c.photo_urls.push(_)}function j(f){const h=(f||[]).map(_=>_.media?.url).filter(Boolean);c.photo_urls=c.photo_urls.filter(_=>h.includes(_))}const b=x(null),O=v(()=>{const f=new Set((C.shipments||[]).filter(_=>_.tracking_status==="delivered").map(_=>_.id)),h=new Set;for(const _ of C.shipments||[])if(f.has(_.id))for(const J of _.items||[])h.add(J.invoice_line_id);return h}),L=v(()=>O.value.size>0),N=v(()=>c.dispute_type==="not_shipped"?(C.lines||[]).filter(f=>!O.value.has(f.id)):(C.lines||[]).filter(f=>O.value.has(f.id)));We([N],()=>{c.selectedItems=N.value.map(f=>f.id)}),We([()=>c.dispute_type,()=>c.selectedItems],async([f,h])=>{if(!f||!C.getRefundPreview||!h?.length){b.value=null;return}const _=h.map(J=>({invoice_line_id:J}));b.value=await C.getRefundPreview(f,_)},{deep:!0});function ue(f){return f==null?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(f)}function he(){E.value?.setSubmitting(!0),G("submit",{dispute_type:c.dispute_type,description:c.description.trim(),items:c.selectedItems.map(f=>({invoice_line_id:f})),photo_urls:[...c.photo_urls]})}function W(f){E.value?.context?.setGeneralError(f),E.value?.setSubmitting(!1)}function $(){c.dispute_type="",c.description="",c.selectedItems=[],c.photo_urls=[],b.value=null,E.value?.context?.clearErrors(),E.value?.setSubmitting(!1)}return A({resetForm:$,setError:W}),(f,h)=>{const _=nt,J=us,fe=Ee,_e=rt,ge=it;return r(),D(tt,{to:"body"},[K.show?(r(),o("div",Ms,[t("div",Is,[h[7]||(h[7]=t("h2",{id:"report-issue-heading",class:"fw-semi text-lg mb-4"},"Report an Issue",-1)),h[8]||(h[8]=t("p",{class:"text-sm text-grey-600 mb-16"},"Let us know what went wrong with your order.",-1)),P(ge,{ref_key:"formRef",ref:E,schema:e(U),state:e(c),onSubmit:he},{default:Y(({isSubmitting:Q,generalError:ce})=>[t("div",Ds,[P(_,{name:"dispute_type","model-value":e(c).dispute_type,label:"What happened?",required:"","label-class":"block text-sm fw-semi text-grey-900 mb-8"},{default:Y(({hasError:V})=>[t("div",Ps,[le(t("select",{id:"dispute_type","onUpdate:modelValue":h[0]||(h[0]=F=>e(c).dispute_type=F),class:I(["tui-select-field",{"tui-select-field--error":V}]),"aria-invalid":V?"true":"false"},[h[5]||(h[5]=t("option",{value:""},"Select an issue...",-1)),K.notShippedEligible?(r(),o("option",Es,"My order never arrived")):l("",!0),e(L)?(r(),o("option",Ls,"Changed my mind")):l("",!0),e(L)?(r(),o("option",Fs,"Item not as described")):l("",!0),e(L)?(r(),o("option",Bs,"Item arrived damaged")):l("",!0)],10,As),[[qt,e(c).dispute_type]]),h[6]||(h[6]=t("svg",{class:"tui-select-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("polyline",{points:"6 9 12 15 18 9"})],-1))])]),_:1},8,["model-value"]),e(N).length>0?(r(),D(_,{key:0,name:"selectedItems","model-value":e(c).selectedItems,label:"Which item(s) have an issue?",required:"","label-class":"block text-sm fw-semi text-grey-900 mb-8"},{default:Y(({hasError:V})=>[t("div",{class:I(["border-1 border-solid rounded-md pa-12",V?"border-red-400":"border-grey-200"])},[(r(!0),o(H,null,se(e(N),F=>(r(),o("label",{key:F.id,class:"flex items-center gap-12 py-4 cursor-pointer"},[le(t("input",{type:"checkbox",value:F.id,"onUpdate:modelValue":h[1]||(h[1]=u=>e(c).selectedItems=u),class:"flex-shrink-0"},null,8,js),[[Zt,e(c).selectedItems]]),e(de)(F.item)?(r(),o("img",{key:0,src:e(de)(F.item),class:"object-cover rounded",style:{width:"80px",height:"80px"},onError:h[2]||(h[2]=u=>u.target.style.display="none")},null,40,Os)):l("",!0),t("div",Us,[t("p",Ns,i(F.item?.title||F.description),1),t("p",Vs,i(ue(F.unit_price)),1)])]))),128))],2)]),_:1},8,["model-value"])):l("",!0),e(b)?(r(),D(J,{key:1,variant:"info",title:`Estimated Refund: ${ue(e(b).refund_estimate)}`},{default:Y(()=>[y(i(e(b).description),1)]),_:1},8,["title"])):l("",!0),P(_,{name:"description","model-value":e(c).description,label:"Describe the issue",required:"","label-class":"block text-sm fw-semi text-grey-900 mb-8"},{default:Y(({hasError:V})=>[le(t("textarea",{id:"description","onUpdate:modelValue":h[3]||(h[3]=F=>e(c).description=F),rows:"4",class:I(["tui-textarea",{"tui-textarea--error":V}]),"aria-invalid":V?"true":"false",placeholder:"Please describe the issue in detail..."},null,10,zs),[[Ae,e(c).description]])]),_:1},8,["model-value"]),e(B)?(r(),D(_,{key:2,name:"photo_urls","model-value":e(c).photo_urls,label:e(a),required:e(m),"label-class":"block text-sm fw-semi text-grey-900 mb-8"},{hint:Y(()=>[t("p",qs,i(e(k)),1)]),default:Y(()=>[P(e(cs),{"entity-id":e(B),"entity-type":"user","photo-type":"gallery","max-photos":be,reorderable:!1,onFileComplete:S,onPhotosChange:j},null,8,["entity-id"])]),_:1},8,["model-value","label","required"])):l("",!0),ce?(r(),o("div",Zs,[t("p",null,i(ce),1)])):l("",!0),t("div",Hs,[t("button",{type:"button",onClick:h[4]||(h[4]=V=>f.$emit("close")),class:"button button--secondary",disabled:Q}," Cancel ",8,Ys),t("button",{type:"submit",class:"button button--danger flex items-center justify-center gap-8",disabled:Q||!e(c).dispute_type||e(c).selectedItems.length===0},[Q?(r(),D(fe,{key:0,color:"light",size:"xs"})):l("",!0),t("span",null,i(Q?"Submitting...":"Submit Issue"),1)],8,Ws)]),t("div",Ks,[P(_e,{"full-width":!1,compact:"","show-subline":!1,label:"Need help? Contact support"})])])]),_:1},8,["schema","state"])])])):l("",!0)])}}},Js={class:"order-detail-page"},Qs={key:1,class:"pa-48"},Xs={class:"bg-white border-1 border-solid border-red-300 pa-24 rounded-lg text-center max-width-600 mx-auto"},er={class:"text-red-600 mb-24"},tr={key:2},sr={class:"order-header bg-white border-bottom-1 border-solid border-grey-200 pa-16 md:pa-24"},rr={class:"body-max-width pr-16 pl-16 md:pl-40 md:pr-40"},or={class:"flex flex-col md:flex-row md:items-center md:justify-between gap-12 mb-12"},nr={class:"text-2xl md:text-3xl fw-bold text-grey-900 mb-4"},ir={class:"text-base text-grey-600"}
1,lr={key:0,class:"flex flex-wrap gap-8"},ar=["disabled"],dr=["disabled"],ur={key:1,class:"mr-8",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},cr=["disabled"],pr={key:1,class:"mr-8",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},mr={class:"flex items-center gap-12"},br={class:"order-body pa-16 md:pa-24 lg:pa-32"},hr={class:"body-max-width pr-16 pl-16 md:pl-40 md:pr-40"},fr={class:"grid grid-cols-1 lg:grid-cols-3 gap-24"},_r={class:"lg:col-span-2"},gr={key:0,class:"pa-16 mb-16 rounded-lg border-1 border-solid bg-red-50 border-red-200"},yr={key:0,class:"text-sm text-red-700 mb-8"},vr={key:2,class:"pa-20 mb-16 rounded-lg border-1 border-solid bg-yellow-50 border-yellow-300"},xr={class:"flex items-center gap-12 mb-12"},wr={class:"text-3xl fw-bold text-grey-900",style:{"font-family":"ui-monospace, SFMono-Regular, Menlo, monospace","letter-spacing":"0.2em"}},kr={key:3,class:"pa-16 mb-16 rounded-lg border-1 border-solid bg-green-50 border-green-200"},Cr={class:"bg-white border-1 border-solid border-grey-300 pa-24 rounded-lg mb-24"},Sr={class:"text-lg fw-semi text-grey-900 mb-16"},Rr={key:1,class:"seller-branding"},$r={class:"flex items-start gap-16 mb-16"},Tr={key:0,class:"seller-logo flex-shrink-0"},Mr=["src","alt"],Ir={key:1,class:"seller-avatar flex-shrink-0 w-64 h-64 bg-grey-200 rounded-md flex items-center justify-center"},Dr={class:"flex-grow"},Pr={class:"text-lg fw-bold text-grey-900 mb-4"},Ar={key:0,class:"text-sm text-grey-600 mb-8"},Er=["href"],Lr={key:0,class:"pt-16 border-top-1 border-solid border-grey-200"},Fr={key:0,class:"text-sm text-grey-700 mb-4"},Br={key:1,class:"text-sm text-grey-700"},jr={class:"pt-16 mt-16 border-top-1 border-solid border-grey-200 flex gap-8"},Or={key:1,class:"text-sm text-grey-600 flex items-center"},Ur={key:4,class:"bg-white border-1 border-solid border-grey-300 pa-24 rounded-lg mb-24"},Nr={class:"flex items-center justify-between mb-16"},Vr={class:"space-y-12"},zr={class:"text-sm fw-semi text-grey-900"},qr={class:"text-sm text-grey-900"},Zr={key:0},Hr={class:"text-sm text-grey-600 mb-4"},Yr={class:"flex flex-wrap gap-8"},Wr=["href","aria-label"],Kr=["src","alt"],Gr={key:1},Jr={class:"space-y-4"},Qr=["src"],Xr={class:"fw-semi text-grey-900"},eo={class:"text-grey-500 ml-auto"},to={key:2,class:"pa-12 bg-yellow-50 border-1 border-solid border-yellow-200 rounded-md"},so={class:"text-sm text-yellow-800"},ro={key:3,class:"pa-12 bg-orange-50 border-1 border-solid border-orange-200 rounded-md"},oo={key:0,class:"text-sm text-orange-800"},no={key:4,class:"pa-12 bg-blue-50 border-1 border-solid border-blue-200 rounded-md"},io=["disabled"],lo={key:0,class:"text-xs text-blue-700 mt-8"},ao={key:5,class:"pa-12 bg-green-50 border-1 border-solid border-green-200 rounded-md"},uo=["href"],co={key:0,class:"text-xs text-green-800 mt-8"},po={key:1,class:"text-xs text-green-700 mt-4"},mo={key:6,class:"pa-12 bg-green-50 border-1 border-solid border-green-200 rounded-md"},bo={class:"text-sm fw-semi text-green-900"},ho={key:0,class:"text-xs text-green-700 mt-4"},fo={key:7,class:"pt-8"},_o=["disabled"],go={key:5,class:"mb-24"},yo={key:0,class:"text-xs text-grey-500 mt-6 text-center"},vo={class:"mt-12"},xo={key:6,class:"mb-24 pa-12 bg-grey-50 border-1 border-solid border-grey-200 rounded-md text-center"},wo=["href"],ko={class:"mt-12"},Co={class:"bg-white border-1 border-solid border-grey-300 pa-24 rounded-lg mb-24"},So={class:"text-lg fw-semi text-grey-900 mb-16"},Ro={key:0,class:"flex items-start gap-10 mb-20 pb-16 border-bottom-1 border-solid border-grey-200"},$o={class:"text-sm text-grey-700"},To={key:0,class:"text-sm fw-semi text-grey-900 mb-8"},Mo={key:1,class:"flex items-center justify-between mb-12"},Io={class:"flex items-center gap-8 min-w-0"},Do={class:"text-sm min-w-0"},Po={class:"fw-semi text-grey-900"},Ao={class:"text-grey-500"},Eo={class:"flex items-center gap-8 flex-shrink-0 ml-8"},Lo=["href"],Fo={key:1,class:"cursor-not-allowed",title:"Unsupported carrier — tracking unavailable"},Bo={key:2,class:"border-top-1 border-solid border-grey-200 mt-16 mb-16"},jo={key:3,class:"flex items-center gap-8 mb-12"},Oo={class:"flex-shrink-0",style:{width:"80px","min-width":"80px",height:"80px"}},Uo=["src","alt"],No={class:"flex-grow min-w-0"},Vo={key:0,class:"fw-bold text-grey-900 mb-4"},zo={class:"text-sm text-grey-600"},qo={class:"text-right flex-shrink-0"},Zo={class:"fw-semi text-grey-900"},Ho={key:0,class:"flex items-center gap-12 pt-8 text-xs text-grey-500"},Yo={class:"font-mono"},Wo={class:"bg-white border-1 border-solid border-grey-300 pa-24 rounded-lg mb-24"},Ko={key:1,class:"text-center py-32 text-red-600"},Go={key:2,class:"space-y-16"},Jo={class:"flex-shrink-0 pt-2"},Qo={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Xo={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},en={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},tn={key:3,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},sn={class:"flex-grow"},rn={class:"text-sm fw-semi text-grey-900 mb-2"},on={class:"text-xs text-grey-600"},nn={key:0},ln={key:0,class:"mt-8 pa-8 bg-grey-50 rounded text-xs"},an={class:"text-grey-700"},dn={class:"font-mono"},un={key:3,class:"text-center py-32 text-grey-500"},cn={class:"lg:col-span-1"},pn={class:"bg-white border-1 border-solid border-grey-300 pa-24 rounded-lg mb-24"},mn={class:"space-y-12 mb-16"},bn={class:"flex justify-between text-base"},hn={class:"text-grey-900"},fn={key:0,class:"flex justify-between text-base"},_n={class:"text-grey-900"},gn={class:"flex justify-between text-base"},yn={key:0,class:"text-grey-900"},vn={key:1,style:{color:"#1A7F38"}},xn={key:1,class:"flex justify-between text-base"},wn={class:"text-grey-900"},kn={class:"flex justify-between text-base"},Cn={class:"text-grey-900"},Sn={class:"border-top-1 border-solid border-grey-300 pt-12"},Rn={class:"flex justify-between text-lg"},$n={class:"fw-bold text-grey-900"},Tn={class:"space-y-12 pt-16 border-top-1 border-solid border-grey-300"},Mn={class:"flex justify-between text-base"},In={class:"fw-semi text-green-600"},Dn={key:0,class:"flex justify-between text-base"},Pn={class:"fw-semi text-red-600"},An={key:1,class:"flex justify-between text-base"},En={class:"fw-semi text-red-600"},Ln={key:0,class:"mt-24 pt-24 border-top-1 border-solid border-grey-300"},Fn={class:"text-base text-grey-900"},Bn="buyer",Kn={__name:"[id]",setup(K){Ht({title:"Order Details"});const A=Qt(),T=Yt(),{storeUrl:C,publicUrl:G}=Wt();Kt();const g=T.params.id,{order:p,history:B,loading:U,error:E,historyLoading:c,historyError:m,seller:a,items:k,shipments:S,shippingAddress:j,paymentStatus:b,fulfillmentStatus:O,isPickupOrder:L,orderNumber:N,fetchOrder:ue,fetchHistory:he,refresh:W,formatCurrency:$,formatDate:f,formatShipBy:h,getStatusClass:_,getFulfillmentClass:J,formatStatus:fe,formatFulfillment:_e}=ss(g,Bn),ge=n=>n&&n.replace(/\s*\[([^\]]+)\]\([^)]+\)/g,"").trim(),{markAsShipped:Q,cancelOrder:ce,processRefund:V}=is(g),{checkExistingReview:F}=ds(),{dispute:u,loading:X,hasActiveDispute:lt,canCancelDispute:at,canPrintReturnLabel:dt,fetchDispute:ut,fileDispute:ct,getRefundPreview:pt,cancelDispute:mt,printReturnLabel:bt}=ts(g),ye=x(!1),ht=v(()=>(a.value?.name||"").split(" ").map(s=>s[0]).join("").substring(0,2).toUpperCase()),ve=x(!1),xe=x(!1),we=x(!1),pe=x(!1),ke=x(!1),ft=x(null),me=x(!1),Le=x(null),Fe=x(null),Ce=x(null),Se=x(null),re=x(!1),oe=x(!1),Re=x(!1);
1async function _t(){if(p.value?.pickup_code)try{await navigator.clipboard.writeText(p.value.pickup_code),Re.value=!0,setTimeout(()=>{Re.value=!1},2e3)}catch{ie.error("Could not copy. Please copy the code manually.")}}const Be=v(()=>{const n=[],s=S.value||[],w=new Set;for(const R of s)for(const z of R.items||[])w.add(z.invoice_line_id);for(const R of s){const z=(R.items||[]).map(ne=>ne.invoice_line_id),te=(k.value||[]).filter(ne=>z.includes(ne.id));te.length>0&&n.push({shipment:R,lines:te})}const M=(k.value||[]).filter(R=>!w.has(R.id));return M.length>0&&n.push({shipment:null,lines:M}),n}),je=v(()=>!p.value||!a.value||!me.value||ke.value?!1:["authorized","paid","closed"].includes(b.value?.status)),gt=v(()=>(S.value||[]).some(n=>n.tracking_status==="delivered")),yt=v(()=>(S.value||[]).length>0),$e=v(()=>p.value?.ship_by?new Date(p.value.ship_by):null),Te=v(()=>$e.value?new Date>$e.value:!1),vt=["in_transit","out_for_delivery","delivered","return_to_sender","failure"],Oe=v(()=>L.value||!p.value?.ship_by||new Date<new Date(p.value.ship_by)?!1:!(S.value||[]).some(n=>vt.includes(n.tracking_status))),xt=v(()=>{if(!p.value||lt.value)return!1;const n=b.value?.status;return n!=="paid"&&n!=="partially_paid"?!1:gt.value&&!Ne.value?!0:Oe.value}),Ue=v(()=>{if(!u.value?.items?.length||!k.value)return[];const n=new Set(u.value.items.map(s=>s.invoice_line_id));return k.value.filter(s=>n.has(s.id))}),ee=v(()=>{if(!p.value?.payout_available_at)return null;const n=new Date(p.value.payout_available_at),s=n.getMinutes(),w=s%15;return w>0&&(n.setMinutes(s+(15-w)),n.setSeconds(0,0)),n}),Me=x(new Date);let Ie=null;Ke(()=>{Ie=Gt(()=>{Me.value=new Date},3e4)}),Jt(()=>{Ie&&clearInterval(Ie)});const Ne=v(()=>ee.value?Me.value>=ee.value:!1),Ve=v(()=>{if(!ee.value)return null;const n=ee.value.getTime()-Me.value.getTime();if(n<=0)return null;const s=Math.floor(n/(1e3*60*60)),w=Math.floor(n%(1e3*60*60)/(1e3*60)),M=ee.value.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}).toLowerCase();return n<1440*60*1e3?s>0?`You have ~${s}h ${w}m to report an issue (${M})`:`You have ~${w}m to report an issue (${M})`:`You have until ${ee.value.toLocaleDateString("en-US",{month:"long",day:"numeric"})} at ${M} to report an issue`}),wt={buyers_remorse:"Changed my mind",not_as_described:"Item not as described",arrived_damaged:"Item arrived damaged",not_shipped:"Seller never shipped"},kt={open:"Under Review",return_approved:"Return Authorized",return_label_created:"Return Label Ready",return_in_transit:"Return In Transit",return_delivered:"Return Delivered",refund_issued:"Refund Issued",seller_contested:"Seller Contested",escalated:"Under Admin Review",resolved:"Resolved",cancelled:"Cancelled"};function Ct(n){return{open:"bg-yellow-100 text-yellow-800",return_approved:"bg-blue-100 text-blue-800",return_label_created:"bg-blue-100 text-blue-800",return_in_transit:"bg-blue-100 text-blue-800",return_delivered:"bg-green-100 text-green-800",refund_issued:"bg-green-100 text-green-800",seller_contested:"bg-orange-100 text-orange-800",escalated:"bg-orange-100 text-orange-800",resolved:"bg-grey-100 text-grey-700",cancelled:"bg-grey-100 text-grey-700"}[n]||"bg-grey-100 text-grey-700"}async function St(n){const s=await ct(n);s.success?(pe.value=!1,Se.value?.resetForm(),await W()):Se.value?.setError(s.error)}async function Rt(){if(!confirm("Are you sure you want to cancel this dispute? The payout hold will be released."))return;(await mt()).success&&await W()}async function $t(){const n=await bt();n.success&&n.label_url&&window.open(n.label_url,"_blank")}function ze(){if(!a.value?.slug||!p.value?.id)return;const n=`${G.value}/stores/${a.value.slug}/review?invoice_id=${p.value.id}`;window.location.href=n}function Tt(n){return{created:"timeline-icon--created",status_changed:"timeline-icon--status",payment_updated:"timeline-icon--payment",shipment_created:"timeline-icon--shipment",fulfillment_updated:"timeline-icon--shipment",cancelled:"timeline-icon--cancelled",refund_processed:"timeline-icon--refund"}[n]||"timeline-icon--default"}function qe(n){return n.easypost_shipment_id?hs(n.carrier,n.tracking_number)||n.tracking_url||null:n.tracking_url||null}const Mt=["in_transit","out_for_delivery","delivered"];function Ze(n){return Mt.includes(n?.tracking_status)}function It(n){for(let s=0;s<n;s++){const w=Be.value[s];if(w.shipment&&Ze(w.shipment))return!1}return!0}function He(n){return{unknown:"Unknown",pre_transit:"Label Created",in_transit:"In Transit",out_for_delivery:"Out for Delivery",delivered:"Delivered",return_to_sender:"Return to Sender",failure:"Delivery Failed",cancelled:"Cancelled",error:"Error"}[n]||n}function Ye(n){return{pre_transit:"bg-blue-100 text-blue-800",in_transit:"bg-blue-100 text-blue-800",out_for_delivery:"bg-yellow-100 text-yellow-800",delivered:"bg-green-100 text-green-800",return_to_sender:"bg-red-100 text-red-800",failure:"bg-red-100 text-red-800",cancelled:"bg-grey-100 text-grey-700",error:"bg-red-100 text-red-800"}[n]||"bg-grey-100 text-grey-700"}async function Dt(n){(await Q(n)).success&&(ve.value=!1,Le.value?.resetForm(),await W())}async function Pt(n){(await ce(n.reason)).success&&(xe.value=!1,Fe.value?.resetForm(),await W())}async function At(n){const s=await V(n);s.success?(we.value=!1,Ce.value?.resetForm(),await W()):Ce.value?.setError(s.error||"Failed to process refund")}function Et(){window.print()}async function Lt(){re.value=!0;try{const n=Je();if(!n)throw new Error("You must be logged in to download invoices");let s=await fetch(`${A.public.supabaseUrl}/functions/v1/orders/${g}/invoice.pdf`,{method:"GET",headers:{Authorization:`Bearer ${n}`,apikey:A.public.supabaseAnonKey}});if(s.status===404){console.log("PDF not found, generating...");const z=await fetch(`${A.public.supabaseUrl}/functions/v1/orders/${g}/generate-invoice`,{method:"POST",headers:{Authorization:`Bearer ${n}`,apikey:A.public.supabaseAnonKey,"Content-Type":"application/json"},body:JSON.stringify({regenerate:!1})});if(!z.ok){const te=await z.json().catch(()=>({}));throw new Error(te.error||"Failed to generate invoice")}s=await fetch(`${A.public.supabaseUrl}/functions/v1/orders/${g}/invoice.pdf`,{method:"GET",headers:{Authorization:`Bearer ${n}`,apikey:A.public.supabaseAnonKey}})}if(!s.ok){const z=await s.json().catch(()=>({}));throw new Error(z.error||"Failed to download invoice")}const w=await s.blob(),M=window.URL.createObjectURL(w),R=document.createElement("a");R.href=M,R.download=`invoice-${N.value}.pdf`,document.body.appendChild(R),R.click(),document.body.removeChild(R),window.URL.revokeObjectURL(M),ie.success("Invoice PDF downloaded successfully!")}catch(n){console.error("Error downloading PDF:",n),ie.error(n.message||"Failed to download PDF. Please try again later.")}finally{re.value=!1}}async function Ft(){oe.value=!0;try{const n=Je();if(!n)throw new Error("You must be logged in to email invoices");const s=await fetch(`${A.public.supabaseUrl}/functions/v1/orders/${g}/email-invoice`,{method:"POST",headers:{Authorization:`Bearer ${n}`,apikey:A.public.supabaseAnonKey,"Content-Type":"application/json"},body:JSON.stringify({regenerate:!1})}),w=await s.json();if(!s.ok)throw new Error(w.error||"Failed to send invoice email");ie.success("Invoice sent to your email successfully!")}catch(n){console.error("Error sending invoice:",n),ie.error(n.message||"Failed to send invoice email. Please try again later.")}finally{oe.value=!1}}function Bt(n){n.target.style.display="none"}async function jt(){if(!a.value?.id){me.value=!0;return}const n=await F(a.value.id,g);ke.value=n.hasReviewed,ft.value=n.reviewId||null,me.value=!0}return Ke(async()=>{await ue(),await Promise.allSettled([he(),ut()]),a.value?.id&&await jt(),window.location.hash==="#review"&&je.value&&(B.replaceState(null,"",window.location.pathname+window.location.search),ze())}),(n,s)=>{const w=es,M=Ee,R=rt,z=Ts,te=rs,ne=os,Ot=Gs,Ut=ns;return Xt("click-outside"),r(),o("div",Js,[e(U)?(r(),D(w,{key:0,info:"order details"})):e(E)?(r(),o("div",Qs,[t("div",Xs,[s[15]||(s[15]=Ge('<svg class="mx-auto mb-16 text-red-500" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor"><circle cx="12" cy="12" r="10" stroke-width="2"></circle><line x1="12" y1="8" x2="12" y2="12" stroke-width="2" stroke-linecap="round"></line>
1<line x1="12" y1="16" x2="12.01" y2="16" stroke-width="2" stroke-linecap="round"></line></svg><h2 class="text-xl fw-semi mb-12">Error Loading Order</h2>',2)),t("p",er,i(e(E)),1),t("button",{onClick:s[0]||(s[0]=(...d)=>e(W)&&e(W)(...d)),class:"button button--primary"}," Try Again ")])])):e(p)?(r(),o("div",tr,[t("div",sr,[t("div",rr,[t("div",or,[t("div",null,[t("h1",nr,i("Invoice"),1),t("p",ir,"Order #"+i(e(N)),1)]),(r(),o("div",lr,[t("button",{onClick:Et,class:"button button--secondary",disabled:e(U)},[...s[16]||(s[16]=[t("svg",{class:"mr-8",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2z"})],-1),y(" Print Invoice ",-1)])],8,ar),t("button",{onClick:Lt,class:"button button--secondary flex items-center justify-center gap-8",disabled:e(U)||e(re)},[e(re)?(r(),D(M,{key:0,color:"default",size:"sm"})):(r(),o("svg",ur,[...s[17]||(s[17]=[t("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"},null,-1)])])),t("span",null,i(e(re)?"Generating...":"Download PDF"),1)],8,dr),t("button",{onClick:Ft,class:"button button--primary flex items-center justify-center gap-8",disabled:e(U)||e(oe)},[e(oe)?(r(),D(M,{key:0,color:"light",size:"sm"})):(r(),o("svg",pr,[...s[18]||(s[18]=[t("path",{d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])])),t("span",null,i(e(oe)?"Sending...":"Email Invoice"),1)],8,cr)])),l("",!0)]),t("div",mr,[t("span",{class:I(["tag--invoice",e(_)(e(b)?.displayStatus)])},i(e(fe)(e(b)?.displayStatus)),3),t("span",{class:I(["tag--invoice",e(J)(e(O))])},i(e(_e)(e(O))),3)])])]),t("div",br,[t("div",hr,[t("div",fr,[t("div",_r,[e(p).status==="cancelled"?(r(),o("div",gr,[s[20]||(s[20]=t("h3",{class:"text-sm fw-semi text-red-800 mb-4"},"This order was cancelled.",-1)),e(p).cancellation_reason?(r(),o("p",yr," Reason: "+i(e(p).cancellation_reason),1)):l("",!0),s[21]||(s[21]=t("p",{class:"text-sm text-red-700"}," A full refund has been issued to your original payment method. Please allow 5-10 business days for the refund to appear on your statement. ",-1))])):l("",!0),e(b)?.isPaid&&!e(yt)&&e($e)?(r(),o("div",{key:1,class:I(["pa-16 mb-16 rounded-lg border-1 border-solid",e(Te)?"bg-red-50 border-red-200":"bg-blue-50 border-blue-200"])},[t("p",{class:I(["text-sm mb-0",e(Te)?"text-red-700":"text-blue-700"])},[e(Te)?(r(),o(H,{key:0},[y(" This order is past the shipping deadline. If the seller has not shipped within 30 days of payment, you will automatically receive a full refund. ")],64)):(r(),o(H,{key:1},[s[22]||(s[22]=y(" The seller has until ",-1)),t("strong",null,i(e(h)(e(p).ship_by)),1),s[23]||(s[23]=y(" to ship your order. ",-1))],64))],2)],2)):l("",!0),e(p).pickup_code&&e(L)&&e(O)!=="fulfilled"?(r(),o("div",vr,[s[24]||(s[24]=t("h3",{class:"text-sm fw-semi text-yellow-900 mb-8",style:{"text-transform":"uppercase","letter-spacing":"0.05em"}}," Your Pickup Code ",-1)),t("div",xr,[t("span",wr,i(e(p).pickup_code),1),t("button",{type:"button",onClick:_t,class:"button button--secondary","aria-label":"Copy pickup code"},i(e(Re)?"Copied":"Copy"),1)]),s[25]||(s[25]=t("p",{class:"text-sm text-yellow-900"},[t("strong",null,"Inspect your item before sharing this code."),y(" Once you give it to the seller, they use it to confirm pickup and release the funds. Keep it private until the handoff. ")],-1))])):e(L)&&e(O)==="fulfilled"?(r(),o("div",kr,[...s[26]||(s[26]=[t("p",{class:"text-sm text-green-800"},[t("strong",null,"Pickup confirmed."),y(" The seller has entered your code and the order is complete. ")],-1)])])):l("",!0),t("div",Cr,[t("h2",Sr,i("Seller Information"),1),e(a)?(r(),o("div",Rr,[t("div",$r,[e(a).logo_url?(r(),o("div",Tr,[t("img",{src:e(a).logo_url,alt:e(a).name,class:"w-64 h-64 object-contain rounded-md border-1 border-solid border-grey-200",onError:Bt},null,40,Mr)])):(r(),o("div",Ir,[...s[29]||(s[29]=[t("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-grey-500"},[t("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),t("circle",{cx:"12",cy:"7",r:"4"})],-1)])])),t("div",Dr,[t("h3",Pr,i(e(a).name),1),e(a).description?(r(),o("p",Ar,i(e(a).description),1)):l("",!0),t("a",{href:e(C)(e(a).slug||e(a).id),class:"text-sm text-blue-600 hover:underline"}," Visit Shop → ",8,Er)])]),e(a).email||e(a).phone?(r(),o("div",Lr,[e(a).email?(r(
1),o("p",Fr,[s[30]||(s[30]=t("svg",{class:"inline mr-8",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})],-1)),y(" "+i(e(a).email),1)])):l("",!0),e(a).phone?(r(),o("p",Br,[s[31]||(s[31]=t("svg",{class:"inline mr-8",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 16.92z"})],-1)),y(" "+i(e(a).phone),1)])):l("",!0)])):l("",!0),t("div",jr,[t("button",{onClick:s[6]||(s[6]=d=>ye.value=!0),class:"button button--secondary flex-1"},[...s[32]||(s[32]=[t("svg",{class:"mr-8",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})],-1),y(" Contact Seller ",-1)])]),e(je)?(r(),o("button",{key:0,onClick:ze,class:"button button--primary flex-1"},[...s[33]||(s[33]=[t("svg",{class:"mr-8",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor"},[t("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})],-1),y(" Review Seller ",-1)])])):e(me)&&e(ke)?(r(),o("p",Or,[...s[34]||(s[34]=[t("svg",{class:"mr-8 text-green-600",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M20 6L9 17l-5-5"})],-1),y(" You've reviewed this order ",-1)])])):l("",!0)])])):l("",!0)]),e(u)?(r(),o("div",Ur,[t("div",Nr,[s[35]||(s[35]=t("h2",{class:"text-lg fw-semi text-grey-900"},"Dispute",-1)),t("span",{class:I(["inline-flex items-center px-3 py-1 rounded-full text-xs font-medium",Ct(e(u).status)])},i(kt[e(u).status]||e(u).status),3)]),t("div",Vr,[t("div",null,[s[36]||(s[36]=t("p",{class:"text-sm text-grey-600 mb-2"},"Issue Type",-1)),t("p",zr,i(wt[e(u).dispute_type]||e(u).dispute_type),1)]),t("div",null,[s[37]||(s[37]=t("p",{class:"text-sm text-grey-600 mb-2"},"Description",-1)),t("p",qr,i(e(u).description),1)]),e(u).photo_urls?.length?(r(),o("div",Zr,[t("p",Hr,"Your Photos ("+i(e(u).photo_urls.length)+")",1),t("div",Yr,[(r(!0),o(H,null,se(e(u).photo_urls,(d,q)=>(r(),o("a",{key:q,href:d,target:"_blank",rel:"noopener noreferrer","aria-label":`View photo ${q+1} in new tab`},[t("img",{src:d,alt:`Dispute photo ${q+1}`,class:"object-cover rounded-md border-1 border-solid border-grey-200",style:{width:"64px",height:"64px"}},null,8,Kr)],8,Wr))),128))])])):l("",!0),e(Ue).length?(r(),o("div",Gr,[s[38]||(s[38]=t("p",{class:"text-sm text-grey-600 mb-4"},"Disputed Items",-1)),t("div",Jr,[(r(!0),o(H,null,se(e(Ue),d=>(r(),o("div",{key:d.id,class:"flex items-center gap-8 text-sm"},[e(de)(d.item)?(r(),o("img",{key:0,src:e(de)(d.item),class:"w-8 h-8 object-cover rounded",onError:s[7]||(s[7]=q=>q.target.style.display="none")},null,40,Qr)):l("",!0),t("span",Xr,i(d.item?.title||d.description),1),t("span",eo,i(e($)(d.unit_price)),1)]))),128))])])):l("",!0),e(u).status==="open"&&e(u).seller_response_deadline?(r(),o("div",to,[t("p",so,"Waiting for seller response by "+i(e(f)(e(u).seller_response_deadline)),1)])):l("",!0),e(u).status==="seller_contested"?(r(),o("div",ro,[s[39]||(s[39]=t("p",{class:"text-sm fw-semi text-orange-900 mb-4"},"Seller Contested",-1)),e(u).seller_response?(r(),o("p",oo,i(e(u).seller_response),1)):l("",!0),s[40]||(s[40]=t("p",{class:"text-sm text-orange-700 mt-8"},"This dispute is being reviewed by our team.",-1))])):l("",!0),e(dt)?(r(),o("div",no,[s[41]||(s[41]=t("p",{class:"text-sm text-blue-800 mb-8"},"Your return has been approved. Print your return shipping label to proceed.",-1)),t("button",{onClick:$t,class:"button button--primary flex items-center justify-center gap-8",disabled:e(X)},[e(X)?(r(),D(M,{key:0,color:"light",size:"sm"})):l("",!0),t("span",null,i(e(X)?"Creating Label...":"Print Return Label"),1)],8,io),e(u).buyer_return_deadline?(r(),o("p",lo," You must ship your return by "+i(e(f)(e(u).buyer_return_deadline)),1)):l("",!0)])):l("",!0),e(u).return_label_url&&["return_label_created","return_in_transit","return_delivered","refund_issued","resolved"].includes(e(u).status)?(r(),o("div",ao,[s[42]||(s[42]=t("p",{class:"text-sm fw-semi text-green-900 mb-8"},"Return Label",-1)),t("a",{href:e(u).return_label_url,target:"_blank",rel:"noopener",class:"button button--secondary button--sm"}
1," Download Label ",8,uo),e(u).return_tracking_number?(r(),o("p",co,[y(" Tracking: "+i(e(u).return_carrier)+" "+i(e(u).return_tracking_number)+" ",1),e(u).return_tracking_status&&e(u).return_tracking_status!=="unknown"?(r(),o("span",{key:0,class:I(["ml-4 inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",Ye(e(u).return_tracking_status)])},i(He(e(u).return_tracking_status)),3)):l("",!0)])):l("",!0),e(u).buyer_return_deadline&&e(u).status==="return_label_created"?(r(),o("p",po," Ship by "+i(e(f)(e(u).buyer_return_deadline)),1)):l("",!0)])):l("",!0),e(u).refund_amount&&["refund_issued","resolved","return_delivered"].includes(e(u).status)?(r(),o("div",mo,[t("p",bo,"Refund: "+i(e($)(e(u).refund_amount)),1),e(u).return_label_charged_to==="buyer"?(r(),o("p",ho,"Return shipping cost deducted from refund")):l("",!0)])):l("",!0),e(at)?(r(),o("div",fo,[t("button",{onClick:Rt,class:"button button--secondary button--sm flex items-center justify-center gap-8",disabled:e(X)},[e(X)?(r(),D(M,{key:0,color:"default",size:"xs"})):l("",!0),t("span",null,i(e(X)?"Cancelling...":"Cancel Dispute"),1)],8,_o)])):l("",!0)])])):e(xt)?(r(),o("div",go,[t("button",{onClick:s[8]||(s[8]=d=>pe.value=!0),class:"button button--secondary width-fill"},[...s[43]||(s[43]=[t("svg",{class:"mr-8",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),t("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),t("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})],-1),y(" Report an Issue ",-1)])]),e(Ve)?(r(),o("p",yo,i(e(Ve)),1)):l("",!0),t("div",vo,[P(R)])])):e(Ne)&&!e(u)?(r(),o("div",xo,[s[44]||(s[44]=t("p",{class:"text-sm text-grey-600"},"The window to report an issue with this order has closed.",-1)),t("a",{href:`${e(G)}/terms`,target:"_blank",class:"text-xs text-grey-500 hover:underline mt-4 d-inline-block"},"Buyer Terms & Conditions",8,wo),t("div",ko,[P(R)])])):l("",!0),t("div",Co,[t("h2",So,i(e(j)?"Items & Shipping":"Items"),1),e(j)?(r(),o("div",Ro,[s[45]||(s[45]=t("svg",{class:"flex-shrink-0 text-grey-500 mt-1",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),t("circle",{cx:"12",cy:"10",r:"3"})],-1)),t("p",$o,[y(i(e(j).line1),1),e(j).line2?(r(),o(H,{key:0},[y(", "+i(e(j).line2),1)],64)):l("",!0),y(", "+i(e(j).city)+", "+i(e(j).state)+" "+i(e(j).zip),1)])])):l("",!0),t("div",null,[(r(!0),o(H,null,se(e(Be),(d,q)=>(r(),o("div",{key:d.shipment?.id||"unshipped",class:I({"mt-24":q>0&&d.shipment})},[d.shipment&&Ze(d.shipment)&&It(q)?(r(),o("p",To,"Shipped")):l("",!0),d.shipment?(r(),o("div",Mo,[t("div",Io,[s[46]||(s[46]=Ge('<svg class="flex-shrink-0 text-grey-500" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="1" y="3" width="15" height="13"></rect><path d="M16 8h5l3 3v5h-2"></path><circle cx="5.5" cy="18.5" r="2.5"></circle><circle cx="18.5" cy="18.5" r="2.5"></circle></svg>',1)),t("span",Do,[t("span",Po,i(e(S).length>1?`Package ${q+1}`:"Shipment"),1),t("span",Ao," · "+i(e(ms)(d.shipment.carrier))+" "+i(e(bs)(d.shipment.service,d.shipment.carrier)),1)]),d.shipment.tracking_status&&d.shipment.tracking_status!=="unknown"?(r(),o("span",{key:0,class:I([Ye(d.shipment.tracking_status),"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0 ml-4 whitespace-nowrap"])},i(He(d.shipment.tracking_status)),3)):l("",!0)]),t("div",Eo,[qe(d.shipment)?(r(),o("a",{key:0,href:qe(d.shipment),target:"_blank",rel:"noopener",class:"button button--secondary button--sm"},"Track",8,Lo)):(r(),o("span",Fo,[...s[47]||(s[47]=[t("button",{type:"button",class:"button button--secondary button--sm",disabled:""},"Track",-1)])]))])])):l("",!0),!d.shipment&&e(S).length>0?(r(),o("hr",Bo)):l("",!0),!d.shipment&&e(S).length>0?(r(),o("div",jo,[...s[48]||(s[48]=[t("svg",{class:"flex-shrink-0 text-amber-600",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 6v6l4 2"})],-1),t("span",{class:"text-sm fw-semi text-amber-800"},"Awaiting shipment",-1)])])):l("",!0),t("div",null,[(r(!0),o(H,null,se(d.lines,(Z,Nt)=>(r(),o("div",{key:Z.id,class:I(["flex gap-12 py-8 items-center",{"border-bottom-1 border-solid border-grey-200":Nt<d.lines.length-1}])},[t("div",Oo,[t("img",{src:e(de)(Z.item),alt:Z.item?.title||Z.description,class:"object-cover rounded-lg border-1 border-solid border-grey-200 d-block",style:{width:"80px","min-width":"80px",height:"80px"},onError:s[9]||(s[9]=(...Vt)=>e(Xe)&&e(Xe)(...Vt))},null,40,Uo)]),t("div",No,[Z.item?.title?(r(),o("p",Vo,i(Z.item.title),
11)):l("",!0),t("p",zo,[Z.quantity>1?(r(),o(H,{key:0},[y("Qty: "+i(Z.quantity)+" × ",1)],64)):l("",!0),y(i(e($)(Z.unit_price)),1)])]),t("div",qo,[t("p",Zo,i(e($)(Z.total_amount)),1)])],2))),128)),d.shipment?(r(),o("div",Ho,[t("span",Yo,i(d.shipment.tracking_number),1)])):l("",!0)])],2))),128))])]),t("div",Wo,[s[54]||(s[54]=t("h2",{class:"text-lg fw-semi text-grey-900 mb-16"},"Order Timeline",-1)),e(c)?(r(),D(w,{key:0,size:"sm",info:"timeline"})):e(m)?(r(),o("div",Ko," Failed to load timeline ")):e(B).length?(r(),o("div",Go,[(r(!0),o(H,null,se(e(B),(d,q)=>(r(),o("div",{key:d.id,class:"flex gap-12 pb-16 border-bottom-1 border-solid border-grey-200 last:border-bottom-0 last:pb-0"},[t("div",Jo,[t("div",{class:I(["timeline-icon",Tt(d.event_type)])},[d.event_type==="created"?(r(),o("svg",Qo,[...s[49]||(s[49]=[t("path",{d:"M12 5v14m-7-7h14"},null,-1)])])):d.event_type==="status_changed"||d.event_type==="payment_updated"?(r(),o("svg",Xo,[...s[50]||(s[50]=[t("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):d.event_type==="shipment_created"||d.event_type==="fulfillment_updated"?(r(),o("svg",en,[...s[51]||(s[51]=[t("rect",{x:"1",y:"3",width:"15",height:"13"},null,-1),t("path",{d:"M16 8h5l3 3v5h-2"},null,-1),t("circle",{cx:"5.5",cy:"18.5",r:"2.5"},null,-1),t("circle",{cx:"18.5",cy:"18.5",r:"2.5"},null,-1)])])):(r(),o("svg",tn,[...s[52]||(s[52]=[t("circle",{cx:"12",cy:"12",r:"10"},null,-1),t("path",{d:"M12 6v6l4 2"},null,-1)])]))],2)]),t("div",sn,[t("p",rn,i(ge(d.description)),1),t("p",on,[y(i(e(f)(d.created_at))+" ",1),d.actor?(r(),o("span",nn," · "+i(d.actor),1)):l("",!0)]),d.new_values?.tracking_number?(r(),o("div",ln,[t("p",an,[s[53]||(s[53]=t("span",{class:"fw-semi"},"Tracking:",-1)),t("span",dn,i(d.new_values.tracking_number),1)])])):l("",!0)])]))),128))])):(r(),o("div",un," No timeline events yet "))])]),t("div",cn,[t("div",pn,[s[65]||(s[65]=t("h2",{class:"text-lg fw-semi text-grey-900 mb-16"},"Payment Summary",-1)),t("div",mn,[t("div",bn,[s[55]||(s[55]=t("span",{class:"text-grey-600"},"Subtotal",-1)),t("span",hn,i(e($)(e(b)?.subtotal)),1)]),e(b)?.buyersPremium>0?(r(),o("div",fn,[s[56]||(s[56]=t("span",{class:"text-grey-600"},"Buyer's Premium",-1)),t("span",_n,i(e($)(e(b)?.buyersPremium)),1)])):l("",!0),t("div",gn,[s[57]||(s[57]=t("span",{class:"text-grey-600"},"Shipping",-1)),e(b)?.shippingAmount>0?(r(),o("span",yn,i(e($)(e(b)?.shippingAmount)),1)):(r(),o("span",vn,"Free"))]),e(b)?.buyerProtectionFee>0?(r(),o("div",xn,[s[58]||(s[58]=t("span",{class:"text-grey-600"},"Buyer Protection",-1)),t("span",wn,i(e($)(e(b)?.buyerProtectionFee)),1)])):l("",!0),t("div",kn,[s[59]||(s[59]=t("span",{class:"text-grey-600"},"Tax",-1)),t("span",Cn,i(e($)(e(b)?.taxAmount)),1)]),t("div",Sn,[t("div",Rn,[s[60]||(s[60]=t("span",{class:"fw-bold text-grey-900"},"Total",-1)),t("span",$n,i(e($)(e(b)?.total)),1)])])]),t("div",Tn,[t("div",Mn,[s[61]||(s[61]=t("span",{class:"text-grey-600"},"Amount Paid",-1)),t("span",In,i(e($)(e(b)?.amountPaid)),1)]),e(b)?.amountDue>0?(r(),o("div",Dn,[s[62]||(s[62]=t("span",{class:"text-grey-600"},"Amount Due",-1)),t("span",Pn,i(e($)(e(b)?.amountDue)),1)])):l("",!0),e(b)?.amountRefunded>0?(r(),o("div",An,[s[63]||(s[63]=t("span",{class:"text-grey-600"},"Refunded",-1)),t("span",En,"-"+i(e($)(e(b)?.amountRefunded)),1)])):l("",!0)]),e(p).notes?(r(),o("div",Ln,[s[64]||(s[64]=t("p",{class:"text-sm text-grey-600 mb-8"},"Order Notes",-1)),t("p",Fn,i(e(p).notes),1)])):l("",!0)])])])])])])):l("",!0),P(z,{ref_key:"shipModalRef",ref:Le,show:e(ve),onClose:s[10]||(s[10]=d=>ve.value=!1),onSubmit:Dt},null,8,["show"]),P(te,{ref_key:"cancelModalRef",ref:Fe,show:e(xe),onClose:s[11]||(s[11]=d=>xe.value=!1),onSubmit:Pt},null,8,["show"]),P(ne,{ref_key:"refundModalRef",ref:Ce,show:e(we),"max-amount":Math.max(0,(e(b)?.amountPaid||0)-(e(b)?.amountRefunded||0)),onClose:s[12]||(s[12]=d=>we.value=!1),onSubmit:At},null,8,["show","max-amount"]),P(Ot,{ref_key:"reportIssueModalRef",ref:Se,show:e(pe),shipments:e(S)||[],lines:e(k)||[],"get-refund-preview":e(pt),"not-shipped-eligible":e(Oe),onClose:s[13]||(s[13]=d=>pe.value=!1),onSubmit:St},null,8,["show","shipments","lines","get-refund-preview","not-shipped-eligible"]),e(a)?(r(),D(Ut,{key:3,show:e(ye),"drawer-id":`invoice-${e(g)}`,"seller-id":e(a).id,"context-type":"invoice","context-id":e(g),"created-from":"invoice","header-title":e(a).name,"header-subtitle":`Order #${e(N)}`,"header-image-url":e(a).logo_url||"","header-initials":e(ht),onClose:s[14]||(s[14]=d=>ye.value=!1)},null,8,["show","drawer-id","seller-id","context-id","header-title","header-subtitle","header-image-url","header-initials"])):l("",!0)])}}};export{Kn 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.