{"size": 10716, "ext": "js", "max_stars_repo_path": "cloudimage/js/plugin.min.js", "max_stars_repo_name": "lck3000/lck3000.github.io", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "cloudimage/js/plugin.min.js", "max_issues_repo_name": "lck3000/lck3000.github.io", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "cloudimage/js/plugin.min.js", "max_forks_repo_name": "lck3000/lck3000.github.io", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 5358.0, "max_line_length": 10715, "alphanum_fraction": 0.7400149309}
!function(window,document){function getSizeLimit(e){return e<=25?"25":e<=50?"50":e<=100?"100":e<=200?"200":e<=300?"300":e<=400?"400":e<=500?"500":e<=600?"600":e<=700?"700":e<=800?"800":e<=900?"900":e<=1e3?"1000":e<=1100?"1100":e<=1200?"1200":e<=1300?"1300":e<=1400?"1400":e<=1500?"1500":e<=1600?"1600":e<=1700?"1700":e<=1800?"1800":e<=1900?"1900":e<=2400?"2400":e<=2800?"2800":"3600"}function onerrorImg(e){}function getParentContainerWithWidth(e){for(var t=null,i=0;i=(t=t&&t.parentNode||e.parentNode).getBoundingClientRect().width,t&&!i;);return i}function filterImages(e,t){for(var i=[],r=0;r<e.length;r++){var n=e[r];".svg"!==(n.getAttribute(t)||"").slice(-4).toLowerCase()&&i.push(n)}return i}function getPresets(e,t){for(var i=(e=e||"").split("|"),r={presets:{},order:[]},n=0;n<i.length;n++){var s=i[n]&&i[n].split(":"),a=s[0]&&s[0].trim(),c=s[1]&&s[1].trim();a&&c&&(r.presets[a]=c,r.order.unshift(a))}return r[t]}var resizeTimer;Array.prototype.forEach||(Array.prototype.forEach=function(e){var t,i;if(null==this)throw new TypeError("this is null or not defined");var r=Object(this),n=r.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(1<arguments.length&&(t=arguments[1]),i=0;i<n;){var s;i in r&&(s=r[i],e.call(t,s,i,r)),i++}}),[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach(function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}),window.jScaler=window.jScaler||{},jScaler.forceUpdate=!1,jScaler.setForceUpdate=function(e){(jScaler.forceUpdate=e)&&jScaler.process(jScaler.config)},jScaler.setConfig=function(e){e=e||{},jScaler.config={IS_ULTRA_FAST:e.IS_ULTRA_FAST||!1,TOKEN:e.TOKEN||"",CONTAINER:e.CONTAINER||".cloudimg.io",DEFAULT_WIDTH:e.DEFAULT_WIDTH||"400",DEFAULT_HEIGHT:e.DEFAULT_HEIGHT||"300",DEFAULT_TYPE:e.DEFAULT_TYPE||"width",DEFAULT_PARAMS:e.DEFAULT_PARAMS||"none",BASE_URL:e.BASE_URL||"/",RESULT_PRESETS:e.PRESETS?getPresets(e.PRESETS,"presets"):{xs:576,sm:768,md:992,lg:1200,xl:1920},ORDER:e.PRESETS?getPresets(e.PRESETS,"order"):["xl","lg","md","sm","xs"],AUTO:e.AUTO||[1920,1200,992,768,576],QUERY_STRING:e.QUERY_STRING||""}},jScaler.init=function(){this.backgroundImgIndex=0,this.head=document.head||document.getElementsByTagName("head")[0],"trunc"in Math||(Math.trunc=Math.floor)},jScaler.process=function(e){this.setConfig(e);var t=filterImages(document.querySelectorAll("img[ci-src]"),"ci-src"),i=filterImages(document.querySelectorAll("[ci-background]"),"ci-background");0<t.length&&(t=Array.prototype.slice.call(t),[].forEach.call(t,function(e){this.attr(e,"src")?this.processImage(e,!0):this.processImage(e)},this)),0<i.length&&(i=Array.prototype.slice.call(i),[].forEach.call(i,function(e){0<=this.attr(e,"ci-img-index")&&this.processBackgroundImage(e)},this))},jScaler.getParentWidth=function(e){if(!(e&&e.parentElement&&e.parentElement.getBoundingClientRect||e&&e.width))return jScaler.config.DEFAULT_WIDTH;var t=getParentContainerWithWidth(e),i=parseInt(t,10),r=Number(window.getComputedStyle(e).width);return r&&r<i&&15<r||!i?getSizeLimit(r):i?getSizeLimit(i):e.width||jScaler.config.DEFAULT_WIDTH},jScaler.getElementSize=function(e,t){return e&&e.getBoundingClientRect?getSizeLimit(parseInt(e.getBoundingClientRect()[t],10)):null},jScaler.checkOnMedia=function(size){try{var object=eval("("+size+")");return object&&"object"==typeof object}catch(e){return!1}},jScaler.processImage=function(img,isUpdate){var sourceUrl="ci-src",imgTypeFromAttr=this.attr(img,"ci-type")||this.attr(img,"ci-operation")||this.attr(img,"ci-o"),imgType=imgTypeFromAttr||this.config.DEFAULT_TYPE||"",imgSizeFromAttr=this.attr(img,"ci-size")||this.attr(img,"ci-s"),imgSize=imgSizeFromAttr||this.getParentWidth(img)||"",imgParamsFromAttr=this.attr(img,"ci-params")||this.attr(img,"ci-filter")||this.attr(img,"ci-f"),imgParams=imgParamsFromAttr||this.config.DEFAULT_PARAMS||"",isLocalUrl=this.isLocalURL(img,sourceUrl),isResponsive=this.checkOnMedia(imgSize),imgSrc=this.getImgSrc(img,sourceUrl,isLocalUrl),cloudimageUrl,oldSize=img.getAttribute("data-old-ci-size");if(!imgTypeFromAttr&&!imgSizeFromAttr){if(!this.forceUpdate&&oldSize&&isUpdate&&imgSize&&parseInt(imgSize)<=parseInt(oldSize))return;img.setAttribute("data-old-ci-size",imgSize)}if(isResponsive?(imgSize=eval("("+imgSize+")"),cloudimageUrl=this.generateUrl("width",this.updateSizeWithPixelRatio(imgSize),imgParams,imgSrc)):cloudimageUrl=this.generateUrl(imgType,this.updateSizeWithPixelRatio(imgSize),imgParams,imgSrc),isUpdate){var wrapper=img.parentNode.parentNode,sources=wrapper.querySelectorAll("source");[].forEach.call(sources,function(e){e.remove()}),img.setAttribute("src",cloudimageUrl),this.addSources(img,imgType,imgSize,imgParams,imgSrc,isResponsive)}else this.wrap(img),img.setAttribute("src",cloudimageUrl),this.addSources(img,imgType,imgSize,imgParams,imgSrc,isResponsive)},jScaler.updateSizeWithPixelRatio=function(e){var t=e.toString().split("x"),i=[];return[].forEach.call(t,function(e){i.push(e*Math.round(window.devicePixelRatio||1))}),i.join("x")},jScaler.processBackgroundImage=function(e){var t=this.attr(e,"ci-type")||this.attr(e,"ci-operation")||this.attr(e,"ci-o")||this.config.DEFAULT_TYPE||"",i=this.attr(e,"ci-size")||this.attr(e,"ci-s")||this.setSizeFromElemProperty(e,t)||this.getDefaultSize(t),r=this.checkOnMedia(i),n=this.attr(e,"ci-params")||this.attr(e,"ci-filter")||this.attr(e,"ci-f")||this.config.DEFAULT_PARAMS||"",s=this.getBackgroundImgUrl(e,"ci-background"),a=e.getAttribute("ci-img-index"),c=null,o=e.getAttribute("data-old-ci-size");!this.forceUpdate&&o&&i&&parseInt(i)<=parseInt(o)||(e.setAttribute("data-old-ci-size",i),0<=a&&null!==a?c=a:(c=this.backgroundImgIndex.toString(),e.setAttribute("ci-img-index",c),this.backgroundImgIndex++),this.addCss(e,t,i,n,s,r,c))},jScaler.generateUrl=function(e,t,i,r){return(this.config.IS_ULTRA_FAST?"https://scaleflex.ultrafast.io/":"https://")+this.config.TOKEN+this.config.CONTAINER+"/"+e+"/"+t+"/"+i+"/"+r+this.config.QUERY_STRING},jScaler.addSources=function(e,t,i,r,n,s){if(s){var a=[];for(c=0;c<this.config.ORDER.length;c++){i[this.config.ORDER[c]]&&a.unshift(this.config.ORDER[c])}for(var c=0;c<a.length;c++){var o=!(c<a.length-1),l=o?a[c-1]:a[c],g=i[a[c]],m=this.generateSrcset(t,g,r,n),h="("+(o?"min":"max")+"-width: "+(this.config.RESULT_PRESETS[l]+(o?1:0))+"px)";this.before(e,'<source media="'+h+'" srcset="'+m+'">')}}else this.before(e,'<source srcset="'+this.generateSrcset(t,i,r,n)+'">')},jScaler.getImgSrc=function(e,t,i){var r=this.attr(e,t);return i&&(e.setAttribute("ci-local-url",r),r=this.config.BASE_URL+r),r},jScaler.getBackgroundImgUrl=function(e,t){var i,r=this.attr(e,t)||"";return r||this.setUrlFromElemProperty(e,t),i=this.isLocalURL(e,t),r=this.getImgSrc(e,t,i)},jScaler.generateImgSrc=function(e,t,i,r,n,s){var a=Math.trunc(r*s);return n&&(a+="x"+Math.trunc(n*s)),this.generateUrl(e,this.updateSizeWithPixelRatio(a),t,i).replace("http://scaleflex.ultrafast.io/","").replace("https://scaleflex.ultrafast.io/","").replace("//scaleflex.ultrafast.io/","").replace("///","/")},jScaler.generateSrcset=function(e,t,i,r){var n=t.toString().split("x")[0],s=t.toString().split("x")[1];return this.generateImgSrc(e,i,r,n,s,1)},jScaler.generateMediaQueries=function(e,t,i,r,n,s,a,c,o){var l=this.attr(e,"ci-selector-suffix")||"",g='[ci-img-index="'+this.attr(e,"ci-img-index")+'"]'+l,m=this.attr(e,"ci-important")?" !important":"",h=i.toString().split("x")[0],d=i.toString().split("x")[1],u=s?"} ":"";return(s?"@media ("+(c?"min":"max")+"-width: "+(c?o:a)+"px) {":"")+g+" { background-image: url("+this.generateImgSrc(t,r,n,h,d,1)+")"+m+"; } "+u},jScaler.getDefaultSize=function(e){var t="";switch(e){case"width":t=this.config.DEFAULT_WIDTH;break;case"height":t=this.config.DEFAULT_HEIGHT;break;case"crop":case"fit":case"cover":case"bound":default:t=this.config.DEFAULT_WIDTH+"x"+this.config.DEFAULT_HEIGHT}return t},jScaler.setUrlFromElemProperty=function(e,t){e.setAttribute(t,window.getComputedStyle(e).backgroundImage.slice(5,-2))},jScaler.setSizeFromElemProperty=function(e,t){var i=Number(window.getComputedStyle(e).width),r=Number(window.getComputedStyle(e).height);return i||(i=this.getParentWidth(e)),"width"===t?this.getElementSize(e,"width"):"width"===t?this.getElementSize(e,"height"):i&&r?i+"x"+r:void 0},jScaler.addCss=function(elem,imgType,imgSize,imgParams,imgSrc,isResponsive,nextIndex){var i,size,mediaQuery;if(isResponsive){var cssQueries="",imgSizeFromAttr=this.attr(elem,"ci-size")||this.attr(elem,"ci-s")||null;if("full_screen"===imgSize||""===imgSize||null===imgSizeFromAttr)for(i=0;i<this.config.AUTO.length;i++)imgSize=this.config.AUTO[i],cssQueries+=this.generateMediaQueries(elem,"width",imgSize,imgParams,imgSrc,isResponsive,imgSize);else if(this.checkOnMedia(imgSize)){imgSize=eval("("+imgSize+")");var orderFiltered=[];for(i=0;i<this.config.ORDER.length;i++)size=imgSize[this.config.ORDER[i]],size&&orderFiltered.push(this.config.ORDER[i]);for(i=0;i<orderFiltered.length;i++){var isFirst=0===i,prevSize=isFirst&&orderFiltered[i+1],prevMediaQuery=isFirst&&this.config.RESULT_PRESETS[prevSize];size=imgSize[orderFiltered[i]],mediaQuery=this.config.RESULT_PRESETS[this.config.ORDER[i]],cssQueries+=this.generateMediaQueries(elem,imgType,size,imgParams,imgSrc,isResponsive,mediaQuery,isFirst,prevMediaQuery)}}this.addStyles(cssQueries,nextIndex)}else this.addStyles(this.generateMediaQueries(elem,imgType,imgSize,imgParams,imgSrc,isResponsive),nextIndex)},jScaler.addStyles=function(e,t){var i=document.querySelector(".ci-img-index_"+t);i||((i=document.createElement("style")).classList.add("ci-img-index_"+t),i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),this.head.appendChild(i)),i.innerHTML=e},jScaler.isLocalURL=function(e,t){var i=this.attr(e,t)||"";return 0===i.indexOf("//")&&(i=window.location.protocol+i,e.setAttribute(t,i)),0!==i.indexOf("http://")&&0!==i.indexOf("https://")&&0!==i.indexOf("//")},jScaler.wrap=function(e,t){return t=t||document.createElement("picture"),e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t.appendChild(e)},jScaler.before=function(e,t){var i,r=document.createElement("template");"content"in r?(r.innerHTML=t,e.parentNode.insertBefore(r.content.firstChild,e)):((i=document.createElement("div")).innerHTML=t,e.parentNode.insertBefore(i.firstChild,e))},jScaler.attr=function(e,t){return e.getAttribute(t)},jScaler.init(),window.addEventListener("resize",function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(function(){jScaler.process(jScaler.config)},350)})}(window,document);
