File: /var/www/www-root/data/www/NEWs/news.automoon.click/templates/2/js/crabs_main.js
function _extends(){return(_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target}).apply(this,arguments)}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}!function(global,factory){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):global.LazyLoad=factory()}(this,function(){"use strict";var runningOnBrowser="undefined"!=typeof window,isBot=runningOnBrowser&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),supportsIntersectionObserver=runningOnBrowser&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&"isIntersecting"in window.IntersectionObserverEntry.prototype,supportsClassList=runningOnBrowser&&"classList"in document.createElement("p"),defaultSettings={elements_selector:"img",container:isBot||runningOnBrowser?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,auto_unobserve:!0,callback_enter:null,callback_exit:null,callback_reveal:null,callback_loaded:null,callback_error:null,callback_finish:null,use_native:!1},getInstanceSettings=function getInstanceSettings(customSettings){return _extends({},defaultSettings,customSettings)},createInstance=function createInstance(classObj,options){var event,eventString="LazyLoad::Initialized",instance=new classObj(options);try{event=new CustomEvent(eventString,{detail:{instance:instance}})}catch(err){(event=document.createEvent("CustomEvent")).initCustomEvent(eventString,!1,!1,{instance:instance})}window.dispatchEvent(event)};function autoInitialize(classObj,options){if(options)if(options.length)for(var i=0,optionsItem;optionsItem=options[i];i+=1)createInstance(classObj,optionsItem);else createInstance(classObj,options)}var dataPrefix="data-",processedDataName="was-processed",timeoutDataName="ll-timeout",trueString="true",getData=function getData(element,attribute){return element.getAttribute("data-"+attribute)},setData=function setData(element,attribute,value){var attrName="data-"+attribute;null!==value?element.setAttribute(attrName,value):element.removeAttribute(attrName)},setWasProcessedData=function setWasProcessedData(element){return setData(element,"was-processed","true")},getWasProcessedData=function getWasProcessedData(element){return"true"===getData(element,"was-processed")},setTimeoutData=function setTimeoutData(element,value){return setData(element,"ll-timeout",value)},getTimeoutData=function getTimeoutData(element){return getData(element,"ll-timeout")},purgeProcessedElements=function purgeProcessedElements(elements){return elements.filter(function(element){return!getWasProcessedData(element)})},purgeOneElement=function purgeOneElement(elements,elementToPurge){return elements.filter(function(element){return element!==elementToPurge})},callbackIfSet=function callbackIfSet(callback,argument){callback&&callback(argument)},updateLoadingCount=function updateLoadingCount(instance,plusMinus){instance._loadingCount+=plusMinus,0===instance._elements.length&&0===instance._loadingCount&&callbackIfSet(instance._settings.callback_finish)},getSourceTags=function getSourceTags(parentTag){for(var sourceTags=[],i=0,childTag;childTag=parentTag.children[i];i+=1)"SOURCE"===childTag.tagName&&sourceTags.push(childTag);return sourceTags},setAttributeIfValue=function setAttributeIfValue(element,attrName,value){value&&element.setAttribute(attrName,value)},setImageAttributes=function setImageAttributes(element,settings){setAttributeIfValue(element,"sizes",getData(element,settings.data_sizes)),setAttributeIfValue(element,"srcset",getData(element,settings.data_srcset)),setAttributeIfValue(element,"src",getData(element,settings.data_src))},setSourcesImg,setSourcesIframe,setSourcesVideo,setSourcesBgImage=function setSourcesBgImage(element,settings){var srcDataValue=getData(element,settings.data_src),bgDataValue=getData(element,settings.data_bg);srcDataValue&&(element.style.backgroundImage='url("'.concat(srcDataValue,'")')),bgDataValue&&(element.style.backgroundImage=bgDataValue)},setSourcesFunctions={IMG:function setSourcesImg(element,settings){var parent=element.parentNode,sourceTags;parent&&"PICTURE"===parent.tagName&&getSourceTags(parent).forEach(function(sourceTag){setImageAttributes(sourceTag,settings)});setImageAttributes(element,settings)},IFRAME:function setSourcesIframe(element,settings){setAttributeIfValue(element,"src",getData(element,settings.data_src))},VIDEO:function setSourcesVideo(element,settings){var sourceTags;getSourceTags(element).forEach(function(sourceTag){setAttributeIfValue(sourceTag,"src",getData(sourceTag,settings.data_src))}),setAttributeIfValue(element,"src",getData(element,settings.data_src)),element.load()}},setSources=function setSources(element,instance){var settings=instance._settings,tagName=element.tagName,setSourcesFunction=setSourcesFunctions[tagName];if(setSourcesFunction)return setSourcesFunction(element,settings),updateLoadingCount(instance,1),void(instance._elements=purgeOneElement(instance._elements,element));setSourcesBgImage(element,settings)},addClass=function addClass(element,className){supportsClassList?element.classList.add(className):element.className+=(element.className?" ":"")+className},removeClass=function removeClass(element,className){supportsClassList?element.classList.remove(className):element.className=element.className.replace(new RegExp("(^|\s+)"+className+"(\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},genericLoadEventName="load",mediaLoadEventName="loadeddata",errorEventName="error",addEventListener=function addEventListener(element,eventName,handler){element.addEventListener(eventName,handler)},removeEventListener=function removeEventListener(element,eventName,handler){element.removeEventListener(eventName,handler)},addEventListeners=function addEventListeners(element,loadHandler,errorHandler){addEventListener(element,"load",loadHandler),addEventListener(element,"loadeddata",loadHandler),addEventListener(element,"error",errorHandler)},removeEventListeners=function removeEventListeners(element,loadHandler,errorHandler){removeEventListener(element,"load",loadHandler),removeEventListener(element,"loadeddata",loadHandler),removeEventListener(element,"error",errorHandler)},eventHandler=function eventHandler(event,success,instance){var settings=instance._settings,className=success?settings.class_loaded:settings.class_error,callback=success?settings.callback_loaded:settings.callback_error,element=event.target;removeClass(element,settings.class_loading),addClass(element,className),callbackIfSet(callback,element),updateLoadingCount(instance,-1)},addOneShotEventListeners=function addOneShotEventListeners(element,instance){var loadHandler=function loadHandler(event){eventHandler(event,!0,instance),removeEventListeners(element,loadHandler,errorHandler)},errorHandler=function errorHandler(event){eventHandler(event,!1,instance),removeEventListeners(element,loadHandler,errorHandler)};addEventListeners(element,loadHandler,errorHandler)},managedTags=["IMG","IFRAME","VIDEO"],onEnter=function onEnter(element,instance){var settings=instance._settings;callbackIfSet(settings.callback_enter,element),settings.load_delay?delayLoad(element,instance):revealAndUnobserve(element,instance)},revealAndUnobserve=function revealAndUnobserve(element,instance){var observer=instance._observer;revealElement(element,instance),observer&&instance._settings.auto_unobserve&&observer.unobserve(element)},onExit=function onExit(element,instance){var settings=instance._settings;callbackIfSet(settings.callback_exit,element),settings.load_delay&&cancelDelayLoad(element)},cancelDelayLoad=function cancelDelayLoad(element){var timeoutId=getTimeoutData(element);timeoutId&&(clearTimeout(timeoutId),setTimeoutData(element,null))},delayLoad=function delayLoad(element,instance){var loadDelay=instance._settings.load_delay,timeoutId=getTimeoutData(element);timeoutId||(timeoutId=setTimeout(function(){revealAndUnobserve(element,instance),cancelDelayLoad(element)},loadDelay),setTimeoutData(element,timeoutId))},revealElement=function revealElement(element,instance,force){var settings=instance._settings;!force&&getWasProcessedData(element)||(managedTags.indexOf(element.tagName)>-1&&(addOneShotEventListeners(element,instance),addClass(element,settings.class_loading)),setSources(element,instance),setWasProcessedData(element),callbackIfSet(settings.callback_reveal,element),callbackIfSet(settings.callback_set,element))},isIntersecting=function isIntersecting(entry){return entry.isIntersecting||entry.intersectionRatio>0},getObserverSettings=function getObserverSettings(settings){return{root:settings.container===document?null:settings.container,rootMargin:settings.thresholds||settings.threshold+"px"}},setObserver=function setObserver(instance){return!!supportsIntersectionObserver&&(instance._observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){return isIntersecting(entry)?onEnter(entry.target,instance):onExit(entry.target,instance)})},getObserverSettings(instance._settings)),!0)},nativeLazyTags=["IMG","IFRAME"],shouldUseNative=function shouldUseNative(settings){return settings.use_native&&"loading"in HTMLImageElement.prototype},loadAllNative=function loadAllNative(instance){instance._elements.forEach(function(element){-1!==nativeLazyTags.indexOf(element.tagName)&&(element.setAttribute("loading","lazy"),revealElement(element,instance))})},nodeSetToArray=function nodeSetToArray(nodeSet){return Array.prototype.slice.call(nodeSet)},queryElements=function queryElements(settings){return settings.container.querySelectorAll(settings.elements_selector)},getElements=function getElements(elements,settings){return purgeProcessedElements(nodeSetToArray(elements||queryElements(settings)))},LazyLoad=function LazyLoad(customSettings,elements){this._settings=getInstanceSettings(customSettings),this._loadingCount=0,setObserver(this),this.update(elements)};return LazyLoad.prototype={update:function update(elements){var _this=this,settings=this._settings;this._elements=getElements(elements,settings),!isBot&&this._observer?(shouldUseNative(settings)&&(loadAllNative(this),this._elements=getElements(elements,settings)),this._elements.forEach(function(element){_this._observer.observe(element)})):this.loadAll()},destroy:function destroy(){var _this2=this;this._observer&&(this._elements.forEach(function(element){_this2._observer.unobserve(element)}),this._observer=null),this._elements=null,this._settings=null},load:function load(element,force){revealElement(element,this,force)},loadAll:function loadAll(){var _this3=this;this._elements.forEach(function(element){revealAndUnobserve(element,_this3)})}},runningOnBrowser&&autoInitialize(LazyLoad,window.lazyLoadOptions),LazyLoad});;var docCookies={getItem:function(sKey){if(!sKey){return null;}
return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(sKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;},setItem:function(sKey,sValue,vEnd,sPath,sDomain,bSecure){if(!sKey||/^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)){return false;}
var sExpires="";if(vEnd){switch(vEnd.constructor){case Number:sExpires=vEnd===Infinity?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+vEnd;break;case String:sExpires="; expires="+vEnd;break;case Date:sExpires="; expires="+vEnd.toUTCString();break;}}
document.cookie=encodeURIComponent(sKey)+"="+encodeURIComponent(sValue)+sExpires+(sDomain?"; domain="+sDomain:"")+(sPath?"; path="+sPath:"")+(bSecure?"; secure":"");return true;},removeItem:function(sKey,sPath,sDomain){if(!this.hasItem(sKey)){return false;}
document.cookie=encodeURIComponent(sKey)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(sDomain?"; domain="+sDomain:"")+(sPath?"; path="+sPath:"");return true;},hasItem:function(sKey){if(!sKey){return false;}
return(new RegExp("(?:^|;\\s*)"+encodeURIComponent(sKey).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=")).test(document.cookie);},keys:function(){var aKeys=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/);for(var nLen=aKeys.length,nIdx=0;nIdx<nLen;nIdx++){aKeys[nIdx]=decodeURIComponent(aKeys[nIdx]);}
return aKeys;}};;!function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}function e(a){return parseFloat(a)||0}function f(a){for(var b=0;a;)b+=a.offsetTop,a=a.offsetParent;return b}function g(){function c(){a.pageXOffset!=m.left?(m.top=a.pageYOffset,m.left=a.pageXOffset,p.refreshAll()):a.pageYOffset!=m.top&&(m.top=a.pageYOffset,m.left=a.pageXOffset,n.forEach(function(a){return a._recalcPosition()}))}function d(){f=setInterval(function(){n.forEach(function(a){return a._fastCheck()})},500)}function e(){clearInterval(f)}if(!k){k=!0,c(),a.addEventListener("scroll",c),a.addEventListener("resize",p.refreshAll),a.addEventListener("orientationchange",p.refreshAll);var f=void 0,g=void 0,h=void 0;"hidden"in b?(g="hidden",h="visibilitychange"):"webkitHidden"in b&&(g="webkitHidden",h="webkitvisibilitychange"),h?(b[g]||d(),b.addEventListener(h,function(){b[g]?e():d()})):d()}}var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=!1,j="undefined"!=typeof a;j&&a.getComputedStyle?!function(){var a=b.createElement("div");["","-webkit-","-moz-","-ms-"].some(function(b){try{a.style.position=b+"sticky"}catch(a){}return""!=a.style.position})&&(i=!0)}():i=!0;var k=!1,l="undefined"!=typeof ShadowRoot,m={top:null,left:null},n=[],o=function(){function g(a){if(c(this,g),!(a instanceof HTMLElement))throw new Error("First argument must be HTMLElement");if(n.some(function(b){return b._node===a}))throw new Error("Stickyfill is already applied to this node");this._node=a,this._stickyMode=null,this._active=!1,n.push(this),this.refresh()}return h(g,[{key:"refresh",value:function(){if(!i&&!this._removed){this._active&&this._deactivate();var c=this._node,g=getComputedStyle(c),h={position:g.position,top:g.top,display:g.display,marginTop:g.marginTop,marginBottom:g.marginBottom,marginLeft:g.marginLeft,marginRight:g.marginRight,cssFloat:g.cssFloat};if(!isNaN(parseFloat(h.top))&&"table-cell"!=h.display&&"none"!=h.display){this._active=!0;var j=c.style.position;"sticky"!=g.position&&"-webkit-sticky"!=g.position||(c.style.position="static");var k=c.parentNode,m=l&&k instanceof ShadowRoot?k.host:k,n=c.getBoundingClientRect(),o=m.getBoundingClientRect(),p=getComputedStyle(m);this._parent={node:m,styles:{position:m.style.position},offsetHeight:m.offsetHeight},this._offsetToWindow={left:n.left,right:b.documentElement.clientWidth-n.right},this._offsetToParent={top:n.top-o.top-e(p.borderTopWidth),left:n.left-o.left-e(p.borderLeftWidth),right:-n.right+o.right-e(p.borderRightWidth)},this._styles={position:j,top:c.style.top,bottom:c.style.bottom,left:c.style.left,right:c.style.right,width:c.style.width,marginTop:c.style.marginTop,marginLeft:c.style.marginLeft,marginRight:c.style.marginRight};var q=e(h.top);this._limits={start:n.top+a.pageYOffset-q,end:o.top+a.pageYOffset+m.offsetHeight-e(p.borderBottomWidth)-c.offsetHeight-q-e(h.marginBottom)};var r=p.position;"absolute"!=r&&"relative"!=r&&(m.style.position="relative"),this._recalcPosition();var s=this._clone={};s.node=b.createElement("div"),d(s.node.style,{width:n.right-n.left+"px",height:n.bottom-n.top+"px",marginTop:h.marginTop,marginBottom:h.marginBottom,marginLeft:h.marginLeft,marginRight:h.marginRight,cssFloat:h.cssFloat,padding:0,border:0,borderSpacing:0,fontSize:"1em",position:"static"}),k.insertBefore(s.node,c),s.docOffsetTop=f(s.node)}}}},{key:"_recalcPosition",value:function(){if(this._active&&!this._removed){var a=m.top<=this._limits.start?"start":m.top>=this._limits.end?"end":"middle";if(this._stickyMode!=a){switch(a){case"start":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:this._offsetToParent.top+"px",bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"middle":d(this._node.style,{position:"fixed",left:this._offsetToWindow.left+"px",right:this._offsetToWindow.right+"px",top:this._styles.top,bottom:"auto",width:"auto",marginLeft:0,marginRight:0,marginTop:0});break;case"end":d(this._node.style,{position:"absolute",left:this._offsetToParent.left+"px",right:this._offsetToParent.right+"px",top:"auto",bottom:0,width:"auto",marginLeft:0,marginRight:0})}this._stickyMode=a}}}},{key:"_fastCheck",value:function(){this._active&&!this._removed&&(Math.abs(f(this._clone.node)-this._clone.docOffsetTop)>1||Math.abs(this._parent.node.offsetHeight-this._parent.offsetHeight)>1)&&this.refresh()}},{key:"_deactivate",value:function(){var a=this;this._active&&!this._removed&&(this._clone.node.parentNode.removeChild(this._clone.node),delete this._clone,d(this._node.style,this._styles),delete this._styles,n.some(function(b){return b!==a&&b._parent&&b._parent.node===a._parent.node})||d(this._parent.node.style,this._parent.styles),delete this._parent,this._stickyMode=null,this._active=!1,delete this._offsetToWindow,delete this._offsetToParent,delete this._limits)}},{key:"remove",value:function(){var a=this;this._deactivate(),n.some(function(b,c){if(b._node===a._node)return n.splice(c,1),!0}),this._removed=!0}}]),g}(),p={stickies:n,Sticky:o,forceSticky:function(){i=!1,g(),this.refreshAll()},addOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}for(var b=0;b<n.length;b++)if(n[b]._node===a)return n[b];return new o(a)},add:function(a){if(a instanceof HTMLElement&&(a=[a]),a.length){for(var b=[],c=function(c){var d=a[c];return d instanceof HTMLElement?n.some(function(a){if(a._node===d)return b.push(a),!0})?"continue":void b.push(new o(d)):(b.push(void 0),"continue")},d=0;d<a.length;d++){c(d)}return b}},refreshAll:function(){n.forEach(function(a){return a.refresh()})},removeOne:function(a){if(!(a instanceof HTMLElement)){if(!a.length||!a[0])return;a=a[0]}n.some(function(b){if(b._node===a)return b.remove(),!0})},remove:function(a){if(a instanceof HTMLElement&&(a=[a]),a.length)for(var b=function(b){var c=a[b];n.some(function(a){if(a._node===c)return a.remove(),!0})},c=0;c<a.length;c++)b(c)},removeAll:function(){for(;n.length;)n[0].remove()}};i||g(),"undefined"!=typeof module&&module.exports?module.exports=p:j&&(a.Stickyfill=p)}(window,document);