// // LESS - Leaner CSS v1.3.0 // http://lesscss.org // // Copyright (c) 2009-2011, Alexis Sellier // Licensed under the Apache 2.0 License. // (function(a,b){function u(a,b){var c="less-error-message:"+o(b),e='
  • {content}
  • ',f=document.createElement("div"),g,h,i=[],j=a.filename||b,k=j.match(/([^\/]+)$/)[1];f.id=c,f.className="less-error-message",h="

    "+(a.message||"There is an error in your .less file")+"

    "+'

    in '+k+" ";var l=function(a,b,c){a.extract[b]&&i.push(e.replace(/\{line\}/,parseInt(a.line)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.stack?h+="
    "+a.stack.split("\n").slice(1).join("
    "):a.extract&&(l(a,0,""),l(a,1,"line"),l(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":

    "+""),f.innerHTML=h,p([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),f.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env=="development"&&(g=setInterval(function(){document.body&&(document.getElementById(c)?document.body.replaceChild(f,document.getElementById(c)):document.body.insertBefore(f,document.body.firstChild),clearInterval(g))},10))}function t(a){d.env=="development"&&typeof console!="undefined"&&console.log("less: "+a)}function s(a){return a&&a.parentNode.removeChild(a)}function r(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){t("browser doesn't support AJAX.");return null}}function q(a,b,c,e){function i(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):typeof d=="function"&&d(b.status,a)}var g=r(),h=f?!1:d.async;typeof g.overrideMimeType=="function"&&g.overrideMimeType("text/css"),g.open("GET",a,h),g.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),g.send(null),f?g.status===0||g.status>=200&&g.status<300?c(g.responseText):e(g.status,a):h?g.onreadystatechange=function(){g.readyState==4&&i(g,c,e)}:i(g,c,e)}function p(a,b,c){var d,e=b.href?b.href.replace(/\?.*$/,""):"",f="less:"+(b.title||o(e));if((d=document.getElementById(f))===null){d=document.createElement("style"),d.type="text/css",b.media&&(d.media=b.media),d.id=f;var h=b&&b.nextSibling||null;document.getElementsByTagName("head")[0].insertBefore(d,h)}if(d.styleSheet)try{d.styleSheet.cssText=a}catch(i){throw new Error("Couldn't reassign styleSheet.cssText.")}else(function(a){d.childNodes.length>0?d.firstChild.nodeValue!==a.nodeValue&&d.replaceChild(a,d.firstChild):d.appendChild(a)})(document.createTextNode(a));if(c&&g){t("saving "+e+" to cache.");try{g.setItem(e,a),g.setItem(e+":timestamp",c)}catch(i){t("failed to save")}}}function o(a){return a.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function n(b,c,e,f){var h=b.contents||{},i=a.location.href.replace(/[#?].*$/,""),j=b.href.replace(/\?.*$/,""),k=g&&g.getItem(j),l=g&&g.getItem(j+":timestamp"),m={css:k,timestamp:l};/^[a-z-]+:/.test(j)||(j.charAt(0)=="/"?j=a.location.protocol+"//"+a.location.host+j:j=i.slice(0,i.lastIndexOf("/")+1)+j),q(b.href,b.type,function(a,g){if(!e&&m&&g&&(new Date(g)).valueOf()===(new Date(m.timestamp)).valueOf())p(m.css,b),c(null,null,a,b,{local:!0,remaining:f});else try{h[j]=a,(new d.Parser({optimization:d.optimization,paths:[j.replace(/[\w\.-]+$/,"")],mime:b.type,filename:j,contents:h})).parse(a,function(d,e){if(d)return u(d,j);try{c(d,e,a,b,{local:!1,lastModified:g,remaining:f}),s(document.getElementById("less-error-message:"+o(j)))}catch(d){u(d,j)}})}catch(i){u(i,j)}},function(a,b){throw new Error("Couldn't load "+b+" ("+a+")")})}function m(a,b){for(var c=0;c>>0;for(var d=0;d>>0,c=Array(b),d=arguments[1];for(var e=0;e>>0,c=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var d=arguments[1];else for(;;){if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}for(;c=b)return-1;c<0&&(c+=b);for(;c=0&&b.charAt(c)!=="\n";c--)d++;return{line:typeof a=="number"?(b.slice(0,a).match(/\n/g)||"").length:null,column:d}}function A(a,b){return a.filename&&b.filename&&a.filename!==b.filename?n.imports.contents[a.filename]:f}function z(a){return typeof a=="string"?f.charAt(g)===a:a.test(l[h])?!0:!1}function y(a,b){throw{index:g,type:b||"Syntax",message:a}}function x(a,b){var c=v(a);if(!c)y(b||(typeof a=="string"?"expected '"+a+"' got '"+f.charAt(g)+"'":"unexpected token"));else return c}function w(a){var b=g,c=h,d=g+l[h].length,e=g+=a;while(gm&&(l[h]=l[h].slice(g-m),m=g)}function s(){l[h]=i,g=j,m=g}function r(){i=l[h],j=g,m=g}var f,g,h,i,j,k,l,m,n,o=this,b=b||{};b.contents||(b.contents={});var p=function(){},q=this.imports={paths:b&&b.paths||[],queue:[],files:{},contents:b.contents,mime:b&&b.mime,error:null,push:function(a,c){var e=this;this.queue.push(a),d.Parser.importer(a,this.paths,function(b,d){e.queue.splice(e.queue.indexOf(a),1);var f=a in e.files;e.files[a]=d,b&&!e.error&&(e.error=b),c(b,d,f),e.queue.length===0&&p(b)},b)}};this.env=b=b||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null;return n={imports:q,parse:function(a,i){var j,o,q,r,s,t,u=[],w,x=null;g=h=m=k=0,f=a.replace(/\r\n/g,"\n"),f=f.replace(/^\uFEFF/,""),l=function(a){var c=0,d=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,e=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,g=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,h=0,i,j=a[0],k;for(var l=0,m,n;l0&&(x=new C({index:l,type:"Parse",message:"missing closing `}`",filename:b.filename},b));return a.map(function(a){return a.join("")})}([[]]);if(x)return i(x);try{j=new e.Ruleset([],v(this.parsers.primary)),j.root=!0}catch(y){return i(new C(y,b))}j.toCSS=function(a){var f,g,h;return function(f,g){var h=[],i;f=f||{},typeof g=="object"&&!Array.isArray(g)&&(g=Object.keys(g).map(function(a){var b=g[a];b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b]));return new e.Rule("@"+a,b,!1,0)}),h=[new e.Ruleset(null,g)]);try{var j=a.call(this,{frames:h}).toCSS([],{compress:f.compress||!1})}catch(k){throw new C(k,b)}if(i=n.imports.error)throw i instanceof C?i:new C(i,b);return f.yuicompress&&d.mode==="node"?c("./cssmin").compressor.cssmin(j):f.compress?j.replace(/(\s)+/g,"$1"):j}}(j.eval);if(g=0&&f.charAt(z)!=="\n";z--)A++;x={type:"Parse",message:"Syntax Error on line "+s,index:g,filename:b.filename,line:s,column:A,extract:[t[s-2],t[s-1],t[s]]}}this.imports.queue.length>0?p=function(a){a?i(a):i(null,j)}:i(x,j)},parsers:{primary:function(){var a,b=[];while((a=v(this.mixin.definition)||v(this.rule)||v(this.ruleset)||v(this.mixin.call)||v(this.comment)||v(this.directive))||v(/^[\s\n]+/))a&&b.push(a);return b},comment:function(){var a;if(f.charAt(g)==="/"){if(f.charAt(g+1)==="/")return new e.Comment(v(/^\/\/.*/),!0);if(a=v(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new e.Comment(a)}},entities:{quoted:function(){var a,b=g,c;f.charAt(b)==="~"&&(b++,c=!0);if(f.charAt(b)==='"'||f.charAt(b)==="'"){c&&v("~");if(a=v(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new e.Quoted(a[0],a[1]||a[2],c)}},keyword:function(){var a;if(a=v(/^[_A-Za-z-][_A-Za-z0-9-]*/))return e.colors.hasOwnProperty(a)?new e.Color(e.colors[a].slice(1)):new e.Keyword(a)},call:function(){var a,c,d,f,i=g;if(!!(a=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(l[h]))){a=a[1],c=a.toLowerCase();if(c==="url")return null;g+=a.length;if(c==="alpha"){f=v(this.alpha);if(typeof f!="undefined")return f}v("("),d=v(this.entities.arguments);if(!v(")"))return;if(a)return new e.Call(a,d,i,b.filename)}},arguments:function(){var a=[],b;while(b=v(this.entities.assignment)||v(this.expression)){a.push(b);if(!v(","))break}return a},literal:function(){return v(this.entities.ratio)||v(this.entities.dimension)||v(this.entities.color)||v(this.entities.quoted)},assignment:function(){var a,b;if((a=v(/^\w+(?=\s?=)/i))&&v("=")&&(b=v(this.entity)))return new e.Assignment(a,b)},url:function(){var a;if(f.charAt(g)==="u"&&!!v(/^url\(/)){a=v(this.entities.quoted)||v(this.entities.variable)||v(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",x(")");return new e.URL(a.value!=null||a instanceof e.Variable?a:new e.Anonymous(a),q.paths)}},variable:function(){var a,c=g;if(f.charAt(g)==="@"&&(a=v(/^@@?[\w-]+/)))return new e.Variable(a,c,b.filename)},variableCurly:function(){var a,c,d=g;if(f.charAt(g)==="@"&&(c=v(/^@\{([\w-]+)\}/)))return new e.Variable("@"+c[1],d,b.filename)},color:function(){var a;if(f.charAt(g)==="#"&&(a=v(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/)))return new e.Color(a[1])},dimension:function(){var a,b=f.charCodeAt(g);if(!(b>57||b<45||b===47))if(a=v(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn|dpi|dpcm|dppx|rem|vw|vh|vmin|vm|ch)?/))return new e.Dimension(a[1],a[2])},ratio:function(){var a,b=f.charCodeAt(g);if(!(b>57||b<48))if(a=v(/^(\d+\/\d+)/))return new e.Ratio(a[1])},javascript:function(){var a,b=g,c;f.charAt(b)==="~"&&(b++,c=!0);if(f.charAt(b)==="`"){c&&v("~");if(a=v(/^`([^`]*)`/))return new e.JavaScript(a[1],g,c)}}},variable:function(){var a;if(f.charAt(g)==="@"&&(a=v(/^(@[\w-]+)\s*:/)))return a[1]},shorthand:function(){var a,b;if(!!z(/^[@\w.%-]+\/[@\w.-]+/)){r();if((a=v(this.entity))&&v("/")&&(b=v(this.entity)))return new e.Shorthand(a,b);s()}},mixin:{call:function(){var a=[],c,d,h=[],i,j=g,k=f.charAt(g),l,m,n=!1;if(k==="."||k==="#"){r();while(c=v(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/))a.push(new e.Element(d,c,g)),d=v(">");if(v("(")){while(i=v(this.expression)){m=i,l=null;if(i.value.length==1){var o=i.value[0];if(o instanceof e.Variable&&v(":"))if(m=v(this.expression))l=o.name;else throw new Error("Expected value")}h.push({name:l,value:m});if(!v(","))break}if(!v(")"))throw new Error("Expected )")}v(this.important)&&(n=!0);if(a.length>0&&(v(";")||z("}")))return new e.mixin.Call(a,h,j,b.filename,n);s()}},definition:function(){var a,b=[],c,d,h,i,j,l=!1;if(!(f.charAt(g)!=="."&&f.charAt(g)!=="#"||z(/^[^{]*(;|})/))){r();if(c=v(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=c[1];do{if(f.charAt(g)==="."&&v(/^\.{3}/)){l=!0;break}if(!(h=v(this.entities.variable)||v(this.entities.literal)||v(this.entities.keyword)))break;if(h instanceof e.Variable)if(v(":"))i=x(this.expression,"expected expression"),b.push({name:h.name,value:i});else{if(v(/^\.{3}/)){b.push({name:h.name,variadic:!0}),l=!0;break}b.push({name:h.name})}else b.push({value:h})}while(v(","));v(")")||(k=g,s()),v(/^when/)&&(j=x(this.conditions,"expected condition")),d=v(this.block);if(d)return new e.mixin.Definition(a,b,d,j,l);s()}}}},entity:function(){return v(this.entities.literal)||v(this.entities.variable)||v(this.entities.url)||v(this.entities.call)||v(this.entities.keyword)||v(this.entities.javascript)||v(this.comment)},end:function(){return v(";")||z("}")},alpha:function(){var a;if(!!v(/^\(opacity=/i))if(a=v(/^\d+/)||v(this.entities.variable)){x(")");return new e.Alpha(a)}},element:function(){var a,b,c,d;c=v(this.combinator),a=v(/^(?:\d+\.\d+|\d+)%/)||v(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||v("*")||v("&")||v(this.attribute)||v(/^\([^)@]+\)/)||v(/^[\.#](?=@)/)||v(this.entities.variableCurly),a||v("(")&&(d=v(this.entities.variableCurly)||v(this.entities.variable))&&v(")")&&(a=new e.Paren(d));if(a)return new e.Element(c,a,g)},combinator:function(){var a,b=f.charAt(g);if(b===">"||b==="+"||b==="~"){g++;while(f.charAt(g).match(/\s/))g++;return new e.Combinator(b)}return f.charAt(g-1).match(/\s/)?new e.Combinator(" "):new e.Combinator(null)},selector:function(){var a,b,c=[],d,h;if(v("(")){a=v(this.entity),x(")");return new e.Selector([new e.Element("",a,g)])}while(b=v(this.element)){d=f.charAt(g),c.push(b);if(d==="{"||d==="}"||d===";"||d===",")break}if(c.length>0)return new e.Selector(c)},tag:function(){return v(/^[A-Za-z][A-Za-z-]*[0-9]?/)||v("*")},attribute:function(){var a="",b,c,d;if(!!v("[")){if(b=v(/^[_A-Za-z0-9-]+/)||v(this.entities.quoted))(d=v(/^[|~*$^]?=/))&&(c=v(this.entities.quoted)||v(/^[\w-]+/))?a=[b,d,c.toCSS?c.toCSS():c].join(""):a=b;if(!v("]"))return;if(a)return"["+a+"]"}},block:function(){var a;if(v("{")&&(a=v(this.primary))&&v("}"))return a},ruleset:function(){var a=[],c,d,f;r();while(c=v(this.selector)){a.push(c),v(this.comment);if(!v(","))break;v(this.comment)}if(a.length>0&&(d=v(this.block)))return new e.Ruleset(a,d,b.strictImports);k=g,s()},rule:function(){var a,b,c=f.charAt(g),d,i;r();if(c!=="."&&c!=="#"&&c!=="&")if(a=v(this.variable)||v(this.property)){a.charAt(0)!="@"&&(i=/^([^@+\/'"*`(;{}-]*);/.exec(l[h]))?(g+=i[0].length-1,b=new e.Anonymous(i[1])):a==="font"?b=v(this.font):b=v(this.value),d=v(this.important);if(b&&v(this.end))return new e.Rule(a,b,d,j);k=g,s()}},"import":function(){var a,b,c=g;r();var d=v(/^@import(?:-(once))?\s+/);if(d&&(a=v(this.entities.quoted)||v(this.entities.url))){b=v(this.mediaFeatures);if(v(";"))return new e.Import(a,q,b,d[1]==="once",c)}s()},mediaFeature:function(){var a,b,c=[];do if(a=v(this.entities.keyword))c.push(a);else if(v("(")){b=v(this.property),a=v(this.entity);if(!v(")"))return null;if(b&&a)c.push(new e.Paren(new e.Rule(b,a,null,g,!0)));else if(a)c.push(new e.Paren(a));else return null}while(a);if(c.length>0)return new e.Expression(c)},mediaFeatures:function(){var a,b=[];do if(a=v(this.mediaFeature)){b.push(a);if(!v(","))break}else if(a=v(this.entities.variable)){b.push(a);if(!v(","))break}while(a);return b.length>0?b:null},media:function(){var a,b;if(v(/^@media/)){a=v(this.mediaFeatures);if(b=v(this.block))return new e.Media(b,a)}},directive:function(){var a,b,c,d,h,i,j,k,l;if(f.charAt(g)==="@"){if(b=v(this["import"])||v(this.media))return b;r(),a=v(/^@[a-z-]+/),j=a,a.charAt(1)=="-"&&a.indexOf("-",2)>0&&(j="@"+a.slice(a.indexOf("-",2)+1));switch(j){case"@font-face":k=!0;break;case"@viewport":case"@top-left":case"@top-left-corner":case"@top-center":case"@top-right":case"@top-right-corner":case"@bottom-left":case"@bottom-left-corner":case"@bottom-center":case"@bottom-right":case"@bottom-right-corner":case"@left-top":case"@left-middle":case"@left-bottom":case"@right-top":case"@right-middle":case"@right-bottom":k=!0;break;case"@page":case"@document":case"@supports":case"@keyframes":k=!0,l=!0}l&&(a+=" "+(v(/^[^{]+/)||"").trim());if(k){if(c=v(this.block))return new e.Directive(a,c)}else if((b=v(this.entity))&&v(";"))return new e.Directive(a,b);s()}},font:function(){var a=[],b=[],c,d,f,g;while(g=v(this.shorthand)||v(this.entity))b.push(g);a.push(new e.Expression(b));if(v(","))while(g=v(this.expression)){a.push(g);if(!v(","))break}return new e.Value(a)},value:function(){var a,b=[],c;while(a=v(this.expression)){b.push(a);if(!v(","))break}if(b.length>0)return new e.Value(b)},important:function(){if(f.charAt(g)==="!")return v(/^! *important/)},sub:function(){var a;if(v("(")&&(a=v(this.expression))&&v(")"))return a},multiplication:function(){var a,b,c,d;if(a=v(this.operand)){while(!z(/^\/\*/)&&(c=v("/")||v("*"))&&(b=v(this.operand)))d=new e.Operation(c,[d||a,b]);return d||a}},addition:function(){var a,b,c,d;if(a=v(this.multiplication)){while((c=v(/^[-+]\s+/)||!u(f.charAt(g-1))&&(v("+")||v("-")))&&(b=v(this.multiplication)))d=new e.Operation(c,[d||a,b]);return d||a}},conditions:function(){var a,b,c=g,d;if(a=v(this.condition)){while(v(",")&&(b=v(this.condition)))d=new e.Condition("or",d||a,b,c);return d||a}},condition:function(){var a,b,c,d,f=g,h=!1;v(/^not/)&&(h=!0),x("(");if(a=v(this.addition)||v(this.entities.keyword)||v(this.entities.quoted)){(d=v(/^(?:>=|=<|[<=>])/))?(b=v(this.addition)||v(this.entities.keyword)||v(this.entities.quoted))?c=new e.Condition(d,a,b,f,h):y("expected expression"):c=new e.Condition("=",a,new e.Keyword("true"),f,h),x(")");return v(/^and/)?new e.Condition("and",c,v(this.condition)):c}},operand:function(){var a,b=f.charAt(g+1);f.charAt(g)==="-"&&(b==="@"||b==="(")&&(a=v("-"));var c=v(this.sub)||v(this.entities.dimension)||v(this.entities.color)||v(this.entities.variable)||v(this.entities.call);return a?new e.Operation("*",[new e.Dimension(-1),c]):c},expression:function(){var a,b,c=[],d;while(a=v(this.addition)||v(this.entity))c.push(a);if(c.length>0)return new e.Expression(c)},property:function(){var a;if(a=v(/^(\*?-?[_a-z0-9-]+)\s*:/))return a[1]}}}};if(d.mode==="browser"||d.mode==="rhino")d.Parser.importer=function(a,b,c,d){!/^([a-z-]+:)?\//.test(a)&&b.length>0&&(a=b[0]+a),n({href:a,title:a,type:d.mime,contents:d.contents},function(e){e&&typeof d.errback=="function"?d.errback.call(null,a,b,c,d):c.apply(null,arguments)},!0)};(function(a){function d(a){return Math.min(1,Math.max(0,a))}function c(b){if(b instanceof a.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);if(typeof b=="number")return b;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function b(b){return a.functions.hsla(b.h,b.s,b.l,b.a)}a.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(b,d,e,f){var g=[b,d,e].map(function(a){return c(a)}),f=c(f);return new a.Color(g,f)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,d,e){function h(a){a=a<0?a+1:a>1?a-1:a;return a*6<1?g+(f-g)*a*6:a*2<1?f:a*3<2?g+(f-g)*(2/3-a)*6:g}a=c(a)%360/360,b=c(b),d=c(d),e=c(e);var f=d<=.5?d*(b+1):d+b-d*b,g=d*2-f;return this.rgba(h(a+1/3)*255,h(a)*255,h(a-1/3)*255,e)},hue:function(b){return new a.Dimension(Math.round(b.toHSL().h))},saturation:function(b){return new a.Dimension(Math.round(b.toHSL().s*100),"%")},lightness:function(b){return new a.Dimension(Math.round(b.toHSL().l*100),"%")},red:function(b){return new a.Dimension(b.rgb[0])},green:function(b){return new a.Dimension(b.rgb[1])},blue:function(b){return new a.Dimension(b.rgb[2])},alpha:function(b){return new a.Dimension(b.toHSL().a)},luma:function(b){return new a.Dimension(Math.round((.2126*(b.rgb[0]/255)+.7152*(b.rgb[1]/255)+.0722*(b.rgb[2]/255))*b.alpha*100),"%")},saturate:function(a,c){var e=a.toHSL();e.s+=c.value/100,e.s=d(e.s);return b(e)},desaturate:function(a,c){var e=a.toHSL();e.s-=c.value/100,e.s=d(e.s);return b(e)},lighten:function(a,c){var e=a.toHSL();e.l+=c.value/100,e.l=d(e.l);return b(e)},darken:function(a,c){var e=a.toHSL();e.l-=c.value/100,e.l=d(e.l);return b(e)},fadein:function(a,c){var e=a.toHSL();e.a+=c.value/100,e.a=d(e.a);return b(e)},fadeout:function(a,c){var e=a.toHSL();e.a-=c.value/100,e.a=d(e.a);return b(e)},fade:function(a,c){var e=a.toHSL();e.a=c.value/100,e.a=d(e.a);return b(e)},spin:function(a,c){var d=a.toHSL(),e=(d.h+c.value)%360;d.h=e<0?360+e:e;return b(d)},mix:function(b,c,d){d||(d=new a.Dimension(50));var e=d.value/100,f=e*2-1,g=b.toHSL().a-c.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[b.rgb[0]*h+c.rgb[0]*i,b.rgb[1]*h+c.rgb[1]*i,b.rgb[2]*h+c.rgb[2]*i],k=b.alpha*e+c.alpha*(1-e);return new a.Color(j,k)},greyscale:function(b){return this.desaturate(b,new a.Dimension(100))},contrast:function(a,b,c,d){typeof c=="undefined"&&(c=this.rgba(255,255,255,1)),typeof b=="undefined"&&(b=this.rgba(0,0,0,1)),typeof d=="undefined"?d=.43:d=d.value;return(.2126*(a.rgb[0]/255)+.7152*(a.rgb[1]/255)+.0722*(a.rgb[2]/255))*a.alpha255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},operate:function(b,c){var d=[];c instanceof a.Color||(c=c.toColor());for(var e=0;e<3;e++)d[e]=a.operate(b,this.rgb[e],c.rgb[e]);return new a.Color(d,this.alpha+c.alpha)},toHSL:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255,d=this.alpha,e=Math.max(a,b,c),f=Math.min(a,b,c),g,h,i=(e+f)/2,j=e-f;if(e===f)g=h=0;else{h=i>.5?j/(2-e-f):j/(e+f);switch(e){case a:g=(b-c)/j+(b255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},compare:function(a){if(!a.rgb)return-1;return a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:-1}}}(c("../tree")),function(a){a.Comment=function(a,b){this.value=a,this.silent=!!b},a.Comment.prototype={toCSS:function(a){return a.compress?"" :this.value},eval:function(){return this}}}(c("../tree")),function(a){a.Condition=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e},a.Condition.prototype.eval=function(a){var b=this.lvalue.eval(a),c=this.rvalue.eval(a),d=this.index,e,e=function(a){switch(a){case"and":return b&&c;case"or":return b||c;default:if(b.compare)e=b.compare(c);else if(c.compare)e=c.compare(b);else throw{type:"Type",message:"Unable to perform comparison",index:d};switch(e){case-1:return a==="<"||a==="=<";case 0:return a==="="||a===">="||a==="=<";case 1:return a===">"||a===">="}}}(this.op);return this.negate?!e:e}}(c("../tree")),function(a){a.Dimension=function(a,b){this.value=parseFloat(a),this.unit=b||null},a.Dimension.prototype={eval:function(){return this},toColor:function(){return new a.Color([this.value,this.value,this.value])},toCSS:function(){var a=this.value+this.unit;return a},operate:function(b,c){return new a.Dimension(a.operate(b,this.value,c.value),this.unit||c.unit)},compare:function(b){return b instanceof a.Dimension?b.value>this.value?-1:b.value":a.compress?">":" > "}[this.value]}}(c("../tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={eval:function(b){return this.value.length>1?new a.Expression(this.value.map(function(a){return a.eval(b)})):this.value.length===1?this.value[0].eval(b):this},toCSS:function(a){return this.value.map(function(b){return b.toCSS?b.toCSS(a):""}).join(" ")}}}(c("../tree")),function(a){a.Import=function(b,c,d,e,f){var g=this;this.once=e,this.index=f,this._path=b,this.features=d&&new a.Value(d),b instanceof a.Quoted?this.path=/\.(le?|c)ss(\?.*)?$/.test(b.value)?b.value:b.value+".less":this.path=b.value.value||b.value,this.css=/css(\?.*)?$/.test(this.path),this.css||c.push(this.path,function(b,c,d){b&&(b.index=f),d&&g.once&&(g.skip=d),g.root=c||new a.Ruleset([],[])})},a.Import.prototype={toCSS:function(a){var b=this.features?" "+this.features.toCSS(a):"";return this.css?"@import "+this._path.toCSS()+b+";\n":""},eval:function(b){var c,d=this.features&&this.features.eval(b);if(this.skip)return[];if(this.css)return this;c=new a.Ruleset([],this.root.rules.slice(0));for(var e=0;e1){var d=this.emptySelectors();c=new a.Ruleset(d,b.mediaBlocks),c.multiMedia=!0}delete b.mediaBlocks,delete b.mediaPath;return c},evalNested:function(b){var c,d,e=b.mediaPath.concat([this]);for(c=0;c0;c--)b.splice(c,0,new a.Anonymous("and"));return new a.Expression(b)}));return new a.Ruleset([],[])},permute:function(a){if(a.length===0)return[];if(a.length===1)return a[0];var b=[],c=this.permute(a.slice(1));for(var d=0;d0){c=this.arguments&&this.arguments.map(function(b){return{name:b.name,value:b.value.eval(a)}});for(var g=0;gthis.params.length)return!1;if(this.required>0&&c>this.params.length)return!1}if(this.condition&&!this.condition.eval({frames:[this.evalParams(b,a)].concat(b.frames)}))return!1;d=Math.min(c,this.arity);for(var f=0;fe.selectors[g].elements.length?Array.prototype.push.apply(d,e.find(new a.Selector(b.elements.slice(1)),c)):d.push(e);break}});return this._lookups[g]=d},toCSS:function(b,c){var d=[],e=[],f=[],g=[],h=[],i,j;this.root||this.joinSelectors(h,b,this.selectors);for(var k=0;k0){i=h.map(function(a){return a.map(function(a){return a.toCSS(c)}).join("").trim()}).join(c.compress?",":",\n");for(var k=e.length-1;k>=0;k--)f.indexOf(e[k])===-1&&f.unshift(e[k]);e=f,d.push(i,(c.compress?"{":" {\n ")+e.join(c.compress?"":"\n ")+(c.compress?"}":"\n}\n"))}d.push(g);return d.join("")+(c.compress?"\n":"")},joinSelectors:function(a,b,c){for(var d=0;d0)for(e=0;e0&&this.mergeElementsOnToSelectors(r,i);for(f=0;f0&&(k[0].elements=k[0].elements.slice(0),k[0].elements.push(new a.Element(j.combinator,"",0))),s.push(k);else for(g=0;g0?(m=k.slice(0),q=m.pop(),o=new a.Selector(q.elements.slice(0)),p=!1):o=new a.Selector([]),l.length>1&&(n=n.concat(l.slice(1))),l.length>0&&(p=!1,o.elements.push(new a.Element(j.combinator,l[0].elements[0].value,0)),o.elements=o.elements.concat(l[0].elements.slice(1))),p||m.push(o),m=m.concat(n),s.push(m)}i=s,r=[]}}r.length>0&&this.mergeElementsOnToSelectors(r,i);for(e=0;e0?e[e.length-1]=new a.Selector(e[e.length-1].elements.concat(b)):e.push(new a.Selector(b))}}}(c("../tree")),function(a){a.Selector=function(a){this.elements=a},a.Selector.prototype.match=function(a){var b=this.elements.length,c=a.elements.length,d=Math.min(b,c);if(b0&&(d.value=this.paths[0]+(d.value.charAt(0)==="/"?d.value.slice(1):d.value));return new b.URL(d,this.paths)}}}(c("../tree")),function(a){a.Value=function(a){this.value=a,this.is="value"},a.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new a.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(a.compress?",":", ")}}}(c("../tree")),function(a){a.Variable=function(a,b,c){this.name=a,this.index=b,this.file=c},a.Variable.prototype={eval:function(b){var c,d,e=this.name;e.indexOf("@@")==0&&(e="@"+(new a.Variable(e.slice(1))).eval(b).value);if(c=a.find(b.frames,function(a){if(d=a.variable(e))return d.value.eval(b)}))return c;throw{type:"Name",message:"variable "+e+" is undefined",filename:this.file,index:this.index}}}}(c("../tree")),function(a){a.find=function(a,b){for(var c=0,d;c1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)}}(c("./tree"));var f=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);d.env=d.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||f?"development":"production"),d.async=!1,d.poll=d.poll||(f?1e3:1500),d.watch=function(){return this.watchMode=!0},d.unwatch=function(){return this.watchMode=!1},d.env==="development"?(d.optimization=0,/!watch/.test(location.hash)&&d.watch(),d.watchTimer=setInterval(function(){d.watchMode&&m(function(a,b,c,d,e){b&&p(b.toCSS(),d,e.lastModified)})},d.poll)):d.optimization=3;var g;try{g=typeof a.localStorage=="undefined"?null:a.localStorage}catch(h){g=null}var i=document.getElementsByTagName("link"),j=/^text\/(x-)?less$/;d.sheets=[];for(var k=0;k