import{_ as b,I as v,aN as k,k as F,r,o as t,b as o,F as u,e as f,p as s,v as a,l as w,q as d,n as _,a as p}from"./main-DHoZdmBw.js";import{_ as V}from"./catalogMixin-uYMILN5M.js";import{p as C}from"./index-BuUnCgYx.js";const L={name:"DocumentDownloadItemsFi",components:{IconFi:v,CountryFlagFi:k},mixins:[F,V],props:{documents:{type:Array,default:()=>[]},subItems:{type:Boolean,default:!1},theme:{type:String,default:null},isFocusable:{type:Boolean,default:!0}},data(){return{isMounted:!1}},computed:{isDownloadCenter(){return this.theme==="download-center"}},mounted(){this.isMounted=!0},methods:{prettyBytes(i){return this.isMounted?C(i,{maximumFractionDigits:1}):""},documentNumber(i){return i.nr?i.nr:this.textListValue(i.AttributeList,"ZULANR")},getDate(i){return i?new Date(i).toLocaleDateString(this.$fischer.siteLanguage(),{day:"2-digit",month:"2-digit",year:"numeric"}):null},productUrl(i){return`${this.$fischer.pages.products().url}${i}`}}},N={class:"document-download-items-fi__item-column document-download-items-fi__item-column--product"},B={class:"document-download-items-fi__file-details"},S=["href","tabindex"],T={class:"document-download-items-fi__file-name"},I={class:"document-download-items-fi__file-meta-info"},z={key:0,class:"document-download-items-fi__file-meta-info-column document-download-items-fi__file-meta-info-column--language"},M={class:"document-download-items-fi__file-type"},U={class:"document-download-items-fi__file-size"},x={key:2,class:"document-download-items-fi__file-meta-info-column"},A={key:0,class:"document-download-items-fi__description"},H=["href"],q={class:"document-download-items-fi__item-column document-download-items-fi__item-column--details"},E={key:0,class:"document-download-items-fi__description"},R={key:1,class:"document-download-items-fi__categories"},Z={class:"document-download-items-fi__categories__label"},j=["href","alt","tabindex"],G={key:1},J={class:"document-download-items-fi__item-column document-download-items-fi__item-column--date"},K={class:"document-download-items-fi__date-container"},O={key:0,class:"document-download-items-fi__date-valid-from"},P={key:1,class:"document-download-items-fi__date-valid-to"},Q=["innerHTML"];function W(i,h,l,X,Y,n){const g=r("country-flag-fi"),D=r("icon-fi"),y=r("document-download-items-fi",!0);return t(),o("div",{class:_(["document-download-items-fi",l.subItems?"document-download-items-fi--sub-items":null,l.theme?`document-download-items-fi--${l.theme}`:null])},[(t(!0),o(u,null,f(l.documents,(e,c)=>(t(),o("div",{key:`${c}-item`,class:"document-download-items-fi__item"},[(t(),o("div",{key:`${c}-item`,class:"document-download-items-fi__item-wrapper"},[s("div",N,[s("div",B,[s("a",{class:"document-download-items-fi__file-link",href:e.Url,tabindex:l.isFocusable?null:"-1",target:"_blank",download:""},[s("div",T,a(e.Name),1)],8,S),s("div",I,[n.isDownloadCenter&&e.Language?(t(),o("span",z,[w(g,{country:e.Language.toLowerCase(),size:"small"},null,8,["country"])])):d("",!0),e.Format||e.FileSize?(t(),o("span",{key:1,class:_({"document-download-items-fi__file-meta-info-column":!0,"document-download-items-fi__file-meta-info-column--has-document-number":n.documentNumber(e)})},[s("span",M,a(e.Format)+", ",1),s("span",U,a(n.prettyBytes(e.FileSize)),1)],2)):d("",!0),n.documentNumber(e)?(t(),o("span",x,a(n.documentNumber(e)),1)):d("",!0)]),e.Description&&n.isDownloadCenter?(t(),o("div",A,a(e.Description),1)):d("",!0)])]),s("a",{class:_({"document-download-items-fi__item-column":!0,"document-download-items-fi__item-column--icon":!0,"document-download-items-fi__item-column--icon-dwnld":n.isDownloadCenter}),href:e.Url,target:"_blank",download:""},[w(D,{class:"document-download-items-fi__file-download-icon-svg",icon:"download"})],10,H),s("div",q,[e.Description&&!n.isDownloadCenter?(t(),o("div",E,a(e.Description),1)):d("",!0),e.categories&&n.isDownloadCenter?(t(),o("div",R,[s("div",Z,a(i.$dict.get("download-Center.Document-Downloads.Label-Categories")),1),(t(!0),o(u,null,f(e.categories,m=>(t(),o("div",{key:m.name},[m.Slug?(t(),o("a",{key:0,href:n.productUrl(m.Slug),alt:m.name,tabindex:l.isFocusable?null:"-1",target:"_blank"},a(m.name),9,j)):(t(),o("span",G,a(m.name),1))]))),128))])):d("",!0)]),s("div",J,[s("div",K,[e.ValidFrom&&!e.ValidTo?(t(),o("div",O,a(i.$dict.get("download-Center.Document-Downloads.Valid-From",[n.getDate(e.ValidFrom)])),1)):d("",!0),e.ValidTo&&!e.ValidFrom?(t(),o("div",P,a(i.$dict.get("download-Center.Document-Downloads.Valid-To",[n.getDate(e.ValidTo)])),1)):d("",!0),e.ValidFrom&&e.ValidTo?(t(),o("div",{key:2,class:"document-download-items-fi__date-valid-to",innerHTML:i.$dict.get("download-Center.Document-Downloads.Valid-From-To",[n.getDate(e.ValidFrom),n.getDate(e.ValidTo)])},null,8,Q)):d("",!0)])])])),e.Subitems?(t(),p(y,{key:`${c}-subitem`,theme:l.theme,documents:e.Subitems,"sub-items":""},null,8,["theme","documents"])):d("",!0)]))),128))],2)}const oe=b(L,[["render",W],["__scopeId","data-v-0545dde4"]]);export{oe as D};