1if(typeof Object.assign!=='function'){Object.defineProperty(Object,"assign",{value:function assign(target,varArgs){'use strict';if(target===null||target===undefined){throw new TypeError('Cannot convert undefined or null to object');} 2var to=Object(target);for(var index=1;index<arguments.length;index++){var nextSource=arguments[index];if(nextSource!==null&&nextSource!==undefined){for(var nextKey in nextSource){if(Object.prototype.hasOwnProperty.call(nextSource,nextKey)){to[nextKey]=nextSource[nextKey];}}}} 3return to;},writable:true,configurable:true});} 4if(typeof NodeList.prototype.forEach!=='function'){NodeList.prototype.forEach=Array.prototype.forEach;} 5var imageDeviceSpecificSource=function(config){var widget={options:{selector:'.image-different-sources',breakpoints:[{maxWidth:480,src:'data-src-mobile'},{maxWidth:992,src:'data-src-tablet'},{maxWidth:999999,src:'data-src-desktop'}]},_defaultSrc:'src',_defaultSrcCopy:'data-src',_window:undefined,_elements:undefined,_windowWidth:0,init:function(config){this.options=Object.assign(this.options,config);this.setElementsSource();this._getWindow().addEventListener('resize',this.setElementsSourceThrottle.bind(this));},_isUndefined:function(value){return typeof value==="undefined"||typeof value===undefined||value==="undefined"||value===undefined||value===null||value==='null';},_getElements:function(){if(this._isUndefined(this._elements)){this._elements=document.querySelectorAll(this.options.selector);} 6return this._elements;},_getWindow:function(){if(this._isUndefined(this._window)){this._window=window;} 7return this._window;},_getBreakpoints:function(){return this.options.breakpoints;},_getElementSourceAttribute:function(element){var windowWidth=this._getWindow().innerWidth,foundBreakpoint=undefined,BreakPointFoundException={};
7try{this._getBreakpoints().forEach(function(breakpoint){var breakpointMatches=windowWidth<=breakpoint.maxWidth;if(this._isUndefined(element)){return breakpointMatches;} 8if(breakpointMatches&&this._hasElementBreakpointSource(element,breakpoint.src)){foundBreakpoint=breakpoint;throw BreakPointFoundException;}}.bind(this));}catch(BreakPointFoundException){return foundBreakpoint.src;} 9if(this._isUndefined(foundBreakpoint)){return this._defaultSrcCopy;}},_copyElementMainSource:function(element){if(!this._isUndefined(element.getAttribute(this._defaultSrcCopy))){return false;} 10element.setAttribute(this._defaultSrcCopy,this._getElementImageSource(element));return true;},_checkElementNeedsSourceChange:function(element){var elementSource=this._getElementImageSource(element),elementBreakpointSource=this._getElementBreakpointSource(element);if(this._isUndefined(elementSource)){return true;} 11return elementSource!==elementBreakpointSource;},_getElementImageSource:function(element){var elementSource=element.getAttribute(this._defaultSrc);if(element.tagName.toLowerCase()==='img'){return elementSource;} 12return element.style.backgroundImage.replace(/(url\(|\)|'|")/gi,'');},_getElementBreakpointSource:function(element){var elementBreakpointSourceAttribute=this._getElementSourceAttribute(element),elementBreakpointSource=element.getAttribute(elementBreakpointSourceAttribute);if(!this._isElementBreakpointSourceAvailable(elementBreakpointSource)){return this._getElementImageSource(element);} 13return elementBreakpointSource;},_isElementBreakpointSourceAvailable:function(source){return!this._isUndefined(source)&&source.length>0;},_hasElementBreakpointSource:function(element,breakpointAttribute){var source=element.getAttribute(breakpointAttribute);return!this._isUndefined(source)&&this._isElementBreakpointSourceAvailable(source);},setElementsSource:function(){this._getElements().forEach(function(element){this.bindDynamicSource(element);}.bind(this));},setElementsSourceThrottle:function(){if(this._windowWidth!==window.outerWidth){this._windowWidth=window.outerWidth;this.setElementsSource();}},bindDynamicSource:function(element){this._copyElementMainSource(element);if(!this._checkElementNeedsSourceChange(element)){return;} 14var elementBreakpointSourceAttribute=this._getElementSourceAttribute(element),elementBreakpointSource=element.getAttribute(elementBreakpointSourceAttribute);if(element.tagName.toLowerCase()==='img'){element.setAttribute(this._defaultSrc,elementBreakpointSource);}else{element.style.backgroundImage='url('+elementBreakpointSource+')';} 15element.classList.add('_changed');}};widget.init(config);};document.addEventListener('DOMContentLoaded',function(){imageDeviceSpecificSource();});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.