carto/dist/less-1.0.30.min.js
2010-07-01 11:15:49 +02:00

64 lines
29 KiB
JavaScript

//
// LESS - Leaner CSS v1.0.30
// http://lesscss.org
//
// Copyright (c) 2010, Alexis Sellier
// Licensed under the Apache 2.0 License.
//
(function(F){function q(d){return F.less[d.split("/")[1]]}function R(d,b){for(var e=0;e<o.sheets.length;e++)S(o.sheets[e],d,b,o.sheets.length-(e+1))}function S(d,b,e,g){var a=d.href.replace(/\?.*$/,""),j=D&&D.getItem(a),i=D&&D.getItem(a+":timestamp"),h={css:j,timestamp:i};Z(d.href,function(n,r){if(!e&&h&&(new Date(r)).valueOf()===(new Date(h.timestamp)).valueOf()){O(h.css,d);b(null,d,{local:true,remaining:g})}else(new o.Parser({optimization:o.optimization,paths:[a.replace(/[\w\.-]+$/,"")]})).parse(n,
function(x,t){if(x)return T(x,a);try{b(t,d,{local:false,lastModified:r,remaining:g});$(document.getElementById("less-error-message:"+a.replace(/[^a-z]+/gi,"-")))}catch(u){T(u,a)}})},function(n,r){throw new Error("Couldn't load "+r+" ("+n+")");})}function O(d,b,e){var g,a=b.href?b.href.replace(/\?.*$/,""):"",j="less:"+(b.title||a.match(/(?:^|\/)([-\w]+)\.[a-z]+$/i)[1]);if((g=document.getElementById(j))===null){g=document.createElement("style");g.type="text/css";g.media=b.media;g.id=j;document.getElementsByTagName("head")[0].appendChild(g)}if(g.styleSheet)try{g.styleSheet.cssText=
d}catch(i){throw new Error("Couldn't reassign styleSheet.cssText.");}else(function(h){if(g.childNodes.length>0)g.firstChild.nodeValue!==h.nodeValue&&g.replaceChild(h,g.firstChild);else g.appendChild(h)})(document.createTextNode(d));if(e&&D){J("saving "+a+" to cache.");D.setItem(a,d);D.setItem(a+":timestamp",e)}}function Z(d,b,e){function g(i,h,n){if(i.status>=200&&i.status<300)h(i.responseText,i.getResponseHeader("Last-Modified"));else typeof n==="function"&&n(i.status,d)}var a=aa(),j=P?false:o.async;
typeof a.overrideMimeType==="function"&&a.overrideMimeType("text/css");a.open("GET",d,j);a.send(null);if(P)a.status===0?b(a.responseText):e(a.status);else if(j)a.onreadystatechange=function(){a.readyState==4&&g(a,b,e)};else g(a,b,e)}function aa(){if(F.XMLHttpRequest)return new XMLHttpRequest;else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(d){J("browser doesn't support AJAX.");return null}}function $(d){return d&&d.parentNode.removeChild(d)}function J(d){o.env=="development"&&typeof console!==
"undefined"&&console.log("less: "+d)}function T(d,b){var e="less-error-message:"+b.replace(/[^a-z]+/ig,"-");if(!d.extract)throw d;var g=document.createElement("div"),a;g.id=e;g.className="less-error-message";g.innerHTML="<h3>"+(d.message||"There is an error in your .less file")+'</h3><p><a href="'+b+'">'+b+"</a> on line "+d.line+", column "+(d.column+1)+":</p>"+'<div>\n<pre class="ctx"><span>[-1]</span>{0}</pre>\n<pre><span>[0]</span>{current}</pre>\n<pre class="ctx"><span>[1]</span>{2}</pre>\n</div>'.replace(/\[(-?\d)\]/g,
function(j,i){return parseInt(d.line)+parseInt(i)||""}).replace(/\{(\d)\}/g,function(j,i){return d.extract[parseInt(i)]||""}).replace(/\{current\}/,d.extract[1].slice(0,d.column)+'<span class="error">'+d.extract[1].slice(d.column)+"</span>");O(".less-error-message span {\nmargin-right: 15px;\n}\n.less-error-message pre {\ncolor: #ee4444;\npadding: 4px 0;\nmargin: 0;\n}\n.less-error-message pre.ctx {\ncolor: #dd7777;\n}\n.less-error-message h3 {\npadding: 15px 0 5px 0;\nmargin: 0;\n}\n.less-error-message a {\ncolor: #10a\n}\n.less-error-message .error {\ncolor: red;\nfont-weight: bold;\npadding-bottom: 2px;\nborder-bottom: 1px dashed red;\n}",
{title:"error-message"});g.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";if(o.env=="development")a=setInterval(function(){if(document.body){document.getElementById(e)?document.body.replaceChild(g,document.getElementById(e)):document.body.insertBefore(g,document.body.firstChild);clearInterval(a)}},10)}if(!Array.isArray)Array.isArray=function(d){return Object.prototype.toString.call(d)===
"[object Array]"||d instanceof Array};if(!Array.prototype.forEach)Array.prototype.forEach=function(d,b){for(var e=this.length>>>0,g=0;g<e;g++)g in this&&d.call(b,this[g],g,this)};if(!Array.prototype.map)Array.prototype.map=function(d,b){for(var e=this.length>>>0,g=new Array(e),a=0;a<e;a++)if(a in this)g[a]=d.call(b,this[a],a,this);return g};if(!Array.prototype.filter)Array.prototype.filter=function(d,b){for(var e=[],g=0;g<this.length;g++)d.call(b,this[g])&&e.push(this[g]);return e};if(!Array.prototype.reduce)Array.prototype.reduce=
function(d){var b=this.length>>>0,e=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var g=arguments[1];else{do{if(e in this){g=this[e++];break}if(++e>=b)throw new TypeError;}while(1)}for(;e<b;e++)if(e in this)g=d.call(null,g,this[e],e,this);return g};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(d,b){var e=this.length;b=b||0;if(!e)return-1;if(b>=e)return-1;if(b<0)b+=e;for(;b<e;b++)if(Object.prototype.hasOwnProperty.call(this,b))if(d===this[b])return b;return-1};
if(!Object.keys)Object.keys=function(d){var b=[];for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&b.push(e);return b};if(!String.prototype.trim)String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var o,m;if(typeof F==="undefined"){o=exports;m=q("less/tree")}else{o=F.less={};m=F.less.tree={}}o.Parser=function(d){function b(){r=u[n];H=x=h}function e(){u[n]=r;H=h=x}function g(){if(h>H){u[n]=u[n].slice(h-H);H=h}}function a(f){var k,l,p;if(f instanceof
Function)return f.call(U.parsers);else if(typeof f==="string"){f=i.charAt(h)===f?f:null;k=1;g()}else{g();if(f=f.exec(u[n]))k=f[0].length;else return null}if(f){mem=h+=k;for(p=h+u[n].length-k;h<p;){l=i.charCodeAt(h);if(!(l===32||l===10||l===9))break;h++}u[n]=u[n].slice(k+(h-mem));H=h;u[n].length===0&&n<u.length-1&&n++;return typeof f==="string"?f:f.length===1?f[0]:f}}function j(f){return typeof f==="string"?i.charAt(h)===f:f.test(u[n])?true:false}var i,h,n,r,x,t,u,H,U,V=function(){},W=this.imports=
{paths:d&&d.paths||[],queue:[],files:{},push:function(f,k){var l=this;this.queue.push(f);o.Parser.importer(f,this.paths,function(p){l.queue.splice(l.queue.indexOf(f),1);l.files[f]=p;k(p);l.queue.length===0&&V()})}};this.env=d=d||{};this.optimization="optimization"in this.env?this.env.optimization:1;this.env.filename=this.env.filename||null;return U={imports:W,parse:function(f,k){var l,p,K=null;h=n=H=t=0;u=[];i=f.replace(/\r\n/g,"\n");u=function(L){for(var I=0,G=/[^"'\{\}\/]+/g,A=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
B=0,w,z=L[0],C,s=0,v;s<i.length;s++){G.lastIndex=s;if(w=G.exec(i))if(w.index===s){s+=w[0].length;z.push(w[0])}v=i.charAt(s);A.lastIndex=s;if(!C&&v==="/"){w=i.charAt(s+1);if(w==="/"||w==="*")if(w=A.exec(i))if(w.index===s){s+=w[0].length;z.push(w[0]);v=i.charAt(s)}}if(v==="{"&&!C){B++;z.push(v)}else if(v==="}"&&!C){B--;z.push(v);L[++I]=z=[]}else{if(v==='"'||v==="'")C=C?C===v?false:C:v;z.push(v)}}if(B>0)throw new Error("Missing closing '}'");return L.map(function(E){return E.join("")})}([[]]);l=new m.Ruleset([],
a(this.parsers.primary));l.root=true;l.toCSS=function(L){var I,G;return function(A,B){function w(v){return(i.slice(0,v).match(/\n/g)||"").length}var z=[];A=A||{};if(typeof B==="object"&&!Array.isArray(B)){B=Object.keys(B).map(function(v){var E=B[v];if(!(E instanceof m.Value)){E instanceof m.Expression||(E=new m.Expression([E]));E=new m.Value([E])}return new m.Rule("@"+v,E,false,0)});z=[new m.Ruleset(null,B)]}try{var C=L.call(this,[],{frames:z,compress:A.compress||false})}catch(s){G=i.split("\n");
I=w(s.index);A=s.index;for(z=-1;A>=0&&i.charAt(A)!=="\n";A--)z++;throw{name:"NameError",message:s.message,filename:d.filename,index:s.index,line:I+1,callLine:s.call&&w(s.call)+1,callExtract:G[w(s.call)-1],stack:s.stack,column:z,extract:[G[I-1],G[I],G[I+1]]};}return A.compress?C.replace(/(\s)+/g,"$1"):C}}(l.toCSS);if(h<i.length-1){h=t;p=i.split("\n");f=(i.slice(0,h).match(/\n/g)||"").length+1;for(var Q=h,X=-1;Q>=0&&i.charAt(Q)!=="\n";Q--)X++;K={name:"ParseError",message:"Syntax Error on line "+f,filename:d.filename,
line:f,column:X,extract:[p[f-2],p[f-1],p[f]]}}if(this.imports.queue.length>0)V=function(){k(K,l)};else k(K,l)},parsers:{primary:function(){for(var f,k=[];(f=a(this.mixin.definition)||a(this.rule)||a(this.ruleset)||a(this.mixin.call)||a(this.comment)||a(this.directive))||a(/^[\s\n]+/);)f&&k.push(f);return k},comment:function(){var f;if(i.charAt(h)==="/")if(i.charAt(h+1)==="/")return new m.Comment(a(/^\/\/.*/),true);else if(f=a(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new m.Comment(f)},entities:{quoted:function(){var f;
if(!(i.charAt(h)!=='"'&&i.charAt(h)!=="'"))if(f=a(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new m.Quoted(f[0],f[1]||f[2])},keyword:function(){var f;if(f=a(/^[A-Za-z-]+/))return new m.Keyword(f)},call:function(){var f,k;if(f=a(/^([\w-]+|%)\(/)){if(f[1].toLowerCase()==="alpha")return a(this.alpha);k=a(this.entities.arguments);if(a(")"))if(f)return new m.Call(f[1],k)}},arguments:function(){for(var f=[],k;k=a(this.expression);){f.push(k);if(!a(","))break}return f},literal:function(){return a(this.entities.dimension)||
a(this.entities.color)||a(this.entities.quoted)},url:function(){var f;if(!(i.charAt(h)!=="u"||!a(/^url\(/))){f=a(this.entities.quoted)||a(/^[-\w%@$\/.&=:;#+?]+/);if(!a(")"))throw new Error("missing closing ) for url()");return new m.URL(f.value?f:new m.Anonymous(f))}},variable:function(){var f,k=h;if(i.charAt(h)==="@"&&(f=a(/^@[\w-]+/)))return new m.Variable(f,k)},color:function(){var f;if(i.charAt(h)==="#"&&(f=a(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new m.Color(f[1])},dimension:function(){var f;
f=i.charCodeAt(h);if(!(f>57||f<45||f===47))if(f=a(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm)?/))return new m.Dimension(f[1],f[2])}},variable:function(){var f;if(i.charAt(h)==="@"&&(f=a(/^(@[\w-]+)\s*:/)))return f[1]},shorthand:function(){var f,k;if(j(/^[@\w.-]+\/[@\w.-]+/))if((f=a(this.entity))&&a("/")&&(k=a(this.entity)))return new m.Shorthand(f,k)},mixin:{call:function(){var f=[],k,l,p,K=h;k=i.charAt(h);if(!(k!=="."&&k!=="#")){for(;k=a(/^[#.][\w-]+/);){f.push(new m.Element(l,k));l=a(">")}a("(")&&
(p=a(this.entities.arguments))&&a(")");if(f.length>0&&(a(";")||j("}")))return new m.mixin.Call(f,p,K)}},definition:function(){var f,k=[],l,p;if(!(i.charAt(h)!=="."||j(/^[^{]*(;|})/)))if(f=a(/^([#.][\w-]+)\s*\(/)){for(f=f[1];l=a(/^@[\w-]+/)||a(this.entities.literal)||a(this.entities.keyword);){if(l[0]==="@")if(a(":"))if(p=a(this.expression))k.push({name:l,value:p});else throw new Error("Expected value");else k.push({name:l});else k.push({value:l});if(!a(","))break}if(!a(")"))throw new Error("Expected )");
if(l=a(this.block))return new m.mixin.Definition(f,k,l)}}},entity:function(){return a(this.entities.literal)||a(this.entities.variable)||a(this.entities.url)||a(this.entities.call)||a(this.entities.keyword)},end:function(){return a(";")||j("}")},alpha:function(){var f;if(a(/^opacity=/i))if(f=a(/^\d+/)||a(this.entities.variable)){if(!a(")"))throw new Error("missing closing ) for alpha()");return new m.Alpha(f)}},element:function(){var f;c=a(this.combinator);if(f=a(/^[.#:]?[\w-]+/)||a("*")||a(this.attribute)||
a(/^\([^)@]+\)/))return new m.Element(c,f)},combinator:function(){var f=i.charAt(h);if(f===">"||f==="&"||f==="+"||f==="~"){for(h++;i.charAt(h)===" ";)h++;return new m.Combinator(f)}else if(f===":"&&i.charAt(h+1)===":"){for(h+=2;i.charAt(h)===" ";)h++;return new m.Combinator("::")}else return i.charAt(h-1)===" "?new m.Combinator(" "):new m.Combinator(null)},selector:function(){for(var f,k=[],l;f=a(this.element);){l=i.charAt(h);k.push(f);if(l==="{"||l==="}"||l===";"||l===",")break}if(k.length>0)return new m.Selector(k)},
tag:function(){return a(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||a("*")},attribute:function(){var f="",k,l,p;if(a("[")){if(k=a(/^[a-z-]+/)||a(this.entities.quoted))f=(p=a(/^[|~*$^]?=/))&&(l=a(this.entities.quoted)||a(/^[\w-]+/))?[k,p,l.toCSS?l.toCSS():l].join(""):k;if(a("]"))if(f)return"["+f+"]"}},block:function(){var f;if(a("{")&&(f=a(this.primary))&&a("}"))return f},ruleset:function(){var f=[],k,l;b();if(k=/^([.#: \w-]+)[\s\n]*\{/.exec(u[n])){h+=k[0].length-1;f=[new m.Selector([new m.Element(null,k[1])])]}else{for(;k=
a(this.selector);){f.push(k);if(!a(","))break}k&&a(this.comment)}if(f.length>0&&(l=a(this.block)))return new m.Ruleset(f,l);else{t=h;e()}},rule:function(){var f;f=i.charAt(h);var k;b();if(!(f==="."||f==="#"||f==="&"))if(name=a(this.variable)||a(this.property)){if(name.charAt(0)!="@"&&(match=/^([^@+\/'"*(;{}-]*);/.exec(u[n]))){h+=match[0].length-1;f=new m.Anonymous(match[1])}else f=name==="font"?a(this.font):a(this.value);k=a(this.important);if(f&&a(this.end))return new m.Rule(name,f,k,x);else{t=h;
e()}}},"import":function(){var f;if(a(/^@import\s+/)&&(f=a(this.entities.quoted)||a(this.entities.url))&&a(";"))return new m.Import(f,W)},directive:function(){var f,k,l;if(i.charAt(h)==="@")if(k=a(this["import"]))return k;else if(f=a(/^@media|@page/)){l=a(/^[^{]+/).trim();if(k=a(this.block))return new m.Directive(f+" "+l,k)}else if(f=a(/^@[-a-z]+/))if(f==="@font-face"){if(k=a(this.block))return new m.Directive(f,k)}else if((k=a(this.entity))&&a(";"))return new m.Directive(f,k)},font:function(){for(var f=
[],k=[],l;l=a(this.shorthand)||a(this.entity);)k.push(l);f.push(new m.Expression(k));if(a(","))for(;l=a(this.expression);){f.push(l);if(!a(","))break}return new m.Value(f)},value:function(){for(var f,k=[];f=a(this.expression);){k.push(f);if(!a(","))break}if(k.length>0)return new m.Value(k)},important:function(){if(i.charAt(h)==="!")return a(/^! *important/)},sub:function(){var f;if(a("(")&&(f=a(this.expression))&&a(")"))return f},multiplication:function(){var f,k,l,p;if(f=a(this.operand)){for(;(l=
a("/")||a("*"))&&(k=a(this.operand));)p=new m.Operation(l,[p||f,k]);return p||f}},addition:function(){var f,k,l,p;if(f=a(this.multiplication)){for(;(l=a(/^[-+]\s+/)||i.charAt(h-1)!=" "&&(a("+")||a("-")))&&(k=a(this.multiplication));)p=new m.Operation(l,[p||f,k]);return p||f}},operand:function(){return a(this.sub)||a(this.entities.dimension)||a(this.entities.color)||a(this.entities.variable)},expression:function(){for(var f,k=[];f=a(this.addition)||a(this.entity);)k.push(f);if(k.length>0)return new m.Expression(k)},
property:function(){var f;if(f=a(/^(\*?-?[-a-z_0-9]+)\s*:/))return f[1]}}}};if(typeof F!=="undefined")o.Parser.importer=function(d,b,e){if(d[0]!=="/"&&b.length>0)d=b[0]+d;S({href:d,title:d},function(g){e(g)})};(function(d){function b(a){return d.functions.hsla(a.h,a.s,a.l,a.a)}function e(a){if(a instanceof d.Dimension)return parseFloat(a.unit=="%"?a.value/100:a.value);else if(typeof a==="number")return a;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function g(a){return Math.min(1,
Math.max(0,a))}d.functions={rgb:function(a,j,i){return this.rgba(a,j,i,1)},rgba:function(a,j,i,h){a=[a,j,i].map(function(n){return e(n)});h=e(h);return new d.Color(a,h)},hsl:function(a,j,i){return this.hsla(a,j,i,1)},hsla:function(a,j,i,h){function n(t){t=t<0?t+1:t>1?t-1:t;return t*6<1?x+(r-x)*t*6:t*2<1?r:t*3<2?x+(r-x)*(2/3-t)*6:x}a=e(a)%360/360;j=e(j);i=e(i);h=e(h);var r=i<=0.5?i*(j+1):i+j-i*j,x=i*2-r;return this.rgba(n(a+1/3)*255,n(a)*255,n(a-1/3)*255,h)},hue:function(a){return new d.Dimension(Math.round(a.toHSL().h))},
saturation:function(a){return new d.Dimension(Math.round(a.toHSL().s*100),"%")},lightness:function(a){return new d.Dimension(Math.round(a.toHSL().l*100),"%")},alpha:function(a){return new d.Dimension(a.toHSL().a)},saturate:function(a,j){a=a.toHSL();a.s+=j.value/100;a.s=g(a.s);return b(a)},desaturate:function(a,j){a=a.toHSL();a.s-=j.value/100;a.s=g(a.s);return b(a)},lighten:function(a,j){a=a.toHSL();a.l+=j.value/100;a.l=g(a.l);return b(a)},darken:function(a,j){a=a.toHSL();a.l-=j.value/100;a.l=g(a.l);
return b(a)},spin:function(a,j){a=a.toHSL();j=(a.h+j.value)%360;a.h=j<0?360+j:j;return b(a)},greyscale:function(a){return this.desaturate(a,new d.Dimension(100))},e:function(a){return new d.Anonymous(a)},"%":function(a){for(var j=Array.prototype.slice.call(arguments,1),i=a.content,h=0;h<j.length;h++)i=i.replace(/%s/,j[h].content).replace(/%[da]/,j[h].toCSS());i=i.replace(/%%/g,"%");return new d.Quoted('"'+i+'"',i)}}})(q("less/tree"));(function(d){d.Alpha=function(b){this.value=b};d.Alpha.prototype=
{toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"},eval:function(){return this}}})(q("less/tree"));(function(d){d.Anonymous=function(b){this.value=b.content||b};d.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Call=function(b,e){this.name=b;this.args=e};d.Call.prototype={eval:function(b){var e=this.args.map(function(g){return g.eval(b)});return this.name in d.functions?d.functions[this.name].apply(d.functions,
e):new d.Anonymous(this.name+"("+e.map(function(g){return g.toCSS()}).join(", ")+")")},toCSS:function(b){return this.eval(b).toCSS()}}})(q("less/tree"));(function(d){d.Color=function(b,e){this.rgb=Array.isArray(b)?b:b.length==6?b.match(/.{2}/g).map(function(g){return parseInt(g,16)}):b.split("").map(function(g){return parseInt(g+g,16)});this.alpha=typeof e==="number"?e:1};d.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha<1?"rgba("+this.rgb.map(function(b){return Math.round(b)}).concat(this.alpha).join(", ")+
")":"#"+this.rgb.map(function(b){b=Math.round(b);b=(b>255?255:b<0?0:b).toString(16);return b.length===1?"0"+b:b}).join("")},operate:function(b,e){var g=[];e instanceof d.Color||(e=e.toColor());for(var a=0;a<3;a++)g[a]=d.operate(b,this.rgb[a],e.rgb[a]);return new d.Color(g)},toHSL:function(){var b=this.rgb[0]/255,e=this.rgb[1]/255,g=this.rgb[2]/255,a=this.alpha,j=Math.max(b,e,g),i=Math.min(b,e,g),h,n=(j+i)/2,r=j-i;if(j===i)h=i=0;else{i=n>0.5?r/(2-j-i):r/(j+i);switch(j){case b:h=(e-g)/r+(e<g?6:0);break;
case e:h=(g-b)/r+2;break;case g:h=(b-e)/r+4;break}h/=6}return{h:h*360,s:i,l:n,a:a}}}})(q("less/tree"));(function(d){d.Comment=function(b,e){this.value=b;this.silent=!!e};d.Comment.prototype={toCSS:function(b){return b.compress?"":this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Dimension=function(b,e){this.value=parseFloat(b);this.unit=e||null};d.Dimension.prototype={eval:function(){return this},toColor:function(){return new d.Color([this.value,this.value,this.value])},toCSS:function(){return this.value+
this.unit},operate:function(b,e){return new d.Dimension(d.operate(b,this.value,e.value),this.unit||e.unit)}}})(q("less/tree"));(function(d){d.Directive=function(b,e){this.name=b;if(Array.isArray(e))this.ruleset=new d.Ruleset([],e);else this.value=e};d.Directive.prototype={toCSS:function(b,e){if(this.ruleset){this.ruleset.root=true;return this.name+(e.compress?"{":" {\n ")+this.ruleset.toCSS(b,e).trim().replace(/\n/g,"\n ")+(e.compress?"}":"\n}\n")}else return this.name+" "+this.value.toCSS()+";\n"},
eval:function(b){b.frames.unshift(this);this.ruleset&&this.ruleset.evalRules(b);b.frames.shift();return this},variable:function(b){return d.Ruleset.prototype.variable.call(this.ruleset,b)},find:function(){return d.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return d.Ruleset.prototype.rulesets.apply(this.ruleset)}}})(q("less/tree"));(function(d){d.Element=function(b,e){this.combinator=b instanceof d.Combinator?b:new d.Combinator(b);this.value=e.trim()};d.Element.prototype.toCSS=
function(b){return this.combinator.toCSS(b||{})+this.value};d.Combinator=function(b){this.value=b===" "?" ":b?b.trim():""};d.Combinator.prototype.toCSS=function(b){return{"":""," ":" ","&":"",":":" :","::":"::","+":b.compress?"+":" + ","~":b.compress?"~":" ~ ",">":b.compress?">":" > "}[this.value]}})(q("less/tree"));(function(d){d.Expression=function(b){this.value=b};d.Expression.prototype={eval:function(b){return this.value.length>1?new d.Expression(this.value.map(function(e){return e.eval(b)})):
this.value[0].eval(b)},toCSS:function(){return this.value.map(function(b){return b.toCSS()}).join(" ")}}})(q("less/tree"));(function(d){d.Import=function(b,e){var g=this;this._path=b;this.path=b instanceof d.Quoted?/\.(le?|c)ss$/.test(b.content)?b.content:b.content+".less":b.value.content||b.value;(this.css=/css$/.test(this.path))||e.push(this.path,function(a){if(!a)throw new Error("Error parsing "+g.path);g.root=a})};d.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+
";\n":""},eval:function(){if(this.css)return this;else{for(var b=0;b<this.root.rules.length;b++)this.root.rules[b]instanceof d.Import&&Array.prototype.splice.apply(this.root.rules,[b,1].concat(this.root.rules[b].eval()));return this.root.rules}}}})(q("less/tree"));(function(d){d.Keyword=function(b){this.value=b};d.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value}}})(q("less/tree"));(function(d){d.mixin={};d.mixin.Call=function(b,e,g){this.selector=new d.Selector(b);
this.arguments=e;this.index=g};d.mixin.Call.prototype={eval:function(b){for(var e,g=[],a=false,j=0;j<b.frames.length;j++)if((e=b.frames[j].find(this.selector)).length>0){for(j=0;j<e.length;j++)if(e[j].match(this.arguments,b))try{Array.prototype.push.apply(g,e[j].eval(this.arguments,b).rules);a=true}catch(i){throw{message:i.message,index:i.index,call:this.index};}if(a)return g;else throw{message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(h){return h.toCSS()}).join(", ")+
")`",index:this.index};}throw{message:this.selector.toCSS().trim()+" is undefined",index:this.index};}};d.mixin.Definition=function(b,e,g){this.name=b;this.selectors=[new d.Selector([new d.Element(null,b)])];this.params=e;this.arity=e.length;this.rules=g;this._lookups={};this.required=e.reduce(function(a,j){return j.name&&!j.value?a+1:a},0);this.parent=d.Ruleset.prototype};d.mixin.Definition.prototype={toCSS:function(){return""},variable:function(b){return this.parent.variable.call(this,b)},find:function(){return this.parent.find.apply(this,
arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},eval:function(b,e){for(var g=new d.Ruleset(null,[]),a=0,j;a<this.params.length;a++)if(this.params[a].name)if(j=b&&b[a]||this.params[a].value)g.rules.unshift(new d.Rule(this.params[a].name,j.eval(e)));else throw{message:"wrong number of arguments for "+this.name+" ("+b.length+" for "+this.arity+")"};return(new d.Ruleset(null,this.rules)).evalRules({frames:[this,g].concat(e.frames)})},match:function(b,e){var g=b&&b.length||0;if(g<
this.required)return false;for(var a=0;a<Math.min(g,this.arity);a++)if(!this.params[a].name)if(!b[a].wildcard)if(b[a].eval(e).toCSS()!=this.params[a].value.eval(e).toCSS())return false;return true}}})(q("less/tree"));(function(d){d.Operation=function(b,e){this.op=b.trim();this.operands=e};d.Operation.prototype.eval=function(b){var e=this.operands[0].eval(b);b=this.operands[1].eval(b);var g;if(e instanceof d.Dimension&&b instanceof d.Color)if(this.op==="*"||this.op==="+"){g=b;b=e;e=g}else throw{name:"OperationError",
message:"Can't substract or divide a color from a number"};return e.operate(this.op,b)};d.operate=function(b,e,g){switch(b){case "+":return e+g;case "-":return e-g;case "*":return e*g;case "/":return e/g}}})(q("less/tree"));(function(d){d.Quoted=function(b,e){this.value=b;this.content=e};d.Quoted.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(q("less/tree"));(function(d){d.Rule=function(b,e,g,a){this.name=b;this.value=e instanceof d.Value?e:new d.Value([e]);this.important=
g?" "+g.trim():"";this.index=a;this.variable=b.charAt(0)==="@"?true:false};d.Rule.prototype.toCSS=function(b){return this.variable?"":this.name+(b.compress?":":": ")+this.value.toCSS(b)+this.important+";"};d.Rule.prototype.eval=function(b){return new d.Rule(this.name,this.value.eval(b),this.important,this.index)};d.Shorthand=function(b,e){this.a=b;this.b=e};d.Shorthand.prototype={toCSS:function(b){return this.a.toCSS(b)+"/"+this.b.toCSS(b)},eval:function(){return this}}})(q("less/tree"));(function(d){d.Ruleset=
function(b,e){this.selectors=b;this.rules=e;this._lookups={}};d.Ruleset.prototype={eval:function(){return this},evalRules:function(b){var e=[];this.rules.forEach(function(g){if(g.evalRules)e.push(g.evalRules(b));else g instanceof d.mixin.Call?Array.prototype.push.apply(e,g.eval(b)):e.push(g.eval?g.eval(b):"")});this.rules=e;return this},match:function(b){return!b||b.length===0},variable:function(b){return this._variables?this._variables[b]:(this._variables=this.rules.reduce(function(e,g){if(g instanceof
d.Rule&&g.variable===true)e[g.name]=g;return e},{}))[b]},rulesets:function(){return this._rulesets?this._rulesets:(this._rulesets=this.rules.filter(function(b){if(b instanceof d.Ruleset||b instanceof d.mixin.Definition)return b}))},find:function(b,e){e=e||this;var g=[],a=b.toCSS();if(a in this._lookups)return this._lookups[a];this.rulesets().forEach(function(j){if(j!==e)for(var i=0;i<j.selectors.length;i++)if(b.match(j.selectors[i])){b.elements.length>1?Array.prototype.push.apply(g,j.find(new d.Selector(b.elements.slice(1)),
e)):g.push(j);break}});return this._lookups[a]=g},toCSS:function(b,e){var g=[],a=[],j=[],i=[];if(this.root)for(var h=0;h<this.rules.length;h++)this.rules[h]instanceof d.Import&&Array.prototype.splice.apply(this.rules,[h,1].concat(this.rules[h].eval(e)));else if(b.length===0)i=this.selectors.map(function(r){return[r]});else for(h=0;h<this.selectors.length;h++)for(var n=0;n<b.length;n++)i.push(b[n].concat([this.selectors[h]]));e.frames.unshift(this);for(h=0;h<this.rules.length;h++)this.rules[h]instanceof
d.mixin.Call&&Array.prototype.splice.apply(this.rules,[h,1].concat(this.rules[h].eval(e)));for(h=0;h<this.rules.length;h++){b=this.rules[h];if(b instanceof d.Directive)j.push(b.eval(e).toCSS(i,e));else if(b.rules)j.push(b.toCSS(i,e));else if(b instanceof d.Comment)b.silent||(this.root?j.push(b.toCSS(e)):a.push(b.toCSS(e)));else if(b.toCSS&&!b.variable)a.push(b.eval(e).toCSS(e));else b.value&&!b.variable&&a.push(b.value.toString())}j=j.join("");if(this.root)g.push(a.join(e.compress?"":"\n"));else if(a.length>
0){i=i.map(function(r){return r.map(function(x){return x.toCSS(e)}).join("").trim()}).join(e.compress?",":i.length>3?",\n":", ");g.push(i,(e.compress?"{":" {\n ")+a.join(e.compress?"":"\n ")+(e.compress?"}":"\n}\n"))}g.push(j);e.frames.shift();return g.join("")+(e.compress?"\n":"")}}})(q("less/tree"));(function(d){d.Selector=function(b){this.elements=b;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value=" "};d.Selector.prototype.match=function(b){return this.elements[0].value===
b.elements[0].value?true:false};d.Selector.prototype.toCSS=function(b){if(this._css)return this._css;return this._css=this.elements.map(function(e){return typeof e==="string"?" "+e.trim():e.toCSS(b)}).join("")}})(q("less/tree"));(function(d){d.URL=function(b){this.value=b};d.URL.prototype={toCSS:function(){return"url("+this.value.toCSS()+")"},eval:function(){return this}}})(q("less/tree"));(function(d){d.Value=function(b){this.value=b;this.is="value"};d.Value.prototype={eval:function(b){return this.value.length===
1?this.value[0].eval(b):new d.Value(this.value.map(function(e){return e.eval(b)}))},toCSS:function(b){return this.value.map(function(e){return e.toCSS(b)}).join(b.compress?",":", ")}}})(q("less/tree"));(function(d){d.Variable=function(b,e){this.name=b;this.index=e};d.Variable.prototype={eval:function(b){var e,g,a=this.name;if(e=d.find(b.frames,function(j){if(g=j.variable(a))return g.value.eval(b)}))return e;else throw{message:"variable "+this.name+" is undefined",index:this.index};}}})(q("less/tree"));
q("less/tree").find=function(d,b){for(var e=0,g;e<d.length;e++)if(g=b.call(d,d[e]))return g;return null};var P=location.protocol==="file:"||location.protocol==="chrome:"||location.protocol==="resource:";o.env=location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||P?"development":"production";o.async=false;o.poll=P?1E3:1500;o.watch=function(){return this.watchMode=true};o.unwatch=function(){return this.watchMode=false};if(o.env==="development"){o.optimization=
0;/!watch/.test(location.hash)&&o.watch();o.watchTimer=setInterval(function(){o.watchMode&&R(function(d,b,e){d&&O(d.toCSS(),b,e.lastModified)})},o.poll)}else o.optimization=3;var D;try{D=typeof F.localStorage==="undefined"?null:F.localStorage}catch(ca){D=null}var M=document.getElementsByTagName("link"),Y=/^text\/(x-)?less$/;o.sheets=[];for(var y=0;y<M.length;y++)if(M[y].rel==="stylesheet/less"||M[y].rel.match(/stylesheet/)&&M[y].type.match(Y))o.sheets.push(M[y]);var N=document.getElementsByTagName("style");
for(y=0;y<N.length;y++)if(N[y].type.match(Y))(new o.Parser).parse(N[y].innerHTML||"",function(d,b){N[y].type="text/css";N[y].innerHTML=b.toCSS()});var ba=endTime=new Date;o.refresh=function(d){R(function(b,e,g){if(g.local)J("loading "+e.href+" from cache.");else{J("parsed "+e.href+" successfully.");O(b.toCSS(),e,g.lastModified)}J("css for "+e.href+" generated in "+(new Date-endTime)+"ms");g.remaining===0&&J("css generated in "+(new Date-ba)+"ms");endTime=new Date},d)};o.refresh(o.env==="development")})(window);