!function(){"use strict";document.addEventListener("rey-DOMContentLoaded",(function(){var t;t=".rey-grid-loadMore",rey.dom.delegate(document,"click",t,(function(e){e.preventDefault();var r=e.initiator,i=r.getAttribute("data-offset"),a=r.getAttribute("data-el-id"),o=r.getAttribute("data-target");if(i&&a&&o){r.classList.add("--loading");var l=`[data-id="${a}"]`,n=r.closest(l).querySelector(o),d=parseInt(r.getAttribute("data-limit")||0);if(n){var s={reycore_grid_offset:i,reycore_grid_offset_id:a},c=rey.util.setUrlVars(s,window.location.origin+window.location.pathname);rey.ajax.url(c,{cb:function(){if("OK"===this.statusText){var e=(new DOMParser).parseFromString(this.responseText,"text/html"),i=e.querySelectorAll(`${l} ${o}  > .__item`),a=!i.length||d&&d>i.length;if(i.length)for(let t=0;t<i.length;t++)n.appendChild(i[t]);if(a)r.classList.remove("--loading"),r.classList.add("disabled");else{r.classList.remove("--loading");var s=e.querySelector(`${l} ${t}`);s&&r.replaceWith(s)}}}})}}}))}))}();