import{p as k,d as v,o as r,c as t,u as d,F as m,g as w,b as x,l as u,h,m as b,e as U,a as V,C,D as $,E as B}from"../vendor-1-1-49.js";import{_ as A}from"../SecondaryButton-1-1-49.js";import{_ as E}from"../ShipmentInfoModal-1-1-49.js";import{p as N,_ as F,a as I,h as L}from"../admin-app-1-1-492.js";import"../BaseButton-1-1-49.js";import"../MdrModal-1-1-49.js";const j={class:"flex flex-col gap-4 items-center"},q={key:0,class:"flex gap-2 items-center"},D=["src","onClick"],M={key:1,class:"flex gap-4 items-start"},R={__name:"App",props:{orderId:{type:[String,Number],required:!0}},setup(a){var f,g;const s=a,i=((f=window.gcargo.shipments)==null?void 0:f[s.orderId])||[],p=((g=window.gcargo.returneds)==null?void 0:g[s.orderId])||[],c=V([]);k(()=>{i.forEach(o=>{c[o.id]=!1})});const y=o=>{const n=atob(o),l=new Uint8Array(n.length);for(let e=0;e<n.length;e++)l[e]=n.charCodeAt(e);return URL.createObjectURL(new Blob([l],{type:"application/pdf"}))};return p.forEach(o=>{o.pdfUrl=o.pdf?y(o.pdf):""}),(o,n)=>{const l=v("arrow-down-tray-icon");return r(),t("div",j,[d(i).length>0?(r(),t("div",q,[(r(!0),t(m,null,w(d(i),e=>(r(),t(m,{key:e.id},[x("img",{src:e.cargo_company.logo,class:"object-cover w-10 cursor-pointer",onClick:_=>c.value[e.id]=!c.value[e.id]},null,8,D),u(E,{modelValue:c.value[e.id],"onUpdate:modelValue":_=>c.value[e.id]=_,shipment:e},null,8,["modelValue","onUpdate:modelValue","shipment"])],64))),128))])):h("",!0),d(p).length>0?(r(),t("div",M,[(r(!0),t(m,null,w(d(p),e=>(r(),t("div",{key:e.id,class:"flex flex-col items-center gap-1"},[u(A,{link:e.pdfUrl,disabled:!e.pdfUrl,download:`iade-barkodu-${a.orderId}.pdf`},{default:b(()=>[n[0]||(n[0]=U(" İade Barkodu ",-1)),u(l,{class:"size-6"})]),_:1},8,["link","disabled","download"])]))),128))])):h("",!0)])}}},S=C({locale:"en",messages:window.gcargo.strings,legacy:!1});function T(a){let s=$(R,{orderId:a}).use(N).use(S).use(B,{prefix:"",decimal:".",thousand:","}).component("MoneyFormat",F).component("TimeFormat",I);s=L(s),s.mount(`#gcargo-order-detail-${a}`)}document.querySelectorAll("[id^='gcargo-order-detail-']").forEach(a=>{T(a.id.replace("gcargo-order-detail-",""))});
