Your IP : 3.139.70.243


Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/main/lazyload/dist/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/main/lazyload/dist/lazyload.bundle.js.map

{"version":3,"file":"lazyload.bundle.js","sources":["../src/lazyload.js"],"sourcesContent":["import {Type} from 'main.core';\nimport 'main.polyfill.intersectionobserver';\n\nconst LazyLoad = {\n\tobserver: null,\n\timages: {},\n\timageStatus: {\n\t\thidden: -2,\n\t\terror: -1,\n\t\t\"undefined\": 0,\n\t\tinited: 1,\n\t\tloaded: 2\n\t},\n\timageTypes: {\n\t\timage: 1,\n\t\tbackground: 2\n\t},\n\n\tinitObserver: function()\n\t{\n\t\tthis.observer = new IntersectionObserver(this.onIntersection.bind(this), {\n\t\t\trootMargin: '20% 0% 20% 0%',\n\t\t\tthreshold: 0.10\n\t\t});\n\t},\n\n\tonIntersection: function(entries)\n\t{\n\t\tentries.forEach(function (entry) {\n\t\t\tif (entry.isIntersecting)\n\t\t\t{\n\t\t\t\tthis.showImage(entry.target);\n\t\t\t}\n\t\t}.bind(this));\n\t},\n\n\tregisterImage: function(id, isImageVisibleCallback, options)\n\t{\n\t\tif (this.observer === null)\n\t\t{\n\t\t\tthis.initObserver();\n\t\t}\n\n\t\toptions = options || {};\n\n\t\tif (!Type.isStringFilled(id))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (Type.isObject(this.images[id]))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tconst element = document.getElementById(id);\n\t\tif (!Type.isDomNode(element))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.observer.observe(element);\n\n\t\tthis.images[id] = {\n\t\t\tid: id,\n\t\t\tnode: null,\n\t\t\tsrc: null,\n\t\t\tdataSrcName: options.dataSrcName || 'src',\n\t\t\ttype: null,\n\t\t\tfunc: Type.isFunction(isImageVisibleCallback) ? isImageVisibleCallback : null,\n\t\t\tstatus: this.imageStatus.undefined\n\t\t};\n\t},\n\n\tregisterImages: function(ids, isImageVisibleCallback, options)\n\t{\n\t\tif (Type.isArray(ids))\n\t\t{\n\t\t\tfor (let i = 0, length = ids.length; i < length; i++)\n\t\t\t{\n\t\t\t\tthis.registerImage(ids[i], isImageVisibleCallback, options);\n\t\t\t}\n\t\t}\n\t},\n\n\tshowImage: function(imageNode)\n\t{\n\t\tconst imageNodeId = imageNode.id;\n\t\tif (!Type.isStringFilled(imageNodeId))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tlet image = this.images[imageNodeId];\n\t\tif (!Type.isPlainObject(image))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (image.status == this.imageStatus.undefined)\n\t\t{\n\t\t\tthis.initImage(image);\n\t\t}\n\n\t\tif (image.status !== this.imageStatus.inited)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t!image.node\n\t\t\t|| !image.node.parentNode\n\t\t)\n\t\t{\n\t\t\timage.node = null;\n\t\t\timage.status = this.imageStatus.error;\n\t\t\treturn;\n\t\t}\n\n\t\tif (image.type == this.imageTypes.image)\n\t\t{\n\t\t\timage.node.src = image.src;\n\t\t}\n\t\telse\n\t\t{\n\t\t\timage.node.style.backgroundImage = \"url('\" + image.src + \"')\";\n\t\t}\n\n\t\timage.node.dataset[image.dataSrcName] = \"\";\n\t\timage.status = this.imageStatus.loaded;\n\t},\n\n\tshowImages: function(checkOwnVisibility)\n\t{\n\t\tcheckOwnVisibility = (checkOwnVisibility !== false);\n\n\t\tfor (let id in this.images)\n\t\t{\n\t\t\tif (!this.images.hasOwnProperty(id))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet image = this.images[id];\n\n\t\t\tif (image.status == this.imageStatus.undefined)\n\t\t\t{\n\t\t\t\tthis.initImage(image);\n\t\t\t}\n\n\t\t\tif (image.status !== this.imageStatus.inited)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!image.node\n\t\t\t\t|| !image.node.parentNode\n\t\t\t)\n\t\t\t{\n\t\t\t\timage.node = null;\n\t\t\t\timage.status = this.imageStatus.error;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet isImageVisible = true;\n\t\t\tif (\n\t\t\t\tcheckOwnVisibility\n\t\t\t\t&& Type.isFunction(image.func)\n\t\t\t)\n\t\t\t{\n\t\t\t\tisImageVisible = image.func(image);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tisImageVisible === true\n\t\t\t\t&& this.isElementVisibleOnScreen(image.node)\n\t\t\t)\n\t\t\t{\n\t\t\t\tif (image.type == this.imageTypes.image)\n\t\t\t\t{\n\t\t\t\t\timage.node.src = image.src;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\timage.node.style.backgroundImage = \"url('\" + image.src + \"')\";\n\t\t\t\t}\n\n\t\t\t\timage.node.dataset[image.dataSrcName] = \"\";\n\t\t\t\timage.status = this.imageStatus.loaded;\n\t\t\t}\n\t\t}\n\t},\n\n\tinitImage: function(image)\n\t{\n\t\timage.status = this.imageStatus.error;\n\t\tconst node = document.getElementById(image.id);\n\n\t\tif (!Type.isDomNode(node))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tconst src = node.dataset[image.dataSrcName];\n\t\tif (Type.isStringFilled(src))\n\t\t{\n\t\t\timage.node = node;\n\t\t\timage.src = src;\n\t\t\timage.status = this.imageStatus.inited;\n\t\t\timage.type = (image.node.tagName.toLowerCase() == \"img\"\n\t\t\t\t\t? this.imageTypes.image\n\t\t\t\t\t: this.imageTypes.background\n\t\t\t);\n\t\t}\n\t},\n\n\tisElementVisibleOnScreen: function (element)\n\t{\n\t\tconst coords = this.getElementCoords(element);\n\t\tconst windowTop = window.pageYOffset || document.documentElement.scrollTop;\n\t\tconst windowBottom = windowTop + document.documentElement.clientHeight;\n\n\t\tcoords.bottom = coords.top + element.offsetHeight;\n\n\t\treturn (\n\t\t\t(coords.top > windowTop && coords.top < windowBottom) // topVisible\n\t\t\t|| (coords.bottom < windowBottom && coords.bottom > windowTop) // bottomVisible\n\t\t);\n\t},\n\n\tisElementVisibleOn2Screens: function(element)\n\t{\n\t\tconst windowHeight = document.documentElement.clientHeight;\n\n\n\t\tvar windowTop = window.pageYOffset || document.documentElement.scrollTop;\n\t\tvar windowBottom = windowTop + windowHeight;\n\t\tvar coords = this.getElementCoords(element);\n\n\t\tcoords.bottom = coords.top + element.offsetHeight;\n\n\t\twindowTop -= windowHeight;\n\t\twindowBottom += windowHeight;\n\n\t\treturn (\n\t\t\t(coords.top > windowTop && coords.top < windowBottom) // topVisible\n\t\t\t|| (coords.bottom < windowBottom && coords.bottom > windowTop) // bottomVisible\n\t\t);\n\t},\n\n\tgetElementCoords: function(element)\n\t{\n\t\tconst box = element.getBoundingClientRect();\n\n\t\treturn {\n\t\t\toriginTop: box.top,\n\t\t\toriginLeft: box.left,\n\t\t\ttop: box.top + window.pageYOffset,\n\t\t\tleft: box.left + window.pageXOffset\n\t\t};\n\t},\n\n\tonScroll: function()\n\t{\n\t},\n\n\tclearImages: function ()\n\t{\n\t\tthis.images = [];\n\t}\n};\n\nexport {LazyLoad};"],"names":["LazyLoad","observer","images","imageStatus","hidden","error","inited","loaded","imageTypes","image","background","initObserver","IntersectionObserver","onIntersection","bind","rootMargin","threshold","entries","forEach","entry","isIntersecting","showImage","target","registerImage","id","isImageVisibleCallback","options","Type","isStringFilled","isObject","element","document","getElementById","isDomNode","observe","node","src","dataSrcName","type","func","isFunction","status","undefined","registerImages","ids","isArray","i","length","imageNode","imageNodeId","isPlainObject","initImage","parentNode","style","backgroundImage","dataset","showImages","checkOwnVisibility","hasOwnProperty","isImageVisible","isElementVisibleOnScreen","tagName","toLowerCase","coords","getElementCoords","windowTop","window","pageYOffset","documentElement","scrollTop","windowBottom","clientHeight","bottom","top","offsetHeight","isElementVisibleOn2Screens","windowHeight","box","getBoundingClientRect","originTop","originLeft","left","pageXOffset","onScroll","clear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