!function(){function c(){}function d(a,b){this.path=a,"undefined"!=typeof b&&null!==b?(this.at_2x_path=b,this.perform_check=!1):(this.at_2x_path=a.replace(/\.\w+$/,function(a){return"@2x"+a}),this.perform_check=!0)}function e(a){this.el=a,this.path=new d(this.el.getAttribute("src"),this.el.getAttribute("data-at2x"));var b=this;this.path.check_2x_variant(function(a){a&&b.swap()})}var a="undefined"==typeof exports?window:exports,b={check_mime_type:!0};a.Retina=c,c.configure=function(a){null==a&&(a={});for(var c in a)b[c]=a[c]},c.init=function(b){null==b&&(b=a);var c=b.onload||new Function;b.onload=function(){var d,f,a=document.getElementsByTagName("img"),b=[];for(d=0;d1?!0:a.matchMedia&&a.matchMedia(b).matches?!0:!1},a.RetinaImagePath=d,d.confirmed_paths=[],d.prototype.is_external=function(){return!(!this.path.match(/^https?\:/i)||this.path.match("//"+document.domain))},d.prototype.check_2x_variant=function(a){var c,e=this;return this.is_external()?a(!1):this.perform_check||"undefined"==typeof this.at_2x_path||null===this.at_2x_path?this.at_2x_path in d.confirmed_paths?a(!0):(c=new XMLHttpRequest,c.open("HEAD",this.at_2x_path),c.onreadystatechange=function(){if(4!=c.readyState)return a(!1);if(c.status>=200&&c.status<=399){if(b.check_mime_type){var f=c.getResponseHeader("Content-Type");if(null==f||!f.match(/^image/i))return a(!1)}return d.confirmed_paths.push(e.at_2x_path),a(!0)}return a(!1)},c.send(),void 0):a(!0)},a.RetinaImage=e,e.prototype.swap=function(a){function c(){b.el.complete?(b.el.setAttribute("width",b.el.offsetWidth),b.el.setAttribute("height",b.el.offsetHeight),b.el.setAttribute("src",a)):setTimeout(c,5)}"undefined"==typeof a&&(a=this.path.at_2x_path);var b=this;c()},c.isRetina()&&c.init(a)}();