{"version":3,"file":"/js/lazy-load-background-images.js","mappings":"8GAAAA,OAAOC,iBACN,oBACA,SAACC,GAGA,IAAMC,EAAaC,SAASC,iBAAiB,YASvCC,EAAgB,IAAIC,sBAAqB,SAACC,EAASF,GACxDE,EAAQC,SAAQ,SAAAC,GACXA,EAAMC,iBACWD,EAAME,OAavBC,UAAUC,OAAO,WAZpBR,EAAcS,UAAUL,EAAME,QAEhC,GACD,GAb0B,CACzBI,UAAW,EACXC,WAAY,sBAcbd,EAAWM,SAAQ,SAAAS,GAClBZ,EAAca,QAAQD,EACvB,GAMD,G","sources":["webpack://wp-plugin-cirrus-blocks/./source/js/lazy-load-background-images.js"],"sourcesContent":["window.addEventListener(\n\t'DOMContentLoaded',\n\t(event) => {\n\n\t\t// All elements with background images that should be lazy loaded\n\t\tconst lazyImages = document.querySelectorAll('.lazy-bg');\n\n\t\t// Options for the observer\n\t\tconst backgroundOptions = {\n\t\t\tthreshold: 0,\n\t\t\trootMargin: \"0px 0px 500px 0px\"\n\t\t};\n\n\t\t// the observer\n\t\tconst imageObserver = new IntersectionObserver((entries, imageObserver) => {\n\t\t\tentries.forEach(entry => {\n\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\tshowImageBackground(entry.target);\n\t\t\t\t\timageObserver.unobserve(entry.target);\n\t\t\t\t}\n\t\t\t});\n\t\t}, backgroundOptions);\n\n\t\t// observe each image\n\t\tlazyImages.forEach(image => {\n\t\t\timageObserver.observe(image);\n\t\t});\n\n\t\t// show background image\n\t\tfunction showImageBackground(node) {\n\t\t\tnode.classList.remove('lazy-bg');\n\t\t}\n\t}\n);"],"names":["window","addEventListener","event","lazyImages","document","querySelectorAll","imageObserver","IntersectionObserver","entries","forEach","entry","isIntersecting","target","classList","remove","unobserve","threshold","rootMargin","image","observe"],"sourceRoot":""}