!function(r){function e(e,n){function i(e){var t="";o.variables&&r.each(o.variables,function(r,e){t+=("@"===r.slice(0,1)?"":"@")+r+": "+(";"===e.slice(-1)?e:e+";")}),t?(new less.Parser).parse(t,function(r,t){if(r)return u.reject(r);var n=e.rules;e.rules=e.rules.concat(t.rules),l(e),e.rules=n}):l(e)}function l(r){try{u.resolve(r.toCSS(o))}catch(e){o.id&&a[o.id]&&delete a[o.id],u.reject(e)}}var u=r.Deferred(),o=n||{};return(o.imports?t(e):r.Deferred().resolve(e)).done(function(r){o.id&&a[o.id]?i(a[o.id]):(new less.Parser).parse(r,function(r,e){return r?u.reject(r):(o.id&&(a[o.id]=e),void i(e))})}),u.promise()}function t(e){function t(e){var t=[],n=null;return r.each(e,function(r,e){t.push(n=n?n.then(e):e.call())}),r.when.apply(r,t)}function n(r,e){return r=r.replace(/@import\s['"]?(.+?)['"]?\s*;/g,function(r,e){return-1!=r.indexOf("url(")?r:'@import url("'+e+'");'}),r.replace(c,function(r,t){return r.match(/data\:image\//)?r:r.replace(t,u(t,e).url)})}var i=r.Deferred(),l={},a=u(window.location.href).host,o=/@import\s+url\s*\(['"]?(.+?)['"]?\)\s*;/g,c=/url\s*\(['"]?(.+?)['"]?\)/g;return function s(e){var c=[];return e=e.replace(/@import\s['"]?(.+?)['"]?\s*;/g,function(r,e){return-1!=r.indexOf("url(")?r:'@import url("'+e+'");'}),e.replace(o,function(e,t){return l[t]||a!=u(t).host||c.push(function(){return r.ajax({url:t,cache:!1}).done(function(r){l[t]=n(r.replace(/^((?!:).)?\/\/.*/g,""),t)}).fail(function(r,e,n){l[t]="/* Can't resolve import '"+t+"' ("+e+", "+n+") */"})}),e}),t(c).always(function(){e=e.replace(o,function(r,e){return l[e]?l[e]:r}),c.length?e=s(e):i.resolve(e)}),e}(n(e.replace(/^((?!:).)?\/\/.*/g,""))),i.promise()}function n(e){var t,n={},i=e.split("\n");for(t=0,max=i.length;t<max;t++){var l=r.trim(i[t]);if(l.length&&/@[\w\-]+\s*:.[^;]*;/.test(l)){var u=r.trim(l.replace(";","").replace(/\s+/,"")).split(":");u[1]=r.trim(u[1].replace(";","").split("//")[0]),n[u[0]]=u[1]}}return n}function i(r,e){return r.replace(/url\s*\(['"]?(.+?)['"]?\)/g,function(r,t){return t.match(/^(http|\/\/)/)||r.match(/data\:image\//)?r:r.replace(t,l(u(t,e).url,e))})}function l(r,e){var t,n,i,l,a=u(r),o=u(e),c="";if(a.host!==o.host)return"";for(i=Math.max(o.dirs.length,a.dirs.length),l=0;i>l&&o.dirs[l]===a.dirs[l];l++);for(t=a.dirs.slice(l),n=o.dirs.slice(l),l=0;l<n.length-1;l++)c+="../";for(l=0;l<t.length-1;l++)c+=t[l]+"/";return c+a.file+a.query}function u(r,e){var t,n,i=/^((?:[a-z-]+:)?\/\/(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/,l=r.match(i),u={},a=[];if(!l)throw new Exception("Could not parse url - '"+r+"'");if(!l[1]||l[2]){if(e||(e=window.location.href),t=e.match(i),!t)throw new Exception("Could not parse url - '"+e+"'");l[1]=t[1],l[2]||(l[3]=t[3]+l[3])}if(l[3])for(a=l[3].replace("\\","/").split("/"),n=0;n<a.length;n++)".."===a[n]&&n>0&&(a.splice(n-1,2),n-=2);return u.host=l[1],u.path=l[1]+a.join("/"),u.file=l[4]||"",u.query=l[5]||"",u.url=u.path+u.file+u.query,u.dirs=a,u}var a={};r.less=r.less||function(){return{getCSS:e,getVars:n,resolveImports:t,rewriteUrls:i,pathDiff:l,extractUrlParts:u}}()}(jQuery);