import{d as T,e as v,f as _,i as S,x as f,t as j}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as Y}from"./vendor-vue-reactivity-CheHbvBM.js";import{b as p,t as y}from"./vendor-vue-shared-DrzsEcag.js";const $={class:"ccb-pdf-layout__item--wrapper order_id_and_date","data-id":"order_id_and_date"},q={key:0,class:"ccb-pdf-item-info--item id"},G={key:1,class:"ccb-pdf-item-info--item date"},Q=T({__name:"OrderIdAndDate",props:{pdf:{},item:{},content:{}},setup(z){const B=z,{pdf:h,item:l,content:g}=Y(B),F=v(()=>{var a,s,o,d,n,r,u,i,c;const e={},t=(a=h.value.document)==null?void 0:a.tabs;return(d=(o=(s=t==null?void 0:t.body)==null?void 0:s.data)==null?void 0:o.backgroundColor)!=null&&d.value&&(e.backgroundColor=t.body.data.backgroundColor.value),(c=(i=(u=(r=(n=l.value.tabs)==null?void 0:n.design)==null?void 0:r.data)==null?void 0:u.backgroundColor)==null?void 0:i.data)!=null&&c.status?e.backgroundColor=l.value.tabs.design.data.backgroundColor.value:e.backgroundColor="transparent",e}),b=v(()=>{var a,s,o,d,n,r,u,i,c,m,C,k,D,w,A,I,O;const e={},t=(a=h.value.document)==null?void 0:a.tabs;return(d=(o=(s=t==null?void 0:t.body)==null?void 0:s.data)==null?void 0:o.textColor)!=null&&d.value&&(e.color=t.body.data.textColor.value),(c=(i=(u=(r=(n=l.value.tabs)==null?void 0:n.design)==null?void 0:r.data)==null?void 0:u.textColor)==null?void 0:i.data)!=null&&c.status&&(e.color=l.value.tabs.design.data.textColor.value),(D=(k=(C=(m=l.value.tabs)==null?void 0:m.design)==null?void 0:C.data)==null?void 0:k.textAlign)!=null&&D.value&&(e.textAlign=l.value.tabs.design.data.textAlign.value==="justified"?"justify":l.value.tabs.design.data.textAlign.value),(O=(I=(A=(w=l.value.tabs)==null?void 0:w.design)==null?void 0:A.data)==null?void 0:I.fontSize)!=null&&O.value&&(e.fontSize=`${l.value.tabs.design.data.fontSize.value}px`),e}),L=v(()=>{const e={left:"start",right:"end",center:"center",justify:"start"},t=b.value.textAlign||"left";return{justifyContent:e[t]}}),M=v(()=>{var e,t,a,s,o,d;return(d=(o=(s=(a=(t=(e=l.value)==null?void 0:e.tabs)==null?void 0:t.id)==null?void 0:a.data)==null?void 0:s.showOrderId)==null?void 0:o.data)==null?void 0:d.status}),x=v(()=>{var e;return((e=g.value)==null?void 0:e.id)||""}),N=v(()=>{var e,t,a,s,o;return(o=(s=(a=(t=(e=l.value)==null?void 0:e.tabs)==null?void 0:t.id)==null?void 0:a.data)==null?void 0:s.showOrderId)==null?void 0:o.value}),V=v(()=>{var e,t,a,s,o,d;return(d=(o=(s=(a=(t=(e=l.value)==null?void 0:e.tabs)==null?void 0:t.date)==null?void 0:a.data)==null?void 0:s.showDate)==null?void 0:o.data)==null?void 0:d.status}),E=v(()=>{var e,t,a,s,o;return(o=(s=(a=(t=(e=l.value)==null?void 0:e.tabs)==null?void 0:t.date)==null?void 0:a.data)==null?void 0:s.showDate)==null?void 0:o.value}),H=v(()=>{var d,n,r,u,i,c,m;const e=((c=(i=(u=(r=(n=(d=l.value.tabs)==null?void 0:d.date)==null?void 0:n.data)==null?void 0:r.format)==null?void 0:u.data)==null?void 0:i.dateFormat)==null?void 0:c.value)||"dd/mm/yyyy";let t=new Date;(m=g.value)!=null&&m.date&&(t=new Date(g.value.date));const a=String(t.getDate()).padStart(2,"0"),s=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getFullYear());return e.replace("dd",a).replace("mm",s).replace("yyyy",o)}),R=v(()=>{var d,n,r,u,i,c,m;const e=((c=(i=(u=(r=(n=(d=l.value.tabs)==null?void 0:d.date)==null?void 0:n.data)==null?void 0:r.format)==null?void 0:u.data)==null?void 0:i.timeFormat)==null?void 0:c.value)||"hh:mm:ss";let t=new Date;(m=g.value)!=null&&m.date&&(t=new Date(g.value.date));const a=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return e.replace("hh",a).replace("mm",s).replace("ss",o)});return(e,t)=>(S(),_("div",{class:"ccb-pdf-layout__item",style:p(F.value)},[f("div",$,[f("span",{class:"ccb-pdf-item-info",style:p(L.value)},[M.value&&x.value?(S(),_("span",q,[f("span",{class:"ccb-pdf-item-info--item-label",style:p(b.value)},y(N.value),5),f("span",{class:"ccb-pdf-item-info--item-value",style:p(b.value)},y(x.value),5)])):j("",!0),V.value?(S(),_("span",G,[f("span",{class:"ccb-pdf-item-info--item-label",style:p(b.value)},y(E.value),5),f("span",{class:"ccb-pdf-item-info--item-value",style:p(b.value)},y(H.value)+" "+y(R.value),5)])):j("",!0)],4)])],4))}});export{Q as default};
//# sourceMappingURL=OrderIdAndDate-vzoSo5T9.js.map
