var r;(r=jQuery)(document).on("doResponsiveLightbox",i=>{if(void 0!==i.masonry&&!1===i.masonry)return!1;if(void 0!==i.pagination_type)if("infinite"===i.pagination_type){const o=i.infinite.gallery,e=parseInt(o.data("gallery_no"))+1,n=i.infinite.items;if(void 0!==window["rlArgsBasicMasonryGallery"+e]){const i=window["rlArgsBasicMasonryGallery"+e],a=o.masonry({itemSelector:".rl-gallery-item",columnWidth:".rl-grid-sizer",percentPosition:!0,originLeft:i.originLeft,originTop:i.originTop});a.append(n).masonry("appended",n),a.imagesLoaded(()=>{a.masonry("layout"),!1===rlArgs.scriptExtension&&r.event.trigger({type:"doResponsiveLightbox",script:rlArgs.script,selector:rlArgs.selector,args:rlArgs,masonry:!1})})}}else{const o=r(`.rl-gallery-container[data-gallery_id="${i.gallery_id}"] .rl-gallery`),e=parseInt(o.data("gallery_no"))+1;if(void 0!==window["rlArgsBasicMasonryGallery"+e]){const r=window["rlArgsBasicMasonryGallery"+e];o.masonry({itemSelector:".rl-gallery-item",columnWidth:".rl-grid-sizer",percentPosition:!0,originLeft:r.originLeft,originTop:r.originTop}),o.imagesLoaded(()=>{o.masonry("layout")})}}else r(".rl-basicmasonry-gallery").each((i,o)=>{const e=r(o),n=parseInt(e.data("gallery_no"))+1;if(void 0!==window["rlArgsBasicMasonryGallery"+n]){const r=window["rlArgsBasicMasonryGallery"+n];e.masonry({itemSelector:".rl-gallery-item",columnWidth:".rl-grid-sizer",percentPosition:!0,originLeft:r.originLeft,originTop:r.originTop}),e.imagesLoaded(()=>{e.parent().removeClass("rl-loading"),e.masonry("layout")})}})});
