1import{b1 as h,b0 as u,aU as o,aP as s,aX as r,aV as _,bB as w,bz as b,b4 as n,b5 as m,aO as c,bT as d}from"./v7.12-_pfsIBSO.js";const I=h({name:"GoodsGalleryItem",props:{item:{type:Object,required:!0}},methods:{trackImageClick(){this.sendAnalyticsData("Ðлик_изобÑажение в галеÑее ÑоваÑа")},trackCaptionClick(){this.sendAnalyticsData("Ðлик_ÑÑÑлка в галеÑее ÑоваÑа")},sendAnalyticsData(e){this.$sendYandexMetrika({level1:e,level4:this.item.url})}}},"$OHPN9xZOJi"),k={class:"goods-gallery-item"},f=["href"],C=["src","width","height","alt"],$={key:0,class:"goods-gallery-item__caption"},R=["href"];function G(e,t,l,g,p,y){return s(),o("figure",k,[r("a",{class:"goods-gallery-item__image-box",href:e.item.url,target:"_blank",onClick:t[0]||(t[0]=(...a)=>e.trackImageClick&&e.trackImageClick(...a))},[r("img",{class:"goods-gallery-item__image",src:e.item.image.url,width:e.item.image.width,height:e.item.image.height,alt:e.item.label},null,8,C)],8,f),e.item.label?(s(),o("figcaption",$,[r("a",{href:e.item.url,target:"_blank",onClick:t[1]||(t[1]=(...a)=>e.trackCaptionClick&&e.trackCaptionClick(...a))},w(e.item.label),9,R)])):_("",!0)])}const v=u(I,[["render",G],["__scopeId","data-v-98e85837"]]),Q=typeof window<"u",A=h({name:"GoodsGallery",components:{GoodsGalleryItem:v},props:{elem:{type:Object,required:!0}},data:()=>({tabletQuery:null,columns:2}),computed:{allItems(){return this.elem.attributes.items},lastRowItemsCount(){return this.allItems.length%this.columns},rowItems(){return this.allItems.slice(0,this.allItems.length-this.lastRowItemsCount)},rowItemsColumns(){return Array(this.columns).fill("1fr").join(" ")},lastRowItems(){return this.allItems.slice(this.allItems.length-this.lastRowItemsCount)},rowItemsAspectRatio(){const e=[...this.rowItems].sort((t,l)=>t.image.height-l.image.height)[0];return(e==null?void 0:e.image.width)/(e==null?void 0:e.image.height)||1},lastRowItemsAspectRatio(){const e=[...this.lastRowItems].sort((t,l)=>t.image.height-l.image.height)[0];return(e==null?void 0:e.image.width)/(e==null?void 0:e.image.height)||1}},mounted(){this.tabletQuery=window.matchMedia("(min-width: 768px)"),this.columns=this.tabletQuery.matches?3:2,this.tabletQuery.addEventListener("change",this.watchTabletMedia)},unmounted(){var e;(e=this.tabletQuery)==null||e.removeEventListener("change",this.watchTabletMedia)},methods:{watchTabletMedia(e){this.columns=e.matches?3:2}}},"$c1J5LbMeVG"),B={class:"goods-gallery"};function M(e,t,l,g,p,y){const a=b("GoodsGalleryItem");return s(),o("div",B,[r("div",{class:"goods-gallery__items",style:d({"grid-template-columns":e.rowItemsColumns,"--aspect-ratio":`${e.rowItemsAspectRatio}`})},[(s(!0),o(n,null,m(e.rowItems,i=>(s(),c(a,{key:i.image.url,item:i,class:"goods-gallery__item"},null,8,["item"]))),128))],4),r("div",{class:"goods-gallery__last-row",style:d({"--aspect-ratio":e.lastRowItemsAspectRatio})},[(s(!0),o(n,null,m(e.lastRowItems,i=>(s(),c(a,{key:i.image.url,item:i,class:"goods-gallery__item"},null,8,["item"]))),128))],4)])}const D=u(A,[["render",M],["__scopeId","data-v-34cbc3f7"]]);export{Q as IS_BROWSER,D as default}; 2//# sourceMappingURL=v7.12-G181fCpH.js.map
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.