less 1.4.0-b3 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,11 @@
1
- (function(window,undefined){function require(arg){return window.less[arg.split("/")[1]]}var less,tree,charset;if(typeof environment==="object"&&{}.toString.call(environment)==="[object Environment]"){if(typeof window==="undefined"){less={}}else{less=window.less={}}tree=less.tree={};less.mode="rhino"}else if(typeof window==="undefined"){less=exports,tree=require("./tree");less.mode="node"}else{if(typeof window.less==="undefined"){window.less={}}less=window.less,tree=window.less.tree={};less.mode="browser"}less.Parser=function Parser(env){var input,i,j,temp,memo,furthest,chunks,current,parser;var that=this;if(!(env instanceof tree.parseEnv)){env=new tree.parseEnv(env)}var imports=this.imports={paths:env.paths||[],queue:[],files:env.files,contents:env.contents,mime:env.mime,error:null,push:function(path,currentFileInfo,callback){var parserImporter=this;this.queue.push(path);less.Parser.importer(path,currentFileInfo,function(e,root,fullPath){parserImporter.queue.splice(parserImporter.queue.indexOf(path),1);var imported=fullPath in parserImporter.files;parserImporter.files[fullPath]=root;if(e&&!parserImporter.error){parserImporter.error=e}callback(e,root,imported)},env)}};function save(){temp=chunks[j],memo=i,current=i}function restore(){chunks[j]=temp,i=memo,current=i}function sync(){if(i>current){chunks[j]=chunks[j].slice(i-current);current=i}}function isWhitespace(c){var code=c.charCodeAt(0);return code===32||code===10||code===9}function $(tok){var match,args,length,index,k;if(tok instanceof Function){return tok.call(parser.parsers)}else if(typeof tok==="string"){match=input.charAt(i)===tok?tok:null;length=1;sync()}else{sync();if(match=tok.exec(chunks[j])){length=match[0].length}else{return null}}if(match){skipWhitespace(length);if(typeof match==="string"){return match}else{return match.length===1?match[0]:match}}}function skipWhitespace(length){var oldi=i,oldj=j,endIndex=i+chunks[j].length,mem=i+=length;while(i<endIndex){if(!isWhitespace(input.charAt(i))){break}i++}chunks[j]=chunks[j].slice(length+(i-mem));current=i;if(chunks[j].length===0&&j<chunks.length-1){j++}return oldi!==i||oldj!==j}function expect(arg,msg){var result=$(arg);if(!result){error(msg||(typeof arg==="string"?"expected '"+arg+"' got '"+input.charAt(i)+"'":"unexpected token"))}else{return result}}function error(msg,type){var e=new Error(msg);e.index=i;e.type=type||"Syntax";throw e}function peek(tok){if(typeof tok==="string"){return input.charAt(i)===tok}else{if(tok.test(chunks[j])){return true}else{return false}}}function getInput(e,env){if(e.filename&&env.currentFileInfo.filename&&e.filename!==env.currentFileInfo.filename){return parser.imports.contents[e.filename]}else{return input}}function getLocation(index,input){for(var n=index,column=-1;n>=0&&input.charAt(n)!=="\n";n--){column++}return{line:typeof index==="number"?(input.slice(0,index).match(/\n/g)||"").length:null,column:column}}function getDebugInfo(index,inputStream,env){var filename=env.currentFileInfo.filename;if(less.mode!=="browser"&&less.mode!=="rhino"){filename=require("path").resolve(filename)}return{lineNumber:getLocation(index,inputStream).line+1,fileName:filename}}function LessError(e,env){var input=getInput(e,env),loc=getLocation(e.index,input),line=loc.line,col=loc.column,lines=input.split("\n");this.type=e.type||"Syntax";this.message=e.message;this.filename=e.filename||env.currentFileInfo.filename;this.index=e.index;this.line=typeof line==="number"?line+1:null;this.callLine=e.call&&getLocation(e.call,input).line+1;this.callExtract=lines[getLocation(e.call,input).line];this.stack=e.stack;this.column=col;this.extract=[lines[line-1],lines[line],lines[line+1]]}LessError.prototype=new Error;LessError.prototype.constructor=LessError;this.env=env=env||{};this.optimization="optimization"in this.env?this.env.optimization:1;return parser={imports:imports,parse:function(str,callback){var root,start,end,zone,line,lines,buff=[],c,error=null;i=j=current=furthest=0;input=str.replace(/\r\n/g,"\n");input=input.replace(/^\uFEFF/,"");chunks=function(chunks){var j=0,skip=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,comment=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,string=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,level=0,match,chunk=chunks[0],inParam;for(var i=0,c,cc;i<input.length;){skip.lastIndex=i;if(match=skip.exec(input)){if(match.index===i){i+=match[0].length;chunk.push(match[0])}}c=input.charAt(i);comment.lastIndex=string.lastIndex=i;if(match=string.exec(input)){if(match.index===i){i+=match[0].length;chunk.push(match[0]);continue}}if(!inParam&&c==="/"){cc=input.charAt(i+1);if(cc==="/"||cc==="*"){if(match=comment.exec(input)){if(match.index===i){i+=match[0].length;chunk.push(match[0]);continue}}}}switch(c){case"{":if(!inParam){level++;chunk.push(c);break}case"}":if(!inParam){level--;chunk.push(c);chunks[++j]=chunk=[];break}case"(":if(!inParam){inParam=true;chunk.push(c);break}case")":if(inParam){inParam=false;chunk.push(c);break}default:chunk.push(c)}i++}if(level!=0){error=new LessError({index:i-1,type:"Parse",message:level>0?"missing closing `}`":"missing opening `{`",filename:env.currentFileInfo.filename},env)}return chunks.map(function(c){return c.join("")})}([[]]);if(error){return callback(new LessError(error,env))}try{root=new tree.Ruleset([],$(this.parsers.primary));root.root=true;root.firstRoot=true}catch(e){return callback(new LessError(e,env))}root.toCSS=function(evaluate){var line,lines,column;return function(options,variables){options=options||{};var importError,evalEnv=new tree.evalEnv(options);if(typeof variables==="object"&&!Array.isArray(variables)){variables=Object.keys(variables).map(function(k){var value=variables[k];if(!(value instanceof tree.Value)){if(!(value instanceof tree.Expression)){value=new tree.Expression([value])}value=new tree.Value([value])}return new tree.Rule("@"+k,value,false,0)});evalEnv.frames=[new tree.Ruleset(null,variables)]}try{var evaldRoot=evaluate.call(this,evalEnv);(new tree.joinSelectorVisitor).run(evaldRoot);(new tree.processExtendsVisitor).run(evaldRoot);var css=evaldRoot.toCSS({compress:Boolean(options.compress),dumpLineNumbers:env.dumpLineNumbers,strictUnits:Boolean(options.strictUnits)})}catch(e){throw new LessError(e,env)}if(options.yuicompress&&less.mode==="node"){return require("ycssmin").cssmin(css,options.maxLineLen)}else if(options.compress){return css.replace(/(\s)+/g,"$1")}else{return css}}}(root.eval);if(i<input.length-1){i=furthest;lines=input.split("\n");line=(input.slice(0,i).match(/\n/g)||"").length+1;for(var n=i,column=-1;n>=0&&input.charAt(n)!=="\n";n--){column++}error={type:"Parse",message:"Unrecognised input",index:i,filename:env.currentFileInfo.filename,line:line,column:column,extract:[lines[line-2],lines[line-1],lines[line]]}}var finish=function(e){e=error||e||parser.imports.error;if(e){if(!(e instanceof LessError)){e=new LessError(e,env)}callback(e)}else{callback(null,root)}};if(env.processImports!==false){new tree.importVisitor(this.imports,finish).run(root)}else{finish()}},parsers:{primary:function(){var node,root=[];while((node=$(this.extendRule)||$(this.mixin.definition)||$(this.rule)||$(this.ruleset)||$(this.mixin.call)||$(this.comment)||$(this.directive))||$(/^[\s\n]+/)||$(/^;+/)){node&&root.push(node)}return root},comment:function(){var comment;if(input.charAt(i)!=="/")return;if(input.charAt(i+1)==="/"){return new tree.Comment($(/^\/\/.*/),true)}else if(comment=$(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)){return new tree.Comment(comment)}},entities:{quoted:function(){var str,j=i,e,index=i;if(input.charAt(j)==="~"){j++,e=true}if(input.charAt(j)!=='"'&&input.charAt(j)!=="'")return;e&&$("~");if(str=$(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)){return new tree.Quoted(str[0],str[1]||str[2],e,index,env.currentFileInfo)}},keyword:function(){var k;if(k=$(/^[_A-Za-z-][_A-Za-z0-9-]*/)){if(tree.colors.hasOwnProperty(k)){return new tree.Color(tree.colors[k].slice(1))}else{return new tree.Keyword(k)}}},call:function(){var name,nameLC,args,alpha_ret,index=i;if(!(name=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(chunks[j])))return;name=name[1];nameLC=name.toLowerCase();if(nameLC==="url"){return null}else{i+=name.length}if(nameLC==="alpha"){alpha_ret=$(this.alpha);if(typeof alpha_ret!=="undefined"){return alpha_ret}}$("(");args=$(this.entities.arguments);if(!$(")")){return}if(name){return new tree.Call(name,args,index,env.currentFileInfo)}},arguments:function(){var args=[],arg;while(arg=$(this.entities.assignment)||$(this.expression)){args.push(arg);if(!$(",")){break}}return args},literal:function(){return $(this.entities.dimension)||$(this.entities.color)||$(this.entities.quoted)||$(this.entities.unicodeDescriptor)},assignment:function(){var key,value;if((key=$(/^\w+(?=\s?=)/i))&&$("=")&&(value=$(this.entity))){return new tree.Assignment(key,value)}},url:function(){var value;if(input.charAt(i)!=="u"||!$(/^url\(/))return;value=$(this.entities.quoted)||$(this.entities.variable)||$(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"";expect(")");return new tree.URL(value.value!=null||value instanceof tree.Variable?value:new tree.Anonymous(value),env.currentFileInfo)},variable:function(){var name,index=i;if(input.charAt(i)==="@"&&(name=$(/^@@?[\w-]+/))){return new tree.Variable(name,index,env.currentFileInfo)}},variableCurly:function(){var name,curly,index=i;if(input.charAt(i)==="@"&&(curly=$(/^@\{([\w-]+)\}/))){return new tree.Variable("@"+curly[1],index,env.currentFileInfo)}},color:function(){var rgb;if(input.charAt(i)==="#"&&(rgb=$(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){return new tree.Color(rgb[1])}},dimension:function(){var value,c=input.charCodeAt(i);if(c>57||c<43||c===47||c==44)return;if(value=$(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/)){return new tree.Dimension(value[1],value[2])}},unicodeDescriptor:function(){var ud;if(ud=$(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/)){return new tree.UnicodeDescriptor(ud[0])}},javascript:function(){var str,j=i,e;if(input.charAt(j)==="~"){j++,e=true}if(input.charAt(j)!=="`"){return}e&&$("~");if(str=$(/^`([^`]*)`/)){return new tree.JavaScript(str[1],i,e)}}},variable:function(){var name;if(input.charAt(i)==="@"&&(name=$(/^(@[\w-]+)\s*:/))){return name[1]}},extend:function(isRule){var elements,e,index=i,option,extendList=[];if(!$(isRule?/^&:extend\(/:/^:extend\(/)){return}do{option=null;elements=[];while(true){option=$(/^(all)(?=\s*(\)|,))/);if(option){break}e=$(this.element);if(!e){break}elements.push(e)}option=option&&option[1];extendList.push(new tree.Extend(new tree.Selector(elements),option,index))}while($(","));expect(/^\)/);if(isRule){expect(/^;/)}return extendList},extendRule:function(){return this.extend(true)},mixin:{call:function(){var elements=[],e,c,args,delim,arg,index=i,s=input.charAt(i),important=false;if(s!=="."&&s!=="#"){return}save();while(e=$(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)){elements.push(new tree.Element(c,e,i));c=$(">")}if($("(")){args=this.mixin.args.call(this,true).args;expect(")")}args=args||[];if($(this.important)){important=true}if(elements.length>0&&($(";")||peek("}"))){return new tree.mixin.Call(elements,args,index,env.currentFileInfo,important)}restore()},args:function(isCall){var expressions=[],argsSemiColon=[],isSemiColonSeperated,argsComma=[],expressionContainsNamed,name,nameLoop,value,arg,returner={args:null,variadic:false};while(true){if(isCall){arg=$(this.expression)}else{$(this.comment);if(input.charAt(i)==="."&&$(/^\.{3}/)){returner.variadic=true;if($(";")&&!isSemiColonSeperated){isSemiColonSeperated=true}(isSemiColonSeperated?argsSemiColon:argsComma).push({variadic:true});break}arg=$(this.entities.variable)||$(this.entities.literal)||$(this.entities.keyword)}if(!arg){break}nameLoop=null;if(arg.throwAwayComments){arg.throwAwayComments()}value=arg;var val=null;if(isCall){if(arg.value.length==1){var val=arg.value[0]}}else{val=arg}if(val&&val instanceof tree.Variable){if($(":")){if(expressions.length>0){if(isSemiColonSeperated){error("Cannot mix ; and , as delimiter types")}expressionContainsNamed=true}value=expect(this.expression);nameLoop=name=val.name}else if(!isCall&&$(/^\.{3}/)){returner.variadic=true;if($(";")&&!isSemiColonSeperated){isSemiColonSeperated=true}(isSemiColonSeperated?argsSemiColon:argsComma).push({name:arg.name,variadic:true});break}else if(!isCall){name=nameLoop=val.name;value=null}}if(value){expressions.push(value)}argsComma.push({name:nameLoop,value:value});if($(",")){continue}if($(";")||isSemiColonSeperated){if(expressionContainsNamed){error("Cannot mix ; and , as delimiter types")}isSemiColonSeperated=true;if(expressions.length>1){value=new tree.Value(expressions)}argsSemiColon.push({name:name,value:value});name=null;expressions=[];expressionContainsNamed=false}}returner.args=isSemiColonSeperated?argsSemiColon:argsComma;return returner},definition:function(){var name,params=[],match,ruleset,param,value,cond,variadic=false;if(input.charAt(i)!=="."&&input.charAt(i)!=="#"||peek(/^[^{]*\}/))return;save();if(match=$(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){name=match[1];var argInfo=this.mixin.args.call(this,false);params=argInfo.args;variadic=argInfo.variadic;if(!$(")")){furthest=i;restore()}$(this.comment);if($(/^when/)){cond=expect(this.conditions,"expected condition")}ruleset=$(this.block);if(ruleset){return new tree.mixin.Definition(name,params,ruleset,cond,variadic)}else{restore()}}}},entity:function(){return $(this.entities.literal)||$(this.entities.variable)||$(this.entities.url)||$(this.entities.call)||$(this.entities.keyword)||$(this.entities.javascript)||$(this.comment)},end:function(){return $(";")||peek("}")},alpha:function(){var value;if(!$(/^\(opacity=/i))return;if(value=$(/^\d+/)||$(this.entities.variable)){expect(")");return new tree.Alpha(value)}},element:function(){var e,t,c,v;c=$(this.combinator);e=$(/^(?:\d+\.\d+|\d+)%/)||$(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||$("*")||$("&")||$(this.attribute)||$(/^\([^()@]+\)/)||$(/^[\.#](?=@)/)||$(this.entities.variableCurly);if(!e){if($("(")){if((v=$(this.selector))&&$(")")){e=new tree.Paren(v)}}}if(e){return new tree.Element(c,e,i)}},combinator:function(){var match,c=input.charAt(i);if(c===">"||c==="+"||c==="~"||c==="|"){i++;while(input.charAt(i).match(/\s/)){i++}return new tree.Combinator(c)}else if(input.charAt(i-1).match(/\s/)){return new tree.Combinator(" ")}else{return new tree.Combinator(null)}},selector:function(){var sel,e,elements=[],c,match,extend,extendList=[];while((extend=$(this.extend))||(e=$(this.element))){if(extend){extendList.push.apply(extendList,extend)}else{if(extendList.length){error("Extend can only be used at the end of selector")}c=input.charAt(i);elements.push(e);e=null}if(c==="{"||c==="}"||c===";"||c===","||c===")"){break}}if(elements.length>0){return new tree.Selector(elements,extendList)}if(extendList.length){error("Extend must be used to extend a selector, it cannot be used on its own")}},attribute:function(){var attr="",key,val,op;if(!$("["))return;if(!(key=$(this.entities.variableCurly))){key=expect(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)}if(op=$(/^[|~*$^]?=/)){val=$(this.entities.quoted)||$(/^[\w-]+/)||$(this.entities.variableCurly)}expect("]");return new tree.Attribute(key,op,val)},block:function(){var content;if($("{")&&(content=$(this.primary))&&$("}")){return content}},ruleset:function(){var selectors=[],s,rules,match,debugInfo;save();if(env.dumpLineNumbers)debugInfo=getDebugInfo(i,input,env);while(s=$(this.selector)){selectors.push(s);$(this.comment);if(!$(",")){break}$(this.comment)}if(selectors.length>0&&(rules=$(this.block))){var ruleset=new tree.Ruleset(selectors,rules,env.strictImports);if(env.dumpLineNumbers)ruleset.debugInfo=debugInfo;return ruleset}else{furthest=i;restore()}},rule:function(tryAnonymous){var name,value,c=input.charAt(i),important,match;save();if(c==="."||c==="#"||c==="&"){return}if(name=$(this.variable)||$(this.property)){value=!tryAnonymous&&(env.compress||name.charAt(0)==="@")?$(this.value)||$(this.anonymousValue):$(this.anonymousValue)||$(this.value);important=$(this.important);if(value&&$(this.end)){return new tree.Rule(name,value,important,memo,env.currentFileInfo)}else{furthest=i;restore();if(value&&!tryAnonymous){return this.rule(true)}}}},anonymousValue:function(){if(match=/^([^@+\/'"*`(;{}-]*);/.exec(chunks[j])){i+=match[0].length-1;return new tree.Anonymous(match[1])}},"import":function(){var path,features,index=i;save();var dir=$(/^@import?\s+/);var options=(dir?$(this.importOptions):null)||{};if(dir&&(path=$(this.entities.quoted)||$(this.entities.url))){features=$(this.mediaFeatures);if($(";")){features=features&&new tree.Value(features);return new tree.Import(path,features,options,index,env.currentFileInfo)}}restore()},importOptions:function(){var o,options={},optionName,value;if(!$("(")){return null}do{if(o=$(this.importOption)){optionName=o;value=true;switch(optionName){case"css":optionName="less";value=false;break;case"once":optionName="multiple";value=false;break}options[optionName]=value;if(!$(",")){break}}}while(o);expect(")");return options},importOption:function(){var opt=$(/^(less|css|multiple|once)/);if(opt){return opt[1]}},mediaFeature:function(){var e,p,nodes=[];do{if(e=$(this.entities.keyword)){nodes.push(e)}else if($("(")){p=$(this.property);e=$(this.value);if($(")")){if(p&&e){nodes.push(new tree.Paren(new tree.Rule(p,e,null,i,env.currentFileInfo,true)))}else if(e){nodes.push(new tree.Paren(e))}else{return null}}else{return null}}}while(e);if(nodes.length>0){return new tree.Expression(nodes)}},mediaFeatures:function(){var e,features=[];do{if(e=$(this.mediaFeature)){features.push(e);if(!$(",")){break}}else if(e=$(this.entities.variable)){features.push(e);if(!$(",")){break}}}while(e);return features.length>0?features:null},media:function(){var features,rules,media,debugInfo;if(env.dumpLineNumbers)debugInfo=getDebugInfo(i,input,env);if($(/^@media/)){features=$(this.mediaFeatures);if(rules=$(this.block)){media=new tree.Media(rules,features);if(env.dumpLineNumbers)media.debugInfo=debugInfo;return media}}},directive:function(){var name,value,rules,identifier,e,nodes,nonVendorSpecificName,hasBlock,hasIdentifier,hasExpression;if(input.charAt(i)!=="@")return;if(value=$(this["import"])||$(this.media)){return value}save();name=$(/^@[a-z-]+/);if(!name)return;nonVendorSpecificName=name;if(name.charAt(1)=="-"&&name.indexOf("-",2)>0){nonVendorSpecificName="@"+name.slice(name.indexOf("-",2)+1)}switch(nonVendorSpecificName){case"@font-face":hasBlock=true;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":hasBlock=true;break;case"@page":case"@document":case"@supports":case"@keyframes":hasBlock=true;hasIdentifier=true;break;case"@namespace":hasExpression=true;break}if(hasIdentifier){name+=" "+($(/^[^{]+/)||"").trim()}if(hasBlock){if(rules=$(this.block)){return new tree.Directive(name,rules)}}else{if((value=hasExpression?$(this.expression):$(this.entity))&&$(";")){var directive=new tree.Directive(name,value);if(env.dumpLineNumbers){directive.debugInfo=getDebugInfo(i,input,env)}return directive}}restore()},value:function(){var e,expressions=[],important;while(e=$(this.expression)){expressions.push(e);if(!$(",")){break}}if(expressions.length>0){return new tree.Value(expressions)}},important:function(){if(input.charAt(i)==="!"){return $(/^! *important/)}},sub:function(){var a,e;if($("(")){if(a=$(this.addition)){e=new tree.Expression([a]);expect(")");e.parens=true;return e}}},multiplication:function(){var m,a,op,operation,isSpaced,expression=[];if(m=$(this.operand)){isSpaced=isWhitespace(input.charAt(i-1));while(!peek(/^\/[*\/]/)&&(op=$("/")||$("*"))){if(a=$(this.operand)){m.parensInOp=true;a.parensInOp=true;operation=new tree.Operation(op,[operation||m,a],isSpaced);isSpaced=isWhitespace(input.charAt(i-1))}else{break}}return operation||m}},addition:function(){var m,a,op,operation,isSpaced;if(m=$(this.multiplication)){isSpaced=isWhitespace(input.charAt(i-1));while((op=$(/^[-+]\s+/)||!isSpaced&&($("+")||$("-")))&&(a=$(this.multiplication))){m.parensInOp=true;a.parensInOp=true;operation=new tree.Operation(op,[operation||m,a],isSpaced);isSpaced=isWhitespace(input.charAt(i-1))}return operation||m}},conditions:function(){var a,b,index=i,condition;if(a=$(this.condition)){while($(",")&&(b=$(this.condition))){condition=new tree.Condition("or",condition||a,b,index)}return condition||a}},condition:function(){var a,b,c,op,index=i,negate=false;if($(/^not/)){negate=true}expect("(");if(a=$(this.addition)||$(this.entities.keyword)||$(this.entities.quoted)){if(op=$(/^(?:>=|=<|[<=>])/)){if(b=$(this.addition)||$(this.entities.keyword)||$(this.entities.quoted)){c=new tree.Condition(op,a,b,index,negate)}else{error("expected expression")}}else{c=new tree.Condition("=",a,new tree.Keyword("true"),index,negate)}expect(")");return $(/^and/)?new tree.Condition("and",c,$(this.condition)):c}},operand:function(){var negate,p=input.charAt(i+1);if(input.charAt(i)==="-"&&(p==="@"||p==="(")){negate=$("-")}var o=$(this.sub)||$(this.entities.dimension)||$(this.entities.color)||$(this.entities.variable)||$(this.entities.call);if(negate){o.parensInOp=true;o=new tree.Negative(o)}return o},expression:function(){var e,delim,entities=[],d;while(e=$(this.addition)||$(this.entity)){entities.push(e);if(!peek(/^\/[\/*]/)&&(delim=$("/"))){entities.push(new tree.Anonymous(delim))}}if(entities.length>0){return new tree.Expression(entities)}},property:function(){var name;if(name=$(/^(\*?-?[_a-z0-9-]+)\s*:/)){return name[1]}}}}};if(less.mode==="browser"||less.mode==="rhino"){less.Parser.importer=function(path,currentFileInfo,callback,env){if(!/^([a-z-]+:)?\//.test(path)&&currentFileInfo.currentDirectory){path=currentFileInfo.currentDirectory+path}var sheetEnv=env.toSheet(path);sheetEnv.processImports=false;sheetEnv.currentFileInfo=currentFileInfo;loadStyleSheet(sheetEnv,function(e,root,data,sheet,_,path){callback.call(null,e,root,path)},true)}}(function(tree){tree.functions={rgb:function(r,g,b){return this.rgba(r,g,b,1)},rgba:function(r,g,b,a){var rgb=[r,g,b].map(function(c){return scaled(c,256)});a=number(a);return new tree.Color(rgb,a)},hsl:function(h,s,l){return this.hsla(h,s,l,1)},hsla:function(h,s,l,a){h=number(h)%360/360;s=clamp(number(s));l=clamp(number(l));a=clamp(number(a));var m2=l<=.5?l*(s+1):l+s-l*s;var m1=l*2-m2;return this.rgba(hue(h+1/3)*255,hue(h)*255,hue(h-1/3)*255,a);function hue(h){h=h<0?h+1:h>1?h-1:h;if(h*6<1)return m1+(m2-m1)*h*6;else if(h*2<1)return m2;else if(h*3<2)return m1+(m2-m1)*(2/3-h)*6;else return m1}},hsv:function(h,s,v){return this.hsva(h,s,v,1)},hsva:function(h,s,v,a){h=number(h)%360/360*360;s=number(s);v=number(v);a=number(a);var i,f;i=Math.floor(h/60%6);f=h/60-i;var vs=[v,v*(1-s),v*(1-f*s),v*(1-(1-f)*s)];var perm=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return this.rgba(vs[perm[i][0]]*255,vs[perm[i][1]]*255,vs[perm[i][2]]*255,a)},hue:function(color){return new tree.Dimension(Math.round(color.toHSL().h))},saturation:function(color){return new tree.Dimension(Math.round(color.toHSL().s*100),"%")},lightness:function(color){return new tree.Dimension(Math.round(color.toHSL().l*100),"%")},hsvhue:function(color){return new tree.Dimension(Math.round(color.toHSV().h))},hsvsaturation:function(color){return new tree.Dimension(Math.round(color.toHSV().s*100),"%")},hsvvalue:function(color){return new tree.Dimension(Math.round(color.toHSV().v*100),"%")},red:function(color){return new tree.Dimension(color.rgb[0])},green:function(color){return new tree.Dimension(color.rgb[1])},blue:function(color){return new tree.Dimension(color.rgb[2])},alpha:function(color){return new tree.Dimension(color.toHSL().a)},luma:function(color){return new tree.Dimension(Math.round(color.luma()*color.alpha*100),"%")},saturate:function(color,amount){var hsl=color.toHSL();hsl.s+=amount.value/100;hsl.s=clamp(hsl.s);return hsla(hsl)},desaturate:function(color,amount){var hsl=color.toHSL();hsl.s-=amount.value/100;hsl.s=clamp(hsl.s);return hsla(hsl)},lighten:function(color,amount){var hsl=color.toHSL();hsl.l+=amount.value/100;hsl.l=clamp(hsl.l);return hsla(hsl)},darken:function(color,amount){var hsl=color.toHSL();hsl.l-=amount.value/100;hsl.l=clamp(hsl.l);return hsla(hsl)},fadein:function(color,amount){var hsl=color.toHSL();hsl.a+=amount.value/100;hsl.a=clamp(hsl.a);return hsla(hsl)},fadeout:function(color,amount){var hsl=color.toHSL();hsl.a-=amount.value/100;hsl.a=clamp(hsl.a);return hsla(hsl)},fade:function(color,amount){var hsl=color.toHSL();hsl.a=amount.value/100;hsl.a=clamp(hsl.a);return hsla(hsl)},spin:function(color,amount){var hsl=color.toHSL();var hue=(hsl.h+amount.value)%360;hsl.h=hue<0?360+hue:hue;return hsla(hsl)},mix:function(color1,color2,weight){if(!weight){weight=new tree.Dimension(50)}var p=weight.value/100;var w=p*2-1;var a=color1.toHSL().a-color2.toHSL().a;var w1=((w*a==-1?w:(w+a)/(1+w*a))+1)/2;var w2=1-w1;var rgb=[color1.rgb[0]*w1+color2.rgb[0]*w2,color1.rgb[1]*w1+color2.rgb[1]*w2,color1.rgb[2]*w1+color2.rgb[2]*w2];var alpha=color1.alpha*p+color2.alpha*(1-p);return new tree.Color(rgb,alpha)},greyscale:function(color){return this.desaturate(color,new tree.Dimension(100))},contrast:function(color,dark,light,threshold){if(!color.rgb){return null}if(typeof light==="undefined"){light=this.rgba(255,255,255,1)}if(typeof dark==="undefined"){dark=this.rgba(0,0,0,1)}if(dark.luma()>light.luma()){var t=light;light=dark;dark=t}if(typeof threshold==="undefined"){threshold=.43}else{threshold=number(threshold)}if(color.luma()*color.alpha<threshold){return light}else{return dark}},e:function(str){return new tree.Anonymous(str instanceof tree.JavaScript?str.evaluated:str)},escape:function(str){return new tree.Anonymous(encodeURI(str.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(quoted){var args=Array.prototype.slice.call(arguments,1),str=quoted.value;for(var i=0;i<args.length;i++){str=str.replace(/%[sda]/i,function(token){var value=token.match(/s/i)?args[i].value:args[i].toCSS();return token.match(/[A-Z]$/)?encodeURIComponent(value):value})}str=str.replace(/%%/g,"%");return new tree.Quoted('"'+str+'"',str)},unit:function(val,unit){return new tree.Dimension(val.value,unit?unit.toCSS():"")},convert:function(val,unit){return val.convertTo(unit.value)},round:function(n,f){var fraction=typeof f==="undefined"?0:f.value;return this._math(function(num){return num.toFixed(fraction)},null,n)},pi:function(){return new tree.Dimension(Math.PI)},mod:function(a,b){return new tree.Dimension(a.value%b.value,a.unit)},pow:function(x,y){if(typeof x==="number"&&typeof y==="number"){x=new tree.Dimension(x);y=new tree.Dimension(y)}else if(!(x instanceof tree.Dimension)||!(y instanceof tree.Dimension)){throw{type:"Argument",message:"arguments must be numbers"}}return new tree.Dimension(Math.pow(x.value,y.value),x.unit)},_math:function(fn,unit,n){if(n instanceof tree.Dimension){return new tree.Dimension(fn(parseFloat(n.value)),unit==null?n.unit:unit)}else if(typeof n==="number"){return fn(n)}else{throw{type:"Argument",message:"argument must be a number"}}},argb:function(color){return new tree.Anonymous(color.toARGB())},percentage:function(n){return new tree.Dimension(n.value*100,"%")},color:function(n){if(n instanceof tree.Quoted){return new tree.Color(n.value.slice(1))}else{throw{type:"Argument",message:"argument must be a string"}}},iscolor:function(n){return this._isa(n,tree.Color)},isnumber:function(n){return this._isa(n,tree.Dimension)},isstring:function(n){return this._isa(n,tree.Quoted)},iskeyword:function(n){return this._isa(n,tree.Keyword)},isurl:function(n){return this._isa(n,tree.URL)},ispixel:function(n){return this.isunit(n,"px")},ispercentage:function(n){return this.isunit(n,"%")},isem:function(n){return this.isunit(n,"em")},isunit:function(n,unit){return n instanceof tree.Dimension&&n.unit.is(unit.value||unit)?tree.True:tree.False},_isa:function(n,Type){return n instanceof Type?tree.True:tree.False},multiply:function(color1,color2){var r=color1.rgb[0]*color2.rgb[0]/255;var g=color1.rgb[1]*color2.rgb[1]/255;var b=color1.rgb[2]*color2.rgb[2]/255;return this.rgb(r,g,b)},screen:function(color1,color2){var r=255-(255-color1.rgb[0])*(255-color2.rgb[0])/255;var g=255-(255-color1.rgb[1])*(255-color2.rgb[1])/255;var b=255-(255-color1.rgb[2])*(255-color2.rgb[2])/255;return this.rgb(r,g,b)},overlay:function(color1,color2){var r=color1.rgb[0]<128?2*color1.rgb[0]*color2.rgb[0]/255:255-2*(255-color1.rgb[0])*(255-color2.rgb[0])/255;var g=color1.rgb[1]<128?2*color1.rgb[1]*color2.rgb[1]/255:255-2*(255-color1.rgb[1])*(255-color2.rgb[1])/255;var b=color1.rgb[2]<128?2*color1.rgb[2]*color2.rgb[2]/255:255-2*(255-color1.rgb[2])*(255-color2.rgb[2])/255;return this.rgb(r,g,b)},softlight:function(color1,color2){var t=color2.rgb[0]*color1.rgb[0]/255;var r=t+color1.rgb[0]*(255-(255-color1.rgb[0])*(255-color2.rgb[0])/255-t)/255;t=color2.rgb[1]*color1.rgb[1]/255;var g=t+color1.rgb[1]*(255-(255-color1.rgb[1])*(255-color2.rgb[1])/255-t)/255;t=color2.rgb[2]*color1.rgb[2]/255;var b=t+color1.rgb[2]*(255-(255-color1.rgb[2])*(255-color2.rgb[2])/255-t)/255;return this.rgb(r,g,b)},hardlight:function(color1,color2){var r=color2.rgb[0]<128?2*color2.rgb[0]*color1.rgb[0]/255:255-2*(255-color2.rgb[0])*(255-color1.rgb[0])/255;var g=color2.rgb[1]<128?2*color2.rgb[1]*color1.rgb[1]/255:255-2*(255-color2.rgb[1])*(255-color1.rgb[1])/255;var b=color2.rgb[2]<128?2*color2.rgb[2]*color1.rgb[2]/255:255-2*(255-color2.rgb[2])*(255-color1.rgb[2])/255;return this.rgb(r,g,b)},difference:function(color1,color2){var r=Math.abs(color1.rgb[0]-color2.rgb[0]);var g=Math.abs(color1.rgb[1]-color2.rgb[1]);var b=Math.abs(color1.rgb[2]-color2.rgb[2]);return this.rgb(r,g,b)},exclusion:function(color1,color2){var r=color1.rgb[0]+color2.rgb[0]*(255-color1.rgb[0]-color1.rgb[0])/255;var g=color1.rgb[1]+color2.rgb[1]*(255-color1.rgb[1]-color1.rgb[1])/255;var b=color1.rgb[2]+color2.rgb[2]*(255-color1.rgb[2]-color1.rgb[2])/255;return this.rgb(r,g,b)},average:function(color1,color2){var r=(color1.rgb[0]+color2.rgb[0])/2;var g=(color1.rgb[1]+color2.rgb[1])/2;var b=(color1.rgb[2]+color2.rgb[2])/2;return this.rgb(r,g,b)},negation:function(color1,color2){var r=255-Math.abs(255-color2.rgb[0]-color1.rgb[0]);var g=255-Math.abs(255-color2.rgb[1]-color1.rgb[1]);var b=255-Math.abs(255-color2.rgb[2]-color1.rgb[2]);return this.rgb(r,g,b)},tint:function(color,amount){return this.mix(this.rgb(255,255,255),color,amount)},shade:function(color,amount){return this.mix(this.rgb(0,0,0),color,amount)},extract:function(values,index){index=index.value-1;return values.value[index]},"data-uri":function(mimetypeNode,filePathNode){if(typeof window!=="undefined"){return new tree.URL(filePathNode||mimetypeNode,this.currentFileInfo).eval(this.env)}var mimetype=mimetypeNode.value;var filePath=filePathNode&&filePathNode.value;var fs=require("fs"),path=require("path"),useBase64=false;if(arguments.length<2){filePath=mimetype}if(this.env.isPathRelative(filePath)){if(this.currentFileInfo.relativeUrls){filePath=path.join(this.currentFileInfo.currentDirectory,filePath)}else{filePath=path.join(this.currentFileInfo.entryPath,filePath)}}if(arguments.length<2){var mime;try{mime=require("mime")}catch(ex){mime=tree._mime}mimetype=mime.lookup(filePath);var charset=mime.charsets.lookup(mimetype);useBase64=["US-ASCII","UTF-8"].indexOf(charset)<0;if(useBase64)mimetype+=";base64"}else{useBase64=/;base64$/.test(mimetype)}var buf=fs.readFileSync(filePath);var DATA_URI_MAX_KB=32,fileSizeInKB=parseInt(buf.length/1024,10);if(fileSizeInKB>=DATA_URI_MAX_KB){if(this.env.ieCompat!==false){if(!this.env.silent){console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!",filePath,fileSizeInKB,DATA_URI_MAX_KB)
2
- }return new tree.URL(filePathNode||mimetypeNode,this.currentFileInfo).eval(this.env)}else if(!this.env.silent){console.warn("WARNING: Embedding %s (%dKB) exceeds IE8's data-uri size limit of %dKB!",filePath,fileSizeInKB,DATA_URI_MAX_KB)}}buf=useBase64?buf.toString("base64"):encodeURIComponent(buf);var uri="'data:"+mimetype+","+buf+"'";return new tree.URL(new tree.Anonymous(uri))}};tree._mime={_types:{".htm":"text/html",".html":"text/html",".gif":"image/gif",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png"},lookup:function(filepath){var ext=require("path").extname(filepath),type=tree._mime._types[ext];if(type===undefined){throw new Error('Optional dependency "mime" is required for '+ext)}return type},charsets:{lookup:function(type){return type&&/^text\//.test(type)?"UTF-8":""}}};var mathFunctions=[{name:"ceil"},{name:"floor"},{name:"sqrt"},{name:"abs"},{name:"tan",unit:""},{name:"sin",unit:""},{name:"cos",unit:""},{name:"atan",unit:"rad"},{name:"asin",unit:"rad"},{name:"acos",unit:"rad"}],createMathFunction=function(name,unit){return function(n){if(unit!=null){n=n.unify()}return this._math(Math[name],unit,n)}};for(var i=0;i<mathFunctions.length;i++){tree.functions[mathFunctions[i].name]=createMathFunction(mathFunctions[i].name,mathFunctions[i].unit)}function hsla(color){return tree.functions.hsla(color.h,color.s,color.l,color.a)}function scaled(n,size){if(n instanceof tree.Dimension&&n.unit.is("%")){return parseFloat(n.value*size/100)}else{return number(n)}}function number(n){if(n instanceof tree.Dimension){return parseFloat(n.unit.is("%")?n.value/100:n.value)}else if(typeof n==="number"){return n}else{throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}}function clamp(val){return Math.min(1,Math.max(0,val))}tree.functionCall=function(env,currentFileInfo){this.env=env;this.currentFileInfo=currentFileInfo};tree.functionCall.prototype=tree.functions})(require("./tree"));(function(tree){tree.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}})(require("./tree"));(function(tree){tree.Alpha=function(val){this.value=val};tree.Alpha.prototype={type:"Alpha",accept:function(visitor){this.value=visitor.visit(this.value)},eval:function(env){if(this.value.eval){this.value=this.value.eval(env)}return this},toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"}}})(require("../tree"));(function(tree){tree.Anonymous=function(string){this.value=string.value||string};tree.Anonymous.prototype={type:"Anonymous",toCSS:function(){return this.value},eval:function(){return this},compare:function(x){if(!x.toCSS){return-1}var left=this.toCSS(),right=x.toCSS();if(left===right){return 0}return left<right?-1:1}}})(require("../tree"));(function(tree){tree.Assignment=function(key,val){this.key=key;this.value=val};tree.Assignment.prototype={type:"Assignment",accept:function(visitor){this.value=visitor.visit(this.value)},toCSS:function(){return this.key+"="+(this.value.toCSS?this.value.toCSS():this.value)},eval:function(env){if(this.value.eval){return new tree.Assignment(this.key,this.value.eval(env))}return this}}})(require("../tree"));(function(tree){tree.Call=function(name,args,index,currentFileInfo){this.name=name;this.args=args;this.index=index;this.currentFileInfo=currentFileInfo};tree.Call.prototype={type:"Call",accept:function(visitor){this.args=visitor.visit(this.args)},eval:function(env){var args=this.args.map(function(a){return a.eval(env)}),nameLC=this.name.toLowerCase(),result,func;if(nameLC in tree.functions){try{func=new tree.functionCall(env,this.currentFileInfo);result=func[nameLC].apply(func,args);if(result!=null){return result}}catch(e){throw{type:e.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(e.message?": "+e.message:""),index:this.index,filename:this.currentFileInfo.filename}}}return new tree.Anonymous(this.name+"("+args.map(function(a){return a.toCSS(env)}).join(", ")+")")},toCSS:function(env){return this.eval(env).toCSS()}}})(require("../tree"));(function(tree){tree.Color=function(rgb,a){if(Array.isArray(rgb)){this.rgb=rgb}else if(rgb.length==6){this.rgb=rgb.match(/.{2}/g).map(function(c){return parseInt(c,16)})}else{this.rgb=rgb.split("").map(function(c){return parseInt(c+c,16)})}this.alpha=typeof a==="number"?a:1};tree.Color.prototype={type:"Color",eval:function(){return this},luma:function(){return.2126*this.rgb[0]/255+.7152*this.rgb[1]/255+.0722*this.rgb[2]/255},toCSS:function(env,doNotCompress){var compress=env&&env.compress&&!doNotCompress;if(this.alpha<1){return"rgba("+this.rgb.map(function(c){return Math.round(c)}).concat(this.alpha).join(","+(compress?"":" "))+")"}else{var color=this.rgb.map(function(i){i=Math.round(i);i=(i>255?255:i<0?0:i).toString(16);return i.length===1?"0"+i:i}).join("");if(compress){color=color.split("");if(color[0]==color[1]&&color[2]==color[3]&&color[4]==color[5]){color=color[0]+color[2]+color[4]}else{color=color.join("")}}return"#"+color}},operate:function(env,op,other){var result=[];if(!(other instanceof tree.Color)){other=other.toColor()}for(var c=0;c<3;c++){result[c]=tree.operate(env,op,this.rgb[c],other.rgb[c])}return new tree.Color(result,this.alpha+other.alpha)},toHSL:function(){var r=this.rgb[0]/255,g=this.rgb[1]/255,b=this.rgb[2]/255,a=this.alpha;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,l=(max+min)/2,d=max-min;if(max===min){h=s=0}else{s=l>.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h*360,s:s,l:l,a:a}},toHSV:function(){var r=this.rgb[0]/255,g=this.rgb[1]/255,b=this.rgb[2]/255,a=this.alpha;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,v=max;var d=max-min;if(max===0){s=0}else{s=d/max}if(max===min){h=0}else{switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h*360,s:s,v:v,a:a}},toARGB:function(){var argb=[Math.round(this.alpha*255)].concat(this.rgb);return"#"+argb.map(function(i){i=Math.round(i);i=(i>255?255:i<0?0:i).toString(16);return i.length===1?"0"+i:i}).join("")},compare:function(x){if(!x.rgb){return-1}return x.rgb[0]===this.rgb[0]&&x.rgb[1]===this.rgb[1]&&x.rgb[2]===this.rgb[2]&&x.alpha===this.alpha?0:-1}}})(require("../tree"));(function(tree){tree.Comment=function(value,silent){this.value=value;this.silent=!!silent};tree.Comment.prototype={type:"Comment",toCSS:function(env){return env.compress?"":this.value},eval:function(){return this}}})(require("../tree"));(function(tree){tree.Condition=function(op,l,r,i,negate){this.op=op.trim();this.lvalue=l;this.rvalue=r;this.index=i;this.negate=negate};tree.Condition.prototype={type:"Condition",accept:function(visitor){this.lvalue=visitor.visit(this.lvalue);this.rvalue=visitor.visit(this.rvalue)},eval:function(env){var a=this.lvalue.eval(env),b=this.rvalue.eval(env);var i=this.index,result;var result=function(op){switch(op){case"and":return a&&b;case"or":return a||b;default:if(a.compare){result=a.compare(b)}else if(b.compare){result=b.compare(a)}else{throw{type:"Type",message:"Unable to perform comparison",index:i}}switch(result){case-1:return op==="<"||op==="=<";case 0:return op==="="||op===">="||op==="=<";case 1:return op===">"||op===">="}}}(this.op);return this.negate?!result:result}}})(require("../tree"));(function(tree){tree.Dimension=function(value,unit){this.value=parseFloat(value);this.unit=unit&&unit instanceof tree.Unit?unit:new tree.Unit(unit?[unit]:undefined)};tree.Dimension.prototype={type:"Dimension",accept:function(visitor){this.unit=visitor.visit(this.unit)},eval:function(env){return this},toColor:function(){return new tree.Color([this.value,this.value,this.value])},toCSS:function(env){if(env&&env.strictUnits&&!this.unit.isSingular()){throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString())}var value=this.value,strValue=String(value);if(value!==0&&value<1e-6&&value>-1e-6){strValue=value.toFixed(20).replace(/0+$/,"")}if(env&&env.compress){if(value===0&&!this.unit.isAngle()){return strValue}if(value>0&&value<1){strValue=strValue.substr(1)}}return strValue+this.unit.toCSS(env)},operate:function(env,op,other){var value=tree.operate(env,op,this.value,other.value),unit=this.unit.clone();if(op==="+"||op==="-"){if(unit.numerator.length===0&&unit.denominator.length===0){unit.numerator=other.unit.numerator.slice(0);unit.denominator=other.unit.denominator.slice(0)}else if(other.unit.numerator.length==0&&unit.denominator.length==0){}else{other=other.convertTo(this.unit.usedUnits());if(env.strictUnits&&other.unit.toString()!==unit.toString()){throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+unit.toString()+"' and '"+other.unit.toString()+"'.")}value=tree.operate(env,op,this.value,other.value)}}else if(op==="*"){unit.numerator=unit.numerator.concat(other.unit.numerator).sort();unit.denominator=unit.denominator.concat(other.unit.denominator).sort();unit.cancel()}else if(op==="/"){unit.numerator=unit.numerator.concat(other.unit.denominator).sort();unit.denominator=unit.denominator.concat(other.unit.numerator).sort();unit.cancel()}return new tree.Dimension(value,unit)},compare:function(other){if(other instanceof tree.Dimension){var a=this.unify(),b=other.unify(),aValue=a.value,bValue=b.value;if(bValue>aValue){return-1}else if(bValue<aValue){return 1}else{if(!b.unit.isEmpty()&&a.unit.compare(b.unit)!==0){return-1}return 0}}else{return-1}},unify:function(){return this.convertTo({length:"m",duration:"s",angle:"rad"})},convertTo:function(conversions){var value=this.value,unit=this.unit.clone(),i,groupName,group,conversion,targetUnit,derivedConversions={};if(typeof conversions==="string"){for(i in tree.UnitConversions){if(tree.UnitConversions[i].hasOwnProperty(conversions)){derivedConversions={};derivedConversions[i]=conversions}}conversions=derivedConversions}for(groupName in conversions){if(conversions.hasOwnProperty(groupName)){targetUnit=conversions[groupName];group=tree.UnitConversions[groupName];unit.map(function(atomicUnit,denominator){if(group.hasOwnProperty(atomicUnit)){if(denominator){value=value/(group[atomicUnit]/group[targetUnit])}else{value=value*(group[atomicUnit]/group[targetUnit])}return targetUnit}return atomicUnit})}}unit.cancel();return new tree.Dimension(value,unit)}};tree.UnitConversions={length:{m:1,cm:.01,mm:.001,"in":.0254,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:1/400,turn:1}};tree.Unit=function(numerator,denominator,backupUnit){this.numerator=numerator?numerator.slice(0).sort():[];this.denominator=denominator?denominator.slice(0).sort():[];this.backupUnit=backupUnit};tree.Unit.prototype={type:"Unit",clone:function(){return new tree.Unit(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},toCSS:function(env){if(this.numerator.length>=1){return this.numerator[0]}if(this.denominator.length>=1){return this.denominator[0]}if((!env||!env.strictUnits)&&this.backupUnit){return this.backupUnit}return""},toString:function(){var i,returnStr=this.numerator.join("*");for(i=0;i<this.denominator.length;i++){returnStr+="/"+this.denominator[i]}return returnStr},compare:function(other){return this.is(other.toString())?0:-1},is:function(unitString){return this.toString()===unitString},isAngle:function(){return tree.UnitConversions.angle.hasOwnProperty(this.toCSS())},isEmpty:function(){return this.numerator.length==0&&this.denominator.length==0},isSingular:function(){return this.numerator.length<=1&&this.denominator.length==0},map:function(callback){var i;for(i=0;i<this.numerator.length;i++){this.numerator[i]=callback(this.numerator[i],false)}for(i=0;i<this.denominator.length;i++){this.denominator[i]=callback(this.denominator[i],true)}},usedUnits:function(){var group,groupName,result={};for(groupName in tree.UnitConversions){if(tree.UnitConversions.hasOwnProperty(groupName)){group=tree.UnitConversions[groupName];this.map(function(atomicUnit){if(group.hasOwnProperty(atomicUnit)&&!result[groupName]){result[groupName]=atomicUnit}return atomicUnit})}}return result},cancel:function(){var counter={},atomicUnit,i,backup;for(i=0;i<this.numerator.length;i++){atomicUnit=this.numerator[i];if(!backup){backup=atomicUnit}counter[atomicUnit]=(counter[atomicUnit]||0)+1}for(i=0;i<this.denominator.length;i++){atomicUnit=this.denominator[i];if(!backup){backup=atomicUnit}counter[atomicUnit]=(counter[atomicUnit]||0)-1}this.numerator=[];this.denominator=[];for(atomicUnit in counter){if(counter.hasOwnProperty(atomicUnit)){var count=counter[atomicUnit];if(count>0){for(i=0;i<count;i++){this.numerator.push(atomicUnit)}}else if(count<0){for(i=0;i<-count;i++){this.denominator.push(atomicUnit)}}}}if(this.numerator.length===0&&this.denominator.length===0&&backup){this.backupUnit=backup}this.numerator.sort();this.denominator.sort()}}})(require("../tree"));(function(tree){tree.Directive=function(name,value){this.name=name;if(Array.isArray(value)){this.ruleset=new tree.Ruleset([],value);this.ruleset.allowImports=true}else{this.value=value}};tree.Directive.prototype={type:"Directive",accept:function(visitor){this.ruleset=visitor.visit(this.ruleset);this.value=visitor.visit(this.value)},toCSS:function(env){if(this.ruleset){this.ruleset.root=true;return this.name+(env.compress?"{":" {\n ")+this.ruleset.toCSS(env).trim().replace(/\n/g,"\n ")+(env.compress?"}":"\n}\n")}else{return this.name+" "+this.value.toCSS()+";\n"}},eval:function(env){var evaldDirective=this;if(this.ruleset){env.frames.unshift(this);evaldDirective=new tree.Directive(this.name);evaldDirective.ruleset=this.ruleset.eval(env);env.frames.shift()}return evaldDirective},variable:function(name){return tree.Ruleset.prototype.variable.call(this.ruleset,name)},find:function(){return tree.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return tree.Ruleset.prototype.rulesets.apply(this.ruleset)}}})(require("../tree"));(function(tree){tree.Element=function(combinator,value,index){this.combinator=combinator instanceof tree.Combinator?combinator:new tree.Combinator(combinator);if(typeof value==="string"){this.value=value.trim()}else if(value){this.value=value}else{this.value=""}this.index=index};tree.Element.prototype={type:"Element",accept:function(visitor){this.combinator=visitor.visit(this.combinator);this.value=visitor.visit(this.value)},eval:function(env){return new tree.Element(this.combinator,this.value.eval?this.value.eval(env):this.value,this.index)},toCSS:function(env){var value=this.value.toCSS?this.value.toCSS(env):this.value;if(value==""&&this.combinator.value.charAt(0)=="&"){return""}else{return this.combinator.toCSS(env||{})+value}}};tree.Attribute=function(key,op,value){this.key=key;this.op=op;this.value=value};tree.Attribute.prototype={type:"Attribute",accept:function(visitor){this.value=visitor.visit(this.value)},eval:function(env){return new tree.Attribute(this.key.eval?this.key.eval(env):this.key,this.op,this.value&&this.value.eval?this.value.eval(env):this.value)},toCSS:function(env){var value=this.key.toCSS?this.key.toCSS(env):this.key;if(this.op){value+=this.op;value+=this.value.toCSS?this.value.toCSS(env):this.value}return"["+value+"]"}};tree.Combinator=function(value){if(value===" "){this.value=" "}else{this.value=value?value.trim():""}};tree.Combinator.prototype={type:"Combinator",toCSS:function(env){return{"":""," ":" ",":":" :","+":env.compress?"+":" + ","~":env.compress?"~":" ~ ",">":env.compress?">":" > ","|":env.compress?"|":" | "}[this.value]}}})(require("../tree"));(function(tree){tree.Expression=function(value){this.value=value};tree.Expression.prototype={type:"Expression",accept:function(visitor){this.value=visitor.visit(this.value)},eval:function(env){var returnValue,inParenthesis=this.parens&&!this.parensInOp,doubleParen=false;if(inParenthesis){env.inParenthesis()}if(this.value.length>1){returnValue=new tree.Expression(this.value.map(function(e){return e.eval(env)}))}else if(this.value.length===1){if(this.value[0].parens&&!this.value[0].parensInOp){doubleParen=true}returnValue=this.value[0].eval(env)}else{returnValue=this}if(inParenthesis){env.outOfParenthesis()}if(this.parens&&this.parensInOp&&!env.isMathsOn()&&!doubleParen){returnValue=new tree.Paren(returnValue)}return returnValue},toCSS:function(env){return this.value.map(function(e){return e.toCSS?e.toCSS(env):""}).join(" ")},throwAwayComments:function(){this.value=this.value.filter(function(v){return!(v instanceof tree.Comment)})}}})(require("../tree"));(function(tree){tree.Extend=function Extend(selector,option,index){this.selector=selector;this.option=option;this.index=index;switch(option){case"all":this.allowBefore=true;this.allowAfter=true;break;default:this.allowBefore=false;this.allowAfter=false;break}};tree.Extend.prototype={type:"Extend",accept:function(visitor){this.selector=visitor.visit(this.selector)},eval:function(env){return new tree.Extend(this.selector.eval(env),this.option,this.index)},clone:function(env){return new tree.Extend(this.selector,this.option,this.index)},findSelfSelectors:function(selectors){var selfElements=[];for(i=0;i<selectors.length;i++){selfElements=selfElements.concat(selectors[i].elements)}this.selfSelectors=[{elements:selfElements}]}}})(require("../tree"));(function(tree){tree.Import=function(path,features,options,index,currentFileInfo){var that=this;this.options=options;this.index=index;this.path=path;this.features=features;this.currentFileInfo=currentFileInfo;if(this.options.less!==undefined){this.css=!this.options.less}else{var pathValue=this.getPath();if(pathValue&&/css([\?;].*)?$/.test(pathValue)){this.css=true}}};tree.Import.prototype={type:"Import",accept:function(visitor){this.features=visitor.visit(this.features);this.path=visitor.visit(this.path);this.root=visitor.visit(this.root)},toCSS:function(env){var features=this.features?" "+this.features.toCSS(env):"";if(this.css){return"@import "+this.path.toCSS()+features+";\n"}else{return""}},getPath:function(){if(this.path instanceof tree.Quoted){var path=this.path.value;return this.css!==undefined||/(\.[a-z]*$)|([\?;].*)$/.test(path)?path:path+".less"}else if(this.path instanceof tree.URL){return this.path.value.value}return null},evalForImport:function(env){return new tree.Import(this.path.eval(env),this.features,this.options,this.index,this.currentFileInfo)},evalPath:function(env){var path=this.path.eval(env);var rootpath=this.currentFileInfo&&this.currentFileInfo.rootpath;if(rootpath&&!(path instanceof tree.URL)){var pathValue=path.value;if(pathValue&&env.isPathRelative(pathValue)){path.value=rootpath+pathValue}}return path},eval:function(env){var ruleset,features=this.features&&this.features.eval(env);if(this.skip){return[]}if(this.css){var newImport=new tree.Import(this.evalPath(env),features,this.options,this.index);if(!newImport.css&&this.error){throw this.error}return newImport}else{ruleset=new tree.Ruleset([],this.root.rules.slice(0));ruleset.evalImports(env);return this.features?new tree.Media(ruleset.rules,this.features.value):ruleset.rules}}}})(require("../tree"));(function(tree){tree.JavaScript=function(string,index,escaped){this.escaped=escaped;this.expression=string;this.index=index};tree.JavaScript.prototype={type:"JavaScript",eval:function(env){var result,that=this,context={};var expression=this.expression.replace(/@\{([\w-]+)\}/g,function(_,name){return tree.jsify(new tree.Variable("@"+name,that.index).eval(env))});try{expression=new Function("return ("+expression+")")}catch(e){throw{message:"JavaScript evaluation error: `"+expression+"`",index:this.index}}for(var k in env.frames[0].variables()){context[k.slice(1)]={value:env.frames[0].variables()[k].value,toJS:function(){return this.value.eval(env).toCSS()}}}try{result=expression.call(context)}catch(e){throw{message:"JavaScript evaluation error: '"+e.name+": "+e.message+"'",index:this.index}}if(typeof result==="string"){return new tree.Quoted('"'+result+'"',result,this.escaped,this.index)}else if(Array.isArray(result)){return new tree.Anonymous(result.join(", "))}else{return new tree.Anonymous(result)}}}})(require("../tree"));(function(tree){tree.Keyword=function(value){this.value=value};tree.Keyword.prototype={type:"Keyword",eval:function(){return this},toCSS:function(){return this.value},compare:function(other){if(other instanceof tree.Keyword){return other.value===this.value?0:1}else{return-1}}};tree.True=new tree.Keyword("true");tree.False=new tree.Keyword("false")})(require("../tree"));(function(tree){tree.Media=function(value,features){var selectors=this.emptySelectors();this.features=new tree.Value(features);this.ruleset=new tree.Ruleset(selectors,value);this.ruleset.allowImports=true};tree.Media.prototype={type:"Media",accept:function(visitor){this.features=visitor.visit(this.features);this.ruleset=visitor.visit(this.ruleset)},toCSS:function(env){var features=this.features.toCSS(env);return"@media "+features+(env.compress?"{":" {\n ")+this.ruleset.toCSS(env).trim().replace(/\n/g,"\n ")+(env.compress?"}":"\n}\n")},eval:function(env){if(!env.mediaBlocks){env.mediaBlocks=[];env.mediaPath=[]}var media=new tree.Media([],[]);if(this.debugInfo){this.ruleset.debugInfo=this.debugInfo;media.debugInfo=this.debugInfo}var strictMathsBypass=false;if(env.strictMaths===false){strictMathsBypass=true;env.strictMaths=true}try{media.features=this.features.eval(env)}finally{if(strictMathsBypass){env.strictMaths=false}}env.mediaPath.push(media);env.mediaBlocks.push(media);env.frames.unshift(this.ruleset);media.ruleset=this.ruleset.eval(env);env.frames.shift();env.mediaPath.pop();return env.mediaPath.length===0?media.evalTop(env):media.evalNested(env)},variable:function(name){return tree.Ruleset.prototype.variable.call(this.ruleset,name)},find:function(){return tree.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return tree.Ruleset.prototype.rulesets.apply(this.ruleset)},emptySelectors:function(){var el=new tree.Element("","&",0);return[new tree.Selector([el])]},evalTop:function(env){var result=this;if(env.mediaBlocks.length>1){var selectors=this.emptySelectors();result=new tree.Ruleset(selectors,env.mediaBlocks);result.multiMedia=true}delete env.mediaBlocks;delete env.mediaPath;return result},evalNested:function(env){var i,value,path=env.mediaPath.concat([this]);for(i=0;i<path.length;i++){value=path[i].features instanceof tree.Value?path[i].features.value:path[i].features;path[i]=Array.isArray(value)?value:[value]}this.features=new tree.Value(this.permute(path).map(function(path){path=path.map(function(fragment){return fragment.toCSS?fragment:new tree.Anonymous(fragment)});for(i=path.length-1;i>0;i--){path.splice(i,0,new tree.Anonymous("and"))}return new tree.Expression(path)}));return new tree.Ruleset([],[])},permute:function(arr){if(arr.length===0){return[]}else if(arr.length===1){return arr[0]}else{var result=[];var rest=this.permute(arr.slice(1));for(var i=0;i<rest.length;i++){for(var j=0;j<arr[0].length;j++){result.push([arr[0][j]].concat(rest[i]))}}return result}},bubbleSelectors:function(selectors){this.ruleset=new tree.Ruleset(selectors.slice(0),[this.ruleset])}}})(require("../tree"));(function(tree){tree.mixin={};tree.mixin.Call=function(elements,args,index,currentFileInfo,important){this.selector=new tree.Selector(elements);this.arguments=args;this.index=index;this.currentFileInfo=currentFileInfo;this.important=important};tree.mixin.Call.prototype={type:"MixinCall",accept:function(visitor){this.selector=visitor.visit(this.selector);this.arguments=visitor.visit(this.arguments)},eval:function(env){var mixins,mixin,args,rules=[],match=false,i,m,f,isRecursive,isOneFound;args=this.arguments&&this.arguments.map(function(a){return{name:a.name,value:a.value.eval(env)}});for(i=0;i<env.frames.length;i++){if((mixins=env.frames[i].find(this.selector)).length>0){isOneFound=true;for(m=0;m<mixins.length;m++){mixin=mixins[m];isRecursive=false;for(f=0;f<env.frames.length;f++){if(!(mixin instanceof tree.mixin.Definition)&&mixin===(env.frames[f].originalRuleset||env.frames[f])){isRecursive=true;break}}if(isRecursive){continue}if(mixin.matchArgs(args,env)){if(!mixin.matchCondition||mixin.matchCondition(args,env)){try{Array.prototype.push.apply(rules,mixin.eval(env,args,this.important).rules)}catch(e){throw{message:e.message,index:this.index,filename:this.currentFileInfo.filename,stack:e.stack}}}match=true}}if(match){return rules}}}if(isOneFound){throw{type:"Runtime",message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+(args?args.map(function(a){var argValue="";if(a.name){argValue+=a.name+":"}if(a.value.toCSS){argValue+=a.value.toCSS()}else{argValue+="???"}return argValue}).join(", "):"")+")`",index:this.index,filename:this.currentFileInfo.filename}}else{throw{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}}}};tree.mixin.Definition=function(name,params,rules,condition,variadic){this.name=name;this.selectors=[new tree.Selector([new tree.Element(null,name)])];this.params=params;this.condition=condition;this.variadic=variadic;this.arity=params.length;this.rules=rules;this._lookups={};this.required=params.reduce(function(count,p){if(!p.name||p.name&&!p.value){return count+1}else{return count}},0);this.parent=tree.Ruleset.prototype;this.frames=[]};tree.mixin.Definition.prototype={type:"MixinDefinition",accept:function(visitor){this.params=visitor.visit(this.params);this.rules=visitor.visit(this.rules);this.condition=visitor.visit(this.condition)},toCSS:function(){return""},variable:function(name){return this.parent.variable.call(this,name)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},evalParams:function(env,mixinEnv,args,evaldArguments){var frame=new tree.Ruleset(null,[]),varargs,arg,params=this.params.slice(0),i,j,val,name,isNamedFound,argIndex;mixinEnv=new tree.evalEnv(mixinEnv,[frame].concat(mixinEnv.frames));if(args){args=args.slice(0);for(i=0;i<args.length;i++){arg=args[i];if(name=arg&&arg.name){isNamedFound=false;for(j=0;j<params.length;j++){if(!evaldArguments[j]&&name===params[j].name){evaldArguments[j]=arg.value.eval(env);frame.rules.unshift(new tree.Rule(name,arg.value.eval(env)));isNamedFound=true;break}}if(isNamedFound){args.splice(i,1);i--;continue}else{throw{type:"Runtime",message:"Named argument for "+this.name+" "+args[i].name+" not found"}}}}}argIndex=0;for(i=0;i<params.length;i++){if(evaldArguments[i])continue;arg=args&&args[argIndex];if(name=params[i].name){if(params[i].variadic&&args){varargs=[];for(j=argIndex;j<args.length;j++){varargs.push(args[j].value.eval(env))}frame.rules.unshift(new tree.Rule(name,new tree.Expression(varargs).eval(env)))}else{val=arg&&arg.value;if(val){val=val.eval(env)}else if(params[i].value){val=params[i].value.eval(mixinEnv);frame.resetCache()}else{throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+args.length+" for "+this.arity+")"}}frame.rules.unshift(new tree.Rule(name,val));evaldArguments[i]=val}}if(params[i].variadic&&args){for(j=argIndex;j<args.length;j++){evaldArguments[j]=args[j].value.eval(env)}}argIndex++}return frame},eval:function(env,args,important){var _arguments=[],mixinFrames=this.frames.concat(env.frames),frame=this.evalParams(env,new tree.evalEnv(env,mixinFrames),args,_arguments),context,rules,start,ruleset;frame.rules.unshift(new tree.Rule("@arguments",new tree.Expression(_arguments).eval(env)));rules=important?this.parent.makeImportant.apply(this).rules:this.rules.slice(0);ruleset=new tree.Ruleset(null,rules).eval(new tree.evalEnv(env,[this,frame].concat(mixinFrames)));ruleset.originalRuleset=this;return ruleset},matchCondition:function(args,env){if(this.condition&&!this.condition.eval(new tree.evalEnv(env,[this.evalParams(env,new tree.evalEnv(env,this.frames.concat(env.frames)),args,[])].concat(env.frames)))){return false}return true},matchArgs:function(args,env){var argsLength=args&&args.length||0,len,frame;if(!this.variadic){if(argsLength<this.required){return false}if(argsLength>this.params.length){return false}if(this.required>0&&argsLength>this.params.length){return false}}len=Math.min(argsLength,this.arity);for(var i=0;i<len;i++){if(!this.params[i].name&&!this.params[i].variadic){if(args[i].value.eval(env).toCSS()!=this.params[i].value.eval(env).toCSS()){return false}}}return true}}})(require("../tree"));(function(tree){tree.Negative=function(node){this.value=node};tree.Negative.prototype={type:"Negative",accept:function(visitor){this.value=visitor.visit(this.value)},toCSS:function(env){return"-"+this.value.toCSS(env)},eval:function(env){if(env.isMathsOn()){return new tree.Operation("*",[new tree.Dimension(-1),this.value]).eval(env)}return new tree.Negative(this.value.eval(env))}}})(require("../tree"));(function(tree){tree.Operation=function(op,operands,isSpaced){this.op=op.trim();this.operands=operands;this.isSpaced=isSpaced};tree.Operation.prototype={type:"Operation",accept:function(visitor){this.operands=visitor.visit(this.operands)
3
- },eval:function(env){var a=this.operands[0].eval(env),b=this.operands[1].eval(env),temp;if(env.isMathsOn()){if(a instanceof tree.Dimension&&b instanceof tree.Color){if(this.op==="*"||this.op==="+"){temp=b,b=a,a=temp}else{throw{type:"Operation",message:"Can't substract or divide a color from a number"}}}if(!a.operate){throw{type:"Operation",message:"Operation on an invalid type"}}return a.operate(env,this.op,b)}else{return new tree.Operation(this.op,[a,b],this.isSpaced)}},toCSS:function(env){var separator=this.isSpaced?" ":"";return this.operands[0].toCSS()+separator+this.op+separator+this.operands[1].toCSS()}};tree.operate=function(env,op,a,b){switch(op){case"+":return a+b;case"-":return a-b;case"*":return a*b;case"/":return a/b}}})(require("../tree"));(function(tree){tree.Paren=function(node){this.value=node};tree.Paren.prototype={type:"Paren",accept:function(visitor){this.value=visitor.visit(this.value)},toCSS:function(env){return"("+this.value.toCSS(env).trim()+")"},eval:function(env){return new tree.Paren(this.value.eval(env))}}})(require("../tree"));(function(tree){tree.Quoted=function(str,content,escaped,index,currentFileInfo){this.escaped=escaped;this.value=content||"";this.quote=str.charAt(0);this.index=index;this.currentFileInfo=currentFileInfo};tree.Quoted.prototype={type:"Quoted",toCSS:function(){if(this.escaped){return this.value}else{return this.quote+this.value+this.quote}},eval:function(env){var that=this;var value=this.value.replace(/`([^`]+)`/g,function(_,exp){return new tree.JavaScript(exp,that.index,true).eval(env).value}).replace(/@\{([\w-]+)\}/g,function(_,name){var v=new tree.Variable("@"+name,that.index,that.currentFileInfo).eval(env,true);return v instanceof tree.Quoted?v.value:v.toCSS()});return new tree.Quoted(this.quote+value+this.quote,value,this.escaped,this.index)},compare:function(x){if(!x.toCSS){return-1}var left=this.toCSS(),right=x.toCSS();if(left===right){return 0}return left<right?-1:1}}})(require("../tree"));(function(tree){tree.Rule=function(name,value,important,index,currentFileInfo,inline){this.name=name;this.value=value instanceof tree.Value?value:new tree.Value([value]);this.important=important?" "+important.trim():"";this.index=index;this.currentFileInfo=currentFileInfo;this.inline=inline||false;if(name.charAt(0)==="@"){this.variable=true}else{this.variable=false}};tree.Rule.prototype={type:"Rule",accept:function(visitor){this.value=visitor.visit(this.value)},toCSS:function(env){if(this.variable){return""}else{try{return this.name+(env.compress?":":": ")+this.value.toCSS(env)+this.important+(this.inline?"":";")}catch(e){e.index=this.index;e.filename=this.currentFileInfo.filename;throw e}}},eval:function(env){var strictMathsBypass=false;if(this.name==="font"&&env.strictMaths===false){strictMathsBypass=true;env.strictMaths=true}try{return new tree.Rule(this.name,this.value.eval(env),this.important,this.index,this.currentFileInfo,this.inline)}finally{if(strictMathsBypass){env.strictMaths=false}}},makeImportant:function(){return new tree.Rule(this.name,this.value,"!important",this.index,this.currentFileInfo,this.inline)}}})(require("../tree"));(function(tree){tree.Ruleset=function(selectors,rules,strictImports){this.selectors=selectors;this.rules=rules;this._lookups={};this.strictImports=strictImports};tree.Ruleset.prototype={type:"Ruleset",accept:function(visitor){this.selectors=visitor.visit(this.selectors);this.rules=visitor.visit(this.rules)},eval:function(env){var selectors=this.selectors&&this.selectors.map(function(s){return s.eval(env)});var ruleset=new tree.Ruleset(selectors,this.rules.slice(0),this.strictImports);var rules;ruleset.originalRuleset=this;ruleset.root=this.root;ruleset.firstRoot=this.firstRoot;ruleset.allowImports=this.allowImports;if(this.debugInfo){ruleset.debugInfo=this.debugInfo}env.frames.unshift(ruleset);if(!env.selectors){env.selectors=[]}env.selectors.unshift(this.selectors);if(ruleset.root||ruleset.allowImports||!ruleset.strictImports){ruleset.evalImports(env)}for(var i=0;i<ruleset.rules.length;i++){if(ruleset.rules[i]instanceof tree.mixin.Definition){ruleset.rules[i].frames=env.frames.slice(0)}}var mediaBlockCount=env.mediaBlocks&&env.mediaBlocks.length||0;for(var i=0;i<ruleset.rules.length;i++){if(ruleset.rules[i]instanceof tree.mixin.Call){rules=ruleset.rules[i].eval(env).filter(function(r){if(r instanceof tree.Rule&&r.variable){return!ruleset.variable(r.name)}return true});ruleset.rules.splice.apply(ruleset.rules,[i,1].concat(rules));i+=rules.length-1;ruleset.resetCache()}}for(var i=0,rule;i<ruleset.rules.length;i++){rule=ruleset.rules[i];if(!(rule instanceof tree.mixin.Definition)){ruleset.rules[i]=rule.eval?rule.eval(env):rule}}env.frames.shift();env.selectors.shift();if(env.mediaBlocks){for(var i=mediaBlockCount;i<env.mediaBlocks.length;i++){env.mediaBlocks[i].bubbleSelectors(selectors)}}return ruleset},evalImports:function(env){var i,rules;for(i=0;i<this.rules.length;i++){if(this.rules[i]instanceof tree.Import){rules=this.rules[i].eval(env);if(typeof rules.length==="number"){this.rules.splice.apply(this.rules,[i,1].concat(rules));i+=rules.length-1}else{this.rules.splice(i,1,rules)}this.resetCache()}}},makeImportant:function(){return new tree.Ruleset(this.selectors,this.rules.map(function(r){if(r.makeImportant){return r.makeImportant()}else{return r}}),this.strictImports)},matchArgs:function(args){return!args||args.length===0},resetCache:function(){this._rulesets=null;this._variables=null;this._lookups={}},variables:function(){if(this._variables){return this._variables}else{return this._variables=this.rules.reduce(function(hash,r){if(r instanceof tree.Rule&&r.variable===true){hash[r.name]=r}return hash},{})}},variable:function(name){return this.variables()[name]},rulesets:function(){return this.rules.filter(function(r){return r instanceof tree.Ruleset||r instanceof tree.mixin.Definition})},find:function(selector,self){self=self||this;var rules=[],rule,match,key=selector.toCSS();if(key in this._lookups){return this._lookups[key]}this.rulesets().forEach(function(rule){if(rule!==self){for(var j=0;j<rule.selectors.length;j++){if(match=selector.match(rule.selectors[j])){if(selector.elements.length>rule.selectors[j].elements.length){Array.prototype.push.apply(rules,rule.find(new tree.Selector(selector.elements.slice(1)),self))}else{rules.push(rule)}break}}}});return this._lookups[key]=rules},toCSS:function(env){var css=[],rules=[],_rules=[],rulesets=[],selector,debugInfo,rule;for(var i=0;i<this.rules.length;i++){rule=this.rules[i];if(rule.rules||rule instanceof tree.Media){rulesets.push(rule.toCSS(env))}else if(rule instanceof tree.Directive){var cssValue=rule.toCSS(env);if(rule.name==="@charset"){if(env.charset){if(rule.debugInfo){rulesets.push(tree.debugInfo(env,rule));rulesets.push(new tree.Comment("/* "+cssValue.replace(/\n/g,"")+" */\n").toCSS(env))}continue}env.charset=true}rulesets.push(cssValue)}else if(rule instanceof tree.Comment){if(!rule.silent){if(this.root){rulesets.push(rule.toCSS(env))}else{rules.push(rule.toCSS(env))}}}else{if(rule.toCSS&&!rule.variable){if(this.firstRoot&&rule instanceof tree.Rule){throw{message:"properties must be inside selector blocks, they cannot be in the root.",index:rule.index,filename:rule.currentFileInfo?rule.currentFileInfo.filename:null}}rules.push(rule.toCSS(env))}else if(rule.value&&!rule.variable){rules.push(rule.value.toString())}}}if(env.compress&&rules.length){rule=rules[rules.length-1];if(rule.charAt(rule.length-1)===";"){rules[rules.length-1]=rule.substring(0,rule.length-1)}}rulesets=rulesets.join("");if(this.root){css.push(rules.join(env.compress?"":"\n"))}else{if(rules.length>0){debugInfo=tree.debugInfo(env,this);selector=this.paths.map(function(p){return p.map(function(s){return s.toCSS(env)}).join("").trim()}).join(env.compress?",":",\n");for(var i=rules.length-1;i>=0;i--){if(rules[i].slice(0,2)==="/*"||_rules.indexOf(rules[i])===-1){_rules.unshift(rules[i])}}rules=_rules;css.push(debugInfo+selector+(env.compress?"{":" {\n ")+rules.join(env.compress?"":"\n ")+(env.compress?"}":"\n}\n"))}}css.push(rulesets);return css.join("")+(env.compress?"\n":"")},joinSelectors:function(paths,context,selectors){for(var s=0;s<selectors.length;s++){this.joinSelector(paths,context,selectors[s])}},joinSelector:function(paths,context,selector){var i,j,k,hasParentSelector,newSelectors,el,sel,parentSel,newSelectorPath,afterParentJoin,newJoinedSelector,newJoinedSelectorEmpty,lastSelector,currentElements,selectorsMultiplied;for(i=0;i<selector.elements.length;i++){el=selector.elements[i];if(el.value==="&"){hasParentSelector=true}}if(!hasParentSelector){if(context.length>0){for(i=0;i<context.length;i++){paths.push(context[i].concat(selector))}}else{paths.push([selector])}return}currentElements=[];newSelectors=[[]];for(i=0;i<selector.elements.length;i++){el=selector.elements[i];if(el.value!=="&"){currentElements.push(el)}else{selectorsMultiplied=[];if(currentElements.length>0){this.mergeElementsOnToSelectors(currentElements,newSelectors)}for(j=0;j<newSelectors.length;j++){sel=newSelectors[j];if(context.length==0){if(sel.length>0){sel[0].elements=sel[0].elements.slice(0);sel[0].elements.push(new tree.Element(el.combinator,"",0))}selectorsMultiplied.push(sel)}else{for(k=0;k<context.length;k++){parentSel=context[k];newSelectorPath=[];afterParentJoin=[];newJoinedSelectorEmpty=true;if(sel.length>0){newSelectorPath=sel.slice(0);lastSelector=newSelectorPath.pop();newJoinedSelector=new tree.Selector(lastSelector.elements.slice(0),selector.extendList);newJoinedSelectorEmpty=false}else{newJoinedSelector=new tree.Selector([],selector.extendList)}if(parentSel.length>1){afterParentJoin=afterParentJoin.concat(parentSel.slice(1))}if(parentSel.length>0){newJoinedSelectorEmpty=false;newJoinedSelector.elements.push(new tree.Element(el.combinator,parentSel[0].elements[0].value,0));newJoinedSelector.elements=newJoinedSelector.elements.concat(parentSel[0].elements.slice(1))}if(!newJoinedSelectorEmpty){newSelectorPath.push(newJoinedSelector)}newSelectorPath=newSelectorPath.concat(afterParentJoin);selectorsMultiplied.push(newSelectorPath)}}}newSelectors=selectorsMultiplied;currentElements=[]}}if(currentElements.length>0){this.mergeElementsOnToSelectors(currentElements,newSelectors)}for(i=0;i<newSelectors.length;i++){if(newSelectors[i].length>0){paths.push(newSelectors[i])}}},mergeElementsOnToSelectors:function(elements,selectors){var i,sel,extendList;if(selectors.length==0){selectors.push([new tree.Selector(elements)]);return}for(i=0;i<selectors.length;i++){sel=selectors[i];if(sel.length>0){sel[sel.length-1]=new tree.Selector(sel[sel.length-1].elements.concat(elements),sel[sel.length-1].extendList)}else{sel.push(new tree.Selector(elements))}}}}})(require("../tree"));(function(tree){tree.Selector=function(elements,extendList){this.elements=elements;this.extendList=extendList||[]};tree.Selector.prototype={type:"Selector",accept:function(visitor){this.elements=visitor.visit(this.elements);this.extendList=visitor.visit(this.extendList)},match:function(other){var elements=this.elements,len=elements.length,oelements,olen,max,i;oelements=other.elements.slice(other.elements.length&&other.elements[0].value==="&"?1:0);olen=oelements.length;max=Math.min(len,olen);if(olen===0||len<olen){return false}else{for(i=0;i<max;i++){if(elements[i].value!==oelements[i].value){return false}}}return true},eval:function(env){return new tree.Selector(this.elements.map(function(e){return e.eval(env)}),this.extendList.map(function(extend){return extend.eval(env)}))},toCSS:function(env){if(this._css){return this._css}if(this.elements[0].combinator.value===""){this._css=" "}else{this._css=""}this._css+=this.elements.map(function(e){if(typeof e==="string"){return" "+e.trim()}else{return e.toCSS(env)}}).join("");return this._css}}})(require("../tree"));(function(tree){tree.UnicodeDescriptor=function(value){this.value=value};tree.UnicodeDescriptor.prototype={type:"UnicodeDescriptor",toCSS:function(env){return this.value},eval:function(){return this}}})(require("../tree"));(function(tree){tree.URL=function(val,currentFileInfo){this.value=val;this.currentFileInfo=currentFileInfo};tree.URL.prototype={type:"Url",accept:function(visitor){this.value=visitor.visit(this.value)},toCSS:function(){return"url("+this.value.toCSS()+")"},eval:function(ctx){var val=this.value.eval(ctx),rootpath;rootpath=this.currentFileInfo&&this.currentFileInfo.rootpath;if(rootpath&&typeof val.value==="string"&&ctx.isPathRelative(val.value)){if(!val.quote){rootpath=rootpath.replace(/[\(\)'"\s]/g,function(match){return"\\"+match})}val.value=rootpath+val.value}return new tree.URL(val,null)}}})(require("../tree"));(function(tree){tree.Value=function(value){this.value=value};tree.Value.prototype={type:"Value",accept:function(visitor){this.value=visitor.visit(this.value)},eval:function(env){if(this.value.length===1){return this.value[0].eval(env)}else{return new tree.Value(this.value.map(function(v){return v.eval(env)}))}},toCSS:function(env){return this.value.map(function(e){return e.toCSS(env)}).join(env.compress?",":", ")}}})(require("../tree"));(function(tree){tree.Variable=function(name,index,currentFileInfo){this.name=name,this.index=index,this.currentFileInfo=currentFileInfo};tree.Variable.prototype={type:"Variable",eval:function(env){var variable,v,name=this.name;if(name.indexOf("@@")==0){name="@"+new tree.Variable(name.slice(1)).eval(env).value}if(this.evaluating){throw{type:"Name",message:"Recursive variable definition for "+name,filename:this.currentFileInfo.file,index:this.index}}this.evaluating=true;if(variable=tree.find(env.frames,function(frame){if(v=frame.variable(name)){return v.value.eval(env)}})){this.evaluating=false;return variable}else{throw{type:"Name",message:"variable "+name+" is undefined",filename:this.currentFileInfo.filename,index:this.index}}}}})(require("../tree"));(function(tree){tree.debugInfo=function(env,ctx){var result="";if(env.dumpLineNumbers&&!env.compress){switch(env.dumpLineNumbers){case"comments":result=tree.debugInfo.asComment(ctx);break;case"mediaquery":result=tree.debugInfo.asMediaQuery(ctx);break;case"all":result=tree.debugInfo.asComment(ctx)+tree.debugInfo.asMediaQuery(ctx);break}}return result};tree.debugInfo.asComment=function(ctx){return"/* line "+ctx.debugInfo.lineNumber+", "+ctx.debugInfo.fileName+" */\n"};tree.debugInfo.asMediaQuery=function(ctx){return"@media -sass-debug-info{filename{font-family:"+("file://"+ctx.debugInfo.fileName).replace(/([.:/\\])/g,function(a){if(a=="\\")a="/";return"\\"+a})+"}line{font-family:\\00003"+ctx.debugInfo.lineNumber+"}}\n"};tree.find=function(obj,fun){for(var i=0,r;i<obj.length;i++){if(r=fun.call(obj,obj[i])){return r}}return null};tree.jsify=function(obj){if(Array.isArray(obj.value)&&obj.value.length>1){return"["+obj.value.map(function(v){return v.toCSS(false)}).join(", ")+"]"}else{return obj.toCSS(false)}}})(require("./tree"));(function(tree){var parseCopyProperties=["paths","optimization","files","contents","relativeUrls","strictImports","dumpLineNumbers","compress","processImports","mime","currentFileInfo"];tree.parseEnv=function(options){copyFromOriginal(options,this,parseCopyProperties);if(!this.contents){this.contents={}}if(!this.files){this.files={}}if(!this.currentFileInfo){var filename=options.filename||"input";options.filename=null;var entryPath=filename.replace(/[^\/\\]*$/,"");this.currentFileInfo={filename:filename,relativeUrls:this.relativeUrls,rootpath:options.rootpath||"",currentDirectory:entryPath,entryPath:entryPath,rootFilename:filename}}};tree.parseEnv.prototype.toSheet=function(path){var env=new tree.parseEnv(this);env.href=path;env.type=this.mime;return env};var evalCopyProperties=["silent","verbose","compress","ieCompat","strictMaths","strictUnits"];tree.evalEnv=function(options,frames){copyFromOriginal(options,this,evalCopyProperties);this.frames=frames||[]};tree.evalEnv.prototype.inParenthesis=function(){if(!this.parensStack){this.parensStack=[]}this.parensStack.push(true)};tree.evalEnv.prototype.outOfParenthesis=function(){this.parensStack.pop()};tree.evalEnv.prototype.isMathsOn=function(){return this.strictMaths===false?true:this.parensStack&&this.parensStack.length};tree.evalEnv.prototype.isPathRelative=function(path){return!/^(?:[a-z-]+:|\/)/.test(path)};var copyFromOriginal=function(original,destination,propertiesToCopy){if(!original){return}for(var i=0;i<propertiesToCopy.length;i++){if(original.hasOwnProperty(propertiesToCopy[i])){destination[propertiesToCopy[i]]=original[propertiesToCopy[i]]}}}})(require("./tree"));(function(tree){tree.visitor=function(implementation){this._implementation=implementation};tree.visitor.prototype={visit:function(node){if(node instanceof Array){return this.visitArray(node)}if(!node||!node.type){return node}var funcName="visit"+node.type,func=this._implementation[funcName],visitArgs,newNode;if(func){visitArgs={visitDeeper:true};newNode=func.call(this._implementation,node,visitArgs);if(this._implementation.isReplacing){node=newNode}}if((!visitArgs||visitArgs.visitDeeper)&&node&&node.accept){node.accept(this)}funcName=funcName+"Out";if(this._implementation[funcName]){this._implementation[funcName](node)}return node},visitArray:function(nodes){var i,newNodes=[];for(i=0;i<nodes.length;i++){var evald=this.visit(nodes[i]);if(evald instanceof Array){newNodes=newNodes.concat(evald)}else{newNodes.push(evald)}}if(this._implementation.isReplacing){return newNodes}return nodes}}})(require("./tree"));(function(tree){tree.importVisitor=function(importer,finish,evalEnv){this._visitor=new tree.visitor(this);this._importer=importer;this._finish=finish;this.env=evalEnv||new tree.evalEnv;this.importCount=0};tree.importVisitor.prototype={isReplacing:true,run:function(root){var error;try{this._visitor.visit(root)}catch(e){error=e}this.isFinished=true;if(this.importCount===0){this._finish(error)}},visitImport:function(importNode,visitArgs){var importVisitor=this,evaldImportNode;if(!importNode.css){try{evaldImportNode=importNode.evalForImport(this.env)}catch(e){if(!e.filename){e.index=importNode.index;e.filename=importNode.currentFileInfo.filename}importNode.css=true;importNode.error=e}if(evaldImportNode&&!evaldImportNode.css){importNode=evaldImportNode;this.importCount++;var env=new tree.evalEnv(this.env,this.env.frames.slice(0));this._importer.push(importNode.getPath(),importNode.currentFileInfo,function(e,root,imported){if(e&&!e.filename){e.index=importNode.index;e.filename=importNode.currentFileInfo.filename}if(imported&&!importNode.options.multiple){importNode.skip=imported}var subFinish=function(e){importVisitor.importCount--;if(importVisitor.importCount===0&&importVisitor.isFinished){importVisitor._finish(e)}};if(root){importNode.root=root;new tree.importVisitor(importVisitor._importer,subFinish,env).run(root)}else{subFinish()}})}}visitArgs.visitDeeper=false;return importNode},visitRule:function(ruleNode,visitArgs){visitArgs.visitDeeper=false;return ruleNode},visitDirective:function(directiveNode,visitArgs){this.env.frames.unshift(directiveNode);return directiveNode},visitDirectiveOut:function(directiveNode){this.env.frames.shift()},visitMixinDefinition:function(mixinDefinitionNode,visitArgs){this.env.frames.unshift(mixinDefinitionNode);return mixinDefinitionNode},visitMixinDefinitionOut:function(mixinDefinitionNode){this.env.frames.shift()},visitRuleset:function(rulesetNode,visitArgs){this.env.frames.unshift(rulesetNode);return rulesetNode},visitRulesetOut:function(rulesetNode){this.env.frames.shift()},visitMedia:function(mediaNode,visitArgs){this.env.frames.unshift(mediaNode.ruleset);return mediaNode},visitMediaOut:function(mediaNode){this.env.frames.shift()}}})(require("./tree"));(function(tree){tree.joinSelectorVisitor=function(){this.contexts=[[]];this._visitor=new tree.visitor(this)};tree.joinSelectorVisitor.prototype={run:function(root){return this._visitor.visit(root)},visitRule:function(ruleNode,visitArgs){visitArgs.visitDeeper=false},visitMixinDefinition:function(mixinDefinitionNode,visitArgs){visitArgs.visitDeeper=false},visitRuleset:function(rulesetNode,visitArgs){var context=this.contexts[this.contexts.length-1];var paths=[];this.contexts.push(paths);if(!rulesetNode.root){rulesetNode.joinSelectors(paths,context,rulesetNode.selectors);rulesetNode.paths=paths}},visitRulesetOut:function(rulesetNode){this.contexts.length=this.contexts.length-1},visitMedia:function(mediaNode,visitArgs){var context=this.contexts[this.contexts.length-1];mediaNode.ruleset.root=context.length===0||context[0].multiMedia}}})(require("./tree"));(function(tree){tree.extendFinderVisitor=function(){this._visitor=new tree.visitor(this);this.contexts=[];this.allExtendsStack=[[]]};tree.extendFinderVisitor.prototype={run:function(root){root=this._visitor.visit(root);root.allExtends=this.allExtendsStack[0];return root},visitRule:function(ruleNode,visitArgs){visitArgs.visitDeeper=false},visitMixinDefinition:function(mixinDefinitionNode,visitArgs){visitArgs.visitDeeper=false},visitRuleset:function(rulesetNode,visitArgs){if(rulesetNode.root){return}var i,j,extend,allSelectorsExtendList=[],extendList;for(i=0;i<rulesetNode.rules.length;i++){if(rulesetNode.rules[i]instanceof tree.Extend){allSelectorsExtendList.push(rulesetNode.rules[i])}}for(i=0;i<rulesetNode.paths.length;i++){var selectorPath=rulesetNode.paths[i],selector=selectorPath[selectorPath.length-1];extendList=selector.extendList.slice(0).concat(allSelectorsExtendList).map(function(allSelectorsExtend){return allSelectorsExtend.clone()});for(j=0;j<extendList.length;j++){this.foundExtends=true;extend=extendList[j];extend.findSelfSelectors(selectorPath);extend.ruleset=rulesetNode;if(j===0){extend.firstExtendOnThisSelectorPath=true}this.allExtendsStack[this.allExtendsStack.length-1].push(extend)}}this.contexts.push(rulesetNode.selectors)},visitRulesetOut:function(rulesetNode){if(!rulesetNode.root){this.contexts.length=this.contexts.length-1}},visitMedia:function(mediaNode,visitArgs){mediaNode.allExtends=[];this.allExtendsStack.push(mediaNode.allExtends)},visitMediaOut:function(mediaNode){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(directiveNode,visitArgs){directiveNode.allExtends=[];this.allExtendsStack.push(directiveNode.allExtends)},visitDirectiveOut:function(directiveNode){this.allExtendsStack.length=this.allExtendsStack.length-1}};tree.processExtendsVisitor=function(){this._visitor=new tree.visitor(this)};tree.processExtendsVisitor.prototype={run:function(root){var extendFinder=new tree.extendFinderVisitor;extendFinder.run(root);if(!extendFinder.foundExtends){return root}root.allExtends=root.allExtends.concat(this.doExtendChaining(root.allExtends,root.allExtends));this.allExtendsStack=[root.allExtends];return this._visitor.visit(root)},doExtendChaining:function(extendsList,extendsListTarget,iterationCount){var extendIndex,targetExtendIndex,matches,extendsToAdd=[],newSelector,extendVisitor=this,selectorPath,extend,targetExtend;iterationCount=iterationCount||0;for(extendIndex=0;extendIndex<extendsList.length;extendIndex++){for(targetExtendIndex=0;targetExtendIndex<extendsListTarget.length;targetExtendIndex++){extend=extendsList[extendIndex];targetExtend=extendsListTarget[targetExtendIndex];if(this.inInheritanceChain(targetExtend,extend)){continue}selectorPath=[targetExtend.selfSelectors[0]];matches=extendVisitor.findMatch(extend,selectorPath);if(matches.length){extend.selfSelectors.forEach(function(selfSelector){newSelector=extendVisitor.extendSelector(matches,selectorPath,selfSelector);newExtend=new tree.Extend(targetExtend.selector,targetExtend.option,0);newExtend.selfSelectors=newSelector;newSelector[newSelector.length-1].extendList=[newExtend];extendsToAdd.push(newExtend);newExtend.ruleset=targetExtend.ruleset;newExtend.parents=[targetExtend,extend];if(targetExtend.firstExtendOnThisSelectorPath){newExtend.firstExtendOnThisSelectorPath=true;targetExtend.ruleset.paths.push(newSelector)}})}}}if(extendsToAdd.length){this.extendChainCount++;if(iterationCount>100){var selectorOne="{unable to calculate}";var selectorTwo="{unable to calculate}";try{selectorOne=extendsToAdd[0].selfSelectors[0].toCSS();selectorTwo=extendsToAdd[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+selectorOne+":extend("+selectorTwo+")"}}return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd,extendsListTarget,iterationCount+1))}else{return extendsToAdd}},inInheritanceChain:function(possibleParent,possibleChild){if(possibleParent===possibleChild){return true}if(possibleChild.parents){if(this.inInheritanceChain(possibleParent,possibleChild.parents[0])){return true}if(this.inInheritanceChain(possibleParent,possibleChild.parents[1])){return true}}return false},visitRule:function(ruleNode,visitArgs){visitArgs.visitDeeper=false},visitMixinDefinition:function(mixinDefinitionNode,visitArgs){visitArgs.visitDeeper=false},visitSelector:function(selectorNode,visitArgs){visitArgs.visitDeeper=false},visitRuleset:function(rulesetNode,visitArgs){if(rulesetNode.root){return}var matches,pathIndex,extendIndex,allExtends=this.allExtendsStack[this.allExtendsStack.length-1],selectorsToAdd=[],extendVisitor=this;for(extendIndex=0;extendIndex<allExtends.length;extendIndex++){for(pathIndex=0;pathIndex<rulesetNode.paths.length;pathIndex++){selectorPath=rulesetNode.paths[pathIndex];if(selectorPath[selectorPath.length-1].extendList.length){continue}matches=this.findMatch(allExtends[extendIndex],selectorPath);if(matches.length){allExtends[extendIndex].selfSelectors.forEach(function(selfSelector){selectorsToAdd.push(extendVisitor.extendSelector(matches,selectorPath,selfSelector))})}}}rulesetNode.paths=rulesetNode.paths.concat(selectorsToAdd)},findMatch:function(extend,haystackSelectorPath){var haystackSelectorIndex,hackstackSelector,hackstackElementIndex,haystackElement,targetCombinator,i,extendVisitor=this,needleElements=extend.selector.elements,potentialMatches=[],potentialMatch,matches=[];for(haystackSelectorIndex=0;haystackSelectorIndex<haystackSelectorPath.length;haystackSelectorIndex++){hackstackSelector=haystackSelectorPath[haystackSelectorIndex];for(hackstackElementIndex=0;hackstackElementIndex<hackstackSelector.elements.length;hackstackElementIndex++){haystackElement=hackstackSelector.elements[hackstackElementIndex];if(extend.allowBefore||haystackSelectorIndex==0&&hackstackElementIndex==0){potentialMatches.push({pathIndex:haystackSelectorIndex,index:hackstackElementIndex,matched:0,initialCombinator:haystackElement.combinator})}for(i=0;i<potentialMatches.length;i++){potentialMatch=potentialMatches[i];targetCombinator=haystackElement.combinator.value;if(targetCombinator==""&&hackstackElementIndex===0){targetCombinator=" "}if(!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value,haystackElement.value)||potentialMatch.matched>0&&needleElements[potentialMatch.matched].combinator.value!==targetCombinator){potentialMatch=null}else{potentialMatch.matched++}if(potentialMatch){potentialMatch.finished=potentialMatch.matched===needleElements.length;if(potentialMatch.finished&&!extend.allowAfter&&(hackstackElementIndex+1<hackstackSelector.elements.length||haystackSelectorIndex+1<haystackSelectorPath.length)){potentialMatch=null}}if(potentialMatch){if(potentialMatch.finished){potentialMatch.length=needleElements.length;potentialMatch.endPathIndex=haystackSelectorIndex;potentialMatch.endPathElementIndex=hackstackElementIndex+1;potentialMatches.length=0;matches.push(potentialMatch)}}else{potentialMatches.splice(i,1);i--}}}}return matches},isElementValuesEqual:function(elementValue1,elementValue2){if(typeof elementValue1==="string"||typeof elementValue2==="string"){return elementValue1===elementValue2}if(elementValue1 instanceof tree.Attribute){if(elementValue1.op!==elementValue2.op||elementValue1.key!==elementValue2.key){return false}if(!elementValue1.value||!elementValue2.value){if(elementValue1.value||elementValue2.value){return false}return true}elementValue1=elementValue1.value.value||elementValue1.value;elementValue2=elementValue2.value.value||elementValue2.value;return elementValue1===elementValue2}return false},extendSelector:function(matches,selectorPath,replacementSelector){var currentSelectorPathIndex=0,currentSelectorPathElementIndex=0,path=[],matchIndex,selector,firstElement;for(matchIndex=0;matchIndex<matches.length;matchIndex++){match=matches[matchIndex];selector=selectorPath[match.pathIndex];firstElement=new tree.Element(match.initialCombinator,replacementSelector.elements[0].value,replacementSelector.elements[0].index);if(match.pathIndex>currentSelectorPathIndex&&currentSelectorPathElementIndex>0){path[path.length-1].elements=path[path.length-1].elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));currentSelectorPathElementIndex=0;currentSelectorPathIndex++}path=path.concat(selectorPath.slice(currentSelectorPathIndex,match.pathIndex));path.push(new tree.Selector(selector.elements.slice(currentSelectorPathElementIndex,match.index).concat([firstElement]).concat(replacementSelector.elements.slice(1))));currentSelectorPathIndex=match.endPathIndex;currentSelectorPathElementIndex=match.endPathElementIndex;if(currentSelectorPathElementIndex>=selector.elements.length){currentSelectorPathElementIndex=0;currentSelectorPathIndex++}}if(currentSelectorPathIndex<selectorPath.length&&currentSelectorPathElementIndex>0){path[path.length-1].elements=path[path.length-1].elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));currentSelectorPathElementIndex=0;currentSelectorPathIndex++}path=path.concat(selectorPath.slice(currentSelectorPathIndex,selectorPath.length));return path},visitRulesetOut:function(rulesetNode){},visitMedia:function(mediaNode,visitArgs){var newAllExtends=mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);newAllExtends=newAllExtends.concat(this.doExtendChaining(newAllExtends,mediaNode.allExtends));this.allExtendsStack.push(newAllExtends)},visitMediaOut:function(mediaNode){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(directiveNode,visitArgs){var newAllExtends=directiveNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);newAllExtends=newAllExtends.concat(this.doExtendChaining(newAllExtends,directiveNode.allExtends));this.allExtendsStack.push(newAllExtends)},visitDirectiveOut:function(directiveNode){this.allExtendsStack.length=this.allExtendsStack.length-1}}})(require("./tree"));var isFileProtocol=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);less.env=less.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||isFileProtocol?"development":"production");less.async=less.async||false;less.fileAsync=less.fileAsync||false;less.poll=less.poll||(isFileProtocol?1e3:1500);if(less.functions){for(var func in less.functions){less.tree.functions[func]=less.functions[func]}}var dumpLineNumbers=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);if(dumpLineNumbers){less.dumpLineNumbers=dumpLineNumbers[1]}less.watch=function(){if(!less.watchMode){less.env="development";initRunningMode()}return this.watchMode=true};less.unwatch=function(){clearInterval(less.watchTimer);return this.watchMode=false};function initRunningMode(){if(less.env==="development"){less.optimization=0;less.watchTimer=setInterval(function(){if(less.watchMode){loadStyleSheets(function(e,root,_,sheet,env){if(e){error(e,sheet.href)}else if(root){createCSS(root.toCSS(less),sheet,env.lastModified)}})}},less.poll)}else{less.optimization=3}}if(/!watch/.test(location.hash)){less.watch()}var cache=null;if(less.env!="development"){try{cache=typeof window.localStorage==="undefined"?null:window.localStorage}catch(_){}}var links=document.getElementsByTagName("link");var typePattern=/^text\/(x-)?less$/;
4
- less.sheets=[];for(var i=0;i<links.length;i++){if(links[i].rel==="stylesheet/less"||links[i].rel.match(/stylesheet/)&&links[i].type.match(typePattern)){less.sheets.push(links[i])}}var session_cache="";less.modifyVars=function(record){var str=session_cache;for(name in record){str+=(name.slice(0,1)==="@"?"":"@")+name+": "+(record[name].slice(-1)===";"?record[name]:record[name]+";")}new less.Parser(new less.tree.parseEnv(less)).parse(str,function(e,root){if(e){error(e,"session_cache")}else{createCSS(root.toCSS(less),less.sheets[less.sheets.length-1])}})};less.refresh=function(reload){var startTime,endTime;startTime=endTime=new Date;loadStyleSheets(function(e,root,_,sheet,env){if(e){return error(e,sheet.href)}if(env.local){log("loading "+sheet.href+" from cache.")}else{log("parsed "+sheet.href+" successfully.");createCSS(root.toCSS(less),sheet,env.lastModified)}log("css for "+sheet.href+" generated in "+(new Date-endTime)+"ms");env.remaining===0&&log("css generated in "+(new Date-startTime)+"ms");endTime=new Date},reload);loadStyles()};less.refreshStyles=loadStyles;less.refresh(less.env==="development");function loadStyles(){var styles=document.getElementsByTagName("style");for(var i=0;i<styles.length;i++){if(styles[i].type.match(typePattern)){var env=new less.tree.parseEnv(less);env.filename=document.location.href.replace(/#.*$/,"");new less.Parser(env).parse(styles[i].innerHTML||"",function(e,cssAST){if(e){return error(e,"inline")}var css=cssAST.toCSS(less);var style=styles[i];style.type="text/css";if(style.styleSheet){style.styleSheet.cssText=css}else{style.innerHTML=css}})}}}function loadStyleSheets(callback,reload){for(var i=0;i<less.sheets.length;i++){loadStyleSheet(less.sheets[i],callback,reload,less.sheets.length-(i+1))}}function pathDiff(url,baseUrl){var urlParts=extractUrlParts(url),baseUrlParts=extractUrlParts(baseUrl),i,max,urlDirectories,baseUrlDirectories,diff="";if(urlParts.hostPart!==baseUrlParts.hostPart){return""}max=Math.max(baseUrlParts.directories.length,urlParts.directories.length);for(i=0;i<max;i++){if(baseUrlParts.directories[i]!==urlParts.directories[i]){break}}baseUrlDirectories=baseUrlParts.directories.slice(i);urlDirectories=urlParts.directories.slice(i);for(i=0;i<baseUrlDirectories.length-1;i++){diff+="../"}for(i=0;i<urlDirectories.length-1;i++){diff+=urlDirectories[i]+"/"}return diff}function extractUrlParts(url,baseUrl){var urlPartsRegex=/^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/,urlParts=url.match(urlPartsRegex),returner={},directories=[],i,baseUrlParts;if(!urlParts){throw new Error("Could not parse sheet href - '"+url+"'")}if(!urlParts[1]||urlParts[2]){baseUrlParts=baseUrl.match(urlPartsRegex);if(!baseUrlParts){throw new Error("Could not parse page url - '"+baseUrl+"'")}urlParts[1]=urlParts[1]||baseUrlParts[1]||"";if(!urlParts[2]){urlParts[3]=baseUrlParts[3]+urlParts[3]}}if(urlParts[3]){directories=urlParts[3].replace("\\","/").split("/");for(i=0;i<directories.length;i++){if(directories[i]==="."){directories.splice(i,1);i-=1}}for(i=0;i<directories.length;i++){if(directories[i]===".."&&i>0){directories.splice(i-1,2);i-=2}}}returner.hostPart=urlParts[1];returner.directories=directories;returner.path=urlParts[1]+directories.join("/");returner.fileUrl=returner.path+(urlParts[4]||"");returner.url=returner.fileUrl+(urlParts[5]||"");return returner}function loadStyleSheet(sheet,callback,reload,remaining){var hrefParts=extractUrlParts(sheet.href,window.location.href);var href=hrefParts.url;var css=cache&&cache.getItem(href);var timestamp=cache&&cache.getItem(href+":timestamp");var styles={css:css,timestamp:timestamp};var env;var newFileInfo={relativeUrls:less.relativeUrls,currentDirectory:hrefParts.path,filename:href};if(sheet instanceof less.tree.parseEnv){env=new less.tree.parseEnv(sheet);newFileInfo.entryPath=env.currentFileInfo.entryPath;newFileInfo.rootpath=env.currentFileInfo.rootpath;newFileInfo.rootFilename=env.currentFileInfo.rootFilename}else{env=new less.tree.parseEnv(less);env.mime=sheet.type;newFileInfo.entryPath=hrefParts.path;newFileInfo.rootpath=less.rootpath||hrefParts.path;newFileInfo.rootFilename=href}if(env.relativeUrls){if(less.rootpath){newFileInfo.rootpath=extractUrlParts(less.rootpath+pathDiff(hrefParts.path,newFileInfo.entryPath)).path}else{newFileInfo.rootpath=hrefParts.path}}xhr(href,sheet.type,function(data,lastModified){session_cache+=data.replace(/@import .+?;/gi,"");if(!reload&&styles&&lastModified&&new Date(lastModified).valueOf()===new Date(styles.timestamp).valueOf()){createCSS(styles.css,sheet);callback(null,null,data,sheet,{local:true,remaining:remaining},href)}else{try{env.contents[href]=data;env.paths=[hrefParts.path];env.currentFileInfo=newFileInfo;new less.Parser(env).parse(data,function(e,root){if(e){return callback(e,null,null,sheet)}try{callback(e,root,data,sheet,{local:false,lastModified:lastModified,remaining:remaining},href);if(env.currentFileInfo.rootFilename===href){removeNode(document.getElementById("less-error-message:"+extractId(href)))}}catch(e){callback(e,null,null,sheet)}})}catch(e){callback(e,null,null,sheet)}}},function(status,url){callback({type:"File",message:"'"+url+"' wasn't found ("+status+")"},null,null,sheet)})}function extractId(href){return href.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function createCSS(styles,sheet,lastModified){var href=sheet.href||"";var id="less:"+(sheet.title||extractId(href));var oldCss=document.getElementById(id);var keepOldCss=false;var css=document.createElement("style");css.setAttribute("type","text/css");if(sheet.media){css.setAttribute("media",sheet.media)}css.id=id;if(css.styleSheet){try{css.styleSheet.cssText=styles}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}}else{css.appendChild(document.createTextNode(styles));keepOldCss=oldCss!==null&&oldCss.childNodes.length>0&&css.childNodes.length>0&&oldCss.firstChild.nodeValue===css.firstChild.nodeValue}var head=document.getElementsByTagName("head")[0];if(oldCss==null||keepOldCss===false){var nextEl=sheet&&sheet.nextSibling||null;(nextEl||document.getElementsByTagName("head")[0]).parentNode.insertBefore(css,nextEl)}if(oldCss&&keepOldCss===false){head.removeChild(oldCss)}if(lastModified&&cache){log("saving "+href+" to cache.");try{cache.setItem(href,styles);cache.setItem(href+":timestamp",lastModified)}catch(e){log("failed to save")}}}function xhr(url,type,callback,errback){var xhr=getXMLHttpRequest();var async=isFileProtocol?less.fileAsync:less.async;if(typeof xhr.overrideMimeType==="function"){xhr.overrideMimeType("text/css")}xhr.open("GET",url,async);xhr.setRequestHeader("Accept",type||"text/x-less, text/css; q=0.9, */*; q=0.5");xhr.send(null);if(isFileProtocol&&!less.fileAsync){if(xhr.status===0||xhr.status>=200&&xhr.status<300){callback(xhr.responseText)}else{errback(xhr.status,url)}}else if(async){xhr.onreadystatechange=function(){if(xhr.readyState==4){handleResponse(xhr,callback,errback)}}}else{handleResponse(xhr,callback,errback)}function handleResponse(xhr,callback,errback){if(xhr.status>=200&&xhr.status<300){callback(xhr.responseText,xhr.getResponseHeader("Last-Modified"))}else if(typeof errback==="function"){errback(xhr.status,url)}}}function getXMLHttpRequest(){if(window.XMLHttpRequest){return new XMLHttpRequest}else{try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){log("browser doesn't support AJAX.");return null}}}function removeNode(node){return node&&node.parentNode.removeChild(node)}function log(str){if(less.env=="development"&&typeof console!=="undefined"){console.log("less: "+str)}}function error(e,rootHref){var id="less-error-message:"+extractId(rootHref||"");var template='<li><label>{line}</label><pre class="{class}">{content}</pre></li>';var elem=document.createElement("div"),timer,content,error=[];var filename=e.filename||rootHref;var filenameNoPath=filename.match(/([^\/]+(\?.*)?)$/)[1];elem.id=id;elem.className="less-error-message";content="<h3>"+(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+"</h3>"+'<p>in <a href="'+filename+'">'+filenameNoPath+"</a> ";var errorline=function(e,i,classname){if(e.extract[i]!=undefined){error.push(template.replace(/\{line\}/,(parseInt(e.line)||0)+(i-1)).replace(/\{class\}/,classname).replace(/\{content\}/,e.extract[i]))}};if(e.extract){errorline(e,0,"");errorline(e,1,"line");errorline(e,2,"");content+="on line "+e.line+", column "+(e.column+1)+":</p>"+"<ul>"+error.join("")+"</ul>"}else if(e.stack){content+="<br/>"+e.stack.split("\n").slice(1).join("<br/>")}elem.innerHTML=content;createCSS([".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"});elem.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(";");if(less.env=="development"){timer=setInterval(function(){if(document.body){if(document.getElementById(id)){document.body.replaceChild(elem,document.getElementById(id))}else{document.body.insertBefore(elem,document.body.firstChild)}clearInterval(timer)}},10)}}if(typeof define==="function"&&define.amd){define(function(){return less})}})(window);
1
+ /*
2
+ * LESS - Leaner CSS v1.4.0
3
+ * http://lesscss.org
4
+ *
5
+ * Copyright (c) 2009-2013, Alexis Sellier
6
+ * Licensed under the Apache 2.0 License.
7
+ *
8
+ * @licence
9
+ */(function(e,t){function n(t){return e.less[t.split("/")[1]]}function f(){r.env==="development"?(r.optimization=0,r.watchTimer=setInterval(function(){r.watchMode&&g(function(e,t,n,i,s){e?k(e,i.href):t&&S(t.toCSS(r),i,s.lastModified)})},r.poll)):r.optimization=3}function m(){var e=document.getElementsByTagName("style");for(var t=0;t<e.length;t++)if(e[t].type.match(p)){var n=new r.tree.parseEnv(r);n.filename=document.location.href.replace(/#.*$/,""),(new r.Parser(n)).parse(e[t].innerHTML||"",function(n,i){if(n)return k(n,"inline");var s=i.toCSS(r),o=e[t];o.type="text/css",o.styleSheet?o.styleSheet.cssText=s:o.innerHTML=s})}}function g(e,t){for(var n=0;n<r.sheets.length;n++)w(r.sheets[n],e,t,r.sheets.length-(n+1))}function y(e,t){var n=b(e),r=b(t),i,s,o,u,a="";if(n.hostPart!==r.hostPart)return"";s=Math.max(r.directories.length,n.directories.length);for(i=0;i<s;i++)if(r.directories[i]!==n.directories[i])break;u=r.directories.slice(i),o=n.directories.slice(i);for(i=0;i<u.length-1;i++)a+="../";for(i=0;i<o.length-1;i++)a+=o[i]+"/";return a}function b(e,t){var n=/^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/,r=e.match(n),i={},s=[],o,u;if(!r)throw new Error("Could not parse sheet href - '"+e+"'");if(!r[1]||r[2]){u=t.match(n);if(!u)throw new Error("Could not parse page url - '"+t+"'");r[1]=r[1]||u[1]||"",r[2]||(r[3]=u[3]+r[3])}if(r[3]){s=r[3].replace("\\","/").split("/");for(o=0;o<s.length;o++)s[o]==="."&&(s.splice(o,1),o-=1);for(o=0;o<s.length;o++)s[o]===".."&&o>0&&(s.splice(o-1,2),o-=2)}return i.hostPart=r[1],i.directories=s,i.path=r[1]+s.join("/"),i.fileUrl=i.path+(r[4]||""),i.url=i.fileUrl+(r[5]||""),i}function w(t,n,i,s){var o=b(t.href,e.location.href),u=o.url,a=l&&l.getItem(u),f=l&&l.getItem(u+":timestamp"),c={css:a,timestamp:f},h,p={relativeUrls:r.relativeUrls,currentDirectory:o.path,filename:u};t instanceof r.tree.parseEnv?(h=new r.tree.parseEnv(t),p.entryPath=h.currentFileInfo.entryPath,p.rootpath=h.currentFileInfo.rootpath,p.rootFilename=h.currentFileInfo.rootFilename):(h=new r.tree.parseEnv(r),h.mime=t.type,p.entryPath=o.path,p.rootpath=r.rootpath||o.path,p.rootFilename=u),h.relativeUrls&&(r.rootpath?p.rootpath=b(r.rootpath+y(o.path,p.entryPath)).path:p.rootpath=o.path),x(u,t.type,function(e,a){v+=e.replace(/@import .+?;/ig,"");if(!i&&c&&a&&(new Date(a)).valueOf()===(new Date(c.timestamp)).valueOf())S(c.css,t),n(null,null,e,t,{local:!0,remaining:s},u);else try{h.contents[u]=e,h.paths=[o.path],h.currentFileInfo=p,(new r.Parser(h)).parse(e,function(r,i){if(r)return n(r,null,null,t);try{n(r,i,e,t,{local:!1,lastModified:a,remaining:s},u),h.currentFileInfo.rootFilename===u&&N(document.getElementById("less-error-message:"+E(u)))}catch(r){n(r,null,null,t)}})}catch(f){n(f,null,null,t)}},function(e,r){n({type:"File",message:"'"+r+"' wasn't found ("+e+")"},null,null,t)})}function E(e){return e.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function S(e,t,n){var r=t.href||"",i="less:"+(t.title||E(r)),s=document.getElementById(i),o=!1,u=document.createElement("style");u.setAttribute("type","text/css"),t.media&&u.setAttribute("media",t.media),u.id=i;if(u.styleSheet)try{u.styleSheet.cssText=e}catch(a){throw new Error("Couldn't reassign styleSheet.cssText.")}else u.appendChild(document.createTextNode(e)),o=s!==null&&s.childNodes.length>0&&u.childNodes.length>0&&s.firstChild.nodeValue===u.firstChild.nodeValue;var f=document.getElementsByTagName("head")[0];if(s==null||o===!1){var c=t&&t.nextSibling||null;(c||document.getElementsByTagName("head")[0]).parentNode.insertBefore(u,c)}s&&o===!1&&f.removeChild(s);if(n&&l){C("saving "+r+" to cache.");try{l.setItem(r,e),l.setItem(r+":timestamp",n)}catch(a){C("failed to save")}}}function x(e,t,n,i){function a(t,n,r){t.status>=200&&t.status<300?n(t.responseText,t.getResponseHeader("Last-Modified")):typeof r=="function"&&r(t.status,e)}var s=T(),u=o?r.fileAsync:r.async;typeof s.overrideMimeType=="function"&&s.overrideMimeType("text/css"),s.open("GET",e,u),s.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),s.send(null),o&&!r.fileAsync?s.status===0||s.status>=200&&s.status<300?n(s.responseText):i(s.status,e):u?s.onreadystatechange=function(){s.readyState==4&&a(s,n,i)}:a(s,n,i)}function T(){if(e.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(t){return C("browser doesn't support AJAX."),null}}function N(e){return e&&e.parentNode.removeChild(e)}function C(e){r.env=="development"&&typeof console!="undefined"&&console.log("less: "+e)}function k(e,n){var i="less-error-message:"+E(n||""),s='<li><label>{line}</label><pre class="{class}">{content}</pre></li>',o=document.createElement("div"),u,a,f=[],l=e.filename||n,c=l.match(/([^\/]+(\?.*)?)$/)[1];o.id=i,o.className="less-error-message",a="<h3>"+(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+"</h3>"+'<p>in <a href="'+l+'">'+c+"</a> ";var h=function(e,n,r){e.extract[n]!=t&&f.push(s.replace(/\{line\}/,(parseInt(e.line)||0)+(n-1)).replace(/\{class\}/,r).replace(/\{content\}/,e.extract[n]))};e.extract?(h(e,0,""),h(e,1,"line"),h(e,2,""),a+="on line "+e.line+", column "+(e.column+1)+":</p>"+"<ul>"+f.join("")+"</ul>"):e.stack&&(a+="<br/>"+e.stack.split("\n").slice(1).join("<br/>")),o.innerHTML=a,S([".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"}),o.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(";"),r.env=="development"&&(u=setInterval(function(){document.body&&(document.getElementById(i)?document.body.replaceChild(o,document.getElementById(i)):document.body.insertBefore(o,document.body.firstChild),clearInterval(u))},10))}var r,i,s;typeof environment=="object"&&{}.toString.call(environment)==="[object Environment]"?(typeof e=="undefined"?r={}:r=e.less={},i=r.tree={},r.mode="rhino"):typeof e=="undefined"?(r=exports,i=n("./tree"),r.mode="node"):(typeof e.less=="undefined"&&(e.less={}),r=e.less,i=e.less.tree={},r.mode="browser"),r.Parser=function(t){function m(){a=c[u],f=o,h=o}function g(){c[u]=a,o=f,h=o}function y(){o>h&&(c[u]=c[u].slice(o-h),h=o)}function b(e){var t=e.charCodeAt(0);return t===32||t===10||t===9}function w(e){var t,n,r,i,a;if(e instanceof Function)return e.call(p.parsers);if(typeof e=="string")t=s.charAt(o)===e?e:null,r=1,y();else{y();if(!(t=e.exec(c[u])))return null;r=t[0].length}if(t)return E(r),typeof t=="string"?t:t.length===1?t[0]:t}function E(e){var t=o,n=u,r=o+c[u].length,i=o+=e;while(o<r){if(!b(s.charAt(o)))break;o++}return c[u]=c[u].slice(e+(o-i)),h=o,c[u].length===0&&u<c.length-1&&u++,t!==o||n!==u}function S(e,t){var n=w(e);if(!!n)return n;x(t||(typeof e=="string"?"expected '"+e+"' got '"+s.charAt(o)+"'":"unexpected token"))}function x(e,t){var n=new Error(e);throw n.index=o,n.type=t||"Syntax",n}function T(e){return typeof e=="string"?s.charAt(o)===e:e.test(c[u])?!0:!1}function N(e,t){return e.filename&&t.currentFileInfo.filename&&e.filename!==t.currentFileInfo.filename?p.imports.contents[e.filename]:s}function C(e,t){for(var n=e,r=-1;n>=0&&t.charAt(n)!=="\n";n--)r++;return{line:typeof e=="number"?(t.slice(0,e).match(/\n/g)||"").length:null,column:r}}function k(e,t,i){var s=i.currentFileInfo.filename;return r.mode!=="browser"&&r.mode!=="rhino"&&(s=n("path").resolve(s)),{lineNumber:C(e,t).line+1,fileName:s}}function L(e,t){var n=N(e,t),r=C(e.index,n),i=r.line,s=r.column,o=n.split("\n");this.type=e.type||"Syntax",this.message=e.message,this.filename=e.filename||t.currentFileInfo.filename,this.index=e.index,this.line=typeof i=="number"?i+1:null,this.callLine=e.call&&C(e.call,n).line+1,this.callExtract=o[C(e.call,n).line],this.stack=e.stack,this.column=s,this.extract=[o[i-1],o[i],o[i+1]]}var s,o,u,a,f,l,c,h,p,d=this;t instanceof i.parseEnv||(t=new i.parseEnv(t));var v=this.imports={paths:t.paths||[],queue:[],files:t.files,contents:t.contents,mime:t.mime,error:null,push:function(e,n,i){var s=this;this.queue.push(e),r.Parser.importer(e,n,function(t,n,r){s.queue.splice(s.queue.indexOf(e),1);var o=r in s.files;s.files[r]=n,t&&!s.error&&(s.error=t),i(t,n,o)},t)}};return L.prototype=new Error,L.prototype.constructor=L,this.env=t=t||{},this.optimization="optimization"in this.env?this.env.optimization:1,p={imports:v,parse:function(e,a){var f,d,v,m,g,y,b=[],E,S=null;o=u=h=l=0,s=e.replace(/\r\n/g,"\n"),s=s.replace(/^\uFEFF/,""),c=function(e){var n=0,r=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,i=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,o=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,u=0,a,f=e[0],l;for(var c=0,h,p;c<s.length;){r.lastIndex=c,(a=r.exec(s))&&a.index===c&&(c+=a[0].length,f.push(a[0])),h=s.charAt(c),i.lastIndex=o.lastIndex=c;if(a=o.exec(s))if(a.index===c){c+=a[0].length,f.push(a[0]);continue}if(!l&&h==="/"){p=s.charAt(c+1);if(p==="/"||p==="*")if(a=i.exec(s))if(a.index===c){c+=a[0].length,f.push(a[0]);continue}}switch(h){case"{":if(!l){u++,f.push(h);break};case"}":if(!l){u--,f.push(h),e[++n]=f=[];break};case"(":if(!l){l=!0,f.push(h);break};case")":if(l){l=!1,f.push(h);break};default:f.push(h)}c++}return u!=0&&(S=new L({index:c-1,type:"Parse",message:u>0?"missing closing `}`":"missing opening `{`",filename:t.currentFileInfo.filename},t)),e.map(function(e){return e.join("")})}([[]]);if(S)return a(new L(S,t));try{f=new i.Ruleset([],w(this.parsers.primary)),f.root=!0,f.firstRoot=!0}catch(x){return a(new L(x,t))}f.toCSS=function(e){var s,o,u;return function(s,o){s=s||{};var u,a=new i.evalEnv(s);typeof o=="object"&&!Array.isArray(o)&&(o=Object.keys(o).map(function(e){var t=o[e];return t instanceof i.Value||(t instanceof i.Expression||(t=new i.Expression([t])),t=new i.Value([t])),new i.Rule("@"+e,t,!1,0)}),a.frames=[new i.Ruleset(null,o)]);try{var f=e.call(this,a);(new i.joinSelectorVisitor).run(f),(new i.processExtendsVisitor).run(f);var l=f.toCSS({compress:Boolean(s.compress),dumpLineNumbers:t.dumpLineNumbers,strictUnits:Boolean(s.strictUnits)})}catch(c){throw new L(c,t)}return s.yuicompress&&r.mode==="node"?n("ycssmin").cssmin(l,s.maxLineLen):s.compress?l.replace(/(\s)+/g,"$1"):l}}(f.eval);if(o<s.length-1){o=l,y=s.split("\n"),g=(s.slice(0,o).match(/\n/g)||"").length+1;for(var T=o,N=-1;T>=0&&s.charAt(T)!=="\n";T--)N++;S={type:"Parse",message:"Unrecognised input",index:o,filename:t.currentFileInfo.filename,line:g,column:N,extract:[y[g-2],y[g-1],y[g]]}}var C=function(e){e=S||e||p.imports.error,e?(e instanceof L||(e=new L(e,t)),a(e)):a(null,f)};t.processImports!==!1?(new i.importVisitor(this.imports,C)).run(f):C()},parsers:{primary:function(){var e,t=[];while((e=w(this.extendRule)||w(this.mixin.definition)||w(this.rule)||w(this.ruleset)||w(this.mixin.call)||w(this.comment)||w(this.directive))||w(/^[\s\n]+/)||w(/^;+/))e&&t.push(e);return t},comment:function(){var e;if(s.charAt(o)!=="/")return;if(s.charAt(o+1)==="/")return new i.Comment(w(/^\/\/.*/),!0);if(e=w(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new i.Comment(e)},entities:{quoted:function(){var e,n=o,r,u=o;s.charAt(n)==="~"&&(n++,r=!0);if(s.charAt(n)!=='"'&&s.charAt(n)!=="'")return;r&&w("~");if(e=w(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new i.Quoted(e[0],e[1]||e[2],r,u,t.currentFileInfo)},keyword:function(){var e;if(e=w(/^[_A-Za-z-][_A-Za-z0-9-]*/))return i.colors.hasOwnProperty(e)?new i.Color(i.colors[e].slice(1)):new i.Keyword(e)},call:function(){var e,n,r,s,a=o;if(!(e=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(c[u])))return;e=e[1],n=e.toLowerCase();if(n==="url")return null;o+=e.length;if(n==="alpha"){s=w(this.alpha);if(typeof s!="undefined")return s}w("("),r=w(this.entities.arguments);if(!w(")"))return;if(e)return new i.Call(e,r,a,t.currentFileInfo)},arguments:function(){var e=[],t;while(t=w(this.entities.assignment)||w(this.expression)){e.push(t);if(!w(","))break}return e},literal:function(){return w(this.entities.dimension)||w(this.entities.color)||w(this.entities.quoted)||w(this.entities.unicodeDescriptor)},assignment:function(){var e,t;if((e=w(/^\w+(?=\s?=)/i))&&w("=")&&(t=w(this.entity)))return new i.Assignment(e,t)},url:function(){var e;if(s.charAt(o)!=="u"||!w(/^url\(/))return;return e=w(this.entities.quoted)||w(this.entities.variable)||w(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",S(")"),new i.URL(e.value!=null||e instanceof i.Variable?e:new i.Anonymous(e),t.currentFileInfo)},variable:function(){var e,n=o;if(s.charAt(o)==="@"&&(e=w(/^@@?[\w-]+/)))return new i.Variable(e,n,t.currentFileInfo)},variableCurly:function(){var e,n,r=o;if(s.charAt(o)==="@"&&(n=w(/^@\{([\w-]+)\}/)))return new i.Variable("@"+n[1],r,t.currentFileInfo)},color:function(){var e;if(s.charAt(o)==="#"&&(e=w(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/)))return new i.Color(e[1])},dimension:function(){var e,t=s.charCodeAt(o);if(t>57||t<43||t===47||t==44)return;if(e=w(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/))return new i.Dimension(e[1],e[2])},unicodeDescriptor:function(){var e;if(e=w(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/))return new i.UnicodeDescriptor(e[0])},javascript:function(){var e,t=o,n;s.charAt(t)==="~"&&(t++,n=!0);if(s.charAt(t)!=="`")return;n&&w("~");if(e=w(/^`([^`]*)`/))return new i.JavaScript(e[1],o,n)}},variable:function(){var e;if(s.charAt(o)==="@"&&(e=w(/^(@[\w-]+)\s*:/)))return e[1]},extend:function(e){var t,n,r=o,s,u=[];if(!w(e?/^&:extend\(/:/^:extend\(/))return;do{s=null,t=[];for(;;){s=w(/^(all)(?=\s*(\)|,))/);if(s)break;n=w(this.element);if(!n)break;t.push(n)}s=s&&s[1],u.push(new i.Extend(new i.Selector(t),s,r))}while(w(","));return S(/^\)/),e&&S(/^;/),u},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var e=[],n,r,u,a,f,l=o,c=s.charAt(o),h=!1;if(c!=="."&&c!=="#")return;m();while(n=w(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/))e.push(new i.Element(r,n,o)),r=w(">");w("(")&&(u=this.mixin.args.call(this,!0).args,S(")")),u=u||[],w(this.important)&&(h=!0);if(e.length>0&&(w(";")||T("}")))return new i.mixin.Call(e,u,l,t.currentFileInfo,h);g()},args:function(e){var t=[],n=[],r,u=[],a,f,l,c,h,p={args:null,variadic:!1};for(;;){if(e)h=w(this.expression);else{w(this.comment);if(s.charAt(o)==="."&&w(/^\.{3}/)){p.variadic=!0,w(";")&&!r&&(r=!0),(r?n:u).push({variadic:!0});break}h=w(this.entities.variable)||w(this.entities.literal)||w(this.entities.keyword)}if(!h)break;l=null,h.throwAwayComments&&h.throwAwayComments(),c=h;var d=null;if(e){if(h.value.length==1)var d=h.value[0]}else d=h;if(d&&d instanceof i.Variable)if(w(":"))t.length>0&&(r&&x("Cannot mix ; and , as delimiter types"),a=!0),c=S(this.expression),l=f=d.name;else{if(!e&&w(/^\.{3}/)){p.variadic=!0,w(";")&&!r&&(r=!0),(r?n:u).push({name:h.name,variadic:!0});break}e||(f=l=d.name,c=null)}c&&t.push(c),u.push({name:l,value:c});if(w(","))continue;if(w(";")||r)a&&x("Cannot mix ; and , as delimiter types"),r=!0,t.length>1&&(c=new i.Value(t)),n.push({name:f,value:c}),f=null,t=[],a=!1}return p.args=r?n:u,p},definition:function(){var e,t=[],n,r,u,a,f,c=!1;if(s.charAt(o)!=="."&&s.charAt(o)!=="#"||T(/^[^{]*\}/))return;m();if(n=w(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=n[1];var h=this.mixin.args.call(this,!1);t=h.args,c=h.variadic,w(")")||(l=o,g()),w(this.comment),w(/^when/)&&(f=S(this.conditions,"expected condition")),r=w(this.block);if(r)return new i.mixin.Definition(e,t,r,f,c);g()}}},entity:function(){return w(this.entities.literal)||w(this.entities.variable)||w(this.entities.url)||w(this.entities.call)||w(this.entities.keyword)||w(this.entities.javascript)||w(this.comment)},end:function(){return w(";")||T("}")},alpha:function(){var e;if(!w(/^\(opacity=/i))return;if(e=w(/^\d+/)||w(this.entities.variable))return S(")"),new i.Alpha(e)},element:function(){var e,t,n,r;n=w(this.combinator),e=w(/^(?:\d+\.\d+|\d+)%/)||w(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||w("*")||w("&")||w(this.attribute)||w(/^\([^()@]+\)/)||w(/^[\.#](?=@)/)||w(this.entities.variableCurly),e||w("(")&&(r=w(this.selector))&&w(")")&&(e=new i.Paren(r));if(e)return new i.Element(n,e,o)},combinator:function(){var e,t=s.charAt(o);if(t===">"||t==="+"||t==="~"||t==="|"){o++;while(s.charAt(o).match(/\s/))o++;return new i.Combinator(t)}return s.charAt(o-1).match(/\s/)?new i.Combinator(" "):new i.Combinator(null)},selector:function(){var e,t,n=[],r,u,a,f=[];while((a=w(this.extend))||(t=w(this.element))){a?f.push.apply(f,a):(f.length&&x("Extend can only be used at the end of selector"),r=s.charAt(o),n.push(t),t=null);if(r==="{"||r==="}"||r===";"||r===","||r===")")break}if(n.length>0)return new i.Selector(n,f);f.length&&x("Extend must be used to extend a selector, it cannot be used on its own")},attribute:function(){var e="",t,n,r;if(!w("["))return;(t=w(this.entities.variableCurly))||(t=S(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/));if(r=w(/^[|~*$^]?=/))n=w(this.entities.quoted)||w(/^[\w-]+/)||w(this.entities.variableCurly);return S("]"),new i.Attribute(t,r,n)},block:function(){var e;if(w("{")&&(e=w(this.primary))&&w("}"))return e},ruleset:function(){var e=[],n,r,u,a;m(),t.dumpLineNumbers&&(a=k(o,s,t));while(n=w(this.selector)){e.push(n),w(this.comment);if(!w(","))break;w(this.comment)}if(e.length>0&&(r=w(this.block))){var f=new i.Ruleset(e,r,t.strictImports);return t.dumpLineNumbers&&(f.debugInfo=a),f}l=o,g()},rule:function(e){var n,r,u=s.charAt(o),a,c;m();if(u==="."||u==="#"||u==="&")return;if(n=w(this.variable)||w(this.property)){r=!e&&(t.compress||n.charAt(0)==="@")?w(this.value)||w(this.anonymousValue):w(this.anonymousValue)||w(this.value),a=w(this.important);if(r&&w(this.end))return new i.Rule(n,r,a,f,t.currentFileInfo);l=o,g();if(r&&!e)return this.rule(!0)}},anonymousValue:function(){if(match=/^([^@+\/'"*`(;{}-]*);/.exec(c[u]))return o+=match[0].length-1,new i.Anonymous(match[1])},"import":function(){var e,n,r=o;m();var s=w(/^@import?\s+/),u=(s?w(this.importOptions):null)||{};if(s&&(e=w(this.entities.quoted)||w(this.entities.url))){n=w(this.mediaFeatures);if(w(";"))return n=n&&new i.Value(n),new i.Import(e,n,u,r,t.currentFileInfo)}g()},importOptions:function(){var e,t={},n,r;if(!w("("))return null;do if(e=w(this.importOption)){n=e,r=!0;switch(n){case"css":n="less",r=!1;break;case"once":n="multiple",r=!1}t[n]=r;if(!w(","))break}while(e);return S(")"),t},importOption:function(){var e=w(/^(less|css|multiple|once)/);if(e)return e[1]},mediaFeature:function(){var e,n,r=[];do if(e=w(this.entities.keyword))r.push(e);else if(w("(")){n=w(this.property),e=w(this.value);if(!w(")"))return null;if(n&&e)r.push(new i.Paren(new i.Rule(n,e,null,o,t.currentFileInfo,!0)));else{if(!e)return null;r.push(new i.Paren(e))}}while(e);if(r.length>0)return new i.Expression(r)},mediaFeatures:function(){var e,t=[];do if(e=w(this.mediaFeature)){t.push(e);if(!w(","))break}else if(e=w(this.entities.variable)){t.push(e);if(!w(","))break}while(e);return t.length>0?t:null},media:function(){var e,n,r,u;t.dumpLineNumbers&&(u=k(o,s,t));if(w(/^@media/)){e=w(this.mediaFeatures);if(n=w(this.block))return r=new i.Media(n,e),t.dumpLineNumbers&&(r.debugInfo=u),r}},directive:function(){var e,n,r,u,a,f,l,c,h,p;if(s.charAt(o)!=="@")return;if(n=w(this["import"])||w(this.media))return n;m(),e=w(/^@[a-z-]+/);if(!e)return;l=e,e.charAt(1)=="-"&&e.indexOf("-",2)>0&&(l="@"+e.slice(e.indexOf("-",2)+1));switch(l){case"@font-face":c=!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":c=!0;break;case"@page":case"@document":case"@supports":case"@keyframes":c=!0,h=!0;break;case"@namespace":p=!0}h&&(e+=" "+(w(/^[^{]+/)||"").trim());if(c){if(r=w(this.block))return new i.Directive(e,r)}else if((n=p?w(this.expression):w(this.entity))&&w(";")){var d=new i.Directive(e,n);return t.dumpLineNumbers&&(d.debugInfo=k(o,s,t)),d}g()},value:function(){var e,t=[],n;while(e=w(this.expression)){t.push(e);if(!w(","))break}if(t.length>0)return new i.Value(t)},important:function(){if(s.charAt(o)==="!")return w(/^! *important/)},sub:function(){var e,t;if(w("("))if(e=w(this.addition))return t=new i.Expression([e]),S(")"),t.parens=!0,t},multiplication:function(){var e,t,n,r,u,a=[];if(e=w(this.operand)){u=b(s.charAt(o-1));while(!T(/^\/[*\/]/)&&(n=w("/")||w("*"))){if(!(t=w(this.operand)))break;e.parensInOp=!0,t.parensInOp=!0,r=new i.Operation(n,[r||e,t],u),u=b(s.charAt(o-1))}return r||e}},addition:function(){var e,t,n,r,u;if(e=w(this.multiplication)){u=b(s.charAt(o-1));while((n=w(/^[-+]\s+/)||!u&&(w("+")||w("-")))&&(t=w(this.multiplication)))e.parensInOp=!0,t.parensInOp=!0,r=new i.Operation(n,[r||e,t],u),u=b(s.charAt(o-1));return r||e}},conditions:function(){var e,t,n=o,r;if(e=w(this.condition)){while(w(",")&&(t=w(this.condition)))r=new i.Condition("or",r||e,t,n);return r||e}},condition:function(){var e,t,n,r,s=o,u=!1;w(/^not/)&&(u=!0),S("(");if(e=w(this.addition)||w(this.entities.keyword)||w(this.entities.quoted))return(r=w(/^(?:>=|=<|[<=>])/))?(t=w(this.addition)||w(this.entities.keyword)||w(this.entities.quoted))?n=new i.Condition(r,e,t,s,u):x("expected expression"):n=new i.Condition("=",e,new i.Keyword("true"),s,u),S(")"),w(/^and/)?new i.Condition("and",n,w(this.condition)):n},operand:function(){var e,t=s.charAt(o+1);s.charAt(o)==="-"&&(t==="@"||t==="(")&&(e=w("-"));var n=w(this.sub)||w(this.entities.dimension)||w(this.entities.color)||w(this.entities.variable)||w(this.entities.call);return e&&(n.parensInOp=!0,n=new i.Negative(n)),n},expression:function(){var e,t,n=[],r;while(e=w(this.addition)||w(this.entity))n.push(e),!T(/^\/[\/*]/)&&(t=w("/"))&&n.push(new i.Anonymous(t));if(n.length>0)return new i.Expression(n)},property:function(){var e;if(e=w(/^(\*?-?[_a-z0-9-]+)\s*:/))return e[1]}}}};if(r.mode==="browser"||r.mode==="rhino")r.Parser.importer=function(e,t,n,r){!/^([a-z-]+:)?\//.test(e)&&t.currentDirectory&&(e=t.currentDirectory+e);var i=r.toSheet(e);i.processImports=!1,i.currentFileInfo=t,w(i,function(e,t,r,i,s,o){n.call(null,e,t,o)},!0)};(function(r){function u(e){return r.functions.hsla(e.h,e.s,e.l,e.a)}function a(e,t){return e instanceof r.Dimension&&e.unit.is("%")?parseFloat(e.value*t/100):f(e)}function f(e){if(e instanceof r.Dimension)return parseFloat(e.unit.is("%")?e.value/100:e.value);if(typeof e=="number")return e;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function l(e){return Math.min(1,Math.max(0,e))}r.functions={rgb:function(e,t,n){return this.rgba(e,t,n,1)},rgba:function(e,t,n,i){var s=[e,t,n].map(function(e){return a(e,256)});return i=f(i),new r.Color(s,i)},hsl:function(e,t,n){return this.hsla(e,t,n,1)},hsla:function(e,t,n,r){function o(e){return e=e<0?e+1:e>1?e-1:e,e*6<1?s+(i-s)*e*6:e*2<1?i:e*3<2?s+(i-s)*(2/3-e)*6:s}e=f(e)%360/360,t=l(f(t)),n=l(f(n)),r=l(f(r));var i=n<=.5?n*(t+1):n+t-n*t,s=n*2-i;return this.rgba(o(e+1/3)*255,o(e)*255,o(e-1/3)*255,r)},hsv:function(e,t,n){return this.hsva(e,t,n,1)},hsva:function(e,t,n,r){e=f(e)%360/360*360,t=f(t),n=f(n),r=f(r);var i,s;i=Math.floor(e/60%6),s=e/60-i;var o=[n,n*(1-t),n*(1-s*t),n*(1-(1-s)*t)],u=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return this.rgba(o[u[i][0]]*255,o[u[i][1]]*255,o[u[i][2]]*255,r)},hue:function(e){return new r.Dimension(Math.round(e.toHSL().h))},saturation:function(e){return new r.Dimension(Math.round(e.toHSL().s*100),"%")},lightness:function(e){return new r.Dimension(Math.round(e.toHSL().l*100),"%")},hsvhue:function(e){return new r.Dimension(Math.round(e.toHSV().h))},hsvsaturation:function(e){return new r.Dimension(Math.round(e.toHSV().s*100),"%")},hsvvalue:function(e){return new r.Dimension(Math.round(e.toHSV().v*100),"%")},red:function(e){return new r.Dimension(e.rgb[0])},green:function(e){return new r.Dimension(e.rgb[1])},blue:function(e){return new r.Dimension(e.rgb[2])},alpha:function(e){return new r.Dimension(e.toHSL().a)},luma:function(e){return new r.Dimension(Math.round(e.luma()*e.alpha*100),"%")},saturate:function(e,t){var n=e.toHSL();return n.s+=t.value/100,n.s=l(n.s),u(n)},desaturate:function(e,t){var n=e.toHSL();return n.s-=t.value/100,n.s=l(n.s),u(n)},lighten:function(e,t){var n=e.toHSL();return n.l+=t.value/100,n.l=l(n.l),u(n)},darken:function(e,t){var n=e.toHSL();return n.l-=t.value/100,n.l=l(n.l),u(n)},fadein:function(e,t){var n=e.toHSL();return n.a+=t.value/100,n.a=l(n.a),u(n)},fadeout:function(e,t){var n=e.toHSL();return n.a-=t.value/100,n.a=l(n.a),u(n)},fade:function(e,t){var n=e.toHSL();return n.a=t.value/100,n.a=l(n.a),u(n)},spin:function(e,t){var n=e.toHSL(),r=(n.h+t.value)%360;return n.h=r<0?360+r:r,u(n)},mix:function(e,t,n){n||(n=new r.Dimension(50));var i=n.value/100,s=i*2-1,o=e.toHSL().a-t.toHSL().a,u=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,a=1-u,f=[e.rgb[0]*u+t.rgb[0]*a,e.rgb[1]*u+t.rgb[1]*a,e.rgb[2]*u+t.rgb[2]*a],l=e.alpha*i+t.alpha*(1-i);return new r.Color(f,l)},greyscale:function(e){return this.desaturate(e,new r.Dimension(100))},contrast:function(e,t,n,r){if(!e.rgb)return null;typeof n=="undefined"&&(n=this.rgba(255,255,255,1)),typeof t=="undefined"&&(t=this.rgba(0,0,0,1));if(t.luma()>n.luma()){var i=n;n=t,t=i}return typeof r=="undefined"?r=.43:r=f(r),e.luma()*e.alpha<r?n:t},e:function(e){return new r.Anonymous(e instanceof r.JavaScript?e.evaluated:e)},escape:function(e){return new r.Anonymous(encodeURI(e.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(e){var t=Array.prototype.slice.call(arguments,1),n=e.value;for(var i=0;i<t.length;i++)n=n.replace(/%[sda]/i,function(e){var n=e.match(/s/i)?t[i].value:t[i].toCSS();return e.match(/[A-Z]$/)?encodeURIComponent(n):n});return n=n.replace(/%%/g,"%"),new r.Quoted('"'+n+'"',n)},unit:function(e,t){return new r.Dimension(e.value,t?t.toCSS():"")},convert:function(e,t){return e.convertTo(t.value)},round:function(e,t){var n=typeof t=="undefined"?0:t.value;return this._math(function(e){return e.toFixed(n)},null,e)},pi:function(){return new r.Dimension(Math.PI)},mod:function(e,t){return new r.Dimension(e.value%t.value,e.unit)},pow:function(e,t){if(typeof e=="number"&&typeof t=="number")e=new r.Dimension(e),t=new r.Dimension(t);else if(!(e instanceof r.Dimension)||!(t instanceof r.Dimension))throw{type:"Argument",message:"arguments must be numbers"};return new r.Dimension(Math.pow(e.value,t.value),e.unit)},_math:function(e,t,n){if(n instanceof r.Dimension)return new r.Dimension(e(parseFloat(n.value)),t==null?n.unit:t);if(typeof n=="number")return e(n);throw{type:"Argument",message:"argument must be a number"}},argb:function(e){return new r.Anonymous(e.toARGB())},percentage:function(e){return new r.Dimension(e.value*100,"%")},color:function(e){if(e instanceof r.Quoted)return new r.Color(e.value.slice(1));throw{type:"Argument",message:"argument must be a string"}},iscolor:function(e){return this._isa(e,r.Color)},isnumber:function(e){return this._isa(e,r.Dimension)},isstring:function(e){return this._isa(e,r.Quoted)},iskeyword:function(e){return this._isa(e,r.Keyword)},isurl:function(e){return this._isa(e,r.URL)},ispixel:function(e){return this.isunit(e,"px")},ispercentage:function(e){return this.isunit(e,"%")},isem:function(e){return this.isunit(e,"em")},isunit:function(e,t){return e instanceof r.Dimension&&e.unit.is(t.value||t)?r.True:r.False},_isa:function(e,t){return e instanceof t?r.True:r.False},multiply:function(e,t){var n=e.rgb[0]*t.rgb[0]/255,r=e.rgb[1]*t.rgb[1]/255,i=e.rgb[2]*t.rgb[2]/255;return this.rgb(n,r,i)},screen:function(e,t){var n=255-(255-e.rgb[0])*(255-t.rgb[0])/255,r=255-(255-e.rgb[1])*(255-t.rgb[1])/255,i=255-(255-e.rgb[2])*(255-t.rgb[2])/255;return this.rgb(n,r,i)},overlay:function(e,t){var n=e.rgb[0]<128?2*e.rgb[0]*t.rgb[0]/255:255-2*(255-e.rgb[0])*(255-t.rgb[0])/255,r=e.rgb[1]<128?2*e.rgb[1]*t.rgb[1]/255:255-2*(255-e.rgb[1])*(255-t.rgb[1])/255,i=e.rgb[2]<128?2*e.rgb[2]*t.rgb[2]/255:255-2*(255-e.rgb[2])*(255-t.rgb[2])/255;return this.rgb(n,r,i)},softlight:function(e,t){var n=t.rgb[0]*e.rgb[0]/255,r=n+e.rgb[0]*(255-(255-e.rgb[0])*(255-t.rgb[0])/255-n)/255;n=t.rgb[1]*e.rgb[1]/255;var i=n+e.rgb[1]*(255-(255-e.rgb[1])*(255-t.rgb[1])/255-n)/255;n=t.rgb[2]*e.rgb[2]/255;var s=n+e.rgb[2]*(255-(255-e.rgb[2])*(255-t.rgb[2])/255-n)/255;return this.rgb(r,i,s)},hardlight:function(e,t){var n=t.rgb[0]<128?2*t.rgb[0]*e.rgb[0]/255:255-2*(255-t.rgb[0])*(255-e.rgb[0])/255,r=t.rgb[1]<128?2*t.rgb[1]*e.rgb[1]/255:255-2*(255-t.rgb[1])*(255-e.rgb[1])/255,i=t.rgb[2]<128?2*t.rgb[2]*e.rgb[2]/255:255-2*(255-t.rgb[2])*(255-e.rgb[2])/255;return this.rgb(n,r,i)},difference:function(e,t){var n=Math.abs(e.rgb[0]-t.rgb[0]),r=Math.abs(e.rgb[1]-t.rgb[1]),i=Math.abs(e.rgb[2]-t.rgb[2]);return this.rgb(n,r,i)},exclusion:function(e,t){var n=e.rgb[0]+t.rgb[0]*(255-e.rgb[0]-e.rgb[0])/255,r=e.rgb[1]+t.rgb[1]*(255-e.rgb[1]-e.rgb[1])/255,i=e.rgb[2]+t.rgb[2]*(255-e.rgb[2]-e.rgb[2])/255;return this.rgb(n,r,i)},average:function(e,t){var n=(e.rgb[0]+t.rgb[0])/2,r=(e.rgb[1]+t.rgb[1])/2,i=(e.rgb[2]+t.rgb[2])/2;return this.rgb(n,r,i)},negation:function(e,t){var n=255-Math.abs(255-t.rgb[0]-e.rgb[0]),r=255-Math.abs(255-t.rgb[1]-e.rgb[1]),i=255-Math.abs(255-t.rgb[2]-e.rgb[2]);return this.rgb(n,r,i)},tint:function(e,t){return this.mix(this.rgb(255,255,255),e,t)},shade:function(e,t){return this.mix(this.rgb(0,0,0),e,t)},extract:function(e,t){return t=t.value-1,e.value[t]},"data-uri":function(t,i){if(typeof e!="undefined")return(new r.URL(i||t,this.currentFileInfo)).eval(this.env);var s=t.value,o=i&&i.value,u=n("fs"),a=n("path"),f=!1;arguments.length<2&&(o=s),this.env.isPathRelative(o)&&(this.currentFileInfo.relativeUrls?o=a.join(this.currentFileInfo.currentDirectory,o):o=a.join(this.currentFileInfo.entryPath,o));if(arguments.length<2){var l;try{l=n("mime")}catch(c){l=r._mime}s=l.lookup(o);var h=l.charsets.lookup(s);f=["US-ASCII","UTF-8"].indexOf(h)<0,f&&(s+=";base64")}else f=/;base64$/.test(s);var p=u.readFileSync(o),d=32,v=parseInt(p.length/1024,10);if(v>=d){if(this.env.ieCompat!==!1)return this.env.silent||console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!",o,v,d),(new r.URL(i||t,this.currentFileInfo)).eval(this.env);this.env.silent||console.warn("WARNING: Embedding %s (%dKB) exceeds IE8's data-uri size limit of %dKB!",o,v,d)}p=f?p.toString("base64"):encodeURIComponent(p);var m="'data:"+s+","+p+"'";return new r.URL(new r.Anonymous(m))}},r._mime={_types:{".htm":"text/html",".html":"text/html",".gif":"image/gif",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png"},lookup:function(e){var i=n("path").extname(e),s=r._mime._types[i];if(s===t)throw new Error('Optional dependency "mime" is required for '+i);return s},charsets:{lookup:function(e){return e&&/^text\//.test(e)?"UTF-8":""}}};var i=[{name:"ceil"},{name:"floor"},{name:"sqrt"},{name:"abs"},{name:"tan",unit:""},{name:"sin",unit:""},{name:"cos",unit:""},{name:"atan",unit:"rad"},{name:"asin",unit:"rad"},{name:"acos",unit:"rad"}],s=function(e,t){return function(n){return t!=null&&(n=n.unify()),this._math(Math[e],t,n)}};for(var o=0;o<i.length;o++)r.functions[i[o].name]=s(i[o].name,i[o].unit);r.functionCall=function(e,t){this.env=e,this.currentFileInfo=t},r.functionCall.prototype=r.functions})(n("./tree")),function(e){e.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b"
10
+ ,darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(n("./tree")),function(e){e.Alpha=function(e){this.value=e},e.Alpha.prototype={type:"Alpha",accept:function(e){this.value=e.visit(this.value)},eval:function(e){return this.value.eval&&(this.value=this.value.eval(e)),this},toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"}}}(n("../tree")),function(e){e.Anonymous=function(e){this.value=e.value||e},e.Anonymous.prototype={type:"Anonymous",toCSS:function(){return this.value},eval:function(){return this},compare:function(e){if(!e.toCSS)return-1;var t=this.toCSS(),n=e.toCSS();return t===n?0:t<n?-1:1}}}(n("../tree")),function(e){e.Assignment=function(e,t){this.key=e,this.value=t},e.Assignment.prototype={type:"Assignment",accept:function(e){this.value=e.visit(this.value)},toCSS:function(){return this.key+"="+(this.value.toCSS?this.value.toCSS():this.value)},eval:function(t){return this.value.eval?new e.Assignment(this.key,this.value.eval(t)):this}}}(n("../tree")),function(e){e.Call=function(e,t,n,r){this.name=e,this.args=t,this.index=n,this.currentFileInfo=r},e.Call.prototype={type:"Call",accept:function(e){this.args=e.visit(this.args)},eval:function(t){var n=this.args.map(function(e){return e.eval(t)}),r=this.name.toLowerCase(),i,s;if(r in e.functions)try{s=new e.functionCall(t,this.currentFileInfo),i=s[r].apply(s,n);if(i!=null)return i}catch(o){throw{type:o.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(o.message?": "+o.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new e.Anonymous(this.name+"("+n.map(function(e){return e.toCSS(t)}).join(", ")+")")},toCSS:function(e){return this.eval(e).toCSS()}}}(n("../tree")),function(e){e.Color=function(e,t){Array.isArray(e)?this.rgb=e:e.length==6?this.rgb=e.match(/.{2}/g).map(function(e){return parseInt(e,16)}):this.rgb=e.split("").map(function(e){return parseInt(e+e,16)}),this.alpha=typeof t=="number"?t:1},e.Color.prototype={type:"Color",eval:function(){return this},luma:function(){return.2126*this.rgb[0]/255+.7152*this.rgb[1]/255+.0722*this.rgb[2]/255},toCSS:function(e,t){var n=e&&e.compress&&!t;if(this.alpha<1)return"rgba("+this.rgb.map(function(e){return Math.round(e)}).concat(this.alpha).join(","+(n?"":" "))+")";var r=this.rgb.map(function(e){return e=Math.round(e),e=(e>255?255:e<0?0:e).toString(16),e.length===1?"0"+e:e}).join("");return n&&(r=r.split(""),r[0]==r[1]&&r[2]==r[3]&&r[4]==r[5]?r=r[0]+r[2]+r[4]:r=r.join("")),"#"+r},operate:function(t,n,r){var i=[];r instanceof e.Color||(r=r.toColor());for(var s=0;s<3;s++)i[s]=e.operate(t,n,this.rgb[s],r.rgb[s]);return new e.Color(i,this.alpha+r.alpha)},toHSL:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255,r=this.alpha,i=Math.max(e,t,n),s=Math.min(e,t,n),o,u,a=(i+s)/2,f=i-s;if(i===s)o=u=0;else{u=a>.5?f/(2-i-s):f/(i+s);switch(i){case e:o=(t-n)/f+(t<n?6:0);break;case t:o=(n-e)/f+2;break;case n:o=(e-t)/f+4}o/=6}return{h:o*360,s:u,l:a,a:r}},toHSV:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255,r=this.alpha,i=Math.max(e,t,n),s=Math.min(e,t,n),o,u,a=i,f=i-s;i===0?u=0:u=f/i;if(i===s)o=0;else{switch(i){case e:o=(t-n)/f+(t<n?6:0);break;case t:o=(n-e)/f+2;break;case n:o=(e-t)/f+4}o/=6}return{h:o*360,s:u,v:a,a:r}},toARGB:function(){var e=[Math.round(this.alpha*255)].concat(this.rgb);return"#"+e.map(function(e){return e=Math.round(e),e=(e>255?255:e<0?0:e).toString(16),e.length===1?"0"+e:e}).join("")},compare:function(e){return e.rgb?e.rgb[0]===this.rgb[0]&&e.rgb[1]===this.rgb[1]&&e.rgb[2]===this.rgb[2]&&e.alpha===this.alpha?0:-1:-1}}}(n("../tree")),function(e){e.Comment=function(e,t){this.value=e,this.silent=!!t},e.Comment.prototype={type:"Comment",toCSS:function(e){return e.compress?"":this.value},eval:function(){return this}}}(n("../tree")),function(e){e.Condition=function(e,t,n,r,i){this.op=e.trim(),this.lvalue=t,this.rvalue=n,this.index=r,this.negate=i},e.Condition.prototype={type:"Condition",accept:function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},eval:function(e){var t=this.lvalue.eval(e),n=this.rvalue.eval(e),r=this.index,i,i=function(e){switch(e){case"and":return t&&n;case"or":return t||n;default:if(t.compare)i=t.compare(n);else{if(!n.compare)throw{type:"Type",message:"Unable to perform comparison",index:r};i=n.compare(t)}switch(i){case-1:return e==="<"||e==="=<";case 0:return e==="="||e===">="||e==="=<";case 1:return e===">"||e===">="}}}(this.op);return this.negate?!i:i}}}(n("../tree")),function(e){e.Dimension=function(n,r){this.value=parseFloat(n),this.unit=r&&r instanceof e.Unit?r:new e.Unit(r?[r]:t)},e.Dimension.prototype={type:"Dimension",accept:function(e){this.unit=e.visit(this.unit)},eval:function(e){return this},toColor:function(){return new e.Color([this.value,this.value,this.value])},toCSS:function(e){if(e&&e.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var t=this.value,n=String(t);t!==0&&t<1e-6&&t>-0.000001&&(n=t.toFixed(20).replace(/0+$/,""));if(e&&e.compress){if(t===0&&!this.unit.isAngle())return n;t>0&&t<1&&(n=n.substr(1))}return n+this.unit.toCSS(e)},operate:function(t,n,r){var i=e.operate(t,n,this.value,r.value),s=this.unit.clone();if(n==="+"||n==="-"){if(s.numerator.length===0&&s.denominator.length===0)s.numerator=r.unit.numerator.slice(0),s.denominator=r.unit.denominator.slice(0);else if(r.unit.numerator.length!=0||s.denominator.length!=0){r=r.convertTo(this.unit.usedUnits());if(t.strictUnits&&r.unit.toString()!==s.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+s.toString()+"' and '"+r.unit.toString()+"'.");i=e.operate(t,n,this.value,r.value)}}else n==="*"?(s.numerator=s.numerator.concat(r.unit.numerator).sort(),s.denominator=s.denominator.concat(r.unit.denominator).sort(),s.cancel()):n==="/"&&(s.numerator=s.numerator.concat(r.unit.denominator).sort(),s.denominator=s.denominator.concat(r.unit.numerator).sort(),s.cancel());return new e.Dimension(i,s)},compare:function(t){if(t instanceof e.Dimension){var n=this.unify(),r=t.unify(),i=n.value,s=r.value;return s>i?-1:s<i?1:!r.unit.isEmpty()&&n.unit.compare(r.unit)!==0?-1:0}return-1},unify:function(){return this.convertTo({length:"m",duration:"s",angle:"rad"})},convertTo:function(t){var n=this.value,r=this.unit.clone(),i,s,o,u,a,f={};if(typeof t=="string"){for(i in e.UnitConversions)e.UnitConversions[i].hasOwnProperty(t)&&(f={},f[i]=t);t=f}for(s in t)t.hasOwnProperty(s)&&(a=t[s],o=e.UnitConversions[s],r.map(function(e,t){return o.hasOwnProperty(e)?(t?n/=o[e]/o[a]:n*=o[e]/o[a],a):e}));return r.cancel(),new e.Dimension(n,r)}},e.UnitConversions={length:{m:1,cm:.01,mm:.001,"in":.0254,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}},e.Unit=function(e,t,n){this.numerator=e?e.slice(0).sort():[],this.denominator=t?t.slice(0).sort():[],this.backupUnit=n},e.Unit.prototype={type:"Unit",clone:function(){return new e.Unit(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},toCSS:function(e){return this.numerator.length>=1?this.numerator[0]:this.denominator.length>=1?this.denominator[0]:(!e||!e.strictUnits)&&this.backupUnit?this.backupUnit:""},toString:function(){var e,t=this.numerator.join("*");for(e=0;e<this.denominator.length;e++)t+="/"+this.denominator[e];return t},compare:function(e){return this.is(e.toString())?0:-1},is:function(e){return this.toString()===e},isAngle:function(){return e.UnitConversions.angle.hasOwnProperty(this.toCSS())},isEmpty:function(){return this.numerator.length==0&&this.denominator.length==0},isSingular:function(){return this.numerator.length<=1&&this.denominator.length==0},map:function(e){var t;for(t=0;t<this.numerator.length;t++)this.numerator[t]=e(this.numerator[t],!1);for(t=0;t<this.denominator.length;t++)this.denominator[t]=e(this.denominator[t],!0)},usedUnits:function(){var t,n,r={};for(n in e.UnitConversions)e.UnitConversions.hasOwnProperty(n)&&(t=e.UnitConversions[n],this.map(function(e){return t.hasOwnProperty(e)&&!r[n]&&(r[n]=e),e}));return r},cancel:function(){var e={},t,n,r;for(n=0;n<this.numerator.length;n++)t=this.numerator[n],r||(r=t),e[t]=(e[t]||0)+1;for(n=0;n<this.denominator.length;n++)t=this.denominator[n],r||(r=t),e[t]=(e[t]||0)-1;this.numerator=[],this.denominator=[];for(t in e)if(e.hasOwnProperty(t)){var i=e[t];if(i>0)for(n=0;n<i;n++)this.numerator.push(t);else if(i<0)for(n=0;n<-i;n++)this.denominator.push(t)}this.numerator.length===0&&this.denominator.length===0&&r&&(this.backupUnit=r),this.numerator.sort(),this.denominator.sort()}}}(n("../tree")),function(e){e.Directive=function(t,n){this.name=t,Array.isArray(n)?(this.ruleset=new e.Ruleset([],n),this.ruleset.allowImports=!0):this.value=n},e.Directive.prototype={type:"Directive",accept:function(e){this.ruleset=e.visit(this.ruleset),this.value=e.visit(this.value)},toCSS:function(e){return this.ruleset?(this.ruleset.root=!0,this.name+(e.compress?"{":" {\n ")+this.ruleset.toCSS(e).trim().replace(/\n/g,"\n ")+(e.compress?"}":"\n}\n")):this.name+" "+this.value.toCSS()+";\n"},eval:function(t){var n=this;return this.ruleset&&(t.frames.unshift(this),n=new e.Directive(this.name),n.ruleset=this.ruleset.eval(t),t.frames.shift()),n},variable:function(t){return e.Ruleset.prototype.variable.call(this.ruleset,t)},find:function(){return e.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return e.Ruleset.prototype.rulesets.apply(this.ruleset)}}}(n("../tree")),function(e){e.Element=function(t,n,r){this.combinator=t instanceof e.Combinator?t:new e.Combinator(t),typeof n=="string"?this.value=n.trim():n?this.value=n:this.value="",this.index=r},e.Element.prototype={type:"Element",accept:function(e){this.combinator=e.visit(this.combinator),this.value=e.visit(this.value)},eval:function(t){return new e.Element(this.combinator,this.value.eval?this.value.eval(t):this.value,this.index)},toCSS:function(e){var t=this.value.toCSS?this.value.toCSS(e):this.value;return t==""&&this.combinator.value.charAt(0)=="&"?"":this.combinator.toCSS(e||{})+t}},e.Attribute=function(e,t,n){this.key=e,this.op=t,this.value=n},e.Attribute.prototype={type:"Attribute",accept:function(e){this.value=e.visit(this.value)},eval:function(t){return new e.Attribute(this.key.eval?this.key.eval(t):this.key,this.op,this.value&&this.value.eval?this.value.eval(t):this.value)},toCSS:function(e){var t=this.key.toCSS?this.key.toCSS(e):this.key;return this.op&&(t+=this.op,t+=this.value.toCSS?this.value.toCSS(e):this.value),"["+t+"]"}},e.Combinator=function(e){e===" "?this.value=" ":this.value=e?e.trim():""},e.Combinator.prototype={type:"Combinator",toCSS:function(e){return{"":""," ":" ",":":" :","+":e.compress?"+":" + ","~":e.compress?"~":" ~ ",">":e.compress?">":" > ","|":e.compress?"|":" | "}[this.value]}}}(n("../tree")),function(e){e.Expression=function(e){this.value=e},e.Expression.prototype={type:"Expression",accept:function(e){this.value=e.visit(this.value)},eval:function(t){var n,r=this.parens&&!this.parensInOp,i=!1;return r&&t.inParenthesis(),this.value.length>1?n=new e.Expression(this.value.map(function(e){return e.eval(t)})):this.value.length===1?(this.value[0].parens&&!this.value[0].parensInOp&&(i=!0),n=this.value[0].eval(t)):n=this,r&&t.outOfParenthesis(),this.parens&&this.parensInOp&&!t.isMathOn()&&!i&&(n=new e.Paren(n)),n},toCSS:function(e){return this.value.map(function(t){return t.toCSS?t.toCSS(e):""}).join(" ")},throwAwayComments:function(){this.value=this.value.filter(function(t){return!(t instanceof e.Comment)})}}}(n("../tree")),function(e){e.Extend=function(t,n,r){this.selector=t,this.option=n,this.index=r;switch(n){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}},e.Extend.prototype={type:"Extend",accept:function(e){this.selector=e.visit(this.selector)},eval:function(t){return new e.Extend(this.selector.eval(t),this.option,this.index)},clone:function(t){return new e.Extend(this.selector,this.option,this.index)},findSelfSelectors:function(e){var t=[];for(d=0;d<e.length;d++)t=t.concat(e[d].elements);this.selfSelectors=[{elements:t}]}}}(n("../tree")),function(e){e.Import=function(e,n,r,i,s){var o=this;this.options=r,this.index=i,this.path=e,this.features=n,this.currentFileInfo=s;if(this.options.less!==t)this.css=!this.options.less;else{var u=this.getPath();u&&/css([\?;].*)?$/.test(u)&&(this.css=!0)}},e.Import.prototype={type:"Import",accept:function(e){this.features=e.visit(this.features),this.path=e.visit(this.path),this.root=e.visit(this.root)},toCSS:function(e){var t=this.features?" "+this.features.toCSS(e):"";return this.css?"@import "+this.path.toCSS()+t+";\n":""},getPath:function(){if(this.path instanceof e.Quoted){var n=this.path.value;return this.css!==t||/(\.[a-z]*$)|([\?;].*)$/.test(n)?n:n+".less"}return this.path instanceof e.URL?this.path.value.value:null},evalForImport:function(t){return new e.Import(this.path.eval(t),this.features,this.options,this.index,this.currentFileInfo)},evalPath:function(t){var n=this.path.eval(t),r=this.currentFileInfo&&this.currentFileInfo.rootpath;if(r&&!(n instanceof e.URL)){var i=n.value;i&&t.isPathRelative(i)&&(n.value=r+i)}return n},eval:function(t){var n,r=this.features&&this.features.eval(t);if(this.skip)return[];if(this.css){var i=new e.Import(this.evalPath(t),r,this.options,this.index);if(!i.css&&this.error)throw this.error;return i}return n=new e.Ruleset([],this.root.rules.slice(0)),n.evalImports(t),this.features?new e.Media(n.rules,this.features.value):n.rules}}}(n("../tree")),function(e){e.JavaScript=function(e,t,n){this.escaped=n,this.expression=e,this.index=t},e.JavaScript.prototype={type:"JavaScript",eval:function(t){var n,r=this,i={},s=this.expression.replace(/@\{([\w-]+)\}/g,function(n,i){return e.jsify((new e.Variable("@"+i,r.index)).eval(t))});try{s=new Function("return ("+s+")")}catch(o){throw{message:"JavaScript evaluation error: `"+s+"`",index:this.index}}for(var u in t.frames[0].variables())i[u.slice(1)]={value:t.frames[0].variables()[u].value,toJS:function(){return this.value.eval(t).toCSS()}};try{n=s.call(i)}catch(o){throw{message:"JavaScript evaluation error: '"+o.name+": "+o.message+"'",index:this.index}}return typeof n=="string"?new e.Quoted('"'+n+'"',n,this.escaped,this.index):Array.isArray(n)?new e.Anonymous(n.join(", ")):new e.Anonymous(n)}}}(n("../tree")),function(e){e.Keyword=function(e){this.value=e},e.Keyword.prototype={type:"Keyword",eval:function(){return this},toCSS:function(){return this.value},compare:function(t){return t instanceof e.Keyword?t.value===this.value?0:1:-1}},e.True=new e.Keyword("true"),e.False=new e.Keyword("false")}(n("../tree")),function(e){e.Media=function(t,n){var r=this.emptySelectors();this.features=new e.Value(n),this.ruleset=new e.Ruleset(r,t),this.ruleset.allowImports=!0},e.Media.prototype={type:"Media",accept:function(e){this.features=e.visit(this.features),this.ruleset=e.visit(this.ruleset)},toCSS:function(e){var t=this.features.toCSS(e);return"@media "+t+(e.compress?"{":" {\n ")+this.ruleset.toCSS(e).trim().replace(/\n/g,"\n ")+(e.compress?"}":"\n}\n")},eval:function(t){t.mediaBlocks||(t.mediaBlocks=[],t.mediaPath=[]);var n=new e.Media([],[]);this.debugInfo&&(this.ruleset.debugInfo=this.debugInfo,n.debugInfo=this.debugInfo);var r=!1;t.strictMath||(r=!0,t.strictMath=!0);try{n.features=this.features.eval(t)}finally{r&&(t.strictMath=!1)}return t.mediaPath.push(n),t.mediaBlocks.push(n),t.frames.unshift(this.ruleset),n.ruleset=this.ruleset.eval(t),t.frames.shift(),t.mediaPath.pop(),t.mediaPath.length===0?n.evalTop(t):n.evalNested(t)},variable:function(t){return e.Ruleset.prototype.variable.call(this.ruleset,t)},find:function(){return e.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return e.Ruleset.prototype.rulesets.apply(this.ruleset)},emptySelectors:function(){var t=new e.Element("","&",0);return[new e.Selector([t])]},evalTop:function(t){var n=this;if(t.mediaBlocks.length>1){var r=this.emptySelectors();n=new e.Ruleset(r,t.mediaBlocks),n.multiMedia=!0}return delete t.mediaBlocks,delete t.mediaPath,n},evalNested:function(t){var n,r,i=t.mediaPath.concat([this]);for(n=0;n<i.length;n++)r=i[n].features instanceof e.Value?i[n].features.value:i[n].features,i[n]=Array.isArray(r)?r:[r];return this.features=new e.Value(this.permute(i).map(function(t){t=t.map(function(t){return t.toCSS?t:new e.Anonymous(t)});for(n=t.length-1;n>0;n--)t.splice(n,0,new e.Anonymous("and"));return new e.Expression(t)})),new e.Ruleset([],[])},permute:function(e){if(e.length===0)return[];if(e.length===1)return e[0];var t=[],n=this.permute(e.slice(1));for(var r=0;r<n.length;r++)for(var i=0;i<e[0].length;i++)t.push([e[0][i]].concat(n[r]));return t},bubbleSelectors:function(t){this.ruleset=new e.Ruleset(t.slice(0),[this.ruleset])}}}(n("../tree")),function(e){e.mixin={},e.mixin.Call=function(t,n,r,i,s){this.selector=new e.Selector(t),this.arguments=n,this.index=r,this.currentFileInfo=i,this.important=s},e.mixin.Call.prototype={type:"MixinCall",accept:function(e){this.selector=e.visit(this.selector),this.arguments=e.visit(this.arguments)},eval:function(t){var n,r,i,s=[],o=!1,u,a,f,l,c;i=this.arguments&&this.arguments.map(function(e){return{name:e.name,value:e.value.eval(t)}});for(u=0;u<t.frames.length;u++)if((n=t.frames[u].find(this.selector)).length>0){c=!0;for(a=0;a<n.length;a++){r=n[a],l=!1;for(f=0;f<t.frames.length;f++)if(!(r instanceof e.mixin.Definition)&&r===(t.frames[f].originalRuleset||t.frames[f])){l=!0;break}if(l)continue;if(r.matchArgs(i,t)){if(!r.matchCondition||r.matchCondition(i,t))try{Array.prototype.push.apply(s,r.eval(t,i,this.important).rules)}catch(h){throw{message:h.message,index:this.index,filename:this.currentFileInfo.filename,stack:h.stack}}o=!0}}if(o)return s}throw c?{type:"Runtime",message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+(i?i.map(function(e){var t="";return e.name&&(t+=e.name+":"),e.value.toCSS?t+=e.value.toCSS():t+="???",t}).join(", "):"")+")`",index:this.index,filename:this.currentFileInfo.filename}:{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}}},e.mixin.Definition=function(t,n,r,i,s){this.name=t,this.selectors=[new e.Selector([new e.Element(null,t)])],this.params=n,this.condition=i,this.variadic=s,this.arity=n.length,this.rules=r,this._lookups={},this.required=n.reduce(function(e,t){return!t.name||t.name&&!t.value?e+1:e},0),this.parent=e.Ruleset.prototype,this.frames=[]},e.mixin.Definition.prototype={type:"MixinDefinition",accept:function(e){this.params=e.visit(this.params),this.rules=e.visit(this.rules),this.condition=e.visit(this.condition)},toCSS:function(){return""},variable:function(e){return this.parent.variable.call(this,e)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},evalParams:function(t,n,r,i){var s=new e.Ruleset(null,[]),o,u,a=this.params.slice(0),f,l,c,h,p,d;n=new e.evalEnv(n,[s].concat(n.frames));if(r){r=r.slice(0);for(f=0;f<r.length;f++){u=r[f];if(h=u&&u.name){p=!1;for(l=0;l<a.length;l++)if(!i[l]&&h===a[l].name){i[l]=u.value.eval(t),s.rules.unshift(new e.Rule(h,u.value.eval(t))),p=!0;break}if(p){r.splice(f,1),f--;continue}throw{type:"Runtime",message:"Named argument for "+this.name+" "+r[f].name+" not found"}}}}d=0;for(f=0;f<a.length;f++){if(i[f])continue;u=r&&r[d];if(h=a[f].name)if(a[f].variadic&&r){o=[];for(l=d;l<r.length;l++)o.push(r[l].value.eval(t));s.rules.unshift(new e.Rule(h,(new e.Expression(o)).eval(t)))}else{c=u&&u.value;if(c)c=c.eval(t);else{if(!a[f].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+r.length+" for "+this.arity+")"};c=a[f].value.eval(n),s.resetCache()}s.rules.unshift(new e.Rule(h,c)),i[f]=c}if(a[f].variadic&&r)for(l=d;l<r.length;l++)i[l]=r[l].value.eval(t);d++}return s},eval:function(t,n,r){var i=[],s=this.frames.concat(t.frames),o=this.evalParams(t,new e.evalEnv(t,s),n,i),u,a,f,l;return o.rules.unshift(new e.Rule("@arguments",(new e.Expression(i)).eval(t))),a=r?this.parent.makeImportant.apply(this).rules:this.rules.slice(0),l=(new e.Ruleset(null,a)).eval(new e.evalEnv(t,[this,o].concat(s))),l.originalRuleset=this,l},matchCondition:function(t,n){return this.condition&&!this.condition.eval(new e.evalEnv(n,[this.evalParams(n,new e.evalEnv(n,this.frames.concat(n.frames)),t,[])].concat(n.frames)))?!1:!0},matchArgs:function(e,t){var n=e&&e.length||0,r,i;if(!this.variadic){if(n<this.required)return!1;if(n>this.params.length)return!1;if(this.required>0&&n>this.params.length)return!1}r=Math.min(n,this.arity);for(var s=0;s<r;s++)if(!this.params[s].name&&!this.params[s].variadic&&e[s].value.eval(t).toCSS()!=this.params[s].value.eval(t).toCSS())return!1;return!0}}}(n("../tree")),function(e){e.Negative=function(e){this.value=e},e.Negative.prototype={type:"Negative",accept:function(e){this.value=e.visit(this.value)},toCSS:function(e){return"-"+this.value.toCSS(e)},eval:function(t){return t.isMathOn()?(new e.Operation("*",[new e.Dimension(-1),this.value])).eval(t):new e.Negative(this.value.eval(t))}}}(n("../tree")),function(e){e.Operation=function(e,t,n){this.op=e.trim(),this.operands=t,this.isSpaced=n},e.Operation.prototype={type:"Operation",accept:function(e){this.operands=e.visit(this.operands)},eval:function(t){var n=this.operands[0].eval(t),r=this.operands[1].eval(t),i;if(t.isMathOn()){if(n instanceof e.Dimension&&r instanceof e.Color){if(this.op!=="*"&&this.op!=="+")throw{type:"Operation",message:"Can't substract or divide a color from a number"};i=r,r=n,n=i}if(!n.operate)throw{type:"Operation",message:"Operation on an invalid type"};return n.operate(t,this.op,r)}return new e.Operation(this.op,[n,r],this.isSpaced)},toCSS:function(e){var t=this.isSpaced?" ":"";return this.operands[0].toCSS()+t+this.op+t+this.operands[1].toCSS()}},e.operate=function(e,t,n,r){switch(t){case"+":return n+r;case"-":return n-r;case"*":return n*r;case"/":return n/r}}}(n("../tree")),function(e){e.Paren=function(e){this.value=e},e.Paren.prototype={type:"Paren",accept:function(e){this.value=e.visit(this.value)},toCSS:function(e){return"("+this.value.toCSS(e).trim()+")"},eval:function(t){return new e.Paren(this.value.eval(t))}}}(n("../tree")),function(e){e.Quoted=function(e,t,n,r,i){this.escaped=n,this.value=t||"",this.quote=e.charAt(0),this.index=r,this.currentFileInfo=i},e.Quoted.prototype={type:"Quoted",toCSS:function(){return this.escaped?this.value:this.quote+this.value+this.quote},eval:function(t){var n=this,r=this.value.replace(/`([^`]+)`/g,function(r,i){return(new e.JavaScript(i,n.index,!0)).eval(t).value}).replace(/@\{([\w-]+)\}/g,function(r,i){var s=(new e.Variable("@"+i,n.index,n.currentFileInfo)).eval(t,!0);return s instanceof e.Quoted?s.value:s.toCSS()});return new e.Quoted(this.quote+r+this.quote,r,this.escaped,this.index)},compare:function(e){if(!e.toCSS)return-1;var t=this.toCSS(),n=e.toCSS();return t===n?0:t<n?-1:1}}}(n("../tree")),function(e){e.Rule=function(t,n,r,i,s,o){this.name=t,this.value=n instanceof e.Value?n:new e.Value([n]),this.important=r?" "+r.trim():"",this.index=i,this.currentFileInfo=s,this.inline=o||!1,t.charAt(0)==="@"?this.variable=!0:this.variable=!1},e.Rule.prototype={type:"Rule",accept:function(e){this.value=e.visit(this.value)},toCSS:function(e){if(this.variable)return"";try{return this.name+(e.compress?":":": ")+this.value.toCSS(e)+this.important+(this.inline?"":";")}catch(t){throw t.index=this.index,t.filename=this.currentFileInfo.filename,t}},eval:function(t){var n=!1;this.name==="font"&&t.strictMath===!1&&(n=!0,t.strictMath=!0);try{return new e.Rule(this.name,this.value.eval(t),this.important,this.index,this.currentFileInfo,this.inline)}finally{n&&(t.strictMath=!1)}},makeImportant:function(){return new e.Rule(this.name,this.value,"!important",this.index,this.currentFileInfo,this.inline)}}}(n("../tree")),function(e){e.Ruleset=function(e,t,n){this.selectors=e,this.rules=t,this._lookups={},this.strictImports=n},e.Ruleset.prototype={type:"Ruleset",accept:function(e){this.selectors=e.visit(this.selectors),this.rules=e.visit(this.rules)},eval:function(t){var n=this.selectors&&this.selectors.map(function(e){return e.eval(t)}),r=new e.Ruleset(n,this.rules.slice(0),this.strictImports),i;r.originalRuleset=this,r.root=this.root,r.firstRoot=this.firstRoot,r.allowImports=this.allowImports,this.debugInfo&&(r.debugInfo=this.debugInfo),t.frames.unshift(r),t.selectors||(t.selectors=[]),t.selectors.unshift(this.selectors),(r.root||r.allowImports||!r.strictImports)&&r.evalImports(t);for(var s=0;s<r.rules.length;s++)r.rules[s]instanceof e.mixin.Definition&&(r.rules[s].frames=t.frames.slice(0));var o=t.mediaBlocks&&t.mediaBlocks.length||0;for(var s=0;s<r.rules.length;s++)r.rules[s]instanceof e.mixin.Call&&(i=r.rules[s].eval(t).filter(function(t){return t instanceof e.Rule&&t.variable?!r.variable(t.name):!0}),r.rules.splice.apply(r.rules,[s,1].concat(i)),s+=i.length-1,r.resetCache());for(var s=0,u;s<r.rules.length;s++)u=r.rules[s],u instanceof e.mixin.Definition||(r.rules[s]=u.eval?u.eval(t):u);t.frames.shift(),t.selectors.shift();if(t.mediaBlocks)for(var s=o;s<t.mediaBlocks.length;s++)t.mediaBlocks[s].bubbleSelectors(n);return r},evalImports:function(t){var n,r;for(n=0;n<this.rules.length;n++)this.rules[n]instanceof e.Import&&(r=this.rules[n].eval(t),typeof r.length=="number"?(this.rules.splice.apply(this.rules,[n,1].concat(r)),n+=r.length-1):this.rules.splice(n,1,r),this.resetCache())},makeImportant:function(){return new e.Ruleset(this.selectors,this.rules.map(function(e){return e.makeImportant?e.makeImportant():e}),this.strictImports)},matchArgs:function(e){return!e||e.length===0},resetCache:function(){this._rulesets=null,this._variables=null,this._lookups={}},variables:function(){return this._variables?this._variables:this._variables=this.rules.reduce(function(t,n){return n instanceof e.Rule&&n.variable===!0&&(t[n.name]=n),t},{})},variable:function(e){return this.variables()[e]},rulesets:function(){return this.rules.filter(function(t){return t instanceof e.Ruleset||t instanceof e.mixin.Definition})},find:function(t,n){n=n||this;var r=[],i,s,o=t.toCSS();return o in this._lookups?this._lookups[o]:(this.rulesets().forEach(function(i){if(i!==n)for(var o=0;o<i.selectors.length;o++)if(s=t.match(i.selectors[o])){t.elements.length>i.selectors[o].elements.length?Array.prototype.push.apply(r,i.find(new e.Selector(t.elements.slice(1)),n)):r.push(i);break}}),this._lookups[o]=r)},toCSS:function(t){var n=[],r=[],i=[],s=[],o,u,a;for(var f=0;f<this.rules.length;f++){a=this.rules[f];if(a.rules||a instanceof e.Media)s.push(a.toCSS(t));else if(a instanceof e.Directive){var l=a.toCSS(t);if(a.name==="@charset"){if(t.charset){a.debugInfo&&(s.push(e.debugInfo(t,a)),s.push((new e.Comment("/* "+l.replace(/\n/g,"")+" */\n")).toCSS(t)));continue}t.charset=!0}s.push(l)}else if(a instanceof e.Comment)a.silent||(this.root?s.push(a.toCSS(t)):r.push(a.toCSS(t)));else if(a.toCSS&&!a.variable){if(this.firstRoot&&a instanceof e.Rule)throw{message:"properties must be inside selector blocks, they cannot be in the root.",index:a.index,filename:a.currentFileInfo?a.currentFileInfo.filename:null};r.push(a.toCSS(t))}else a.value&&!a.variable&&r.push(a.value.toString())}t.compress&&r.length&&(a=r[r.length-1],a.charAt(a.length-1)===";"&&(r[r.length-1]=a.substring(0,a.length-1))),s=s.join("");if(this.root)n.push(r.join(t.compress?"":"\n"));else if(r.length>0){u=e.debugInfo(t,this),o=this.paths.map(function(e){return e.map(function(e){return e.toCSS(t)}).join("").trim()}).join(t.compress?",":",\n");for(var f=r.length-1;f>=0;f--)(r[f].slice(0,2)==="/*"||i.indexOf(r[f])===-1)&&i.unshift(r[f]);r=i,n.push(u+o+(t.compress?"{":" {\n ")+r.join(t.compress?"":"\n ")+(t.compress?"}":"\n}\n"))}return n.push(s),n.join("")+(t.compress?"\n":"")},joinSelectors:function(e,t,n){for(var r=0;r<n.length;r++)this.joinSelector(e,t,n[r])},joinSelector:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;for(i=0;i<r.elements.length;i++)f=r.elements[i],f.value==="&"&&(u=!0);if(!u){if(n.length>0)for(i=0;i<n.length;i++)t.push(n[i].concat(r));else t.push([r]);return}g=[],a=[[]];for(i=0;i<r.elements.length;i++){f=r.elements[i];if(f.value!=="&")g.push(f);else{y=[],g.length>0&&this.mergeElementsOnToSelectors(g,a);for(s=0;s<a.length;s++){l=a[s];if(n.length==0)l.length>0&&(l[0].elements=l[0].elements.slice(0),l[0].elements.push(new e.Element(f.combinator,"",0))),y.push(l);else for(o=0;o<n.length;o++)c=n[o],h=[],p=[],v=!0,l.length>0?(h=l.slice(0),m=h.pop(),d=new e.Selector(m.elements.slice(0),r.extendList),v=!1):d=new e.Selector([],r.extendList),c.length>1&&(p=p.concat(c.slice(1))),c.length>0&&(v=!1,d.elements.push(new e.Element(f.combinator,c[0].elements[0].value,0)),d.elements=d.elements.concat(c[0].elements.slice(1))),v||h.push(d),h=h.concat(p),y.push(h)}a=y,g=[]}}g.length>0&&this.mergeElementsOnToSelectors(g,a);for(i=0;i<a.length;i++)a[i].length>0&&t.push(a[i])},mergeElementsOnToSelectors:function(t,n){var r,i,s;if(n.length==0){n.push([new e.Selector(t)]);return}for(r=0;r<n.length;r++)i=n[r],i.length>0?i[i.length-1]=new e.Selector(i[i.length-1].elements.concat(t),i[i.length-1].extendList):i.push(new e.Selector(t))}}}(n("../tree")),function(e){e.Selector=function(e,t){this.elements=e,this.extendList=t||[]},e.Selector.prototype={type:"Selector",accept:function(e){this.elements=e.visit(this.elements),this.extendList=e.visit(this.extendList)},match:function(e){var t=this.elements,n=t.length,r,i,s,o;r=e.elements.slice(e.elements.length&&e.elements[0].value==="&"?1:0),i=r.length,s=Math.min(n,i);if(i===0||n<i)return!1;for(o=0;o<s;o++)if(t[o].value!==r[o].value)return!1;return!0},eval:function(t){return new e.Selector(this.elements.map(function(e){return e.eval(t)}),this.extendList.map(function(e){return e.eval(t)}))},toCSS:function(e){return this._css?this._css:(this.elements[0].combinator.value===""?this._css=" ":this._css="",this._css+=this.elements.map(function(t){return typeof t=="string"?" "+t.trim():t.toCSS(e)}).join(""),this._css)}}}(n("../tree")),function(e){e.UnicodeDescriptor=function(e){this.value=e},e.UnicodeDescriptor.prototype={type:"UnicodeDescriptor",toCSS:function(e){return this.value},eval:function(){return this
11
+ }}}(n("../tree")),function(e){e.URL=function(e,t){this.value=e,this.currentFileInfo=t},e.URL.prototype={type:"Url",accept:function(e){this.value=e.visit(this.value)},toCSS:function(){return"url("+this.value.toCSS()+")"},eval:function(t){var n=this.value.eval(t),r;return r=this.currentFileInfo&&this.currentFileInfo.rootpath,r&&typeof n.value=="string"&&t.isPathRelative(n.value)&&(n.quote||(r=r.replace(/[\(\)'"\s]/g,function(e){return"\\"+e})),n.value=r+n.value),new e.URL(n,null)}}}(n("../tree")),function(e){e.Value=function(e){this.value=e},e.Value.prototype={type:"Value",accept:function(e){this.value=e.visit(this.value)},eval:function(t){return this.value.length===1?this.value[0].eval(t):new e.Value(this.value.map(function(e){return e.eval(t)}))},toCSS:function(e){return this.value.map(function(t){return t.toCSS(e)}).join(e.compress?",":", ")}}}(n("../tree")),function(e){e.Variable=function(e,t,n){this.name=e,this.index=t,this.currentFileInfo=n},e.Variable.prototype={type:"Variable",eval:function(t){var n,r,i=this.name;i.indexOf("@@")==0&&(i="@"+(new e.Variable(i.slice(1))).eval(t).value);if(this.evaluating)throw{type:"Name",message:"Recursive variable definition for "+i,filename:this.currentFileInfo.file,index:this.index};this.evaluating=!0;if(n=e.find(t.frames,function(e){if(r=e.variable(i))return r.value.eval(t)}))return this.evaluating=!1,n;throw{type:"Name",message:"variable "+i+" is undefined",filename:this.currentFileInfo.filename,index:this.index}}}}(n("../tree")),function(e){e.debugInfo=function(t,n){var r="";if(t.dumpLineNumbers&&!t.compress)switch(t.dumpLineNumbers){case"comments":r=e.debugInfo.asComment(n);break;case"mediaquery":r=e.debugInfo.asMediaQuery(n);break;case"all":r=e.debugInfo.asComment(n)+e.debugInfo.asMediaQuery(n)}return r},e.debugInfo.asComment=function(e){return"/* line "+e.debugInfo.lineNumber+", "+e.debugInfo.fileName+" */\n"},e.debugInfo.asMediaQuery=function(e){return"@media -sass-debug-info{filename{font-family:"+("file://"+e.debugInfo.fileName).replace(/([.:/\\])/g,function(e){return e=="\\"&&(e="/"),"\\"+e})+"}line{font-family:\\00003"+e.debugInfo.lineNumber+"}}\n"},e.find=function(e,t){for(var n=0,r;n<e.length;n++)if(r=t.call(e,e[n]))return r;return null},e.jsify=function(e){return Array.isArray(e.value)&&e.value.length>1?"["+e.value.map(function(e){return e.toCSS(!1)}).join(", ")+"]":e.toCSS(!1)}}(n("./tree")),function(e){var t=["paths","optimization","files","contents","relativeUrls","strictImports","dumpLineNumbers","compress","processImports","mime","currentFileInfo"];e.parseEnv=function(e){r(e,this,t),this.contents||(this.contents={}),this.files||(this.files={});if(!this.currentFileInfo){var n=e.filename||"input";e.filename=null;var i=n.replace(/[^\/\\]*$/,"");this.currentFileInfo={filename:n,relativeUrls:this.relativeUrls,rootpath:e.rootpath||"",currentDirectory:i,entryPath:i,rootFilename:n}}},e.parseEnv.prototype.toSheet=function(t){var n=new e.parseEnv(this);return n.href=t,n.type=this.mime,n};var n=["silent","verbose","compress","ieCompat","strictMath","strictUnits"];e.evalEnv=function(e,t){r(e,this,n),this.frames=t||[]},e.evalEnv.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},e.evalEnv.prototype.outOfParenthesis=function(){this.parensStack.pop()},e.evalEnv.prototype.isMathOn=function(){return this.strictMath?this.parensStack&&this.parensStack.length:!0},e.evalEnv.prototype.isPathRelative=function(e){return!/^(?:[a-z-]+:|\/)/.test(e)};var r=function(e,t,n){if(!e)return;for(var r=0;r<n.length;r++)e.hasOwnProperty(n[r])&&(t[n[r]]=e[n[r]])}}(n("./tree")),function(e){e.visitor=function(e){this._implementation=e},e.visitor.prototype={visit:function(e){if(e instanceof Array)return this.visitArray(e);if(!e||!e.type)return e;var t="visit"+e.type,n=this._implementation[t],r,i;return n&&(r={visitDeeper:!0},i=n.call(this._implementation,e,r),this._implementation.isReplacing&&(e=i)),(!r||r.visitDeeper)&&e&&e.accept&&e.accept(this),t+="Out",this._implementation[t]&&this._implementation[t](e),e},visitArray:function(e){var t,n=[];for(t=0;t<e.length;t++){var r=this.visit(e[t]);r instanceof Array?n=n.concat(r):n.push(r)}return this._implementation.isReplacing?n:e}}}(n("./tree")),function(e){e.importVisitor=function(t,n,r){this._visitor=new e.visitor(this),this._importer=t,this._finish=n,this.env=r||new e.evalEnv,this.importCount=0},e.importVisitor.prototype={isReplacing:!0,run:function(e){var t;try{this._visitor.visit(e)}catch(n){t=n}this.isFinished=!0,this.importCount===0&&this._finish(t)},visitImport:function(t,n){var r=this,i;if(!t.css){try{i=t.evalForImport(this.env)}catch(s){s.filename||(s.index=t.index,s.filename=t.currentFileInfo.filename),t.css=!0,t.error=s}if(i&&!i.css){t=i,this.importCount++;var o=new e.evalEnv(this.env,this.env.frames.slice(0));this._importer.push(t.getPath(),t.currentFileInfo,function(n,i,s){n&&!n.filename&&(n.index=t.index,n.filename=t.currentFileInfo.filename),s&&!t.options.multiple&&(t.skip=s);var u=function(e){r.importCount--,r.importCount===0&&r.isFinished&&r._finish(e)};i?(t.root=i,(new e.importVisitor(r._importer,u,o)).run(i)):u()})}}return n.visitDeeper=!1,t},visitRule:function(e,t){return t.visitDeeper=!1,e},visitDirective:function(e,t){return this.env.frames.unshift(e),e},visitDirectiveOut:function(e){this.env.frames.shift()},visitMixinDefinition:function(e,t){return this.env.frames.unshift(e),e},visitMixinDefinitionOut:function(e){this.env.frames.shift()},visitRuleset:function(e,t){return this.env.frames.unshift(e),e},visitRulesetOut:function(e){this.env.frames.shift()},visitMedia:function(e,t){return this.env.frames.unshift(e.ruleset),e},visitMediaOut:function(e){this.env.frames.shift()}}}(n("./tree")),function(e){e.joinSelectorVisitor=function(){this.contexts=[[]],this._visitor=new e.visitor(this)},e.joinSelectorVisitor.prototype={run:function(e){return this._visitor.visit(e)},visitRule:function(e,t){t.visitDeeper=!1},visitMixinDefinition:function(e,t){t.visitDeeper=!1},visitRuleset:function(e,t){var n=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||(e.joinSelectors(r,n,e.selectors),e.paths=r)},visitRulesetOut:function(e){this.contexts.length=this.contexts.length-1},visitMedia:function(e,t){var n=this.contexts[this.contexts.length-1];e.ruleset.root=n.length===0||n[0].multiMedia}}}(n("./tree")),function(e){e.extendFinderVisitor=function(){this._visitor=new e.visitor(this),this.contexts=[],this.allExtendsStack=[[]]},e.extendFinderVisitor.prototype={run:function(e){return e=this._visitor.visit(e),e.allExtends=this.allExtendsStack[0],e},visitRule:function(e,t){t.visitDeeper=!1},visitMixinDefinition:function(e,t){t.visitDeeper=!1},visitRuleset:function(t,n){if(t.root)return;var r,i,s,o=[],u;for(r=0;r<t.rules.length;r++)t.rules[r]instanceof e.Extend&&o.push(t.rules[r]);for(r=0;r<t.paths.length;r++){var a=t.paths[r],f=a[a.length-1];u=f.extendList.slice(0).concat(o).map(function(e){return e.clone()});for(i=0;i<u.length;i++)this.foundExtends=!0,s=u[i],s.findSelfSelectors(a),s.ruleset=t,i===0&&(s.firstExtendOnThisSelectorPath=!0),this.allExtendsStack[this.allExtendsStack.length-1].push(s)}this.contexts.push(t.selectors)},visitRulesetOut:function(e){e.root||(this.contexts.length=this.contexts.length-1)},visitMedia:function(e,t){e.allExtends=[],this.allExtendsStack.push(e.allExtends)},visitMediaOut:function(e){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(e,t){e.allExtends=[],this.allExtendsStack.push(e.allExtends)},visitDirectiveOut:function(e){this.allExtendsStack.length=this.allExtendsStack.length-1}},e.processExtendsVisitor=function(){this._visitor=new e.visitor(this)},e.processExtendsVisitor.prototype={run:function(t){var n=new e.extendFinderVisitor;return n.run(t),n.foundExtends?(t.allExtends=t.allExtends.concat(this.doExtendChaining(t.allExtends,t.allExtends)),this.allExtendsStack=[t.allExtends],this._visitor.visit(t)):t},doExtendChaining:function(t,n,r){var i,s,o,u=[],a,f=this,l,c,h;r=r||0;for(i=0;i<t.length;i++)for(s=0;s<n.length;s++){c=t[i],h=n[s];if(this.inInheritanceChain(h,c))continue;l=[h.selfSelectors[0]],o=f.findMatch(c,l),o.length&&c.selfSelectors.forEach(function(t){a=f.extendSelector(o,l,t),newExtend=new e.Extend(h.selector,h.option,0),newExtend.selfSelectors=a,a[a.length-1].extendList=[newExtend],u.push(newExtend),newExtend.ruleset=h.ruleset,newExtend.parents=[h,c],h.firstExtendOnThisSelectorPath&&(newExtend.firstExtendOnThisSelectorPath=!0,h.ruleset.paths.push(a))})}if(u.length){this.extendChainCount++;if(r>100){var p="{unable to calculate}",d="{unable to calculate}";try{p=u[0].selfSelectors[0].toCSS(),d=u[0].selector.toCSS()}catch(v){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+p+":extend("+d+")"}}return u.concat(f.doExtendChaining(u,n,r+1))}return u},inInheritanceChain:function(e,t){if(e===t)return!0;if(t.parents){if(this.inInheritanceChain(e,t.parents[0]))return!0;if(this.inInheritanceChain(e,t.parents[1]))return!0}return!1},visitRule:function(e,t){t.visitDeeper=!1},visitMixinDefinition:function(e,t){t.visitDeeper=!1},visitSelector:function(e,t){t.visitDeeper=!1},visitRuleset:function(e,t){if(e.root)return;var n,r,i,s=this.allExtendsStack[this.allExtendsStack.length-1],o=[],u=this;for(i=0;i<s.length;i++)for(r=0;r<e.paths.length;r++){selectorPath=e.paths[r];if(selectorPath[selectorPath.length-1].extendList.length)continue;n=this.findMatch(s[i],selectorPath),n.length&&s[i].selfSelectors.forEach(function(e){o.push(u.extendSelector(n,selectorPath,e))})}e.paths=e.paths.concat(o)},findMatch:function(e,t){var n,r,i,s,o,u,a=this,f=e.selector.elements,l=[],c,h=[];for(n=0;n<t.length;n++){r=t[n];for(i=0;i<r.elements.length;i++){s=r.elements[i],(e.allowBefore||n==0&&i==0)&&l.push({pathIndex:n,index:i,matched:0,initialCombinator:s.combinator});for(u=0;u<l.length;u++)c=l[u],o=s.combinator.value,o==""&&i===0&&(o=" "),!a.isElementValuesEqual(f[c.matched].value,s.value)||c.matched>0&&f[c.matched].combinator.value!==o?c=null:c.matched++,c&&(c.finished=c.matched===f.length,c.finished&&!e.allowAfter&&(i+1<r.elements.length||n+1<t.length)&&(c=null)),c?c.finished&&(c.length=f.length,c.endPathIndex=n,c.endPathElementIndex=i+1,l.length=0,h.push(c)):(l.splice(u,1),u--)}}return h},isElementValuesEqual:function(t,n){if(typeof t=="string"||typeof n=="string")return t===n;if(t instanceof e.Attribute)return t.op!==n.op||t.key!==n.key?!1:!t.value||!n.value?t.value||n.value?!1:!0:(t=t.value.value||t.value,n=n.value.value||n.value,t===n);return!1},extendSelector:function(t,n,r){var i=0,s=0,o=[],u,a,f;for(u=0;u<t.length;u++)match=t[u],a=n[match.pathIndex],f=new e.Element(match.initialCombinator,r.elements[0].value,r.elements[0].index),match.pathIndex>i&&s>0&&(o[o.length-1].elements=o[o.length-1].elements.concat(n[i].elements.slice(s)),s=0,i++),o=o.concat(n.slice(i,match.pathIndex)),o.push(new e.Selector(a.elements.slice(s,match.index).concat([f]).concat(r.elements.slice(1)))),i=match.endPathIndex,s=match.endPathElementIndex,s>=a.elements.length&&(s=0,i++);return i<n.length&&s>0&&(o[o.length-1].elements=o[o.length-1].elements.concat(n[i].elements.slice(s)),s=0,i++),o=o.concat(n.slice(i,n.length)),o},visitRulesetOut:function(e){},visitMedia:function(e,t){var n=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);n=n.concat(this.doExtendChaining(n,e.allExtends)),this.allExtendsStack.push(n)},visitMediaOut:function(e){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(e,t){var n=e.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);n=n.concat(this.doExtendChaining(n,e.allExtends)),this.allExtendsStack.push(n)},visitDirectiveOut:function(e){this.allExtendsStack.length=this.allExtendsStack.length-1}}}(n("./tree"));var o=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);r.env=r.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||o?"development":"production"),r.async=r.async||!1,r.fileAsync=r.fileAsync||!1,r.poll=r.poll||(o?1e3:1500);if(r.functions)for(var u in r.functions)r.tree.functions[u]=r.functions[u];var a=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);a&&(r.dumpLineNumbers=a[1]),r.watch=function(){return r.watchMode||(r.env="development",f()),this.watchMode=!0},r.unwatch=function(){return clearInterval(r.watchTimer),this.watchMode=!1},/!watch/.test(location.hash)&&r.watch();var l=null;if(r.env!="development")try{l=typeof e.localStorage=="undefined"?null:e.localStorage}catch(c){}var h=document.getElementsByTagName("link"),p=/^text\/(x-)?less$/;r.sheets=[];for(var d=0;d<h.length;d++)(h[d].rel==="stylesheet/less"||h[d].rel.match(/stylesheet/)&&h[d].type.match(p))&&r.sheets.push(h[d]);var v="";r.modifyVars=function(e){var t=v;for(name in e)t+=(name.slice(0,1)==="@"?"":"@")+name+": "+(e[name].slice(-1)===";"?e[name]:e[name]+";");(new r.Parser(new r.tree.parseEnv(r))).parse(t,function(e,t){e?k(e,"session_cache"):S(t.toCSS(r),r.sheets[r.sheets.length-1])})},r.refresh=function(e){var t,n;t=n=new Date,g(function(e,i,s,o,u){if(e)return k(e,o.href);u.local?C("loading "+o.href+" from cache."):(C("parsed "+o.href+" successfully."),S(i.toCSS(r),o,u.lastModified)),C("css for "+o.href+" generated in "+(new Date-n)+"ms"),u.remaining===0&&C("css generated in "+(new Date-t)+"ms"),n=new Date},e),m()},r.refreshStyles=m,r.refresh(r.env==="development"),typeof define=="function"&&define.amd&&define(function(){return r})})(window);