diff --git a/bin/lessc b/bin/lessc index fba84b476..e2b6d2981 100755 --- a/bin/lessc +++ b/bin/lessc @@ -1646,8 +1646,11 @@ var debugInfo = function (context, ctx, lineSeparator) { } return result; }; -debugInfo.asComment = function (ctx) { return "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n"; }; +debugInfo.asComment = function (ctx) { return ctx.debugInfo ? "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n" : ''; }; debugInfo.asMediaQuery = function (ctx) { + if (!ctx.debugInfo) { + return ''; + } var filenameWithProtocol = ctx.debugInfo.fileName; if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { filenameWithProtocol = "file://" + filenameWithProtocol; @@ -10110,12 +10113,8 @@ var parseTree = (function (SourceMapBuilder) { if (options.sourceMap) { result.map = sourceMapBuilder.getExternalSourceMap(); } - result.imports = []; - for (var file_1 in this.imports.files) { - if (this.imports.files.hasOwnProperty(file_1) && file_1 !== this.imports.rootFilename) { - result.imports.push(file_1); - } - } + var rootFilename = this.imports.rootFilename; + result.imports = this.imports.files.filter(function (file) { return file !== rootFilename; }); return result; }; return ParseTree; @@ -10144,6 +10143,7 @@ var importManager = (function (environment) { this.context = context; // Deprecated? Unused outside of here, could be useful. this.queue = []; // Files which haven't been imported yet + this.files = []; // List of files imported } /** * Add an import to be imported @@ -10165,6 +10165,10 @@ var importManager = (function (environment) { logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional."); } else { + var files = importManager.files; + if (files.indexOf(fullPath) === -1) { + files.push(fullPath); + } if (e && !importManager.error) { importManager.error = e; } @@ -10549,7 +10553,7 @@ var createFromEnvironment = (function (environment, fileManagers) { * It's not clear what should / must be public and why. */ var initial = { - version: [3, 11, 2], + version: [3, 11, 3], data: data, tree: tree, Environment: environment$1, diff --git a/dist/less.cjs.js b/dist/less.cjs.js index 1c7571f63..214f9c40a 100644 --- a/dist/less.cjs.js +++ b/dist/less.cjs.js @@ -1642,8 +1642,11 @@ var debugInfo = function (context, ctx, lineSeparator) { } return result; }; -debugInfo.asComment = function (ctx) { return "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n"; }; +debugInfo.asComment = function (ctx) { return ctx.debugInfo ? "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n" : ''; }; debugInfo.asMediaQuery = function (ctx) { + if (!ctx.debugInfo) { + return ''; + } var filenameWithProtocol = ctx.debugInfo.fileName; if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { filenameWithProtocol = "file://" + filenameWithProtocol; @@ -10106,12 +10109,8 @@ var parseTree = (function (SourceMapBuilder) { if (options.sourceMap) { result.map = sourceMapBuilder.getExternalSourceMap(); } - result.imports = []; - for (var file_1 in this.imports.files) { - if (this.imports.files.hasOwnProperty(file_1) && file_1 !== this.imports.rootFilename) { - result.imports.push(file_1); - } - } + var rootFilename = this.imports.rootFilename; + result.imports = this.imports.files.filter(function (file) { return file !== rootFilename; }); return result; }; return ParseTree; @@ -10140,6 +10139,7 @@ var importManager = (function (environment) { this.context = context; // Deprecated? Unused outside of here, could be useful. this.queue = []; // Files which haven't been imported yet + this.files = []; // List of files imported } /** * Add an import to be imported @@ -10161,6 +10161,10 @@ var importManager = (function (environment) { logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional."); } else { + var files = importManager.files; + if (files.indexOf(fullPath) === -1) { + files.push(fullPath); + } if (e && !importManager.error) { importManager.error = e; } @@ -10545,7 +10549,7 @@ var createFromEnvironment = (function (environment, fileManagers) { * It's not clear what should / must be public and why. */ var initial = { - version: [3, 11, 2], + version: [3, 11, 3], data: data, tree: tree, Environment: environment$1, diff --git a/dist/less.js b/dist/less.js index 2eb1fa589..5b6c14656 100644 --- a/dist/less.js +++ b/dist/less.js @@ -1,5 +1,5 @@ /** - * Less - Leaner CSS v3.11.2 + * Less - Leaner CSS v3.11.3 * http://lesscss.org * * Copyright (c) 2009-2020, Alexis Sellier @@ -1750,8 +1750,11 @@ } return result; }; - debugInfo.asComment = function (ctx) { return "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n"; }; + debugInfo.asComment = function (ctx) { return ctx.debugInfo ? "/* line " + ctx.debugInfo.lineNumber + ", " + ctx.debugInfo.fileName + " */\n" : ''; }; debugInfo.asMediaQuery = function (ctx) { + if (!ctx.debugInfo) { + return ''; + } var filenameWithProtocol = ctx.debugInfo.fileName; if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { filenameWithProtocol = "file://" + filenameWithProtocol; @@ -10364,12 +10367,8 @@ if (options.sourceMap) { result.map = sourceMapBuilder.getExternalSourceMap(); } - result.imports = []; - for (var file_1 in this.imports.files) { - if (this.imports.files.hasOwnProperty(file_1) && file_1 !== this.imports.rootFilename) { - result.imports.push(file_1); - } - } + var rootFilename = this.imports.rootFilename; + result.imports = this.imports.files.filter(function (file) { return file !== rootFilename; }); return result; }; return ParseTree; @@ -10398,6 +10397,7 @@ this.context = context; // Deprecated? Unused outside of here, could be useful. this.queue = []; // Files which haven't been imported yet + this.files = []; // List of files imported } /** * Add an import to be imported @@ -10419,6 +10419,10 @@ logger.info("The file " + fullPath + " was skipped because it was not found and the import was marked optional."); } else { + var files = importManager.files; + if (files.indexOf(fullPath) === -1) { + files.push(fullPath); + } if (e && !importManager.error) { importManager.error = e; } @@ -10803,7 +10807,7 @@ * It's not clear what should / must be public and why. */ var initial = { - version: [3, 11, 2], + version: [3, 11, 3], data: data, tree: tree, Environment: environment, diff --git a/dist/less.min.js b/dist/less.min.js index 02101879d..387f7afd4 100644 --- a/dist/less.min.js +++ b/dist/less.min.js @@ -1,5 +1,5 @@ /** - * Less - Leaner CSS v3.11.2 + * Less - Leaner CSS v3.11.3 * http://lesscss.org * * Copyright (c) 2009-2020, Alexis Sellier @@ -7,5 +7,5 @@ * * @license Apache-2.0 */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).less=t()}(this,(function(){"use strict";function e(e){return e.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/[\?\&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function t(e,t){for(var n in t.dataset)if(t.dataset.hasOwnProperty(n))if("env"===n||"dumpLineNumbers"===n||"rootpath"===n||"errorReporting"===n)e[n]=t.dataset[n];else try{e[n]=JSON.parse(t.dataset[n])}catch(e){}}var n=function(t,n,i){var r=i.href||"",o="less:"+(i.title||e(r)),s=t.getElementById(o),a=!1,l=t.createElement("style");l.setAttribute("type","text/css"),i.media&&l.setAttribute("media",i.media),l.id=o,l.styleSheet||(l.appendChild(t.createTextNode(n)),a=null!==s&&s.childNodes.length>0&&l.childNodes.length>0&&s.firstChild.nodeValue===l.firstChild.nodeValue);var u=t.getElementsByTagName("head")[0];if(null===s||!1===a){var c=i&&i.nextSibling||null;c?c.parentNode.insertBefore(l,c):u.appendChild(l)}if(s&&!1===a&&s.parentNode.removeChild(s),l.styleSheet)try{l.styleSheet.cssText=n}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}},i=function(e){var t,n=e.document;return n.currentScript||(t=n.getElementsByTagName("script"))[t.length-1]},r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(){for(var e=0,t=0,n=arguments.length;tt?1:void 0};var h=function(e){function t(t,n,i){var r=e.call(this)||this,o=r;return Array.isArray(t)?r.rgb=t:t.length>=6?(r.rgb=[],t.match(/.{2}/g).map((function(e,t){t<3?o.rgb.push(parseInt(e,16)):o.alpha=parseInt(e,16)/255}))):(r.rgb=[],t.split("").map((function(e,t){t<3?o.rgb.push(parseInt(e+e,16)):o.alpha=parseInt(e+e,16)/255}))),r.alpha=r.alpha||("number"==typeof n?n:1),void 0!==i&&(r.value=i),r}return o(t,e),t.prototype.luma=function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255;return.2126*(e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},t.prototype.genCSS=function(e,t){t.add(this.toCSS(e))},t.prototype.toCSS=function(e,t){var n,i,r,o=e&&e.compress&&!t,s=[];if(i=this.fround(e,this.alpha),this.value)if(0===this.value.indexOf("rgb"))i<1&&(r="rgba");else{if(0!==this.value.indexOf("hsl"))return this.value;r=i<1?"hsla":"hsl"}else i<1&&(r="rgba");switch(r){case"rgba":s=this.rgb.map((function(e){return f(Math.round(e),255)})).concat(f(i,1));break;case"hsla":s.push(f(i,1));case"hsl":n=this.toHSL(),s=[this.fround(e,n.h),this.fround(e,100*n.s)+"%",this.fround(e,100*n.l)+"%"].concat(s)}if(r)return r+"("+s.join(","+(o?"":" "))+")";if(n=this.toRGB(),o){var a=n.split("");a[1]===a[2]&&a[3]===a[4]&&a[5]===a[6]&&(n="#"+a[1]+a[3]+a[5])}return n},t.prototype.operate=function(e,n,i){for(var r=new Array(3),o=this.alpha*(1-i.alpha)+i.alpha,s=0;s<3;s++)r[s]=this._operate(e,n,this.rgb[s],i.rgb[s]);return new t(r,o)},t.prototype.toRGB=function(){return p(this.rgb)},t.prototype.toHSL=function(){var e,t,n=this.rgb[0]/255,i=this.rgb[1]/255,r=this.rgb[2]/255,o=this.alpha,s=Math.max(n,i,r),a=Math.min(n,i,r),l=(s+a)/2,u=s-a;if(s===a)e=t=0;else{switch(t=l>.5?u/(2-s-a):u/(s+a),s){case n:e=(i-r)/u+(i=0&&"\n"!==t.charAt(n);)r++;return"number"==typeof e&&(i=(t.slice(0,e).match(/\n/g)||"").length),{line:i,column:r}}function C(e){var t,n=e.length,i=new Array(n);for(t=0;t|Function):(\d+):(\d+)/,R=function(e,t,n){Error.call(this);var i=e.filename||n;if(this.message=e.message,this.stack=e.stack,t&&i){var r=t.contents[i],o=I(e.index,r),s=o.line,a=o.column,l=e.call&&I(e.call,r).line,u=r?r.split("\n"):"";if(this.type=e.type||"Syntax",this.filename=i,this.index=e.index,this.line="number"==typeof s?s+1:null,this.column=a,!this.line&&this.stack){var c=this.stack.match(E),h=new Function("a","throw new Error()"),f=0;try{h()}catch(e){var p=e.stack.match(E);f=1-parseInt(p[2])}c&&(c[2]&&(this.line=parseInt(c[2])+f),c[3]&&(this.column=parseInt(c[3])))}this.callLine=l+1,this.callExtract=u[l],this.extract=[u[this.line-2],u[this.line-1],u[this.line]]}};if(void 0===Object.create){var V=function(){};V.prototype=Error.prototype,R.prototype=new V}else R.prototype=Object.create(Error.prototype);R.prototype.constructor=R,R.prototype.toString=function(e){void 0===e&&(e={});var t="",n=this.extract||[],i=[],r=function(e){return e};if(e.stylize){var o=typeof e.stylize;if("function"!==o)throw Error("options.stylize should be a function, got a "+o+"!");r=e.stylize}if(null!==this.line){if("string"==typeof n[0]&&i.push(r(this.line-1+" "+n[0],"grey")),"string"==typeof n[1]){var s=this.line+" ";n[1]&&(s+=n[1].slice(0,this.column)+r(r(r(n[1].substr(this.column,1),"bold")+n[1].slice(this.column+1),"red"),"inverse")),i.push(s)}"string"==typeof n[2]&&i.push(r(this.line+1+" "+n[2],"grey")),i=i.join("\n")+r("","reset")+"\n"}return t+=r(this.type+"Error: "+this.message,"red"),this.filename&&(t+=r(" in ","red")+this.filename),this.line&&(t+=r(" on line "+this.line+", column "+(this.column+1)+":","grey")),t+="\n"+i,this.callLine&&(t+=r("from ","red")+(this.filename||"")+"/n",t+=r(this.callLine,"grey")+" "+this.callExtract+"/n"),t};var F=function(e){function t(t,n,i,r,o,s){var a=e.call(this)||this;return a.extendList=n,a.condition=i,a.evaldCondition=!i,a._index=r,a._fileInfo=o,a.elements=a.getElements(t),a.mixinElements_=void 0,a.copyVisibilityInfo(s),a.setParent(a.elements,a),a}return o(t,e),t.prototype.accept=function(e){this.elements&&(this.elements=e.visitArray(this.elements)),this.extendList&&(this.extendList=e.visitArray(this.extendList)),this.condition&&(this.condition=e.visit(this.condition))},t.prototype.createDerived=function(e,n,i){var r=new t(e=this.getElements(e),n||this.extendList,null,this.getIndex(),this.fileInfo(),this.visibilityInfo());return r.evaldCondition=null!=i?i:this.evaldCondition,r.mediaEmpty=this.mediaEmpty,r},t.prototype.getElements=function(e){return e?("string"==typeof e&&this.parse.parseNode(e,["selector"],this._index,this._fileInfo,(function(t,n){if(t)throw new R({index:t.index,message:t.message},this.parse.imports,this._fileInfo.filename);e=n[0].elements})),e):[new g("","&",!1,this._index,this._fileInfo)]},t.prototype.createEmptySelectors=function(){var e=[new t([new g("","&",!1,this._index,this._fileInfo)],null,null,this._index,this._fileInfo)];return e[0].mediaEmpty=!0,e},t.prototype.match=function(e){var t,n,i=this.elements,r=i.length;if(0===(t=(e=e.mixinElements()).length)||ry.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},e.prototype.pathRequiresRewrite=function(e){return(this.rewriteUrls===w?W:G)(e)},e.prototype.rewritePath=function(e,t){var n;return t=t||"",n=this.normalizePath(t+e),W(e)&&G(t)&&!1===W(n)&&(n="./"+n),n},e.prototype.normalizePath=function(e){var t,n=e.split("/").reverse();for(e=[];0!==n.length;)switch(t=n.pop()){case".":break;case"..":0===e.length||".."===e[e.length-1]?e.push(t):e.pop();break;default:e.push(t)}return e.join("/")},e}();var J=function e(t){return{_data:{},add:function(e,t){e=e.toLowerCase(),this._data.hasOwnProperty(e),this._data[e]=t},addMultiple:function(e){var t=this;Object.keys(e).forEach((function(n){t.add(n,e[n])}))},get:function(e){return this._data[e]||t&&t.get(e)},getLocalFunctions:function(){return this._data},inherit:function(){return e(this)},create:function(t){return e(t)}}}(null),H={eval:function(){var e=this.value_,t=this.error_;if(t)throw t;if(null!=e)return e?$.True:$.False},value:function(e){this.value_=e},error:function(e){this.error_=e},reset:function(){this.value_=this.error_=null}},Q=function(e){function t(t,n,i,r){var o=e.call(this)||this;return o.selectors=t,o.rules=n,o._lookups={},o._variables=null,o._properties=null,o.strictImports=i,o.copyVisibilityInfo(r),o.allowRoot=!0,o.setParent(o.selectors,o),o.setParent(o.rules,o),o}return o(t,e),t.prototype.isRulesetLike=function(){return!0},t.prototype.accept=function(e){this.paths?this.paths=e.visitArray(this.paths,!0):this.selectors&&(this.selectors=e.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=e.visitArray(this.rules))},t.prototype.eval=function(e){var n,i,r,o,s,a=!1;if(this.selectors&&(i=this.selectors.length)){for(n=new Array(i),H.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),o=0;o0;e--){var t=this.rules[e-1];if(t instanceof N)return this.parseValue(t)}},t.prototype.parseValue=function(e){var t=this;function n(e){return e.value instanceof L&&!e.parsed?("string"==typeof e.value.value?this.parse.parseNode(e.value.value,["value","important"],e.value.getIndex(),e.fileInfo(),(function(t,n){t&&(e.parsed=!0),n&&(e.value=n[0],e.important=n[1]||"",e.parsed=!0)})):e.parsed=!0,e):e}if(Array.isArray(e)){var i=[];return e.forEach((function(e){i.push(n.call(t,e))})),i}return n.call(t,e)},t.prototype.rulesets=function(){if(!this.rules)return[];var e,t,n=[],i=this.rules;for(e=0;t=i[e];e++)t.isRuleset&&n.push(t);return n},t.prototype.prependRule=function(e){var t=this.rules;t?t.unshift(e):this.rules=[e],this.setParent(e,this)},t.prototype.find=function(e,t,n){void 0===t&&(t=this);var i,r,o=[],s=e.toCSS();return s in this._lookups?this._lookups[s]:(this.rulesets().forEach((function(s){if(s!==t)for(var a=0;ai){if(!n||n(s)){r=s.find(new F(e.elements.slice(i)),t,n);for(var l=0;l0&&t.add(l),e.firstSelector=!0,s[0].genCSS(e,t),e.firstSelector=!1,i=1;i0?(o=(r=C(e)).pop(),s=i.createDerived(C(o.elements))):s=i.createDerived([]),t.length>0){var a=n.combinator,l=t[0].elements[0];a.emptyOrWhitespace&&!l.combinator.emptyOrWhitespace&&(a=l.combinator),s.elements.push(new g(a,l.value,n.isVariable,n._index,n._fileInfo)),s.elements=s.elements.concat(t[0].elements.slice(1))}if(0!==s.elements.length&&r.push(s),t.length>1){var u=t.slice(1);u=u.map((function(e){return e.createDerived(e.elements,[])})),r=r.concat(u)}return r}function s(e,t,n,i,r){var s;for(s=0;s0?i[i.length-1]=i[i.length-1].createDerived(i[i.length-1].elements.concat(e)):i.push(new F(e));else t.push([new F(e)])}function l(e,t){var n=t.createDerived(t.elements,t.extendList,t.evaldCondition);return n.copyVisibilityInfo(e),n}var u,c;if(!function e(t,n,l){var u,c,h,f,p,d,m,y,b,w,x,S,I=!1;for(f=[],p=[[]],u=0;y=l.elements[u];u++)if("&"!==y.value){var C=(S=void 0,(x=y).value instanceof v&&(S=x.value.value)instanceof F?S:null);if(null!=C){a(f,p);var _,k=[],A=[];for(_=e(k,n,C),I=I||_,h=0;h0&&m[0].elements.push(new g(y.combinator,"",y.isVariable,y._index,y._fileInfo)),d.push(m);else for(h=0;h0&&(t.push(p[u]),w=p[u][b-1],p[u][b-1]=w.createDerived(w.elements,l.extendList));return I}(c=[],t,n))if(t.length>0)for(c=[],u=0;u0)for(t=0;t-1e-6&&(i=n.toFixed(20).replace(/0+$/,"")),e&&e.compress){if(0===n&&this.unit.isLength())return void t.add(i);n>0&&n<1&&(i=i.substr(1))}t.add(i),this.unit.genCSS(e,t)},t.prototype.operate=function(e,n,i){var r=this._operate(e,n,this.value,i.value),o=this.unit.clone();if("+"===n||"-"===n)if(0===o.numerator.length&&0===o.denominator.length)o=i.unit.clone(),this.unit.backupUnit&&(o.backupUnit=this.unit.backupUnit);else if(0===i.unit.numerator.length&&0===o.denominator.length);else{if(i=i.convertTo(this.unit.usedUnits()),e.strictUnits&&i.unit.toString()!==o.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+o.toString()+"' and '"+i.unit.toString()+"'.");r=this._operate(e,n,this.value,i.value)}else"*"===n?(o.numerator=o.numerator.concat(i.unit.numerator).sort(),o.denominator=o.denominator.concat(i.unit.denominator).sort(),o.cancel()):"/"===n&&(o.numerator=o.numerator.concat(i.unit.denominator).sort(),o.denominator=o.denominator.concat(i.unit.numerator).sort(),o.cancel());return new t(r,o)},t.prototype.compare=function(e){var n,i;if(e instanceof t){if(this.unit.isEmpty()||e.unit.isEmpty())n=this,i=e;else if(n=this.unify(),i=e.unify(),0!==n.unit.compare(i.unit))return;return c.numericCompare(n.value,i.value)}},t.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},t.prototype.convertTo=function(e){var n,i,r,o,s,a=this.value,u=this.unit.clone(),c={};if("string"==typeof e){for(n in l)l[n].hasOwnProperty(e)&&((c={})[n]=e);e=c}for(i in s=function(e,t){return r.hasOwnProperty(e)?(t?a/=r[e]/r[o]:a*=r[e]/r[o],o):e},e)e.hasOwnProperty(i)&&(o=e[i],r=l[i],u.map(s));return u.cancel(),new t(a,u)},t}(c);X.prototype.type="Dimension";var ee=y,te=function(e){function t(t,n,i){var r=e.call(this)||this;return r.op=t.trim(),r.operands=n,r.isSpaced=i,r}return o(t,e),t.prototype.accept=function(e){this.operands=e.visitArray(this.operands)},t.prototype.eval=function(e){var n,i=this.operands[0].eval(e),r=this.operands[1].eval(e);if(e.isMathOn(this.op)){if(n="./"===this.op?"/":this.op,i instanceof X&&r instanceof h&&(i=i.toColor()),r instanceof X&&i instanceof h&&(r=r.toColor()),!i.operate){if(i instanceof t&&"/"===i.op&&e.math===ee.PARENS_DIVISION)return new t(this.op,[i,r],this.isSpaced);throw{type:"Operation",message:"Operation on an invalid type"}}return i.operate(e,n,r)}return new t(this.op,[i,r],this.isSpaced)},t.prototype.genCSS=function(e,t){this.operands[0].genCSS(e,t),this.isSpaced&&t.add(" "),t.add(this.op),this.isSpaced&&t.add(" "),this.operands[1].genCSS(e,t)},t}(c);te.prototype.type="Operation";var ne=y,ie=function(e){function t(t,n){var i=e.call(this)||this;if(i.value=t,i.noSpacing=n,!t)throw new Error("Expression requires an array parameter");return i}return o(t,e),t.prototype.accept=function(e){this.value=e.visitArray(this.value)},t.prototype.eval=function(e){var n,i=e.isMathOn(),r=this.parens&&(e.math!==ne.STRICT_LEGACY||!this.parensInOp),o=!1;return r&&e.inParenthesis(),this.value.length>1?n=new t(this.value.map((function(t){return t.eval?t.eval(e):t})),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||e.inCalc||(o=!0),n=this.value[0].eval(e)):n=this,r&&e.outOfParenthesis(),!this.parens||!this.parensInOp||i||o||n instanceof X||(n=new v(n)),n},t.prototype.genCSS=function(e,t){for(var n=0;n1){var n=new F([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();(t=new Q(n,e.mediaBlocks)).multiMedia=!0,t.copyVisibilityInfo(this.visibilityInfo()),this.setParent(t,this)}return delete e.mediaBlocks,delete e.mediaPath,t},t.prototype.evalNested=function(e){var t,n,i=e.mediaPath.concat([this]);for(t=0;t0;t--)e.splice(t,0,new L("and"));return new ie(e)}))),this.setParent(this.features,this),new Q([],[])},t.prototype.permute=function(e){if(0===e.length)return[];if(1===e.length)return e[0];for(var t=[],n=this.permute(e.slice(1)),i=0;i1?"["+e.value.map((function(e){return e.toCSS()})).join(", ")+"]":e.toCSS()},t}(c));pe.prototype.type="JavaScript";var ve=function(e){function t(t,n){var i=e.call(this)||this;return i.key=t,i.value=n,i}return o(t,e),t.prototype.accept=function(e){this.value=e.visit(this.value)},t.prototype.eval=function(e){return this.value.eval?new t(this.key,this.value.eval(e)):this},t.prototype.genCSS=function(e,t){t.add(this.key+"="),this.value.genCSS?this.value.genCSS(e,t):t.add(this.value)},t}(c);ve.prototype.type="Assignment";var de=function(e){function t(t,n,i,r,o){var s=e.call(this)||this;return s.op=t.trim(),s.lvalue=n,s.rvalue=i,s._index=r,s.negate=o,s}return o(t,e),t.prototype.accept=function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},t.prototype.eval=function(e){var t=function(e,t,n){switch(e){case"and":return t&&n;case"or":return t||n;default:switch(c.compare(t,n)){case-1:return"<"===e||"=<"===e||"<="===e;case 0:return"="===e||">="===e||"=<"===e||"<="===e;case 1:return">"===e||">="===e;default:return!1}}}(this.op,this.lvalue.eval(e),this.rvalue.eval(e));return this.negate?!t:t},t}(c);de.prototype.type="Condition";var me=function(e){function t(t){var n=e.call(this)||this;return n.value=t,n}return o(t,e),t}(c);me.prototype.type="UnicodeDescriptor";var ge=function(e){function t(t){var n=e.call(this)||this;return n.value=t,n}return o(t,e),t.prototype.genCSS=function(e,t){t.add("-"),this.value.genCSS(e,t)},t.prototype.eval=function(e){return e.isMathOn()?new te("*",[new X(-1),this.value]).eval(e):new t(this.value.eval(e))},t}(c);ge.prototype.type="Negative";var ye=function(e){function t(n,i,r,o,s){var a=e.call(this)||this;switch(a.selector=n,a.option=i,a.object_id=t.next_id++,a.parent_ids=[a.object_id],a._index=r,a._fileInfo=o,a.copyVisibilityInfo(s),a.allowRoot=!0,i){case"all":a.allowBefore=!0,a.allowAfter=!0;break;default:a.allowBefore=!1,a.allowAfter=!1}return a.setParent(a.selector,a),a}return o(t,e),t.prototype.accept=function(e){this.selector=e.visit(this.selector)},t.prototype.eval=function(e){return new t(this.selector.eval(e),this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},t.prototype.clone=function(e){return new t(this.selector,this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},t.prototype.findSelfSelectors=function(e){var t,n,i=[];for(t=0;t0&&n.length&&""===n[0].combinator.value&&(n[0].combinator.value=" "),i=i.concat(e[t].elements);this.selfSelectors=[new F(i)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())},t}(c);ye.next_id=0,ye.prototype.type="Extend";var be=function(e){function t(t,n,i){var r=e.call(this)||this;return r.variable=t,r._index=n,r._fileInfo=i,r.allowRoot=!0,r}return o(t,e),t.prototype.eval=function(e){var t,n=new se(this.variable,this.getIndex(),this.fileInfo()).eval(e),i=new R({message:"Could not evaluate variable call "+this.variable});if(!n.ruleset){if(n.rules)t=n;else if(Array.isArray(n))t=new Q("",n);else{if(!Array.isArray(n.value))throw i;t=new Q("",n.value)}n=new Z(t)}if(n.ruleset)return n.callEval(e);throw i},t}(c);be.prototype.type="VariableCall";var we=function(e){function t(t,n,i,r){var o=e.call(this)||this;return o.value=t,o.lookups=n,o._index=i,o._fileInfo=r,o}return o(t,e),t.prototype.eval=function(e){var t,n,i=this.value.eval(e);for(t=0;tthis.params.length)return!1}n=Math.min(o,this.arity);for(var s=0;s0){for(c=!0,a=0;a0)f=2;else if(f=1,p[1]+p[2]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(m)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(a=0;a=0;s--){var a=o[s];if(a[r?"supportsSync":"supports"](e,t,n,i))return a}return null},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},e}(),ke=function(){function e(){}return e.prototype.getPath=function(e){var t=e.lastIndexOf("?");return t>0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))<0&&(t=e.lastIndexOf("\\")),t<0?"":e.slice(0,t+1)},e.prototype.tryAppendExtension=function(e,t){return/(\.[a-z]*$)|([\?;].*)$/.test(e)?e:e+t},e.prototype.tryAppendLessExtension=function(e){return this.tryAppendExtension(e,".less")},e.prototype.supportsSync=function(){return!1},e.prototype.alwaysMakePathsAbsolute=function(){return!1},e.prototype.isPathAbsolute=function(e){return/^(?:[a-z-]+:|\/|\\|#)/i.test(e)},e.prototype.join=function(e,t){return e?e+t:t},e.prototype.pathDiff=function(e,t){var n,i,r,o,s=this.extractUrlParts(e),a=this.extractUrlParts(t),l="";if(s.hostPart!==a.hostPart)return"";for(i=Math.max(a.directories.length,s.directories.length),n=0;nparseInt(t[n])?-1:1;return 0},e.prototype.versionToString=function(e){for(var t="",n=0;n0;){var e=this.imports[0];if(!e.isReady)return;this.imports=this.imports.slice(1),e.callback.apply(null,e.args)}if(0===this.variableImports.length)break;var t=this.variableImports[0];this.variableImports=this.variableImports.slice(1),t()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},e}(),Fe=function(e,t){this._visitor=new Re(this),this._importer=e,this._finish=t,this.context=new j.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new Ve(this._onSequencerEmpty.bind(this))};Fe.prototype={isReplacing:!1,run:function(e){try{this._visitor.visit(e)}catch(e){this.error=e}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(e,t){var n=e.options.inline;if(!e.css||n){var i=new j.Eval(this.context,C(this.context.frames)),r=i.frames[0];this.importCount++,e.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,e,i,r)):this.processImportNode(e,i,r)}t.visitDeeper=!1},processImportNode:function(e,t,n){var i,r=e.options.inline;try{i=e.evalForImport(t)}catch(t){t.filename||(t.index=e.getIndex(),t.filename=e.fileInfo().filename),e.css=!0,e.error=t}if(!i||i.css&&!r)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{i.options.multiple&&(t.importMultiple=!0);for(var o=void 0===i.css,s=0;s=0||(a=[u.selfSelectors[0]],(o=f.findMatch(l,a)).length&&(l.hasFoundMatches=!0,l.selfSelectors.forEach((function(e){var t=u.visibilityInfo();s=f.extendSelector(o,a,e,l.isVisible()),(c=new Ie.Extend(u.selector,u.option,0,u.fileInfo(),t)).selfSelectors=s,s[s.length-1].extendList=[c],h.push(c),c.ruleset=u.ruleset,c.parent_ids=c.parent_ids.concat(u.parent_ids,l.parent_ids),u.firstExtendOnThisSelectorPath&&(c.firstExtendOnThisSelectorPath=!0,u.ruleset.paths.push(s))}))));if(h.length){if(this.extendChainCount++,n>100){var p="{unable to calculate}",v="{unable to calculate}";try{p=h[0].selfSelectors[0].toCSS(),v=h[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+p+":extend("+v+")"}}return h.concat(f.doExtendChaining(h,t,n+1))}return h},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitSelector=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){if(!e.root){var n,i,r,o,s=this.allExtendsStack[this.allExtendsStack.length-1],a=[],l=this;for(r=0;r0&&u[l.matched].combinator.value!==s?l=null:l.matched++,l&&(l.finished=l.matched===u.length,l.finished&&!e.allowAfter&&(r+1u&&c>0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),c=0,u++),l=o.elements.slice(c,a.index).concat([s]).concat(n.elements.slice(1)),u===a.pathIndex&&r>0?h[h.length-1].elements=h[h.length-1].elements.concat(l):(h=h.concat(t.slice(u,a.pathIndex))).push(new Ie.Selector(l)),u=a.endPathIndex,(c=a.endPathElementIndex)>=t[u].elements.length&&(c=0,u++);return u0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),u++),h=(h=h.concat(t.slice(u,t.length))).map((function(e){var t=e.createDerived(e.elements);return i?t.ensureVisibility():t.ensureInvisibility(),t}))},e.prototype.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)},e.prototype.visitMediaOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e.prototype.visitAtRule=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)},e.prototype.visitAtRuleOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e}(),De=function(){function e(){this.contexts=[[]],this._visitor=new Re(this)}return e.prototype.run=function(e){return this._visitor.visit(e)},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){var n,i=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||((n=e.selectors)&&(n=n.filter((function(e){return e.getIsOutput()})),e.selectors=n.length?n:n=null,n&&e.joinSelectors(r,i,n)),n||(e.rules=null),e.paths=r)},e.prototype.visitRulesetOut=function(e){this.contexts.length=this.contexts.length-1},e.prototype.visitMedia=function(e,t){var n=this.contexts[this.contexts.length-1];e.rules[0].root=0===n.length||n[0].multiMedia},e.prototype.visitAtRule=function(e,t){var n=this.contexts[this.contexts.length-1];e.rules&&e.rules.length&&(e.rules[0].root=e.isRooted||0===n.length||null)},e}(),Ne=function(){function e(e){this._visitor=new Re(this),this._context=e}return e.prototype.containsSilentNonBlockedChild=function(e){var t;if(!e)return!1;for(var n=0;n0},e.prototype.resolveVisibility=function(e,t){if(!e.blocksVisibility()){if(this.isEmpty(e)&&!this.containsSilentNonBlockedChild(t))return;return e}var n=e.rules[0];if(this.keepOnlyVisibleChilds(n),!this.isEmpty(n))return e.ensureVisibility(),e.removeVisibilityBlock(),e},e.prototype.isVisibleRuleset=function(e){return!!e.firstRoot||!this.isEmpty(e)&&!(!e.root&&!this.hasVisibleSelector(e))},e}(),Be=function(e){this._visitor=new Re(this),this._context=e,this.utils=new Ne(e)};Be.prototype={isReplacing:!0,run:function(e){return this._visitor.visit(e)},visitDeclaration:function(e,t){if(!e.blocksVisibility()&&!e.variable)return e},visitMixinDefinition:function(e,t){e.frames=[]},visitExtend:function(e,t){},visitComment:function(e,t){if(!e.blocksVisibility()&&!e.isSilent(this._context))return e},visitMedia:function(e,t){var n=e.rules[0].rules;return e.accept(this._visitor),t.visitDeeper=!1,this.utils.resolveVisibility(e,n)},visitImport:function(e,t){if(!e.blocksVisibility())return e},visitAtRule:function(e,t){return e.rules&&e.rules.length?this.visitAtRuleWithBody(e,t):this.visitAtRuleWithoutBody(e,t)},visitAnonymous:function(e,t){if(!e.blocksVisibility())return e.accept(this._visitor),e},visitAtRuleWithBody:function(e,t){var n=function(e){var t=e.rules;return function(e){var t=e.rules;return 1===t.length&&(!t[0].paths||0===t[0].paths.length)}(e)?t[0].rules:t}(e);return e.accept(this._visitor),t.visitDeeper=!1,this.utils.isEmpty(e)||this._mergeRules(e.rules[0].rules),this.utils.resolveVisibility(e,n)},visitAtRuleWithoutBody:function(e,t){if(!e.blocksVisibility()){if("@charset"===e.name){if(this.charset){if(e.debugInfo){var n=new Ie.Comment("/* "+e.toCSS(this._context).replace(/\n/g,"")+" */\n");return n.debugInfo=e.debugInfo,this._visitor.visit(n)}return}this.charset=!0}return e}},checkValidNodes:function(e,t){if(e)for(var n=0;n0?e.accept(this._visitor):e.rules=null,t.visitDeeper=!1}return e.rules&&(this._mergeRules(e.rules),this._removeDuplicateRules(e.rules)),this.utils.isVisibleRuleset(e)&&(e.ensureVisibility(),i.splice(0,0,e)),1===i.length?i[0]:i},_compileRulesetPaths:function(e){e.paths&&(e.paths=e.paths.filter((function(e){var t;for(" "===e[0].elements[0].combinator.value&&(e[0].elements[0].combinator=new Ie.Combinator("")),t=0;t=0;i--)if((n=e[i])instanceof Ie.Declaration)if(r[n.name]){(t=r[n.name])instanceof Ie.Declaration&&(t=r[n.name]=[r[n.name].toCSS(this._context)]);var o=n.toCSS(this._context);-1!==t.indexOf(o)?e.splice(i,1):t.push(o)}else r[n.name]=n}},_mergeRules:function(e){if(e){for(var t={},n=[],i=0;i0){var t=e[0],n=[],i=[new Ie.Expression(n)];e.forEach((function(e){"+"===e.merge&&n.length>0&&i.push(new Ie.Expression(n=[])),n.push(e.value),t.important=t.important||e.important})),t.value=new Ie.Value(i)}}))}}};var Ue={Visitor:Re,ImportVisitor:Fe,MarkVisibleSelectorsVisitor:Oe,ExtendVisitor:Le,JoinSelectorVisitor:De,ToCSSVisitor:Be},je=function(){var e,t,n,i,r,o,s,a=[],l={};function u(n){for(var i,a,c,h=l.i,f=t,p=l.i-s,v=l.i+o.length-p,d=l.i+=n,m=e;l.i=0){c={index:l.i,text:m.substr(l.i,y+2-l.i),isLineComment:!1},l.i+=c.text.length-1,l.commentStore.push(c);continue}}break}if(32!==i&&10!==i&&9!==i&&13!==i)break}if(o=o.slice(n+l.i-d+p),s=l.i,!o.length){if(tn||l.i===n&&e&&!i)&&(n=l.i,i=e);var r=a.pop();o=r.current,s=l.i=r.i,t=r.j},l.forget=function(){a.pop()},l.isWhitespace=function(t){var n=l.i+(t||0),i=e.charCodeAt(n);return 32===i||13===i||9===i||10===i},l.$re=function(e){l.i>s&&(o=o.slice(l.i-s),s=l.i);var t=e.exec(o);return t?(u(t[0].length),"string"==typeof t?t:1===t.length?t[0]:t):null},l.$char=function(t){return e.charAt(l.i)!==t?null:(u(1),t)},l.$str=function(t){for(var n=t.length,i=0;ih&&(d=!1)}}while(d);return r||null},l.autoCommentAbsorb=!0,l.commentStore=[],l.finished=!1,l.peek=function(t){if("string"==typeof t){for(var n=0;n57||t<43||47===t||44===t},l.start=function(i,a,c){e=i,l.i=t=s=n=0,r=a?function(e,t){var n,i,r,o,s,a,l,u,c,h=e.length,f=0,p=0,v=[],d=0;function m(t){var n=s-d;n<512&&!t||!n||(v.push(e.slice(d,s+1)),d=s+1)}for(s=0;s=97&&l<=122||l<34))switch(l){case 40:p++,i=s;continue;case 41:if(--p<0)return t("missing opening `(`",s);continue;case 59:p||m();continue;case 123:f++,n=s;continue;case 125:if(--f<0)return t("missing opening `{`",s);f||p||m();continue;case 92:if(s96)){if(u==l){c=1;break}if(92==u){if(s==h-1)return t("unescaped `\\`",s);s++}}if(c)continue;return t("unmatched `"+String.fromCharCode(l)+"`",a);case 47:if(p||s==h-1)continue;if(47==(u=e.charCodeAt(s+1)))for(s+=2;sn&&o>r?"missing closing `}` or `*/`":"missing closing `}`",n):0!==p?t("missing closing `)`",i):(m(!0),v)}(i,c):[i],o=r[0],u(0)},l.end=function(){var t,r=l.i>=e.length;return l.i=e.length-1,furthestChar:e[l.i]}},l},qe=function e(t,n,i){var r,o=je();function s(e,t){throw new R({index:o.i,filename:i.filename,type:t||"Syntax",message:e},n)}function a(e,t){var n=e instanceof Function?e.call(r):o.$re(e);if(n)return n;s(t||("string"==typeof e?"expected '"+e+"' got '"+o.currentChar()+"'":"unexpected token"))}function l(e,t){if(o.$char(e))return e;s(t||"expected '"+e+"' got '"+o.currentChar()+"'")}function u(e){var t=i.filename;return{lineNumber:I(e,o.getInput()).line+1,fileName:t}}return{parserInput:o,imports:n,fileInfo:i,parseNode:function(e,t,i,s,a){var l,u=[],c=o;try{c.start(e,!1,(function(e,t){a({message:e,index:t+i})}));for(var h,f=0,p=void 0;p=t[f];f++)if(h=c.i,l=r[p]()){try{l._index=h+i,l._fileInfo=s}catch(e){}u.push(l)}else u.push(null);c.end().isFinished?a(null,u):a(!0,null)}catch(e){throw new R({index:e.index+i,message:e.message},n,s.filename)}},parse:function(r,s,a){var l,u,c,h,f=null,p="";if(u=a&&a.globalVars?e.serializeVars(a.globalVars)+"\n":"",c=a&&a.modifyVars?"\n"+e.serializeVars(a.modifyVars):"",t.pluginManager)for(var v=t.pluginManager.getPreProcessors(),d=0;d");return e},args:function(e){var t,n,i,a,l,u,c,h=r.entities,f={args:null,variadic:!1},p=[],v=[],d=[],m=!0;for(o.save();;){if(e)u=r.detachedRuleset()||r.expression();else{if(o.commentStore.length=0,o.$str("...")){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({variadic:!0});break}u=h.variable()||h.property()||h.literal()||h.keyword()||this.call(!0)}if(!u||!m)break;a=null,u.throwAwayComments&&u.throwAwayComments(),l=u;var g=null;if(e?u.value&&1==u.value.length&&(g=u.value[0]):g=u,g&&(g instanceof Ie.Variable||g instanceof Ie.Property))if(o.$char(":")){if(p.length>0&&(t&&s("Cannot mix ; and , as delimiter types"),n=!0),!(l=r.detachedRuleset()||r.expression())){if(!e)return o.restore(),f.args=[],f;s("could not understand value for named argument")}a=i=g.name}else if(o.$str("...")){if(!e){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({name:u.name,variadic:!0});break}c=!0}else e||(i=a=g.name,l=null);l&&p.push(l),d.push({name:a,value:l,expand:c}),o.$char(",")?m=!0:((m=";"===o.$char(";"))||t)&&(n&&s("Cannot mix ; and , as delimiter types"),t=!0,p.length>1&&(l=new Ie.Value(p)),v.push({name:i,value:l,expand:c}),i=null,p=[],n=!1)}return o.forget(),f.args=t?v:d,f},definition:function(){var e,t,n,i,s=[],l=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),t=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=t[1];var u=this.args(!1);if(s=u.args,l=u.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(i=a(r.conditions,"expected condition")),n=r.block())return o.forget(),new Ie.mixin.Definition(e,s,n,i,l);o.restore()}else o.restore()},ruleLookups:function(){var e,t=[];if("["===o.currentChar()){for(;;){if(o.save(),!(e=this.lookupValue())&&""!==e){o.restore();break}t.push(e),o.forget()}return t.length>0?t:void 0}},lookupValue:function(){if(o.save(),o.$char("[")){var e=o.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);if(o.$char("]"))return e||""===e?(o.forget(),e):void o.restore();o.restore()}else o.restore()}},entity:function(){var e=this.entities;return this.comment()||e.literal()||e.variable()||e.url()||e.property()||e.call()||e.keyword()||this.mixin.call(!0)||e.javascript()},end:function(){return o.$char(";")||o.peek("}")},ieAlpha:function(){var e;if(o.$re(/^opacity=/i))return(e=o.$re(/^\d+/))||(e="@{"+(e=a(r.entities.variable,"Could not parse alpha")).name.slice(1)+"}"),l(")"),new Ie.Quoted("","alpha(opacity="+e+")")},element:function(){var e,t,n,r=o.i;if(t=this.combinator(),(e=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[\.#:](?=@)/)||this.entities.variableCurly())||(o.save(),o.$char("(")?(n=this.selector(!1))&&o.$char(")")?(e=new Ie.Paren(n),o.forget()):o.restore("Missing closing ')'"):o.forget()),e)return new Ie.Element(t,e,e instanceof Ie.Variable,r,i)},combinator:function(){var e=o.currentChar();if("/"===e){o.save();var t=o.$re(/^\/[a-z]+\//i);if(t)return o.forget(),new Ie.Combinator(t);o.restore()}if(">"===e||"+"===e||"~"===e||"|"===e||"^"===e){for(o.i++,"^"===e&&"^"===o.currentChar()&&(e="^^",o.i++);o.isWhitespace();)o.i++;return new Ie.Combinator(e)}return o.isWhitespace(-1)?new Ie.Combinator(" "):new Ie.Combinator(null)},selector:function(e){var t,n,r,l,u,c,h,f=o.i;for(e=!1!==e;(e&&(n=this.extend())||e&&(c=o.$str("when"))||(l=this.element()))&&(c?h=a(this.conditions,"expected condition"):h?s("CSS guard can only be used at the end of selector"):n?u=u?u.concat(n):n:(u&&s("Extend can only be used at the end of selector"),r=o.currentChar(),t?t.push(l):t=[l],l=null),"{"!==r&&"}"!==r&&";"!==r&&","!==r&&")"!==r););if(t)return new Ie.Selector(t,u,h,f,i);u&&s("Extend must be used to extend a selector, it cannot be used on its own")},selectors:function(){for(var e,t;(e=this.selector())&&(t?t.push(e):t=[e],o.commentStore.length=0,e.condition&&t.length>1&&s("Guards are only currently allowed on a single selector."),o.$char(","));)e.condition&&s("Guards are only currently allowed on a single selector."),o.commentStore.length=0;return t},attribute:function(){if(o.$char("[")){var e,t,n,i=this.entities;return(e=i.variableCurly())||(e=a(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),(n=o.$re(/^[|~*$^]?=/))&&(t=i.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||i.variableCurly()),l("]"),new Ie.Attribute(e,n,t)}},block:function(){var e;if(o.$char("{")&&(e=this.primary())&&o.$char("}"))return e},blockRuleset:function(){var e=this.block();return e&&(e=new Ie.Ruleset(null,e)),e},detachedRuleset:function(){var e,t,n;if(o.save(),!o.$re(/^[.#]\(/)||(t=(e=this.mixin.args(!1)).args,n=e.variadic,o.$char(")"))){var i=this.blockRuleset();if(i)return o.forget(),t?new Ie.mixin.Definition(null,t,i,null,n):new Ie.DetachedRuleset(i);o.restore()}else o.restore()},ruleset:function(){var e,n,i;if(o.save(),t.dumpLineNumbers&&(i=u(o.i)),(e=this.selectors())&&(n=this.block())){o.forget();var r=new Ie.Ruleset(e,n,t.strictImports);return t.dumpLineNumbers&&(r.debugInfo=i),r}o.restore()},declaration:function(){var e,t,n,r,s,a,l=o.i,u=o.currentChar();if("."!==u&&"#"!==u&&"&"!==u&&":"!==u)if(o.save(),e=this.variable()||this.ruleProperty()){if((a="string"==typeof e)&&(t=this.detachedRuleset())&&(n=!0),o.commentStore.length=0,!t){if(s=!a&&e.length>1&&e.pop().value,t=e[0].value&&"--"===e[0].value.slice(0,2)?this.permissiveValue():this.anonymousValue())return o.forget(),new Ie.Declaration(e,t,!1,s,l,i);t||(t=this.value()),t?r=this.important():a&&(t=this.permissiveValue())}if(t&&(this.end()||n))return o.forget(),new Ie.Declaration(e,t,r,s,l,i);o.restore()}else o.restore()},anonymousValue:function(){var e=o.i,t=o.$re(/^([^.#@\$+\/'"*`(;{}-]*);/);if(t)return new Ie.Anonymous(t[1],e)},permissiveValue:function(e){var t,n,r,a,l=e||";",u=o.i,c=[];function h(){var e=o.currentChar();return"string"==typeof l?e===l:l.test(e)}if(!h()){a=[];do{((n=this.comment())||(n=this.entity()))&&a.push(n)}while(n);if(r=h(),a.length>0){if(a=new Ie.Expression(a),r)return a;c.push(a)," "===o.prevChar()&&c.push(new Ie.Anonymous(" ",u))}if(o.save(),a=o.$parseUntil(l)){if("string"==typeof a&&s("Expected '"+a+"'","Parse"),1===a.length&&" "===a[0])return o.forget(),new Ie.Anonymous("",u);var f=void 0;for(t=0;t0)return new Ie.Expression(r)},mediaFeatures:function(){var e,t=this.entities,n=[];do{if(e=this.mediaFeature()){if(n.push(e),!o.$char(","))break}else if((e=t.variable()||t.mixinLookup())&&(n.push(e),!o.$char(",")))break}while(e);return n.length>0?n:null},media:function(){var e,n,r,a,l=o.i;if(t.dumpLineNumbers&&(a=u(l)),o.save(),o.$str("@media"))return e=this.mediaFeatures(),(n=this.block())||s("media definitions require block statements after any features"),o.forget(),r=new Ie.Media(n,e,l,i),t.dumpLineNumbers&&(r.debugInfo=a),r;o.restore()},plugin:function(){var e,t,n,r=o.i;if(o.$re(/^@plugin?\s+/)){if(n=(t=this.pluginArgs())?{pluginArgs:t,isPlugin:!0}:{isPlugin:!0},e=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=r,s("missing semi-colon on @plugin")),new Ie.Import(e,null,n,r,i);o.i=r,s("malformed @plugin statement")}},pluginArgs:function(){if(o.save(),!o.$char("("))return o.restore(),null;var e=o.$re(/^\s*([^\);]+)\)\s*/);return e[1]?(o.forget(),e[1].trim()):(o.restore(),null)},atrule:function(){var e,n,r,a,l,c,h,f=o.i,p=!0,v=!0;if("@"===o.currentChar()){if(n=this.import()||this.plugin()||this.media())return n;if(o.save(),e=o.$re(/^@[a-z-]+/)){switch(a=e,"-"==e.charAt(1)&&e.indexOf("-",2)>0&&(a="@"+e.slice(e.indexOf("-",2)+1)),a){case"@charset":l=!0,p=!1;break;case"@namespace":c=!0,p=!1;break;case"@keyframes":case"@counter-style":l=!0;break;case"@document":case"@supports":h=!0,v=!1;break;default:h=!0}if(o.commentStore.length=0,l?(n=this.entity())||s("expected "+e+" identifier"):c?(n=this.expression())||s("expected "+e+" expression"):h&&(n=this.permissiveValue(/^[{;]/),p="{"===o.currentChar(),n?n.value||(n=null):p||";"===o.currentChar()||s(e+" rule is missing block or ending semi-colon")),p&&(r=this.blockRuleset()),r||!p&&n&&o.$char(";"))return o.forget(),new Ie.AtRule(e,n,r,f,i,t.dumpLineNumbers?u(f):null,v);o.restore("at-rule options not recognised")}}},value:function(){var e,t=[],n=o.i;do{if((e=this.expression())&&(t.push(e),!o.$char(",")))break}while(e);if(t.length>0)return new Ie.Value(t,n)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var e,t;if(o.save(),o.$char("("))return(e=this.addition())&&o.$char(")")?(o.forget(),(t=new Ie.Expression([e])).parens=!0,t):void o.restore("Expected ')'");o.restore()},multiplication:function(){var e,t,n,i,r;if(e=this.operand()){for(r=o.isWhitespace(-1);!o.peek(/^\/[*\/]/);){if(o.save(),!(n=o.$char("/")||o.$char("*")||o.$str("./"))){o.forget();break}if(!(t=this.operand())){o.restore();break}o.forget(),e.parensInOp=!0,t.parensInOp=!0,i=new Ie.Operation(n,[i||e,t],r),r=o.isWhitespace(-1)}return i||e}},addition:function(){var e,t,n,i,r;if(e=this.multiplication()){for(r=o.isWhitespace(-1);(n=o.$re(/^[-+]\s+/)||!r&&(o.$char("+")||o.$char("-")))&&(t=this.multiplication());)e.parensInOp=!0,t.parensInOp=!0,i=new Ie.Operation(n,[i||e,t],r),r=o.isWhitespace(-1);return i||e}},conditions:function(){var e,t,n,i=o.i;if(e=this.condition(!0)){for(;o.peek(/^,\s*(not\s*)?\(/)&&o.$char(",")&&(t=this.condition(!0));)n=new Ie.Condition("or",n||e,t,i);return n||e}},condition:function(e){var t,n,i;if(t=this.conditionAnd(e)){if(n=o.$str("or")){if(!(i=this.condition(e)))return;t=new Ie.Condition(n,t,i)}return t}},conditionAnd:function(e){var t,n,i,r,s=this;if(t=(r=s.negatedCondition(e)||s.parenthesisCondition(e))||e?r:s.atomicCondition(e)){if(n=o.$str("and")){if(!(i=this.conditionAnd(e)))return;t=new Ie.Condition(n,t,i)}return t}},negatedCondition:function(e){if(o.$str("not")){var t=this.parenthesisCondition(e);return t&&(t.negate=!t.negate),t}},parenthesisCondition:function(e){var t;if(o.save(),o.$str("(")){if(t=function(t){var n;if(o.save(),n=t.condition(e)){if(o.$char(")"))return o.forget(),n;o.restore()}else o.restore()}(this))return o.forget(),t;if(t=this.atomicCondition(e)){if(o.$char(")"))return o.forget(),t;o.restore("expected ')' got '"+o.currentChar()+"'")}else o.restore()}else o.restore()},atomicCondition:function(e){var t,n,i,r,a=this.entities,l=o.i;function u(){return this.addition()||a.keyword()||a.quoted()||a.mixinLookup()}if(t=(u=u.bind(this))())return o.$char(">")?r=o.$char("=")?">=":">":o.$char("<")?r=o.$char("=")?"<=":"<":o.$char("=")&&(r=o.$char(">")?"=>":o.$char("<")?"=<":"="),r?(n=u())?i=new Ie.Condition(r,t,n,l,!1):s("expected expression"):i=new Ie.Condition("=",t,new Ie.Keyword("true"),l,!1),i},operand:function(){var e,t=this.entities;o.peek(/^-[@\$\(]/)&&(e=o.$char("-"));var n=this.sub()||t.dimension()||t.color()||t.variable()||t.property()||t.call()||t.quoted(!0)||t.colorKeyword()||t.mixinLookup();return e&&(n.parensInOp=!0,n=new Ie.Negative(n)),n},expression:function(){var e,t,n=[],i=o.i;do{(e=this.comment())?n.push(e):((e=this.addition()||this.entity())instanceof Ie.Comment&&(e=null),e&&(n.push(e),o.peek(/^\/[\/*]/)||(t=o.$char("/"))&&n.push(new Ie.Anonymous(t,i))))}while(e);if(n.length>0)return new Ie.Expression(n)},property:function(){var e=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(e)return e[1]},ruleProperty:function(){var e,t,n=[],r=[];o.save();var s=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(s)return n=[new Ie.Keyword(s[1])],o.forget(),n;function a(e){var t=o.i,i=o.$re(e);if(i)return r.push(t),n.push(i[1])}for(a(/^(\*?)/);a(/^((?:[\w-]+)|(?:[@\$]\{[\w-]+\}))/););if(n.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===n[0]&&(n.shift(),r.shift()),t=0;t1?e-1:e)<1?r+(o-r)*e*6:2*e<1?o:3*e<2?r+(o-r)*(2/3-e)*6:r}e=Qe(e)%360/360,t=Ge(Qe(t)),n=Ge(Qe(n)),i=Ge(Qe(i)),r=2*n-(o=n<=.5?n*(t+1):n+t-n*t);var a=[255*s(e+1/3),255*s(e),255*s(e-1/3)];return i=Qe(i),new h(a,i,"hsla")}catch(e){}},hsv:function(e,t,n){return Te.hsva(e,t,n,1)},hsva:function(e,t,n,i){var r,o;e=Qe(e)%360/360*360,t=Qe(t),n=Qe(n),i=Qe(i);var s=[n,n*(1-t),n*(1-(o=e/60-(r=Math.floor(e/60%6)))*t),n*(1-(1-o)*t)],a=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return Te.rgba(255*s[a[r][0]],255*s[a[r][1]],255*s[a[r][2]],i)},hue:function(e){return new X(Je(e).h)},saturation:function(e){return new X(100*Je(e).s,"%")},lightness:function(e){return new X(100*Je(e).l,"%")},hsvhue:function(e){return new X(He(e).h)},hsvsaturation:function(e){return new X(100*He(e).s,"%")},hsvvalue:function(e){return new X(100*He(e).v,"%")},red:function(e){return new X(e.rgb[0])},green:function(e){return new X(e.rgb[1])},blue:function(e){return new X(e.rgb[2])},alpha:function(e){return new X(Je(e).a)},luma:function(e){return new X(e.luma()*e.alpha*100,"%")},luminance:function(e){var t=.2126*e.rgb[0]/255+.7152*e.rgb[1]/255+.0722*e.rgb[2]/255;return new X(t*e.alpha*100,"%")},saturate:function(e,t,n){if(!e.rgb)return null;var i=Je(e);return void 0!==n&&"relative"===n.value?i.s+=i.s*t.value/100:i.s+=t.value/100,i.s=Ge(i.s),We(e,i)},desaturate:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.s-=i.s*t.value/100:i.s-=t.value/100,i.s=Ge(i.s),We(e,i)},lighten:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.l+=i.l*t.value/100:i.l+=t.value/100,i.l=Ge(i.l),We(e,i)},darken:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.l-=i.l*t.value/100:i.l-=t.value/100,i.l=Ge(i.l),We(e,i)},fadein:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.a+=i.a*t.value/100:i.a+=t.value/100,i.a=Ge(i.a),We(e,i)},fadeout:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.a-=i.a*t.value/100:i.a-=t.value/100,i.a=Ge(i.a),We(e,i)},fade:function(e,t){var n=Je(e);return n.a=t.value/100,n.a=Ge(n.a),We(e,n)},spin:function(e,t){var n=Je(e),i=(n.h+t.value)%360;return n.h=i<0?360+i:i,We(e,n)},mix:function(e,t,n){n||(n=new X(50));var i=n.value/100,r=2*i-1,o=Je(e).a-Je(t).a,s=((r*o==-1?r:(r+o)/(1+r*o))+1)/2,a=1-s,l=[e.rgb[0]*s+t.rgb[0]*a,e.rgb[1]*s+t.rgb[1]*a,e.rgb[2]*s+t.rgb[2]*a],u=e.alpha*i+t.alpha*(1-i);return new h(l,u)},greyscale:function(e){return Te.desaturate(e,new X(100))},contrast:function(e,t,n,i){if(!e.rgb)return null;if(void 0===n&&(n=Te.rgba(255,255,255,1)),void 0===t&&(t=Te.rgba(0,0,0,1)),t.luma()>n.luma()){var r=n;n=t,t=r}return i=void 0===i?.43:Qe(i),e.luma().5&&(i=1,n=e>.25?Math.sqrt(e):((16*e-12)*e+4)*e),e-(1-2*t)*i*(n-e)},hardlight:function(e,t){return Ye.overlay(t,e)},difference:function(e,t){return Math.abs(e-t)},exclusion:function(e,t){return e+t-2*e*t},average:function(e,t){return(e+t)/2},negation:function(e,t){return 1-Math.abs(e+t-1)}};for(var Xe in Ye)Ye.hasOwnProperty(Xe)&&(Ze[Xe]=Ze.bind(null,Ye[Xe]));var et=function(e){return Array.isArray(e.value)?e.value:Array(e)},tt={_SELF:function(e){return e},extract:function(e,t){return t=t.value-1,et(e)[t]},length:function(e){return new X(et(e).length)},range:function(e,t,n){var i,r,o=1,s=[];t?(r=t,i=e.value,n&&(o=n.value)):(i=1,r=e);for(var a=i;a<=r.value;a+=o)s.push(new X(a,r.unit));return new ie(s)},each:function(e,t){var n,i,r=[];i=!e.value||e instanceof ue?e.ruleset?e.ruleset.rules:e.rules?e.rules:Array.isArray(e)?e:[e]:Array.isArray(e.value)?e.value:[e.value];var o="@value",s="@key",a="@index";t.params?(o=t.params[0]&&t.params[0].name,s=t.params[1]&&t.params[1].name,a=t.params[2]&&t.params[2].name,t=t.rules):t=t.ruleset;for(var l=0;ls.value)&&(c[i]=r);else{if(void 0!==l&&a!==l)throw{type:"Argument",message:"incompatible types"};h[a]=c.length,c.push(r)}else Array.isArray(t[n].value)&&Array.prototype.push.apply(t,Array.prototype.slice.call(t[n].value));return 1==c.length?c[0]:(t=c.map((function(e){return e.toCSS(this.context)})).join(this.context.compress?",":", "),new L((e?"min":"max")+"("+t+")"))},at={min:function(){for(var e=[],t=0;t",r=0;r";return i+="',i=encodeURIComponent(i),new ce(new ue("'"+(i="data:image/svg+xml,"+i)+"'",i,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)}}),J.addMultiple(ht),t},pt=function(e,t){var n;void 0===t&&(t={});var i=t.variables,r=new j.Eval(t);"object"!=typeof i||Array.isArray(i)||(i=Object.keys(i).map((function(e){var t=i[e];return t instanceof Ie.Value||(t instanceof Ie.Expression||(t=new Ie.Expression([t])),t=new Ie.Value([t])),new Ie.Declaration("@"+e,t,!1,null,0)})),r.frames=[new Ie.Ruleset(null,i)]);var o,s,a=[new Ue.JoinSelectorVisitor,new Ue.MarkVisibleSelectorsVisitor(!0),new Ue.ExtendVisitor,new Ue.ToCSSVisitor({compress:Boolean(t.compress)})],l=[];if(t.pluginManager){s=t.pluginManager.visitor();for(var u=0;u<2;u++)for(s.first();o=s.get();)o.isPreEvalVisitor?0!==u&&-1!==l.indexOf(o)||(l.push(o),o.run(e)):0!==u&&-1!==a.indexOf(o)||(o.isPreVisitor?a.unshift(o):a.push(o))}n=e.eval(r);for(u=0;u=t);n++);this.preProcessors.splice(n,0,{preProcessor:e,priority:t})},e.prototype.addPostProcessor=function(e,t){var n;for(n=0;n=t);n++);this.postProcessors.splice(n,0,{postProcessor:e,priority:t})},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.getPreProcessors=function(){for(var e=[],t=0;t0){var i=void 0,r=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?i=this.sourceMapURL:this._sourceMapFilename&&(i=this._sourceMapFilename),this.sourceMapURL=i,this.sourceMap=r}return this._css.join("")},t}()}(e=new _e(e,t)),r=function(e,t){return function(){function n(e){this.options=e}return n.prototype.toCSS=function(t,n,i){var r=new e({contentsIgnoredCharsMap:i.contentsIgnoredChars,rootNode:t,contentsMap:i.contents,sourceMapFilename:this.options.sourceMapFilename,sourceMapURL:this.options.sourceMapURL,outputFilename:this.options.sourceMapOutputFilename,sourceMapBasepath:this.options.sourceMapBasepath,sourceMapRootpath:this.options.sourceMapRootpath,outputSourceFiles:this.options.outputSourceFiles,sourceMapGenerator:this.options.sourceMapGenerator,sourceMapFileInline:this.options.sourceMapFileInline}),o=r.toCSS(n);return this.sourceMap=r.sourceMap,this.sourceMapURL=r.sourceMapURL,this.options.sourceMapInputFilename&&(this.sourceMapInputFilename=r.normalizeFilename(this.options.sourceMapInputFilename)),void 0!==this.options.sourceMapBasepath&&void 0!==this.sourceMapURL&&(this.sourceMapURL=r.removeBasepath(this.sourceMapURL)),o+this.getCSSAppendage()},n.prototype.getCSSAppendage=function(){var e=this.sourceMapURL;if(this.options.sourceMapFileInline){if(void 0===this.sourceMap)return"";e="data:application/json;base64,"+t.encodeBase64(this.sourceMap)}return e?"/*# sourceMappingURL="+e+" */":""},n.prototype.getExternalSourceMap=function(){return this.sourceMap},n.prototype.setExternalSourceMap=function(e){this.sourceMap=e},n.prototype.isInline=function(){return this.options.sourceMapFileInline},n.prototype.getSourceMapURL=function(){return this.sourceMapURL},n.prototype.getOutputFilename=function(){return this.options.sourceMapOutputFilename},n.prototype.getInputFilename=function(){return this.sourceMapInputFilename},n}()}(i,e),o=function(e){return function(){function t(e,t){this.root=e,this.imports=t}return t.prototype.toCSS=function(t){var n,i,r={};try{n=pt(this.root,t)}catch(e){throw new R(e,this.imports)}try{var o=Boolean(t.compress);o&&Ce.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");var s={compress:o,dumpLineNumbers:t.dumpLineNumbers,strictUnits:Boolean(t.strictUnits),numPrecision:8};t.sourceMap?(i=new e(t.sourceMap),r.css=i.toCSS(n,s,this.imports)):r.css=n.toCSS(s)}catch(e){throw new R(e,this.imports)}if(t.pluginManager)for(var a=t.pluginManager.getPostProcessors(),l=0;l=200&&t.status<300?n(t.responseText,t.getResponseHeader("Last-Modified")):"function"==typeof i&&i(t.status,e)}"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/css"),gt.debug("XHR: Getting '"+e+"'"),r.open("GET",e,o),r.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),r.send(null),mt.isFileProtocol&&!mt.fileAsync?0===r.status||r.status>=200&&r.status<300?n(r.responseText):i(r.status,e):o?r.onreadystatechange=function(){4==r.readyState&&s(r,n,i)}:s(r,n,i)},t.prototype.supports=function(){return!0},t.prototype.clearFileCache=function(){bt={}},t.prototype.loadFile=function(e,t,n,i){t&&!this.isPathAbsolute(e)&&(e=t+e),e=n.ext?this.tryAppendExtension(e,n.ext):e,n=n||{};var r=this.extractUrlParts(e,window.location.href).url,o=this;return new Promise((function(e,t){if(n.useFileCache&&bt[r])try{var i=bt[r];return e({contents:i,filename:r,webInfo:{lastModified:new Date}})}catch(e){return t({filename:r,message:"Error loading file "+r+" error was "+e.message})}o.doXHR(r,n.mime,(function(t,n){bt[r]=t,e({contents:t,filename:r,webInfo:{lastModified:n}})}),(function(e,n){t({type:"File",message:"'"+n+"' wasn't found ("+e+")",href:r})}))}))},t}(ke),xt=function(e,t){return mt=e,gt=t,wt},St=function(e){function t(t){var n=e.call(this)||this;return n.less=t,n}return o(t,e),t.prototype.loadPlugin=function(e,t,n,i,r){return new Promise((function(o,s){r.loadFile(e,t,n,i).then(o).catch(s)}))},t}(Ae),It=function(t,i,r){return{add:function(o,s){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting?function(e,t){var n=e.filename||t,o=[],s=(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+" in "+n,a=function(e,t,n){void 0!==e.extract[t]&&o.push("{line} {content}".replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};e.line&&(a(e,0,""),a(e,1,"line"),a(e,2,""),s+=" on line "+e.line+", column "+(e.column+1)+":\n"+o.join("\n")),e.stack&&(e.extract||r.logLevel>=4)&&(s+="\nStack Trace\n"+e.stack),i.logger.error(s)}(o,s):"function"==typeof r.errorReporting&&r.errorReporting("add",o,s):function(i,o){var s,a,l="less-error-message:"+e(o||""),u=t.document.createElement("div"),c=[],h=i.filename||o,f=h.match(/([^\/]+(\?.*)?)$/)[1];u.id=l,u.className="less-error-message",a="

"+(i.type||"Syntax")+"Error: "+(i.message||"There is an error in your .less file")+'

in '+f+" ";var p=function(e,t,n){void 0!==e.extract[t]&&c.push('

  • {content}
  • '.replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};i.line&&(p(i,0,""),p(i,1,"line"),p(i,2,""),a+="on line "+i.line+", column "+(i.column+1)+":

      "+c.join("")+"
    "),i.stack&&(i.extract||r.logLevel>=4)&&(a+="
    Stack Trace
    "+i.stack.split("\n").slice(1).join("
    ")),u.innerHTML=a,n(t.document,[".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"}),u.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(";"),"development"===r.env&&(s=setInterval((function(){var e=t.document,n=e.body;n&&(e.getElementById(l)?n.replaceChild(u,e.getElementById(l)):n.insertBefore(u,n.firstChild),clearInterval(s))}),10))}(o,s)},remove:function(n){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting||"function"==typeof r.errorReporting&&r.errorReporting("remove",n):function(n){var i=t.document.getElementById("less-error-message:"+e(n));i&&i.parentNode.removeChild(i)}(n)}}},Ct={javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",rewriteUrls:!1,math:0,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""};if(window.less)for(var _t in window.less)window.less.hasOwnProperty(_t)&&(Ct[_t]=window.less[_t]);!function(e,n){t(n,i(e)),void 0===n.isFileProtocol&&(n.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(e.location.protocol)),n.async=n.async||!1,n.fileAsync=n.fileAsync||!1,n.poll=n.poll||(n.isFileProtocol?1e3:1500),n.env=n.env||("127.0.0.1"==e.location.hostname||"0.0.0.0"==e.location.hostname||"localhost"==e.location.hostname||e.location.port&&e.location.port.length>0||n.isFileProtocol?"development":"production");var r=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(e.location.hash);r&&(n.dumpLineNumbers=r[1]),void 0===n.useFileCache&&(n.useFileCache=!0),void 0===n.onReady&&(n.onReady=!0),n.relativeUrls&&(n.rewriteUrls="all")}(window,Ct),Ct.plugins=Ct.plugins||[],window.LESS_PLUGINS&&(Ct.plugins=Ct.plugins.concat(window.LESS_PLUGINS));var kt,At,Mt,Pt=function(e,i){var r=e.document,o=yt();o.options=i;var s=o.environment,a=xt(i,o.logger),l=new a;s.addFileManager(l),o.FileManager=a,o.PluginLoader=St,function(e,t){t.logLevel=void 0!==t.logLevel?t.logLevel:"development"===t.env?3:1,t.loggers||(t.loggers=[{debug:function(e){t.logLevel>=4&&console.log(e)},info:function(e){t.logLevel>=3&&console.log(e)},warn:function(e){t.logLevel>=2&&console.warn(e)},error:function(e){t.logLevel>=1&&console.error(e)}}]);for(var n=0;n0&&l.childNodes.length>0&&s.firstChild.nodeValue===l.firstChild.nodeValue);var u=t.getElementsByTagName("head")[0];if(null===s||!1===a){var c=i&&i.nextSibling||null;c?c.parentNode.insertBefore(l,c):u.appendChild(l)}if(s&&!1===a&&s.parentNode.removeChild(s),l.styleSheet)try{l.styleSheet.cssText=n}catch(e){throw new Error("Couldn't reassign styleSheet.cssText.")}},i=function(e){var t,n=e.document;return n.currentScript||(t=n.getElementsByTagName("script"))[t.length-1]},r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function s(){for(var e=0,t=0,n=arguments.length;tt?1:void 0};var h=function(e){function t(t,n,i){var r=e.call(this)||this,o=r;return Array.isArray(t)?r.rgb=t:t.length>=6?(r.rgb=[],t.match(/.{2}/g).map((function(e,t){t<3?o.rgb.push(parseInt(e,16)):o.alpha=parseInt(e,16)/255}))):(r.rgb=[],t.split("").map((function(e,t){t<3?o.rgb.push(parseInt(e+e,16)):o.alpha=parseInt(e+e,16)/255}))),r.alpha=r.alpha||("number"==typeof n?n:1),void 0!==i&&(r.value=i),r}return o(t,e),t.prototype.luma=function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255;return.2126*(e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},t.prototype.genCSS=function(e,t){t.add(this.toCSS(e))},t.prototype.toCSS=function(e,t){var n,i,r,o=e&&e.compress&&!t,s=[];if(i=this.fround(e,this.alpha),this.value)if(0===this.value.indexOf("rgb"))i<1&&(r="rgba");else{if(0!==this.value.indexOf("hsl"))return this.value;r=i<1?"hsla":"hsl"}else i<1&&(r="rgba");switch(r){case"rgba":s=this.rgb.map((function(e){return f(Math.round(e),255)})).concat(f(i,1));break;case"hsla":s.push(f(i,1));case"hsl":n=this.toHSL(),s=[this.fround(e,n.h),this.fround(e,100*n.s)+"%",this.fround(e,100*n.l)+"%"].concat(s)}if(r)return r+"("+s.join(","+(o?"":" "))+")";if(n=this.toRGB(),o){var a=n.split("");a[1]===a[2]&&a[3]===a[4]&&a[5]===a[6]&&(n="#"+a[1]+a[3]+a[5])}return n},t.prototype.operate=function(e,n,i){for(var r=new Array(3),o=this.alpha*(1-i.alpha)+i.alpha,s=0;s<3;s++)r[s]=this._operate(e,n,this.rgb[s],i.rgb[s]);return new t(r,o)},t.prototype.toRGB=function(){return p(this.rgb)},t.prototype.toHSL=function(){var e,t,n=this.rgb[0]/255,i=this.rgb[1]/255,r=this.rgb[2]/255,o=this.alpha,s=Math.max(n,i,r),a=Math.min(n,i,r),l=(s+a)/2,u=s-a;if(s===a)e=t=0;else{switch(t=l>.5?u/(2-s-a):u/(s+a),s){case n:e=(i-r)/u+(i=0&&"\n"!==t.charAt(n);)r++;return"number"==typeof e&&(i=(t.slice(0,e).match(/\n/g)||"").length),{line:i,column:r}}function C(e){var t,n=e.length,i=new Array(n);for(t=0;t|Function):(\d+):(\d+)/,R=function(e,t,n){Error.call(this);var i=e.filename||n;if(this.message=e.message,this.stack=e.stack,t&&i){var r=t.contents[i],o=I(e.index,r),s=o.line,a=o.column,l=e.call&&I(e.call,r).line,u=r?r.split("\n"):"";if(this.type=e.type||"Syntax",this.filename=i,this.index=e.index,this.line="number"==typeof s?s+1:null,this.column=a,!this.line&&this.stack){var c=this.stack.match(E),h=new Function("a","throw new Error()"),f=0;try{h()}catch(e){var p=e.stack.match(E);f=1-parseInt(p[2])}c&&(c[2]&&(this.line=parseInt(c[2])+f),c[3]&&(this.column=parseInt(c[3])))}this.callLine=l+1,this.callExtract=u[l],this.extract=[u[this.line-2],u[this.line-1],u[this.line]]}};if(void 0===Object.create){var V=function(){};V.prototype=Error.prototype,R.prototype=new V}else R.prototype=Object.create(Error.prototype);R.prototype.constructor=R,R.prototype.toString=function(e){void 0===e&&(e={});var t="",n=this.extract||[],i=[],r=function(e){return e};if(e.stylize){var o=typeof e.stylize;if("function"!==o)throw Error("options.stylize should be a function, got a "+o+"!");r=e.stylize}if(null!==this.line){if("string"==typeof n[0]&&i.push(r(this.line-1+" "+n[0],"grey")),"string"==typeof n[1]){var s=this.line+" ";n[1]&&(s+=n[1].slice(0,this.column)+r(r(r(n[1].substr(this.column,1),"bold")+n[1].slice(this.column+1),"red"),"inverse")),i.push(s)}"string"==typeof n[2]&&i.push(r(this.line+1+" "+n[2],"grey")),i=i.join("\n")+r("","reset")+"\n"}return t+=r(this.type+"Error: "+this.message,"red"),this.filename&&(t+=r(" in ","red")+this.filename),this.line&&(t+=r(" on line "+this.line+", column "+(this.column+1)+":","grey")),t+="\n"+i,this.callLine&&(t+=r("from ","red")+(this.filename||"")+"/n",t+=r(this.callLine,"grey")+" "+this.callExtract+"/n"),t};var F=function(e){function t(t,n,i,r,o,s){var a=e.call(this)||this;return a.extendList=n,a.condition=i,a.evaldCondition=!i,a._index=r,a._fileInfo=o,a.elements=a.getElements(t),a.mixinElements_=void 0,a.copyVisibilityInfo(s),a.setParent(a.elements,a),a}return o(t,e),t.prototype.accept=function(e){this.elements&&(this.elements=e.visitArray(this.elements)),this.extendList&&(this.extendList=e.visitArray(this.extendList)),this.condition&&(this.condition=e.visit(this.condition))},t.prototype.createDerived=function(e,n,i){var r=new t(e=this.getElements(e),n||this.extendList,null,this.getIndex(),this.fileInfo(),this.visibilityInfo());return r.evaldCondition=null!=i?i:this.evaldCondition,r.mediaEmpty=this.mediaEmpty,r},t.prototype.getElements=function(e){return e?("string"==typeof e&&this.parse.parseNode(e,["selector"],this._index,this._fileInfo,(function(t,n){if(t)throw new R({index:t.index,message:t.message},this.parse.imports,this._fileInfo.filename);e=n[0].elements})),e):[new g("","&",!1,this._index,this._fileInfo)]},t.prototype.createEmptySelectors=function(){var e=[new t([new g("","&",!1,this._index,this._fileInfo)],null,null,this._index,this._fileInfo)];return e[0].mediaEmpty=!0,e},t.prototype.match=function(e){var t,n,i=this.elements,r=i.length;if(0===(t=(e=e.mixinElements()).length)||ry.PARENS_DIVISION)||this.parensStack&&this.parensStack.length))},e.prototype.pathRequiresRewrite=function(e){return(this.rewriteUrls===w?W:G)(e)},e.prototype.rewritePath=function(e,t){var n;return t=t||"",n=this.normalizePath(t+e),W(e)&&G(t)&&!1===W(n)&&(n="./"+n),n},e.prototype.normalizePath=function(e){var t,n=e.split("/").reverse();for(e=[];0!==n.length;)switch(t=n.pop()){case".":break;case"..":0===e.length||".."===e[e.length-1]?e.push(t):e.pop();break;default:e.push(t)}return e.join("/")},e}();var J=function e(t){return{_data:{},add:function(e,t){e=e.toLowerCase(),this._data.hasOwnProperty(e),this._data[e]=t},addMultiple:function(e){var t=this;Object.keys(e).forEach((function(n){t.add(n,e[n])}))},get:function(e){return this._data[e]||t&&t.get(e)},getLocalFunctions:function(){return this._data},inherit:function(){return e(this)},create:function(t){return e(t)}}}(null),H={eval:function(){var e=this.value_,t=this.error_;if(t)throw t;if(null!=e)return e?$.True:$.False},value:function(e){this.value_=e},error:function(e){this.error_=e},reset:function(){this.value_=this.error_=null}},Q=function(e){function t(t,n,i,r){var o=e.call(this)||this;return o.selectors=t,o.rules=n,o._lookups={},o._variables=null,o._properties=null,o.strictImports=i,o.copyVisibilityInfo(r),o.allowRoot=!0,o.setParent(o.selectors,o),o.setParent(o.rules,o),o}return o(t,e),t.prototype.isRulesetLike=function(){return!0},t.prototype.accept=function(e){this.paths?this.paths=e.visitArray(this.paths,!0):this.selectors&&(this.selectors=e.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=e.visitArray(this.rules))},t.prototype.eval=function(e){var n,i,r,o,s,a=!1;if(this.selectors&&(i=this.selectors.length)){for(n=new Array(i),H.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),o=0;o0;e--){var t=this.rules[e-1];if(t instanceof N)return this.parseValue(t)}},t.prototype.parseValue=function(e){var t=this;function n(e){return e.value instanceof L&&!e.parsed?("string"==typeof e.value.value?this.parse.parseNode(e.value.value,["value","important"],e.value.getIndex(),e.fileInfo(),(function(t,n){t&&(e.parsed=!0),n&&(e.value=n[0],e.important=n[1]||"",e.parsed=!0)})):e.parsed=!0,e):e}if(Array.isArray(e)){var i=[];return e.forEach((function(e){i.push(n.call(t,e))})),i}return n.call(t,e)},t.prototype.rulesets=function(){if(!this.rules)return[];var e,t,n=[],i=this.rules;for(e=0;t=i[e];e++)t.isRuleset&&n.push(t);return n},t.prototype.prependRule=function(e){var t=this.rules;t?t.unshift(e):this.rules=[e],this.setParent(e,this)},t.prototype.find=function(e,t,n){void 0===t&&(t=this);var i,r,o=[],s=e.toCSS();return s in this._lookups?this._lookups[s]:(this.rulesets().forEach((function(s){if(s!==t)for(var a=0;ai){if(!n||n(s)){r=s.find(new F(e.elements.slice(i)),t,n);for(var l=0;l0&&t.add(l),e.firstSelector=!0,s[0].genCSS(e,t),e.firstSelector=!1,i=1;i0?(o=(r=C(e)).pop(),s=i.createDerived(C(o.elements))):s=i.createDerived([]),t.length>0){var a=n.combinator,l=t[0].elements[0];a.emptyOrWhitespace&&!l.combinator.emptyOrWhitespace&&(a=l.combinator),s.elements.push(new g(a,l.value,n.isVariable,n._index,n._fileInfo)),s.elements=s.elements.concat(t[0].elements.slice(1))}if(0!==s.elements.length&&r.push(s),t.length>1){var u=t.slice(1);u=u.map((function(e){return e.createDerived(e.elements,[])})),r=r.concat(u)}return r}function s(e,t,n,i,r){var s;for(s=0;s0?i[i.length-1]=i[i.length-1].createDerived(i[i.length-1].elements.concat(e)):i.push(new F(e));else t.push([new F(e)])}function l(e,t){var n=t.createDerived(t.elements,t.extendList,t.evaldCondition);return n.copyVisibilityInfo(e),n}var u,c;if(!function e(t,n,l){var u,c,h,f,p,d,m,y,b,w,x,S,I=!1;for(f=[],p=[[]],u=0;y=l.elements[u];u++)if("&"!==y.value){var C=(S=void 0,(x=y).value instanceof v&&(S=x.value.value)instanceof F?S:null);if(null!=C){a(f,p);var _,k=[],A=[];for(_=e(k,n,C),I=I||_,h=0;h0&&m[0].elements.push(new g(y.combinator,"",y.isVariable,y._index,y._fileInfo)),d.push(m);else for(h=0;h0&&(t.push(p[u]),w=p[u][b-1],p[u][b-1]=w.createDerived(w.elements,l.extendList));return I}(c=[],t,n))if(t.length>0)for(c=[],u=0;u0)for(t=0;t-1e-6&&(i=n.toFixed(20).replace(/0+$/,"")),e&&e.compress){if(0===n&&this.unit.isLength())return void t.add(i);n>0&&n<1&&(i=i.substr(1))}t.add(i),this.unit.genCSS(e,t)},t.prototype.operate=function(e,n,i){var r=this._operate(e,n,this.value,i.value),o=this.unit.clone();if("+"===n||"-"===n)if(0===o.numerator.length&&0===o.denominator.length)o=i.unit.clone(),this.unit.backupUnit&&(o.backupUnit=this.unit.backupUnit);else if(0===i.unit.numerator.length&&0===o.denominator.length);else{if(i=i.convertTo(this.unit.usedUnits()),e.strictUnits&&i.unit.toString()!==o.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+o.toString()+"' and '"+i.unit.toString()+"'.");r=this._operate(e,n,this.value,i.value)}else"*"===n?(o.numerator=o.numerator.concat(i.unit.numerator).sort(),o.denominator=o.denominator.concat(i.unit.denominator).sort(),o.cancel()):"/"===n&&(o.numerator=o.numerator.concat(i.unit.denominator).sort(),o.denominator=o.denominator.concat(i.unit.numerator).sort(),o.cancel());return new t(r,o)},t.prototype.compare=function(e){var n,i;if(e instanceof t){if(this.unit.isEmpty()||e.unit.isEmpty())n=this,i=e;else if(n=this.unify(),i=e.unify(),0!==n.unit.compare(i.unit))return;return c.numericCompare(n.value,i.value)}},t.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},t.prototype.convertTo=function(e){var n,i,r,o,s,a=this.value,u=this.unit.clone(),c={};if("string"==typeof e){for(n in l)l[n].hasOwnProperty(e)&&((c={})[n]=e);e=c}for(i in s=function(e,t){return r.hasOwnProperty(e)?(t?a/=r[e]/r[o]:a*=r[e]/r[o],o):e},e)e.hasOwnProperty(i)&&(o=e[i],r=l[i],u.map(s));return u.cancel(),new t(a,u)},t}(c);X.prototype.type="Dimension";var ee=y,te=function(e){function t(t,n,i){var r=e.call(this)||this;return r.op=t.trim(),r.operands=n,r.isSpaced=i,r}return o(t,e),t.prototype.accept=function(e){this.operands=e.visitArray(this.operands)},t.prototype.eval=function(e){var n,i=this.operands[0].eval(e),r=this.operands[1].eval(e);if(e.isMathOn(this.op)){if(n="./"===this.op?"/":this.op,i instanceof X&&r instanceof h&&(i=i.toColor()),r instanceof X&&i instanceof h&&(r=r.toColor()),!i.operate){if(i instanceof t&&"/"===i.op&&e.math===ee.PARENS_DIVISION)return new t(this.op,[i,r],this.isSpaced);throw{type:"Operation",message:"Operation on an invalid type"}}return i.operate(e,n,r)}return new t(this.op,[i,r],this.isSpaced)},t.prototype.genCSS=function(e,t){this.operands[0].genCSS(e,t),this.isSpaced&&t.add(" "),t.add(this.op),this.isSpaced&&t.add(" "),this.operands[1].genCSS(e,t)},t}(c);te.prototype.type="Operation";var ne=y,ie=function(e){function t(t,n){var i=e.call(this)||this;if(i.value=t,i.noSpacing=n,!t)throw new Error("Expression requires an array parameter");return i}return o(t,e),t.prototype.accept=function(e){this.value=e.visitArray(this.value)},t.prototype.eval=function(e){var n,i=e.isMathOn(),r=this.parens&&(e.math!==ne.STRICT_LEGACY||!this.parensInOp),o=!1;return r&&e.inParenthesis(),this.value.length>1?n=new t(this.value.map((function(t){return t.eval?t.eval(e):t})),this.noSpacing):1===this.value.length?(!this.value[0].parens||this.value[0].parensInOp||e.inCalc||(o=!0),n=this.value[0].eval(e)):n=this,r&&e.outOfParenthesis(),!this.parens||!this.parensInOp||i||o||n instanceof X||(n=new v(n)),n},t.prototype.genCSS=function(e,t){for(var n=0;n1){var n=new F([],null,null,this.getIndex(),this.fileInfo()).createEmptySelectors();(t=new Q(n,e.mediaBlocks)).multiMedia=!0,t.copyVisibilityInfo(this.visibilityInfo()),this.setParent(t,this)}return delete e.mediaBlocks,delete e.mediaPath,t},t.prototype.evalNested=function(e){var t,n,i=e.mediaPath.concat([this]);for(t=0;t0;t--)e.splice(t,0,new L("and"));return new ie(e)}))),this.setParent(this.features,this),new Q([],[])},t.prototype.permute=function(e){if(0===e.length)return[];if(1===e.length)return e[0];for(var t=[],n=this.permute(e.slice(1)),i=0;i1?"["+e.value.map((function(e){return e.toCSS()})).join(", ")+"]":e.toCSS()},t}(c));pe.prototype.type="JavaScript";var ve=function(e){function t(t,n){var i=e.call(this)||this;return i.key=t,i.value=n,i}return o(t,e),t.prototype.accept=function(e){this.value=e.visit(this.value)},t.prototype.eval=function(e){return this.value.eval?new t(this.key,this.value.eval(e)):this},t.prototype.genCSS=function(e,t){t.add(this.key+"="),this.value.genCSS?this.value.genCSS(e,t):t.add(this.value)},t}(c);ve.prototype.type="Assignment";var de=function(e){function t(t,n,i,r,o){var s=e.call(this)||this;return s.op=t.trim(),s.lvalue=n,s.rvalue=i,s._index=r,s.negate=o,s}return o(t,e),t.prototype.accept=function(e){this.lvalue=e.visit(this.lvalue),this.rvalue=e.visit(this.rvalue)},t.prototype.eval=function(e){var t=function(e,t,n){switch(e){case"and":return t&&n;case"or":return t||n;default:switch(c.compare(t,n)){case-1:return"<"===e||"=<"===e||"<="===e;case 0:return"="===e||">="===e||"=<"===e||"<="===e;case 1:return">"===e||">="===e;default:return!1}}}(this.op,this.lvalue.eval(e),this.rvalue.eval(e));return this.negate?!t:t},t}(c);de.prototype.type="Condition";var me=function(e){function t(t){var n=e.call(this)||this;return n.value=t,n}return o(t,e),t}(c);me.prototype.type="UnicodeDescriptor";var ge=function(e){function t(t){var n=e.call(this)||this;return n.value=t,n}return o(t,e),t.prototype.genCSS=function(e,t){t.add("-"),this.value.genCSS(e,t)},t.prototype.eval=function(e){return e.isMathOn()?new te("*",[new X(-1),this.value]).eval(e):new t(this.value.eval(e))},t}(c);ge.prototype.type="Negative";var ye=function(e){function t(n,i,r,o,s){var a=e.call(this)||this;switch(a.selector=n,a.option=i,a.object_id=t.next_id++,a.parent_ids=[a.object_id],a._index=r,a._fileInfo=o,a.copyVisibilityInfo(s),a.allowRoot=!0,i){case"all":a.allowBefore=!0,a.allowAfter=!0;break;default:a.allowBefore=!1,a.allowAfter=!1}return a.setParent(a.selector,a),a}return o(t,e),t.prototype.accept=function(e){this.selector=e.visit(this.selector)},t.prototype.eval=function(e){return new t(this.selector.eval(e),this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},t.prototype.clone=function(e){return new t(this.selector,this.option,this.getIndex(),this.fileInfo(),this.visibilityInfo())},t.prototype.findSelfSelectors=function(e){var t,n,i=[];for(t=0;t0&&n.length&&""===n[0].combinator.value&&(n[0].combinator.value=" "),i=i.concat(e[t].elements);this.selfSelectors=[new F(i)],this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo())},t}(c);ye.next_id=0,ye.prototype.type="Extend";var be=function(e){function t(t,n,i){var r=e.call(this)||this;return r.variable=t,r._index=n,r._fileInfo=i,r.allowRoot=!0,r}return o(t,e),t.prototype.eval=function(e){var t,n=new se(this.variable,this.getIndex(),this.fileInfo()).eval(e),i=new R({message:"Could not evaluate variable call "+this.variable});if(!n.ruleset){if(n.rules)t=n;else if(Array.isArray(n))t=new Q("",n);else{if(!Array.isArray(n.value))throw i;t=new Q("",n.value)}n=new Z(t)}if(n.ruleset)return n.callEval(e);throw i},t}(c);be.prototype.type="VariableCall";var we=function(e){function t(t,n,i,r){var o=e.call(this)||this;return o.value=t,o.lookups=n,o._index=i,o._fileInfo=r,o}return o(t,e),t.prototype.eval=function(e){var t,n,i=this.value.eval(e);for(t=0;tthis.params.length)return!1}n=Math.min(o,this.arity);for(var s=0;s0){for(c=!0,a=0;a0)f=2;else if(f=1,p[1]+p[2]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(m)+"`",index:this.getIndex(),filename:this.fileInfo().filename};for(a=0;a=0;s--){var a=o[s];if(a[r?"supportsSync":"supports"](e,t,n,i))return a}return null},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.clearFileManagers=function(){this.fileManagers=[]},e}(),ke=function(){function e(){}return e.prototype.getPath=function(e){var t=e.lastIndexOf("?");return t>0&&(e=e.slice(0,t)),(t=e.lastIndexOf("/"))<0&&(t=e.lastIndexOf("\\")),t<0?"":e.slice(0,t+1)},e.prototype.tryAppendExtension=function(e,t){return/(\.[a-z]*$)|([\?;].*)$/.test(e)?e:e+t},e.prototype.tryAppendLessExtension=function(e){return this.tryAppendExtension(e,".less")},e.prototype.supportsSync=function(){return!1},e.prototype.alwaysMakePathsAbsolute=function(){return!1},e.prototype.isPathAbsolute=function(e){return/^(?:[a-z-]+:|\/|\\|#)/i.test(e)},e.prototype.join=function(e,t){return e?e+t:t},e.prototype.pathDiff=function(e,t){var n,i,r,o,s=this.extractUrlParts(e),a=this.extractUrlParts(t),l="";if(s.hostPart!==a.hostPart)return"";for(i=Math.max(a.directories.length,s.directories.length),n=0;nparseInt(t[n])?-1:1;return 0},e.prototype.versionToString=function(e){for(var t="",n=0;n0;){var e=this.imports[0];if(!e.isReady)return;this.imports=this.imports.slice(1),e.callback.apply(null,e.args)}if(0===this.variableImports.length)break;var t=this.variableImports[0];this.variableImports=this.variableImports.slice(1),t()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},e}(),Fe=function(e,t){this._visitor=new Re(this),this._importer=e,this._finish=t,this.context=new j.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new Ve(this._onSequencerEmpty.bind(this))};Fe.prototype={isReplacing:!1,run:function(e){try{this._visitor.visit(e)}catch(e){this.error=e}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(e,t){var n=e.options.inline;if(!e.css||n){var i=new j.Eval(this.context,C(this.context.frames)),r=i.frames[0];this.importCount++,e.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,e,i,r)):this.processImportNode(e,i,r)}t.visitDeeper=!1},processImportNode:function(e,t,n){var i,r=e.options.inline;try{i=e.evalForImport(t)}catch(t){t.filename||(t.index=e.getIndex(),t.filename=e.fileInfo().filename),e.css=!0,e.error=t}if(!i||i.css&&!r)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{i.options.multiple&&(t.importMultiple=!0);for(var o=void 0===i.css,s=0;s=0||(a=[u.selfSelectors[0]],(o=f.findMatch(l,a)).length&&(l.hasFoundMatches=!0,l.selfSelectors.forEach((function(e){var t=u.visibilityInfo();s=f.extendSelector(o,a,e,l.isVisible()),(c=new Ie.Extend(u.selector,u.option,0,u.fileInfo(),t)).selfSelectors=s,s[s.length-1].extendList=[c],h.push(c),c.ruleset=u.ruleset,c.parent_ids=c.parent_ids.concat(u.parent_ids,l.parent_ids),u.firstExtendOnThisSelectorPath&&(c.firstExtendOnThisSelectorPath=!0,u.ruleset.paths.push(s))}))));if(h.length){if(this.extendChainCount++,n>100){var p="{unable to calculate}",v="{unable to calculate}";try{p=h[0].selfSelectors[0].toCSS(),v=h[0].selector.toCSS()}catch(e){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+p+":extend("+v+")"}}return h.concat(f.doExtendChaining(h,t,n+1))}return h},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitSelector=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){if(!e.root){var n,i,r,o,s=this.allExtendsStack[this.allExtendsStack.length-1],a=[],l=this;for(r=0;r0&&u[l.matched].combinator.value!==s?l=null:l.matched++,l&&(l.finished=l.matched===u.length,l.finished&&!e.allowAfter&&(r+1u&&c>0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),c=0,u++),l=o.elements.slice(c,a.index).concat([s]).concat(n.elements.slice(1)),u===a.pathIndex&&r>0?h[h.length-1].elements=h[h.length-1].elements.concat(l):(h=h.concat(t.slice(u,a.pathIndex))).push(new Ie.Selector(l)),u=a.endPathIndex,(c=a.endPathElementIndex)>=t[u].elements.length&&(c=0,u++);return u0&&(h[h.length-1].elements=h[h.length-1].elements.concat(t[u].elements.slice(c)),u++),h=(h=h.concat(t.slice(u,t.length))).map((function(e){var t=e.createDerived(e.elements);return i?t.ensureVisibility():t.ensureInvisibility(),t}))},e.prototype.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)},e.prototype.visitMediaOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e.prototype.visitAtRule=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)},e.prototype.visitAtRuleOut=function(e){var t=this.allExtendsStack.length-1;this.allExtendsStack.length=t},e}(),De=function(){function e(){this.contexts=[[]],this._visitor=new Re(this)}return e.prototype.run=function(e){return this._visitor.visit(e)},e.prototype.visitDeclaration=function(e,t){t.visitDeeper=!1},e.prototype.visitMixinDefinition=function(e,t){t.visitDeeper=!1},e.prototype.visitRuleset=function(e,t){var n,i=this.contexts[this.contexts.length-1],r=[];this.contexts.push(r),e.root||((n=e.selectors)&&(n=n.filter((function(e){return e.getIsOutput()})),e.selectors=n.length?n:n=null,n&&e.joinSelectors(r,i,n)),n||(e.rules=null),e.paths=r)},e.prototype.visitRulesetOut=function(e){this.contexts.length=this.contexts.length-1},e.prototype.visitMedia=function(e,t){var n=this.contexts[this.contexts.length-1];e.rules[0].root=0===n.length||n[0].multiMedia},e.prototype.visitAtRule=function(e,t){var n=this.contexts[this.contexts.length-1];e.rules&&e.rules.length&&(e.rules[0].root=e.isRooted||0===n.length||null)},e}(),Ne=function(){function e(e){this._visitor=new Re(this),this._context=e}return e.prototype.containsSilentNonBlockedChild=function(e){var t;if(!e)return!1;for(var n=0;n0},e.prototype.resolveVisibility=function(e,t){if(!e.blocksVisibility()){if(this.isEmpty(e)&&!this.containsSilentNonBlockedChild(t))return;return e}var n=e.rules[0];if(this.keepOnlyVisibleChilds(n),!this.isEmpty(n))return e.ensureVisibility(),e.removeVisibilityBlock(),e},e.prototype.isVisibleRuleset=function(e){return!!e.firstRoot||!this.isEmpty(e)&&!(!e.root&&!this.hasVisibleSelector(e))},e}(),Be=function(e){this._visitor=new Re(this),this._context=e,this.utils=new Ne(e)};Be.prototype={isReplacing:!0,run:function(e){return this._visitor.visit(e)},visitDeclaration:function(e,t){if(!e.blocksVisibility()&&!e.variable)return e},visitMixinDefinition:function(e,t){e.frames=[]},visitExtend:function(e,t){},visitComment:function(e,t){if(!e.blocksVisibility()&&!e.isSilent(this._context))return e},visitMedia:function(e,t){var n=e.rules[0].rules;return e.accept(this._visitor),t.visitDeeper=!1,this.utils.resolveVisibility(e,n)},visitImport:function(e,t){if(!e.blocksVisibility())return e},visitAtRule:function(e,t){return e.rules&&e.rules.length?this.visitAtRuleWithBody(e,t):this.visitAtRuleWithoutBody(e,t)},visitAnonymous:function(e,t){if(!e.blocksVisibility())return e.accept(this._visitor),e},visitAtRuleWithBody:function(e,t){var n=function(e){var t=e.rules;return function(e){var t=e.rules;return 1===t.length&&(!t[0].paths||0===t[0].paths.length)}(e)?t[0].rules:t}(e);return e.accept(this._visitor),t.visitDeeper=!1,this.utils.isEmpty(e)||this._mergeRules(e.rules[0].rules),this.utils.resolveVisibility(e,n)},visitAtRuleWithoutBody:function(e,t){if(!e.blocksVisibility()){if("@charset"===e.name){if(this.charset){if(e.debugInfo){var n=new Ie.Comment("/* "+e.toCSS(this._context).replace(/\n/g,"")+" */\n");return n.debugInfo=e.debugInfo,this._visitor.visit(n)}return}this.charset=!0}return e}},checkValidNodes:function(e,t){if(e)for(var n=0;n0?e.accept(this._visitor):e.rules=null,t.visitDeeper=!1}return e.rules&&(this._mergeRules(e.rules),this._removeDuplicateRules(e.rules)),this.utils.isVisibleRuleset(e)&&(e.ensureVisibility(),i.splice(0,0,e)),1===i.length?i[0]:i},_compileRulesetPaths:function(e){e.paths&&(e.paths=e.paths.filter((function(e){var t;for(" "===e[0].elements[0].combinator.value&&(e[0].elements[0].combinator=new Ie.Combinator("")),t=0;t=0;i--)if((n=e[i])instanceof Ie.Declaration)if(r[n.name]){(t=r[n.name])instanceof Ie.Declaration&&(t=r[n.name]=[r[n.name].toCSS(this._context)]);var o=n.toCSS(this._context);-1!==t.indexOf(o)?e.splice(i,1):t.push(o)}else r[n.name]=n}},_mergeRules:function(e){if(e){for(var t={},n=[],i=0;i0){var t=e[0],n=[],i=[new Ie.Expression(n)];e.forEach((function(e){"+"===e.merge&&n.length>0&&i.push(new Ie.Expression(n=[])),n.push(e.value),t.important=t.important||e.important})),t.value=new Ie.Value(i)}}))}}};var Ue={Visitor:Re,ImportVisitor:Fe,MarkVisibleSelectorsVisitor:Oe,ExtendVisitor:Le,JoinSelectorVisitor:De,ToCSSVisitor:Be},je=function(){var e,t,n,i,r,o,s,a=[],l={};function u(n){for(var i,a,c,h=l.i,f=t,p=l.i-s,v=l.i+o.length-p,d=l.i+=n,m=e;l.i=0){c={index:l.i,text:m.substr(l.i,y+2-l.i),isLineComment:!1},l.i+=c.text.length-1,l.commentStore.push(c);continue}}break}if(32!==i&&10!==i&&9!==i&&13!==i)break}if(o=o.slice(n+l.i-d+p),s=l.i,!o.length){if(tn||l.i===n&&e&&!i)&&(n=l.i,i=e);var r=a.pop();o=r.current,s=l.i=r.i,t=r.j},l.forget=function(){a.pop()},l.isWhitespace=function(t){var n=l.i+(t||0),i=e.charCodeAt(n);return 32===i||13===i||9===i||10===i},l.$re=function(e){l.i>s&&(o=o.slice(l.i-s),s=l.i);var t=e.exec(o);return t?(u(t[0].length),"string"==typeof t?t:1===t.length?t[0]:t):null},l.$char=function(t){return e.charAt(l.i)!==t?null:(u(1),t)},l.$str=function(t){for(var n=t.length,i=0;ih&&(d=!1)}}while(d);return r||null},l.autoCommentAbsorb=!0,l.commentStore=[],l.finished=!1,l.peek=function(t){if("string"==typeof t){for(var n=0;n57||t<43||47===t||44===t},l.start=function(i,a,c){e=i,l.i=t=s=n=0,r=a?function(e,t){var n,i,r,o,s,a,l,u,c,h=e.length,f=0,p=0,v=[],d=0;function m(t){var n=s-d;n<512&&!t||!n||(v.push(e.slice(d,s+1)),d=s+1)}for(s=0;s=97&&l<=122||l<34))switch(l){case 40:p++,i=s;continue;case 41:if(--p<0)return t("missing opening `(`",s);continue;case 59:p||m();continue;case 123:f++,n=s;continue;case 125:if(--f<0)return t("missing opening `{`",s);f||p||m();continue;case 92:if(s96)){if(u==l){c=1;break}if(92==u){if(s==h-1)return t("unescaped `\\`",s);s++}}if(c)continue;return t("unmatched `"+String.fromCharCode(l)+"`",a);case 47:if(p||s==h-1)continue;if(47==(u=e.charCodeAt(s+1)))for(s+=2;sn&&o>r?"missing closing `}` or `*/`":"missing closing `}`",n):0!==p?t("missing closing `)`",i):(m(!0),v)}(i,c):[i],o=r[0],u(0)},l.end=function(){var t,r=l.i>=e.length;return l.i=e.length-1,furthestChar:e[l.i]}},l},qe=function e(t,n,i){var r,o=je();function s(e,t){throw new R({index:o.i,filename:i.filename,type:t||"Syntax",message:e},n)}function a(e,t){var n=e instanceof Function?e.call(r):o.$re(e);if(n)return n;s(t||("string"==typeof e?"expected '"+e+"' got '"+o.currentChar()+"'":"unexpected token"))}function l(e,t){if(o.$char(e))return e;s(t||"expected '"+e+"' got '"+o.currentChar()+"'")}function u(e){var t=i.filename;return{lineNumber:I(e,o.getInput()).line+1,fileName:t}}return{parserInput:o,imports:n,fileInfo:i,parseNode:function(e,t,i,s,a){var l,u=[],c=o;try{c.start(e,!1,(function(e,t){a({message:e,index:t+i})}));for(var h,f=0,p=void 0;p=t[f];f++)if(h=c.i,l=r[p]()){try{l._index=h+i,l._fileInfo=s}catch(e){}u.push(l)}else u.push(null);c.end().isFinished?a(null,u):a(!0,null)}catch(e){throw new R({index:e.index+i,message:e.message},n,s.filename)}},parse:function(r,s,a){var l,u,c,h,f=null,p="";if(u=a&&a.globalVars?e.serializeVars(a.globalVars)+"\n":"",c=a&&a.modifyVars?"\n"+e.serializeVars(a.modifyVars):"",t.pluginManager)for(var v=t.pluginManager.getPreProcessors(),d=0;d");return e},args:function(e){var t,n,i,a,l,u,c,h=r.entities,f={args:null,variadic:!1},p=[],v=[],d=[],m=!0;for(o.save();;){if(e)u=r.detachedRuleset()||r.expression();else{if(o.commentStore.length=0,o.$str("...")){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({variadic:!0});break}u=h.variable()||h.property()||h.literal()||h.keyword()||this.call(!0)}if(!u||!m)break;a=null,u.throwAwayComments&&u.throwAwayComments(),l=u;var g=null;if(e?u.value&&1==u.value.length&&(g=u.value[0]):g=u,g&&(g instanceof Ie.Variable||g instanceof Ie.Property))if(o.$char(":")){if(p.length>0&&(t&&s("Cannot mix ; and , as delimiter types"),n=!0),!(l=r.detachedRuleset()||r.expression())){if(!e)return o.restore(),f.args=[],f;s("could not understand value for named argument")}a=i=g.name}else if(o.$str("...")){if(!e){f.variadic=!0,o.$char(";")&&!t&&(t=!0),(t?v:d).push({name:u.name,variadic:!0});break}c=!0}else e||(i=a=g.name,l=null);l&&p.push(l),d.push({name:a,value:l,expand:c}),o.$char(",")?m=!0:((m=";"===o.$char(";"))||t)&&(n&&s("Cannot mix ; and , as delimiter types"),t=!0,p.length>1&&(l=new Ie.Value(p)),v.push({name:i,value:l,expand:c}),i=null,p=[],n=!1)}return o.forget(),f.args=t?v:d,f},definition:function(){var e,t,n,i,s=[],l=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),t=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=t[1];var u=this.args(!1);if(s=u.args,l=u.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(i=a(r.conditions,"expected condition")),n=r.block())return o.forget(),new Ie.mixin.Definition(e,s,n,i,l);o.restore()}else o.restore()},ruleLookups:function(){var e,t=[];if("["===o.currentChar()){for(;;){if(o.save(),!(e=this.lookupValue())&&""!==e){o.restore();break}t.push(e),o.forget()}return t.length>0?t:void 0}},lookupValue:function(){if(o.save(),o.$char("[")){var e=o.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);if(o.$char("]"))return e||""===e?(o.forget(),e):void o.restore();o.restore()}else o.restore()}},entity:function(){var e=this.entities;return this.comment()||e.literal()||e.variable()||e.url()||e.property()||e.call()||e.keyword()||this.mixin.call(!0)||e.javascript()},end:function(){return o.$char(";")||o.peek("}")},ieAlpha:function(){var e;if(o.$re(/^opacity=/i))return(e=o.$re(/^\d+/))||(e="@{"+(e=a(r.entities.variable,"Could not parse alpha")).name.slice(1)+"}"),l(")"),new Ie.Quoted("","alpha(opacity="+e+")")},element:function(){var e,t,n,r=o.i;if(t=this.combinator(),(e=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[\.#:](?=@)/)||this.entities.variableCurly())||(o.save(),o.$char("(")?(n=this.selector(!1))&&o.$char(")")?(e=new Ie.Paren(n),o.forget()):o.restore("Missing closing ')'"):o.forget()),e)return new Ie.Element(t,e,e instanceof Ie.Variable,r,i)},combinator:function(){var e=o.currentChar();if("/"===e){o.save();var t=o.$re(/^\/[a-z]+\//i);if(t)return o.forget(),new Ie.Combinator(t);o.restore()}if(">"===e||"+"===e||"~"===e||"|"===e||"^"===e){for(o.i++,"^"===e&&"^"===o.currentChar()&&(e="^^",o.i++);o.isWhitespace();)o.i++;return new Ie.Combinator(e)}return o.isWhitespace(-1)?new Ie.Combinator(" "):new Ie.Combinator(null)},selector:function(e){var t,n,r,l,u,c,h,f=o.i;for(e=!1!==e;(e&&(n=this.extend())||e&&(c=o.$str("when"))||(l=this.element()))&&(c?h=a(this.conditions,"expected condition"):h?s("CSS guard can only be used at the end of selector"):n?u=u?u.concat(n):n:(u&&s("Extend can only be used at the end of selector"),r=o.currentChar(),t?t.push(l):t=[l],l=null),"{"!==r&&"}"!==r&&";"!==r&&","!==r&&")"!==r););if(t)return new Ie.Selector(t,u,h,f,i);u&&s("Extend must be used to extend a selector, it cannot be used on its own")},selectors:function(){for(var e,t;(e=this.selector())&&(t?t.push(e):t=[e],o.commentStore.length=0,e.condition&&t.length>1&&s("Guards are only currently allowed on a single selector."),o.$char(","));)e.condition&&s("Guards are only currently allowed on a single selector."),o.commentStore.length=0;return t},attribute:function(){if(o.$char("[")){var e,t,n,i=this.entities;return(e=i.variableCurly())||(e=a(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),(n=o.$re(/^[|~*$^]?=/))&&(t=i.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||i.variableCurly()),l("]"),new Ie.Attribute(e,n,t)}},block:function(){var e;if(o.$char("{")&&(e=this.primary())&&o.$char("}"))return e},blockRuleset:function(){var e=this.block();return e&&(e=new Ie.Ruleset(null,e)),e},detachedRuleset:function(){var e,t,n;if(o.save(),!o.$re(/^[.#]\(/)||(t=(e=this.mixin.args(!1)).args,n=e.variadic,o.$char(")"))){var i=this.blockRuleset();if(i)return o.forget(),t?new Ie.mixin.Definition(null,t,i,null,n):new Ie.DetachedRuleset(i);o.restore()}else o.restore()},ruleset:function(){var e,n,i;if(o.save(),t.dumpLineNumbers&&(i=u(o.i)),(e=this.selectors())&&(n=this.block())){o.forget();var r=new Ie.Ruleset(e,n,t.strictImports);return t.dumpLineNumbers&&(r.debugInfo=i),r}o.restore()},declaration:function(){var e,t,n,r,s,a,l=o.i,u=o.currentChar();if("."!==u&&"#"!==u&&"&"!==u&&":"!==u)if(o.save(),e=this.variable()||this.ruleProperty()){if((a="string"==typeof e)&&(t=this.detachedRuleset())&&(n=!0),o.commentStore.length=0,!t){if(s=!a&&e.length>1&&e.pop().value,t=e[0].value&&"--"===e[0].value.slice(0,2)?this.permissiveValue():this.anonymousValue())return o.forget(),new Ie.Declaration(e,t,!1,s,l,i);t||(t=this.value()),t?r=this.important():a&&(t=this.permissiveValue())}if(t&&(this.end()||n))return o.forget(),new Ie.Declaration(e,t,r,s,l,i);o.restore()}else o.restore()},anonymousValue:function(){var e=o.i,t=o.$re(/^([^.#@\$+\/'"*`(;{}-]*);/);if(t)return new Ie.Anonymous(t[1],e)},permissiveValue:function(e){var t,n,r,a,l=e||";",u=o.i,c=[];function h(){var e=o.currentChar();return"string"==typeof l?e===l:l.test(e)}if(!h()){a=[];do{((n=this.comment())||(n=this.entity()))&&a.push(n)}while(n);if(r=h(),a.length>0){if(a=new Ie.Expression(a),r)return a;c.push(a)," "===o.prevChar()&&c.push(new Ie.Anonymous(" ",u))}if(o.save(),a=o.$parseUntil(l)){if("string"==typeof a&&s("Expected '"+a+"'","Parse"),1===a.length&&" "===a[0])return o.forget(),new Ie.Anonymous("",u);var f=void 0;for(t=0;t0)return new Ie.Expression(r)},mediaFeatures:function(){var e,t=this.entities,n=[];do{if(e=this.mediaFeature()){if(n.push(e),!o.$char(","))break}else if((e=t.variable()||t.mixinLookup())&&(n.push(e),!o.$char(",")))break}while(e);return n.length>0?n:null},media:function(){var e,n,r,a,l=o.i;if(t.dumpLineNumbers&&(a=u(l)),o.save(),o.$str("@media"))return e=this.mediaFeatures(),(n=this.block())||s("media definitions require block statements after any features"),o.forget(),r=new Ie.Media(n,e,l,i),t.dumpLineNumbers&&(r.debugInfo=a),r;o.restore()},plugin:function(){var e,t,n,r=o.i;if(o.$re(/^@plugin?\s+/)){if(n=(t=this.pluginArgs())?{pluginArgs:t,isPlugin:!0}:{isPlugin:!0},e=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=r,s("missing semi-colon on @plugin")),new Ie.Import(e,null,n,r,i);o.i=r,s("malformed @plugin statement")}},pluginArgs:function(){if(o.save(),!o.$char("("))return o.restore(),null;var e=o.$re(/^\s*([^\);]+)\)\s*/);return e[1]?(o.forget(),e[1].trim()):(o.restore(),null)},atrule:function(){var e,n,r,a,l,c,h,f=o.i,p=!0,v=!0;if("@"===o.currentChar()){if(n=this.import()||this.plugin()||this.media())return n;if(o.save(),e=o.$re(/^@[a-z-]+/)){switch(a=e,"-"==e.charAt(1)&&e.indexOf("-",2)>0&&(a="@"+e.slice(e.indexOf("-",2)+1)),a){case"@charset":l=!0,p=!1;break;case"@namespace":c=!0,p=!1;break;case"@keyframes":case"@counter-style":l=!0;break;case"@document":case"@supports":h=!0,v=!1;break;default:h=!0}if(o.commentStore.length=0,l?(n=this.entity())||s("expected "+e+" identifier"):c?(n=this.expression())||s("expected "+e+" expression"):h&&(n=this.permissiveValue(/^[{;]/),p="{"===o.currentChar(),n?n.value||(n=null):p||";"===o.currentChar()||s(e+" rule is missing block or ending semi-colon")),p&&(r=this.blockRuleset()),r||!p&&n&&o.$char(";"))return o.forget(),new Ie.AtRule(e,n,r,f,i,t.dumpLineNumbers?u(f):null,v);o.restore("at-rule options not recognised")}}},value:function(){var e,t=[],n=o.i;do{if((e=this.expression())&&(t.push(e),!o.$char(",")))break}while(e);if(t.length>0)return new Ie.Value(t,n)},important:function(){if("!"===o.currentChar())return o.$re(/^! *important/)},sub:function(){var e,t;if(o.save(),o.$char("("))return(e=this.addition())&&o.$char(")")?(o.forget(),(t=new Ie.Expression([e])).parens=!0,t):void o.restore("Expected ')'");o.restore()},multiplication:function(){var e,t,n,i,r;if(e=this.operand()){for(r=o.isWhitespace(-1);!o.peek(/^\/[*\/]/);){if(o.save(),!(n=o.$char("/")||o.$char("*")||o.$str("./"))){o.forget();break}if(!(t=this.operand())){o.restore();break}o.forget(),e.parensInOp=!0,t.parensInOp=!0,i=new Ie.Operation(n,[i||e,t],r),r=o.isWhitespace(-1)}return i||e}},addition:function(){var e,t,n,i,r;if(e=this.multiplication()){for(r=o.isWhitespace(-1);(n=o.$re(/^[-+]\s+/)||!r&&(o.$char("+")||o.$char("-")))&&(t=this.multiplication());)e.parensInOp=!0,t.parensInOp=!0,i=new Ie.Operation(n,[i||e,t],r),r=o.isWhitespace(-1);return i||e}},conditions:function(){var e,t,n,i=o.i;if(e=this.condition(!0)){for(;o.peek(/^,\s*(not\s*)?\(/)&&o.$char(",")&&(t=this.condition(!0));)n=new Ie.Condition("or",n||e,t,i);return n||e}},condition:function(e){var t,n,i;if(t=this.conditionAnd(e)){if(n=o.$str("or")){if(!(i=this.condition(e)))return;t=new Ie.Condition(n,t,i)}return t}},conditionAnd:function(e){var t,n,i,r,s=this;if(t=(r=s.negatedCondition(e)||s.parenthesisCondition(e))||e?r:s.atomicCondition(e)){if(n=o.$str("and")){if(!(i=this.conditionAnd(e)))return;t=new Ie.Condition(n,t,i)}return t}},negatedCondition:function(e){if(o.$str("not")){var t=this.parenthesisCondition(e);return t&&(t.negate=!t.negate),t}},parenthesisCondition:function(e){var t;if(o.save(),o.$str("(")){if(t=function(t){var n;if(o.save(),n=t.condition(e)){if(o.$char(")"))return o.forget(),n;o.restore()}else o.restore()}(this))return o.forget(),t;if(t=this.atomicCondition(e)){if(o.$char(")"))return o.forget(),t;o.restore("expected ')' got '"+o.currentChar()+"'")}else o.restore()}else o.restore()},atomicCondition:function(e){var t,n,i,r,a=this.entities,l=o.i;function u(){return this.addition()||a.keyword()||a.quoted()||a.mixinLookup()}if(t=(u=u.bind(this))())return o.$char(">")?r=o.$char("=")?">=":">":o.$char("<")?r=o.$char("=")?"<=":"<":o.$char("=")&&(r=o.$char(">")?"=>":o.$char("<")?"=<":"="),r?(n=u())?i=new Ie.Condition(r,t,n,l,!1):s("expected expression"):i=new Ie.Condition("=",t,new Ie.Keyword("true"),l,!1),i},operand:function(){var e,t=this.entities;o.peek(/^-[@\$\(]/)&&(e=o.$char("-"));var n=this.sub()||t.dimension()||t.color()||t.variable()||t.property()||t.call()||t.quoted(!0)||t.colorKeyword()||t.mixinLookup();return e&&(n.parensInOp=!0,n=new Ie.Negative(n)),n},expression:function(){var e,t,n=[],i=o.i;do{(e=this.comment())?n.push(e):((e=this.addition()||this.entity())instanceof Ie.Comment&&(e=null),e&&(n.push(e),o.peek(/^\/[\/*]/)||(t=o.$char("/"))&&n.push(new Ie.Anonymous(t,i))))}while(e);if(n.length>0)return new Ie.Expression(n)},property:function(){var e=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);if(e)return e[1]},ruleProperty:function(){var e,t,n=[],r=[];o.save();var s=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(s)return n=[new Ie.Keyword(s[1])],o.forget(),n;function a(e){var t=o.i,i=o.$re(e);if(i)return r.push(t),n.push(i[1])}for(a(/^(\*?)/);a(/^((?:[\w-]+)|(?:[@\$]\{[\w-]+\}))/););if(n.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===n[0]&&(n.shift(),r.shift()),t=0;t1?e-1:e)<1?r+(o-r)*e*6:2*e<1?o:3*e<2?r+(o-r)*(2/3-e)*6:r}e=Qe(e)%360/360,t=Ge(Qe(t)),n=Ge(Qe(n)),i=Ge(Qe(i)),r=2*n-(o=n<=.5?n*(t+1):n+t-n*t);var a=[255*s(e+1/3),255*s(e),255*s(e-1/3)];return i=Qe(i),new h(a,i,"hsla")}catch(e){}},hsv:function(e,t,n){return Te.hsva(e,t,n,1)},hsva:function(e,t,n,i){var r,o;e=Qe(e)%360/360*360,t=Qe(t),n=Qe(n),i=Qe(i);var s=[n,n*(1-t),n*(1-(o=e/60-(r=Math.floor(e/60%6)))*t),n*(1-(1-o)*t)],a=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return Te.rgba(255*s[a[r][0]],255*s[a[r][1]],255*s[a[r][2]],i)},hue:function(e){return new X(Je(e).h)},saturation:function(e){return new X(100*Je(e).s,"%")},lightness:function(e){return new X(100*Je(e).l,"%")},hsvhue:function(e){return new X(He(e).h)},hsvsaturation:function(e){return new X(100*He(e).s,"%")},hsvvalue:function(e){return new X(100*He(e).v,"%")},red:function(e){return new X(e.rgb[0])},green:function(e){return new X(e.rgb[1])},blue:function(e){return new X(e.rgb[2])},alpha:function(e){return new X(Je(e).a)},luma:function(e){return new X(e.luma()*e.alpha*100,"%")},luminance:function(e){var t=.2126*e.rgb[0]/255+.7152*e.rgb[1]/255+.0722*e.rgb[2]/255;return new X(t*e.alpha*100,"%")},saturate:function(e,t,n){if(!e.rgb)return null;var i=Je(e);return void 0!==n&&"relative"===n.value?i.s+=i.s*t.value/100:i.s+=t.value/100,i.s=Ge(i.s),We(e,i)},desaturate:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.s-=i.s*t.value/100:i.s-=t.value/100,i.s=Ge(i.s),We(e,i)},lighten:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.l+=i.l*t.value/100:i.l+=t.value/100,i.l=Ge(i.l),We(e,i)},darken:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.l-=i.l*t.value/100:i.l-=t.value/100,i.l=Ge(i.l),We(e,i)},fadein:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.a+=i.a*t.value/100:i.a+=t.value/100,i.a=Ge(i.a),We(e,i)},fadeout:function(e,t,n){var i=Je(e);return void 0!==n&&"relative"===n.value?i.a-=i.a*t.value/100:i.a-=t.value/100,i.a=Ge(i.a),We(e,i)},fade:function(e,t){var n=Je(e);return n.a=t.value/100,n.a=Ge(n.a),We(e,n)},spin:function(e,t){var n=Je(e),i=(n.h+t.value)%360;return n.h=i<0?360+i:i,We(e,n)},mix:function(e,t,n){n||(n=new X(50));var i=n.value/100,r=2*i-1,o=Je(e).a-Je(t).a,s=((r*o==-1?r:(r+o)/(1+r*o))+1)/2,a=1-s,l=[e.rgb[0]*s+t.rgb[0]*a,e.rgb[1]*s+t.rgb[1]*a,e.rgb[2]*s+t.rgb[2]*a],u=e.alpha*i+t.alpha*(1-i);return new h(l,u)},greyscale:function(e){return Te.desaturate(e,new X(100))},contrast:function(e,t,n,i){if(!e.rgb)return null;if(void 0===n&&(n=Te.rgba(255,255,255,1)),void 0===t&&(t=Te.rgba(0,0,0,1)),t.luma()>n.luma()){var r=n;n=t,t=r}return i=void 0===i?.43:Qe(i),e.luma().5&&(i=1,n=e>.25?Math.sqrt(e):((16*e-12)*e+4)*e),e-(1-2*t)*i*(n-e)},hardlight:function(e,t){return Ye.overlay(t,e)},difference:function(e,t){return Math.abs(e-t)},exclusion:function(e,t){return e+t-2*e*t},average:function(e,t){return(e+t)/2},negation:function(e,t){return 1-Math.abs(e+t-1)}};for(var Xe in Ye)Ye.hasOwnProperty(Xe)&&(Ze[Xe]=Ze.bind(null,Ye[Xe]));var et=function(e){return Array.isArray(e.value)?e.value:Array(e)},tt={_SELF:function(e){return e},extract:function(e,t){return t=t.value-1,et(e)[t]},length:function(e){return new X(et(e).length)},range:function(e,t,n){var i,r,o=1,s=[];t?(r=t,i=e.value,n&&(o=n.value)):(i=1,r=e);for(var a=i;a<=r.value;a+=o)s.push(new X(a,r.unit));return new ie(s)},each:function(e,t){var n,i,r=[];i=!e.value||e instanceof ue?e.ruleset?e.ruleset.rules:e.rules?e.rules:Array.isArray(e)?e:[e]:Array.isArray(e.value)?e.value:[e.value];var o="@value",s="@key",a="@index";t.params?(o=t.params[0]&&t.params[0].name,s=t.params[1]&&t.params[1].name,a=t.params[2]&&t.params[2].name,t=t.rules):t=t.ruleset;for(var l=0;ls.value)&&(c[i]=r);else{if(void 0!==l&&a!==l)throw{type:"Argument",message:"incompatible types"};h[a]=c.length,c.push(r)}else Array.isArray(t[n].value)&&Array.prototype.push.apply(t,Array.prototype.slice.call(t[n].value));return 1==c.length?c[0]:(t=c.map((function(e){return e.toCSS(this.context)})).join(this.context.compress?",":", "),new L((e?"min":"max")+"("+t+")"))},at={min:function(){for(var e=[],t=0;t",r=0;r";return i+="',i=encodeURIComponent(i),new ce(new ue("'"+(i="data:image/svg+xml,"+i)+"'",i,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)}}),J.addMultiple(ht),t},pt=function(e,t){var n;void 0===t&&(t={});var i=t.variables,r=new j.Eval(t);"object"!=typeof i||Array.isArray(i)||(i=Object.keys(i).map((function(e){var t=i[e];return t instanceof Ie.Value||(t instanceof Ie.Expression||(t=new Ie.Expression([t])),t=new Ie.Value([t])),new Ie.Declaration("@"+e,t,!1,null,0)})),r.frames=[new Ie.Ruleset(null,i)]);var o,s,a=[new Ue.JoinSelectorVisitor,new Ue.MarkVisibleSelectorsVisitor(!0),new Ue.ExtendVisitor,new Ue.ToCSSVisitor({compress:Boolean(t.compress)})],l=[];if(t.pluginManager){s=t.pluginManager.visitor();for(var u=0;u<2;u++)for(s.first();o=s.get();)o.isPreEvalVisitor?0!==u&&-1!==l.indexOf(o)||(l.push(o),o.run(e)):0!==u&&-1!==a.indexOf(o)||(o.isPreVisitor?a.unshift(o):a.push(o))}n=e.eval(r);for(u=0;u=t);n++);this.preProcessors.splice(n,0,{preProcessor:e,priority:t})},e.prototype.addPostProcessor=function(e,t){var n;for(n=0;n=t);n++);this.postProcessors.splice(n,0,{postProcessor:e,priority:t})},e.prototype.addFileManager=function(e){this.fileManagers.push(e)},e.prototype.getPreProcessors=function(){for(var e=[],t=0;t0){var i=void 0,r=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?i=this.sourceMapURL:this._sourceMapFilename&&(i=this._sourceMapFilename),this.sourceMapURL=i,this.sourceMap=r}return this._css.join("")},t}()}(e=new _e(e,t)),r=function(e,t){return function(){function n(e){this.options=e}return n.prototype.toCSS=function(t,n,i){var r=new e({contentsIgnoredCharsMap:i.contentsIgnoredChars,rootNode:t,contentsMap:i.contents,sourceMapFilename:this.options.sourceMapFilename,sourceMapURL:this.options.sourceMapURL,outputFilename:this.options.sourceMapOutputFilename,sourceMapBasepath:this.options.sourceMapBasepath,sourceMapRootpath:this.options.sourceMapRootpath,outputSourceFiles:this.options.outputSourceFiles,sourceMapGenerator:this.options.sourceMapGenerator,sourceMapFileInline:this.options.sourceMapFileInline}),o=r.toCSS(n);return this.sourceMap=r.sourceMap,this.sourceMapURL=r.sourceMapURL,this.options.sourceMapInputFilename&&(this.sourceMapInputFilename=r.normalizeFilename(this.options.sourceMapInputFilename)),void 0!==this.options.sourceMapBasepath&&void 0!==this.sourceMapURL&&(this.sourceMapURL=r.removeBasepath(this.sourceMapURL)),o+this.getCSSAppendage()},n.prototype.getCSSAppendage=function(){var e=this.sourceMapURL;if(this.options.sourceMapFileInline){if(void 0===this.sourceMap)return"";e="data:application/json;base64,"+t.encodeBase64(this.sourceMap)}return e?"/*# sourceMappingURL="+e+" */":""},n.prototype.getExternalSourceMap=function(){return this.sourceMap},n.prototype.setExternalSourceMap=function(e){this.sourceMap=e},n.prototype.isInline=function(){return this.options.sourceMapFileInline},n.prototype.getSourceMapURL=function(){return this.sourceMapURL},n.prototype.getOutputFilename=function(){return this.options.sourceMapOutputFilename},n.prototype.getInputFilename=function(){return this.sourceMapInputFilename},n}()}(i,e),o=function(e){return function(){function t(e,t){this.root=e,this.imports=t}return t.prototype.toCSS=function(t){var n,i,r={};try{n=pt(this.root,t)}catch(e){throw new R(e,this.imports)}try{var o=Boolean(t.compress);o&&Ce.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");var s={compress:o,dumpLineNumbers:t.dumpLineNumbers,strictUnits:Boolean(t.strictUnits),numPrecision:8};t.sourceMap?(i=new e(t.sourceMap),r.css=i.toCSS(n,s,this.imports)):r.css=n.toCSS(s)}catch(e){throw new R(e,this.imports)}if(t.pluginManager)for(var a=t.pluginManager.getPostProcessors(),l=0;l=200&&t.status<300?n(t.responseText,t.getResponseHeader("Last-Modified")):"function"==typeof i&&i(t.status,e)}"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/css"),gt.debug("XHR: Getting '"+e+"'"),r.open("GET",e,o),r.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),r.send(null),mt.isFileProtocol&&!mt.fileAsync?0===r.status||r.status>=200&&r.status<300?n(r.responseText):i(r.status,e):o?r.onreadystatechange=function(){4==r.readyState&&s(r,n,i)}:s(r,n,i)},t.prototype.supports=function(){return!0},t.prototype.clearFileCache=function(){bt={}},t.prototype.loadFile=function(e,t,n,i){t&&!this.isPathAbsolute(e)&&(e=t+e),e=n.ext?this.tryAppendExtension(e,n.ext):e,n=n||{};var r=this.extractUrlParts(e,window.location.href).url,o=this;return new Promise((function(e,t){if(n.useFileCache&&bt[r])try{var i=bt[r];return e({contents:i,filename:r,webInfo:{lastModified:new Date}})}catch(e){return t({filename:r,message:"Error loading file "+r+" error was "+e.message})}o.doXHR(r,n.mime,(function(t,n){bt[r]=t,e({contents:t,filename:r,webInfo:{lastModified:n}})}),(function(e,n){t({type:"File",message:"'"+n+"' wasn't found ("+e+")",href:r})}))}))},t}(ke),xt=function(e,t){return mt=e,gt=t,wt},St=function(e){function t(t){var n=e.call(this)||this;return n.less=t,n}return o(t,e),t.prototype.loadPlugin=function(e,t,n,i,r){return new Promise((function(o,s){r.loadFile(e,t,n,i).then(o).catch(s)}))},t}(Ae),It=function(t,i,r){return{add:function(o,s){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting?function(e,t){var n=e.filename||t,o=[],s=(e.type||"Syntax")+"Error: "+(e.message||"There is an error in your .less file")+" in "+n,a=function(e,t,n){void 0!==e.extract[t]&&o.push("{line} {content}".replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};e.line&&(a(e,0,""),a(e,1,"line"),a(e,2,""),s+=" on line "+e.line+", column "+(e.column+1)+":\n"+o.join("\n")),e.stack&&(e.extract||r.logLevel>=4)&&(s+="\nStack Trace\n"+e.stack),i.logger.error(s)}(o,s):"function"==typeof r.errorReporting&&r.errorReporting("add",o,s):function(i,o){var s,a,l="less-error-message:"+e(o||""),u=t.document.createElement("div"),c=[],h=i.filename||o,f=h.match(/([^\/]+(\?.*)?)$/)[1];u.id=l,u.className="less-error-message",a="

    "+(i.type||"Syntax")+"Error: "+(i.message||"There is an error in your .less file")+'

    in '+f+" ";var p=function(e,t,n){void 0!==e.extract[t]&&c.push('

  • {content}
  • '.replace(/\{line\}/,(parseInt(e.line,10)||0)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};i.line&&(p(i,0,""),p(i,1,"line"),p(i,2,""),a+="on line "+i.line+", column "+(i.column+1)+":

      "+c.join("")+"
    "),i.stack&&(i.extract||r.logLevel>=4)&&(a+="
    Stack Trace
    "+i.stack.split("\n").slice(1).join("
    ")),u.innerHTML=a,n(t.document,[".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"}),u.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(";"),"development"===r.env&&(s=setInterval((function(){var e=t.document,n=e.body;n&&(e.getElementById(l)?n.replaceChild(u,e.getElementById(l)):n.insertBefore(u,n.firstChild),clearInterval(s))}),10))}(o,s)},remove:function(n){r.errorReporting&&"html"!==r.errorReporting?"console"===r.errorReporting||"function"==typeof r.errorReporting&&r.errorReporting("remove",n):function(n){var i=t.document.getElementById("less-error-message:"+e(n));i&&i.parentNode.removeChild(i)}(n)}}},Ct={javascriptEnabled:!1,depends:!1,compress:!1,lint:!1,paths:[],color:!0,strictImports:!1,insecure:!1,rootpath:"",rewriteUrls:!1,math:0,strictUnits:!1,globalVars:null,modifyVars:null,urlArgs:""};if(window.less)for(var _t in window.less)window.less.hasOwnProperty(_t)&&(Ct[_t]=window.less[_t]);!function(e,n){t(n,i(e)),void 0===n.isFileProtocol&&(n.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(e.location.protocol)),n.async=n.async||!1,n.fileAsync=n.fileAsync||!1,n.poll=n.poll||(n.isFileProtocol?1e3:1500),n.env=n.env||("127.0.0.1"==e.location.hostname||"0.0.0.0"==e.location.hostname||"localhost"==e.location.hostname||e.location.port&&e.location.port.length>0||n.isFileProtocol?"development":"production");var r=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(e.location.hash);r&&(n.dumpLineNumbers=r[1]),void 0===n.useFileCache&&(n.useFileCache=!0),void 0===n.onReady&&(n.onReady=!0),n.relativeUrls&&(n.rewriteUrls="all")}(window,Ct),Ct.plugins=Ct.plugins||[],window.LESS_PLUGINS&&(Ct.plugins=Ct.plugins.concat(window.LESS_PLUGINS));var kt,At,Mt,Pt=function(e,i){var r=e.document,o=yt();o.options=i;var s=o.environment,a=xt(i,o.logger),l=new a;s.addFileManager(l),o.FileManager=a,o.PluginLoader=St,function(e,t){t.logLevel=void 0!==t.logLevel?t.logLevel:"development"===t.env?3:1,t.loggers||(t.loggers=[{debug:function(e){t.logLevel>=4&&console.log(e)},info:function(e){t.logLevel>=3&&console.log(e)},warn:function(e){t.logLevel>=2&&console.warn(e)},error:function(e){t.logLevel>=1&&console.error(e)}}]);for(var n=0;n 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n","export default {\n 'aliceblue':'#f0f8ff',\n 'antiquewhite':'#faebd7',\n 'aqua':'#00ffff',\n 'aquamarine':'#7fffd4',\n 'azure':'#f0ffff',\n 'beige':'#f5f5dc',\n 'bisque':'#ffe4c4',\n 'black':'#000000',\n 'blanchedalmond':'#ffebcd',\n 'blue':'#0000ff',\n 'blueviolet':'#8a2be2',\n 'brown':'#a52a2a',\n 'burlywood':'#deb887',\n 'cadetblue':'#5f9ea0',\n 'chartreuse':'#7fff00',\n 'chocolate':'#d2691e',\n 'coral':'#ff7f50',\n 'cornflowerblue':'#6495ed',\n 'cornsilk':'#fff8dc',\n 'crimson':'#dc143c',\n 'cyan':'#00ffff',\n 'darkblue':'#00008b',\n 'darkcyan':'#008b8b',\n 'darkgoldenrod':'#b8860b',\n 'darkgray':'#a9a9a9',\n 'darkgrey':'#a9a9a9',\n 'darkgreen':'#006400',\n 'darkkhaki':'#bdb76b',\n 'darkmagenta':'#8b008b',\n 'darkolivegreen':'#556b2f',\n 'darkorange':'#ff8c00',\n 'darkorchid':'#9932cc',\n 'darkred':'#8b0000',\n 'darksalmon':'#e9967a',\n 'darkseagreen':'#8fbc8f',\n 'darkslateblue':'#483d8b',\n 'darkslategray':'#2f4f4f',\n 'darkslategrey':'#2f4f4f',\n 'darkturquoise':'#00ced1',\n 'darkviolet':'#9400d3',\n 'deeppink':'#ff1493',\n 'deepskyblue':'#00bfff',\n 'dimgray':'#696969',\n 'dimgrey':'#696969',\n 'dodgerblue':'#1e90ff',\n 'firebrick':'#b22222',\n 'floralwhite':'#fffaf0',\n 'forestgreen':'#228b22',\n 'fuchsia':'#ff00ff',\n 'gainsboro':'#dcdcdc',\n 'ghostwhite':'#f8f8ff',\n 'gold':'#ffd700',\n 'goldenrod':'#daa520',\n 'gray':'#808080',\n 'grey':'#808080',\n 'green':'#008000',\n 'greenyellow':'#adff2f',\n 'honeydew':'#f0fff0',\n 'hotpink':'#ff69b4',\n 'indianred':'#cd5c5c',\n 'indigo':'#4b0082',\n 'ivory':'#fffff0',\n 'khaki':'#f0e68c',\n 'lavender':'#e6e6fa',\n 'lavenderblush':'#fff0f5',\n 'lawngreen':'#7cfc00',\n 'lemonchiffon':'#fffacd',\n 'lightblue':'#add8e6',\n 'lightcoral':'#f08080',\n 'lightcyan':'#e0ffff',\n 'lightgoldenrodyellow':'#fafad2',\n 'lightgray':'#d3d3d3',\n 'lightgrey':'#d3d3d3',\n 'lightgreen':'#90ee90',\n 'lightpink':'#ffb6c1',\n 'lightsalmon':'#ffa07a',\n 'lightseagreen':'#20b2aa',\n 'lightskyblue':'#87cefa',\n 'lightslategray':'#778899',\n 'lightslategrey':'#778899',\n 'lightsteelblue':'#b0c4de',\n 'lightyellow':'#ffffe0',\n 'lime':'#00ff00',\n 'limegreen':'#32cd32',\n 'linen':'#faf0e6',\n 'magenta':'#ff00ff',\n 'maroon':'#800000',\n 'mediumaquamarine':'#66cdaa',\n 'mediumblue':'#0000cd',\n 'mediumorchid':'#ba55d3',\n 'mediumpurple':'#9370d8',\n 'mediumseagreen':'#3cb371',\n 'mediumslateblue':'#7b68ee',\n 'mediumspringgreen':'#00fa9a',\n 'mediumturquoise':'#48d1cc',\n 'mediumvioletred':'#c71585',\n 'midnightblue':'#191970',\n 'mintcream':'#f5fffa',\n 'mistyrose':'#ffe4e1',\n 'moccasin':'#ffe4b5',\n 'navajowhite':'#ffdead',\n 'navy':'#000080',\n 'oldlace':'#fdf5e6',\n 'olive':'#808000',\n 'olivedrab':'#6b8e23',\n 'orange':'#ffa500',\n 'orangered':'#ff4500',\n 'orchid':'#da70d6',\n 'palegoldenrod':'#eee8aa',\n 'palegreen':'#98fb98',\n 'paleturquoise':'#afeeee',\n 'palevioletred':'#d87093',\n 'papayawhip':'#ffefd5',\n 'peachpuff':'#ffdab9',\n 'peru':'#cd853f',\n 'pink':'#ffc0cb',\n 'plum':'#dda0dd',\n 'powderblue':'#b0e0e6',\n 'purple':'#800080',\n 'rebeccapurple':'#663399',\n 'red':'#ff0000',\n 'rosybrown':'#bc8f8f',\n 'royalblue':'#4169e1',\n 'saddlebrown':'#8b4513',\n 'salmon':'#fa8072',\n 'sandybrown':'#f4a460',\n 'seagreen':'#2e8b57',\n 'seashell':'#fff5ee',\n 'sienna':'#a0522d',\n 'silver':'#c0c0c0',\n 'skyblue':'#87ceeb',\n 'slateblue':'#6a5acd',\n 'slategray':'#708090',\n 'slategrey':'#708090',\n 'snow':'#fffafa',\n 'springgreen':'#00ff7f',\n 'steelblue':'#4682b4',\n 'tan':'#d2b48c',\n 'teal':'#008080',\n 'thistle':'#d8bfd8',\n 'tomato':'#ff6347',\n 'turquoise':'#40e0d0',\n 'violet':'#ee82ee',\n 'wheat':'#f5deb3',\n 'white':'#ffffff',\n 'whitesmoke':'#f5f5f5',\n 'yellow':'#ffff00',\n 'yellowgreen':'#9acd32'\n};","export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};","import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n","class Node {\n constructor() {\n this.parent = null;\n this.visibilityBlocks = undefined;\n this.nodeVisible = undefined;\n this.rootNode = null;\n this.parsed = null;\n\n const self = this;\n Object.defineProperty(this, 'currentFileInfo', {\n get: function() { return self.fileInfo(); }\n });\n Object.defineProperty(this, 'index', {\n get: function() { return self.getIndex(); }\n });\n\n }\n\n setParent(nodes, parent) {\n function set(node) {\n if (node && node instanceof Node) {\n node.parent = parent;\n }\n }\n if (Array.isArray(nodes)) {\n nodes.forEach(set);\n }\n else {\n set(nodes);\n }\n }\n\n getIndex() {\n return this._index || (this.parent && this.parent.getIndex()) || 0;\n }\n\n fileInfo() {\n return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};\n }\n\n isRulesetLike() {\n return false;\n }\n\n toCSS(context) {\n const strs = [];\n this.genCSS(context, {\n add: function(chunk, fileInfo, index) {\n strs.push(chunk);\n },\n isEmpty: function () {\n return strs.length === 0;\n }\n });\n return strs.join('');\n }\n\n genCSS(context, output) {\n output.add(this.value);\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval() { return this; }\n\n _operate(context, op, a, b) {\n switch (op) {\n case '+': return a + b;\n case '-': return a - b;\n case '*': return a * b;\n case '/': return a / b;\n }\n }\n\n fround(context, value) {\n const precision = context && context.numPrecision;\n // add \"epsilon\" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded:\n return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;\n }\n\n // Returns true if this node represents root of ast imported by reference\n blocksVisibility() {\n if (this.visibilityBlocks == null) {\n this.visibilityBlocks = 0;\n }\n return this.visibilityBlocks !== 0;\n }\n\n addVisibilityBlock() {\n if (this.visibilityBlocks == null) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks + 1;\n }\n\n removeVisibilityBlock() {\n if (this.visibilityBlocks == null) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks - 1;\n }\n\n // Turns on node visibility - if called node will be shown in output regardless\n // of whether it comes from import by reference or not\n ensureVisibility() {\n this.nodeVisible = true;\n }\n\n // Turns off node visibility - if called node will NOT be shown in output regardless\n // of whether it comes from import by reference or not\n ensureInvisibility() {\n this.nodeVisible = false;\n }\n\n // return values:\n // false - the node must not be visible\n // true - the node must be visible\n // undefined or null - the node has the same visibility as its parent\n isVisible() {\n return this.nodeVisible;\n }\n\n visibilityInfo() {\n return {\n visibilityBlocks: this.visibilityBlocks,\n nodeVisible: this.nodeVisible\n };\n }\n\n copyVisibilityInfo(info) {\n if (!info) {\n return;\n }\n this.visibilityBlocks = info.visibilityBlocks;\n this.nodeVisible = info.nodeVisible;\n }\n}\n\nNode.compare = (a, b) => {\n /* returns:\n -1: a < b\n 0: a = b\n 1: a > b\n and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */\n\n if ((a.compare) &&\n // for \"symmetric results\" force toCSS-based comparison\n // of Quoted or Anonymous if either value is one of those\n !(b.type === 'Quoted' || b.type === 'Anonymous')) {\n return a.compare(b);\n } else if (b.compare) {\n return -b.compare(a);\n } else if (a.type !== b.type) {\n return undefined;\n }\n\n a = a.value;\n b = b.value;\n if (!Array.isArray(a)) {\n return a === b ? 0 : undefined;\n }\n if (a.length !== b.length) {\n return undefined;\n }\n for (let i = 0; i < a.length; i++) {\n if (Node.compare(a[i], b[i]) !== 0) {\n return undefined;\n }\n }\n return 0;\n};\n\nNode.numericCompare = (a, b) => a < b ? -1\n : a === b ? 0\n : a > b ? 1 : undefined;\nexport default Node;\n","import Node from './node';\nimport colors from '../data/colors';\n\n//\n// RGB Colors - #ff0014, #eee\n//\nclass Color extends Node {\n constructor(rgb, a, originalForm) {\n super();\n\n const self = this;\n //\n // The end goal here, is to parse the arguments\n // into an integer triplet, such as `128, 255, 0`\n //\n // This facilitates operations and conversions.\n //\n if (Array.isArray(rgb)) {\n this.rgb = rgb;\n } else if (rgb.length >= 6) {\n this.rgb = [];\n rgb.match(/.{2}/g).map((c, i) => {\n if (i < 3) {\n self.rgb.push(parseInt(c, 16));\n } else {\n self.alpha = (parseInt(c, 16)) / 255;\n }\n });\n } else {\n this.rgb = [];\n rgb.split('').map((c, i) => {\n if (i < 3) {\n self.rgb.push(parseInt(c + c, 16));\n } else {\n self.alpha = (parseInt(c + c, 16)) / 255;\n }\n });\n }\n this.alpha = this.alpha || (typeof a === 'number' ? a : 1);\n if (typeof originalForm !== 'undefined') {\n this.value = originalForm;\n }\n }\n\n luma() {\n let r = this.rgb[0] / 255;\n let g = this.rgb[1] / 255;\n let b = this.rgb[2] / 255;\n\n r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);\n g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);\n b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);\n\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n }\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n }\n\n toCSS(context, doNotCompress) {\n const compress = context && context.compress && !doNotCompress;\n let color;\n let alpha;\n let colorFunction;\n let args = [];\n\n // `value` is set if this color was originally\n // converted from a named color string so we need\n // to respect this and try to output named color too.\n alpha = this.fround(context, this.alpha);\n\n if (this.value) {\n if (this.value.indexOf('rgb') === 0) {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n } else if (this.value.indexOf('hsl') === 0) {\n if (alpha < 1) {\n colorFunction = 'hsla';\n } else {\n colorFunction = 'hsl';\n }\n } else {\n return this.value;\n }\n } else {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n }\n\n switch (colorFunction) {\n case 'rgba':\n args = this.rgb.map(c => clamp(Math.round(c), 255)).concat(clamp(alpha, 1));\n break;\n case 'hsla':\n args.push(clamp(alpha, 1));\n case 'hsl':\n color = this.toHSL();\n args = [\n this.fround(context, color.h),\n `${this.fround(context, color.s * 100)}%`,\n `${this.fround(context, color.l * 100)}%`\n ].concat(args);\n }\n\n if (colorFunction) {\n // Values are capped between `0` and `255`, rounded and zero-padded.\n return `${colorFunction}(${args.join(`,${compress ? '' : ' '}`)})`;\n }\n\n color = this.toRGB();\n\n if (compress) {\n const splitcolor = color.split('');\n\n // Convert color to short format\n if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {\n color = `#${splitcolor[1]}${splitcolor[3]}${splitcolor[5]}`;\n }\n }\n\n return color;\n }\n\n //\n // Operations have to be done per-channel, if not,\n // channels will spill onto each other. Once we have\n // our result, in the form of an integer triplet,\n // we create a new Color node to hold the result.\n //\n operate(context, op, other) {\n const rgb = new Array(3);\n const alpha = this.alpha * (1 - other.alpha) + other.alpha;\n for (let c = 0; c < 3; c++) {\n rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);\n }\n return new Color(rgb, alpha);\n }\n\n toRGB() {\n return toHex(this.rgb);\n }\n\n toHSL() {\n const r = this.rgb[0] / 255;\n const g = this.rgb[1] / 255;\n const b = this.rgb[2] / 255;\n const a = this.alpha;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n const d = max - min;\n\n if (max === min) {\n h = s = 0;\n } else {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, l, a };\n }\n\n // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n toHSV() {\n const r = this.rgb[0] / 255;\n const g = this.rgb[1] / 255;\n const b = this.rgb[2] / 255;\n const a = this.alpha;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h;\n let s;\n const v = max;\n\n const d = max - min;\n if (max === 0) {\n s = 0;\n } else {\n s = d / max;\n }\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, v, a };\n }\n\n toARGB() {\n return toHex([this.alpha * 255].concat(this.rgb));\n }\n\n compare(x) {\n return (x.rgb &&\n x.rgb[0] === this.rgb[0] &&\n x.rgb[1] === this.rgb[1] &&\n x.rgb[2] === this.rgb[2] &&\n x.alpha === this.alpha) ? 0 : undefined;\n }\n}\n\nColor.prototype.type = 'Color';\n\nfunction clamp(v, max) {\n return Math.min(Math.max(v, 0), max);\n}\n\nfunction toHex(v) {\n return `#${v.map(c => {\n c = clamp(Math.round(c), 255);\n return (c < 16 ? '0' : '') + c.toString(16);\n }).join('')}`;\n}\n\nColor.fromKeyword = keyword => {\n let c;\n const key = keyword.toLowerCase();\n if (colors.hasOwnProperty(key)) {\n c = new Color(colors[key].slice(1));\n }\n else if (key === 'transparent') {\n c = new Color([0, 0, 0], 0);\n }\n\n if (c) {\n c.value = keyword;\n return c;\n }\n};\nexport default Color;\n","import Node from './node';\n\nclass Paren extends Node {\n constructor(node) {\n super();\n\n this.value = node;\n }\n\n genCSS(context, output) {\n output.add('(');\n this.value.genCSS(context, output);\n output.add(')');\n }\n\n eval(context) {\n return new Paren(this.value.eval(context));\n }\n}\n\nParen.prototype.type = 'Paren';\nexport default Paren;\n","import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nclass Combinator extends Node {\n constructor(value) {\n super();\n\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n }\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n}\n\nCombinator.prototype.type = 'Combinator';\n\nexport default Combinator;\n","import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nclass Element extends Node {\n constructor(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n }\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n }\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n }\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n }\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n }\n\n toCSS(context = {}) {\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n}\n\nElement.prototype.type = 'Element';\nexport default Element;\n","\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2,\n STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};","var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","/* jshint proto: true */\nimport * as Constants from './constants';\nimport CloneHelper from 'clone';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = CloneHelper(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? CloneHelper(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.STRICT_LEGACY;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n case 'strict-legacy':\n opts.math = Constants.Math.STRICT_LEGACY;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (obj2.hasOwnProperty(prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}","import * as utils from './utils';\n\nconst anonymousFunc = /(|Function):(\\d+):(\\d+)/;\n\n/**\n * This is a centralized class of any error that could be thrown internally (mostly by the parser).\n * Besides standard .message it keeps some additional data like a path to the file where the error\n * occurred along with line and column numbers.\n *\n * @class\n * @extends Error\n * @type {module.LessError}\n *\n * @prop {string} type\n * @prop {string} filename\n * @prop {number} index\n * @prop {number} line\n * @prop {number} column\n * @prop {number} callLine\n * @prop {number} callExtract\n * @prop {string[]} extract\n *\n * @param {Object} e - An error object to wrap around or just a descriptive object\n * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?\n * @param {string} [currentFilename]\n */\nconst LessError = function LessError(e, fileContentMap, currentFilename) {\n Error.call(this);\n\n const filename = e.filename || currentFilename;\n\n this.message = e.message;\n this.stack = e.stack;\n\n if (fileContentMap && filename) {\n const input = fileContentMap.contents[filename];\n const loc = utils.getLocation(e.index, input);\n const line = loc.line;\n const col = loc.column;\n const callLine = e.call && utils.getLocation(e.call, input).line;\n const lines = input ? input.split('\\n') : '';\n\n this.type = e.type || 'Syntax';\n this.filename = filename;\n this.index = e.index;\n this.line = typeof line === 'number' ? line + 1 : null;\n this.column = col;\n\n if (!this.line && this.stack) {\n const found = this.stack.match(anonymousFunc);\n\n /**\n * We have to figure out how this environment stringifies anonymous functions\n * so we can correctly map plugin errors.\n * \n * Note, in Node 8, the output of anonymous funcs varied based on parameters\n * being present or not, so we inject dummy params.\n */\n const func = new Function('a', 'throw new Error()');\n let lineAdjust = 0;\n try {\n func();\n } catch (e) {\n const match = e.stack.match(anonymousFunc);\n const line = parseInt(match[2]);\n lineAdjust = 1 - line;\n }\n\n if (found) {\n if (found[2]) {\n this.line = parseInt(found[2]) + lineAdjust;\n }\n if (found[3]) {\n this.column = parseInt(found[3]);\n }\n }\n }\n\n this.callLine = callLine + 1;\n this.callExtract = lines[callLine];\n\n this.extract = [\n lines[this.line - 2],\n lines[this.line - 1],\n lines[this.line]\n ];\n }\n\n};\n\nif (typeof Object.create === 'undefined') {\n const F = () => {};\n F.prototype = Error.prototype;\n LessError.prototype = new F();\n} else {\n LessError.prototype = Object.create(Error.prototype);\n}\n\nLessError.prototype.constructor = LessError;\n\n/**\n * An overridden version of the default Object.prototype.toString\n * which uses additional information to create a helpful message.\n *\n * @param {Object} options\n * @returns {string}\n */\nLessError.prototype.toString = function(options = {}) {\n let message = '';\n const extract = this.extract || [];\n let error = [];\n let stylize = str => str;\n if (options.stylize) {\n const type = typeof options.stylize;\n if (type !== 'function') {\n throw Error(`options.stylize should be a function, got a ${type}!`);\n }\n stylize = options.stylize;\n }\n\n if (this.line !== null) {\n if (typeof extract[0] === 'string') {\n error.push(stylize(`${this.line - 1} ${extract[0]}`, 'grey'));\n }\n\n if (typeof extract[1] === 'string') {\n let errorTxt = `${this.line} `;\n if (extract[1]) {\n errorTxt += extract[1].slice(0, this.column) +\n stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +\n extract[1].slice(this.column + 1), 'red'), 'inverse');\n }\n error.push(errorTxt);\n }\n\n if (typeof extract[2] === 'string') {\n error.push(stylize(`${this.line + 1} ${extract[2]}`, 'grey'));\n }\n error = `${error.join('\\n') + stylize('', 'reset')}\\n`;\n }\n\n message += stylize(`${this.type}Error: ${this.message}`, 'red');\n if (this.filename) {\n message += stylize(' in ', 'red') + this.filename;\n }\n if (this.line) {\n message += stylize(` on line ${this.line}, column ${this.column + 1}:`, 'grey');\n }\n\n message += `\\n${error}`;\n\n if (this.callLine) {\n message += `${stylize('from ', 'red') + (this.filename || '')}/n`;\n message += `${stylize(this.callLine, 'grey')} ${this.callExtract}/n`;\n }\n\n return message;\n};\n\nexport default LessError;","import Node from './node';\nimport Element from './element';\nimport LessError from '../less-error';\n\nclass Selector extends Node {\n constructor(elements, extendList, condition, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.extendList = extendList;\n this.condition = condition;\n this.evaldCondition = !condition;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.elements = this.getElements(elements);\n this.mixinElements_ = undefined;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.elements, this);\n }\n\n accept(visitor) {\n if (this.elements) {\n this.elements = visitor.visitArray(this.elements);\n }\n if (this.extendList) {\n this.extendList = visitor.visitArray(this.extendList);\n }\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n }\n\n createDerived(elements, extendList, evaldCondition) {\n elements = this.getElements(elements);\n const newSelector = new Selector(elements, extendList || this.extendList,\n null, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n newSelector.evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition;\n newSelector.mediaEmpty = this.mediaEmpty;\n return newSelector;\n }\n\n getElements(els) {\n if (!els) {\n return [new Element('', '&', false, this._index, this._fileInfo)];\n }\n if (typeof els === 'string') {\n this.parse.parseNode(\n els, \n ['selector'],\n this._index, \n this._fileInfo, \n function(err, result) {\n if (err) {\n throw new LessError({\n index: err.index,\n message: err.message\n }, this.parse.imports, this._fileInfo.filename);\n }\n els = result[0].elements;\n });\n }\n return els;\n }\n\n createEmptySelectors() {\n const el = new Element('', '&', false, this._index, this._fileInfo);\n const sels = [new Selector([el], null, null, this._index, this._fileInfo)];\n sels[0].mediaEmpty = true;\n return sels;\n }\n\n match(other) {\n const elements = this.elements;\n const len = elements.length;\n let olen;\n let i;\n\n other = other.mixinElements();\n olen = other.length;\n if (olen === 0 || len < olen) {\n return 0;\n } else {\n for (i = 0; i < olen; i++) {\n if (elements[i].value !== other[i]) {\n return 0;\n }\n }\n }\n\n return olen; // return number of matched elements\n }\n\n mixinElements() {\n if (this.mixinElements_) {\n return this.mixinElements_;\n }\n\n let elements = this.elements.map( v => v.combinator.value + (v.value.value || v.value)).join('').match(/[,&#\\*\\.\\w-]([\\w-]|(\\\\.))*/g);\n\n if (elements) {\n if (elements[0] === '&') {\n elements.shift();\n }\n } else {\n elements = [];\n }\n\n return (this.mixinElements_ = elements);\n }\n\n isJustParentSelector() {\n return !this.mediaEmpty &&\n this.elements.length === 1 &&\n this.elements[0].value === '&' &&\n (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');\n }\n\n eval(context) {\n const evaldCondition = this.condition && this.condition.eval(context);\n let elements = this.elements;\n let extendList = this.extendList;\n\n elements = elements && elements.map(e => e.eval(context));\n extendList = extendList && extendList.map(extend => extend.eval(context));\n\n return this.createDerived(elements, extendList, evaldCondition);\n }\n\n genCSS(context, output) {\n let i;\n let element;\n if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {\n output.add(' ', this.fileInfo(), this.getIndex());\n }\n for (i = 0; i < this.elements.length; i++) {\n element = this.elements[i];\n element.genCSS(context, output);\n }\n }\n\n getIsOutput() {\n return this.evaldCondition;\n }\n}\n\nSelector.prototype.type = 'Selector';\nexport default Selector;\n","import Node from './node';\n\nclass Value extends Node {\n constructor(value) {\n super();\n\n if (!value) {\n throw new Error('Value requires an array argument');\n }\n if (!Array.isArray(value)) {\n this.value = [ value ];\n }\n else {\n this.value = value;\n }\n }\n\n accept(visitor) {\n if (this.value) {\n this.value = visitor.visitArray(this.value);\n }\n }\n\n eval(context) {\n if (this.value.length === 1) {\n return this.value[0].eval(context);\n } else {\n return new Value(this.value.map(v => v.eval(context)));\n }\n }\n\n genCSS(context, output) {\n let i;\n for (i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (i + 1 < this.value.length) {\n output.add((context && context.compress) ? ',' : ', ');\n }\n }\n }\n}\n\nValue.prototype.type = 'Value';\nexport default Value;\n","import Node from './node';\n\nclass Keyword extends Node {\n constructor(value) {\n super();\n\n this.value = value;\n }\n\n genCSS(context, output) {\n if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }\n output.add(this.value);\n }\n}\n\nKeyword.prototype.type = 'Keyword';\n\nKeyword.True = new Keyword('true');\nKeyword.False = new Keyword('false');\n\nexport default Keyword;\n","import Node from './node';\n\nclass Anonymous extends Node {\n constructor(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n super();\n\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n }\n\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n }\n\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n\n isRulesetLike() {\n return this.rulesetLike;\n }\n\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n}\n\nAnonymous.prototype.type = 'Anonymous';\nexport default Anonymous;\n","import Node from './node';\nimport Value from './value';\nimport Keyword from './keyword';\nimport Anonymous from './anonymous';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nclass Declaration extends Node {\n constructor(name, value, important, merge, index, currentFileInfo, inline, variable) {\n super();\n\n this.name = name;\n this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);\n this.important = important ? ` ${important.trim()}` : '';\n this.merge = merge;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.inline = inline || false;\n this.variable = (variable !== undefined) ? variable\n : (name.charAt && (name.charAt(0) === '@'));\n this.allowRoot = true;\n this.setParent(this.value, this);\n }\n\n genCSS(context, output) {\n output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());\n try {\n this.value.genCSS(context, output);\n }\n catch (e) {\n e.index = this._index;\n e.filename = this._fileInfo.filename;\n throw e;\n }\n output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);\n }\n\n eval(context) {\n let mathBypass = false;\n let prevMath;\n let name = this.name;\n let evaldValue;\n let variable = this.variable;\n if (typeof name !== 'string') {\n // expand 'primitive' name directly to get\n // things faster (~10% for benchmark.less):\n name = (name.length === 1) && (name[0] instanceof Keyword) ?\n name[0].value : evalName(context, name);\n variable = false; // never treat expanded interpolation as new variable name\n }\n\n // @todo remove when parens-division is default\n if (name === 'font' && context.math === MATH.ALWAYS) {\n mathBypass = true;\n prevMath = context.math;\n context.math = MATH.PARENS_DIVISION;\n }\n try {\n context.importantScope.push({});\n evaldValue = this.value.eval(context);\n\n if (!this.variable && evaldValue.type === 'DetachedRuleset') {\n throw { message: 'Rulesets cannot be evaluated on a property.',\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n let important = this.important;\n const importantResult = context.importantScope.pop();\n if (!important && importantResult.important) {\n important = importantResult.important;\n }\n\n return new Declaration(name,\n evaldValue,\n important,\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline,\n variable);\n }\n catch (e) {\n if (typeof e.index !== 'number') {\n e.index = this.getIndex();\n e.filename = this.fileInfo().filename;\n }\n throw e;\n }\n finally {\n if (mathBypass) {\n context.math = prevMath;\n }\n }\n }\n\n makeImportant() {\n return new Declaration(this.name,\n this.value,\n '!important',\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline);\n }\n}\n\nfunction evalName(context, name) {\n let value = '';\n let i;\n const n = name.length;\n const output = {add: function (s) {value += s;}};\n for (i = 0; i < n; i++) {\n name[i].eval(context).genCSS(context, output);\n }\n return value;\n}\n\nDeclaration.prototype.type = 'Declaration';\nexport default Declaration;","const debugInfo = (context, ctx, lineSeparator) => {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = debugInfo.asComment(ctx);\n break;\n case 'mediaquery':\n result = debugInfo.asMediaQuery(ctx);\n break;\n case 'all':\n result = debugInfo.asComment(ctx) + (lineSeparator || '') + debugInfo.asMediaQuery(ctx);\n break;\n }\n }\n return result;\n};\n\ndebugInfo.asComment = ctx => `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n`;\n\ndebugInfo.asMediaQuery = ctx => {\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:\\/\\\\])/g, a => {\n if (a == '\\\\') {\n a = '\\/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n};\n\nexport default debugInfo;\n","import Node from './node';\nimport getDebugInfo from './debug-info';\n\nclass Comment extends Node {\n constructor(value, isLineComment, index, currentFileInfo) {\n super();\n\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n }\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n }\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n}\n\nComment.prototype.type = 'Comment';\nexport default Comment;\n","const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (original.hasOwnProperty(propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager' // Used as the plugin manager for the session\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\ncontexts.Eval = class {\n constructor(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n this.inCalc = false;\n this.mathOn = true;\n }\n\n enterCalc() {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n }\n\n exitCalc() {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n }\n\n inParenthesis() {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n };\n\n outOfParenthesis() {\n this.parensStack.pop();\n };\n\n isMathOn(op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n }\n\n pathRequiresRewrite(path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n }\n\n rewritePath(path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n }\n\n normalizePath(path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n }\n}\n","function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );","import Keyword from '../tree/keyword';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (v != null) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n","import Node from './node';\nimport Declaration from './declaration';\nimport Keyword from './keyword';\nimport Comment from './comment';\nimport Paren from './paren';\nimport Selector from './selector';\nimport Element from './element';\nimport Anonymous from './anonymous';\nimport contexts from '../contexts';\nimport globalFunctionRegistry from '../functions/function-registry';\nimport defaultFunc from '../functions/default';\nimport getDebugInfo from './debug-info';\nimport * as utils from '../utils';\n\nclass Ruleset extends Node {\n constructor(selectors, rules, strictImports, visibilityInfo) {\n super();\n\n this.selectors = selectors;\n this.rules = rules;\n this._lookups = {};\n this._variables = null;\n this._properties = null;\n this.strictImports = strictImports;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n this.setParent(this.selectors, this);\n this.setParent(this.rules, this);\n\n }\n\n isRulesetLike() {\n return true;\n }\n\n accept(visitor) {\n if (this.paths) {\n this.paths = visitor.visitArray(this.paths, true);\n } else if (this.selectors) {\n this.selectors = visitor.visitArray(this.selectors);\n }\n if (this.rules && this.rules.length) {\n this.rules = visitor.visitArray(this.rules);\n }\n }\n\n eval(context) {\n const that = this;\n let selectors;\n let selCnt;\n let selector;\n let i;\n let hasVariable;\n let hasOnePassingSelector = false;\n\n if (this.selectors && (selCnt = this.selectors.length)) {\n selectors = new Array(selCnt);\n defaultFunc.error({\n type: 'Syntax',\n message: 'it is currently only allowed in parametric mixin guards,'\n });\n\n for (i = 0; i < selCnt; i++) {\n selector = this.selectors[i].eval(context);\n for (var j = 0; j < selector.elements.length; j++) {\n if (selector.elements[j].isVariable) {\n hasVariable = true;\n break;\n }\n }\n selectors[i] = selector;\n if (selector.evaldCondition) {\n hasOnePassingSelector = true;\n }\n }\n\n if (hasVariable) {\n const toParseSelectors = new Array(selCnt);\n for (i = 0; i < selCnt; i++) {\n selector = selectors[i];\n toParseSelectors[i] = selector.toCSS(context);\n }\n this.parse.parseNode(\n toParseSelectors.join(','),\n [\"selectors\"], \n selectors[0].getIndex(), \n selectors[0].fileInfo(), \n (err, result) => {\n if (result) {\n selectors = utils.flattenArray(result);\n }\n });\n }\n\n defaultFunc.reset();\n } else {\n hasOnePassingSelector = true;\n }\n\n let rules = this.rules ? utils.copyArray(this.rules) : null;\n const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());\n let rule;\n let subRule;\n\n ruleset.originalRuleset = this;\n ruleset.root = this.root;\n ruleset.firstRoot = this.firstRoot;\n ruleset.allowImports = this.allowImports;\n\n if (this.debugInfo) {\n ruleset.debugInfo = this.debugInfo;\n }\n\n if (!hasOnePassingSelector) {\n rules.length = 0;\n }\n\n // inherit a function registry from the frames stack when possible;\n // otherwise from the global registry\n ruleset.functionRegistry = (frames => {\n let i = 0;\n const n = frames.length;\n let found;\n for ( ; i !== n ; ++i ) {\n found = frames[ i ].functionRegistry;\n if ( found ) { return found; }\n }\n return globalFunctionRegistry;\n })(context.frames).inherit();\n\n // push the current ruleset to the frames stack\n const ctxFrames = context.frames;\n ctxFrames.unshift(ruleset);\n\n // currrent selectors\n let ctxSelectors = context.selectors;\n if (!ctxSelectors) {\n context.selectors = ctxSelectors = [];\n }\n ctxSelectors.unshift(this.selectors);\n\n // Evaluate imports\n if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {\n ruleset.evalImports(context);\n }\n\n // Store the frames around mixin definitions,\n // so they can be evaluated like closures when the time comes.\n const rsRules = ruleset.rules;\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.evalFirst) {\n rsRules[i] = rule.eval(context);\n }\n }\n\n const mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;\n\n // Evaluate mixin calls.\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.type === 'MixinCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).filter(r => {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope if the variable is\n // already there. consider returning false here\n // but we need a way to \"return\" variable from mixins\n return !(ruleset.variable(r.name));\n }\n return true;\n });\n rsRules.splice(...[i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n } else if (rule.type === 'VariableCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).rules.filter(r => {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope at all\n return false;\n }\n return true;\n });\n rsRules.splice(...[i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n if (!rule.evalFirst) {\n rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n // for rulesets, check if it is a css guard and can be removed\n if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {\n // check if it can be folded in (e.g. & where)\n if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {\n rsRules.splice(i--, 1);\n\n for (var j = 0; (subRule = rule.rules[j]); j++) {\n if (subRule instanceof Node) {\n subRule.copyVisibilityInfo(rule.visibilityInfo());\n if (!(subRule instanceof Declaration) || !subRule.variable) {\n rsRules.splice(++i, 0, subRule);\n }\n }\n }\n }\n }\n }\n\n // Pop the stack\n ctxFrames.shift();\n ctxSelectors.shift();\n\n if (context.mediaBlocks) {\n for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {\n context.mediaBlocks[i].bubbleSelectors(selectors);\n }\n }\n\n return ruleset;\n }\n\n evalImports(context) {\n const rules = this.rules;\n let i;\n let importRules;\n if (!rules) { return; }\n\n for (i = 0; i < rules.length; i++) {\n if (rules[i].type === 'Import') {\n importRules = rules[i].eval(context);\n if (importRules && (importRules.length || importRules.length === 0)) {\n rules.splice(...[i, 1].concat(importRules));\n i += importRules.length - 1;\n } else {\n rules.splice(i, 1, importRules);\n }\n this.resetCache();\n }\n }\n }\n\n makeImportant() {\n const result = new Ruleset(this.selectors, this.rules.map(r => {\n if (r.makeImportant) {\n return r.makeImportant();\n } else {\n return r;\n }\n }), this.strictImports, this.visibilityInfo());\n\n return result;\n }\n\n matchArgs(args) {\n return !args || args.length === 0;\n }\n\n // lets you call a css selector with a guard\n matchCondition(args, context) {\n const lastSelector = this.selectors[this.selectors.length - 1];\n if (!lastSelector.evaldCondition) {\n return false;\n }\n if (lastSelector.condition &&\n !lastSelector.condition.eval(\n new contexts.Eval(context,\n context.frames))) {\n return false;\n }\n return true;\n }\n\n resetCache() {\n this._rulesets = null;\n this._variables = null;\n this._properties = null;\n this._lookups = {};\n }\n\n variables() {\n if (!this._variables) {\n this._variables = !this.rules ? {} : this.rules.reduce((hash, r) => {\n if (r instanceof Declaration && r.variable === true) {\n hash[r.name] = r;\n }\n // when evaluating variables in an import statement, imports have not been eval'd\n // so we need to go inside import statements.\n // guard against root being a string (in the case of inlined less)\n if (r.type === 'Import' && r.root && r.root.variables) {\n const vars = r.root.variables();\n for (const name in vars) {\n if (vars.hasOwnProperty(name)) {\n hash[name] = r.root.variable(name);\n }\n }\n }\n return hash;\n }, {});\n }\n return this._variables;\n }\n\n properties() {\n if (!this._properties) {\n this._properties = !this.rules ? {} : this.rules.reduce((hash, r) => {\n if (r instanceof Declaration && r.variable !== true) {\n const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?\n r.name[0].value : r.name;\n // Properties don't overwrite as they can merge\n if (!hash[`$${name}`]) {\n hash[`$${name}`] = [ r ];\n }\n else {\n hash[`$${name}`].push(r);\n }\n }\n return hash;\n }, {});\n }\n return this._properties;\n }\n\n variable(name) {\n const decl = this.variables()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n }\n\n property(name) {\n const decl = this.properties()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n }\n\n lastDeclaration() {\n for (let i = this.rules.length; i > 0; i--) {\n const decl = this.rules[i - 1];\n if (decl instanceof Declaration) {\n return this.parseValue(decl);\n }\n }\n }\n\n parseValue(toParse) {\n const self = this;\n function transformDeclaration(decl) {\n if (decl.value instanceof Anonymous && !decl.parsed) {\n if (typeof decl.value.value === 'string') {\n this.parse.parseNode(\n decl.value.value,\n ['value', 'important'], \n decl.value.getIndex(), \n decl.fileInfo(), \n (err, result) => {\n if (err) {\n decl.parsed = true;\n }\n if (result) {\n decl.value = result[0];\n decl.important = result[1] || '';\n decl.parsed = true;\n }\n });\n } else {\n decl.parsed = true;\n }\n\n return decl;\n }\n else {\n return decl;\n }\n }\n if (!Array.isArray(toParse)) {\n return transformDeclaration.call(self, toParse);\n }\n else {\n const nodes = [];\n toParse.forEach(n => {\n nodes.push(transformDeclaration.call(self, n));\n });\n return nodes;\n }\n }\n\n rulesets() {\n if (!this.rules) { return []; }\n\n const filtRules = [];\n const rules = this.rules;\n let i;\n let rule;\n\n for (i = 0; (rule = rules[i]); i++) {\n if (rule.isRuleset) {\n filtRules.push(rule);\n }\n }\n\n return filtRules;\n }\n\n prependRule(rule) {\n const rules = this.rules;\n if (rules) {\n rules.unshift(rule);\n } else {\n this.rules = [ rule ];\n }\n this.setParent(rule, this);\n }\n\n find(selector, self = this, filter) {\n const rules = [];\n let match;\n let foundMixins;\n const key = selector.toCSS();\n\n if (key in this._lookups) { return this._lookups[key]; }\n\n this.rulesets().forEach(rule => {\n if (rule !== self) {\n for (let j = 0; j < rule.selectors.length; j++) {\n match = selector.match(rule.selectors[j]);\n if (match) {\n if (selector.elements.length > match) {\n if (!filter || filter(rule)) {\n foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);\n for (let i = 0; i < foundMixins.length; ++i) {\n foundMixins[i].path.push(rule);\n }\n Array.prototype.push.apply(rules, foundMixins);\n }\n } else {\n rules.push({ rule, path: []});\n }\n break;\n }\n }\n }\n });\n this._lookups[key] = rules;\n return rules;\n }\n\n genCSS(context, output) {\n let i;\n let j;\n const charsetRuleNodes = [];\n let ruleNodes = [];\n\n let // Line number debugging\n debugInfo;\n\n let rule;\n let path;\n\n context.tabLevel = (context.tabLevel || 0);\n\n if (!this.root) {\n context.tabLevel++;\n }\n\n const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');\n const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');\n let sep;\n\n let charsetNodeIndex = 0;\n let importNodeIndex = 0;\n for (i = 0; (rule = this.rules[i]); i++) {\n if (rule instanceof Comment) {\n if (importNodeIndex === i) {\n importNodeIndex++;\n }\n ruleNodes.push(rule);\n } else if (rule.isCharset && rule.isCharset()) {\n ruleNodes.splice(charsetNodeIndex, 0, rule);\n charsetNodeIndex++;\n importNodeIndex++;\n } else if (rule.type === 'Import') {\n ruleNodes.splice(importNodeIndex, 0, rule);\n importNodeIndex++;\n } else {\n ruleNodes.push(rule);\n }\n }\n ruleNodes = charsetRuleNodes.concat(ruleNodes);\n\n // If this is the root node, we don't render\n // a selector, or {}.\n if (!this.root) {\n debugInfo = getDebugInfo(context, this, tabSetStr);\n\n if (debugInfo) {\n output.add(debugInfo);\n output.add(tabSetStr);\n }\n\n const paths = this.paths;\n const pathCnt = paths.length;\n let pathSubCnt;\n\n sep = context.compress ? ',' : (`,\\n${tabSetStr}`);\n\n for (i = 0; i < pathCnt; i++) {\n path = paths[i];\n if (!(pathSubCnt = path.length)) { continue; }\n if (i > 0) { output.add(sep); }\n\n context.firstSelector = true;\n path[0].genCSS(context, output);\n\n context.firstSelector = false;\n for (j = 1; j < pathSubCnt; j++) {\n path[j].genCSS(context, output);\n }\n }\n\n output.add((context.compress ? '{' : ' {\\n') + tabRuleStr);\n }\n\n // Compile rules and rulesets\n for (i = 0; (rule = ruleNodes[i]); i++) {\n\n if (i + 1 === ruleNodes.length) {\n context.lastRule = true;\n }\n\n const currentLastRule = context.lastRule;\n if (rule.isRulesetLike(rule)) {\n context.lastRule = false;\n }\n\n if (rule.genCSS) {\n rule.genCSS(context, output);\n } else if (rule.value) {\n output.add(rule.value.toString());\n }\n\n context.lastRule = currentLastRule;\n\n if (!context.lastRule && rule.isVisible()) {\n output.add(context.compress ? '' : (`\\n${tabRuleStr}`));\n } else {\n context.lastRule = false;\n }\n }\n\n if (!this.root) {\n output.add((context.compress ? '}' : `\\n${tabSetStr}}`));\n context.tabLevel--;\n }\n\n if (!output.isEmpty() && !context.compress && this.firstRoot) {\n output.add('\\n');\n }\n }\n\n joinSelectors(paths, context, selectors) {\n for (let s = 0; s < selectors.length; s++) {\n this.joinSelector(paths, context, selectors[s]);\n }\n }\n\n joinSelector(paths, context, selector) {\n function createParenthesis(elementsToPak, originalElement) {\n let replacementParen;\n let j;\n if (elementsToPak.length === 0) {\n replacementParen = new Paren(elementsToPak[0]);\n } else {\n const insideParent = new Array(elementsToPak.length);\n for (j = 0; j < elementsToPak.length; j++) {\n insideParent[j] = new Element(\n null,\n elementsToPak[j],\n originalElement.isVariable,\n originalElement._index,\n originalElement._fileInfo\n );\n }\n replacementParen = new Paren(new Selector(insideParent));\n }\n return replacementParen;\n }\n\n function createSelector(containedElement, originalElement) {\n let element;\n let selector;\n element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);\n selector = new Selector([element]);\n return selector;\n }\n\n // joins selector path from `beginningPath` with selector path in `addPath`\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns concatenated path\n function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {\n let newSelectorPath;\n let lastSelector;\n let newJoinedSelector;\n // our new selector path\n newSelectorPath = [];\n\n // construct the joined selector - if & is the first thing this will be empty,\n // if not newJoinedSelector will be the last set of elements in the selector\n if (beginningPath.length > 0) {\n newSelectorPath = utils.copyArray(beginningPath);\n lastSelector = newSelectorPath.pop();\n newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements));\n }\n else {\n newJoinedSelector = originalSelector.createDerived([]);\n }\n\n if (addPath.length > 0) {\n // /deep/ is a CSS4 selector - (removed, so should deprecate)\n // that is valid without anything in front of it\n // so if the & does not have a combinator that is \"\" or \" \" then\n // and there is a combinator on the parent, then grab that.\n // this also allows + a { & .b { .a & { ... though not sure why you would want to do that\n let combinator = replacedElement.combinator;\n\n const parentEl = addPath[0].elements[0];\n if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {\n combinator = parentEl.combinator;\n }\n // join the elements so far with the first part of the parent\n newJoinedSelector.elements.push(new Element(\n combinator,\n parentEl.value,\n replacedElement.isVariable,\n replacedElement._index,\n replacedElement._fileInfo\n ));\n newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));\n }\n\n // now add the joined selector - but only if it is not empty\n if (newJoinedSelector.elements.length !== 0) {\n newSelectorPath.push(newJoinedSelector);\n }\n\n // put together the parent selectors after the join (e.g. the rest of the parent)\n if (addPath.length > 1) {\n let restOfPath = addPath.slice(1);\n restOfPath = restOfPath.map(selector => selector.createDerived(selector.elements, []));\n newSelectorPath = newSelectorPath.concat(restOfPath);\n }\n return newSelectorPath;\n }\n\n // joins selector path from `beginningPath` with every selector path in `addPaths` array\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns array with all concatenated paths\n function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) {\n let j;\n for (j = 0; j < beginningPath.length; j++) {\n const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n result.push(newSelectorPath);\n }\n return result;\n }\n\n function mergeElementsOnToSelectors(elements, selectors) {\n let i;\n let sel;\n\n if (elements.length === 0) {\n return ;\n }\n if (selectors.length === 0) {\n selectors.push([ new Selector(elements) ]);\n return;\n }\n\n for (i = 0; (sel = selectors[i]); i++) {\n // if the previous thing in sel is a parent this needs to join on to it\n if (sel.length > 0) {\n sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));\n }\n else {\n sel.push(new Selector(elements));\n }\n }\n }\n\n // replace all parent selectors inside `inSelector` by content of `context` array\n // resulting selectors are returned inside `paths` array\n // returns true if `inSelector` contained at least one parent selector\n function replaceParentSelector(paths, context, inSelector) {\n // The paths are [[Selector]]\n // The first list is a list of comma separated selectors\n // The inner list is a list of inheritance separated selectors\n // e.g.\n // .a, .b {\n // .c {\n // }\n // }\n // == [[.a] [.c]] [[.b] [.c]]\n //\n let i;\n\n let j;\n let k;\n let currentElements;\n let newSelectors;\n let selectorsMultiplied;\n let sel;\n let el;\n let hadParentSelector = false;\n let length;\n let lastSelector;\n function findNestedSelector(element) {\n let maybeSelector;\n if (!(element.value instanceof Paren)) {\n return null;\n }\n\n maybeSelector = element.value.value;\n if (!(maybeSelector instanceof Selector)) {\n return null;\n }\n\n return maybeSelector;\n }\n\n // the elements from the current selector so far\n currentElements = [];\n // the current list of new selectors to add to the path.\n // We will build it up. We initiate it with one empty selector as we \"multiply\" the new selectors\n // by the parents\n newSelectors = [\n []\n ];\n\n for (i = 0; (el = inSelector.elements[i]); i++) {\n // non parent reference elements just get added\n if (el.value !== '&') {\n const nestedSelector = findNestedSelector(el);\n if (nestedSelector != null) {\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n const nestedPaths = [];\n let replaced;\n const replacedNewSelectors = [];\n replaced = replaceParentSelector(nestedPaths, context, nestedSelector);\n hadParentSelector = hadParentSelector || replaced;\n // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors\n for (k = 0; k < nestedPaths.length; k++) {\n const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);\n addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);\n }\n newSelectors = replacedNewSelectors;\n currentElements = [];\n } else {\n currentElements.push(el);\n }\n\n } else {\n hadParentSelector = true;\n // the new list of selectors to add\n selectorsMultiplied = [];\n\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n // loop through our current selectors\n for (j = 0; j < newSelectors.length; j++) {\n sel = newSelectors[j];\n // if we don't have any parent paths, the & might be in a mixin so that it can be used\n // whether there are parents or not\n if (context.length === 0) {\n // the combinator used on el should now be applied to the next element instead so that\n // it is not lost\n if (sel.length > 0) {\n sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));\n }\n selectorsMultiplied.push(sel);\n }\n else {\n // and the parent selectors\n for (k = 0; k < context.length; k++) {\n // We need to put the current selectors\n // then join the last selector's elements on to the parents selectors\n const newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);\n // add that to our new set of selectors\n selectorsMultiplied.push(newSelectorPath);\n }\n }\n }\n\n // our new selectors has been multiplied, so reset the state\n newSelectors = selectorsMultiplied;\n currentElements = [];\n }\n }\n\n // if we have any elements left over (e.g. .a& .b == .b)\n // add them on to all the current selectors\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n for (i = 0; i < newSelectors.length; i++) {\n length = newSelectors[i].length;\n if (length > 0) {\n paths.push(newSelectors[i]);\n lastSelector = newSelectors[i][length - 1];\n newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);\n }\n }\n\n return hadParentSelector;\n }\n\n function deriveSelector(visibilityInfo, deriveFrom) {\n const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);\n newSelector.copyVisibilityInfo(visibilityInfo);\n return newSelector;\n }\n\n // joinSelector code follows\n let i;\n\n let newPaths;\n let hadParentSelector;\n\n newPaths = [];\n hadParentSelector = replaceParentSelector(newPaths, context, selector);\n\n if (!hadParentSelector) {\n if (context.length > 0) {\n newPaths = [];\n for (i = 0; i < context.length; i++) {\n\n const concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));\n\n concatenated.push(selector);\n newPaths.push(concatenated);\n }\n }\n else {\n newPaths = [[selector]];\n }\n }\n\n for (i = 0; i < newPaths.length; i++) {\n paths.push(newPaths[i]);\n }\n }\n}\n\nRuleset.prototype.type = 'Ruleset';\nRuleset.prototype.isRuleset = true;\nexport default Ruleset;\n","import Node from './node';\nimport Selector from './selector';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\n\nclass AtRule extends Node {\n constructor(\n name,\n value,\n rules,\n index,\n currentFileInfo,\n debugInfo,\n isRooted,\n visibilityInfo\n ) {\n super();\n\n let i;\n\n this.name = name;\n this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);\n if (rules) {\n if (Array.isArray(rules)) {\n this.rules = rules;\n } else {\n this.rules = [rules];\n this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();\n }\n for (i = 0; i < this.rules.length; i++) {\n this.rules[i].allowImports = true;\n }\n this.setParent(this.rules, this);\n }\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.debugInfo = debugInfo;\n this.isRooted = isRooted || false;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n }\n\n accept(visitor) {\n const value = this.value;\n const rules = this.rules;\n if (rules) {\n this.rules = visitor.visitArray(rules);\n }\n if (value) {\n this.value = visitor.visit(value);\n }\n }\n\n isRulesetLike() {\n return this.rules || !this.isCharset();\n }\n\n isCharset() {\n return '@charset' === this.name;\n }\n\n genCSS(context, output) {\n const value = this.value;\n const rules = this.rules;\n output.add(this.name, this.fileInfo(), this.getIndex());\n if (value) {\n output.add(' ');\n value.genCSS(context, output);\n }\n if (rules) {\n this.outputRuleset(context, output, rules);\n } else {\n output.add(';');\n }\n }\n\n eval(context) {\n let mediaPathBackup;\n let mediaBlocksBackup;\n let value = this.value;\n let rules = this.rules;\n\n // media stored inside other atrule should not bubble over it\n // backpup media bubbling information\n mediaPathBackup = context.mediaPath;\n mediaBlocksBackup = context.mediaBlocks;\n // deleted media bubbling information\n context.mediaPath = [];\n context.mediaBlocks = [];\n\n if (value) {\n value = value.eval(context);\n }\n if (rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n rules = [rules[0].eval(context)];\n rules[0].root = true;\n }\n // restore media bubbling information\n context.mediaPath = mediaPathBackup;\n context.mediaBlocks = mediaBlocksBackup;\n\n return new AtRule(this.name, value, rules,\n this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());\n }\n\n variable(name) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.variable.call(this.rules[0], name);\n }\n }\n\n find(...args) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.find.apply(this.rules[0], args);\n }\n }\n\n rulesets() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.rulesets.apply(this.rules[0]);\n }\n }\n\n outputRuleset(context, output, rules) {\n const ruleCnt = rules.length;\n let i;\n context.tabLevel = (context.tabLevel | 0) + 1;\n\n // Compressed\n if (context.compress) {\n output.add('{');\n for (i = 0; i < ruleCnt; i++) {\n rules[i].genCSS(context, output);\n }\n output.add('}');\n context.tabLevel--;\n return;\n }\n\n // Non-compressed\n const tabSetStr = `\\n${Array(context.tabLevel).join(' ')}`;\n\n const tabRuleStr = `${tabSetStr} `;\n if (!ruleCnt) {\n output.add(` {${tabSetStr}}`);\n } else {\n output.add(` {${tabRuleStr}`);\n rules[0].genCSS(context, output);\n for (i = 1; i < ruleCnt; i++) {\n output.add(tabRuleStr);\n rules[i].genCSS(context, output);\n }\n output.add(`${tabSetStr}}`);\n }\n\n context.tabLevel--;\n }\n}\n\nAtRule.prototype.type = 'AtRule';\nexport default AtRule;\n","import Node from './node';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nclass DetachedRuleset extends Node {\n constructor(ruleset, frames) {\n super();\n\n this.ruleset = ruleset;\n this.frames = frames;\n this.setParent(this.ruleset, this);\n }\n\n accept(visitor) {\n this.ruleset = visitor.visit(this.ruleset);\n }\n\n eval(context) {\n const frames = this.frames || utils.copyArray(context.frames);\n return new DetachedRuleset(this.ruleset, frames);\n }\n\n callEval(context) {\n return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);\n }\n}\n\nDetachedRuleset.prototype.type = 'DetachedRuleset';\nDetachedRuleset.prototype.evalFirst = true;\nexport default DetachedRuleset;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport * as utils from '../utils';\n\nclass Unit extends Node {\n constructor(numerator, denominator, backupUnit) {\n super();\n\n this.numerator = numerator ? utils.copyArray(numerator).sort() : [];\n this.denominator = denominator ? utils.copyArray(denominator).sort() : [];\n if (backupUnit) {\n this.backupUnit = backupUnit;\n } else if (numerator && numerator.length) {\n this.backupUnit = numerator[0];\n }\n }\n\n clone() {\n return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);\n }\n\n genCSS(context, output) {\n // Dimension checks the unit is singular and throws an error if in strict math mode.\n const strictUnits = context && context.strictUnits;\n if (this.numerator.length === 1) {\n output.add(this.numerator[0]); // the ideal situation\n } else if (!strictUnits && this.backupUnit) {\n output.add(this.backupUnit);\n } else if (!strictUnits && this.denominator.length) {\n output.add(this.denominator[0]);\n }\n }\n\n toString() {\n let i;\n let returnStr = this.numerator.join('*');\n for (i = 0; i < this.denominator.length; i++) {\n returnStr += `/${this.denominator[i]}`;\n }\n return returnStr;\n }\n\n compare(other) {\n return this.is(other.toString()) ? 0 : undefined;\n }\n\n is(unitString) {\n return this.toString().toUpperCase() === unitString.toUpperCase();\n }\n\n isLength() {\n return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());\n }\n\n isEmpty() {\n return this.numerator.length === 0 && this.denominator.length === 0;\n }\n\n isSingular() {\n return this.numerator.length <= 1 && this.denominator.length === 0;\n }\n\n map(callback) {\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n this.numerator[i] = callback(this.numerator[i], false);\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n this.denominator[i] = callback(this.denominator[i], true);\n }\n }\n\n usedUnits() {\n let group;\n const result = {};\n let mapUnit;\n let groupName;\n\n mapUnit = atomicUnit => {\n /* jshint loopfunc:true */\n if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {\n result[groupName] = atomicUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in unitConversions) {\n if (unitConversions.hasOwnProperty(groupName)) {\n group = unitConversions[groupName];\n\n this.map(mapUnit);\n }\n }\n\n return result;\n }\n\n cancel() {\n const counter = {};\n let atomicUnit;\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n atomicUnit = this.numerator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n atomicUnit = this.denominator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;\n }\n\n this.numerator = [];\n this.denominator = [];\n\n for (atomicUnit in counter) {\n if (counter.hasOwnProperty(atomicUnit)) {\n const count = counter[atomicUnit];\n\n if (count > 0) {\n for (i = 0; i < count; i++) {\n this.numerator.push(atomicUnit);\n }\n } else if (count < 0) {\n for (i = 0; i < -count; i++) {\n this.denominator.push(atomicUnit);\n }\n }\n }\n }\n\n this.numerator.sort();\n this.denominator.sort();\n }\n}\n\nUnit.prototype.type = 'Unit';\nexport default Unit;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport Unit from './unit';\nimport Color from './color';\n\n//\n// A number with a unit\n//\nclass Dimension extends Node {\n constructor(value, unit) {\n super();\n\n this.value = parseFloat(value);\n if (isNaN(this.value)) {\n throw new Error('Dimension is not a number.');\n }\n this.unit = (unit && unit instanceof Unit) ? unit :\n new Unit(unit ? [unit] : undefined);\n this.setParent(this.unit, this);\n }\n\n accept(visitor) {\n this.unit = visitor.visit(this.unit);\n }\n\n eval(context) {\n return this;\n }\n\n toColor() {\n return new Color([this.value, this.value, this.value]);\n }\n\n genCSS(context, output) {\n if ((context && context.strictUnits) && !this.unit.isSingular()) {\n throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`);\n }\n\n const value = this.fround(context, this.value);\n let strValue = String(value);\n\n if (value !== 0 && value < 0.000001 && value > -0.000001) {\n // would be output 1e-6 etc.\n strValue = value.toFixed(20).replace(/0+$/, '');\n }\n\n if (context && context.compress) {\n // Zero values doesn't need a unit\n if (value === 0 && this.unit.isLength()) {\n output.add(strValue);\n return;\n }\n\n // Float values doesn't need a leading zero\n if (value > 0 && value < 1) {\n strValue = (strValue).substr(1);\n }\n }\n\n output.add(strValue);\n this.unit.genCSS(context, output);\n }\n\n // In an operation between two Dimensions,\n // we default to the first Dimension's unit,\n // so `1px + 2` will yield `3px`.\n operate(context, op, other) {\n /* jshint noempty:false */\n let value = this._operate(context, op, this.value, other.value);\n\n let unit = this.unit.clone();\n\n if (op === '+' || op === '-') {\n if (unit.numerator.length === 0 && unit.denominator.length === 0) {\n unit = other.unit.clone();\n if (this.unit.backupUnit) {\n unit.backupUnit = this.unit.backupUnit;\n }\n } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {\n // do nothing\n } else {\n other = other.convertTo(this.unit.usedUnits());\n\n if (context.strictUnits && other.unit.toString() !== unit.toString()) {\n throw new Error(`Incompatible units. Change the units or use the unit function. ` + \n `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`);\n }\n\n value = this._operate(context, op, this.value, other.value);\n }\n } else if (op === '*') {\n unit.numerator = unit.numerator.concat(other.unit.numerator).sort();\n unit.denominator = unit.denominator.concat(other.unit.denominator).sort();\n unit.cancel();\n } else if (op === '/') {\n unit.numerator = unit.numerator.concat(other.unit.denominator).sort();\n unit.denominator = unit.denominator.concat(other.unit.numerator).sort();\n unit.cancel();\n }\n return new Dimension(value, unit);\n }\n\n compare(other) {\n let a;\n let b;\n\n if (!(other instanceof Dimension)) {\n return undefined;\n }\n\n if (this.unit.isEmpty() || other.unit.isEmpty()) {\n a = this;\n b = other;\n } else {\n a = this.unify();\n b = other.unify();\n if (a.unit.compare(b.unit) !== 0) {\n return undefined;\n }\n }\n\n return Node.numericCompare(a.value, b.value);\n }\n\n unify() {\n return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });\n }\n\n convertTo(conversions) {\n let value = this.value;\n const unit = this.unit.clone();\n let i;\n let groupName;\n let group;\n let targetUnit;\n let derivedConversions = {};\n let applyUnit;\n\n if (typeof conversions === 'string') {\n for (i in unitConversions) {\n if (unitConversions[i].hasOwnProperty(conversions)) {\n derivedConversions = {};\n derivedConversions[i] = conversions;\n }\n }\n conversions = derivedConversions;\n }\n applyUnit = (atomicUnit, denominator) => {\n /* jshint loopfunc:true */\n if (group.hasOwnProperty(atomicUnit)) {\n if (denominator) {\n value = value / (group[atomicUnit] / group[targetUnit]);\n } else {\n value = value * (group[atomicUnit] / group[targetUnit]);\n }\n\n return targetUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in conversions) {\n if (conversions.hasOwnProperty(groupName)) {\n targetUnit = conversions[groupName];\n group = unitConversions[groupName];\n\n unit.map(applyUnit);\n }\n }\n\n unit.cancel();\n\n return new Dimension(value, unit);\n }\n}\n\nDimension.prototype.type = 'Dimension';\nexport default Dimension;\n","import Node from './node';\nimport Color from './color';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nclass Operation extends Node {\n constructor(op, operands, isSpaced) {\n super();\n\n this.op = op.trim();\n this.operands = operands;\n this.isSpaced = isSpaced;\n }\n\n accept(visitor) {\n this.operands = visitor.visitArray(this.operands);\n }\n\n eval(context) {\n let a = this.operands[0].eval(context);\n let b = this.operands[1].eval(context);\n let op;\n\n if (context.isMathOn(this.op)) {\n op = this.op === './' ? '/' : this.op;\n if (a instanceof Dimension && b instanceof Color) {\n a = a.toColor();\n }\n if (b instanceof Dimension && a instanceof Color) {\n b = b.toColor();\n }\n if (!a.operate) {\n if (a instanceof Operation && a.op === '/' && context.math === MATH.PARENS_DIVISION) {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n throw { type: 'Operation',\n message: 'Operation on an invalid type' };\n }\n\n return a.operate(context, op, b);\n } else {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n }\n\n genCSS(context, output) {\n this.operands[0].genCSS(context, output);\n if (this.isSpaced) {\n output.add(' ');\n }\n output.add(this.op);\n if (this.isSpaced) {\n output.add(' ');\n }\n this.operands[1].genCSS(context, output);\n }\n}\n\nOperation.prototype.type = 'Operation';\nexport default Operation;\n","import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nclass Expression extends Node {\n constructor(value, noSpacing) {\n super();\n\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n }\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n }\n\n eval(context) {\n let returnValue;\n const mathOn = context.isMathOn();\n\n const inParenthesis = this.parens && \n (context.math !== MATH.STRICT_LEGACY || !this.parensInOp);\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(e => {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen \n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n return returnValue;\n }\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n output.add(' ');\n }\n }\n }\n\n throwAwayComments() {\n this.value = this.value.filter(v => !(v instanceof Comment));\n }\n}\n\nExpression.prototype.type = 'Expression';\nexport default Expression;\n","import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n if (Array.isArray(args)) {\n args = args.filter(item => {\n if (item.type === 'Comment') {\n return false;\n }\n return true;\n })\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(item => {\n if (item.type === 'Comment') {\n return false;\n }\n return true;\n });\n if (subNodes.length === 1) {\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n","import Node from './node';\nimport Anonymous from './anonymous';\nimport FunctionCaller from '../functions/function-caller';\n\n//\n// A function call node.\n//\nclass Call extends Node {\n constructor(name, args, index, currentFileInfo) {\n super();\n\n this.name = name;\n this.args = args;\n this.calc = name === 'calc';\n this._index = index;\n this._fileInfo = currentFileInfo;\n }\n\n accept(visitor) {\n if (this.args) {\n this.args = visitor.visitArray(this.args);\n }\n }\n\n //\n // When evaluating a function call,\n // we either find the function in the functionRegistry,\n // in which case we call it, passing the evaluated arguments,\n // if this returns null or we cannot find the function, we\n // simply print it out as it appeared originally [2].\n //\n // The reason why we evaluate the arguments, is in the case where\n // we try to pass a variable to a function, like: `saturate(@color)`.\n // The function should receive the value, not the variable.\n //\n eval(context) {\n /**\n * Turn off math for calc(), and switch back on for evaluating nested functions\n */\n const currentMathContext = context.mathOn;\n context.mathOn = !this.calc;\n if (this.calc || context.inCalc) {\n context.enterCalc();\n }\n const args = this.args.map(a => a.eval(context));\n if (this.calc || context.inCalc) {\n context.exitCalc();\n }\n context.mathOn = currentMathContext;\n\n let result;\n const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo());\n\n if (funcCaller.isValid()) {\n try {\n result = funcCaller.call(args);\n } catch (e) {\n throw { \n type: e.type || 'Runtime',\n message: `error evaluating function \\`${this.name}\\`${e.message ? `: ${e.message}` : ''}`,\n index: this.getIndex(), \n filename: this.fileInfo().filename,\n line: e.lineNumber,\n column: e.columnNumber\n };\n }\n\n if (result !== null && result !== undefined) {\n // Results that that are not nodes are cast as Anonymous nodes\n // Falsy values or booleans are returned as empty nodes\n if (!(result instanceof Node)) {\n if (!result || result === true) {\n result = new Anonymous(null); \n }\n else {\n result = new Anonymous(result.toString()); \n }\n \n }\n result._index = this._index;\n result._fileInfo = this._fileInfo;\n return result;\n }\n\n }\n\n return new Call(this.name, args, this.getIndex(), this.fileInfo());\n }\n\n genCSS(context, output) {\n output.add(`${this.name}(`, this.fileInfo(), this.getIndex());\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i].genCSS(context, output);\n if (i + 1 < this.args.length) {\n output.add(', ');\n }\n }\n\n output.add(')');\n }\n}\n\nCall.prototype.type = 'Call';\nexport default Call;\n","import Node from './node';\nimport Call from './call';\n\nclass Variable extends Node {\n constructor(name, index, currentFileInfo) {\n super();\n\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n }\n\n eval(context) {\n let variable;\n let name = this.name;\n\n if (name.indexOf('@@') === 0) {\n name = `@${new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value}`;\n }\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive variable definition for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n variable = this.find(context.frames, frame => {\n const v = frame.variable(name);\n if (v) {\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n // If in calc, wrap vars in a function call to cascade evaluate args first\n if (context.inCalc) {\n return (new Call('_SELF', [v.value])).eval(context);\n }\n else {\n return v.value.eval(context);\n }\n }\n });\n if (variable) {\n this.evaluating = false;\n return variable;\n } else {\n throw { type: 'Name',\n message: `variable ${name} is undefined`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n}\n\nVariable.prototype.type = 'Variable';\nexport default Variable;\n","import Node from './node';\nimport Declaration from './declaration';\n\nclass Property extends Node {\n constructor(name, index, currentFileInfo) {\n super();\n\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n }\n\n eval(context) {\n let property;\n const name = this.name;\n // TODO: shorten this reference\n const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive property reference for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n property = this.find(context.frames, frame => {\n let v;\n const vArr = frame.property(name);\n if (vArr) {\n for (let i = 0; i < vArr.length; i++) {\n v = vArr[i];\n\n vArr[i] = new Declaration(v.name,\n v.value,\n v.important,\n v.merge,\n v.index,\n v.currentFileInfo,\n v.inline,\n v.variable\n );\n }\n mergeRules(vArr);\n\n v = vArr[vArr.length - 1];\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n v = v.value.eval(context);\n return v;\n }\n });\n if (property) {\n this.evaluating = false;\n return property;\n } else {\n throw { type: 'Name',\n message: `Property '${name}' is undefined`,\n filename: this.currentFileInfo.filename,\n index: this.index };\n }\n }\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n}\n\nProperty.prototype.type = 'Property';\nexport default Property;\n","import Node from './node';\n\nclass Attribute extends Node {\n constructor(key, op, value) {\n super();\n\n this.key = key;\n this.op = op;\n this.value = value;\n }\n\n eval(context) {\n return new Attribute(this.key.eval ? this.key.eval(context) : this.key,\n this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value);\n }\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n }\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n return `[${value}]`;\n }\n}\n\nAttribute.prototype.type = 'Attribute';\nexport default Attribute;\n","import Node from './node';\nimport Variable from './variable';\nimport Property from './property';\n\n\nclass Quoted extends Node {\n constructor(str, content, escaped, index, currentFileInfo) {\n super();\n\n this.escaped = (escaped == null) ? true : escaped;\n this.value = content || '';\n this.quote = str.charAt(0);\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.variableRegex = /@\\{([\\w-]+)\\}/g;\n this.propRegex = /\\$\\{([\\w-]+)\\}/g;\n this.allowRoot = escaped;\n }\n\n genCSS(context, output) {\n if (!this.escaped) {\n output.add(this.quote, this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n if (!this.escaped) {\n output.add(this.quote);\n }\n }\n\n containsVariables() {\n return this.value.match(this.variableRegex);\n }\n\n eval(context) {\n const that = this;\n let value = this.value;\n const variableReplacement = (_, name) => {\n const v = new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n const propertyReplacement = (_, name) => {\n const v = new Property(`$${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n function iterativeReplace(value, regexp, replacementFnc) {\n let evaluatedValue = value;\n do {\n value = evaluatedValue.toString();\n evaluatedValue = value.replace(regexp, replacementFnc);\n } while (value !== evaluatedValue);\n return evaluatedValue;\n }\n value = iterativeReplace(value, this.variableRegex, variableReplacement);\n value = iterativeReplace(value, this.propRegex, propertyReplacement);\n\n return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());\n }\n\n compare(other) {\n // when comparing quoted strings allow the quote to differ\n if (other.type === 'Quoted' && !this.escaped && !other.escaped) {\n return Node.numericCompare(this.value, other.value);\n } else {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n }\n}\n\nQuoted.prototype.type = 'Quoted';\nexport default Quoted;\n","import Node from './node';\n\nclass URL extends Node {\n constructor(val, index, currentFileInfo, isEvald) {\n super();\n\n this.value = val;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.isEvald = isEvald;\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n genCSS(context, output) {\n output.add('url(');\n this.value.genCSS(context, output);\n output.add(')');\n }\n\n eval(context) {\n const val = this.value.eval(context);\n let rootpath;\n\n if (!this.isEvald) {\n // Add the rootpath if the URL requires a rewrite\n rootpath = this.fileInfo() && this.fileInfo().rootpath;\n if (typeof rootpath === 'string' &&\n typeof val.value === 'string' &&\n context.pathRequiresRewrite(val.value)) {\n if (!val.quote) {\n rootpath = escapePath(rootpath);\n }\n val.value = context.rewritePath(val.value, rootpath);\n } else {\n val.value = context.normalizePath(val.value);\n }\n\n // Add url args if enabled\n if (context.urlArgs) {\n if (!val.value.match(/^\\s*data:/)) {\n const delimiter = val.value.indexOf('?') === -1 ? '?' : '&';\n const urlArgs = delimiter + context.urlArgs;\n if (val.value.indexOf('#') !== -1) {\n val.value = val.value.replace('#', `${urlArgs}#`);\n } else {\n val.value += urlArgs;\n }\n }\n }\n }\n\n return new URL(val, this.getIndex(), this.fileInfo(), true);\n }\n}\n\nURL.prototype.type = 'Url';\n\nfunction escapePath(path) {\n return path.replace(/[\\(\\)'\"\\s]/g, match => `\\\\${match}`);\n}\n\nexport default URL;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport Anonymous from './anonymous';\nimport Expression from './expression';\nimport AtRule from './atrule';\nimport * as utils from '../utils';\n\nclass Media extends AtRule {\n constructor(value, features, index, currentFileInfo, visibilityInfo) {\n super();\n\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n }\n\n isRulesetLike() {\n return true;\n }\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n if (this.rules) {\n this.rules = visitor.visitArray(this.rules);\n }\n }\n\n genCSS(context, output) {\n output.add('@media ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n }\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n\n evalTop(context) {\n let result = this;\n\n // Render all dependent Media blocks.\n if (context.mediaBlocks.length > 1) {\n const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();\n result = new Ruleset(selectors, context.mediaBlocks);\n result.multiMedia = true;\n result.copyVisibilityInfo(this.visibilityInfo());\n this.setParent(result, this);\n }\n\n delete context.mediaBlocks;\n delete context.mediaPath;\n\n return result;\n }\n\n evalNested(context) {\n let i;\n let value;\n const path = context.mediaPath.concat([this]);\n\n // Extract the media-query conditions separated with `,` (OR).\n for (i = 0; i < path.length; i++) {\n value = path[i].features instanceof Value ?\n path[i].features.value : path[i].features;\n path[i] = Array.isArray(value) ? value : [value];\n }\n\n // Trace all permutations to generate the resulting media-query.\n //\n // (a, b and c) with nested (d, e) ->\n // a and d\n // a and e\n // b and c and d\n // b and c and e\n this.features = new Value(this.permute(path).map(path => {\n path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment));\n\n for (i = path.length - 1; i > 0; i--) {\n path.splice(i, 0, new Anonymous('and'));\n }\n\n return new Expression(path);\n }));\n this.setParent(this.features, this);\n\n // Fake a tree-node that doesn't output anything.\n return new Ruleset([], []);\n }\n\n permute(arr) {\n if (arr.length === 0) {\n return [];\n } else if (arr.length === 1) {\n return arr[0];\n } else {\n const result = [];\n const rest = this.permute(arr.slice(1));\n for (let i = 0; i < rest.length; i++) {\n for (let j = 0; j < arr[0].length; j++) {\n result.push([arr[0][j]].concat(rest[i]));\n }\n }\n return result;\n }\n }\n\n bubbleSelectors(selectors) {\n if (!selectors) {\n return;\n }\n this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])];\n this.setParent(this.rules, this);\n }\n}\n\nMedia.prototype.type = 'Media';\nexport default Media;\n","import Node from './node';\nimport Media from './media';\nimport URL from './url';\nimport Quoted from './quoted';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport * as utils from '../utils';\nimport LessError from '../less-error';\n\n//\n// CSS @import node\n//\n// The general strategy here is that we don't want to wait\n// for the parsing to be completed, before we start importing\n// the file. That's because in the context of a browser,\n// most of the time will be spent waiting for the server to respond.\n//\n// On creation, we push the import path to our import queue, though\n// `import,push`, we also pass it a callback, which it'll call once\n// the file has been fetched, and parsed.\n//\nclass Import extends Node {\n constructor(path, features, options, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.options = options;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.path = path;\n this.features = features;\n this.allowRoot = true;\n\n if (this.options.less !== undefined || this.options.inline) {\n this.css = !this.options.less || this.options.inline;\n } else {\n const pathValue = this.getPath();\n if (pathValue && /[#\\.\\&\\?]css([\\?;].*)?$/.test(pathValue)) {\n this.css = true;\n }\n }\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.features, this);\n this.setParent(this.path, this);\n }\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n this.path = visitor.visit(this.path);\n if (!this.options.isPlugin && !this.options.inline && this.root) {\n this.root = visitor.visit(this.root);\n }\n }\n\n genCSS(context, output) {\n if (this.css && this.path._fileInfo.reference === undefined) {\n output.add('@import ', this._fileInfo, this._index);\n this.path.genCSS(context, output);\n if (this.features) {\n output.add(' ');\n this.features.genCSS(context, output);\n }\n output.add(';');\n }\n }\n\n getPath() {\n return (this.path instanceof URL) ?\n this.path.value.value : this.path.value;\n }\n\n isVariableImport() {\n let path = this.path;\n if (path instanceof URL) {\n path = path.value;\n }\n if (path instanceof Quoted) {\n return path.containsVariables();\n }\n\n return true;\n }\n\n evalForImport(context) {\n let path = this.path;\n\n if (path instanceof URL) {\n path = path.value;\n }\n\n return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());\n }\n\n evalPath(context) {\n const path = this.path.eval(context);\n const fileInfo = this._fileInfo;\n\n if (!(path instanceof URL)) {\n // Add the rootpath if the URL requires a rewrite\n const pathValue = path.value;\n if (fileInfo &&\n pathValue &&\n context.pathRequiresRewrite(pathValue)) {\n path.value = context.rewritePath(pathValue, fileInfo.rootpath);\n } else {\n path.value = context.normalizePath(path.value);\n }\n }\n\n return path;\n }\n\n eval(context) {\n const result = this.doEval(context);\n if (this.options.reference || this.blocksVisibility()) {\n if (result.length || result.length === 0) {\n result.forEach(node => {\n node.addVisibilityBlock();\n }\n );\n } else {\n result.addVisibilityBlock();\n }\n }\n return result;\n }\n\n doEval(context) {\n let ruleset;\n let registry;\n const features = this.features && this.features.eval(context);\n\n if (this.options.isPlugin) {\n if (this.root && this.root.eval) {\n try {\n this.root.eval(context);\n }\n catch (e) {\n e.message = 'Plugin error during evaluation';\n throw new LessError(e, this.root.imports, this.root.filename);\n }\n }\n registry = context.frames[0] && context.frames[0].functionRegistry;\n if ( registry && this.root && this.root.functions ) {\n registry.addMultiple( this.root.functions );\n }\n\n return [];\n }\n\n if (this.skip) {\n if (typeof this.skip === 'function') {\n this.skip = this.skip();\n }\n if (this.skip) {\n return [];\n }\n }\n if (this.options.inline) {\n const contents = new Anonymous(this.root, 0,\n {\n filename: this.importedFilename,\n reference: this.path._fileInfo && this.path._fileInfo.reference\n }, true, true);\n\n return this.features ? new Media([contents], this.features.value) : [contents];\n } else if (this.css) {\n const newImport = new Import(this.evalPath(context), features, this.options, this._index);\n if (!newImport.css && this.error) {\n throw this.error;\n }\n return newImport;\n } else {\n ruleset = new Ruleset(null, utils.copyArray(this.root.rules));\n ruleset.evalImports(context);\n\n return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;\n }\n }\n}\n\nImport.prototype.type = 'Import';\nexport default Import;\n","import Node from './node';\nimport Variable from './variable';\n\nclass JsEvalNode extends Node {\n evaluateJavaScript(expression, context) {\n let result;\n const that = this;\n const evalContext = {};\n\n if (!context.javascriptEnabled) {\n throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n expression = expression.replace(/@\\{([\\w-]+)\\}/g, (_, name) => that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context)));\n\n try {\n expression = new Function(`return (${expression})`);\n } catch (e) {\n throw { message: `JavaScript evaluation error: ${e.message} from \\`${expression}\\`` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n const variables = context.frames[0].variables();\n for (const k in variables) {\n if (variables.hasOwnProperty(k)) {\n /* jshint loopfunc:true */\n evalContext[k.slice(1)] = {\n value: variables[k].value,\n toJS: function () {\n return this.value.eval(context).toCSS();\n }\n };\n }\n }\n\n try {\n result = expression.call(evalContext);\n } catch (e) {\n throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/[\"]/g, '\\'')}'` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n return result;\n }\n\n jsify(obj) {\n if (Array.isArray(obj.value) && (obj.value.length > 1)) {\n return `[${obj.value.map(v => v.toCSS()).join(', ')}]`;\n } else {\n return obj.toCSS();\n }\n }\n}\n\nexport default JsEvalNode;\n","import JsEvalNode from './js-eval-node';\nimport Dimension from './dimension';\nimport Quoted from './quoted';\nimport Anonymous from './anonymous';\n\nclass JavaScript extends JsEvalNode {\n constructor(string, escaped, index, currentFileInfo) {\n super();\n\n this.escaped = escaped;\n this.expression = string;\n this._index = index;\n this._fileInfo = currentFileInfo;\n }\n\n eval(context) {\n const result = this.evaluateJavaScript(this.expression, context);\n const type = typeof result;\n\n if (type === 'number' && !isNaN(result)) {\n return new Dimension(result);\n } else if (type === 'string') {\n return new Quoted(`\"${result}\"`, result, this.escaped, this._index);\n } else if (Array.isArray(result)) {\n return new Anonymous(result.join(', '));\n } else {\n return new Anonymous(result);\n }\n }\n}\n\nJavaScript.prototype.type = 'JavaScript';\nexport default JavaScript;\n","import Node from './node';\n\nclass Assignment extends Node {\n constructor(key, val) {\n super();\n\n this.key = key;\n this.value = val;\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n }\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n}\n\nAssignment.prototype.type = 'Assignment';\nexport default Assignment;\n","import Node from './node';\n\nclass Condition extends Node {\n constructor(op, l, r, i, negate) {\n super();\n\n this.op = op.trim();\n this.lvalue = l;\n this.rvalue = r;\n this._index = i;\n this.negate = negate;\n }\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.rvalue = visitor.visit(this.rvalue);\n }\n\n eval(context) {\n const result = ((op, a, b) => {\n switch (op) {\n case 'and': return a && b;\n case 'or': return a || b;\n default:\n switch (Node.compare(a, b)) {\n case -1:\n return op === '<' || op === '=<' || op === '<=';\n case 0:\n return op === '=' || op === '>=' || op === '=<' || op === '<=';\n case 1:\n return op === '>' || op === '>=';\n default:\n return false;\n }\n }\n })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));\n\n return this.negate ? !result : result;\n }\n}\n\nCondition.prototype.type = 'Condition';\nexport default Condition;\n","import Node from './node';\n\nclass UnicodeDescriptor extends Node {\n constructor(value) {\n super();\n\n this.value = value;\n }\n}\n\nUnicodeDescriptor.prototype.type = 'UnicodeDescriptor';\n\nexport default UnicodeDescriptor;\n","import Node from './node';\nimport Operation from './operation';\nimport Dimension from './dimension';\n\nclass Negative extends Node {\n constructor(node) {\n super();\n\n this.value = node;\n }\n\n genCSS(context, output) {\n output.add('-');\n this.value.genCSS(context, output);\n }\n\n eval(context) {\n if (context.isMathOn()) {\n return (new Operation('*', [new Dimension(-1), this.value])).eval(context);\n }\n return new Negative(this.value.eval(context));\n }\n}\n\nNegative.prototype.type = 'Negative';\nexport default Negative;\n","import Node from './node';\nimport Selector from './selector';\n\nclass Extend extends Node {\n constructor(selector, option, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n }\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n }\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n }\n\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n }\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [];\n let i;\n let selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n}\n\nExtend.next_id = 0;\n\nExtend.prototype.type = 'Extend';\nexport default Extend;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport DetachedRuleset from './detached-ruleset';\nimport LessError from '../less-error';\n\nclass VariableCall extends Node {\n constructor(variable, index, currentFileInfo) {\n super();\n\n this.variable = variable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n }\n\n eval(context) {\n let rules;\n let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);\n const error = new LessError({message: `Could not evaluate variable call ${this.variable}`});\n\n if (!detachedRuleset.ruleset) {\n if (detachedRuleset.rules) {\n rules = detachedRuleset;\n }\n else if (Array.isArray(detachedRuleset)) {\n rules = new Ruleset('', detachedRuleset);\n }\n else if (Array.isArray(detachedRuleset.value)) {\n rules = new Ruleset('', detachedRuleset.value);\n }\n else {\n throw error;\n }\n detachedRuleset = new DetachedRuleset(rules);\n }\n\n if (detachedRuleset.ruleset) {\n return detachedRuleset.callEval(context);\n }\n throw error;\n }\n}\n\nVariableCall.prototype.type = 'VariableCall';\nexport default VariableCall;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport Selector from './selector';\n\nclass NamespaceValue extends Node {\n constructor(ruleCall, lookups, index, fileInfo) {\n super();\n\n this.value = ruleCall;\n this.lookups = lookups;\n this._index = index;\n this._fileInfo = fileInfo;\n }\n\n eval(context) {\n let i;\n let j;\n let name;\n let rules = this.value.eval(context);\n\n for (i = 0; i < this.lookups.length; i++) {\n name = this.lookups[i];\n\n /**\n * Eval'd DRs return rulesets.\n * Eval'd mixins return rules, so let's make a ruleset if we need it.\n * We need to do this because of late parsing of values\n */\n if (Array.isArray(rules)) {\n rules = new Ruleset([new Selector()], rules);\n }\n\n if (name === '') {\n rules = rules.lastDeclaration();\n }\n else if (name.charAt(0) === '@') {\n if (name.charAt(1) === '@') {\n name = `@${new Variable(name.substr(1)).eval(context).value}`;\n }\n if (rules.variables) {\n rules = rules.variable(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `variable ${name} not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n else {\n if (name.substring(0, 2) === '$@') {\n name = `$${new Variable(name.substr(1)).eval(context).value}`;\n }\n else {\n name = name.charAt(0) === '$' ? name : `$${name}`;\n }\n if (rules.properties) {\n rules = rules.property(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `property \"${name.substr(1)}\" not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n // Properties are an array of values, since a ruleset can have multiple props.\n // We pick the last one (the \"cascaded\" value)\n rules = rules[rules.length - 1];\n }\n\n if (rules.value) {\n rules = rules.eval(context).value;\n }\n if (rules.ruleset) {\n rules = rules.ruleset.eval(context);\n }\n }\n return rules;\n }\n}\n\nNamespaceValue.prototype.type = 'NamespaceValue';\nexport default NamespaceValue;\n","import Selector from './selector';\nimport Element from './element';\nimport Ruleset from './ruleset';\nimport Declaration from './declaration';\nimport DetachedRuleset from './detached-ruleset';\nimport Expression from './expression';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nclass Definition extends Ruleset {\n constructor(name, params, rules, condition, variadic, frames, visibilityInfo) {\n super();\n\n this.name = name || 'anonymous mixin';\n this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];\n this.params = params;\n this.condition = condition;\n this.variadic = variadic;\n this.arity = params.length;\n this.rules = rules;\n this._lookups = {};\n const optionalParameters = [];\n this.required = params.reduce((count, p) => {\n if (!p.name || (p.name && !p.value)) {\n return count + 1;\n }\n else {\n optionalParameters.push(p.name);\n return count;\n }\n }, 0);\n this.optionalParameters = optionalParameters;\n this.frames = frames;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n }\n\n accept(visitor) {\n if (this.params && this.params.length) {\n this.params = visitor.visitArray(this.params);\n }\n this.rules = visitor.visitArray(this.rules);\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n }\n\n evalParams(context, mixinEnv, args, evaldArguments) {\n /* jshint boss:true */\n const frame = new Ruleset(null, null);\n\n let varargs;\n let arg;\n const params = utils.copyArray(this.params);\n let i;\n let j;\n let val;\n let name;\n let isNamedFound;\n let argIndex;\n let argsLength = 0;\n\n if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {\n frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();\n }\n mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));\n\n if (args) {\n args = utils.copyArray(args);\n argsLength = args.length;\n\n for (i = 0; i < argsLength; i++) {\n arg = args[i];\n if (name = (arg && arg.name)) {\n isNamedFound = false;\n for (j = 0; j < params.length; j++) {\n if (!evaldArguments[j] && name === params[j].name) {\n evaldArguments[j] = arg.value.eval(context);\n frame.prependRule(new Declaration(name, arg.value.eval(context)));\n isNamedFound = true;\n break;\n }\n }\n if (isNamedFound) {\n args.splice(i, 1);\n i--;\n continue;\n } else {\n throw { type: 'Runtime', message: `Named argument for ${this.name} ${args[i].name} not found` };\n }\n }\n }\n }\n argIndex = 0;\n for (i = 0; i < params.length; i++) {\n if (evaldArguments[i]) { continue; }\n\n arg = args && args[argIndex];\n\n if (name = params[i].name) {\n if (params[i].variadic) {\n varargs = [];\n for (j = argIndex; j < argsLength; j++) {\n varargs.push(args[j].value.eval(context));\n }\n frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));\n } else {\n val = arg && arg.value;\n if (val) {\n // This was a mixin call, pass in a detached ruleset of it's eval'd rules\n if (Array.isArray(val)) {\n val = new DetachedRuleset(new Ruleset('', val));\n }\n else {\n val = val.eval(context);\n }\n } else if (params[i].value) {\n val = params[i].value.eval(mixinEnv);\n frame.resetCache();\n } else {\n throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` };\n }\n\n frame.prependRule(new Declaration(name, val));\n evaldArguments[i] = val;\n }\n }\n\n if (params[i].variadic && args) {\n for (j = argIndex; j < argsLength; j++) {\n evaldArguments[j] = args[j].value.eval(context);\n }\n }\n argIndex++;\n }\n\n return frame;\n }\n\n makeImportant() {\n const rules = !this.rules ? this.rules : this.rules.map(r => {\n if (r.makeImportant) {\n return r.makeImportant(true);\n } else {\n return r;\n }\n });\n const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);\n return result;\n }\n\n eval(context) {\n return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames));\n }\n\n evalCall(context, args, important) {\n const _arguments = [];\n const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;\n const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);\n let rules;\n let ruleset;\n\n frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));\n\n rules = utils.copyArray(this.rules);\n\n ruleset = new Ruleset(null, rules);\n ruleset.originalRuleset = this;\n ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));\n if (important) {\n ruleset = ruleset.makeImportant();\n }\n return ruleset;\n }\n\n matchCondition(args, context) {\n if (this.condition && !this.condition.eval(\n new contexts.Eval(context,\n [this.evalParams(context, /* the parameter variables */\n new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]\n .concat(this.frames || []) // the parent namespace/mixin frames\n .concat(context.frames)))) { // the current environment frames\n return false;\n }\n return true;\n }\n\n matchArgs(args, context) {\n const allArgsCnt = (args && args.length) || 0;\n let len;\n const optionalParameters = this.optionalParameters;\n const requiredArgsCnt = !args ? 0 : args.reduce((count, p) => {\n if (optionalParameters.indexOf(p.name) < 0) {\n return count + 1;\n } else {\n return count;\n }\n }, 0);\n\n if (!this.variadic) {\n if (requiredArgsCnt < this.required) {\n return false;\n }\n if (allArgsCnt > this.params.length) {\n return false;\n }\n } else {\n if (requiredArgsCnt < (this.required - 1)) {\n return false;\n }\n }\n\n // check patterns\n len = Math.min(requiredArgsCnt, this.arity);\n\n for (let i = 0; i < len; i++) {\n if (!this.params[i].name && !this.params[i].variadic) {\n if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {\n return false;\n }\n }\n }\n return true;\n }\n}\n\nDefinition.prototype.type = 'MixinDefinition';\nDefinition.prototype.evalFirst = true;\nexport default Definition;\n","import Node from './node';\nimport Selector from './selector';\nimport MixinDefinition from './mixin-definition';\nimport defaultFunc from '../functions/default';\n\nclass MixinCall extends Node {\n constructor(elements, args, index, currentFileInfo, important) {\n super();\n\n this.selector = new Selector(elements);\n this.arguments = args || [];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.important = important;\n this.allowRoot = true;\n this.setParent(this.selector, this);\n }\n\n accept(visitor) {\n if (this.selector) {\n this.selector = visitor.visit(this.selector);\n }\n if (this.arguments.length) {\n this.arguments = visitor.visitArray(this.arguments);\n }\n }\n\n eval(context) {\n let mixins;\n let mixin;\n let mixinPath;\n const args = [];\n let arg;\n let argValue;\n const rules = [];\n let match = false;\n let i;\n let m;\n let f;\n let isRecursive;\n let isOneFound;\n const candidates = [];\n let candidate;\n const conditionResult = [];\n let defaultResult;\n const defFalseEitherCase = -1;\n const defNone = 0;\n const defTrue = 1;\n const defFalse = 2;\n let count;\n let originalRuleset;\n let noArgumentsFilter;\n\n this.selector = this.selector.eval(context);\n\n function calcDefGroup(mixin, mixinPath) {\n let f;\n let p;\n let namespace;\n\n for (f = 0; f < 2; f++) {\n conditionResult[f] = true;\n defaultFunc.value(f);\n for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {\n namespace = mixinPath[p];\n if (namespace.matchCondition) {\n conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);\n }\n }\n if (mixin.matchCondition) {\n conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);\n }\n }\n if (conditionResult[0] || conditionResult[1]) {\n if (conditionResult[0] != conditionResult[1]) {\n return conditionResult[1] ?\n defTrue : defFalse;\n }\n\n return defNone;\n }\n return defFalseEitherCase;\n }\n\n for (i = 0; i < this.arguments.length; i++) {\n arg = this.arguments[i];\n argValue = arg.value.eval(context);\n if (arg.expand && Array.isArray(argValue.value)) {\n argValue = argValue.value;\n for (m = 0; m < argValue.length; m++) {\n args.push({value: argValue[m]});\n }\n } else {\n args.push({name: arg.name, value: argValue});\n }\n }\n\n noArgumentsFilter = rule => rule.matchArgs(null, context);\n\n for (i = 0; i < context.frames.length; i++) {\n if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {\n isOneFound = true;\n\n // To make `default()` function independent of definition order we have two \"subpasses\" here.\n // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),\n // and build candidate list with corresponding flags. Then, when we know all possible matches,\n // we make a final decision.\n\n for (m = 0; m < mixins.length; m++) {\n mixin = mixins[m].rule;\n mixinPath = mixins[m].path;\n isRecursive = false;\n for (f = 0; f < context.frames.length; f++) {\n if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {\n isRecursive = true;\n break;\n }\n }\n if (isRecursive) {\n continue;\n }\n\n if (mixin.matchArgs(args, context)) {\n candidate = {mixin, group: calcDefGroup(mixin, mixinPath)};\n\n if (candidate.group !== defFalseEitherCase) {\n candidates.push(candidate);\n }\n\n match = true;\n }\n }\n\n defaultFunc.reset();\n\n count = [0, 0, 0];\n for (m = 0; m < candidates.length; m++) {\n count[candidates[m].group]++;\n }\n\n if (count[defNone] > 0) {\n defaultResult = defFalse;\n } else {\n defaultResult = defTrue;\n if ((count[defTrue] + count[defFalse]) > 1) {\n throw { type: 'Runtime',\n message: `Ambiguous use of \\`default()\\` found when matching for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n for (m = 0; m < candidates.length; m++) {\n candidate = candidates[m].group;\n if ((candidate === defNone) || (candidate === defaultResult)) {\n try {\n mixin = candidates[m].mixin;\n if (!(mixin instanceof MixinDefinition)) {\n originalRuleset = mixin.originalRuleset || mixin;\n mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());\n mixin.originalRuleset = originalRuleset;\n }\n const newRules = mixin.evalCall(context, args, this.important).rules;\n this._setVisibilityToReplacement(newRules);\n Array.prototype.push.apply(rules, newRules);\n } catch (e) {\n throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };\n }\n }\n }\n\n if (match) {\n return rules;\n }\n }\n }\n if (isOneFound) {\n throw { type: 'Runtime',\n message: `No matching definition was found for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n } else {\n throw { type: 'Name',\n message: `${this.selector.toCSS().trim()} is undefined`,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n _setVisibilityToReplacement(replacement) {\n let i;\n let rule;\n if (this.blocksVisibility()) {\n for (i = 0; i < replacement.length; i++) {\n rule = replacement[i];\n rule.addVisibilityBlock();\n }\n }\n }\n\n format(args) {\n return `${this.selector.toCSS().trim()}(${args ? args.map(a => {\n let argValue = '';\n if (a.name) {\n argValue += `${a.name}:`;\n }\n if (a.value.toCSS) {\n argValue += a.value.toCSS();\n } else {\n argValue += '???';\n }\n return argValue;\n }).join(', ') : ''})`;\n }\n}\n\nMixinCall.prototype.type = 'MixinCall';\nexport default MixinCall;\n","const tree = Object.create(null);\n\nimport Node from './node';\nimport Color from './color';\nimport AtRule from './atrule';\nimport DetachedRuleset from './detached-ruleset';\nimport Operation from './operation';\nimport Dimension from './dimension';\nimport Unit from './unit';\nimport Keyword from './keyword';\nimport Variable from './variable';\nimport Property from './property';\nimport Ruleset from './ruleset';\nimport Element from './element';\nimport Attribute from './attribute';\nimport Combinator from './combinator';\nimport Selector from './selector';\nimport Quoted from './quoted';\nimport Expression from './expression';\nimport Declaration from './declaration';\nimport Call from './call';\nimport URL from './url';\nimport Import from './import';\nimport Comment from './comment';\nimport Anonymous from './anonymous';\nimport Value from './value';\nimport JavaScript from './javascript';\nimport Assignment from './assignment';\nimport Condition from './condition';\nimport Paren from './paren';\nimport Media from './media';\nimport UnicodeDescriptor from './unicode-descriptor';\nimport Negative from './negative';\nimport Extend from './extend';\nimport VariableCall from './variable-call';\nimport NamespaceValue from './namespace-value';\n\n// mixins\nimport MixinCall from './mixin-call';\nimport MixinDefinition from './mixin-definition';\n\nexport default {\n Node, Color, AtRule, DetachedRuleset, Operation,\n Dimension, Unit, Keyword, Variable, Property,\n Ruleset, Element, Attribute, Combinator, Selector,\n Quoted, Expression, Declaration, Call, URL, Import,\n Comment, Anonymous, Value, JavaScript, Assignment,\n Condition, Paren, Media, UnicodeDescriptor, Negative,\n Extend, VariableCall, NamespaceValue,\n mixin: {\n Call: MixinCall,\n Definition: MixinDefinition\n }\n};","export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n","/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory == null) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default environment;\n","class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([\\?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n };\n\n supportsSync() { return false; }\n\n alwaysMakePathsAbsolute() { return false; }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n };\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n const urlParts = this.extractUrlParts(url);\n const baseUrlParts = this.extractUrlParts(baseUrl);\n\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n };\n // helper function, not part of API\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^\\/\\?#]*\\/)|([\\/\\\\]))?((?:[^\\/\\\\\\?#]*[\\/\\\\])*)([^\\/\\\\\\?#]*)([#\\?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n };\n}\n\nexport default AbstractFileManager;","import functionRegistry from '../functions/function-registry';\nimport LessError from '../less-error';\n\nclass AbstractPluginLoader {\n constructor() {\n // Implemented by Node.js plugin loader\n this.require = () => null\n }\n\n evalPlugin(contents, context, imports, pluginOptions, fileInfo) {\n let loader;\n let registry;\n let pluginObj;\n let localModule;\n let pluginManager;\n let filename;\n let result;\n\n pluginManager = context.pluginManager;\n\n if (fileInfo) {\n if (typeof fileInfo === 'string') {\n filename = fileInfo;\n }\n else {\n filename = fileInfo.filename;\n }\n }\n const shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;\n\n if (filename) {\n pluginObj = pluginManager.get(filename);\n\n if (pluginObj) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n return pluginObj;\n }\n }\n localModule = {\n exports: {},\n pluginManager,\n fileInfo\n };\n registry = functionRegistry.create();\n\n const registerPlugin = obj => {\n pluginObj = obj;\n };\n\n try {\n loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);\n loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);\n }\n catch (e) {\n return new LessError(e, imports, filename);\n }\n\n if (!pluginObj) {\n pluginObj = localModule.exports;\n }\n pluginObj = this.validatePlugin(pluginObj, filename, shortname);\n\n if (pluginObj instanceof LessError) {\n return pluginObj;\n }\n\n if (pluginObj) {\n pluginObj.imports = imports;\n pluginObj.filename = filename;\n\n // For < 3.x (or unspecified minVersion) - setOptions() before install()\n if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n\n if (result) {\n return result;\n }\n }\n\n // Run on first load\n pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);\n pluginObj.functions = registry.getLocalFunctions();\n\n // Need to call setOptions again because the pluginObj might have functions\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n\n // Run every @plugin call\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n\n }\n else {\n return new LessError({ message: 'Not a valid plugin' }, imports, filename);\n }\n\n return pluginObj;\n }\n\n trySetOptions(plugin, filename, name, options) {\n if (options && !plugin.setOptions) {\n return new LessError({\n message: `Options have been provided but the plugin ${name} does not support any options.`\n });\n }\n try {\n plugin.setOptions && plugin.setOptions(options);\n }\n catch (e) {\n return new LessError(e);\n }\n }\n\n validatePlugin(plugin, filename, name) {\n if (plugin) {\n // support plugins being a function\n // so that the plugin can be more usable programmatically\n if (typeof plugin === 'function') {\n plugin = new plugin();\n }\n\n if (plugin.minVersion) {\n if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {\n return new LessError({\n message: `Plugin ${name} requires version ${this.versionToString(plugin.minVersion)}`\n });\n }\n }\n return plugin;\n }\n return null;\n }\n\n compareVersion(aVersion, bVersion) {\n if (typeof aVersion === 'string') {\n aVersion = aVersion.match(/^(\\d+)\\.?(\\d+)?\\.?(\\d+)?/);\n aVersion.shift();\n }\n for (let i = 0; i < aVersion.length; i++) {\n if (aVersion[i] !== bVersion[i]) {\n return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;\n }\n }\n return 0;\n }\n\n versionToString(version) {\n let versionString = '';\n for (let i = 0; i < version.length; i++) {\n versionString += (versionString ? '.' : '') + version[i];\n }\n return versionString;\n }\n\n printUsage(plugins) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.printUsage) {\n plugin.printUsage();\n }\n }\n }\n}\n\nexport default AbstractPluginLoader;\n\n","import tree from '../tree';\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n // add .typeIndex to tree node types for lookup table\n let key;\n\n let child;\n for (key in parent) { \n /* eslint guard-for-in: 0 */\n child = parent[key];\n switch (typeof child) {\n case 'function':\n // ignore bound functions directly on tree which do not have a prototype\n // or aren't nodes\n if (child.prototype && child.prototype.type) {\n child.prototype.typeIndex = ticker++;\n }\n break;\n case 'object':\n ticker = indexNodeTypes(child, ticker);\n break;\n \n }\n }\n return ticker;\n}\n\nclass Visitor {\n constructor(implementation) {\n this._implementation = implementation;\n this._visitInCache = {};\n this._visitOutCache = {};\n\n if (!_hasIndexed) {\n indexNodeTypes(tree, 1);\n _hasIndexed = true;\n }\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n\n const nodeTypeIndex = node.typeIndex;\n if (!nodeTypeIndex) {\n // MixinCall args aren't a node type?\n if (node.value && node.value.typeIndex) {\n this.visit(node.value);\n }\n return node;\n }\n\n const impl = this._implementation;\n let func = this._visitInCache[nodeTypeIndex];\n let funcOut = this._visitOutCache[nodeTypeIndex];\n const visitArgs = _visitArgs;\n let fnName;\n\n visitArgs.visitDeeper = true;\n\n if (!func) {\n fnName = `visit${node.type}`;\n func = impl[fnName] || _noop;\n funcOut = impl[`${fnName}Out`] || _noop;\n this._visitInCache[nodeTypeIndex] = func;\n this._visitOutCache[nodeTypeIndex] = funcOut;\n }\n\n if (func !== _noop) {\n const newNode = func.call(impl, node, visitArgs);\n if (node && impl.isReplacing) {\n node = newNode;\n }\n }\n\n if (visitArgs.visitDeeper && node) {\n if (node.length) {\n for (var i = 0, cnt = node.length; i < cnt; i++) {\n if (node[i].accept) {\n node[i].accept(this);\n }\n }\n } else if (node.accept) {\n node.accept(this);\n }\n }\n\n if (funcOut != _noop) {\n funcOut.call(impl, node);\n }\n\n return node;\n }\n\n visitArray(nodes, nonReplacing) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n\n // Non-replacing\n if (nonReplacing || !this._implementation.isReplacing) {\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n // Replacing\n const out = [];\n for (i = 0; i < cnt; i++) {\n const evald = this.visit(nodes[i]);\n if (evald === undefined) { continue; }\n if (!evald.splice) {\n out.push(evald);\n } else if (evald.length) {\n this.flatten(evald, out);\n }\n }\n return out;\n }\n\n flatten(arr, out) {\n if (!out) {\n out = [];\n }\n\n let cnt;\n let i;\n let item;\n let nestedCnt;\n let j;\n let nestedItem;\n\n for (i = 0, cnt = arr.length; i < cnt; i++) {\n item = arr[i];\n if (item === undefined) {\n continue;\n }\n if (!item.splice) {\n out.push(item);\n continue;\n }\n\n for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n nestedItem = item[j];\n if (nestedItem === undefined) {\n continue;\n }\n if (!nestedItem.splice) {\n out.push(nestedItem);\n } else if (nestedItem.length) {\n this.flatten(nestedItem, out);\n }\n }\n }\n\n return out;\n }\n}\n\nexport default Visitor;\n","class ImportSequencer {\n constructor(onSequencerEmpty) {\n this.imports = [];\n this.variableImports = [];\n this._onSequencerEmpty = onSequencerEmpty;\n this._currentDepth = 0;\n }\n\n addImport(callback) {\n const importSequencer = this;\n\n const importItem = {\n callback,\n args: null,\n isReady: false\n };\n\n this.imports.push(importItem);\n return function(...args) {\n importItem.args = Array.prototype.slice.call(args, 0);\n importItem.isReady = true;\n importSequencer.tryRun();\n };\n }\n\n addVariableImport(callback) {\n this.variableImports.push(callback);\n }\n\n tryRun() {\n this._currentDepth++;\n try {\n while (true) {\n while (this.imports.length > 0) {\n const importItem = this.imports[0];\n if (!importItem.isReady) {\n return;\n }\n this.imports = this.imports.slice(1);\n importItem.callback.apply(null, importItem.args);\n }\n if (this.variableImports.length === 0) {\n break;\n }\n const variableImport = this.variableImports[0];\n this.variableImports = this.variableImports.slice(1);\n variableImport();\n }\n } finally {\n this._currentDepth--;\n }\n if (this._currentDepth === 0 && this._onSequencerEmpty) {\n this._onSequencerEmpty();\n }\n }\n}\n\nexport default ImportSequencer;\n","import contexts from '../contexts';\nimport Visitor from './visitor';\nimport ImportSequencer from './import-sequencer';\nimport * as utils from '../utils';\n\nconst ImportVisitor = function(importer, finish) {\n\n this._visitor = new Visitor(this);\n this._importer = importer;\n this._finish = finish;\n this.context = new contexts.Eval();\n this.importCount = 0;\n this.onceFileDetectionMap = {};\n this.recursionDetector = {};\n this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));\n};\n\nImportVisitor.prototype = {\n isReplacing: false,\n run: function (root) {\n try {\n // process the contents\n this._visitor.visit(root);\n }\n catch (e) {\n this.error = e;\n }\n\n this.isFinished = true;\n this._sequencer.tryRun();\n },\n _onSequencerEmpty: function() {\n if (!this.isFinished) {\n return;\n }\n this._finish(this.error);\n },\n visitImport: function (importNode, visitArgs) {\n const inlineCSS = importNode.options.inline;\n\n if (!importNode.css || inlineCSS) {\n\n const context = new contexts.Eval(this.context, utils.copyArray(this.context.frames));\n const importParent = context.frames[0];\n\n this.importCount++;\n if (importNode.isVariableImport()) {\n this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));\n } else {\n this.processImportNode(importNode, context, importParent);\n }\n }\n visitArgs.visitDeeper = false;\n },\n processImportNode: function(importNode, context, importParent) {\n let evaldImportNode;\n const inlineCSS = importNode.options.inline;\n\n try {\n evaldImportNode = importNode.evalForImport(context);\n } catch (e) {\n if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; }\n // attempt to eval properly and treat as css\n importNode.css = true;\n // if that fails, this error will be thrown\n importNode.error = e;\n }\n\n if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {\n if (evaldImportNode.options.multiple) {\n context.importMultiple = true;\n }\n\n // try appending if we haven't determined if it is css or not\n const tryAppendLessExtension = evaldImportNode.css === undefined;\n\n for (let i = 0; i < importParent.rules.length; i++) {\n if (importParent.rules[i] === importNode) {\n importParent.rules[i] = evaldImportNode;\n break;\n }\n }\n\n const onImported = this.onImported.bind(this, evaldImportNode, context);\n const sequencedOnImported = this._sequencer.addImport(onImported);\n\n this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(),\n evaldImportNode.options, sequencedOnImported);\n } else {\n this.importCount--;\n if (this.isFinished) {\n this._sequencer.tryRun();\n }\n }\n },\n onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {\n if (e) {\n if (!e.filename) {\n e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename;\n }\n this.error = e;\n }\n\n const importVisitor = this;\n const inlineCSS = importNode.options.inline;\n const isPlugin = importNode.options.isPlugin;\n const isOptional = importNode.options.optional;\n const duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;\n\n if (!context.importMultiple) {\n if (duplicateImport) {\n importNode.skip = true;\n } else {\n importNode.skip = () => {\n if (fullPath in importVisitor.onceFileDetectionMap) {\n return true;\n }\n importVisitor.onceFileDetectionMap[fullPath] = true;\n return false;\n };\n }\n }\n\n if (!fullPath && isOptional) {\n importNode.skip = true;\n }\n\n if (root) {\n importNode.root = root;\n importNode.importedFilename = fullPath;\n\n if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {\n importVisitor.recursionDetector[fullPath] = true;\n\n const oldContext = this.context;\n this.context = context;\n try {\n this._visitor.visit(root);\n } catch (e) {\n this.error = e;\n }\n this.context = oldContext;\n }\n }\n\n importVisitor.importCount--;\n\n if (importVisitor.isFinished) {\n importVisitor._sequencer.tryRun();\n }\n },\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.unshift(declNode);\n } else {\n visitArgs.visitDeeper = false;\n }\n },\n visitDeclarationOut: function(declNode) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.shift();\n }\n },\n visitAtRule: function (atRuleNode, visitArgs) {\n this.context.frames.unshift(atRuleNode);\n },\n visitAtRuleOut: function (atRuleNode) {\n this.context.frames.shift();\n },\n visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {\n this.context.frames.unshift(mixinDefinitionNode);\n },\n visitMixinDefinitionOut: function (mixinDefinitionNode) {\n this.context.frames.shift();\n },\n visitRuleset: function (rulesetNode, visitArgs) {\n this.context.frames.unshift(rulesetNode);\n },\n visitRulesetOut: function (rulesetNode) {\n this.context.frames.shift();\n },\n visitMedia: function (mediaNode, visitArgs) {\n this.context.frames.unshift(mediaNode.rules[0]);\n },\n visitMediaOut: function (mediaNode) {\n this.context.frames.shift();\n }\n};\nexport default ImportVisitor;\n","class SetTreeVisibilityVisitor {\n constructor(visible) {\n this.visible = visible;\n }\n\n run(root) {\n this.visit(root);\n }\n\n visitArray(nodes) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n if (node.constructor === Array) {\n return this.visitArray(node);\n }\n\n if (!node.blocksVisibility || node.blocksVisibility()) {\n return node;\n }\n if (this.visible) {\n node.ensureVisibility();\n } else {\n node.ensureInvisibility();\n }\n\n node.accept(this);\n return node;\n }\n}\n\nexport default SetTreeVisibilityVisitor;","import tree from '../tree';\nimport Visitor from './visitor';\nimport logger from '../logger';\nimport * as utils from '../utils';\n\n/* jshint loopfunc:true */\n\nclass ExtendFinderVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n this.contexts = [];\n this.allExtendsStack = [[]];\n }\n\n run(root) {\n root = this._visitor.visit(root);\n root.allExtends = this.allExtendsStack[0];\n return root;\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n\n let i;\n let j;\n let extend;\n const allSelectorsExtendList = [];\n let extendList;\n\n // get &:extend(.a); rules which apply to all selectors in this ruleset\n const rules = rulesetNode.rules;\n\n const ruleCnt = rules ? rules.length : 0;\n for (i = 0; i < ruleCnt; i++) {\n if (rulesetNode.rules[i] instanceof tree.Extend) {\n allSelectorsExtendList.push(rules[i]);\n rulesetNode.extendOnEveryPath = true;\n }\n }\n\n // now find every selector and apply the extends that apply to all extends\n // and the ones which apply to an individual extend\n const paths = rulesetNode.paths;\n for (i = 0; i < paths.length; i++) {\n const selectorPath = paths[i];\n const selector = selectorPath[selectorPath.length - 1];\n const selExtendList = selector.extendList;\n\n extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList)\n : allSelectorsExtendList;\n\n if (extendList) {\n extendList = extendList.map(allSelectorsExtend => allSelectorsExtend.clone());\n }\n\n for (j = 0; j < extendList.length; j++) {\n this.foundExtends = true;\n extend = extendList[j];\n extend.findSelfSelectors(selectorPath);\n extend.ruleset = rulesetNode;\n if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }\n this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);\n }\n }\n\n this.contexts.push(rulesetNode.selectors);\n }\n\n visitRulesetOut(rulesetNode) {\n if (!rulesetNode.root) {\n this.contexts.length = this.contexts.length - 1;\n }\n }\n\n visitMedia(mediaNode, visitArgs) {\n mediaNode.allExtends = [];\n this.allExtendsStack.push(mediaNode.allExtends);\n }\n\n visitMediaOut(mediaNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n atRuleNode.allExtends = [];\n this.allExtendsStack.push(atRuleNode.allExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n}\n\nclass ProcessExtendsVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n const extendFinder = new ExtendFinderVisitor();\n this.extendIndices = {};\n extendFinder.run(root);\n if (!extendFinder.foundExtends) { return root; }\n root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));\n this.allExtendsStack = [root.allExtends];\n const newRoot = this._visitor.visit(root);\n this.checkExtendsForNonMatched(root.allExtends);\n return newRoot;\n }\n\n checkExtendsForNonMatched(extendList) {\n const indices = this.extendIndices;\n extendList.filter(extend => !extend.hasFoundMatches && extend.parent_ids.length == 1).forEach(extend => {\n let selector = '_unknown_';\n try {\n selector = extend.selector.toCSS({});\n }\n catch (_) {}\n\n if (!indices[`${extend.index} ${selector}`]) {\n indices[`${extend.index} ${selector}`] = true;\n logger.warn(`extend '${selector}' has no matches`);\n }\n });\n }\n\n doExtendChaining(extendsList, extendsListTarget, iterationCount) {\n //\n // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering\n // and pasting the selector we would do normally, but we are also adding an extend with the same target selector\n // this means this new extend can then go and alter other extends\n //\n // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors\n // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already\n // processed if we look at each selector at a time, as is done in visitRuleset\n\n let extendIndex;\n\n let targetExtendIndex;\n let matches;\n const extendsToAdd = [];\n let newSelector;\n const extendVisitor = this;\n let selectorPath;\n let extend;\n let targetExtend;\n let newExtend;\n\n iterationCount = iterationCount || 0;\n\n // loop through comparing every extend with every target extend.\n // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place\n // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one\n // and the second is the target.\n // the separation into two lists allows us to process a subset of chains with a bigger set, as is the\n // case when processing media queries\n for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {\n for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {\n\n extend = extendsList[extendIndex];\n targetExtend = extendsListTarget[targetExtendIndex];\n\n // look for circular references\n if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; }\n\n // find a match in the target extends self selector (the bit before :extend)\n selectorPath = [targetExtend.selfSelectors[0]];\n matches = extendVisitor.findMatch(extend, selectorPath);\n\n if (matches.length) {\n extend.hasFoundMatches = true;\n\n // we found a match, so for each self selector..\n extend.selfSelectors.forEach(selfSelector => {\n const info = targetExtend.visibilityInfo();\n\n // process the extend as usual\n newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());\n\n // but now we create a new extend from it\n newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);\n newExtend.selfSelectors = newSelector;\n\n // add the extend onto the list of extends for that selector\n newSelector[newSelector.length - 1].extendList = [newExtend];\n\n // record that we need to add it.\n extendsToAdd.push(newExtend);\n newExtend.ruleset = targetExtend.ruleset;\n\n // remember its parents for circular references\n newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);\n\n // only process the selector once.. if we have :extend(.a,.b) then multiple\n // extends will look at the same selector path, so when extending\n // we know that any others will be duplicates in terms of what is added to the css\n if (targetExtend.firstExtendOnThisSelectorPath) {\n newExtend.firstExtendOnThisSelectorPath = true;\n targetExtend.ruleset.paths.push(newSelector);\n }\n });\n }\n }\n }\n\n if (extendsToAdd.length) {\n // try to detect circular references to stop a stack overflow.\n // may no longer be needed.\n this.extendChainCount++;\n if (iterationCount > 100) {\n let selectorOne = '{unable to calculate}';\n let selectorTwo = '{unable to calculate}';\n try {\n selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();\n selectorTwo = extendsToAdd[0].selector.toCSS();\n }\n catch (e) {}\n throw { message: `extend circular reference detected. One of the circular extends is currently:${selectorOne}:extend(${selectorTwo})`};\n }\n\n // now process the new extends on the existing rules so that we can handle a extending b extending c extending\n // d extending e...\n return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));\n } else {\n return extendsToAdd;\n }\n }\n\n visitDeclaration(ruleNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitSelector(selectorNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n let matches;\n let pathIndex;\n let extendIndex;\n const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];\n const selectorsToAdd = [];\n const extendVisitor = this;\n let selectorPath;\n\n // look at each selector path in the ruleset, find any extend matches and then copy, find and replace\n\n for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {\n for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {\n selectorPath = rulesetNode.paths[pathIndex];\n\n // extending extends happens initially, before the main pass\n if (rulesetNode.extendOnEveryPath) { continue; }\n const extendList = selectorPath[selectorPath.length - 1].extendList;\n if (extendList && extendList.length) { continue; }\n\n matches = this.findMatch(allExtends[extendIndex], selectorPath);\n\n if (matches.length) {\n allExtends[extendIndex].hasFoundMatches = true;\n\n allExtends[extendIndex].selfSelectors.forEach(selfSelector => {\n let extendedSelectors;\n extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());\n selectorsToAdd.push(extendedSelectors);\n });\n }\n }\n }\n rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);\n }\n\n findMatch(extend, haystackSelectorPath) {\n //\n // look through the haystack selector path to try and find the needle - extend.selector\n // returns an array of selector matches that can then be replaced\n //\n let haystackSelectorIndex;\n\n let hackstackSelector;\n let hackstackElementIndex;\n let haystackElement;\n let targetCombinator;\n let i;\n const extendVisitor = this;\n const needleElements = extend.selector.elements;\n const potentialMatches = [];\n let potentialMatch;\n const matches = [];\n\n // loop through the haystack elements\n for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {\n hackstackSelector = haystackSelectorPath[haystackSelectorIndex];\n\n for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {\n\n haystackElement = hackstackSelector.elements[hackstackElementIndex];\n\n // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.\n if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {\n potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,\n initialCombinator: haystackElement.combinator});\n }\n\n for (i = 0; i < potentialMatches.length; i++) {\n potentialMatch = potentialMatches[i];\n\n // selectors add \" \" onto the first element. When we use & it joins the selectors together, but if we don't\n // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to\n // work out what the resulting combinator will be\n targetCombinator = haystackElement.combinator.value;\n if (targetCombinator === '' && hackstackElementIndex === 0) {\n targetCombinator = ' ';\n }\n\n // if we don't match, null our match to indicate failure\n if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||\n (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {\n potentialMatch = null;\n } else {\n potentialMatch.matched++;\n }\n\n // if we are still valid and have finished, test whether we have elements after and whether these are allowed\n if (potentialMatch) {\n potentialMatch.finished = potentialMatch.matched === needleElements.length;\n if (potentialMatch.finished &&\n (!extend.allowAfter &&\n (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {\n potentialMatch = null;\n }\n }\n // if null we remove, if not, we are still valid, so either push as a valid match or continue\n if (potentialMatch) {\n if (potentialMatch.finished) {\n potentialMatch.length = needleElements.length;\n potentialMatch.endPathIndex = haystackSelectorIndex;\n potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match\n potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again\n matches.push(potentialMatch);\n }\n } else {\n potentialMatches.splice(i, 1);\n i--;\n }\n }\n }\n }\n return matches;\n }\n\n isElementValuesEqual(elementValue1, elementValue2) {\n if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {\n return elementValue1 === elementValue2;\n }\n if (elementValue1 instanceof tree.Attribute) {\n if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {\n return false;\n }\n if (!elementValue1.value || !elementValue2.value) {\n if (elementValue1.value || elementValue2.value) {\n return false;\n }\n return true;\n }\n elementValue1 = elementValue1.value.value || elementValue1.value;\n elementValue2 = elementValue2.value.value || elementValue2.value;\n return elementValue1 === elementValue2;\n }\n elementValue1 = elementValue1.value;\n elementValue2 = elementValue2.value;\n if (elementValue1 instanceof tree.Selector) {\n if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {\n return false;\n }\n for (let i = 0; i < elementValue1.elements.length; i++) {\n if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {\n if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {\n return false;\n }\n }\n if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n extendSelector(matches, selectorPath, replacementSelector, isVisible) {\n // for a set of matches, replace each match with the replacement selector\n\n let currentSelectorPathIndex = 0;\n\n let currentSelectorPathElementIndex = 0;\n let path = [];\n let matchIndex;\n let selector;\n let firstElement;\n let match;\n let newElements;\n\n for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {\n match = matches[matchIndex];\n selector = selectorPath[match.pathIndex];\n firstElement = new tree.Element(\n match.initialCombinator,\n replacementSelector.elements[0].value,\n replacementSelector.elements[0].isVariable,\n replacementSelector.elements[0].getIndex(),\n replacementSelector.elements[0].fileInfo()\n );\n\n if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n\n newElements = selector.elements\n .slice(currentSelectorPathElementIndex, match.index)\n .concat([firstElement])\n .concat(replacementSelector.elements.slice(1));\n\n if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {\n path[path.length - 1].elements =\n path[path.length - 1].elements.concat(newElements);\n } else {\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));\n\n path.push(new tree.Selector(\n newElements\n ));\n }\n currentSelectorPathIndex = match.endPathIndex;\n currentSelectorPathElementIndex = match.endPathElementIndex;\n if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n }\n\n if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathIndex++;\n }\n\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));\n path = path.map(currentValue => {\n // we can re-use elements here, because the visibility property matters only for selectors\n const derived = currentValue.createDerived(currentValue.elements);\n if (isVisible) {\n derived.ensureVisibility();\n } else {\n derived.ensureInvisibility();\n }\n return derived;\n });\n return path;\n }\n\n visitMedia(mediaNode, visitArgs) {\n let newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitMediaOut(mediaNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n let newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n}\n\nexport default ProcessExtendsVisitor;\n","import Visitor from './visitor';\n\nclass JoinSelectorVisitor {\n constructor() {\n this.contexts = [[]];\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n return this._visitor.visit(root);\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n const paths = [];\n let selectors;\n\n this.contexts.push(paths);\n\n if (!rulesetNode.root) {\n selectors = rulesetNode.selectors;\n if (selectors) {\n selectors = selectors.filter(selector => selector.getIsOutput());\n rulesetNode.selectors = selectors.length ? selectors : (selectors = null);\n if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }\n }\n if (!selectors) { rulesetNode.rules = null; }\n rulesetNode.paths = paths;\n }\n }\n\n visitRulesetOut(rulesetNode) {\n this.contexts.length = this.contexts.length - 1;\n }\n\n visitMedia(mediaNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n if (atRuleNode.rules && atRuleNode.rules.length) {\n atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);\n }\n }\n}\n\nexport default JoinSelectorVisitor;\n","import tree from '../tree';\nimport Visitor from './visitor';\n\nclass CSSVisitorUtils {\n constructor(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n }\n\n containsSilentNonBlockedChild(bodyRules) {\n let rule;\n if (!bodyRules) {\n return false;\n }\n for (let r = 0; r < bodyRules.length; r++) {\n rule = bodyRules[r];\n if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {\n // the atrule contains something that was referenced (likely by extend)\n // therefore it needs to be shown in output too\n return true;\n }\n }\n return false;\n }\n\n keepOnlyVisibleChilds(owner) {\n if (owner && owner.rules) {\n owner.rules = owner.rules.filter(thing => thing.isVisible());\n }\n }\n\n isEmpty(owner) {\n return (owner && owner.rules) \n ? (owner.rules.length === 0) : true;\n }\n\n hasVisibleSelector(rulesetNode) {\n return (rulesetNode && rulesetNode.paths)\n ? (rulesetNode.paths.length > 0) : false;\n }\n\n resolveVisibility(node, originalRules) {\n if (!node.blocksVisibility()) {\n if (this.isEmpty(node) && !this.containsSilentNonBlockedChild(originalRules)) {\n return ;\n }\n\n return node;\n }\n\n const compiledRulesBody = node.rules[0];\n this.keepOnlyVisibleChilds(compiledRulesBody);\n\n if (this.isEmpty(compiledRulesBody)) {\n return ;\n }\n\n node.ensureVisibility();\n node.removeVisibilityBlock();\n\n return node;\n }\n\n isVisibleRuleset(rulesetNode) {\n if (rulesetNode.firstRoot) {\n return true;\n }\n\n if (this.isEmpty(rulesetNode)) {\n return false;\n }\n\n if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {\n return false;\n }\n\n return true;\n }\n}\n\nconst ToCSSVisitor = function(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n this.utils = new CSSVisitorUtils(context);\n};\n\nToCSSVisitor.prototype = {\n isReplacing: true,\n run: function (root) {\n return this._visitor.visit(root);\n },\n\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.blocksVisibility() || declNode.variable) {\n return;\n }\n return declNode;\n },\n\n visitMixinDefinition: function (mixinNode, visitArgs) {\n // mixin definitions do not get eval'd - this means they keep state\n // so we have to clear that state here so it isn't used if toCSS is called twice\n mixinNode.frames = [];\n },\n\n visitExtend: function (extendNode, visitArgs) {\n },\n\n visitComment: function (commentNode, visitArgs) {\n if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {\n return;\n }\n return commentNode;\n },\n\n visitMedia: function(mediaNode, visitArgs) {\n const originalRules = mediaNode.rules[0].rules;\n mediaNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n return this.utils.resolveVisibility(mediaNode, originalRules);\n },\n\n visitImport: function (importNode, visitArgs) {\n if (importNode.blocksVisibility()) {\n return ;\n }\n return importNode;\n },\n\n visitAtRule: function(atRuleNode, visitArgs) {\n if (atRuleNode.rules && atRuleNode.rules.length) {\n return this.visitAtRuleWithBody(atRuleNode, visitArgs);\n } else {\n return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);\n }\n },\n\n visitAnonymous: function(anonymousNode, visitArgs) {\n if (!anonymousNode.blocksVisibility()) {\n anonymousNode.accept(this._visitor);\n return anonymousNode;\n }\n },\n\n visitAtRuleWithBody: function(atRuleNode, visitArgs) {\n // if there is only one nested ruleset and that one has no path, then it is\n // just fake ruleset\n function hasFakeRuleset(atRuleNode) {\n const bodyRules = atRuleNode.rules;\n return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);\n }\n function getBodyRules(atRuleNode) {\n const nodeRules = atRuleNode.rules;\n if (hasFakeRuleset(atRuleNode)) {\n return nodeRules[0].rules;\n }\n\n return nodeRules;\n }\n // it is still true that it is only one ruleset in array\n // this is last such moment\n // process childs\n const originalRules = getBodyRules(atRuleNode);\n atRuleNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n if (!this.utils.isEmpty(atRuleNode)) {\n this._mergeRules(atRuleNode.rules[0].rules);\n }\n\n return this.utils.resolveVisibility(atRuleNode, originalRules);\n },\n\n visitAtRuleWithoutBody: function(atRuleNode, visitArgs) {\n if (atRuleNode.blocksVisibility()) {\n return;\n }\n\n if (atRuleNode.name === '@charset') {\n // Only output the debug info together with subsequent @charset definitions\n // a comment (or @media statement) before the actual @charset atrule would\n // be considered illegal css as it has to be on the first line\n if (this.charset) {\n if (atRuleNode.debugInfo) {\n const comment = new tree.Comment(`/* ${atRuleNode.toCSS(this._context).replace(/\\n/g, '')} */\\n`);\n comment.debugInfo = atRuleNode.debugInfo;\n return this._visitor.visit(comment);\n }\n return;\n }\n this.charset = true;\n }\n\n return atRuleNode;\n },\n\n checkValidNodes: function(rules, isRoot) {\n if (!rules) {\n return;\n }\n\n for (let i = 0; i < rules.length; i++) {\n const ruleNode = rules[i];\n if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {\n throw { message: 'Properties must be inside selector blocks. They cannot be in the root',\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode instanceof tree.Call) {\n throw { message: `Function '${ruleNode.name}' is undefined`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode.type && !ruleNode.allowRoot) {\n throw { message: `${ruleNode.type} node returned by a function is not valid here`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n }\n },\n\n visitRuleset: function (rulesetNode, visitArgs) {\n // at this point rulesets are nested into each other\n let rule;\n\n const rulesets = [];\n\n this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);\n\n if (!rulesetNode.root) {\n // remove invisible paths\n this._compileRulesetPaths(rulesetNode);\n\n // remove rulesets from this ruleset body and compile them separately\n const nodeRules = rulesetNode.rules;\n\n let nodeRuleCnt = nodeRules ? nodeRules.length : 0;\n for (let i = 0; i < nodeRuleCnt; ) {\n rule = nodeRules[i];\n if (rule && rule.rules) {\n // visit because we are moving them out from being a child\n rulesets.push(this._visitor.visit(rule));\n nodeRules.splice(i, 1);\n nodeRuleCnt--;\n continue;\n }\n i++;\n }\n // accept the visitor to remove rules and refactor itself\n // then we can decide nogw whether we want it or not\n // compile body\n if (nodeRuleCnt > 0) {\n rulesetNode.accept(this._visitor);\n } else {\n rulesetNode.rules = null;\n }\n visitArgs.visitDeeper = false;\n } else { // if (! rulesetNode.root) {\n rulesetNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n }\n\n if (rulesetNode.rules) {\n this._mergeRules(rulesetNode.rules);\n this._removeDuplicateRules(rulesetNode.rules);\n }\n\n // now decide whether we keep the ruleset\n if (this.utils.isVisibleRuleset(rulesetNode)) {\n rulesetNode.ensureVisibility();\n rulesets.splice(0, 0, rulesetNode);\n }\n\n if (rulesets.length === 1) {\n return rulesets[0];\n }\n return rulesets;\n },\n\n _compileRulesetPaths: function(rulesetNode) {\n if (rulesetNode.paths) {\n rulesetNode.paths = rulesetNode.paths\n .filter(p => {\n let i;\n if (p[0].elements[0].combinator.value === ' ') {\n p[0].elements[0].combinator = new(tree.Combinator)('');\n }\n for (i = 0; i < p.length; i++) {\n if (p[i].isVisible() && p[i].getIsOutput()) {\n return true;\n }\n }\n return false;\n });\n }\n },\n\n _removeDuplicateRules: function(rules) {\n if (!rules) { return; }\n\n // remove duplicates\n const ruleCache = {};\n\n let ruleList;\n let rule;\n let i;\n\n for (i = rules.length - 1; i >= 0 ; i--) {\n rule = rules[i];\n if (rule instanceof tree.Declaration) {\n if (!ruleCache[rule.name]) {\n ruleCache[rule.name] = rule;\n } else {\n ruleList = ruleCache[rule.name];\n if (ruleList instanceof tree.Declaration) {\n ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];\n }\n const ruleCSS = rule.toCSS(this._context);\n if (ruleList.indexOf(ruleCSS) !== -1) {\n rules.splice(i, 1);\n } else {\n ruleList.push(ruleCSS);\n }\n }\n }\n }\n },\n\n _mergeRules: function(rules) {\n if (!rules) {\n return; \n }\n\n const groups = {};\n const groupsArr = [];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (rule.merge) {\n const key = rule.name;\n groups[key] ? rules.splice(i--, 1) : \n groupsArr.push(groups[key] = []);\n groups[key].push(rule);\n }\n }\n\n groupsArr.forEach(group => {\n if (group.length > 0) {\n const result = group[0];\n let space = [];\n const comma = [new tree.Expression(space)];\n group.forEach(rule => {\n if ((rule.merge === '+') && (space.length > 0)) {\n comma.push(new tree.Expression(space = []));\n }\n space.push(rule.value);\n result.important = result.important || rule.important;\n });\n result.value = new tree.Value(comma);\n }\n });\n }\n};\n\nexport default ToCSSVisitor;\n","import Visitor from './visitor';\nimport ImportVisitor from './import-visitor';\nimport MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor';\nimport ExtendVisitor from './extend-visitor';\nimport JoinSelectorVisitor from './join-selector-visitor';\nimport ToCSSVisitor from './to-css-visitor';\n\nexport default {\n Visitor,\n ImportVisitor,\n MarkVisibleSelectorsVisitor,\n ExtendVisitor,\n JoinSelectorVisitor,\n ToCSSVisitor\n};\n","import chunker from './chunker';\n\nexport default () => {\n let // Less input string\n input;\n\n let // current chunk\n j;\n\n const // holds state for backtracking\n saveStack = [];\n\n let // furthest index the parser has gone to\n furthest;\n\n let // if this is furthest we got to, this is the probably cause\n furthestPossibleErrorMessage;\n\n let // chunkified input\n chunks;\n\n let // current chunk\n current;\n\n let // index of current chunk, in `input`\n currentPos;\n\n const parserInput = {};\n const CHARCODE_SPACE = 32;\n const CHARCODE_TAB = 9;\n const CHARCODE_LF = 10;\n const CHARCODE_CR = 13;\n const CHARCODE_PLUS = 43;\n const CHARCODE_COMMA = 44;\n const CHARCODE_FORWARD_SLASH = 47;\n const CHARCODE_9 = 57;\n\n function skipWhitespace(length) {\n const oldi = parserInput.i;\n const oldj = j;\n const curr = parserInput.i - currentPos;\n const endIndex = parserInput.i + current.length - curr;\n const mem = (parserInput.i += length);\n const inp = input;\n let c;\n let nextChar;\n let comment;\n\n for (; parserInput.i < endIndex; parserInput.i++) {\n c = inp.charCodeAt(parserInput.i);\n\n if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {\n nextChar = inp.charAt(parserInput.i + 1);\n if (nextChar === '/') {\n comment = {index: parserInput.i, isLineComment: true};\n let nextNewLine = inp.indexOf('\\n', parserInput.i + 2);\n if (nextNewLine < 0) {\n nextNewLine = endIndex;\n }\n parserInput.i = nextNewLine;\n comment.text = inp.substr(comment.index, parserInput.i - comment.index);\n parserInput.commentStore.push(comment);\n continue;\n } else if (nextChar === '*') {\n const nextStarSlash = inp.indexOf('*/', parserInput.i + 2);\n if (nextStarSlash >= 0) {\n comment = {\n index: parserInput.i,\n text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),\n isLineComment: false\n };\n parserInput.i += comment.text.length - 1;\n parserInput.commentStore.push(comment);\n continue;\n }\n }\n break;\n }\n\n if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {\n break;\n }\n }\n\n current = current.slice(length + parserInput.i - mem + curr);\n currentPos = parserInput.i;\n\n if (!current.length) {\n if (j < chunks.length - 1) {\n current = chunks[++j];\n skipWhitespace(0); // skip space at the beginning of a chunk\n return true; // things changed\n }\n parserInput.finished = true;\n }\n\n return oldi !== parserInput.i || oldj !== j;\n }\n\n parserInput.save = () => {\n currentPos = parserInput.i;\n saveStack.push( { current, i: parserInput.i, j });\n };\n parserInput.restore = possibleErrorMessage => {\n\n if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {\n furthest = parserInput.i;\n furthestPossibleErrorMessage = possibleErrorMessage;\n }\n const state = saveStack.pop();\n current = state.current;\n currentPos = parserInput.i = state.i;\n j = state.j;\n };\n parserInput.forget = () => {\n saveStack.pop();\n };\n parserInput.isWhitespace = offset => {\n const pos = parserInput.i + (offset || 0);\n const code = input.charCodeAt(pos);\n return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);\n };\n\n // Specialization of $(tok)\n parserInput.$re = tok => {\n if (parserInput.i > currentPos) {\n current = current.slice(parserInput.i - currentPos);\n currentPos = parserInput.i;\n }\n\n const m = tok.exec(current);\n if (!m) {\n return null;\n }\n\n skipWhitespace(m[0].length);\n if (typeof m === 'string') {\n return m;\n }\n\n return m.length === 1 ? m[0] : m;\n };\n\n parserInput.$char = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n skipWhitespace(1);\n return tok;\n };\n\n parserInput.$str = tok => {\n const tokLength = tok.length;\n\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tokLength; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return null;\n }\n }\n\n skipWhitespace(tokLength);\n return tok;\n };\n\n parserInput.$quoted = loc => {\n const pos = loc || parserInput.i;\n const startChar = input.charAt(pos);\n\n if (startChar !== '\\'' && startChar !== '\"') {\n return;\n }\n const length = input.length;\n const currentPosition = pos;\n\n for (let i = 1; i + currentPosition < length; i++) {\n const nextChar = input.charAt(i + currentPosition);\n switch (nextChar) {\n case '\\\\':\n i++;\n continue;\n case '\\r':\n case '\\n':\n break;\n case startChar:\n const str = input.substr(currentPosition, i + 1);\n if (!loc && loc !== 0) {\n skipWhitespace(i + 1);\n return str\n }\n return [startChar, str];\n default:\n }\n }\n return null;\n };\n\n /**\n * Permissive parsing. Ignores everything except matching {} [] () and quotes\n * until matching token (outside of blocks)\n */\n parserInput.$parseUntil = tok => {\n let quote = '';\n let returnVal = null;\n let inComment = false;\n let blockDepth = 0;\n const blockStack = [];\n const parseGroups = [];\n const length = input.length;\n const startPos = parserInput.i;\n let lastPos = parserInput.i;\n let i = parserInput.i;\n let loop = true;\n let testChar;\n\n if (typeof tok === 'string') {\n testChar = char => char === tok\n } else {\n testChar = char => tok.test(char)\n }\n\n do {\n let prevChar;\n let nextChar = input.charAt(i);\n if (blockDepth === 0 && testChar(nextChar)) {\n returnVal = input.substr(lastPos, i - lastPos);\n if (returnVal) {\n parseGroups.push(returnVal);\n }\n else {\n parseGroups.push(' ');\n }\n returnVal = parseGroups;\n skipWhitespace(i - startPos);\n loop = false\n } else {\n if (inComment) {\n if (nextChar === '*' && \n input.charAt(i + 1) === '/') {\n i++;\n blockDepth--;\n inComment = false;\n }\n i++;\n continue;\n }\n switch (nextChar) {\n case '\\\\':\n i++;\n nextChar = input.charAt(i);\n parseGroups.push(input.substr(lastPos, i - lastPos + 1));\n lastPos = i + 1;\n break;\n case '/':\n if (input.charAt(i + 1) === '*') {\n i++;\n inComment = true;\n blockDepth++;\n }\n break;\n case '\\'':\n case '\"':\n quote = parserInput.$quoted(i);\n if (quote) {\n parseGroups.push(input.substr(lastPos, i - lastPos), quote);\n i += quote[1].length - 1;\n lastPos = i + 1;\n }\n else {\n skipWhitespace(i - startPos);\n returnVal = nextChar;\n loop = false;\n }\n break;\n case '{':\n blockStack.push('}');\n blockDepth++;\n break;\n case '(':\n blockStack.push(')');\n blockDepth++;\n break;\n case '[':\n blockStack.push(']');\n blockDepth++;\n break;\n case '}':\n case ')':\n case ']':\n const expected = blockStack.pop();\n if (nextChar === expected) {\n blockDepth--;\n } else {\n // move the parser to the error and return expected\n skipWhitespace(i - startPos);\n returnVal = expected;\n loop = false;\n }\n }\n i++;\n if (i > length) {\n loop = false;\n }\n }\n prevChar = nextChar;\n } while (loop);\n\n return returnVal ? returnVal : null;\n }\n\n parserInput.autoCommentAbsorb = true;\n parserInput.commentStore = [];\n parserInput.finished = false;\n\n // Same as $(), but don't change the state of the parser,\n // just return the match.\n parserInput.peek = tok => {\n if (typeof tok === 'string') {\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tok.length; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return false;\n }\n }\n return true;\n } else {\n return tok.test(current);\n }\n };\n\n // Specialization of peek()\n // TODO remove or change some currentChar calls to peekChar\n parserInput.peekChar = tok => input.charAt(parserInput.i) === tok;\n\n parserInput.currentChar = () => input.charAt(parserInput.i);\n\n parserInput.prevChar = () => input.charAt(parserInput.i - 1);\n\n parserInput.getInput = () => input;\n\n parserInput.peekNotNumeric = () => {\n const c = input.charCodeAt(parserInput.i);\n // Is the first char of the dimension 0-9, '.', '+' or '-'\n return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;\n };\n\n parserInput.start = (str, chunkInput, failFunction) => {\n input = str;\n parserInput.i = j = currentPos = furthest = 0;\n\n // chunking apparently makes things quicker (but my tests indicate\n // it might actually make things slower in node at least)\n // and it is a non-perfect parse - it can't recognise\n // unquoted urls, meaning it can't distinguish comments\n // meaning comments with quotes or {}() in them get 'counted'\n // and then lead to parse errors.\n // In addition if the chunking chunks in the wrong place we might\n // not be able to parse a parser statement in one go\n // this is officially deprecated but can be switched on via an option\n // in the case it causes too much performance issues.\n if (chunkInput) {\n chunks = chunker(str, failFunction);\n } else {\n chunks = [str];\n }\n\n current = chunks[0];\n\n skipWhitespace(0);\n };\n\n parserInput.end = () => {\n let message;\n const isFinished = parserInput.i >= input.length;\n\n if (parserInput.i < furthest) {\n message = furthestPossibleErrorMessage;\n parserInput.i = furthest;\n }\n return {\n isFinished,\n furthest: parserInput.i,\n furthestPossibleErrorMessage: message,\n furthestReachedEnd: parserInput.i >= input.length - 1,\n furthestChar: input[parserInput.i]\n };\n };\n\n return parserInput;\n};\n","// Split the input into chunks.\nexport default (input, fail) => {\n const len = input.length;\n let level = 0;\n let parenLevel = 0;\n let lastOpening;\n let lastOpeningParen;\n let lastMultiComment;\n let lastMultiCommentEndBrace;\n const chunks = [];\n let emitFrom = 0;\n let chunkerCurrentIndex;\n let currentChunkStartIndex;\n let cc;\n let cc2;\n let matched;\n\n function emitChunk(force) {\n const len = chunkerCurrentIndex - emitFrom;\n if (((len < 512) && !force) || !len) {\n return;\n }\n chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));\n emitFrom = chunkerCurrentIndex + 1;\n }\n\n for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc = input.charCodeAt(chunkerCurrentIndex);\n if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {\n // a-z or whitespace\n continue;\n }\n\n switch (cc) {\n case 40: // (\n parenLevel++;\n lastOpeningParen = chunkerCurrentIndex;\n continue;\n case 41: // )\n if (--parenLevel < 0) {\n return fail('missing opening `(`', chunkerCurrentIndex);\n }\n continue;\n case 59: // ;\n if (!parenLevel) { emitChunk(); }\n continue;\n case 123: // {\n level++;\n lastOpening = chunkerCurrentIndex;\n continue;\n case 125: // }\n if (--level < 0) {\n return fail('missing opening `{`', chunkerCurrentIndex);\n }\n if (!level && !parenLevel) { emitChunk(); }\n continue;\n case 92: // \\\n if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n case 34:\n case 39:\n case 96: // \", ' and `\n matched = 0;\n currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 > 96) { continue; }\n if (cc2 == cc) { matched = 1; break; }\n if (cc2 == 92) { // \\\n if (chunkerCurrentIndex == len - 1) {\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n }\n chunkerCurrentIndex++;\n }\n }\n if (matched) { continue; }\n return fail(`unmatched \\`${String.fromCharCode(cc)}\\``, currentChunkStartIndex);\n case 47: // /, check for comment\n if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }\n cc2 = input.charCodeAt(chunkerCurrentIndex + 1);\n if (cc2 == 47) {\n // //, find lnfeed\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }\n }\n } else if (cc2 == 42) {\n // /*, find */\n lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; }\n if (cc2 != 42) { continue; }\n if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; }\n }\n if (chunkerCurrentIndex == len - 1) {\n return fail('missing closing `*/`', currentChunkStartIndex);\n }\n chunkerCurrentIndex++;\n }\n continue;\n case 42: // *, check for unmatched */\n if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {\n return fail('unmatched `/*`', chunkerCurrentIndex);\n }\n continue;\n }\n }\n\n if (level !== 0) {\n if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {\n return fail('missing closing `}` or `*/`', lastOpening);\n } else {\n return fail('missing closing `}`', lastOpening);\n }\n } else if (parenLevel !== 0) {\n return fail('missing closing `)`', lastOpeningParen);\n }\n\n emitChunk(true);\n return chunks;\n};\n","import LessError from '../less-error';\nimport tree from '../tree';\nimport visitors from '../visitors';\nimport getParserInput from './parser-input';\nimport * as utils from '../utils';\nimport functionRegistry from '../functions/function-registry';\n\n//\n// less.js - parser\n//\n// A relatively straight-forward predictive parser.\n// There is no tokenization/lexing stage, the input is parsed\n// in one sweep.\n//\n// To make the parser fast enough to run in the browser, several\n// optimization had to be made:\n//\n// - Matching and slicing on a huge input is often cause of slowdowns.\n// The solution is to chunkify the input into smaller strings.\n// The chunks are stored in the `chunks` var,\n// `j` holds the current chunk index, and `currentPos` holds\n// the index of the current chunk in relation to `input`.\n// This gives us an almost 4x speed-up.\n//\n// - In many cases, we don't need to match individual tokens;\n// for example, if a value doesn't hold any variables, operations\n// or dynamic references, the parser can effectively 'skip' it,\n// treating it as a literal.\n// An example would be '1px solid #000' - which evaluates to itself,\n// we don't need to know what the individual components are.\n// The drawback, of course is that you don't get the benefits of\n// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,\n// and a smaller speed-up in the code-gen.\n//\n//\n// Token matching is done with the `$` function, which either takes\n// a terminal string or regexp, or a non-terminal function to call.\n// It also takes care of moving all the indices forwards.\n//\n\nconst Parser = function Parser(context, imports, fileInfo) {\n let parsers;\n const parserInput = getParserInput();\n\n function error(msg, type) {\n throw new LessError(\n {\n index: parserInput.i,\n filename: fileInfo.filename,\n type: type || 'Syntax',\n message: msg\n },\n imports\n );\n }\n\n function expect(arg, msg) {\n // some older browsers return typeof 'function' for RegExp\n const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);\n if (result) {\n return result;\n }\n \n error(msg || (typeof arg === 'string'\n ? `expected '${arg}' got '${parserInput.currentChar()}'`\n : 'unexpected token'));\n }\n\n // Specialization of expect()\n function expectChar(arg, msg) {\n if (parserInput.$char(arg)) {\n return arg;\n }\n error(msg || `expected '${arg}' got '${parserInput.currentChar()}'`);\n }\n\n function getDebugInfo(index) {\n const filename = fileInfo.filename;\n\n return {\n lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1,\n fileName: filename\n };\n }\n\n /**\n * Used after initial parsing to create nodes on the fly\n * \n * @param {String} str - string to parse \n * @param {Array} parseList - array of parsers to run input through e.g. [\"value\", \"important\"]\n * @param {Number} currentIndex - start number to begin indexing\n * @param {Object} fileInfo - fileInfo to attach to created nodes\n */\n function parseNode(str, parseList, currentIndex, fileInfo, callback) {\n let result;\n const returnNodes = [];\n const parser = parserInput;\n\n try {\n parser.start(str, false, function fail(msg, index) {\n callback({\n message: msg,\n index: index + currentIndex\n });\n });\n for (let x = 0, p, i; (p = parseList[x]); x++) {\n i = parser.i;\n result = parsers[p]();\n if (result) {\n try {\n result._index = i + currentIndex;\n result._fileInfo = fileInfo;\n } catch (e) {}\n returnNodes.push(result);\n }\n else {\n returnNodes.push(null);\n }\n }\n\n const endInfo = parser.end();\n if (endInfo.isFinished) {\n callback(null, returnNodes);\n }\n else {\n callback(true, null);\n }\n } catch (e) {\n throw new LessError({\n index: e.index + currentIndex,\n message: e.message\n }, imports, fileInfo.filename);\n }\n }\n\n //\n // The Parser\n //\n return {\n parserInput,\n imports,\n fileInfo,\n parseNode,\n //\n // Parse an input string into an abstract syntax tree,\n // @param str A string containing 'less' markup\n // @param callback call `callback` when done.\n // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply\n //\n parse: function (str, callback, additionalData) {\n let root;\n let error = null;\n let globalVars;\n let modifyVars;\n let ignored;\n let preText = '';\n\n globalVars = (additionalData && additionalData.globalVars) ? `${Parser.serializeVars(additionalData.globalVars)}\\n` : '';\n modifyVars = (additionalData && additionalData.modifyVars) ? `\\n${Parser.serializeVars(additionalData.modifyVars)}` : '';\n\n if (context.pluginManager) {\n const preProcessors = context.pluginManager.getPreProcessors();\n for (let i = 0; i < preProcessors.length; i++) {\n str = preProcessors[i].process(str, { context, imports, fileInfo });\n }\n }\n\n if (globalVars || (additionalData && additionalData.banner)) {\n preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;\n ignored = imports.contentsIgnoredChars;\n ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;\n ignored[fileInfo.filename] += preText.length;\n }\n\n str = str.replace(/\\r\\n?/g, '\\n');\n // Remove potential UTF Byte Order Mark\n str = preText + str.replace(/^\\uFEFF/, '') + modifyVars;\n imports.contents[fileInfo.filename] = str;\n\n // Start with the primary rule.\n // The whole syntax tree is held under a Ruleset node,\n // with the `root` property set to true, so no `{}` are\n // output. The callback is called when the input is parsed.\n try {\n parserInput.start(str, context.chunkInput, function fail(msg, index) {\n throw new LessError({\n index,\n type: 'Parse',\n message: msg,\n filename: fileInfo.filename\n }, imports);\n });\n\n tree.Node.prototype.parse = this;\n root = new tree.Ruleset(null, this.parsers.primary());\n tree.Node.prototype.rootNode = root;\n root.root = true;\n root.firstRoot = true;\n root.functionRegistry = functionRegistry.inherit();\n \n } catch (e) {\n return callback(new LessError(e, imports, fileInfo.filename));\n }\n\n // If `i` is smaller than the `input.length - 1`,\n // it means the parser wasn't able to parse the whole\n // string, so we've got a parsing error.\n //\n // We try to extract a \\n delimited string,\n // showing the line where the parse error occurred.\n // We split it up into two parts (the part which parsed,\n // and the part which didn't), so we can color them differently.\n const endInfo = parserInput.end();\n if (!endInfo.isFinished) {\n\n let message = endInfo.furthestPossibleErrorMessage;\n\n if (!message) {\n message = 'Unrecognised input';\n if (endInfo.furthestChar === '}') {\n message += '. Possibly missing opening \\'{\\'';\n } else if (endInfo.furthestChar === ')') {\n message += '. Possibly missing opening \\'(\\'';\n } else if (endInfo.furthestReachedEnd) {\n message += '. Possibly missing something';\n }\n }\n\n error = new LessError({\n type: 'Parse',\n message,\n index: endInfo.furthest,\n filename: fileInfo.filename\n }, imports);\n }\n\n const finish = e => {\n e = error || e || imports.error;\n\n if (e) {\n if (!(e instanceof LessError)) {\n e = new LessError(e, imports, fileInfo.filename);\n }\n\n return callback(e);\n }\n else {\n return callback(null, root);\n }\n };\n\n if (context.processImports !== false) {\n new visitors.ImportVisitor(imports, finish)\n .run(root);\n } else {\n return finish();\n }\n },\n\n //\n // Here in, the parsing rules/functions\n //\n // The basic structure of the syntax tree generated is as follows:\n //\n // Ruleset -> Declaration -> Value -> Expression -> Entity\n //\n // Here's some Less code:\n //\n // .class {\n // color: #fff;\n // border: 1px solid #000;\n // width: @w + 4px;\n // > .child {...}\n // }\n //\n // And here's what the parse tree might look like:\n //\n // Ruleset (Selector '.class', [\n // Declaration (\"color\", Value ([Expression [Color #fff]]))\n // Declaration (\"border\", Value ([Expression [Dimension 1px][Keyword \"solid\"][Color #000]]))\n // Declaration (\"width\", Value ([Expression [Operation \" + \" [Variable \"@w\"][Dimension 4px]]]))\n // Ruleset (Selector [Element '>', '.child'], [...])\n // ])\n //\n // In general, most rules will try to parse a token with the `$re()` function, and if the return\n // value is truly, will return a new node, of the relevant type. Sometimes, we need to check\n // first, before parsing, that's when we use `peek()`.\n //\n parsers: parsers = {\n //\n // The `primary` rule is the *entry* and *exit* point of the parser.\n // The rules here can appear at any level of the parse tree.\n //\n // The recursive nature of the grammar is an interplay between the `block`\n // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,\n // as represented by this simplified grammar:\n //\n // primary → (ruleset | declaration)+\n // ruleset → selector+ block\n // block → '{' primary '}'\n //\n // Only at one point is the primary rule not called from the\n // block rule: at the root level.\n //\n primary: function () {\n const mixin = this.mixin;\n let root = [];\n let node;\n\n while (true) {\n while (true) {\n node = this.comment();\n if (!node) { break; }\n root.push(node);\n }\n // always process comments before deciding if finished\n if (parserInput.finished) {\n break;\n }\n if (parserInput.peek('}')) {\n break;\n }\n\n node = this.extendRule();\n if (node) {\n root = root.concat(node);\n continue;\n }\n\n node = mixin.definition() || this.declaration() || mixin.call(false, false) || \n this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();\n if (node) {\n root.push(node);\n } else {\n let foundSemiColon = false;\n while (parserInput.$char(';')) {\n foundSemiColon = true;\n }\n if (!foundSemiColon) {\n break;\n }\n }\n }\n\n return root;\n },\n\n // comments are collected by the main parsing mechanism and then assigned to nodes\n // where the current structure allows it\n comment: function () {\n if (parserInput.commentStore.length) {\n const comment = parserInput.commentStore.shift();\n return new(tree.Comment)(comment.text, comment.isLineComment, comment.index, fileInfo);\n }\n },\n\n //\n // Entities are tokens which can be found inside an Expression\n //\n entities: {\n mixinLookup: function() {\n return parsers.mixin.call(true, true);\n },\n //\n // A string, which supports escaping \" and '\n //\n // \"milky way\" 'he\\'s the one!'\n //\n quoted: function (forceEscaped) {\n let str;\n const index = parserInput.i;\n let isEscaped = false;\n\n parserInput.save();\n if (parserInput.$char('~')) {\n isEscaped = true;\n } else if (forceEscaped) {\n parserInput.restore();\n return;\n }\n\n str = parserInput.$quoted();\n if (!str) {\n parserInput.restore();\n return;\n }\n parserInput.forget();\n\n return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index, fileInfo);\n },\n\n //\n // A catch-all word, such as:\n //\n // black border-collapse\n //\n keyword: function () {\n const k = parserInput.$char('%') || parserInput.$re(/^\\[?(?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\\]?/);\n if (k) {\n return tree.Color.fromKeyword(k) || new(tree.Keyword)(k);\n }\n },\n\n //\n // A function call\n //\n // rgb(255, 0, 255)\n //\n // The arguments are parsed with the `entities.arguments` parser.\n //\n call: function () {\n let name;\n let args;\n let func;\n const index = parserInput.i;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (parserInput.peek(/^url\\(/i)) {\n return;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^([\\w-]+|%|progid:[\\w\\.]+)\\(/);\n if (!name) {\n parserInput.forget(); \n return;\n }\n\n name = name[1];\n func = this.customFuncCall(name);\n if (func) {\n args = func.parse();\n if (args && func.stop) {\n parserInput.forget();\n return args;\n }\n }\n\n args = this.arguments(args);\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(name, args, index, fileInfo);\n },\n \n //\n // Parsing rules for functions with non-standard args, e.g.:\n //\n // boolean(not(2 > 1))\n //\n // This is a quick prototype, to be modified/improved when\n // more custom-parsed funcs come (e.g. `selector(...)`)\n //\n\n customFuncCall: function (name) {\n /* Ideally the table is to be moved out of here for faster perf.,\n but it's quite tricky since it relies on all these `parsers`\n and `expect` available only here */\n return {\n alpha: f(parsers.ieAlpha, true),\n boolean: f(condition),\n 'if': f(condition)\n }[name.toLowerCase()];\n\n function f(parse, stop) {\n return {\n parse, // parsing function\n stop // when true - stop after parse() and return its result, \n // otherwise continue for plain args\n };\n }\n \n function condition() {\n return [expect(parsers.condition, 'expected condition')];\n }\n },\n\n arguments: function (prevArgs) {\n let argsComma = prevArgs || [];\n const argsSemiColon = [];\n let isSemiColonSeparated;\n let value;\n\n parserInput.save();\n\n while (true) {\n if (prevArgs) {\n prevArgs = false;\n } else {\n value = parsers.detachedRuleset() || this.assignment() || parsers.expression();\n if (!value) {\n break;\n }\n\n if (value.value && value.value.length == 1) {\n value = value.value[0];\n }\n\n argsComma.push(value);\n }\n\n if (parserInput.$char(',')) {\n continue;\n }\n\n if (parserInput.$char(';') || isSemiColonSeparated) {\n isSemiColonSeparated = true;\n value = (argsComma.length < 1) ? argsComma[0]\n : new tree.Value(argsComma);\n argsSemiColon.push(value);\n argsComma = [];\n }\n }\n\n parserInput.forget();\n return isSemiColonSeparated ? argsSemiColon : argsComma;\n },\n literal: function () {\n return this.dimension() ||\n this.color() ||\n this.quoted() ||\n this.unicodeDescriptor();\n },\n\n // Assignments are argument entities for calls.\n // They are present in ie filter properties as shown below.\n //\n // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )\n //\n\n assignment: function () {\n let key;\n let value;\n parserInput.save();\n key = parserInput.$re(/^\\w+(?=\\s?=)/i);\n if (!key) {\n parserInput.restore();\n return;\n }\n if (!parserInput.$char('=')) {\n parserInput.restore();\n return;\n }\n value = parsers.entity();\n if (value) {\n parserInput.forget();\n return new(tree.Assignment)(key, value);\n } else {\n parserInput.restore();\n }\n },\n\n //\n // Parse url() tokens\n //\n // We use a specific rule for urls, because they don't really behave like\n // standard function calls. The difference is that the argument doesn't have\n // to be enclosed within a string, so it can't be parsed as an Expression.\n //\n url: function () {\n let value;\n const index = parserInput.i;\n\n parserInput.autoCommentAbsorb = false;\n\n if (!parserInput.$str('url(')) {\n parserInput.autoCommentAbsorb = true;\n return;\n }\n\n value = this.quoted() || this.variable() || this.property() ||\n parserInput.$re(/^(?:(?:\\\\[\\(\\)'\"])|[^\\(\\)'\"])+/) || '';\n\n parserInput.autoCommentAbsorb = true;\n\n expectChar(')');\n\n return new(tree.URL)((value.value != null || \n value instanceof tree.Variable || \n value instanceof tree.Property) ?\n value : new(tree.Anonymous)(value, index), index, fileInfo);\n },\n\n //\n // A Variable entity, such as `@fink`, in\n //\n // width: @fink + 2px\n //\n // We use a different parser for variable definitions,\n // see `parsers.variable`.\n //\n variable: function () {\n let ch;\n let name;\n const index = parserInput.i;\n\n parserInput.save();\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\\w-]+/))) {\n ch = parserInput.currentChar();\n if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\\s/)) {\n // this may be a VariableCall lookup\n const result = parsers.variableCall(name);\n if (result) {\n parserInput.forget();\n return result;\n }\n }\n parserInput.forget();\n return new(tree.Variable)(name, index, fileInfo);\n }\n parserInput.restore();\n },\n\n // A variable entity using the protective {} e.g. @{var}\n variableCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\\{([\\w-]+)\\}/))) {\n return new(tree.Variable)(`@${curly[1]}`, index, fileInfo);\n }\n },\n //\n // A Property accessor, such as `$color`, in\n //\n // background-color: $color\n //\n property: function () {\n let name;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\\$[\\w-]+/))) {\n return new(tree.Property)(name, index, fileInfo);\n }\n },\n\n // A property entity useing the protective {} e.g. ${prop}\n propertyCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\\$\\{([\\w-]+)\\}/))) {\n return new(tree.Property)(`$${curly[1]}`, index, fileInfo);\n }\n },\n //\n // A Hexadecimal color\n //\n // #4F3C2F\n //\n // `rgb` and `hsl` colors are parsed through the `entities.call` parser.\n //\n color: function () {\n let rgb;\n parserInput.save();\n\n if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\\w.#\\[])?/))) {\n if (!rgb[2]) {\n parserInput.forget();\n return new(tree.Color)(rgb[1], undefined, rgb[0]);\n } \n }\n parserInput.restore();\n },\n\n colorKeyword: function () {\n parserInput.save();\n const autoCommentAbsorb = parserInput.autoCommentAbsorb;\n parserInput.autoCommentAbsorb = false;\n const k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);\n parserInput.autoCommentAbsorb = autoCommentAbsorb;\n if (!k) {\n parserInput.forget();\n return;\n }\n parserInput.restore();\n const color = tree.Color.fromKeyword(k);\n if (color) {\n parserInput.$str(k);\n return color;\n }\n },\n\n //\n // A Dimension, that is, a number and a unit\n //\n // 0.5em 95%\n //\n dimension: function () {\n if (parserInput.peekNotNumeric()) {\n return;\n }\n\n const value = parserInput.$re(/^([+-]?\\d*\\.?\\d+)(%|[a-z_]+)?/i);\n if (value) {\n return new(tree.Dimension)(value[1], value[2]);\n }\n },\n\n //\n // A unicode descriptor, as is used in unicode-range\n //\n // U+0?? or U+00A1-00A9\n //\n unicodeDescriptor: function () {\n let ud;\n\n ud = parserInput.$re(/^U\\+[0-9a-fA-F?]+(\\-[0-9a-fA-F?]+)?/);\n if (ud) {\n return new(tree.UnicodeDescriptor)(ud[0]);\n }\n },\n\n //\n // JavaScript code to be evaluated\n //\n // `window.location.href`\n //\n javascript: function () {\n let js;\n const index = parserInput.i;\n\n parserInput.save();\n\n const escape = parserInput.$char('~');\n const jsQuote = parserInput.$char('`');\n\n if (!jsQuote) {\n parserInput.restore();\n return;\n }\n\n js = parserInput.$re(/^[^`]*`/);\n if (js) {\n parserInput.forget();\n return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index, fileInfo);\n }\n parserInput.restore('invalid javascript definition');\n }\n },\n\n //\n // The variable part of a variable definition. Used in the `rule` parser\n //\n // @fink:\n //\n variable: function () {\n let name;\n\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\\w-]+)\\s*:/))) { return name[1]; }\n },\n\n //\n // Call a variable value to retrieve a detached ruleset\n // or a value from a detached ruleset's rules.\n //\n // @fink();\n // @fink;\n // color: @fink[@color];\n //\n variableCall: function (parsedName) {\n let lookups;\n const i = parserInput.i;\n const inValue = !!parsedName;\n let name = parsedName;\n\n parserInput.save();\n\n if (name || (parserInput.currentChar() === '@'\n && (name = parserInput.$re(/^(@[\\w-]+)(\\(\\s*\\))?/)))) {\n\n lookups = this.mixin.ruleLookups();\n\n if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {\n parserInput.restore('Missing \\'[...]\\' lookup in variable call');\n return;\n }\n\n if (!inValue) {\n name = name[1];\n }\n\n const call = new tree.VariableCall(name, i, fileInfo);\n if (!inValue && parsers.end()) {\n parserInput.forget();\n return call;\n }\n else {\n parserInput.forget();\n return new tree.NamespaceValue(call, lookups, i, fileInfo);\n }\n }\n\n parserInput.restore();\n },\n\n //\n // extend syntax - used to extend selectors\n //\n extend: function(isRule) {\n let elements;\n let e;\n const index = parserInput.i;\n let option;\n let extendList;\n let extend;\n\n if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {\n return;\n }\n\n do {\n option = null;\n elements = null;\n while (!(option = parserInput.$re(/^(all)(?=\\s*(\\)|,))/))) {\n e = this.element();\n if (!e) {\n break;\n }\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n }\n\n option = option && option[1];\n if (!elements) {\n error('Missing target selector for :extend().');\n }\n extend = new(tree.Extend)(new(tree.Selector)(elements), option, index, fileInfo);\n if (extendList) {\n extendList.push(extend);\n } else {\n extendList = [ extend ];\n }\n } while (parserInput.$char(','));\n\n expect(/^\\)/);\n\n if (isRule) {\n expect(/^;/);\n }\n\n return extendList;\n },\n\n //\n // extendRule - used in a rule to extend all the parent selectors\n //\n extendRule: function() {\n return this.extend(true);\n },\n\n //\n // Mixins\n //\n mixin: {\n //\n // A Mixin call, with an optional argument list\n //\n // #mixins > .square(#fff);\n // #mixins.square(#fff);\n // .rounded(4px, black);\n // .button;\n //\n // We can lookup / return a value using the lookup syntax:\n //\n // color: #mixin.square(#fff)[@color];\n //\n // The `while` loop is there because mixins can be\n // namespaced, but we only support the child and descendant\n // selector for now.\n //\n call: function (inValue, getLookup) {\n const s = parserInput.currentChar();\n let important = false;\n let lookups;\n const index = parserInput.i;\n let elements;\n let args;\n let hasParens;\n\n if (s !== '.' && s !== '#') { return; }\n\n parserInput.save(); // stop us absorbing part of an invalid selector\n\n elements = this.elements();\n\n if (elements) {\n if (parserInput.$char('(')) {\n args = this.args(true).args;\n expectChar(')');\n hasParens = true;\n }\n\n if (getLookup !== false) {\n lookups = this.ruleLookups();\n }\n if (getLookup === true && !lookups) {\n parserInput.restore();\n return;\n }\n\n if (inValue && !lookups && !hasParens) {\n // This isn't a valid in-value mixin call\n parserInput.restore();\n return;\n }\n\n if (!inValue && parsers.important()) {\n important = true;\n }\n\n if (inValue || parsers.end()) {\n parserInput.forget();\n const mixin = new(tree.mixin.Call)(elements, args, index, fileInfo, !lookups && important);\n if (lookups) {\n return new tree.NamespaceValue(mixin, lookups);\n }\n else {\n return mixin;\n }\n }\n }\n\n parserInput.restore();\n },\n /**\n * Matching elements for mixins\n * (Start with . or # and can have > )\n */\n elements: function() {\n let elements;\n let e;\n let c;\n let elem;\n let elemIndex;\n const re = /^[#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;\n while (true) {\n elemIndex = parserInput.i;\n e = parserInput.$re(re);\n \n if (!e) {\n break;\n }\n elem = new(tree.Element)(c, e, false, elemIndex, fileInfo);\n if (elements) {\n elements.push(elem);\n } else {\n elements = [ elem ];\n }\n c = parserInput.$char('>');\n }\n return elements;\n },\n args: function (isCall) {\n const entities = parsers.entities;\n const returner = { args:null, variadic: false };\n let expressions = [];\n const argsSemiColon = [];\n const argsComma = [];\n let isSemiColonSeparated;\n let expressionContainsNamed;\n let name;\n let nameLoop;\n let value;\n let arg;\n let expand;\n let hasSep = true;\n\n parserInput.save();\n\n while (true) {\n if (isCall) {\n arg = parsers.detachedRuleset() || parsers.expression();\n } else {\n parserInput.commentStore.length = 0;\n if (parserInput.$str('...')) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ variadic: true });\n break;\n }\n arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);\n }\n\n if (!arg || !hasSep) {\n break;\n }\n\n nameLoop = null;\n if (arg.throwAwayComments) {\n arg.throwAwayComments();\n }\n value = arg;\n let val = null;\n\n if (isCall) {\n // Variable\n if (arg.value && arg.value.length == 1) {\n val = arg.value[0];\n }\n } else {\n val = arg;\n }\n\n if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {\n if (parserInput.$char(':')) {\n if (expressions.length > 0) {\n if (isSemiColonSeparated) {\n error('Cannot mix ; and , as delimiter types');\n }\n expressionContainsNamed = true;\n }\n\n value = parsers.detachedRuleset() || parsers.expression();\n\n if (!value) {\n if (isCall) {\n error('could not understand value for named argument');\n } else {\n parserInput.restore();\n returner.args = [];\n return returner;\n }\n }\n nameLoop = (name = val.name);\n } else if (parserInput.$str('...')) {\n if (!isCall) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ name: arg.name, variadic: true });\n break;\n } else {\n expand = true;\n }\n } else if (!isCall) {\n name = nameLoop = val.name;\n value = null;\n }\n }\n\n if (value) {\n expressions.push(value);\n }\n\n argsComma.push({ name:nameLoop, value, expand });\n\n if (parserInput.$char(',')) {\n hasSep = true;\n continue;\n }\n hasSep = parserInput.$char(';') === ';';\n\n if (hasSep || isSemiColonSeparated) {\n\n if (expressionContainsNamed) {\n error('Cannot mix ; and , as delimiter types');\n }\n\n isSemiColonSeparated = true;\n\n if (expressions.length > 1) {\n value = new(tree.Value)(expressions);\n }\n argsSemiColon.push({ name, value, expand });\n\n name = null;\n expressions = [];\n expressionContainsNamed = false;\n }\n }\n\n parserInput.forget();\n returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;\n return returner;\n },\n //\n // A Mixin definition, with a list of parameters\n //\n // .rounded (@radius: 2px, @color) {\n // ...\n // }\n //\n // Until we have a finer grained state-machine, we have to\n // do a look-ahead, to make sure we don't have a mixin call.\n // See the `rule` function for more information.\n //\n // We start by matching `.rounded (`, and then proceed on to\n // the argument list, which has optional default values.\n // We store the parameters in `params`, with a `value` key,\n // if there is a value, such as in the case of `@radius`.\n //\n // Once we've got our params list, and a closing `)`, we parse\n // the `{...}` block.\n //\n definition: function () {\n let name;\n let params = [];\n let match;\n let ruleset;\n let cond;\n let variadic = false;\n if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||\n parserInput.peek(/^[^{]*\\}/)) {\n return;\n }\n\n parserInput.save();\n\n match = parserInput.$re(/^([#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\\s*\\(/);\n if (match) {\n name = match[1];\n\n const argInfo = this.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n\n // .mixincall(\"@{a}\");\n // looks a bit like a mixin definition..\n // also\n // .mixincall(@a: {rule: set;});\n // so we have to be nice and restore\n if (!parserInput.$char(')')) {\n parserInput.restore('Missing closing \\')\\'');\n return;\n }\n\n parserInput.commentStore.length = 0;\n\n if (parserInput.$str('when')) { // Guard\n cond = expect(parsers.conditions, 'expected condition');\n }\n\n ruleset = parsers.block();\n\n if (ruleset) {\n parserInput.forget();\n return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);\n } else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n \n ruleLookups: function() {\n let rule;\n let args;\n const lookups = [];\n\n if (parserInput.currentChar() !== '[') { \n return;\n }\n\n while (true) {\n parserInput.save();\n args = null;\n rule = this.lookupValue();\n if (!rule && rule !== '') {\n parserInput.restore();\n break;\n }\n lookups.push(rule);\n parserInput.forget();\n }\n if (lookups.length > 0) {\n return lookups;\n }\n },\n \n lookupValue: function() {\n parserInput.save();\n \n if (!parserInput.$char('[')) { \n parserInput.restore();\n return;\n }\n \n const name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);\n \n if (!parserInput.$char(']')) {\n parserInput.restore();\n return;\n } \n\n if (name || name === '') {\n parserInput.forget();\n return name;\n }\n \n parserInput.restore();\n }\n },\n //\n // Entities are the smallest recognized token,\n // and can be found inside a rule's value.\n //\n entity: function () {\n const entities = this.entities;\n\n return this.comment() || entities.literal() || entities.variable() || entities.url() ||\n entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||\n entities.javascript();\n },\n\n //\n // A Declaration terminator. Note that we use `peek()` to check for '}',\n // because the `block` rule will be expecting it, but we still need to make sure\n // it's there, if ';' was omitted.\n //\n end: function () {\n return parserInput.$char(';') || parserInput.peek('}');\n },\n\n //\n // IE's alpha function\n //\n // alpha(opacity=88)\n //\n ieAlpha: function () {\n let value;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (!parserInput.$re(/^opacity=/i)) { return; }\n value = parserInput.$re(/^\\d+/);\n if (!value) {\n value = expect(parsers.entities.variable, 'Could not parse alpha');\n value = `@{${value.name.slice(1)}}`;\n }\n expectChar(')');\n return new tree.Quoted('', `alpha(opacity=${value})`);\n },\n\n //\n // A Selector Element\n //\n // div\n // + h1\n // #socks\n // input[type=\"text\"]\n //\n // Elements are the building blocks for Selectors,\n // they are made out of a `Combinator` (see combinator rule),\n // and an element name, such as a tag a class, or `*`.\n //\n element: function () {\n let e;\n let c;\n let v;\n const index = parserInput.i;\n\n c = this.combinator();\n\n e = parserInput.$re(/^(?:\\d+\\.\\d+|\\d+)%/) ||\n parserInput.$re(/^(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||\n parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||\n parserInput.$re(/^\\([^&()@]+\\)/) || parserInput.$re(/^[\\.#:](?=@)/) ||\n this.entities.variableCurly();\n\n if (!e) {\n parserInput.save();\n if (parserInput.$char('(')) {\n if ((v = this.selector(false)) && parserInput.$char(')')) {\n e = new(tree.Paren)(v);\n parserInput.forget();\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.forget();\n }\n }\n\n if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index, fileInfo); }\n },\n\n //\n // Combinators combine elements together, in a Selector.\n //\n // Because our parser isn't white-space sensitive, special care\n // has to be taken, when parsing the descendant combinator, ` `,\n // as it's an empty space. We have to check the previous character\n // in the input, to see if it's a ` ` character. More info on how\n // we deal with this in *combinator.js*.\n //\n combinator: function () {\n let c = parserInput.currentChar();\n\n if (c === '/') {\n parserInput.save();\n const slashedCombinator = parserInput.$re(/^\\/[a-z]+\\//i);\n if (slashedCombinator) {\n parserInput.forget();\n return new(tree.Combinator)(slashedCombinator);\n }\n parserInput.restore();\n }\n\n if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {\n parserInput.i++;\n if (c === '^' && parserInput.currentChar() === '^') {\n c = '^^';\n parserInput.i++;\n }\n while (parserInput.isWhitespace()) { parserInput.i++; }\n return new(tree.Combinator)(c);\n } else if (parserInput.isWhitespace(-1)) {\n return new(tree.Combinator)(' ');\n } else {\n return new(tree.Combinator)(null);\n }\n },\n //\n // A CSS Selector\n // with less extensions e.g. the ability to extend and guard\n //\n // .class > div + h1\n // li a:hover\n //\n // Selectors are made out of one or more Elements, see above.\n //\n selector: function (isLess) {\n const index = parserInput.i;\n let elements;\n let extendList;\n let c;\n let e;\n let allExtends;\n let when;\n let condition;\n isLess = isLess !== false;\n while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {\n if (when) {\n condition = expect(this.conditions, 'expected condition');\n } else if (condition) {\n error('CSS guard can only be used at the end of selector');\n } else if (extendList) {\n if (allExtends) {\n allExtends = allExtends.concat(extendList);\n } else {\n allExtends = extendList;\n }\n } else {\n if (allExtends) { error('Extend can only be used at the end of selector'); }\n c = parserInput.currentChar();\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n e = null;\n }\n if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {\n break;\n }\n }\n\n if (elements) { return new(tree.Selector)(elements, allExtends, condition, index, fileInfo); }\n if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); }\n },\n selectors: function () {\n let s;\n let selectors;\n while (true) {\n s = this.selector();\n if (!s) {\n break;\n }\n if (selectors) {\n selectors.push(s);\n } else {\n selectors = [ s ];\n }\n parserInput.commentStore.length = 0;\n if (s.condition && selectors.length > 1) {\n error(\"Guards are only currently allowed on a single selector.\");\n }\n if (!parserInput.$char(',')) { break; }\n if (s.condition) {\n error(\"Guards are only currently allowed on a single selector.\");\n }\n parserInput.commentStore.length = 0;\n }\n return selectors;\n },\n attribute: function () {\n if (!parserInput.$char('[')) { return; }\n\n const entities = this.entities;\n let key;\n let val;\n let op;\n\n if (!(key = entities.variableCurly())) {\n key = expect(/^(?:[_A-Za-z0-9-\\*]*\\|)?(?:[_A-Za-z0-9-]|\\\\.)+/);\n }\n\n op = parserInput.$re(/^[|~*$^]?=/);\n if (op) {\n val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\\w-]+/) || entities.variableCurly();\n }\n\n expectChar(']');\n\n return new(tree.Attribute)(key, op, val);\n },\n\n //\n // The `block` rule is used by `ruleset` and `mixin.definition`.\n // It's a wrapper around the `primary` rule, with added `{}`.\n //\n block: function () {\n let content;\n if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {\n return content;\n }\n },\n\n blockRuleset: function() {\n let block = this.block();\n\n if (block) {\n block = new tree.Ruleset(null, block);\n }\n return block;\n },\n\n detachedRuleset: function() {\n let argInfo;\n let params;\n let variadic;\n\n parserInput.save();\n if (parserInput.$re(/^[.#]\\(/)) {\n /**\n * DR args currently only implemented for each() function, and not \n * yet settable as `@dr: #(@arg) {}`\n * This should be done when DRs are merged with mixins.\n * See: https://github.com/less/less-meta/issues/16\n */\n argInfo = this.mixin.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return;\n }\n }\n const blockRuleset = this.blockRuleset();\n if (blockRuleset) {\n parserInput.forget();\n if (params) {\n return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);\n }\n return new tree.DetachedRuleset(blockRuleset);\n }\n parserInput.restore();\n },\n\n //\n // div, .class, body > p {...}\n //\n ruleset: function () {\n let selectors;\n let rules;\n let debugInfo;\n\n parserInput.save();\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(parserInput.i);\n }\n\n selectors = this.selectors();\n\n if (selectors && (rules = this.block())) {\n parserInput.forget();\n const ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports);\n if (context.dumpLineNumbers) {\n ruleset.debugInfo = debugInfo;\n }\n return ruleset;\n } else {\n parserInput.restore();\n }\n },\n declaration: function () {\n let name;\n let value;\n const index = parserInput.i;\n let hasDR;\n const c = parserInput.currentChar();\n let important;\n let merge;\n let isVariable;\n\n if (c === '.' || c === '#' || c === '&' || c === ':') { return; }\n\n parserInput.save();\n\n name = this.variable() || this.ruleProperty();\n if (name) {\n isVariable = typeof name === 'string';\n\n if (isVariable) {\n value = this.detachedRuleset();\n if (value) {\n hasDR = true;\n }\n }\n\n parserInput.commentStore.length = 0;\n if (!value) {\n // a name returned by this.ruleProperty() is always an array of the form:\n // [string-1, ..., string-n, \"\"] or [string-1, ..., string-n, \"+\"]\n // where each item is a tree.Keyword or tree.Variable\n merge = !isVariable && name.length > 1 && name.pop().value;\n\n // Custom property values get permissive parsing\n if (name[0].value && name[0].value.slice(0, 2) === '--') {\n value = this.permissiveValue();\n }\n // Try to store values as anonymous\n // If we need the value later we'll re-parse it in ruleset.parseValue\n else {\n value = this.anonymousValue();\n }\n if (value) {\n parserInput.forget();\n // anonymous values absorb the end ';' which is required for them to work\n return new(tree.Declaration)(name, value, false, merge, index, fileInfo);\n }\n\n if (!value) {\n value = this.value();\n }\n\n if (value) {\n important = this.important();\n } else if (isVariable) {\n // As a last resort, try permissiveValue\n value = this.permissiveValue();\n }\n }\n\n if (value && (this.end() || hasDR)) {\n parserInput.forget();\n return new(tree.Declaration)(name, value, important, merge, index, fileInfo);\n }\n else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n anonymousValue: function () {\n const index = parserInput.i;\n const match = parserInput.$re(/^([^.#@\\$+\\/'\"*`(;{}-]*);/);\n if (match) {\n return new(tree.Anonymous)(match[1], index);\n }\n },\n /**\n * Used for custom properties, at-rules, and variables (as fallback)\n * Parses almost anything inside of {} [] () \"\" blocks\n * until it reaches outer-most tokens.\n * \n * First, it will try to parse comments and entities to reach\n * the end. This is mostly like the Expression parser except no\n * math is allowed.\n */\n permissiveValue: function (untilTokens) {\n let i;\n let e;\n let done;\n let value;\n const tok = untilTokens || ';';\n const index = parserInput.i;\n const result = [];\n\n function testCurrentChar() {\n const char = parserInput.currentChar();\n if (typeof tok === 'string') {\n return char === tok;\n } else {\n return tok.test(char);\n }\n }\n if (testCurrentChar()) {\n return;\n }\n value = [];\n do {\n e = this.comment();\n if (e) {\n value.push(e);\n continue;\n }\n e = this.entity();\n if (e) {\n value.push(e);\n }\n } while (e);\n\n done = testCurrentChar();\n\n if (value.length > 0) {\n value = new(tree.Expression)(value);\n if (done) {\n return value;\n }\n else {\n result.push(value);\n }\n // Preserve space before $parseUntil as it will not\n if (parserInput.prevChar() === ' ') {\n result.push(new tree.Anonymous(' ', index));\n }\n }\n parserInput.save();\n\n value = parserInput.$parseUntil(tok);\n\n if (value) {\n if (typeof value === 'string') {\n error(`Expected '${value}'`, 'Parse');\n }\n if (value.length === 1 && value[0] === ' ') {\n parserInput.forget();\n return new tree.Anonymous('', index);\n }\n let item;\n for (i = 0; i < value.length; i++) {\n item = value[i];\n if (Array.isArray(item)) {\n // Treat actual quotes as normal quoted values\n result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));\n }\n else {\n if (i === value.length - 1) {\n item = item.trim();\n }\n // Treat like quoted values, but replace vars like unquoted expressions\n const quote = new tree.Quoted('\\'', item, true, index, fileInfo);\n quote.variableRegex = /@([\\w-]+)/g;\n quote.propRegex = /\\$([\\w-]+)/g;\n result.push(quote);\n }\n }\n parserInput.forget();\n return new tree.Expression(result, true);\n }\n parserInput.restore();\n },\n\n //\n // An @import atrule\n //\n // @import \"lib\";\n //\n // Depending on our environment, importing is done differently:\n // In the browser, it's an XHR request, in Node, it would be a\n // file-system operation. The function used for importing is\n // stored in `import`, which we pass to the Import constructor.\n //\n 'import': function () {\n let path;\n let features;\n const index = parserInput.i;\n\n const dir = parserInput.$re(/^@import?\\s+/);\n\n if (dir) {\n const options = (dir ? this.importOptions() : null) || {};\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n features = this.mediaFeatures();\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon or unrecognised media features on import');\n }\n features = features && new(tree.Value)(features);\n return new(tree.Import)(path, features, options, index, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed import statement');\n }\n }\n },\n\n importOptions: function() {\n let o;\n const options = {};\n let optionName;\n let value;\n\n // list of options, surrounded by parens\n if (!parserInput.$char('(')) { return null; }\n do {\n o = this.importOption();\n if (o) {\n optionName = o;\n value = true;\n switch (optionName) {\n case 'css':\n optionName = 'less';\n value = false;\n break;\n case 'once':\n optionName = 'multiple';\n value = false;\n break;\n }\n options[optionName] = value;\n if (!parserInput.$char(',')) { break; }\n }\n } while (o);\n expectChar(')');\n return options;\n },\n\n importOption: function() {\n const opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);\n if (opt) {\n return opt[1];\n }\n },\n\n mediaFeature: function () {\n const entities = this.entities;\n const nodes = [];\n let e;\n let p;\n parserInput.save();\n do {\n e = entities.keyword() || entities.variable() || entities.mixinLookup();\n if (e) {\n nodes.push(e);\n } else if (parserInput.$char('(')) {\n p = this.property();\n e = this.value();\n if (parserInput.$char(')')) {\n if (p && e) {\n nodes.push(new(tree.Paren)(new(tree.Declaration)(p, e, null, null, parserInput.i, fileInfo, true)));\n } else if (e) {\n nodes.push(new(tree.Paren)(e));\n } else {\n error('badly formed media feature definition');\n }\n } else {\n error('Missing closing \\')\\'', 'Parse');\n }\n }\n } while (e);\n\n parserInput.forget();\n if (nodes.length > 0) {\n return new(tree.Expression)(nodes);\n }\n },\n\n mediaFeatures: function () {\n const entities = this.entities;\n const features = [];\n let e;\n do {\n e = this.mediaFeature();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n } else {\n e = entities.variable() || entities.mixinLookup();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n }\n } while (e);\n\n return features.length > 0 ? features : null;\n },\n\n media: function () {\n let features;\n let rules;\n let media;\n let debugInfo;\n const index = parserInput.i;\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(index);\n }\n\n parserInput.save();\n\n if (parserInput.$str('@media')) {\n features = this.mediaFeatures();\n\n rules = this.block();\n\n if (!rules) {\n error('media definitions require block statements after any features');\n }\n\n parserInput.forget();\n\n media = new(tree.Media)(rules, features, index, fileInfo);\n if (context.dumpLineNumbers) {\n media.debugInfo = debugInfo;\n }\n\n return media;\n }\n\n parserInput.restore();\n },\n\n //\n\n // A @plugin directive, used to import plugins dynamically.\n //\n // @plugin (args) \"lib\";\n //\n plugin: function () {\n let path;\n let args;\n let options;\n const index = parserInput.i;\n const dir = parserInput.$re(/^@plugin?\\s+/);\n\n if (dir) {\n args = this.pluginArgs();\n\n if (args) {\n options = {\n pluginArgs: args,\n isPlugin: true\n };\n }\n else {\n options = { isPlugin: true };\n }\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon on @plugin');\n }\n return new(tree.Import)(path, null, options, index, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed @plugin statement');\n }\n }\n },\n\n pluginArgs: function() {\n // list of options, surrounded by parens\n parserInput.save();\n if (!parserInput.$char('(')) {\n parserInput.restore();\n return null;\n }\n const args = parserInput.$re(/^\\s*([^\\);]+)\\)\\s*/);\n if (args[1]) {\n parserInput.forget();\n return args[1].trim();\n }\n else { \n parserInput.restore();\n return null;\n }\n },\n\n //\n // A CSS AtRule\n //\n // @charset \"utf-8\";\n //\n atrule: function () {\n const index = parserInput.i;\n let name;\n let value;\n let rules;\n let nonVendorSpecificName;\n let hasIdentifier;\n let hasExpression;\n let hasUnknown;\n let hasBlock = true;\n let isRooted = true;\n\n if (parserInput.currentChar() !== '@') { return; }\n\n value = this['import']() || this.plugin() || this.media();\n if (value) {\n return value;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^@[a-z-]+/);\n\n if (!name) { return; }\n\n nonVendorSpecificName = name;\n if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {\n nonVendorSpecificName = `@${name.slice(name.indexOf('-', 2) + 1)}`;\n }\n\n switch (nonVendorSpecificName) {\n case '@charset':\n hasIdentifier = true;\n hasBlock = false;\n break;\n case '@namespace':\n hasExpression = true;\n hasBlock = false;\n break;\n case '@keyframes':\n case '@counter-style':\n hasIdentifier = true;\n break;\n case '@document':\n case '@supports':\n hasUnknown = true;\n isRooted = false;\n break;\n default:\n hasUnknown = true;\n break;\n }\n\n parserInput.commentStore.length = 0;\n\n if (hasIdentifier) {\n value = this.entity();\n if (!value) {\n error(`expected ${name} identifier`);\n }\n } else if (hasExpression) {\n value = this.expression();\n if (!value) {\n error(`expected ${name} expression`);\n }\n } else if (hasUnknown) {\n value = this.permissiveValue(/^[{;]/);\n hasBlock = (parserInput.currentChar() === '{');\n if (!value) {\n if (!hasBlock && parserInput.currentChar() !== ';') {\n error(`${name} rule is missing block or ending semi-colon`);\n }\n }\n else if (!value.value) {\n value = null;\n }\n }\n\n if (hasBlock) {\n rules = this.blockRuleset();\n }\n\n if (rules || (!hasBlock && value && parserInput.$char(';'))) {\n parserInput.forget();\n return new(tree.AtRule)(name, value, rules, index, fileInfo,\n context.dumpLineNumbers ? getDebugInfo(index) : null,\n isRooted\n );\n }\n\n parserInput.restore('at-rule options not recognised');\n },\n\n //\n // A Value is a comma-delimited list of Expressions\n //\n // font-family: Baskerville, Georgia, serif;\n //\n // In a Rule, a Value represents everything after the `:`,\n // and before the `;`.\n //\n value: function () {\n let e;\n const expressions = [];\n const index = parserInput.i;\n\n do {\n e = this.expression();\n if (e) {\n expressions.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n } while (e);\n\n if (expressions.length > 0) {\n return new(tree.Value)(expressions, index);\n }\n },\n important: function () {\n if (parserInput.currentChar() === '!') {\n return parserInput.$re(/^! *important/);\n }\n },\n sub: function () {\n let a;\n let e;\n\n parserInput.save();\n if (parserInput.$char('(')) {\n a = this.addition();\n if (a && parserInput.$char(')')) {\n parserInput.forget();\n e = new(tree.Expression)([a]);\n e.parens = true;\n return e;\n }\n parserInput.restore('Expected \\')\\'');\n return;\n }\n parserInput.restore();\n },\n multiplication: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.operand();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n if (parserInput.peek(/^\\/[*\\/]/)) {\n break;\n }\n\n parserInput.save();\n\n op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./');\n\n if (!op) { parserInput.forget(); break; }\n\n a = this.operand();\n\n if (!a) { parserInput.restore(); break; }\n parserInput.forget();\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n addition: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.multiplication();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n op = parserInput.$re(/^[-+]\\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));\n if (!op) {\n break;\n }\n a = this.multiplication();\n if (!a) {\n break;\n }\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n conditions: function () {\n let a;\n let b;\n const index = parserInput.i;\n let condition;\n\n a = this.condition(true);\n if (a) {\n while (true) {\n if (!parserInput.peek(/^,\\s*(not\\s*)?\\(/) || !parserInput.$char(',')) {\n break;\n }\n b = this.condition(true);\n if (!b) {\n break;\n }\n condition = new(tree.Condition)('or', condition || a, b, index);\n }\n return condition || a;\n }\n },\n condition: function (needsParens) {\n let result;\n let logical;\n let next;\n function or() {\n return parserInput.$str('or');\n }\n\n result = this.conditionAnd(needsParens);\n if (!result) {\n return ;\n }\n logical = or();\n if (logical) {\n next = this.condition(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n conditionAnd: function (needsParens) {\n let result;\n let logical;\n let next;\n const self = this;\n function insideCondition() {\n const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);\n if (!cond && !needsParens) {\n return self.atomicCondition(needsParens);\n }\n return cond;\n }\n function and() {\n return parserInput.$str('and');\n }\n\n result = insideCondition();\n if (!result) {\n return ;\n }\n logical = and();\n if (logical) {\n next = this.conditionAnd(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n negatedCondition: function (needsParens) {\n if (parserInput.$str('not')) {\n const result = this.parenthesisCondition(needsParens);\n if (result) {\n result.negate = !result.negate;\n }\n return result;\n }\n },\n parenthesisCondition: function (needsParens) {\n function tryConditionFollowedByParenthesis(me) {\n let body;\n parserInput.save();\n body = me.condition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return ;\n }\n parserInput.forget();\n return body;\n }\n\n let body;\n parserInput.save();\n if (!parserInput.$str('(')) {\n parserInput.restore();\n return ;\n }\n body = tryConditionFollowedByParenthesis(this);\n if (body) {\n parserInput.forget();\n return body;\n }\n\n body = this.atomicCondition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore(`expected ')' got '${parserInput.currentChar()}'`);\n return ;\n }\n parserInput.forget();\n return body;\n },\n atomicCondition: function (needsParens) {\n const entities = this.entities;\n const index = parserInput.i;\n let a;\n let b;\n let c;\n let op;\n\n function cond() {\n return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();\n }\n cond = cond.bind(this);\n\n a = cond();\n if (a) {\n if (parserInput.$char('>')) {\n if (parserInput.$char('=')) {\n op = '>=';\n } else {\n op = '>';\n }\n } else\n if (parserInput.$char('<')) {\n if (parserInput.$char('=')) {\n op = '<=';\n } else {\n op = '<';\n }\n } else\n if (parserInput.$char('=')) {\n if (parserInput.$char('>')) {\n op = '=>';\n } else if (parserInput.$char('<')) {\n op = '=<';\n } else {\n op = '=';\n }\n }\n if (op) {\n b = cond();\n if (b) {\n c = new(tree.Condition)(op, a, b, index, false);\n } else {\n error('expected expression');\n }\n } else {\n c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index, false);\n }\n return c;\n }\n },\n\n //\n // An operand is anything that can be part of an operation,\n // such as a Color, or a Variable\n //\n operand: function () {\n const entities = this.entities;\n let negate;\n\n if (parserInput.peek(/^-[@\\$\\(]/)) {\n negate = parserInput.$char('-');\n }\n\n let o = this.sub() || entities.dimension() ||\n entities.color() || entities.variable() ||\n entities.property() || entities.call() ||\n entities.quoted(true) || entities.colorKeyword() ||\n entities.mixinLookup();\n\n if (negate) {\n o.parensInOp = true;\n o = new(tree.Negative)(o);\n }\n\n return o;\n },\n\n //\n // Expressions either represent mathematical operations,\n // or white-space delimited Entities.\n //\n // 1px solid black\n // @var * 2\n //\n expression: function () {\n const entities = [];\n let e;\n let delim;\n const index = parserInput.i;\n\n do {\n e = this.comment();\n if (e) {\n entities.push(e);\n continue;\n }\n e = this.addition() || this.entity();\n\n if (e instanceof tree.Comment) {\n e = null;\n }\n\n if (e) {\n entities.push(e);\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!parserInput.peek(/^\\/[\\/*]/)) {\n delim = parserInput.$char('/');\n if (delim) {\n entities.push(new(tree.Anonymous)(delim, index));\n }\n }\n }\n } while (e);\n if (entities.length > 0) {\n return new(tree.Expression)(entities);\n }\n },\n property: function () {\n const name = parserInput.$re(/^(\\*?-?[_a-zA-Z0-9-]+)\\s*:/);\n if (name) {\n return name[1];\n }\n },\n ruleProperty: function () {\n let name = [];\n const index = [];\n let s;\n let k;\n\n parserInput.save();\n\n const simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\\s*:/);\n if (simpleProperty) {\n name = [new(tree.Keyword)(simpleProperty[1])];\n parserInput.forget();\n return name;\n }\n\n function match(re) {\n const i = parserInput.i;\n const chunk = parserInput.$re(re);\n if (chunk) {\n index.push(i);\n return name.push(chunk[1]);\n }\n }\n\n match(/^(\\*?)/);\n while (true) {\n if (!match(/^((?:[\\w-]+)|(?:[@\\$]\\{[\\w-]+\\}))/)) {\n break;\n }\n }\n\n if ((name.length > 1) && match(/^((?:\\+_|\\+)?)\\s*:/)) {\n parserInput.forget();\n\n // at last, we have the complete match now. move forward,\n // convert name particles to tree objects and return:\n if (name[0] === '') {\n name.shift();\n index.shift();\n }\n for (k = 0; k < name.length; k++) {\n s = name[k];\n name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?\n new(tree.Keyword)(s) :\n (s.charAt(0) === '@' ?\n new(tree.Variable)(`@${s.slice(2, -1)}`, index[k], fileInfo) :\n new(tree.Property)(`$${s.slice(2, -1)}`, index[k], fileInfo));\n }\n return name;\n }\n parserInput.restore();\n }\n }\n };\n};\nParser.serializeVars = vars => {\n let s = '';\n\n for (const name in vars) {\n if (Object.hasOwnProperty.call(vars, name)) {\n const value = vars[name];\n s += `${((name[0] === '@') ? '' : '@') + name}: ${value}${(String(value).slice(-1) === ';') ? '' : ';'}`;\n }\n }\n\n return s;\n};\n\nexport default Parser;\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nlet colorFunctions;\n\nfunction clamp(val) {\n return Math.min(1, Math.max(0, val));\n}\nfunction hsla(origColor, hsl) {\n const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);\n if (color) {\n if (origColor.value && \n /^(rgb|hsl)/.test(origColor.value)) {\n color.value = origColor.value;\n } else {\n color.value = 'rgb';\n }\n return color;\n }\n}\nfunction toHSL(color) {\n if (color.toHSL) {\n return color.toHSL();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction toHSV(color) {\n if (color.toHSV) {\n return color.toHSV();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction number(n) {\n if (n instanceof Dimension) {\n return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);\n } else if (typeof n === 'number') {\n return n;\n } else {\n throw {\n type: 'Argument',\n message: 'color functions take numbers as parameters'\n };\n }\n}\nfunction scaled(n, size) {\n if (n instanceof Dimension && n.unit.is('%')) {\n return parseFloat(n.value * size / 100);\n } else {\n return number(n);\n }\n}\ncolorFunctions = {\n rgb: function (r, g, b) {\n const color = colorFunctions.rgba(r, g, b, 1.0);\n if (color) {\n color.value = 'rgb';\n return color;\n }\n },\n rgba: function (r, g, b, a) {\n try {\n if (r instanceof Color) {\n if (g) {\n a = number(g);\n } else {\n a = r.alpha;\n }\n return new Color(r.rgb, a, 'rgba');\n }\n const rgb = [r, g, b].map(c => scaled(c, 255));\n a = number(a);\n return new Color(rgb, a, 'rgba');\n }\n catch (e) {}\n },\n hsl: function (h, s, l) {\n const color = colorFunctions.hsla(h, s, l, 1.0);\n if (color) {\n color.value = 'hsl';\n return color;\n }\n },\n hsla: function (h, s, l, a) {\n try {\n if (h instanceof Color) {\n if (s) {\n a = number(s);\n } else {\n a = h.alpha;\n }\n return new Color(h.rgb, a, 'hsla');\n }\n\n let m1;\n let m2;\n\n function hue(h) {\n h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n else if (h * 2 < 1) {\n return m2;\n }\n else if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n else {\n return m1;\n }\n }\n\n h = (number(h) % 360) / 360;\n s = clamp(number(s));l = clamp(number(l));a = clamp(number(a));\n\n m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n m1 = l * 2 - m2;\n\n const rgb = [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255\n ];\n a = number(a);\n return new Color(rgb, a, 'hsla');\n }\n catch (e) {}\n },\n\n hsv: function(h, s, v) {\n return colorFunctions.hsva(h, s, v, 1.0);\n },\n\n hsva: function(h, s, v, a) {\n h = ((number(h) % 360) / 360) * 360;\n s = number(s);v = number(v);a = number(a);\n\n let i;\n let f;\n i = Math.floor((h / 60) % 6);\n f = (h / 60) - i;\n\n const vs = [v,\n v * (1 - s),\n v * (1 - f * s),\n v * (1 - (1 - f) * s)];\n const perm = [[0, 3, 1],\n [2, 0, 1],\n [1, 0, 3],\n [1, 2, 0],\n [3, 1, 0],\n [0, 1, 2]];\n\n return colorFunctions.rgba(vs[perm[i][0]] * 255,\n vs[perm[i][1]] * 255,\n vs[perm[i][2]] * 255,\n a);\n },\n\n hue: function (color) {\n return new Dimension(toHSL(color).h);\n },\n saturation: function (color) {\n return new Dimension(toHSL(color).s * 100, '%');\n },\n lightness: function (color) {\n return new Dimension(toHSL(color).l * 100, '%');\n },\n hsvhue: function(color) {\n return new Dimension(toHSV(color).h);\n },\n hsvsaturation: function (color) {\n return new Dimension(toHSV(color).s * 100, '%');\n },\n hsvvalue: function (color) {\n return new Dimension(toHSV(color).v * 100, '%');\n },\n red: function (color) {\n return new Dimension(color.rgb[0]);\n },\n green: function (color) {\n return new Dimension(color.rgb[1]);\n },\n blue: function (color) {\n return new Dimension(color.rgb[2]);\n },\n alpha: function (color) {\n return new Dimension(toHSL(color).a);\n },\n luma: function (color) {\n return new Dimension(color.luma() * color.alpha * 100, '%');\n },\n luminance: function (color) {\n const luminance =\n (0.2126 * color.rgb[0] / 255) +\n (0.7152 * color.rgb[1] / 255) +\n (0.0722 * color.rgb[2] / 255);\n\n return new Dimension(luminance * color.alpha * 100, '%');\n },\n saturate: function (color, amount, method) {\n // filter: saturate(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s += hsl.s * amount.value / 100;\n }\n else {\n hsl.s += amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n desaturate: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s -= hsl.s * amount.value / 100;\n }\n else {\n hsl.s -= amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n lighten: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l += hsl.l * amount.value / 100;\n }\n else {\n hsl.l += amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n darken: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l -= hsl.l * amount.value / 100;\n }\n else {\n hsl.l -= amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n fadein: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a += hsl.a * amount.value / 100;\n }\n else {\n hsl.a += amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fadeout: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a -= hsl.a * amount.value / 100;\n }\n else {\n hsl.a -= amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fade: function (color, amount) {\n const hsl = toHSL(color);\n\n hsl.a = amount.value / 100;\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n spin: function (color, amount) {\n const hsl = toHSL(color);\n const hue = (hsl.h + amount.value) % 360;\n\n hsl.h = hue < 0 ? 360 + hue : hue;\n\n return hsla(color, hsl);\n },\n //\n // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein\n // http://sass-lang.com\n //\n mix: function (color1, color2, weight) {\n if (!weight) {\n weight = new Dimension(50);\n }\n const p = weight.value / 100.0;\n const w = p * 2 - 1;\n const a = toHSL(color1).a - toHSL(color2).a;\n\n const w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,\n color1.rgb[1] * w1 + color2.rgb[1] * w2,\n color1.rgb[2] * w1 + color2.rgb[2] * w2];\n\n const alpha = color1.alpha * p + color2.alpha * (1 - p);\n\n return new Color(rgb, alpha);\n },\n greyscale: function (color) {\n return colorFunctions.desaturate(color, new Dimension(100));\n },\n contrast: function (color, dark, light, threshold) {\n // filter: contrast(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n if (typeof light === 'undefined') {\n light = colorFunctions.rgba(255, 255, 255, 1.0);\n }\n if (typeof dark === 'undefined') {\n dark = colorFunctions.rgba(0, 0, 0, 1.0);\n }\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n const t = light;\n light = dark;\n dark = t;\n }\n if (typeof threshold === 'undefined') {\n threshold = 0.43;\n } else {\n threshold = number(threshold);\n }\n if (color.luma() < threshold) {\n return light;\n } else {\n return dark;\n }\n },\n // Changes made in 2.7.0 - Reverted in 3.0.0\n // contrast: function (color, color1, color2, threshold) {\n // // Return which of `color1` and `color2` has the greatest contrast with `color`\n // // according to the standard WCAG contrast ratio calculation.\n // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n // // The threshold param is no longer used, in line with SASS.\n // // filter: contrast(3.2);\n // // should be kept as is, so check for color\n // if (!color.rgb) {\n // return null;\n // }\n // if (typeof color1 === 'undefined') {\n // color1 = colorFunctions.rgba(0, 0, 0, 1.0);\n // }\n // if (typeof color2 === 'undefined') {\n // color2 = colorFunctions.rgba(255, 255, 255, 1.0);\n // }\n // var contrast1, contrast2;\n // var luma = color.luma();\n // var luma1 = color1.luma();\n // var luma2 = color2.luma();\n // // Calculate contrast ratios for each color\n // if (luma > luma1) {\n // contrast1 = (luma + 0.05) / (luma1 + 0.05);\n // } else {\n // contrast1 = (luma1 + 0.05) / (luma + 0.05);\n // }\n // if (luma > luma2) {\n // contrast2 = (luma + 0.05) / (luma2 + 0.05);\n // } else {\n // contrast2 = (luma2 + 0.05) / (luma + 0.05);\n // }\n // if (contrast1 > contrast2) {\n // return color1;\n // } else {\n // return color2;\n // }\n // },\n argb: function (color) {\n return new Anonymous(color.toARGB());\n },\n color: function(c) {\n if ((c instanceof Quoted) &&\n (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {\n const val = c.value.slice(1);\n return new Color(val, undefined, `#${val}`);\n }\n if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {\n c.value = undefined;\n return c;\n }\n throw {\n type: 'Argument',\n message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'\n };\n },\n tint: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);\n },\n shade: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);\n }\n};\n\nexport default colorFunctions;\n","import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\nfunction If(condition, trueValue, falseValue) {\n return condition ? trueValue\n : (falseValue || new Anonymous);\n}\n\nexport default { boolean, 'if': If };\n","import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n","import Comment from '../tree/comment';\nimport Dimension from '../tree/dimension';\nimport Declaration from '../tree/declaration';\nimport Expression from '../tree/expression';\nimport Ruleset from '../tree/ruleset';\nimport Selector from '../tree/selector';\nimport Element from '../tree/element';\nimport Quote from '../tree/quoted';\n\nconst getItemsFromNode = node => {\n // handle non-array values as an array of length 1\n // return 'undefined' if index is invalid\n const items = Array.isArray(node.value) ?\n node.value : Array(node);\n\n return items;\n};\n\nexport default {\n _SELF: function(n) {\n return n;\n },\n extract: function(values, index) {\n // (1-based index)\n index = index.value - 1;\n\n return getItemsFromNode(values)[index];\n },\n length: function(values) {\n return new Dimension(getItemsFromNode(values).length);\n },\n /**\n * Creates a Less list of incremental values.\n * Modeled after Lodash's range function, also exists natively in PHP\n * \n * @param {Dimension} [start=1]\n * @param {Dimension} end - e.g. 10 or 10px - unit is added to output\n * @param {Dimension} [step=1] \n */\n range: function(start, end, step) {\n let from;\n let to;\n let stepValue = 1;\n const list = [];\n if (end) {\n to = end;\n from = start.value;\n if (step) {\n stepValue = step.value;\n }\n }\n else {\n from = 1;\n to = start;\n }\n\n for (let i = from; i <= to.value; i += stepValue) {\n list.push(new Dimension(i, to.unit));\n }\n\n return new Expression(list);\n },\n each: function(list, rs) {\n const rules = [];\n let newRules;\n let iterator;\n\n if (list.value && !(list instanceof Quote)) {\n if (Array.isArray(list.value)) {\n iterator = list.value;\n } else {\n iterator = [list.value];\n }\n } else if (list.ruleset) {\n iterator = list.ruleset.rules;\n } else if (list.rules) {\n iterator = list.rules;\n } else if (Array.isArray(list)) {\n iterator = list;\n } else {\n iterator = [list];\n }\n\n let valueName = '@value';\n let keyName = '@key';\n let indexName = '@index';\n\n if (rs.params) {\n valueName = rs.params[0] && rs.params[0].name;\n keyName = rs.params[1] && rs.params[1].name;\n indexName = rs.params[2] && rs.params[2].name;\n rs = rs.rules;\n } else {\n rs = rs.ruleset;\n }\n\n for (let i = 0; i < iterator.length; i++) {\n let key;\n let value;\n const item = iterator[i];\n if (item instanceof Declaration) {\n key = typeof item.name === 'string' ? item.name : item.name[0].value;\n value = item.value;\n } else {\n key = new Dimension(i + 1);\n value = item;\n }\n\n if (item instanceof Comment) {\n continue;\n }\n\n newRules = rs.rules.slice(0);\n if (valueName) {\n newRules.push(new Declaration(valueName,\n value,\n false, false, this.index, this.currentFileInfo));\n }\n if (indexName) {\n newRules.push(new Declaration(indexName,\n new Dimension(i + 1),\n false, false, this.index, this.currentFileInfo));\n }\n if (keyName) {\n newRules.push(new Declaration(keyName,\n key,\n false, false, this.index, this.currentFileInfo));\n }\n\n rules.push(new Ruleset([ new(Selector)([ new Element(\"\", '&') ]) ],\n newRules,\n rs.strictImports,\n rs.visibilityInfo()\n ));\n }\n\n return new Ruleset([ new(Selector)([ new Element(\"\", '&') ]) ],\n rules,\n rs.strictImports,\n rs.visibilityInfo()\n ).eval(this.context);\n }\n};\n","import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit == null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;","import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n","import Dimension from '../tree/dimension';\nimport Anonymous from '../tree/anonymous';\nimport mathHelper from './math-helper.js';\n\nconst minMax = function (isMin, args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n let i; // key is the unit.toString() for unified Dimension values,\n let j;\n let current;\n let currentUnified;\n let referenceUnified;\n let unit;\n let unitStatic;\n let unitClone;\n\n const // elems only contains original argument values.\n order = [];\n\n const values = {};\n // value is the index into the order array.\n for (i = 0; i < args.length; i++) {\n current = args[i];\n if (!(current instanceof Dimension)) {\n if (Array.isArray(args[i].value)) {\n Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));\n }\n continue;\n }\n currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();\n unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();\n unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;\n unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;\n j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];\n if (j === undefined) {\n if (unitStatic !== undefined && unit !== unitStatic) {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n values[unit] = order.length;\n order.push(current);\n continue;\n }\n referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();\n if ( isMin && currentUnified.value < referenceUnified.value ||\n !isMin && currentUnified.value > referenceUnified.value) {\n order[j] = current;\n }\n }\n if (order.length == 1) {\n return order[0];\n }\n args = order.map(function (a) { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n return new Anonymous(`${isMin ? 'min' : 'max'}(${args})`);\n};\n\nexport default {\n min: function(...args) {\n return minMax(true, args);\n },\n max: function(...args) {\n return minMax(false, args);\n },\n convert: function (val, unit) {\n return val.convertTo(unit.value);\n },\n pi: function () {\n return new Dimension(Math.PI);\n },\n mod: function(a, b) {\n return new Dimension(a.value % b.value, a.unit);\n },\n pow: function(x, y) {\n if (typeof x === 'number' && typeof y === 'number') {\n x = new Dimension(x);\n y = new Dimension(y);\n } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {\n throw { type: 'Argument', message: 'arguments must be numbers' };\n }\n\n return new Dimension(Math.pow(x.value, y.value), x.unit);\n },\n percentage: function (n) {\n const result = mathHelper(num => num * 100, '%', n);\n\n return result;\n }\n};\n","/**\n * Plugin Manager\n */\nclass PluginManager {\n constructor(less) {\n this.less = less;\n this.visitors = [];\n this.preProcessors = [];\n this.postProcessors = [];\n this.installedPlugins = [];\n this.fileManagers = [];\n this.iterator = -1;\n this.pluginCache = {};\n this.Loader = new less.PluginLoader(less);\n }\n\n /**\n * Adds all the plugins in the array\n * @param {Array} plugins\n */\n addPlugins(plugins) {\n if (plugins) {\n for (let i = 0; i < plugins.length; i++) {\n this.addPlugin(plugins[i]);\n }\n }\n }\n\n /**\n *\n * @param plugin\n * @param {String} filename\n */\n addPlugin(plugin, filename, functionRegistry) {\n this.installedPlugins.push(plugin);\n if (filename) {\n this.pluginCache[filename] = plugin;\n }\n if (plugin.install) {\n plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);\n }\n }\n\n /**\n *\n * @param filename\n */\n get(filename) {\n return this.pluginCache[filename];\n }\n\n /**\n * Adds a visitor. The visitor object has options on itself to determine\n * when it should run.\n * @param visitor\n */\n addVisitor(visitor) {\n this.visitors.push(visitor);\n }\n\n /**\n * Adds a pre processor object\n * @param {object} preProcessor\n * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import\n */\n addPreProcessor(preProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {\n if (this.preProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.preProcessors.splice(indexToInsertAt, 0, {preProcessor, priority});\n }\n\n /**\n * Adds a post processor object\n * @param {object} postProcessor\n * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression\n */\n addPostProcessor(postProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {\n if (this.postProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.postProcessors.splice(indexToInsertAt, 0, {postProcessor, priority});\n }\n\n /**\n *\n * @param manager\n */\n addFileManager(manager) {\n this.fileManagers.push(manager);\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPreProcessors() {\n const preProcessors = [];\n for (let i = 0; i < this.preProcessors.length; i++) {\n preProcessors.push(this.preProcessors[i].preProcessor);\n }\n return preProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPostProcessors() {\n const postProcessors = [];\n for (let i = 0; i < this.postProcessors.length; i++) {\n postProcessors.push(this.postProcessors[i].postProcessor);\n }\n return postProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getVisitors() {\n return this.visitors;\n }\n\n visitor() {\n const self = this;\n return {\n first: function() {\n self.iterator = -1;\n return self.visitors[self.iterator];\n },\n get: function() {\n self.iterator += 1;\n return self.visitors[self.iterator];\n }\n };\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getFileManagers() {\n return this.fileManagers;\n }\n}\n\nlet pm;\n\nfunction PluginManagerFactory(less, newFactory) {\n if (newFactory || !pm) {\n pm = new PluginManager(less);\n }\n return pm;\n};\n\n//\nexport default PluginManagerFactory;\n","import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n","import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n","import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n\n return functions;\n};\n","import Quoted from '../tree/quoted';\nimport URL from '../tree/url';\nimport * as utils from '../utils';\nimport logger from '../logger';\n\nexport default environment => {\n \n const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); \n\n return { 'data-uri': function(mimetypeNode, filePathNode) {\n\n if (!filePathNode) {\n filePathNode = mimetypeNode;\n mimetypeNode = null;\n }\n\n let mimetype = mimetypeNode && mimetypeNode.value;\n let filePath = filePathNode.value;\n const currentFileInfo = this.currentFileInfo;\n const currentDirectory = currentFileInfo.rewriteUrls ?\n currentFileInfo.currentDirectory : currentFileInfo.entryPath;\n\n const fragmentStart = filePath.indexOf('#');\n let fragment = '';\n if (fragmentStart !== -1) {\n fragment = filePath.slice(fragmentStart);\n filePath = filePath.slice(0, fragmentStart);\n }\n const context = utils.clone(this.context);\n context.rawBuffer = true;\n\n const fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);\n\n if (!fileManager) {\n return fallback(this, filePathNode);\n }\n\n let useBase64 = false;\n\n // detect the mimetype if not given\n if (!mimetypeNode) {\n\n mimetype = environment.mimeLookup(filePath);\n\n if (mimetype === 'image/svg+xml') {\n useBase64 = false;\n } else {\n // use base 64 unless it's an ASCII or UTF-8 format\n const charset = environment.charsetLookup(mimetype);\n useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;\n }\n if (useBase64) { mimetype += ';base64'; }\n }\n else {\n useBase64 = /;base64$/.test(mimetype);\n }\n\n const fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);\n if (!fileSync.contents) {\n logger.warn(`Skipped data-uri embedding of ${filePath} because file not found`);\n return fallback(this, filePathNode || mimetypeNode);\n }\n let buf = fileSync.contents;\n if (useBase64 && !environment.encodeBase64) {\n return fallback(this, filePathNode);\n }\n\n buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);\n\n const uri = `data:${mimetype},${buf}${fragment}`;\n\n return new URL(new Quoted(`\"${uri}\"`, uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default environment => {\n return { 'svg-gradient': function(direction) {\n let stops;\n let gradientDirectionSvg;\n let gradientType = 'linear';\n let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n const renderEnv = {compress: false};\n let returner;\n const directionValue = direction.toCSS(renderEnv);\n let i;\n let color;\n let position;\n let positionValue;\n let alpha;\n\n function throwArgumentDescriptor() {\n throw { type: 'Argument',\n message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n ' end_color [end_position] or direction, color list' };\n }\n\n if (arguments.length == 2) {\n if (arguments[1].value.length < 2) {\n throwArgumentDescriptor();\n }\n stops = arguments[1].value;\n } else if (arguments.length < 3) {\n throwArgumentDescriptor();\n } else {\n stops = Array.prototype.slice.call(arguments, 1);\n }\n\n switch (directionValue) {\n case 'to bottom':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n break;\n case 'to right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'to bottom right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n break;\n case 'to top right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'ellipse':\n case 'ellipse at center':\n gradientType = 'radial';\n gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n break;\n default:\n throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n }\n returner = `<${gradientType}Gradient id=\"g\" ${gradientDirectionSvg}>`;\n\n for (i = 0; i < stops.length; i += 1) {\n if (stops[i] instanceof Expression) {\n color = stops[i].value[0];\n position = stops[i].value[1];\n } else {\n color = stops[i];\n position = undefined;\n }\n\n if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) {\n throwArgumentDescriptor();\n }\n positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';\n alpha = color.alpha;\n returner += ``;\n }\n returner += ``;\n\n returner = encodeURIComponent(returner);\n\n returner = `data:image/svg+xml,${returner}`;\n return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import contexts from './contexts';\nimport visitor from './visitors';\nimport tree from './tree';\n\nexport default (root, options = {}) => {\n let evaldRoot;\n let variables = options.variables;\n const evalEnv = new contexts.Eval(options);\n\n //\n // Allows setting variables with a hash, so:\n //\n // `{ color: new tree.Color('#f01') }` will become:\n //\n // new tree.Declaration('@color',\n // new tree.Value([\n // new tree.Expression([\n // new tree.Color('#f01')\n // ])\n // ])\n // )\n //\n if (typeof variables === 'object' && !Array.isArray(variables)) {\n variables = Object.keys(variables).map(k => {\n let value = variables[k];\n\n if (!(value instanceof tree.Value)) {\n if (!(value instanceof tree.Expression)) {\n value = new tree.Expression([value]);\n }\n value = new tree.Value([value]);\n }\n return new tree.Declaration(`@${k}`, value, false, null, 0);\n });\n evalEnv.frames = [new tree.Ruleset(null, variables)];\n }\n\n const visitors = [\n new visitor.JoinSelectorVisitor(),\n new visitor.MarkVisibleSelectorsVisitor(true),\n new visitor.ExtendVisitor(),\n new visitor.ToCSSVisitor({compress: Boolean(options.compress)})\n ];\n\n const preEvalVisitors = [];\n let v;\n let visitorIterator;\n\n /**\n * first() / get() allows visitors to be added while visiting\n * \n * @todo Add scoping for visitors just like functions for @plugin; right now they're global\n */\n if (options.pluginManager) {\n visitorIterator = options.pluginManager.visitor();\n for (var i = 0; i < 2; i++) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (v.isPreEvalVisitor) {\n if (i === 0 || preEvalVisitors.indexOf(v) === -1) {\n preEvalVisitors.push(v);\n v.run(root);\n }\n }\n else {\n if (i === 0 || visitors.indexOf(v) === -1) {\n if (v.isPreVisitor) {\n visitors.unshift(v);\n }\n else {\n visitors.push(v);\n }\n }\n }\n }\n }\n }\n\n evaldRoot = root.eval(evalEnv);\n\n for (var i = 0; i < visitors.length; i++) {\n visitors[i].run(evaldRoot);\n }\n\n // Run any remaining visitors added after eval pass\n if (options.pluginManager) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {\n v.run(evaldRoot);\n }\n }\n }\n\n return evaldRoot;\n};\n","/* global window, XMLHttpRequest */\n\nimport AbstractFileManager from '../less/environment/abstract-file-manager.js';\n\nlet options;\nlet logger;\nlet fileCache = {};\n\n// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load\nclass FileManager extends AbstractFileManager {\n alwaysMakePathsAbsolute() {\n return true;\n }\n\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return this.extractUrlParts(laterPath, basePath).path;\n }\n\n doXHR(url, type, callback, errback) {\n const xhr = new XMLHttpRequest();\n const async = options.isFileProtocol ? options.fileAsync : true;\n\n if (typeof xhr.overrideMimeType === 'function') {\n xhr.overrideMimeType('text/css');\n }\n logger.debug(`XHR: Getting '${url}'`);\n xhr.open('GET', url, async);\n xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');\n xhr.send(null);\n\n function handleResponse(xhr, callback, errback) {\n if (xhr.status >= 200 && xhr.status < 300) {\n callback(xhr.responseText,\n xhr.getResponseHeader('Last-Modified'));\n } else if (typeof errback === 'function') {\n errback(xhr.status, url);\n }\n }\n\n if (options.isFileProtocol && !options.fileAsync) {\n if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {\n callback(xhr.responseText);\n } else {\n errback(xhr.status, url);\n }\n } else if (async) {\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4) {\n handleResponse(xhr, callback, errback);\n }\n };\n } else {\n handleResponse(xhr, callback, errback);\n }\n }\n\n supports() {\n return true;\n }\n\n clearFileCache() {\n fileCache = {};\n }\n\n loadFile(filename, currentDirectory, options, environment) {\n // TODO: Add prefix support like less-node?\n // What about multiple paths?\n\n if (currentDirectory && !this.isPathAbsolute(filename)) {\n filename = currentDirectory + filename;\n }\n\n filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;\n\n options = options || {};\n\n // sheet may be set to the stylesheet for the initial load or a collection of properties including\n // some context variables for imports\n const hrefParts = this.extractUrlParts(filename, window.location.href);\n const href = hrefParts.url;\n const self = this;\n \n return new Promise((resolve, reject) => {\n if (options.useFileCache && fileCache[href]) {\n try {\n const lessText = fileCache[href];\n return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});\n } catch (e) {\n return reject({ filename: href, message: `Error loading file ${href} error was ${e.message}` });\n }\n }\n\n self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {\n // per file cache\n fileCache[href] = data;\n\n // Use remote copy (re-parse)\n resolve({ contents: data, filename: href, webInfo: { lastModified }});\n }, function doXHRError(status, url) {\n reject({ type: 'File', message: `'${url}' wasn't found (${status})`, href });\n });\n });\n }\n}\n\nexport default (opts, log) => {\n options = opts;\n logger = log;\n return FileManager;\n}\n","import data from './data';\nimport tree from './tree';\nimport Environment from './environment/environment';\nimport AbstractFileManager from './environment/abstract-file-manager';\nimport AbstractPluginLoader from './environment/abstract-plugin-loader';\nimport visitors from './visitors';\nimport Parser from './parser/parser';\nimport Functions from './functions';\nimport contexts from './contexts';\nimport sourceMapOutput from './source-map-output';\nimport sourceMapBuilder from './source-map-builder';\nimport parseTree from './parse-tree';\nimport importManager from './import-manager';\nimport Render from './render';\nimport Parse from './parse';\nimport LessError from './less-error';\nimport transformTree from './transform-tree';\nimport * as utils from './utils';\nimport PluginManager from './plugin-manager';\nimport logger from './logger';\n\nexport default (environment, fileManagers) => {\n /**\n * @todo\n * This original code could be improved quite a bit.\n * Many classes / modules currently add side-effects / mutations to passed in objects,\n * which makes it hard to refactor and reason about. \n */\n environment = new Environment(environment, fileManagers);\n\n const SourceMapOutput = sourceMapOutput(environment);\n const SourceMapBuilder = sourceMapBuilder(SourceMapOutput, environment);\n const ParseTree = parseTree(SourceMapBuilder);\n const ImportManager = importManager(environment);\n const render = Render(environment, ParseTree, ImportManager);\n const parse = Parse(environment, ParseTree, ImportManager);\n const functions = Functions(environment);\n\n /**\n * @todo\n * This root properties / methods need to be organized.\n * It's not clear what should / must be public and why.\n */\n const initial = {\n version: [3, 11, 2],\n data,\n tree,\n Environment,\n AbstractFileManager,\n AbstractPluginLoader,\n environment,\n visitors,\n Parser,\n functions,\n contexts,\n SourceMapOutput,\n SourceMapBuilder,\n ParseTree,\n ImportManager,\n render,\n parse,\n LessError,\n transformTree,\n utils,\n PluginManager,\n logger\n };\n\n // Create a public API\n const ctor = t => function (...args) {\n return new t(...args);\n };\n\n let t;\n const api = Object.create(initial);\n for (const n in initial.tree) {\n /* eslint guard-for-in: 0 */\n t = initial.tree[n];\n if (typeof t === 'function') {\n api[n.toLowerCase()] = ctor(t);\n }\n else {\n api[n] = Object.create(null);\n for (const o in t) {\n /* eslint guard-for-in: 0 */\n api[n][o.toLowerCase()] = ctor(t[o]);\n }\n }\n }\n\n return api;\n};\n","export default environment => {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines;\n let sourceLines;\n let columns;\n let sourceColumns;\n let i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n // ignore empty content\n if (inputSource === undefined) {\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n};\n","export default (SourceMapOutput, environment) => {\n class SourceMapBuilder {\n constructor(options) {\n this.options = options;\n }\n\n toCSS(rootNode, options, imports) {\n const sourceMapOutput = new SourceMapOutput(\n {\n contentsIgnoredCharsMap: imports.contentsIgnoredChars,\n rootNode,\n contentsMap: imports.contents,\n sourceMapFilename: this.options.sourceMapFilename,\n sourceMapURL: this.options.sourceMapURL,\n outputFilename: this.options.sourceMapOutputFilename,\n sourceMapBasepath: this.options.sourceMapBasepath,\n sourceMapRootpath: this.options.sourceMapRootpath,\n outputSourceFiles: this.options.outputSourceFiles,\n sourceMapGenerator: this.options.sourceMapGenerator,\n sourceMapFileInline: this.options.sourceMapFileInline\n });\n\n const css = sourceMapOutput.toCSS(options);\n this.sourceMap = sourceMapOutput.sourceMap;\n this.sourceMapURL = sourceMapOutput.sourceMapURL;\n if (this.options.sourceMapInputFilename) {\n this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);\n }\n if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {\n this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);\n }\n return css + this.getCSSAppendage();\n }\n\n getCSSAppendage() {\n\n let sourceMapURL = this.sourceMapURL;\n if (this.options.sourceMapFileInline) {\n if (this.sourceMap === undefined) {\n return '';\n }\n sourceMapURL = `data:application/json;base64,${environment.encodeBase64(this.sourceMap)}`;\n }\n\n if (sourceMapURL) {\n return `/*# sourceMappingURL=${sourceMapURL} */`;\n }\n return '';\n }\n\n getExternalSourceMap() {\n return this.sourceMap;\n }\n\n setExternalSourceMap(sourceMap) {\n this.sourceMap = sourceMap;\n }\n\n isInline() {\n return this.options.sourceMapFileInline;\n }\n\n getSourceMapURL() {\n return this.sourceMapURL;\n }\n\n getOutputFilename() {\n return this.options.sourceMapOutputFilename;\n }\n\n getInputFilename() {\n return this.sourceMapInputFilename;\n }\n }\n\n return SourceMapBuilder;\n};\n","import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default SourceMapBuilder => {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n result.imports = [];\n for (const file in this.imports.files) {\n if (this.imports.files.hasOwnProperty(file) && file !== this.imports.rootFilename) {\n result.imports.push(file);\n }\n }\n return result;\n }\n }\n\n return ParseTree;\n};\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport LessError from './less-error';\nimport * as utils from './utils';\nimport logger from './logger';\n\nexport default environment => {\n // FileInfo = {\n // 'rewriteUrls' - option - whether to adjust URL's to be relative\n // 'filename' - full resolved filename of current file\n // 'rootpath' - path to append to normal URLs for this node\n // 'currentDirectory' - path to the current file, absolute\n // 'rootFilename' - filename of the base file\n // 'entryPath' - absolute path to the entry file\n // 'reference' - whether the file should not be output and only output parts that are referenced\n\n class ImportManager {\n constructor(less, context, rootFileInfo) {\n this.less = less;\n this.rootFilename = rootFileInfo.filename;\n this.paths = context.paths || []; // Search paths, when importing\n this.contents = {}; // map - filename to contents of all the files\n this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore\n this.mime = context.mime;\n this.error = null;\n this.context = context;\n // Deprecated? Unused outside of here, could be useful.\n this.queue = []; // Files which haven't been imported yet\n }\n\n /**\n * Add an import to be imported\n * @param path - the raw path\n * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)\n * @param currentFileInfo - the current file info (used for instance to work out relative paths)\n * @param importOptions - import options\n * @param callback - callback for when it is imported\n */\n push(path, tryAppendExtension, currentFileInfo, importOptions, callback) {\n const importManager = this;\n const pluginLoader = this.context.pluginManager.Loader;\n\n this.queue.push(path);\n\n const fileParsedFunc = (e, root, fullPath) => {\n importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue\n\n const importedEqualsRoot = fullPath === importManager.rootFilename;\n if (importOptions.optional && e) {\n callback(null, {rules:[]}, false, null);\n logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`);\n }\n else {\n if (e && !importManager.error) { importManager.error = e; }\n callback(e, root, importedEqualsRoot, fullPath);\n }\n };\n\n const newFileInfo = {\n rewriteUrls: this.context.rewriteUrls,\n entryPath: currentFileInfo.entryPath,\n rootpath: currentFileInfo.rootpath,\n rootFilename: currentFileInfo.rootFilename\n };\n\n const fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);\n\n if (!fileManager) {\n fileParsedFunc({ message: `Could not find a file-manager for ${path}` });\n return;\n }\n\n const loadFileCallback = loadedFile => {\n let plugin;\n const resolvedFilename = loadedFile.filename;\n const contents = loadedFile.contents.replace(/^\\uFEFF/, '');\n\n // Pass on an updated rootpath if path of imported file is relative and file\n // is in a (sub|sup) directory\n //\n // Examples:\n // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',\n // then rootpath should become 'less/module/nav/'\n // - If path of imported file is '../mixins.less' and rootpath is 'less/',\n // then rootpath should become 'less/../'\n newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);\n if (newFileInfo.rewriteUrls) {\n newFileInfo.rootpath = fileManager.join(\n (importManager.context.rootpath || ''),\n fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));\n\n if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {\n newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);\n }\n }\n newFileInfo.filename = resolvedFilename;\n\n const newEnv = new contexts.Parse(importManager.context);\n\n newEnv.processImports = false;\n importManager.contents[resolvedFilename] = contents;\n\n if (currentFileInfo.reference || importOptions.reference) {\n newFileInfo.reference = true;\n }\n\n if (importOptions.isPlugin) {\n plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);\n if (plugin instanceof LessError) {\n fileParsedFunc(plugin, null, resolvedFilename);\n }\n else {\n fileParsedFunc(null, plugin, resolvedFilename);\n }\n } else if (importOptions.inline) {\n fileParsedFunc(null, contents, resolvedFilename);\n } else {\n new Parser(newEnv, importManager, newFileInfo).parse(contents, (e, root) => {\n fileParsedFunc(e, root, resolvedFilename);\n });\n }\n };\n let promise;\n const context = utils.clone(this.context);\n\n if (tryAppendExtension) {\n context.ext = importOptions.isPlugin ? '.js' : '.less';\n }\n\n if (importOptions.isPlugin) {\n context.mime = 'application/javascript';\n promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n }\n else {\n promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,\n (err, loadedFile) => {\n if (err) {\n fileParsedFunc(err);\n } else {\n loadFileCallback(loadedFile);\n }\n });\n }\n if (promise) {\n promise.then(loadFileCallback, fileParsedFunc);\n }\n }\n }\n\n return ImportManager;\n};\n","let PromiseConstructor;\nimport * as utils from './utils';\n\nexport default (environment, ParseTree, ImportManager) => {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise((resolve, reject) => {\n render.call(self, input, options, (err, output) => {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, (err, root, imports, options) => {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n};\n","let PromiseConstructor;\nimport contexts from './contexts';\nimport Parser from './parser/parser';\nimport PluginManager from './plugin-manager';\nimport LessError from './less-error';\nimport * as utils from './utils';\n\nexport default (environment, ParseTree, ImportManager) => {\n const parse = function (input, options, callback) {\n\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise((resolve, reject) => {\n parse.call(self, input, options, (err, output) => {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n let context;\n let rootFileInfo;\n const pluginManager = new PluginManager(this, !options.reUsePluginManager);\n\n options.pluginManager = pluginManager;\n\n context = new contexts.Parse(options);\n\n if (options.rootFileInfo) {\n rootFileInfo = options.rootFileInfo;\n } else {\n const filename = options.filename || 'input';\n const entryPath = filename.replace(/[^\\/\\\\]*$/, '');\n rootFileInfo = {\n filename,\n rewriteUrls: context.rewriteUrls,\n rootpath: context.rootpath || '',\n currentDirectory: entryPath,\n entryPath,\n rootFilename: filename\n };\n // add in a missing trailing slash\n if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {\n rootFileInfo.rootpath += '/';\n }\n }\n\n const imports = new ImportManager(this, context, rootFileInfo);\n this.importManager = imports;\n\n // TODO: allow the plugins to be just a list of paths or names\n // Do an async plugin queue like lessc\n\n if (options.plugins) {\n options.plugins.forEach(plugin => {\n let evalResult;\n let contents;\n if (plugin.fileContent) {\n contents = plugin.fileContent.replace(/^\\uFEFF/, '');\n evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename);\n if (evalResult instanceof LessError) {\n return callback(evalResult);\n }\n }\n else {\n pluginManager.addPlugin(plugin);\n }\n });\n }\n\n new Parser(context, imports, rootFileInfo)\n .parse(input, (e, root) => {\n if (e) { return callback(e); }\n callback(null, root, imports, options);\n }, options);\n }\n };\n return parse;\n};\n","// TODO: Add tests for browser @plugin\n/* global window */\n\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nclass PluginLoader extends AbstractPluginLoader {\n constructor(less) {\n super();\n\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n }\n\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n}\n\nexport default PluginLoader;\n\n","import * as utils from './utils';\nimport browser from './browser';\n\nexport default (window, less, options) => {\n\n function errorHTML(e, rootHref) {\n const id = `less-error-message:${utils.extractId(rootHref || '')}`;\n const template = '
  • {content}
  • ';\n const elem = window.document.createElement('div');\n let timer;\n let content;\n const errors = [];\n const filename = e.filename || rootHref;\n const filenameNoPath = filename.match(/([^\\/]+(\\?.*)?)$/)[1];\n\n elem.id = id;\n elem.className = 'less-error-message';\n\n content = `

    ${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}` + \n `

    in ${filenameNoPath} `;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += `on line ${e.line}, column ${e.column + 1}:

      ${errors.join('')}
    `;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `
    Stack Trace
    ${e.stack.split('\\n').slice(1).join('
    ')}`;\n }\n elem.innerHTML = content;\n\n // CSS for error messages\n browser.createCSS(window.document, [\n '.less-error-message ul, .less-error-message li {',\n 'list-style-type: none;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message label {',\n 'font-size: 12px;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'color: #cc7777;',\n '}',\n '.less-error-message pre {',\n 'color: #dd6666;',\n 'padding: 4px 0;',\n 'margin: 0;',\n 'display: inline-block;',\n '}',\n '.less-error-message pre.line {',\n 'color: #ff0000;',\n '}',\n '.less-error-message h3 {',\n 'font-size: 20px;',\n 'font-weight: bold;',\n 'padding: 15px 0 5px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message a {',\n 'color: #10a',\n '}',\n '.less-error-message .error {',\n 'color: red;',\n 'font-weight: bold;',\n 'padding-bottom: 2px;',\n 'border-bottom: 1px dashed red;',\n '}'\n ].join('\\n'), { title: 'error-message' });\n\n elem.style.cssText = [\n 'font-family: Arial, sans-serif',\n 'border: 1px solid #e00',\n 'background-color: #eee',\n 'border-radius: 5px',\n '-webkit-border-radius: 5px',\n '-moz-border-radius: 5px',\n 'color: #e00',\n 'padding: 15px',\n 'margin-bottom: 15px'\n ].join(';');\n\n if (options.env === 'development') {\n timer = setInterval(() => {\n const document = window.document;\n const body = document.body;\n if (body) {\n if (document.getElementById(id)) {\n body.replaceChild(elem, document.getElementById(id));\n } else {\n body.insertBefore(elem, body.firstChild);\n }\n clearInterval(timer);\n }\n }, 10);\n }\n }\n\n function removeErrorHTML(path) {\n const node = window.document.getElementById(`less-error-message:${utils.extractId(path)}`);\n if (node) {\n node.parentNode.removeChild(node);\n }\n }\n\n function removeErrorConsole(path) {\n // no action\n }\n\n function removeError(path) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n removeErrorHTML(path);\n } else if (options.errorReporting === 'console') {\n removeErrorConsole(path);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('remove', path);\n }\n }\n\n function errorConsole(e, rootHref) {\n const template = '{line} {content}';\n const filename = e.filename || rootHref;\n const errors = [];\n let content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'} in ${filename}`;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += ` on line ${e.line}, column ${e.column + 1}:\\n${errors.join('\\n')}`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `\\nStack Trace\\n${e.stack}`;\n }\n less.logger.error(content);\n }\n\n function error(e, rootHref) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n errorHTML(e, rootHref);\n } else if (options.errorReporting === 'console') {\n errorConsole(e, rootHref);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('add', e, rootHref);\n }\n }\n\n return {\n add: error,\n remove: removeError\n };\n};\n","/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\n/* global window, document */\n\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (window.less.hasOwnProperty(key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n","// Export a new default each time\nexport default () => ({\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 0,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n});","import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n","//\n// index.js\n// Should expose the additional browser functions on to the less object\n//\nimport {addDataAttr} from './utils';\nimport lessRoot from '../less';\nimport browser from './browser';\nimport FM from './file-manager';\nimport PluginLoader from './plugin-loader';\nimport LogListener from './log-listener';\nimport ErrorReporting from './error-reporting';\nimport Cache from './cache';\nimport ImageSize from './image-size';\n\nexport default (window, options) => {\n const document = window.document;\n const less = lessRoot();\n\n less.options = options;\n const environment = less.environment;\n const FileManager = FM(options, less.logger);\n const fileManager = new FileManager();\n environment.addFileManager(fileManager);\n less.FileManager = FileManager;\n less.PluginLoader = PluginLoader;\n\n LogListener(less, options);\n const errors = ErrorReporting(window, less, options);\n const cache = less.cache = options.cache || Cache(window, options, less.logger);\n ImageSize(less.environment);\n\n // Setup user functions - Deprecate?\n if (options.functions) {\n less.functions.functionRegistry.addMultiple(options.functions);\n }\n\n const typePattern = /^text\\/(x-)?less$/;\n\n function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n }\n\n // only really needed for phantom\n function bind(func, thisArg) {\n const curryArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));\n return func.apply(thisArg, args);\n };\n }\n\n function loadStyles(modifyVars) {\n const styles = document.getElementsByTagName('style');\n let style;\n\n for (let i = 0; i < styles.length; i++) {\n style = styles[i];\n if (style.type.match(typePattern)) {\n const instanceOptions = clone(options);\n instanceOptions.modifyVars = modifyVars;\n const lessText = style.innerHTML || '';\n instanceOptions.filename = document.location.href.replace(/#.*$/, '');\n\n /* jshint loopfunc:true */\n // use closure to store current style\n less.render(lessText, instanceOptions,\n bind((style, e, result) => {\n if (e) {\n errors.add(e, 'inline');\n } else {\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = result.css;\n } else {\n style.innerHTML = result.css;\n }\n }\n }, null, style));\n }\n }\n }\n\n function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {\n\n const instanceOptions = clone(options);\n addDataAttr(instanceOptions, sheet);\n instanceOptions.mime = sheet.type;\n\n if (modifyVars) {\n instanceOptions.modifyVars = modifyVars;\n }\n\n function loadInitialFileCallback(loadedFile) {\n const data = loadedFile.contents;\n const path = loadedFile.filename;\n const webInfo = loadedFile.webInfo;\n\n const newFileInfo = {\n currentDirectory: fileManager.getPath(path),\n filename: path,\n rootFilename: path,\n rewriteUrls: instanceOptions.rewriteUrls\n };\n\n newFileInfo.entryPath = newFileInfo.currentDirectory;\n newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;\n\n if (webInfo) {\n webInfo.remaining = remaining;\n\n const css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);\n if (!reload && css) {\n webInfo.local = true;\n callback(null, css, data, sheet, webInfo, path);\n return;\n }\n\n }\n\n // TODO add tests around how this behaves when reloading\n errors.remove(path);\n\n instanceOptions.rootFileInfo = newFileInfo;\n less.render(data, instanceOptions, (e, result) => {\n if (e) {\n e.href = path;\n callback(e);\n } else {\n cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);\n callback(null, result.css, data, sheet, webInfo, path);\n }\n });\n }\n\n fileManager.loadFile(sheet.href, null, instanceOptions, environment)\n .then(loadedFile => {\n loadInitialFileCallback(loadedFile);\n }).catch(err => {\n console.log(err);\n callback(err);\n });\n\n }\n\n function loadStyleSheets(callback, reload, modifyVars) {\n for (let i = 0; i < less.sheets.length; i++) {\n loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);\n }\n }\n\n function initRunningMode() {\n if (less.env === 'development') {\n less.watchTimer = setInterval(() => {\n if (less.watchMode) {\n fileManager.clearFileCache();\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n } else if (css) {\n browser.createCSS(window.document, css, sheet);\n }\n });\n }\n }, options.poll);\n }\n }\n\n //\n // Watch mode\n //\n less.watch = function () {\n if (!less.watchMode ) {\n less.env = 'development';\n initRunningMode();\n }\n this.watchMode = true;\n return true;\n };\n\n less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };\n\n //\n // Synchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\".\n //\n less.registerStylesheetsImmediately = () => {\n const links = document.getElementsByTagName('link');\n less.sheets = [];\n\n for (let i = 0; i < links.length; i++) {\n if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&\n (links[i].type.match(typePattern)))) {\n less.sheets.push(links[i]);\n }\n }\n };\n\n //\n // Asynchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\", returning a Promise.\n //\n less.registerStylesheets = () => new Promise((resolve, reject) => {\n less.registerStylesheetsImmediately();\n resolve();\n });\n\n //\n // With this function, it's possible to alter variables and re-render\n // CSS without reloading less-files\n //\n less.modifyVars = record => less.refresh(true, record, false);\n\n less.refresh = (reload, modifyVars, clearFileCache) => {\n if ((reload || clearFileCache) && clearFileCache !== false) {\n fileManager.clearFileCache();\n }\n return new Promise((resolve, reject) => {\n let startTime;\n let endTime;\n let totalMilliseconds;\n let remainingSheets;\n startTime = endTime = new Date();\n\n // Set counter for remaining unprocessed sheets\n remainingSheets = less.sheets.length;\n\n if (remainingSheets === 0) {\n\n endTime = new Date();\n totalMilliseconds = endTime - startTime;\n less.logger.info('Less has finished and no sheets were loaded.');\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n\n } else {\n // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n reject(e);\n return;\n }\n if (webInfo.local) {\n less.logger.info(`Loading ${sheet.href} from cache.`);\n } else {\n less.logger.info(`Rendered ${sheet.href} successfully.`);\n }\n browser.createCSS(window.document, css, sheet);\n less.logger.info(`CSS for ${sheet.href} generated in ${new Date() - endTime}ms`);\n\n // Count completed sheet\n remainingSheets--;\n\n // Check if the last remaining sheet was processed and then call the promise\n if (remainingSheets === 0) {\n totalMilliseconds = new Date() - startTime;\n less.logger.info(`Less has finished. CSS generated in ${totalMilliseconds}ms`);\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n }\n endTime = new Date();\n }, reload, modifyVars);\n }\n\n loadStyles(modifyVars);\n });\n };\n\n less.refreshStyles = loadStyles;\n return less;\n};\n","export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n","// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || \"{}\"; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n","\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"],"names":["extractId","href","replace","addDataAttr","options","tag","opt","dataset","hasOwnProperty","JSON","parse","_","document","styles","sheet","id","title","utils.extractId","oldStyleNode","getElementById","keepOldStyleNode","styleNode","createElement","setAttribute","media","styleSheet","appendChild","createTextNode","childNodes","length","firstChild","nodeValue","head","getElementsByTagName","nextEl","nextSibling","parentNode","insertBefore","removeChild","cssText","e","Error","window","scripts","currentScript","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","m","cm","mm","in","px","pt","pc","duration","s","ms","angle","rad","Math","PI","deg","grad","turn","colors","unitConversions","this","parent","visibilityBlocks","undefined","nodeVisible","rootNode","parsed","self","Object","defineProperty","get","fileInfo","getIndex","Node","nodes","set","node","Array","isArray","forEach","_index","_fileInfo","context","strs","genCSS","add","chunk","index","push","isEmpty","join","output","value","visitor","visit","op","a","b","precision","numPrecision","Number","toFixed","info","compare","type","i_1","numericCompare","rgb","originalForm","_super","_this","match","map","c","i","parseInt","alpha","split","__extends","Color","r","g","pow","toCSS","doNotCompress","color","colorFunction","compress","args","fround","indexOf","clamp","round","concat","toHSL","h","l","toRGB","splitcolor","other","_operate","toHex","max","min","d","v","x","toString","prototype","fromKeyword","keyword","key","toLowerCase","slice","Paren","eval","_noSpaceCombinators"," ","|","emptyOrWhitespace","trim","Combinator","spaceOrEmpty","combinator","isVariable","currentFileInfo","visibilityInfo","copyVisibilityInfo","setParent","Element","firstSelector","charAt","ALWAYS","PARENS_DIVISION","PARENS","STRICT_LEGACY","RewriteUrls","clone","_instanceof","obj","nativeMap","nativeSet","nativePromise","Map","Set","Promise","circular","depth","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","Infinity","_clone","child","proto","resolve","reject","then","err","__isArray","__isRegExp","RegExp","source","__getRegExpFlags","lastIndex","__isDate","Date","getTime","isBuffer","allocUnsafe","copy","create","getPrototypeOf","keyChild","valueChild","entryChild","attrs","getOwnPropertyDescriptor","getOwnPropertySymbols","symbols","symbol","descriptor","enumerable","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","o","call","re","flags","global","ignoreCase","multiline","clonePrototype","module","exports","getLocation","inputStream","n","line","column","copyArray","arr","cloned","prop","defaults","obj1","obj2","newObj","_defaults","defaults_1","CloneHelper","assign","copyOptions","opts","strictMath","math","Constants.Math","relativeUrls","rewriteUrls","Constants.RewriteUrls","flattenArray","result","length_1","anonymousFunc","LessError","fileContentMap","currentFilename","filename","message","stack","input","contents","loc","utils.getLocation","col","callLine","lines","found","func","Function","lineAdjust","callExtract","extract","F","constructor","error","stylize","str","errorTxt","substr","elements","extendList","condition","evaldCondition","getElements","mixinElements_","Selector","visitArray","newSelector","mediaEmpty","els","parseNode","imports","sels","olen","len","mixinElements","shift","extend","createDerived","Value","Keyword","True","False","mapLines","rulesetLike","allowRoot","Anonymous","Boolean","MATH","name","important","merge","inline","variable","Declaration","lastRule","prevMath","evaldValue","mathBypass","evalName","importantScope","importantResult","pop","debugInfo","ctx","lineSeparator","dumpLineNumbers","asComment","asMediaQuery","lineNumber","fileName","filenameWithProtocol","test","isLineComment","Comment","getDebugInfo","isCompressed","contexts","copyFromOriginal","original","destination","propertiesToCopy","parseCopyProperties","Parse","paths","evalCopyProperties","isPathRelative","path","isPathLocalRelative","Eval","frames","inCalc","mathOn","calcStack","parensStack","rootpath","newPath","normalizePath","segment","segments","reverse","makeRegistry","base","_data","addMultiple","functions","keys","getLocalFunctions","inherit","defaultFunc","value_","error_","reset","selectors","rules","strictImports","_lookups","_variables","_properties","Ruleset","selCnt","selector","hasVariable","hasOnePassingSelector","j","toParseSelectors","utils.flattenArray","rule","subRule","utils.copyArray","ruleset","originalRuleset","root","firstRoot","allowImports","functionRegistry","globalFunctionRegistry","ctxFrames","unshift","ctxSelectors","evalImports","rsRules","evalFirst","mediaBlockCount","mediaBlocks","filter","splice","resetCache","isJustParentSelector","bubbleSelectors","importRules","makeImportant","lastSelector","_rulesets","reduce","hash","variables","vars","name_1","name_2","decl","parseValue","properties","toParse","transformDeclaration","nodes_1","filtRules","isRuleset","foundMixins","rulesets","find","i_2","apply","ruleNodes","tabLevel","sep","tabRuleStr","tabSetStr","charsetNodeIndex","importNodeIndex","isCharset","pathCnt","pathSubCnt","currentLastRule","isRulesetLike","isVisible","joinSelector","createParenthesis","elementsToPak","originalElement","replacementParen","insideParent","createSelector","containedElement","element","addReplacementIntoPath","beginningPath","addPath","replacedElement","originalSelector","newSelectorPath","newJoinedSelector","parentEl","restOfPath","addAllReplacementsIntoPath","addPaths","mergeElementsOnToSelectors","sel","deriveSelector","deriveFrom","newPaths","replaceParentSelector","inSelector","k","currentElements","newSelectors","selectorsMultiplied","el","maybeSelector","hadParentSelector","nestedSelector","replaced","nestedPaths","replacedNewSelectors","concatenated","bind","isRooted","createEmptySelectors","AtRule","outputRuleset","mediaPathBackup","mediaBlocksBackup","mediaPath","_i","ruleCnt","DetachedRuleset","numerator","denominator","backupUnit","sort","Unit","strictUnits","returnStr","is","unitString","toUpperCase","callback","group","mapUnit","groupName","atomicUnit","counter","count","unit","parseFloat","isNaN","Dimension","isSingular","strValue","String","isLength","convertTo","usedUnits","cancel","unify","conversions","targetUnit","applyUnit","derivedConversions","operands","isSpaced","Operation","isMathOn","toColor","operate","noSpacing","Expression","returnValue","inParenthesis","parens","parensInOp","doubleParen","outOfParenthesis","functionCaller","item","subNodes","calc","Call","currentMathContext","enterCalc","exitCalc","funcCaller","FunctionCaller","isValid","columnNumber","Variable","evaluating","frame","fun","Property","property","mergeRules","pluginManager","less","visitors","ToCSSVisitor","_mergeRules","vArr","Attribute","content","escaped","quote","variableRegex","propRegex","Quoted","that","iterativeReplace","regexp","replacementFnc","evaluatedValue","val","isEvald","URL","pathRequiresRewrite","rewritePath","urlArgs","features","Media","evalTop","evalNested","multiMedia","permute","fragment","rest","css","pathValue","getPath","Import","isPlugin","reference","containsVariables","doEval","blocksVisibility","addVisibilityBlock","registry","skip","importedFilename","newImport","evalPath","string","expression","JavaScript","evaluateJavaScript","JsEvalNode","evalContext","javascriptEnabled","jsify","toJS","Assignment","negate","lvalue","rvalue","Condition","UnicodeDescriptor","Negative","option","object_id","Extend","next_id","parent_ids","allowBefore","allowAfter","selectorElements","selfElements","selfSelectors","VariableCall","detachedRuleset","callEval","ruleCall","lookups","NamespaceValue","lastDeclaration","substring","params","variadic","arity","optionalParameters","required","p","Definition","mixinEnv","evaldArguments","varargs","arg","isNamedFound","argIndex","argsLength","prependRule","_arguments","mixinFrames","evalParams","allArgsCnt","requiredArgsCnt","arguments","MixinCall","mixins","mixin","mixinPath","argValue","f","isRecursive","isOneFound","candidate","defaultResult","noArgumentsFilter","candidates","conditionResult","calcDefGroup","namespace","matchCondition","expand","matchArgs","MixinDefinition","format","newRules","evalCall","_setVisibilityToReplacement","replacement","msg","_fireEvent","warn","debug","addListener","listener","_listeners","removeListener","logFunction","externalEnvironment","fileManagers","requiredFunctions","propName","environmentFunc","environment","currentDirectory","isSync","logger","getFileManagers","fileManager","AbstractFileManager","lastIndexOf","ext","tryAppendExtension","basePath","laterPath","url","baseUrl","urlDirectories","baseUrlDirectories","urlParts","extractUrlParts","baseUrlParts","diff","hostPart","directories","urlPartsRegex","returner","rawDirectories","rawPath","fileUrl","require","AbstractPluginLoader","pluginOptions","pluginObj","localModule","shortname","FileManager","trySetOptions","use","loader","tree","validatePlugin","minVersion","compareVersion","addPlugin","plugin","setOptions","version","versionToString","aVersion","bVersion","versionString","plugins","i_3","printUsage","_visitArgs","visitDeeper","_hasIndexed","_noop","implementation","_implementation","_visitInCache","_visitOutCache","indexNodeTypes","ticker","typeIndex","Visitor","nodeTypeIndex","fnName","impl","funcOut","visitArgs","newNode","isReplacing","cnt","accept","nonReplacing","out","evald","flatten","nestedCnt","nestedItem","onSequencerEmpty","variableImports","_onSequencerEmpty","_currentDepth","ImportSequencer","importSequencer","importItem","isReady","tryRun","variableImport","ImportVisitor","importer","finish","_visitor","_importer","_finish","importCount","onceFileDetectionMap","recursionDetector","_sequencer","run","isFinished","visitImport","importNode","inlineCSS","importParent","isVariableImport","addVariableImport","processImportNode","evaldImportNode","evalForImport","multiple","importMultiple","tryAppendLessExtension","onImported","sequencedOnImported","addImport","importedAtRoot","fullPath","importVisitor","isOptional","optional","duplicateImport","oldContext","visitDeclaration","declNode","visitDeclarationOut","visitAtRule","atRuleNode","visitAtRuleOut","visitMixinDefinition","mixinDefinitionNode","visitMixinDefinitionOut","visitRuleset","rulesetNode","visitRulesetOut","visitMedia","mediaNode","visitMediaOut","visible","SetTreeVisibilityVisitor","ensureVisibility","ensureInvisibility","allExtendsStack","ExtendFinderVisitor","allExtends","allSelectorsExtendList","extendOnEveryPath","selectorPath","selExtendList","allSelectorsExtend","foundExtends","findSelfSelectors","firstExtendOnThisSelectorPath","ProcessExtendsVisitor","extendFinder","extendIndices","doExtendChaining","newRoot","checkExtendsForNonMatched","indices","hasFoundMatches","extendsList","extendsListTarget","iterationCount","extendIndex","targetExtendIndex","matches","targetExtend","newExtend","extendsToAdd","extendVisitor","findMatch","selfSelector","extendSelector","extendChainCount","selectorOne","selectorTwo","ruleNode","selectorNode","pathIndex","selectorsToAdd","extendedSelectors","haystackSelectorPath","haystackSelectorIndex","hackstackSelector","hackstackElementIndex","haystackElement","targetCombinator","potentialMatch","needleElements","potentialMatches","matched","initialCombinator","isElementValuesEqual","finished","endPathIndex","endPathElementIndex","elementValue1","elementValue2","replacementSelector","matchIndex","firstElement","newElements","currentSelectorPathIndex","currentSelectorPathElementIndex","currentValue","derived","newAllExtends","JoinSelectorVisitor","getIsOutput","joinSelectors","_context","CSSVisitorUtils","bodyRules","isSilent","owner","thing","originalRules","containsSilentNonBlockedChild","compiledRulesBody","keepOnlyVisibleChilds","removeVisibilityBlock","hasVisibleSelector","utils","mixinNode","visitExtend","extendNode","visitComment","commentNode","resolveVisibility","visitAtRuleWithBody","visitAtRuleWithoutBody","visitAnonymous","anonymousNode","nodeRules","hasFakeRuleset","getBodyRules","charset","comment","checkValidNodes","isRoot","_compileRulesetPaths","nodeRuleCnt","_removeDuplicateRules","isVisibleRuleset","ruleList","ruleCache","ruleCSS","groups","groupsArr","result_1","space_1","comma_1","MarkVisibleSelectorsVisitor","ExtendVisitor","furthest","furthestPossibleErrorMessage","chunks","current","currentPos","saveStack","parserInput","skipWhitespace","nextChar","oldi","oldj","curr","endIndex","mem","inp","charCodeAt","autoCommentAbsorb","nextNewLine","text","commentStore","nextStarSlash","save","restore","possibleErrorMessage","state","forget","isWhitespace","offset","pos","code","$re","tok","exec","$char","$str","tokLength","$quoted","startChar","currentPosition","$parseUntil","testChar","returnVal","inComment","blockDepth","blockStack","parseGroups","startPos","lastPos","loop","char","expected","peek","peekChar","currentChar","prevChar","getInput","peekNotNumeric","start","chunkInput","failFunction","fail","lastOpening","lastOpeningParen","lastMultiComment","lastMultiCommentEndBrace","chunkerCurrentIndex","currentChunkStartIndex","cc","cc2","level","parenLevel","emitFrom","emitChunk","force","fromCharCode","chunker","end","furthestReachedEnd","furthestChar","Parser","parsers","getParserInput","expect","expectChar","parseList","currentIndex","returnNodes","parser","additionalData","globalVars","modifyVars","ignored","preText","serializeVars","preProcessors","getPreProcessors","process","banner","contentsIgnoredChars","primary","endInfo","processImports","extendRule","definition","declaration","variableCall","entities","atrule","foundSemiColon","mixinLookup","quoted","forceEscaped","isEscaped","customFuncCall","stop","ieAlpha","boolean","if","prevArgs","isSemiColonSeparated","argsComma","argsSemiColon","assignment","literal","dimension","unicodeDescriptor","entity","ch","variableCurly","curly","propertyCurly","colorKeyword","ud","javascript","js","escape","parsedName","inValue","ruleLookups","isRule","getLookup","hasParens","elem","elemIndex","isCall","expressionContainsNamed","nameLoop","expressions","hasSep","throwAwayComments","cond","argInfo","conditions","block","lookupValue","attribute","slashedCombinator","isLess","when","blockRuleset","hasDR","ruleProperty","permissiveValue","anonymousValue","untilTokens","done","testCurrentChar","import","dir","options_1","importOptions","mediaFeatures","optionName","importOption","mediaFeature","pluginArgs","nonVendorSpecificName","hasIdentifier","hasExpression","hasUnknown","hasBlock","sub","addition","multiplication","operation","operand","needsParens","logical","next","conditionAnd","negatedCondition","parenthesisCondition","atomicCondition","body","me","tryConditionFollowedByParenthesis","delim","simpleProperty","colorFunctions","trueValue","falseValue","hsla","origColor","hsl","toHSV","number","rgba","size","m1_1","m2_1","hue","hsv","hsva","vs","floor","perm","saturation","lightness","hsvhue","hsvsaturation","hsvvalue","luma","luminance","saturate","amount","method","desaturate","lighten","darken","fadein","fadeout","fade","spin","mix","color1","color2","weight","w","w1","w2","greyscale","contrast","dark","light","threshold","t","argb","toARGB","tint","shade","colorBlend","mode","cb","cs","ar","cr","ab","as","colorBlendModeFunctions","multiply","screen","overlay","softlight","sqrt","hardlight","difference","abs","exclusion","average","negation","getItemsFromNode","_SELF","values","range","step","from","to","stepValue","list","each","rs","iterator","Quote","valueName","keyName","indexName","MathHelper","fn","mathFunctions","ceil","sin","cos","atan","asin","acos","mathHelper","fraction","num","pm","minMax","isMin","currentUnified","referenceUnified","unitStatic","unitClone","order","convert","pi","mod","y","percentage","evaluated","encodeURI","pattern","%","token","encodeURIComponent","isa","Type","isunit","isruleset","iscolor","isnumber","isstring","iskeyword","isurl","ispixel","ispercentage","isem","get-unit","colorBlending","fallback","functionThis","data-uri","mimetypeNode","filePathNode","mimetype","filePath","entryPath","fragmentStart","utils.clone","rawBuffer","getFileManager","useBase64","mimeLookup","charsetLookup","fileSync","loadFileSync","buf","encodeBase64","uri","dataUri","svg-gradient","direction","stops","gradientDirectionSvg","position","positionValue","gradientType","rectangleDimension","renderEnv","directionValue","throwArgumentDescriptor","types","evaldRoot","evalEnv","visitorIterator","preEvalVisitors","first","isPreEvalVisitor","isPreVisitor","postProcessors","installedPlugins","pluginCache","Loader","PluginLoader","PluginManager","install","preProcessor","priority","indexToInsertAt","postProcessor","manager","PluginManagerFactory","newFactory","SourceMapOutput","_css","_rootNode","_contentsMap","contentsMap","_contentsIgnoredCharsMap","contentsIgnoredCharsMap","sourceMapFilename","_sourceMapFilename","_outputFilename","outputFilename","sourceMapURL","sourceMapBasepath","_sourceMapBasepath","sourceMapRootpath","_sourceMapRootpath","_outputSourceFiles","outputSourceFiles","_sourceMapGeneratorConstructor","getSourceMapGenerator","_lineNumber","_column","removeBasepath","sourceLines","columns","sourceColumns","inputSource","_sourceMapGenerator","addMapping","generated","normalizeFilename","file","sourceRoot","setSourceContent","sourceMapContent","stringify","toJSON","sourceMap","sourceMapOutput","Environment","SourceMapBuilder","sourceMapOutputFilename","sourceMapGenerator","sourceMapFileInline","sourceMapInputFilename","getCSSAppendage","sourceMapBuilder","ParseTree","transformTree","toCSSOptions","getPostProcessors","file_1","getExternalSourceMap","files","rootFilename","parseTree","ImportManager","rootFileInfo","mime","queue","importManager","pluginLoader","fileParsedFunc","importedEqualsRoot","newFileInfo","promise","loadFileCallback","loadedFile","resolvedFilename","pathDiff","isPathAbsolute","alwaysMakePathsAbsolute","newEnv","evalPlugin","loadPlugin","loadFile","render","utils.copyOptions","self_1","Render","context_1","pluginManager_1","reUsePluginManager","imports_1","evalResult","fileContent","Functions","initial","data","ctor","api","fileCache","errback","xhr","XMLHttpRequest","async","isFileProtocol","fileAsync","handleResponse","status","responseText","getResponseHeader","overrideMimeType","open","setRequestHeader","send","onreadystatechange","readyState","location","useFileCache","lessText_1","webInfo","lastModified","doXHR","log","fulfill","catch","rootHref","errorReporting","errors","errorline","classname","logLevel","errorConsole","timer","filenameNoPath","className","innerHTML","browser","style","env","setInterval","replaceChild","clearInterval","errorHTML","remove","removeErrorHTML","depends","lint","insecure","protocol","poll","hostname","port","onReady","addDefaultOptions","LESS_PLUGINS","lessRoot","FM","addFileManager","loggers","console","LogListener","ErrorReporting","cache","localStorage","setCSS","setItem","getCSS","getItem","timestamp","valueOf","Cache","imageSize","imageFunctions","image-size","image-width","image-height","ImageSize","typePattern","thisArg","curryArgs","loadStyles","instanceOptions","loadStyleSheet","reload","remaining","local","loadInitialFileCallback","loadStyleSheets","sheets","watch","watchMode","watchTimer","clearFileCache","unwatch","registerStylesheetsImmediately","links","rel","registerStylesheets","record","refresh","startTime","endTime","totalMilliseconds","remainingSheets","refreshStyles","resolveOrReject","pageLoadFinished"],"mappings":";;;;;;;;;oMACgBA,EAAUC,GACtB,OAAOA,EAAKC,QAAQ,sBAAuB,IACtCA,QAAQ,uBAAwB,IAChCA,QAAQ,MAAO,IACfA,QAAQ,eAAgB,IACxBA,QAAQ,aAAc,KACtBA,QAAQ,MAAO,cAGRC,EAAYC,EAASC,GACjC,IAAK,IAAMC,KAAOD,EAAIE,QAClB,GAAIF,EAAIE,QAAQC,eAAeF,GAC3B,GAAY,QAARA,GAAyB,oBAARA,GAAqC,aAARA,GAA8B,mBAARA,EACpEF,EAAQE,GAAOD,EAAIE,QAAQD,QAE3B,IACIF,EAAQE,GAAOG,KAAKC,MAAML,EAAIE,QAAQD,IAE1C,MAAOK,WChBR,SAAUC,EAAUC,EAAQC,GAEnC,IAAMb,EAAOa,EAAMb,MAAQ,GAGrBc,EAAK,SAAQD,EAAME,OAASC,EAAgBhB,IAG5CiB,EAAeN,EAASO,eAAeJ,GACzCK,GAAmB,EAGjBC,EAAYT,EAASU,cAAc,SACzCD,EAAUE,aAAa,OAAQ,YAC3BT,EAAMU,OACNH,EAAUE,aAAa,QAAST,EAAMU,OAE1CH,EAAUN,GAAKA,EAEVM,EAAUI,aACXJ,EAAUK,YAAYd,EAASe,eAAed,IAG9CO,EAAqC,OAAjBF,GAAyBA,EAAaU,WAAWC,OAAS,GAAKR,EAAUO,WAAWC,OAAS,GAC7GX,EAAaY,WAAWC,YAAcV,EAAUS,WAAWC,WAGnE,IAAMC,EAAOpB,EAASqB,qBAAqB,QAAQ,GAInD,GAAqB,OAAjBf,IAA8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GAAQgkD,OACTpiD,GAAKM,YAAYgkD,WAZzB5jD,OAAOgrB,KAAOA,GAgBVttB,GAAQinD,UACJ,SAASloC,KAAKzc,OAAOuiD,SAAS3gC,OAC9BoJ,GAAKg8B,QAGJtpD,GAAQgkD,QACT30B,GAAM,oCACNztB,GAAOpB,SAASoB,MAAQpB,SAASqB,qBAAqB,QAAQ,IAC9DqkD,GAAQ1lD,SAASU,cAAc,UAEzB0O,KAAO,WACTs2C,GAAM7kD,WACN6kD,GAAM7kD,WAAWc,QAAUktB,GAE3B62B,GAAM5kD,YAAYd,SAASe,eAAe8tB,KAG9CztB,GAAKN,YAAY4kD,KAErB54B,GAAKq8B,iCACLr8B,GAAKi9B,iBAAmBj9B,GAAK08B,QAAqB,gBAAb18B,GAAK64B,KAAuBxwC,KAAK20C,GAAiBA"} \ No newline at end of file +{"version":3,"file":"less.min.js","sources":["../lib/less-browser/utils.js","../lib/less-browser/browser.js","../lib/less/data/colors.js","../lib/less/data/unit-conversions.js","../lib/less/data/index.js","../lib/less/tree/node.js","../lib/less/tree/color.js","../lib/less/tree/paren.js","../lib/less/tree/combinator.js","../lib/less/tree/element.js","../lib/less/constants.js","../node_modules/clone/clone.js","../lib/less/utils.js","../lib/less/less-error.js","../lib/less/tree/selector.js","../lib/less/tree/value.js","../lib/less/tree/keyword.js","../lib/less/tree/anonymous.js","../lib/less/tree/declaration.js","../lib/less/tree/debug-info.js","../lib/less/tree/comment.js","../lib/less/contexts.js","../lib/less/functions/function-registry.js","../lib/less/functions/default.js","../lib/less/tree/ruleset.js","../lib/less/tree/atrule.js","../lib/less/tree/detached-ruleset.js","../lib/less/tree/unit.js","../lib/less/tree/dimension.js","../lib/less/tree/operation.js","../lib/less/tree/expression.js","../lib/less/functions/function-caller.js","../lib/less/tree/call.js","../lib/less/tree/variable.js","../lib/less/tree/property.js","../lib/less/tree/attribute.js","../lib/less/tree/quoted.js","../lib/less/tree/url.js","../lib/less/tree/media.js","../lib/less/tree/import.js","../lib/less/tree/js-eval-node.js","../lib/less/tree/javascript.js","../lib/less/tree/assignment.js","../lib/less/tree/condition.js","../lib/less/tree/unicode-descriptor.js","../lib/less/tree/negative.js","../lib/less/tree/extend.js","../lib/less/tree/variable-call.js","../lib/less/tree/namespace-value.js","../lib/less/tree/mixin-definition.js","../lib/less/tree/mixin-call.js","../lib/less/tree/index.js","../lib/less/logger.js","../lib/less/environment/environment.js","../lib/less/environment/abstract-file-manager.js","../lib/less/environment/abstract-plugin-loader.js","../lib/less/visitors/visitor.js","../lib/less/visitors/import-sequencer.js","../lib/less/visitors/import-visitor.js","../lib/less/visitors/set-tree-visibility-visitor.js","../lib/less/visitors/extend-visitor.js","../lib/less/visitors/join-selector-visitor.js","../lib/less/visitors/to-css-visitor.js","../lib/less/visitors/index.js","../lib/less/parser/parser-input.js","../lib/less/parser/chunker.js","../lib/less/parser/parser.js","../lib/less/functions/color.js","../lib/less/functions/boolean.js","../lib/less/functions/color-blending.js","../lib/less/functions/list.js","../lib/less/functions/math-helper.js","../lib/less/functions/math.js","../lib/less/functions/number.js","../lib/less/plugin-manager.js","../lib/less/functions/string.js","../lib/less/functions/types.js","../lib/less/functions/index.js","../lib/less/functions/data-uri.js","../lib/less/functions/svg.js","../lib/less/transform-tree.js","../lib/less-browser/file-manager.js","../lib/less/index.js","../lib/less/source-map-output.js","../lib/less/source-map-builder.js","../lib/less/parse-tree.js","../lib/less/import-manager.js","../lib/less/render.js","../lib/less/parse.js","../lib/less-browser/plugin-loader.js","../lib/less-browser/error-reporting.js","../lib/less-browser/bootstrap.js","../lib/less/default-options.js","../lib/less-browser/add-default-options.js","../lib/less-browser/index.js","../lib/less-browser/log-listener.js","../lib/less-browser/cache.js","../lib/less-browser/image-size.js"],"sourcesContent":["\nexport function extractId(href) {\n return href.replace(/^[a-z-]+:\\/+?[^\\/]+/, '') // Remove protocol & domain\n .replace(/[\\?\\&]livereload=\\w+/, '') // Remove LiveReload cachebuster\n .replace(/^\\//, '') // Remove root /\n .replace(/\\.[a-zA-Z]+$/, '') // Remove simple extension\n .replace(/[^\\.\\w-]+/g, '-') // Replace illegal characters\n .replace(/\\./g, ':'); // Replace dots with colons(for valid id)\n}\n\nexport function addDataAttr(options, tag) {\n for (const opt in tag.dataset) {\n if (tag.dataset.hasOwnProperty(opt)) {\n if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {\n options[opt] = tag.dataset[opt];\n } else {\n try {\n options[opt] = JSON.parse(tag.dataset[opt]);\n }\n catch (_) {}\n }\n }\n }\n}\n","import * as utils from './utils';\n\nexport default {\n createCSS: function (document, styles, sheet) {\n // Strip the query-string\n const href = sheet.href || '';\n\n // If there is no title set, use the filename, minus the extension\n const id = `less:${sheet.title || utils.extractId(href)}`;\n\n // If this has already been inserted into the DOM, we may need to replace it\n const oldStyleNode = document.getElementById(id);\n let keepOldStyleNode = false;\n\n // Create a new stylesheet node for insertion or (if necessary) replacement\n const styleNode = document.createElement('style');\n styleNode.setAttribute('type', 'text/css');\n if (sheet.media) {\n styleNode.setAttribute('media', sheet.media);\n }\n styleNode.id = id;\n\n if (!styleNode.styleSheet) {\n styleNode.appendChild(document.createTextNode(styles));\n\n // If new contents match contents of oldStyleNode, don't replace oldStyleNode\n keepOldStyleNode = (oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 &&\n oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue);\n }\n\n const head = document.getElementsByTagName('head')[0];\n\n // If there is no oldStyleNode, just append; otherwise, only append if we need\n // to replace oldStyleNode with an updated stylesheet\n if (oldStyleNode === null || keepOldStyleNode === false) {\n const nextEl = sheet && sheet.nextSibling || null;\n if (nextEl) {\n nextEl.parentNode.insertBefore(styleNode, nextEl);\n } else {\n head.appendChild(styleNode);\n }\n }\n if (oldStyleNode && keepOldStyleNode === false) {\n oldStyleNode.parentNode.removeChild(oldStyleNode);\n }\n\n // For IE.\n // This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.\n // See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head\n if (styleNode.styleSheet) {\n try {\n styleNode.styleSheet.cssText = styles;\n } catch (e) {\n throw new Error('Couldn\\'t reassign styleSheet.cssText.');\n }\n }\n },\n currentScript: function(window) {\n const document = window.document;\n return document.currentScript || (() => {\n const scripts = document.getElementsByTagName('script');\n return scripts[scripts.length - 1];\n })();\n }\n};\n","export default {\n 'aliceblue':'#f0f8ff',\n 'antiquewhite':'#faebd7',\n 'aqua':'#00ffff',\n 'aquamarine':'#7fffd4',\n 'azure':'#f0ffff',\n 'beige':'#f5f5dc',\n 'bisque':'#ffe4c4',\n 'black':'#000000',\n 'blanchedalmond':'#ffebcd',\n 'blue':'#0000ff',\n 'blueviolet':'#8a2be2',\n 'brown':'#a52a2a',\n 'burlywood':'#deb887',\n 'cadetblue':'#5f9ea0',\n 'chartreuse':'#7fff00',\n 'chocolate':'#d2691e',\n 'coral':'#ff7f50',\n 'cornflowerblue':'#6495ed',\n 'cornsilk':'#fff8dc',\n 'crimson':'#dc143c',\n 'cyan':'#00ffff',\n 'darkblue':'#00008b',\n 'darkcyan':'#008b8b',\n 'darkgoldenrod':'#b8860b',\n 'darkgray':'#a9a9a9',\n 'darkgrey':'#a9a9a9',\n 'darkgreen':'#006400',\n 'darkkhaki':'#bdb76b',\n 'darkmagenta':'#8b008b',\n 'darkolivegreen':'#556b2f',\n 'darkorange':'#ff8c00',\n 'darkorchid':'#9932cc',\n 'darkred':'#8b0000',\n 'darksalmon':'#e9967a',\n 'darkseagreen':'#8fbc8f',\n 'darkslateblue':'#483d8b',\n 'darkslategray':'#2f4f4f',\n 'darkslategrey':'#2f4f4f',\n 'darkturquoise':'#00ced1',\n 'darkviolet':'#9400d3',\n 'deeppink':'#ff1493',\n 'deepskyblue':'#00bfff',\n 'dimgray':'#696969',\n 'dimgrey':'#696969',\n 'dodgerblue':'#1e90ff',\n 'firebrick':'#b22222',\n 'floralwhite':'#fffaf0',\n 'forestgreen':'#228b22',\n 'fuchsia':'#ff00ff',\n 'gainsboro':'#dcdcdc',\n 'ghostwhite':'#f8f8ff',\n 'gold':'#ffd700',\n 'goldenrod':'#daa520',\n 'gray':'#808080',\n 'grey':'#808080',\n 'green':'#008000',\n 'greenyellow':'#adff2f',\n 'honeydew':'#f0fff0',\n 'hotpink':'#ff69b4',\n 'indianred':'#cd5c5c',\n 'indigo':'#4b0082',\n 'ivory':'#fffff0',\n 'khaki':'#f0e68c',\n 'lavender':'#e6e6fa',\n 'lavenderblush':'#fff0f5',\n 'lawngreen':'#7cfc00',\n 'lemonchiffon':'#fffacd',\n 'lightblue':'#add8e6',\n 'lightcoral':'#f08080',\n 'lightcyan':'#e0ffff',\n 'lightgoldenrodyellow':'#fafad2',\n 'lightgray':'#d3d3d3',\n 'lightgrey':'#d3d3d3',\n 'lightgreen':'#90ee90',\n 'lightpink':'#ffb6c1',\n 'lightsalmon':'#ffa07a',\n 'lightseagreen':'#20b2aa',\n 'lightskyblue':'#87cefa',\n 'lightslategray':'#778899',\n 'lightslategrey':'#778899',\n 'lightsteelblue':'#b0c4de',\n 'lightyellow':'#ffffe0',\n 'lime':'#00ff00',\n 'limegreen':'#32cd32',\n 'linen':'#faf0e6',\n 'magenta':'#ff00ff',\n 'maroon':'#800000',\n 'mediumaquamarine':'#66cdaa',\n 'mediumblue':'#0000cd',\n 'mediumorchid':'#ba55d3',\n 'mediumpurple':'#9370d8',\n 'mediumseagreen':'#3cb371',\n 'mediumslateblue':'#7b68ee',\n 'mediumspringgreen':'#00fa9a',\n 'mediumturquoise':'#48d1cc',\n 'mediumvioletred':'#c71585',\n 'midnightblue':'#191970',\n 'mintcream':'#f5fffa',\n 'mistyrose':'#ffe4e1',\n 'moccasin':'#ffe4b5',\n 'navajowhite':'#ffdead',\n 'navy':'#000080',\n 'oldlace':'#fdf5e6',\n 'olive':'#808000',\n 'olivedrab':'#6b8e23',\n 'orange':'#ffa500',\n 'orangered':'#ff4500',\n 'orchid':'#da70d6',\n 'palegoldenrod':'#eee8aa',\n 'palegreen':'#98fb98',\n 'paleturquoise':'#afeeee',\n 'palevioletred':'#d87093',\n 'papayawhip':'#ffefd5',\n 'peachpuff':'#ffdab9',\n 'peru':'#cd853f',\n 'pink':'#ffc0cb',\n 'plum':'#dda0dd',\n 'powderblue':'#b0e0e6',\n 'purple':'#800080',\n 'rebeccapurple':'#663399',\n 'red':'#ff0000',\n 'rosybrown':'#bc8f8f',\n 'royalblue':'#4169e1',\n 'saddlebrown':'#8b4513',\n 'salmon':'#fa8072',\n 'sandybrown':'#f4a460',\n 'seagreen':'#2e8b57',\n 'seashell':'#fff5ee',\n 'sienna':'#a0522d',\n 'silver':'#c0c0c0',\n 'skyblue':'#87ceeb',\n 'slateblue':'#6a5acd',\n 'slategray':'#708090',\n 'slategrey':'#708090',\n 'snow':'#fffafa',\n 'springgreen':'#00ff7f',\n 'steelblue':'#4682b4',\n 'tan':'#d2b48c',\n 'teal':'#008080',\n 'thistle':'#d8bfd8',\n 'tomato':'#ff6347',\n 'turquoise':'#40e0d0',\n 'violet':'#ee82ee',\n 'wheat':'#f5deb3',\n 'white':'#ffffff',\n 'whitesmoke':'#f5f5f5',\n 'yellow':'#ffff00',\n 'yellowgreen':'#9acd32'\n};","export default {\n length: {\n 'm': 1,\n 'cm': 0.01,\n 'mm': 0.001,\n 'in': 0.0254,\n 'px': 0.0254 / 96,\n 'pt': 0.0254 / 72,\n 'pc': 0.0254 / 72 * 12\n },\n duration: {\n 's': 1,\n 'ms': 0.001\n },\n angle: {\n 'rad': 1 / (2 * Math.PI),\n 'deg': 1 / 360,\n 'grad': 1 / 400,\n 'turn': 1\n }\n};","import colors from './colors';\nimport unitConversions from './unit-conversions';\n\nexport default { colors, unitConversions };\n","class Node {\n constructor() {\n this.parent = null;\n this.visibilityBlocks = undefined;\n this.nodeVisible = undefined;\n this.rootNode = null;\n this.parsed = null;\n\n const self = this;\n Object.defineProperty(this, 'currentFileInfo', {\n get: function() { return self.fileInfo(); }\n });\n Object.defineProperty(this, 'index', {\n get: function() { return self.getIndex(); }\n });\n\n }\n\n setParent(nodes, parent) {\n function set(node) {\n if (node && node instanceof Node) {\n node.parent = parent;\n }\n }\n if (Array.isArray(nodes)) {\n nodes.forEach(set);\n }\n else {\n set(nodes);\n }\n }\n\n getIndex() {\n return this._index || (this.parent && this.parent.getIndex()) || 0;\n }\n\n fileInfo() {\n return this._fileInfo || (this.parent && this.parent.fileInfo()) || {};\n }\n\n isRulesetLike() {\n return false;\n }\n\n toCSS(context) {\n const strs = [];\n this.genCSS(context, {\n add: function(chunk, fileInfo, index) {\n strs.push(chunk);\n },\n isEmpty: function () {\n return strs.length === 0;\n }\n });\n return strs.join('');\n }\n\n genCSS(context, output) {\n output.add(this.value);\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval() { return this; }\n\n _operate(context, op, a, b) {\n switch (op) {\n case '+': return a + b;\n case '-': return a - b;\n case '*': return a * b;\n case '/': return a / b;\n }\n }\n\n fround(context, value) {\n const precision = context && context.numPrecision;\n // add \"epsilon\" to ensure numbers like 1.000000005 (represented as 1.000000004999...) are properly rounded:\n return (precision) ? Number((value + 2e-16).toFixed(precision)) : value;\n }\n\n // Returns true if this node represents root of ast imported by reference\n blocksVisibility() {\n if (this.visibilityBlocks == null) {\n this.visibilityBlocks = 0;\n }\n return this.visibilityBlocks !== 0;\n }\n\n addVisibilityBlock() {\n if (this.visibilityBlocks == null) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks + 1;\n }\n\n removeVisibilityBlock() {\n if (this.visibilityBlocks == null) {\n this.visibilityBlocks = 0;\n }\n this.visibilityBlocks = this.visibilityBlocks - 1;\n }\n\n // Turns on node visibility - if called node will be shown in output regardless\n // of whether it comes from import by reference or not\n ensureVisibility() {\n this.nodeVisible = true;\n }\n\n // Turns off node visibility - if called node will NOT be shown in output regardless\n // of whether it comes from import by reference or not\n ensureInvisibility() {\n this.nodeVisible = false;\n }\n\n // return values:\n // false - the node must not be visible\n // true - the node must be visible\n // undefined or null - the node has the same visibility as its parent\n isVisible() {\n return this.nodeVisible;\n }\n\n visibilityInfo() {\n return {\n visibilityBlocks: this.visibilityBlocks,\n nodeVisible: this.nodeVisible\n };\n }\n\n copyVisibilityInfo(info) {\n if (!info) {\n return;\n }\n this.visibilityBlocks = info.visibilityBlocks;\n this.nodeVisible = info.nodeVisible;\n }\n}\n\nNode.compare = (a, b) => {\n /* returns:\n -1: a < b\n 0: a = b\n 1: a > b\n and *any* other value for a != b (e.g. undefined, NaN, -2 etc.) */\n\n if ((a.compare) &&\n // for \"symmetric results\" force toCSS-based comparison\n // of Quoted or Anonymous if either value is one of those\n !(b.type === 'Quoted' || b.type === 'Anonymous')) {\n return a.compare(b);\n } else if (b.compare) {\n return -b.compare(a);\n } else if (a.type !== b.type) {\n return undefined;\n }\n\n a = a.value;\n b = b.value;\n if (!Array.isArray(a)) {\n return a === b ? 0 : undefined;\n }\n if (a.length !== b.length) {\n return undefined;\n }\n for (let i = 0; i < a.length; i++) {\n if (Node.compare(a[i], b[i]) !== 0) {\n return undefined;\n }\n }\n return 0;\n};\n\nNode.numericCompare = (a, b) => a < b ? -1\n : a === b ? 0\n : a > b ? 1 : undefined;\nexport default Node;\n","import Node from './node';\nimport colors from '../data/colors';\n\n//\n// RGB Colors - #ff0014, #eee\n//\nclass Color extends Node {\n constructor(rgb, a, originalForm) {\n super();\n\n const self = this;\n //\n // The end goal here, is to parse the arguments\n // into an integer triplet, such as `128, 255, 0`\n //\n // This facilitates operations and conversions.\n //\n if (Array.isArray(rgb)) {\n this.rgb = rgb;\n } else if (rgb.length >= 6) {\n this.rgb = [];\n rgb.match(/.{2}/g).map((c, i) => {\n if (i < 3) {\n self.rgb.push(parseInt(c, 16));\n } else {\n self.alpha = (parseInt(c, 16)) / 255;\n }\n });\n } else {\n this.rgb = [];\n rgb.split('').map((c, i) => {\n if (i < 3) {\n self.rgb.push(parseInt(c + c, 16));\n } else {\n self.alpha = (parseInt(c + c, 16)) / 255;\n }\n });\n }\n this.alpha = this.alpha || (typeof a === 'number' ? a : 1);\n if (typeof originalForm !== 'undefined') {\n this.value = originalForm;\n }\n }\n\n luma() {\n let r = this.rgb[0] / 255;\n let g = this.rgb[1] / 255;\n let b = this.rgb[2] / 255;\n\n r = (r <= 0.03928) ? r / 12.92 : Math.pow(((r + 0.055) / 1.055), 2.4);\n g = (g <= 0.03928) ? g / 12.92 : Math.pow(((g + 0.055) / 1.055), 2.4);\n b = (b <= 0.03928) ? b / 12.92 : Math.pow(((b + 0.055) / 1.055), 2.4);\n\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n }\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n }\n\n toCSS(context, doNotCompress) {\n const compress = context && context.compress && !doNotCompress;\n let color;\n let alpha;\n let colorFunction;\n let args = [];\n\n // `value` is set if this color was originally\n // converted from a named color string so we need\n // to respect this and try to output named color too.\n alpha = this.fround(context, this.alpha);\n\n if (this.value) {\n if (this.value.indexOf('rgb') === 0) {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n } else if (this.value.indexOf('hsl') === 0) {\n if (alpha < 1) {\n colorFunction = 'hsla';\n } else {\n colorFunction = 'hsl';\n }\n } else {\n return this.value;\n }\n } else {\n if (alpha < 1) {\n colorFunction = 'rgba';\n }\n }\n\n switch (colorFunction) {\n case 'rgba':\n args = this.rgb.map(c => clamp(Math.round(c), 255)).concat(clamp(alpha, 1));\n break;\n case 'hsla':\n args.push(clamp(alpha, 1));\n case 'hsl':\n color = this.toHSL();\n args = [\n this.fround(context, color.h),\n `${this.fround(context, color.s * 100)}%`,\n `${this.fround(context, color.l * 100)}%`\n ].concat(args);\n }\n\n if (colorFunction) {\n // Values are capped between `0` and `255`, rounded and zero-padded.\n return `${colorFunction}(${args.join(`,${compress ? '' : ' '}`)})`;\n }\n\n color = this.toRGB();\n\n if (compress) {\n const splitcolor = color.split('');\n\n // Convert color to short format\n if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) {\n color = `#${splitcolor[1]}${splitcolor[3]}${splitcolor[5]}`;\n }\n }\n\n return color;\n }\n\n //\n // Operations have to be done per-channel, if not,\n // channels will spill onto each other. Once we have\n // our result, in the form of an integer triplet,\n // we create a new Color node to hold the result.\n //\n operate(context, op, other) {\n const rgb = new Array(3);\n const alpha = this.alpha * (1 - other.alpha) + other.alpha;\n for (let c = 0; c < 3; c++) {\n rgb[c] = this._operate(context, op, this.rgb[c], other.rgb[c]);\n }\n return new Color(rgb, alpha);\n }\n\n toRGB() {\n return toHex(this.rgb);\n }\n\n toHSL() {\n const r = this.rgb[0] / 255;\n const g = this.rgb[1] / 255;\n const b = this.rgb[2] / 255;\n const a = this.alpha;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h;\n let s;\n const l = (max + min) / 2;\n const d = max - min;\n\n if (max === min) {\n h = s = 0;\n } else {\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, l, a };\n }\n\n // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n toHSV() {\n const r = this.rgb[0] / 255;\n const g = this.rgb[1] / 255;\n const b = this.rgb[2] / 255;\n const a = this.alpha;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h;\n let s;\n const v = max;\n\n const d = max - min;\n if (max === 0) {\n s = 0;\n } else {\n s = d / max;\n }\n\n if (max === min) {\n h = 0;\n } else {\n switch (max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h * 360, s, v, a };\n }\n\n toARGB() {\n return toHex([this.alpha * 255].concat(this.rgb));\n }\n\n compare(x) {\n return (x.rgb &&\n x.rgb[0] === this.rgb[0] &&\n x.rgb[1] === this.rgb[1] &&\n x.rgb[2] === this.rgb[2] &&\n x.alpha === this.alpha) ? 0 : undefined;\n }\n}\n\nColor.prototype.type = 'Color';\n\nfunction clamp(v, max) {\n return Math.min(Math.max(v, 0), max);\n}\n\nfunction toHex(v) {\n return `#${v.map(c => {\n c = clamp(Math.round(c), 255);\n return (c < 16 ? '0' : '') + c.toString(16);\n }).join('')}`;\n}\n\nColor.fromKeyword = keyword => {\n let c;\n const key = keyword.toLowerCase();\n if (colors.hasOwnProperty(key)) {\n c = new Color(colors[key].slice(1));\n }\n else if (key === 'transparent') {\n c = new Color([0, 0, 0], 0);\n }\n\n if (c) {\n c.value = keyword;\n return c;\n }\n};\nexport default Color;\n","import Node from './node';\n\nclass Paren extends Node {\n constructor(node) {\n super();\n\n this.value = node;\n }\n\n genCSS(context, output) {\n output.add('(');\n this.value.genCSS(context, output);\n output.add(')');\n }\n\n eval(context) {\n return new Paren(this.value.eval(context));\n }\n}\n\nParen.prototype.type = 'Paren';\nexport default Paren;\n","import Node from './node';\nconst _noSpaceCombinators = {\n '': true,\n ' ': true,\n '|': true\n};\n\nclass Combinator extends Node {\n constructor(value) {\n super();\n\n if (value === ' ') {\n this.value = ' ';\n this.emptyOrWhitespace = true;\n } else {\n this.value = value ? value.trim() : '';\n this.emptyOrWhitespace = this.value === '';\n }\n }\n\n genCSS(context, output) {\n const spaceOrEmpty = (context.compress || _noSpaceCombinators[this.value]) ? '' : ' ';\n output.add(spaceOrEmpty + this.value + spaceOrEmpty);\n }\n}\n\nCombinator.prototype.type = 'Combinator';\n\nexport default Combinator;\n","import Node from './node';\nimport Paren from './paren';\nimport Combinator from './combinator';\n\nclass Element extends Node {\n constructor(combinator, value, isVariable, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.combinator = combinator instanceof Combinator ?\n combinator : new Combinator(combinator);\n\n if (typeof value === 'string') {\n this.value = value.trim();\n } else if (value) {\n this.value = value;\n } else {\n this.value = '';\n }\n this.isVariable = isVariable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.combinator, this);\n }\n\n accept(visitor) {\n const value = this.value;\n this.combinator = visitor.visit(this.combinator);\n if (typeof value === 'object') {\n this.value = visitor.visit(value);\n }\n }\n\n eval(context) {\n return new Element(this.combinator,\n this.value.eval ? this.value.eval(context) : this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n }\n\n clone() {\n return new Element(this.combinator,\n this.value,\n this.isVariable,\n this.getIndex(),\n this.fileInfo(), this.visibilityInfo());\n }\n\n genCSS(context, output) {\n output.add(this.toCSS(context), this.fileInfo(), this.getIndex());\n }\n\n toCSS(context = {}) {\n let value = this.value;\n const firstSelector = context.firstSelector;\n if (value instanceof Paren) {\n // selector in parens should not be affected by outer selector\n // flags (breaks only interpolated selectors - see #1973)\n context.firstSelector = true;\n }\n value = value.toCSS ? value.toCSS(context) : value;\n context.firstSelector = firstSelector;\n if (value === '' && this.combinator.value.charAt(0) === '&') {\n return '';\n } else {\n return this.combinator.toCSS(context) + value;\n }\n }\n}\n\nElement.prototype.type = 'Element';\nexport default Element;\n","\nexport const Math = {\n ALWAYS: 0,\n PARENS_DIVISION: 1,\n PARENS: 2,\n STRICT_LEGACY: 3\n};\n\nexport const RewriteUrls = {\n OFF: 0,\n LOCAL: 1,\n ALL: 2\n};","var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n","/* jshint proto: true */\nimport * as Constants from './constants';\nimport CloneHelper from 'clone';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = CloneHelper(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? CloneHelper(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.STRICT_LEGACY;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n case 'strict-legacy':\n opts.math = Constants.Math.STRICT_LEGACY;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (obj2.hasOwnProperty(prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}","import * as utils from './utils';\n\nconst anonymousFunc = /(|Function):(\\d+):(\\d+)/;\n\n/**\n * This is a centralized class of any error that could be thrown internally (mostly by the parser).\n * Besides standard .message it keeps some additional data like a path to the file where the error\n * occurred along with line and column numbers.\n *\n * @class\n * @extends Error\n * @type {module.LessError}\n *\n * @prop {string} type\n * @prop {string} filename\n * @prop {number} index\n * @prop {number} line\n * @prop {number} column\n * @prop {number} callLine\n * @prop {number} callExtract\n * @prop {string[]} extract\n *\n * @param {Object} e - An error object to wrap around or just a descriptive object\n * @param {Object} fileContentMap - An object with file contents in 'contents' property (like importManager) @todo - move to fileManager?\n * @param {string} [currentFilename]\n */\nconst LessError = function LessError(e, fileContentMap, currentFilename) {\n Error.call(this);\n\n const filename = e.filename || currentFilename;\n\n this.message = e.message;\n this.stack = e.stack;\n\n if (fileContentMap && filename) {\n const input = fileContentMap.contents[filename];\n const loc = utils.getLocation(e.index, input);\n const line = loc.line;\n const col = loc.column;\n const callLine = e.call && utils.getLocation(e.call, input).line;\n const lines = input ? input.split('\\n') : '';\n\n this.type = e.type || 'Syntax';\n this.filename = filename;\n this.index = e.index;\n this.line = typeof line === 'number' ? line + 1 : null;\n this.column = col;\n\n if (!this.line && this.stack) {\n const found = this.stack.match(anonymousFunc);\n\n /**\n * We have to figure out how this environment stringifies anonymous functions\n * so we can correctly map plugin errors.\n * \n * Note, in Node 8, the output of anonymous funcs varied based on parameters\n * being present or not, so we inject dummy params.\n */\n const func = new Function('a', 'throw new Error()');\n let lineAdjust = 0;\n try {\n func();\n } catch (e) {\n const match = e.stack.match(anonymousFunc);\n const line = parseInt(match[2]);\n lineAdjust = 1 - line;\n }\n\n if (found) {\n if (found[2]) {\n this.line = parseInt(found[2]) + lineAdjust;\n }\n if (found[3]) {\n this.column = parseInt(found[3]);\n }\n }\n }\n\n this.callLine = callLine + 1;\n this.callExtract = lines[callLine];\n\n this.extract = [\n lines[this.line - 2],\n lines[this.line - 1],\n lines[this.line]\n ];\n }\n\n};\n\nif (typeof Object.create === 'undefined') {\n const F = () => {};\n F.prototype = Error.prototype;\n LessError.prototype = new F();\n} else {\n LessError.prototype = Object.create(Error.prototype);\n}\n\nLessError.prototype.constructor = LessError;\n\n/**\n * An overridden version of the default Object.prototype.toString\n * which uses additional information to create a helpful message.\n *\n * @param {Object} options\n * @returns {string}\n */\nLessError.prototype.toString = function(options = {}) {\n let message = '';\n const extract = this.extract || [];\n let error = [];\n let stylize = str => str;\n if (options.stylize) {\n const type = typeof options.stylize;\n if (type !== 'function') {\n throw Error(`options.stylize should be a function, got a ${type}!`);\n }\n stylize = options.stylize;\n }\n\n if (this.line !== null) {\n if (typeof extract[0] === 'string') {\n error.push(stylize(`${this.line - 1} ${extract[0]}`, 'grey'));\n }\n\n if (typeof extract[1] === 'string') {\n let errorTxt = `${this.line} `;\n if (extract[1]) {\n errorTxt += extract[1].slice(0, this.column) +\n stylize(stylize(stylize(extract[1].substr(this.column, 1), 'bold') +\n extract[1].slice(this.column + 1), 'red'), 'inverse');\n }\n error.push(errorTxt);\n }\n\n if (typeof extract[2] === 'string') {\n error.push(stylize(`${this.line + 1} ${extract[2]}`, 'grey'));\n }\n error = `${error.join('\\n') + stylize('', 'reset')}\\n`;\n }\n\n message += stylize(`${this.type}Error: ${this.message}`, 'red');\n if (this.filename) {\n message += stylize(' in ', 'red') + this.filename;\n }\n if (this.line) {\n message += stylize(` on line ${this.line}, column ${this.column + 1}:`, 'grey');\n }\n\n message += `\\n${error}`;\n\n if (this.callLine) {\n message += `${stylize('from ', 'red') + (this.filename || '')}/n`;\n message += `${stylize(this.callLine, 'grey')} ${this.callExtract}/n`;\n }\n\n return message;\n};\n\nexport default LessError;","import Node from './node';\nimport Element from './element';\nimport LessError from '../less-error';\n\nclass Selector extends Node {\n constructor(elements, extendList, condition, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.extendList = extendList;\n this.condition = condition;\n this.evaldCondition = !condition;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.elements = this.getElements(elements);\n this.mixinElements_ = undefined;\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.elements, this);\n }\n\n accept(visitor) {\n if (this.elements) {\n this.elements = visitor.visitArray(this.elements);\n }\n if (this.extendList) {\n this.extendList = visitor.visitArray(this.extendList);\n }\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n }\n\n createDerived(elements, extendList, evaldCondition) {\n elements = this.getElements(elements);\n const newSelector = new Selector(elements, extendList || this.extendList,\n null, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n newSelector.evaldCondition = (evaldCondition != null) ? evaldCondition : this.evaldCondition;\n newSelector.mediaEmpty = this.mediaEmpty;\n return newSelector;\n }\n\n getElements(els) {\n if (!els) {\n return [new Element('', '&', false, this._index, this._fileInfo)];\n }\n if (typeof els === 'string') {\n this.parse.parseNode(\n els, \n ['selector'],\n this._index, \n this._fileInfo, \n function(err, result) {\n if (err) {\n throw new LessError({\n index: err.index,\n message: err.message\n }, this.parse.imports, this._fileInfo.filename);\n }\n els = result[0].elements;\n });\n }\n return els;\n }\n\n createEmptySelectors() {\n const el = new Element('', '&', false, this._index, this._fileInfo);\n const sels = [new Selector([el], null, null, this._index, this._fileInfo)];\n sels[0].mediaEmpty = true;\n return sels;\n }\n\n match(other) {\n const elements = this.elements;\n const len = elements.length;\n let olen;\n let i;\n\n other = other.mixinElements();\n olen = other.length;\n if (olen === 0 || len < olen) {\n return 0;\n } else {\n for (i = 0; i < olen; i++) {\n if (elements[i].value !== other[i]) {\n return 0;\n }\n }\n }\n\n return olen; // return number of matched elements\n }\n\n mixinElements() {\n if (this.mixinElements_) {\n return this.mixinElements_;\n }\n\n let elements = this.elements.map( v => v.combinator.value + (v.value.value || v.value)).join('').match(/[,&#\\*\\.\\w-]([\\w-]|(\\\\.))*/g);\n\n if (elements) {\n if (elements[0] === '&') {\n elements.shift();\n }\n } else {\n elements = [];\n }\n\n return (this.mixinElements_ = elements);\n }\n\n isJustParentSelector() {\n return !this.mediaEmpty &&\n this.elements.length === 1 &&\n this.elements[0].value === '&' &&\n (this.elements[0].combinator.value === ' ' || this.elements[0].combinator.value === '');\n }\n\n eval(context) {\n const evaldCondition = this.condition && this.condition.eval(context);\n let elements = this.elements;\n let extendList = this.extendList;\n\n elements = elements && elements.map(e => e.eval(context));\n extendList = extendList && extendList.map(extend => extend.eval(context));\n\n return this.createDerived(elements, extendList, evaldCondition);\n }\n\n genCSS(context, output) {\n let i;\n let element;\n if ((!context || !context.firstSelector) && this.elements[0].combinator.value === '') {\n output.add(' ', this.fileInfo(), this.getIndex());\n }\n for (i = 0; i < this.elements.length; i++) {\n element = this.elements[i];\n element.genCSS(context, output);\n }\n }\n\n getIsOutput() {\n return this.evaldCondition;\n }\n}\n\nSelector.prototype.type = 'Selector';\nexport default Selector;\n","import Node from './node';\n\nclass Value extends Node {\n constructor(value) {\n super();\n\n if (!value) {\n throw new Error('Value requires an array argument');\n }\n if (!Array.isArray(value)) {\n this.value = [ value ];\n }\n else {\n this.value = value;\n }\n }\n\n accept(visitor) {\n if (this.value) {\n this.value = visitor.visitArray(this.value);\n }\n }\n\n eval(context) {\n if (this.value.length === 1) {\n return this.value[0].eval(context);\n } else {\n return new Value(this.value.map(v => v.eval(context)));\n }\n }\n\n genCSS(context, output) {\n let i;\n for (i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (i + 1 < this.value.length) {\n output.add((context && context.compress) ? ',' : ', ');\n }\n }\n }\n}\n\nValue.prototype.type = 'Value';\nexport default Value;\n","import Node from './node';\n\nclass Keyword extends Node {\n constructor(value) {\n super();\n\n this.value = value;\n }\n\n genCSS(context, output) {\n if (this.value === '%') { throw { type: 'Syntax', message: 'Invalid % without number' }; }\n output.add(this.value);\n }\n}\n\nKeyword.prototype.type = 'Keyword';\n\nKeyword.True = new Keyword('true');\nKeyword.False = new Keyword('false');\n\nexport default Keyword;\n","import Node from './node';\n\nclass Anonymous extends Node {\n constructor(value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {\n super();\n\n this.value = value;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.mapLines = mapLines;\n this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;\n this.allowRoot = true;\n this.copyVisibilityInfo(visibilityInfo);\n }\n\n eval() {\n return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());\n }\n\n compare(other) {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n\n isRulesetLike() {\n return this.rulesetLike;\n }\n\n genCSS(context, output) {\n this.nodeVisible = Boolean(this.value);\n if (this.nodeVisible) {\n output.add(this.value, this._fileInfo, this._index, this.mapLines);\n }\n }\n}\n\nAnonymous.prototype.type = 'Anonymous';\nexport default Anonymous;\n","import Node from './node';\nimport Value from './value';\nimport Keyword from './keyword';\nimport Anonymous from './anonymous';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nclass Declaration extends Node {\n constructor(name, value, important, merge, index, currentFileInfo, inline, variable) {\n super();\n\n this.name = name;\n this.value = (value instanceof Node) ? value : new Value([value ? new Anonymous(value) : null]);\n this.important = important ? ` ${important.trim()}` : '';\n this.merge = merge;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.inline = inline || false;\n this.variable = (variable !== undefined) ? variable\n : (name.charAt && (name.charAt(0) === '@'));\n this.allowRoot = true;\n this.setParent(this.value, this);\n }\n\n genCSS(context, output) {\n output.add(this.name + (context.compress ? ':' : ': '), this.fileInfo(), this.getIndex());\n try {\n this.value.genCSS(context, output);\n }\n catch (e) {\n e.index = this._index;\n e.filename = this._fileInfo.filename;\n throw e;\n }\n output.add(this.important + ((this.inline || (context.lastRule && context.compress)) ? '' : ';'), this._fileInfo, this._index);\n }\n\n eval(context) {\n let mathBypass = false;\n let prevMath;\n let name = this.name;\n let evaldValue;\n let variable = this.variable;\n if (typeof name !== 'string') {\n // expand 'primitive' name directly to get\n // things faster (~10% for benchmark.less):\n name = (name.length === 1) && (name[0] instanceof Keyword) ?\n name[0].value : evalName(context, name);\n variable = false; // never treat expanded interpolation as new variable name\n }\n\n // @todo remove when parens-division is default\n if (name === 'font' && context.math === MATH.ALWAYS) {\n mathBypass = true;\n prevMath = context.math;\n context.math = MATH.PARENS_DIVISION;\n }\n try {\n context.importantScope.push({});\n evaldValue = this.value.eval(context);\n\n if (!this.variable && evaldValue.type === 'DetachedRuleset') {\n throw { message: 'Rulesets cannot be evaluated on a property.',\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n let important = this.important;\n const importantResult = context.importantScope.pop();\n if (!important && importantResult.important) {\n important = importantResult.important;\n }\n\n return new Declaration(name,\n evaldValue,\n important,\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline,\n variable);\n }\n catch (e) {\n if (typeof e.index !== 'number') {\n e.index = this.getIndex();\n e.filename = this.fileInfo().filename;\n }\n throw e;\n }\n finally {\n if (mathBypass) {\n context.math = prevMath;\n }\n }\n }\n\n makeImportant() {\n return new Declaration(this.name,\n this.value,\n '!important',\n this.merge,\n this.getIndex(), this.fileInfo(), this.inline);\n }\n}\n\nfunction evalName(context, name) {\n let value = '';\n let i;\n const n = name.length;\n const output = {add: function (s) {value += s;}};\n for (i = 0; i < n; i++) {\n name[i].eval(context).genCSS(context, output);\n }\n return value;\n}\n\nDeclaration.prototype.type = 'Declaration';\nexport default Declaration;","const debugInfo = (context, ctx, lineSeparator) => {\n let result = '';\n if (context.dumpLineNumbers && !context.compress) {\n switch (context.dumpLineNumbers) {\n case 'comments':\n result = debugInfo.asComment(ctx);\n break;\n case 'mediaquery':\n result = debugInfo.asMediaQuery(ctx);\n break;\n case 'all':\n result = debugInfo.asComment(ctx) + (lineSeparator || '') + debugInfo.asMediaQuery(ctx);\n break;\n }\n }\n return result;\n};\n\ndebugInfo.asComment = ctx => ctx.debugInfo ? `/* line ${ctx.debugInfo.lineNumber}, ${ctx.debugInfo.fileName} */\\n` : '';\n\ndebugInfo.asMediaQuery = ctx => {\n if (!ctx.debugInfo) { return ''; }\n let filenameWithProtocol = ctx.debugInfo.fileName;\n if (!/^[a-z]+:\\/\\//i.test(filenameWithProtocol)) {\n filenameWithProtocol = `file://${filenameWithProtocol}`;\n }\n return `@media -sass-debug-info{filename{font-family:${filenameWithProtocol.replace(/([.:\\/\\\\])/g, a => {\n if (a == '\\\\') {\n a = '\\/';\n }\n return `\\\\${a}`;\n })}}line{font-family:\\\\00003${ctx.debugInfo.lineNumber}}}\\n`;\n};\n\nexport default debugInfo;\n","import Node from './node';\nimport getDebugInfo from './debug-info';\n\nclass Comment extends Node {\n constructor(value, isLineComment, index, currentFileInfo) {\n super();\n\n this.value = value;\n this.isLineComment = isLineComment;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n }\n\n genCSS(context, output) {\n if (this.debugInfo) {\n output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n }\n\n isSilent(context) {\n const isCompressed = context.compress && this.value[2] !== '!';\n return this.isLineComment || isCompressed;\n }\n}\n\nComment.prototype.type = 'Comment';\nexport default Comment;\n","const contexts = {};\nexport default contexts;\nimport * as Constants from './constants';\n\nconst copyFromOriginal = function copyFromOriginal(original, destination, propertiesToCopy) {\n if (!original) { return; }\n\n for (let i = 0; i < propertiesToCopy.length; i++) {\n if (original.hasOwnProperty(propertiesToCopy[i])) {\n destination[propertiesToCopy[i]] = original[propertiesToCopy[i]];\n }\n }\n};\n\n/*\n parse is used whilst parsing\n */\nconst parseCopyProperties = [\n // options\n 'paths', // option - unmodified - paths to search for imports on\n 'rewriteUrls', // option - whether to adjust URL's to be relative\n 'rootpath', // option - rootpath to append to URL's\n 'strictImports', // option -\n 'insecure', // option - whether to allow imports from insecure ssl hosts\n 'dumpLineNumbers', // option - whether to dump line numbers\n 'compress', // option - whether to compress\n 'syncImport', // option - whether to import synchronously\n 'chunkInput', // option - whether to chunk input. more performant but causes parse issues.\n 'mime', // browser only - mime type for sheet import\n 'useFileCache', // browser only - whether to use the per file session cache\n // context\n 'processImports', // option & context - whether to process imports. if false then imports will not be imported.\n // Used by the import manager to stop multiple import visitors being created.\n 'pluginManager' // Used as the plugin manager for the session\n];\n\ncontexts.Parse = function(options) {\n copyFromOriginal(options, this, parseCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n};\n\nconst evalCopyProperties = [\n 'paths', // additional include paths\n 'compress', // whether to compress\n 'math', // whether math has to be within parenthesis\n 'strictUnits', // whether units need to evaluate correctly\n 'sourceMap', // whether to output a source map\n 'importMultiple', // whether we are currently importing multiple copies\n 'urlArgs', // whether to add args into url tokens\n 'javascriptEnabled', // option - whether Inline JavaScript is enabled. if undefined, defaults to false\n 'pluginManager', // Used as the plugin manager for the session\n 'importantScope', // used to bubble up !important statements\n 'rewriteUrls' // option - whether to adjust URL's to be relative\n];\n\nfunction isPathRelative(path) {\n return !/^(?:[a-z-]+:|\\/|#)/i.test(path);\n}\n\nfunction isPathLocalRelative(path) {\n return path.charAt(0) === '.';\n}\n\ncontexts.Eval = class {\n constructor(options, frames) {\n copyFromOriginal(options, this, evalCopyProperties);\n\n if (typeof this.paths === 'string') { this.paths = [this.paths]; }\n\n this.frames = frames || [];\n this.importantScope = this.importantScope || [];\n this.inCalc = false;\n this.mathOn = true;\n }\n\n enterCalc() {\n if (!this.calcStack) {\n this.calcStack = [];\n }\n this.calcStack.push(true);\n this.inCalc = true;\n }\n\n exitCalc() {\n this.calcStack.pop();\n if (!this.calcStack.length) {\n this.inCalc = false;\n }\n }\n\n inParenthesis() {\n if (!this.parensStack) {\n this.parensStack = [];\n }\n this.parensStack.push(true);\n };\n\n outOfParenthesis() {\n this.parensStack.pop();\n };\n\n isMathOn(op) {\n if (!this.mathOn) {\n return false;\n }\n if (op === '/' && this.math !== Constants.Math.ALWAYS && (!this.parensStack || !this.parensStack.length)) {\n return false;\n }\n if (this.math > Constants.Math.PARENS_DIVISION) {\n return this.parensStack && this.parensStack.length;\n }\n return true;\n }\n\n pathRequiresRewrite(path) {\n const isRelative = this.rewriteUrls === Constants.RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative;\n\n return isRelative(path);\n }\n\n rewritePath(path, rootpath) {\n let newPath;\n\n rootpath = rootpath || '';\n newPath = this.normalizePath(rootpath + path);\n\n // If a path was explicit relative and the rootpath was not an absolute path\n // we must ensure that the new path is also explicit relative.\n if (isPathLocalRelative(path) &&\n isPathRelative(rootpath) &&\n isPathLocalRelative(newPath) === false) {\n newPath = `./${newPath}`;\n }\n\n return newPath;\n }\n\n normalizePath(path) {\n const segments = path.split('/').reverse();\n let segment;\n\n path = [];\n while (segments.length !== 0) {\n segment = segments.pop();\n switch ( segment ) {\n case '.':\n break;\n case '..':\n if ((path.length === 0) || (path[path.length - 1] === '..')) {\n path.push( segment );\n } else {\n path.pop();\n }\n break;\n default:\n path.push(segment);\n break;\n }\n }\n\n return path.join('/');\n }\n}\n","function makeRegistry( base ) {\n return {\n _data: {},\n add: function(name, func) {\n // precautionary case conversion, as later querying of\n // the registry by function-caller uses lower case as well.\n name = name.toLowerCase();\n\n if (this._data.hasOwnProperty(name)) {\n // TODO warn\n }\n this._data[name] = func;\n },\n addMultiple: function(functions) {\n Object.keys(functions).forEach(\n name => {\n this.add(name, functions[name]);\n });\n },\n get: function(name) {\n return this._data[name] || ( base && base.get( name ));\n },\n getLocalFunctions: function() {\n return this._data;\n },\n inherit: function() {\n return makeRegistry( this );\n },\n create: function(base) {\n return makeRegistry(base);\n }\n };\n}\n\nexport default makeRegistry( null );","import Keyword from '../tree/keyword';\n\nconst defaultFunc = {\n eval: function () {\n const v = this.value_;\n const e = this.error_;\n if (e) {\n throw e;\n }\n if (v != null) {\n return v ? Keyword.True : Keyword.False;\n }\n },\n value: function (v) {\n this.value_ = v;\n },\n error: function (e) {\n this.error_ = e;\n },\n reset: function () {\n this.value_ = this.error_ = null;\n }\n};\n\nexport default defaultFunc;\n","import Node from './node';\nimport Declaration from './declaration';\nimport Keyword from './keyword';\nimport Comment from './comment';\nimport Paren from './paren';\nimport Selector from './selector';\nimport Element from './element';\nimport Anonymous from './anonymous';\nimport contexts from '../contexts';\nimport globalFunctionRegistry from '../functions/function-registry';\nimport defaultFunc from '../functions/default';\nimport getDebugInfo from './debug-info';\nimport * as utils from '../utils';\n\nclass Ruleset extends Node {\n constructor(selectors, rules, strictImports, visibilityInfo) {\n super();\n\n this.selectors = selectors;\n this.rules = rules;\n this._lookups = {};\n this._variables = null;\n this._properties = null;\n this.strictImports = strictImports;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n this.setParent(this.selectors, this);\n this.setParent(this.rules, this);\n\n }\n\n isRulesetLike() {\n return true;\n }\n\n accept(visitor) {\n if (this.paths) {\n this.paths = visitor.visitArray(this.paths, true);\n } else if (this.selectors) {\n this.selectors = visitor.visitArray(this.selectors);\n }\n if (this.rules && this.rules.length) {\n this.rules = visitor.visitArray(this.rules);\n }\n }\n\n eval(context) {\n const that = this;\n let selectors;\n let selCnt;\n let selector;\n let i;\n let hasVariable;\n let hasOnePassingSelector = false;\n\n if (this.selectors && (selCnt = this.selectors.length)) {\n selectors = new Array(selCnt);\n defaultFunc.error({\n type: 'Syntax',\n message: 'it is currently only allowed in parametric mixin guards,'\n });\n\n for (i = 0; i < selCnt; i++) {\n selector = this.selectors[i].eval(context);\n for (var j = 0; j < selector.elements.length; j++) {\n if (selector.elements[j].isVariable) {\n hasVariable = true;\n break;\n }\n }\n selectors[i] = selector;\n if (selector.evaldCondition) {\n hasOnePassingSelector = true;\n }\n }\n\n if (hasVariable) {\n const toParseSelectors = new Array(selCnt);\n for (i = 0; i < selCnt; i++) {\n selector = selectors[i];\n toParseSelectors[i] = selector.toCSS(context);\n }\n this.parse.parseNode(\n toParseSelectors.join(','),\n [\"selectors\"], \n selectors[0].getIndex(), \n selectors[0].fileInfo(), \n (err, result) => {\n if (result) {\n selectors = utils.flattenArray(result);\n }\n });\n }\n\n defaultFunc.reset();\n } else {\n hasOnePassingSelector = true;\n }\n\n let rules = this.rules ? utils.copyArray(this.rules) : null;\n const ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo());\n let rule;\n let subRule;\n\n ruleset.originalRuleset = this;\n ruleset.root = this.root;\n ruleset.firstRoot = this.firstRoot;\n ruleset.allowImports = this.allowImports;\n\n if (this.debugInfo) {\n ruleset.debugInfo = this.debugInfo;\n }\n\n if (!hasOnePassingSelector) {\n rules.length = 0;\n }\n\n // inherit a function registry from the frames stack when possible;\n // otherwise from the global registry\n ruleset.functionRegistry = (frames => {\n let i = 0;\n const n = frames.length;\n let found;\n for ( ; i !== n ; ++i ) {\n found = frames[ i ].functionRegistry;\n if ( found ) { return found; }\n }\n return globalFunctionRegistry;\n })(context.frames).inherit();\n\n // push the current ruleset to the frames stack\n const ctxFrames = context.frames;\n ctxFrames.unshift(ruleset);\n\n // currrent selectors\n let ctxSelectors = context.selectors;\n if (!ctxSelectors) {\n context.selectors = ctxSelectors = [];\n }\n ctxSelectors.unshift(this.selectors);\n\n // Evaluate imports\n if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {\n ruleset.evalImports(context);\n }\n\n // Store the frames around mixin definitions,\n // so they can be evaluated like closures when the time comes.\n const rsRules = ruleset.rules;\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.evalFirst) {\n rsRules[i] = rule.eval(context);\n }\n }\n\n const mediaBlockCount = (context.mediaBlocks && context.mediaBlocks.length) || 0;\n\n // Evaluate mixin calls.\n for (i = 0; (rule = rsRules[i]); i++) {\n if (rule.type === 'MixinCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).filter(r => {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope if the variable is\n // already there. consider returning false here\n // but we need a way to \"return\" variable from mixins\n return !(ruleset.variable(r.name));\n }\n return true;\n });\n rsRules.splice(...[i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n } else if (rule.type === 'VariableCall') {\n /* jshint loopfunc:true */\n rules = rule.eval(context).rules.filter(r => {\n if ((r instanceof Declaration) && r.variable) {\n // do not pollute the scope at all\n return false;\n }\n return true;\n });\n rsRules.splice(...[i, 1].concat(rules));\n i += rules.length - 1;\n ruleset.resetCache();\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n if (!rule.evalFirst) {\n rsRules[i] = rule = rule.eval ? rule.eval(context) : rule;\n }\n }\n\n // Evaluate everything else\n for (i = 0; (rule = rsRules[i]); i++) {\n // for rulesets, check if it is a css guard and can be removed\n if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) {\n // check if it can be folded in (e.g. & where)\n if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) {\n rsRules.splice(i--, 1);\n\n for (var j = 0; (subRule = rule.rules[j]); j++) {\n if (subRule instanceof Node) {\n subRule.copyVisibilityInfo(rule.visibilityInfo());\n if (!(subRule instanceof Declaration) || !subRule.variable) {\n rsRules.splice(++i, 0, subRule);\n }\n }\n }\n }\n }\n }\n\n // Pop the stack\n ctxFrames.shift();\n ctxSelectors.shift();\n\n if (context.mediaBlocks) {\n for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) {\n context.mediaBlocks[i].bubbleSelectors(selectors);\n }\n }\n\n return ruleset;\n }\n\n evalImports(context) {\n const rules = this.rules;\n let i;\n let importRules;\n if (!rules) { return; }\n\n for (i = 0; i < rules.length; i++) {\n if (rules[i].type === 'Import') {\n importRules = rules[i].eval(context);\n if (importRules && (importRules.length || importRules.length === 0)) {\n rules.splice(...[i, 1].concat(importRules));\n i += importRules.length - 1;\n } else {\n rules.splice(i, 1, importRules);\n }\n this.resetCache();\n }\n }\n }\n\n makeImportant() {\n const result = new Ruleset(this.selectors, this.rules.map(r => {\n if (r.makeImportant) {\n return r.makeImportant();\n } else {\n return r;\n }\n }), this.strictImports, this.visibilityInfo());\n\n return result;\n }\n\n matchArgs(args) {\n return !args || args.length === 0;\n }\n\n // lets you call a css selector with a guard\n matchCondition(args, context) {\n const lastSelector = this.selectors[this.selectors.length - 1];\n if (!lastSelector.evaldCondition) {\n return false;\n }\n if (lastSelector.condition &&\n !lastSelector.condition.eval(\n new contexts.Eval(context,\n context.frames))) {\n return false;\n }\n return true;\n }\n\n resetCache() {\n this._rulesets = null;\n this._variables = null;\n this._properties = null;\n this._lookups = {};\n }\n\n variables() {\n if (!this._variables) {\n this._variables = !this.rules ? {} : this.rules.reduce((hash, r) => {\n if (r instanceof Declaration && r.variable === true) {\n hash[r.name] = r;\n }\n // when evaluating variables in an import statement, imports have not been eval'd\n // so we need to go inside import statements.\n // guard against root being a string (in the case of inlined less)\n if (r.type === 'Import' && r.root && r.root.variables) {\n const vars = r.root.variables();\n for (const name in vars) {\n if (vars.hasOwnProperty(name)) {\n hash[name] = r.root.variable(name);\n }\n }\n }\n return hash;\n }, {});\n }\n return this._variables;\n }\n\n properties() {\n if (!this._properties) {\n this._properties = !this.rules ? {} : this.rules.reduce((hash, r) => {\n if (r instanceof Declaration && r.variable !== true) {\n const name = (r.name.length === 1) && (r.name[0] instanceof Keyword) ?\n r.name[0].value : r.name;\n // Properties don't overwrite as they can merge\n if (!hash[`$${name}`]) {\n hash[`$${name}`] = [ r ];\n }\n else {\n hash[`$${name}`].push(r);\n }\n }\n return hash;\n }, {});\n }\n return this._properties;\n }\n\n variable(name) {\n const decl = this.variables()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n }\n\n property(name) {\n const decl = this.properties()[name];\n if (decl) {\n return this.parseValue(decl);\n }\n }\n\n lastDeclaration() {\n for (let i = this.rules.length; i > 0; i--) {\n const decl = this.rules[i - 1];\n if (decl instanceof Declaration) {\n return this.parseValue(decl);\n }\n }\n }\n\n parseValue(toParse) {\n const self = this;\n function transformDeclaration(decl) {\n if (decl.value instanceof Anonymous && !decl.parsed) {\n if (typeof decl.value.value === 'string') {\n this.parse.parseNode(\n decl.value.value,\n ['value', 'important'], \n decl.value.getIndex(), \n decl.fileInfo(), \n (err, result) => {\n if (err) {\n decl.parsed = true;\n }\n if (result) {\n decl.value = result[0];\n decl.important = result[1] || '';\n decl.parsed = true;\n }\n });\n } else {\n decl.parsed = true;\n }\n\n return decl;\n }\n else {\n return decl;\n }\n }\n if (!Array.isArray(toParse)) {\n return transformDeclaration.call(self, toParse);\n }\n else {\n const nodes = [];\n toParse.forEach(n => {\n nodes.push(transformDeclaration.call(self, n));\n });\n return nodes;\n }\n }\n\n rulesets() {\n if (!this.rules) { return []; }\n\n const filtRules = [];\n const rules = this.rules;\n let i;\n let rule;\n\n for (i = 0; (rule = rules[i]); i++) {\n if (rule.isRuleset) {\n filtRules.push(rule);\n }\n }\n\n return filtRules;\n }\n\n prependRule(rule) {\n const rules = this.rules;\n if (rules) {\n rules.unshift(rule);\n } else {\n this.rules = [ rule ];\n }\n this.setParent(rule, this);\n }\n\n find(selector, self = this, filter) {\n const rules = [];\n let match;\n let foundMixins;\n const key = selector.toCSS();\n\n if (key in this._lookups) { return this._lookups[key]; }\n\n this.rulesets().forEach(rule => {\n if (rule !== self) {\n for (let j = 0; j < rule.selectors.length; j++) {\n match = selector.match(rule.selectors[j]);\n if (match) {\n if (selector.elements.length > match) {\n if (!filter || filter(rule)) {\n foundMixins = rule.find(new Selector(selector.elements.slice(match)), self, filter);\n for (let i = 0; i < foundMixins.length; ++i) {\n foundMixins[i].path.push(rule);\n }\n Array.prototype.push.apply(rules, foundMixins);\n }\n } else {\n rules.push({ rule, path: []});\n }\n break;\n }\n }\n }\n });\n this._lookups[key] = rules;\n return rules;\n }\n\n genCSS(context, output) {\n let i;\n let j;\n const charsetRuleNodes = [];\n let ruleNodes = [];\n\n let // Line number debugging\n debugInfo;\n\n let rule;\n let path;\n\n context.tabLevel = (context.tabLevel || 0);\n\n if (!this.root) {\n context.tabLevel++;\n }\n\n const tabRuleStr = context.compress ? '' : Array(context.tabLevel + 1).join(' ');\n const tabSetStr = context.compress ? '' : Array(context.tabLevel).join(' ');\n let sep;\n\n let charsetNodeIndex = 0;\n let importNodeIndex = 0;\n for (i = 0; (rule = this.rules[i]); i++) {\n if (rule instanceof Comment) {\n if (importNodeIndex === i) {\n importNodeIndex++;\n }\n ruleNodes.push(rule);\n } else if (rule.isCharset && rule.isCharset()) {\n ruleNodes.splice(charsetNodeIndex, 0, rule);\n charsetNodeIndex++;\n importNodeIndex++;\n } else if (rule.type === 'Import') {\n ruleNodes.splice(importNodeIndex, 0, rule);\n importNodeIndex++;\n } else {\n ruleNodes.push(rule);\n }\n }\n ruleNodes = charsetRuleNodes.concat(ruleNodes);\n\n // If this is the root node, we don't render\n // a selector, or {}.\n if (!this.root) {\n debugInfo = getDebugInfo(context, this, tabSetStr);\n\n if (debugInfo) {\n output.add(debugInfo);\n output.add(tabSetStr);\n }\n\n const paths = this.paths;\n const pathCnt = paths.length;\n let pathSubCnt;\n\n sep = context.compress ? ',' : (`,\\n${tabSetStr}`);\n\n for (i = 0; i < pathCnt; i++) {\n path = paths[i];\n if (!(pathSubCnt = path.length)) { continue; }\n if (i > 0) { output.add(sep); }\n\n context.firstSelector = true;\n path[0].genCSS(context, output);\n\n context.firstSelector = false;\n for (j = 1; j < pathSubCnt; j++) {\n path[j].genCSS(context, output);\n }\n }\n\n output.add((context.compress ? '{' : ' {\\n') + tabRuleStr);\n }\n\n // Compile rules and rulesets\n for (i = 0; (rule = ruleNodes[i]); i++) {\n\n if (i + 1 === ruleNodes.length) {\n context.lastRule = true;\n }\n\n const currentLastRule = context.lastRule;\n if (rule.isRulesetLike(rule)) {\n context.lastRule = false;\n }\n\n if (rule.genCSS) {\n rule.genCSS(context, output);\n } else if (rule.value) {\n output.add(rule.value.toString());\n }\n\n context.lastRule = currentLastRule;\n\n if (!context.lastRule && rule.isVisible()) {\n output.add(context.compress ? '' : (`\\n${tabRuleStr}`));\n } else {\n context.lastRule = false;\n }\n }\n\n if (!this.root) {\n output.add((context.compress ? '}' : `\\n${tabSetStr}}`));\n context.tabLevel--;\n }\n\n if (!output.isEmpty() && !context.compress && this.firstRoot) {\n output.add('\\n');\n }\n }\n\n joinSelectors(paths, context, selectors) {\n for (let s = 0; s < selectors.length; s++) {\n this.joinSelector(paths, context, selectors[s]);\n }\n }\n\n joinSelector(paths, context, selector) {\n function createParenthesis(elementsToPak, originalElement) {\n let replacementParen;\n let j;\n if (elementsToPak.length === 0) {\n replacementParen = new Paren(elementsToPak[0]);\n } else {\n const insideParent = new Array(elementsToPak.length);\n for (j = 0; j < elementsToPak.length; j++) {\n insideParent[j] = new Element(\n null,\n elementsToPak[j],\n originalElement.isVariable,\n originalElement._index,\n originalElement._fileInfo\n );\n }\n replacementParen = new Paren(new Selector(insideParent));\n }\n return replacementParen;\n }\n\n function createSelector(containedElement, originalElement) {\n let element;\n let selector;\n element = new Element(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo);\n selector = new Selector([element]);\n return selector;\n }\n\n // joins selector path from `beginningPath` with selector path in `addPath`\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns concatenated path\n function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) {\n let newSelectorPath;\n let lastSelector;\n let newJoinedSelector;\n // our new selector path\n newSelectorPath = [];\n\n // construct the joined selector - if & is the first thing this will be empty,\n // if not newJoinedSelector will be the last set of elements in the selector\n if (beginningPath.length > 0) {\n newSelectorPath = utils.copyArray(beginningPath);\n lastSelector = newSelectorPath.pop();\n newJoinedSelector = originalSelector.createDerived(utils.copyArray(lastSelector.elements));\n }\n else {\n newJoinedSelector = originalSelector.createDerived([]);\n }\n\n if (addPath.length > 0) {\n // /deep/ is a CSS4 selector - (removed, so should deprecate)\n // that is valid without anything in front of it\n // so if the & does not have a combinator that is \"\" or \" \" then\n // and there is a combinator on the parent, then grab that.\n // this also allows + a { & .b { .a & { ... though not sure why you would want to do that\n let combinator = replacedElement.combinator;\n\n const parentEl = addPath[0].elements[0];\n if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) {\n combinator = parentEl.combinator;\n }\n // join the elements so far with the first part of the parent\n newJoinedSelector.elements.push(new Element(\n combinator,\n parentEl.value,\n replacedElement.isVariable,\n replacedElement._index,\n replacedElement._fileInfo\n ));\n newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1));\n }\n\n // now add the joined selector - but only if it is not empty\n if (newJoinedSelector.elements.length !== 0) {\n newSelectorPath.push(newJoinedSelector);\n }\n\n // put together the parent selectors after the join (e.g. the rest of the parent)\n if (addPath.length > 1) {\n let restOfPath = addPath.slice(1);\n restOfPath = restOfPath.map(selector => selector.createDerived(selector.elements, []));\n newSelectorPath = newSelectorPath.concat(restOfPath);\n }\n return newSelectorPath;\n }\n\n // joins selector path from `beginningPath` with every selector path in `addPaths` array\n // `replacedElement` contains element that is being replaced by `addPath`\n // returns array with all concatenated paths\n function addAllReplacementsIntoPath( beginningPath, addPaths, replacedElement, originalSelector, result) {\n let j;\n for (j = 0; j < beginningPath.length; j++) {\n const newSelectorPath = addReplacementIntoPath(beginningPath[j], addPaths, replacedElement, originalSelector);\n result.push(newSelectorPath);\n }\n return result;\n }\n\n function mergeElementsOnToSelectors(elements, selectors) {\n let i;\n let sel;\n\n if (elements.length === 0) {\n return ;\n }\n if (selectors.length === 0) {\n selectors.push([ new Selector(elements) ]);\n return;\n }\n\n for (i = 0; (sel = selectors[i]); i++) {\n // if the previous thing in sel is a parent this needs to join on to it\n if (sel.length > 0) {\n sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements));\n }\n else {\n sel.push(new Selector(elements));\n }\n }\n }\n\n // replace all parent selectors inside `inSelector` by content of `context` array\n // resulting selectors are returned inside `paths` array\n // returns true if `inSelector` contained at least one parent selector\n function replaceParentSelector(paths, context, inSelector) {\n // The paths are [[Selector]]\n // The first list is a list of comma separated selectors\n // The inner list is a list of inheritance separated selectors\n // e.g.\n // .a, .b {\n // .c {\n // }\n // }\n // == [[.a] [.c]] [[.b] [.c]]\n //\n let i;\n\n let j;\n let k;\n let currentElements;\n let newSelectors;\n let selectorsMultiplied;\n let sel;\n let el;\n let hadParentSelector = false;\n let length;\n let lastSelector;\n function findNestedSelector(element) {\n let maybeSelector;\n if (!(element.value instanceof Paren)) {\n return null;\n }\n\n maybeSelector = element.value.value;\n if (!(maybeSelector instanceof Selector)) {\n return null;\n }\n\n return maybeSelector;\n }\n\n // the elements from the current selector so far\n currentElements = [];\n // the current list of new selectors to add to the path.\n // We will build it up. We initiate it with one empty selector as we \"multiply\" the new selectors\n // by the parents\n newSelectors = [\n []\n ];\n\n for (i = 0; (el = inSelector.elements[i]); i++) {\n // non parent reference elements just get added\n if (el.value !== '&') {\n const nestedSelector = findNestedSelector(el);\n if (nestedSelector != null) {\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n const nestedPaths = [];\n let replaced;\n const replacedNewSelectors = [];\n replaced = replaceParentSelector(nestedPaths, context, nestedSelector);\n hadParentSelector = hadParentSelector || replaced;\n // the nestedPaths array should have only one member - replaceParentSelector does not multiply selectors\n for (k = 0; k < nestedPaths.length; k++) {\n const replacementSelector = createSelector(createParenthesis(nestedPaths[k], el), el);\n addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors);\n }\n newSelectors = replacedNewSelectors;\n currentElements = [];\n } else {\n currentElements.push(el);\n }\n\n } else {\n hadParentSelector = true;\n // the new list of selectors to add\n selectorsMultiplied = [];\n\n // merge the current list of non parent selector elements\n // on to the current list of selectors to add\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n // loop through our current selectors\n for (j = 0; j < newSelectors.length; j++) {\n sel = newSelectors[j];\n // if we don't have any parent paths, the & might be in a mixin so that it can be used\n // whether there are parents or not\n if (context.length === 0) {\n // the combinator used on el should now be applied to the next element instead so that\n // it is not lost\n if (sel.length > 0) {\n sel[0].elements.push(new Element(el.combinator, '', el.isVariable, el._index, el._fileInfo));\n }\n selectorsMultiplied.push(sel);\n }\n else {\n // and the parent selectors\n for (k = 0; k < context.length; k++) {\n // We need to put the current selectors\n // then join the last selector's elements on to the parents selectors\n const newSelectorPath = addReplacementIntoPath(sel, context[k], el, inSelector);\n // add that to our new set of selectors\n selectorsMultiplied.push(newSelectorPath);\n }\n }\n }\n\n // our new selectors has been multiplied, so reset the state\n newSelectors = selectorsMultiplied;\n currentElements = [];\n }\n }\n\n // if we have any elements left over (e.g. .a& .b == .b)\n // add them on to all the current selectors\n mergeElementsOnToSelectors(currentElements, newSelectors);\n\n for (i = 0; i < newSelectors.length; i++) {\n length = newSelectors[i].length;\n if (length > 0) {\n paths.push(newSelectors[i]);\n lastSelector = newSelectors[i][length - 1];\n newSelectors[i][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList);\n }\n }\n\n return hadParentSelector;\n }\n\n function deriveSelector(visibilityInfo, deriveFrom) {\n const newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition);\n newSelector.copyVisibilityInfo(visibilityInfo);\n return newSelector;\n }\n\n // joinSelector code follows\n let i;\n\n let newPaths;\n let hadParentSelector;\n\n newPaths = [];\n hadParentSelector = replaceParentSelector(newPaths, context, selector);\n\n if (!hadParentSelector) {\n if (context.length > 0) {\n newPaths = [];\n for (i = 0; i < context.length; i++) {\n\n const concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo()));\n\n concatenated.push(selector);\n newPaths.push(concatenated);\n }\n }\n else {\n newPaths = [[selector]];\n }\n }\n\n for (i = 0; i < newPaths.length; i++) {\n paths.push(newPaths[i]);\n }\n }\n}\n\nRuleset.prototype.type = 'Ruleset';\nRuleset.prototype.isRuleset = true;\nexport default Ruleset;\n","import Node from './node';\nimport Selector from './selector';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\n\nclass AtRule extends Node {\n constructor(\n name,\n value,\n rules,\n index,\n currentFileInfo,\n debugInfo,\n isRooted,\n visibilityInfo\n ) {\n super();\n\n let i;\n\n this.name = name;\n this.value = (value instanceof Node) ? value : (value ? new Anonymous(value) : value);\n if (rules) {\n if (Array.isArray(rules)) {\n this.rules = rules;\n } else {\n this.rules = [rules];\n this.rules[0].selectors = (new Selector([], null, null, index, currentFileInfo)).createEmptySelectors();\n }\n for (i = 0; i < this.rules.length; i++) {\n this.rules[i].allowImports = true;\n }\n this.setParent(this.rules, this);\n }\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.debugInfo = debugInfo;\n this.isRooted = isRooted || false;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n }\n\n accept(visitor) {\n const value = this.value;\n const rules = this.rules;\n if (rules) {\n this.rules = visitor.visitArray(rules);\n }\n if (value) {\n this.value = visitor.visit(value);\n }\n }\n\n isRulesetLike() {\n return this.rules || !this.isCharset();\n }\n\n isCharset() {\n return '@charset' === this.name;\n }\n\n genCSS(context, output) {\n const value = this.value;\n const rules = this.rules;\n output.add(this.name, this.fileInfo(), this.getIndex());\n if (value) {\n output.add(' ');\n value.genCSS(context, output);\n }\n if (rules) {\n this.outputRuleset(context, output, rules);\n } else {\n output.add(';');\n }\n }\n\n eval(context) {\n let mediaPathBackup;\n let mediaBlocksBackup;\n let value = this.value;\n let rules = this.rules;\n\n // media stored inside other atrule should not bubble over it\n // backpup media bubbling information\n mediaPathBackup = context.mediaPath;\n mediaBlocksBackup = context.mediaBlocks;\n // deleted media bubbling information\n context.mediaPath = [];\n context.mediaBlocks = [];\n\n if (value) {\n value = value.eval(context);\n }\n if (rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n rules = [rules[0].eval(context)];\n rules[0].root = true;\n }\n // restore media bubbling information\n context.mediaPath = mediaPathBackup;\n context.mediaBlocks = mediaBlocksBackup;\n\n return new AtRule(this.name, value, rules,\n this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo());\n }\n\n variable(name) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.variable.call(this.rules[0], name);\n }\n }\n\n find(...args) {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.find.apply(this.rules[0], args);\n }\n }\n\n rulesets() {\n if (this.rules) {\n // assuming that there is only one rule at this point - that is how parser constructs the rule\n return Ruleset.prototype.rulesets.apply(this.rules[0]);\n }\n }\n\n outputRuleset(context, output, rules) {\n const ruleCnt = rules.length;\n let i;\n context.tabLevel = (context.tabLevel | 0) + 1;\n\n // Compressed\n if (context.compress) {\n output.add('{');\n for (i = 0; i < ruleCnt; i++) {\n rules[i].genCSS(context, output);\n }\n output.add('}');\n context.tabLevel--;\n return;\n }\n\n // Non-compressed\n const tabSetStr = `\\n${Array(context.tabLevel).join(' ')}`;\n\n const tabRuleStr = `${tabSetStr} `;\n if (!ruleCnt) {\n output.add(` {${tabSetStr}}`);\n } else {\n output.add(` {${tabRuleStr}`);\n rules[0].genCSS(context, output);\n for (i = 1; i < ruleCnt; i++) {\n output.add(tabRuleStr);\n rules[i].genCSS(context, output);\n }\n output.add(`${tabSetStr}}`);\n }\n\n context.tabLevel--;\n }\n}\n\nAtRule.prototype.type = 'AtRule';\nexport default AtRule;\n","import Node from './node';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nclass DetachedRuleset extends Node {\n constructor(ruleset, frames) {\n super();\n\n this.ruleset = ruleset;\n this.frames = frames;\n this.setParent(this.ruleset, this);\n }\n\n accept(visitor) {\n this.ruleset = visitor.visit(this.ruleset);\n }\n\n eval(context) {\n const frames = this.frames || utils.copyArray(context.frames);\n return new DetachedRuleset(this.ruleset, frames);\n }\n\n callEval(context) {\n return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context);\n }\n}\n\nDetachedRuleset.prototype.type = 'DetachedRuleset';\nDetachedRuleset.prototype.evalFirst = true;\nexport default DetachedRuleset;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport * as utils from '../utils';\n\nclass Unit extends Node {\n constructor(numerator, denominator, backupUnit) {\n super();\n\n this.numerator = numerator ? utils.copyArray(numerator).sort() : [];\n this.denominator = denominator ? utils.copyArray(denominator).sort() : [];\n if (backupUnit) {\n this.backupUnit = backupUnit;\n } else if (numerator && numerator.length) {\n this.backupUnit = numerator[0];\n }\n }\n\n clone() {\n return new Unit(utils.copyArray(this.numerator), utils.copyArray(this.denominator), this.backupUnit);\n }\n\n genCSS(context, output) {\n // Dimension checks the unit is singular and throws an error if in strict math mode.\n const strictUnits = context && context.strictUnits;\n if (this.numerator.length === 1) {\n output.add(this.numerator[0]); // the ideal situation\n } else if (!strictUnits && this.backupUnit) {\n output.add(this.backupUnit);\n } else if (!strictUnits && this.denominator.length) {\n output.add(this.denominator[0]);\n }\n }\n\n toString() {\n let i;\n let returnStr = this.numerator.join('*');\n for (i = 0; i < this.denominator.length; i++) {\n returnStr += `/${this.denominator[i]}`;\n }\n return returnStr;\n }\n\n compare(other) {\n return this.is(other.toString()) ? 0 : undefined;\n }\n\n is(unitString) {\n return this.toString().toUpperCase() === unitString.toUpperCase();\n }\n\n isLength() {\n return RegExp('^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS());\n }\n\n isEmpty() {\n return this.numerator.length === 0 && this.denominator.length === 0;\n }\n\n isSingular() {\n return this.numerator.length <= 1 && this.denominator.length === 0;\n }\n\n map(callback) {\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n this.numerator[i] = callback(this.numerator[i], false);\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n this.denominator[i] = callback(this.denominator[i], true);\n }\n }\n\n usedUnits() {\n let group;\n const result = {};\n let mapUnit;\n let groupName;\n\n mapUnit = atomicUnit => {\n /* jshint loopfunc:true */\n if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {\n result[groupName] = atomicUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in unitConversions) {\n if (unitConversions.hasOwnProperty(groupName)) {\n group = unitConversions[groupName];\n\n this.map(mapUnit);\n }\n }\n\n return result;\n }\n\n cancel() {\n const counter = {};\n let atomicUnit;\n let i;\n\n for (i = 0; i < this.numerator.length; i++) {\n atomicUnit = this.numerator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;\n }\n\n for (i = 0; i < this.denominator.length; i++) {\n atomicUnit = this.denominator[i];\n counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;\n }\n\n this.numerator = [];\n this.denominator = [];\n\n for (atomicUnit in counter) {\n if (counter.hasOwnProperty(atomicUnit)) {\n const count = counter[atomicUnit];\n\n if (count > 0) {\n for (i = 0; i < count; i++) {\n this.numerator.push(atomicUnit);\n }\n } else if (count < 0) {\n for (i = 0; i < -count; i++) {\n this.denominator.push(atomicUnit);\n }\n }\n }\n }\n\n this.numerator.sort();\n this.denominator.sort();\n }\n}\n\nUnit.prototype.type = 'Unit';\nexport default Unit;\n","import Node from './node';\nimport unitConversions from '../data/unit-conversions';\nimport Unit from './unit';\nimport Color from './color';\n\n//\n// A number with a unit\n//\nclass Dimension extends Node {\n constructor(value, unit) {\n super();\n\n this.value = parseFloat(value);\n if (isNaN(this.value)) {\n throw new Error('Dimension is not a number.');\n }\n this.unit = (unit && unit instanceof Unit) ? unit :\n new Unit(unit ? [unit] : undefined);\n this.setParent(this.unit, this);\n }\n\n accept(visitor) {\n this.unit = visitor.visit(this.unit);\n }\n\n eval(context) {\n return this;\n }\n\n toColor() {\n return new Color([this.value, this.value, this.value]);\n }\n\n genCSS(context, output) {\n if ((context && context.strictUnits) && !this.unit.isSingular()) {\n throw new Error(`Multiple units in dimension. Correct the units or use the unit function. Bad unit: ${this.unit.toString()}`);\n }\n\n const value = this.fround(context, this.value);\n let strValue = String(value);\n\n if (value !== 0 && value < 0.000001 && value > -0.000001) {\n // would be output 1e-6 etc.\n strValue = value.toFixed(20).replace(/0+$/, '');\n }\n\n if (context && context.compress) {\n // Zero values doesn't need a unit\n if (value === 0 && this.unit.isLength()) {\n output.add(strValue);\n return;\n }\n\n // Float values doesn't need a leading zero\n if (value > 0 && value < 1) {\n strValue = (strValue).substr(1);\n }\n }\n\n output.add(strValue);\n this.unit.genCSS(context, output);\n }\n\n // In an operation between two Dimensions,\n // we default to the first Dimension's unit,\n // so `1px + 2` will yield `3px`.\n operate(context, op, other) {\n /* jshint noempty:false */\n let value = this._operate(context, op, this.value, other.value);\n\n let unit = this.unit.clone();\n\n if (op === '+' || op === '-') {\n if (unit.numerator.length === 0 && unit.denominator.length === 0) {\n unit = other.unit.clone();\n if (this.unit.backupUnit) {\n unit.backupUnit = this.unit.backupUnit;\n }\n } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) {\n // do nothing\n } else {\n other = other.convertTo(this.unit.usedUnits());\n\n if (context.strictUnits && other.unit.toString() !== unit.toString()) {\n throw new Error(`Incompatible units. Change the units or use the unit function. ` + \n `Bad units: '${unit.toString()}' and '${other.unit.toString()}'.`);\n }\n\n value = this._operate(context, op, this.value, other.value);\n }\n } else if (op === '*') {\n unit.numerator = unit.numerator.concat(other.unit.numerator).sort();\n unit.denominator = unit.denominator.concat(other.unit.denominator).sort();\n unit.cancel();\n } else if (op === '/') {\n unit.numerator = unit.numerator.concat(other.unit.denominator).sort();\n unit.denominator = unit.denominator.concat(other.unit.numerator).sort();\n unit.cancel();\n }\n return new Dimension(value, unit);\n }\n\n compare(other) {\n let a;\n let b;\n\n if (!(other instanceof Dimension)) {\n return undefined;\n }\n\n if (this.unit.isEmpty() || other.unit.isEmpty()) {\n a = this;\n b = other;\n } else {\n a = this.unify();\n b = other.unify();\n if (a.unit.compare(b.unit) !== 0) {\n return undefined;\n }\n }\n\n return Node.numericCompare(a.value, b.value);\n }\n\n unify() {\n return this.convertTo({ length: 'px', duration: 's', angle: 'rad' });\n }\n\n convertTo(conversions) {\n let value = this.value;\n const unit = this.unit.clone();\n let i;\n let groupName;\n let group;\n let targetUnit;\n let derivedConversions = {};\n let applyUnit;\n\n if (typeof conversions === 'string') {\n for (i in unitConversions) {\n if (unitConversions[i].hasOwnProperty(conversions)) {\n derivedConversions = {};\n derivedConversions[i] = conversions;\n }\n }\n conversions = derivedConversions;\n }\n applyUnit = (atomicUnit, denominator) => {\n /* jshint loopfunc:true */\n if (group.hasOwnProperty(atomicUnit)) {\n if (denominator) {\n value = value / (group[atomicUnit] / group[targetUnit]);\n } else {\n value = value * (group[atomicUnit] / group[targetUnit]);\n }\n\n return targetUnit;\n }\n\n return atomicUnit;\n };\n\n for (groupName in conversions) {\n if (conversions.hasOwnProperty(groupName)) {\n targetUnit = conversions[groupName];\n group = unitConversions[groupName];\n\n unit.map(applyUnit);\n }\n }\n\n unit.cancel();\n\n return new Dimension(value, unit);\n }\n}\n\nDimension.prototype.type = 'Dimension';\nexport default Dimension;\n","import Node from './node';\nimport Color from './color';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\n\nclass Operation extends Node {\n constructor(op, operands, isSpaced) {\n super();\n\n this.op = op.trim();\n this.operands = operands;\n this.isSpaced = isSpaced;\n }\n\n accept(visitor) {\n this.operands = visitor.visitArray(this.operands);\n }\n\n eval(context) {\n let a = this.operands[0].eval(context);\n let b = this.operands[1].eval(context);\n let op;\n\n if (context.isMathOn(this.op)) {\n op = this.op === './' ? '/' : this.op;\n if (a instanceof Dimension && b instanceof Color) {\n a = a.toColor();\n }\n if (b instanceof Dimension && a instanceof Color) {\n b = b.toColor();\n }\n if (!a.operate) {\n if (a instanceof Operation && a.op === '/' && context.math === MATH.PARENS_DIVISION) {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n throw { type: 'Operation',\n message: 'Operation on an invalid type' };\n }\n\n return a.operate(context, op, b);\n } else {\n return new Operation(this.op, [a, b], this.isSpaced);\n }\n }\n\n genCSS(context, output) {\n this.operands[0].genCSS(context, output);\n if (this.isSpaced) {\n output.add(' ');\n }\n output.add(this.op);\n if (this.isSpaced) {\n output.add(' ');\n }\n this.operands[1].genCSS(context, output);\n }\n}\n\nOperation.prototype.type = 'Operation';\nexport default Operation;\n","import Node from './node';\nimport Paren from './paren';\nimport Comment from './comment';\nimport Dimension from './dimension';\nimport * as Constants from '../constants';\nconst MATH = Constants.Math;\n\nclass Expression extends Node {\n constructor(value, noSpacing) {\n super();\n\n this.value = value;\n this.noSpacing = noSpacing;\n if (!value) {\n throw new Error('Expression requires an array parameter');\n }\n }\n\n accept(visitor) {\n this.value = visitor.visitArray(this.value);\n }\n\n eval(context) {\n let returnValue;\n const mathOn = context.isMathOn();\n\n const inParenthesis = this.parens && \n (context.math !== MATH.STRICT_LEGACY || !this.parensInOp);\n\n let doubleParen = false;\n if (inParenthesis) {\n context.inParenthesis();\n }\n if (this.value.length > 1) {\n returnValue = new Expression(this.value.map(e => {\n if (!e.eval) {\n return e;\n }\n return e.eval(context);\n }), this.noSpacing);\n } else if (this.value.length === 1) {\n if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) {\n doubleParen = true;\n }\n returnValue = this.value[0].eval(context);\n } else {\n returnValue = this;\n }\n if (inParenthesis) {\n context.outOfParenthesis();\n }\n if (this.parens && this.parensInOp && !mathOn && !doubleParen \n && (!(returnValue instanceof Dimension))) {\n returnValue = new Paren(returnValue);\n }\n return returnValue;\n }\n\n genCSS(context, output) {\n for (let i = 0; i < this.value.length; i++) {\n this.value[i].genCSS(context, output);\n if (!this.noSpacing && i + 1 < this.value.length) {\n output.add(' ');\n }\n }\n }\n\n throwAwayComments() {\n this.value = this.value.filter(v => !(v instanceof Comment));\n }\n}\n\nExpression.prototype.type = 'Expression';\nexport default Expression;\n","import Expression from '../tree/expression';\n\nclass functionCaller {\n constructor(name, context, index, currentFileInfo) {\n this.name = name.toLowerCase();\n this.index = index;\n this.context = context;\n this.currentFileInfo = currentFileInfo;\n\n this.func = context.frames[0].functionRegistry.get(this.name);\n }\n\n isValid() {\n return Boolean(this.func);\n }\n\n call(args) {\n // This code is terrible and should be replaced as per this issue...\n // https://github.com/less/less.js/issues/2477\n if (Array.isArray(args)) {\n args = args.filter(item => {\n if (item.type === 'Comment') {\n return false;\n }\n return true;\n })\n .map(item => {\n if (item.type === 'Expression') {\n const subNodes = item.value.filter(item => {\n if (item.type === 'Comment') {\n return false;\n }\n return true;\n });\n if (subNodes.length === 1) {\n return subNodes[0];\n } else {\n return new Expression(subNodes);\n }\n }\n return item;\n });\n }\n\n return this.func(...args);\n }\n}\n\nexport default functionCaller;\n","import Node from './node';\nimport Anonymous from './anonymous';\nimport FunctionCaller from '../functions/function-caller';\n\n//\n// A function call node.\n//\nclass Call extends Node {\n constructor(name, args, index, currentFileInfo) {\n super();\n\n this.name = name;\n this.args = args;\n this.calc = name === 'calc';\n this._index = index;\n this._fileInfo = currentFileInfo;\n }\n\n accept(visitor) {\n if (this.args) {\n this.args = visitor.visitArray(this.args);\n }\n }\n\n //\n // When evaluating a function call,\n // we either find the function in the functionRegistry,\n // in which case we call it, passing the evaluated arguments,\n // if this returns null or we cannot find the function, we\n // simply print it out as it appeared originally [2].\n //\n // The reason why we evaluate the arguments, is in the case where\n // we try to pass a variable to a function, like: `saturate(@color)`.\n // The function should receive the value, not the variable.\n //\n eval(context) {\n /**\n * Turn off math for calc(), and switch back on for evaluating nested functions\n */\n const currentMathContext = context.mathOn;\n context.mathOn = !this.calc;\n if (this.calc || context.inCalc) {\n context.enterCalc();\n }\n const args = this.args.map(a => a.eval(context));\n if (this.calc || context.inCalc) {\n context.exitCalc();\n }\n context.mathOn = currentMathContext;\n\n let result;\n const funcCaller = new FunctionCaller(this.name, context, this.getIndex(), this.fileInfo());\n\n if (funcCaller.isValid()) {\n try {\n result = funcCaller.call(args);\n } catch (e) {\n throw { \n type: e.type || 'Runtime',\n message: `error evaluating function \\`${this.name}\\`${e.message ? `: ${e.message}` : ''}`,\n index: this.getIndex(), \n filename: this.fileInfo().filename,\n line: e.lineNumber,\n column: e.columnNumber\n };\n }\n\n if (result !== null && result !== undefined) {\n // Results that that are not nodes are cast as Anonymous nodes\n // Falsy values or booleans are returned as empty nodes\n if (!(result instanceof Node)) {\n if (!result || result === true) {\n result = new Anonymous(null); \n }\n else {\n result = new Anonymous(result.toString()); \n }\n \n }\n result._index = this._index;\n result._fileInfo = this._fileInfo;\n return result;\n }\n\n }\n\n return new Call(this.name, args, this.getIndex(), this.fileInfo());\n }\n\n genCSS(context, output) {\n output.add(`${this.name}(`, this.fileInfo(), this.getIndex());\n\n for (let i = 0; i < this.args.length; i++) {\n this.args[i].genCSS(context, output);\n if (i + 1 < this.args.length) {\n output.add(', ');\n }\n }\n\n output.add(')');\n }\n}\n\nCall.prototype.type = 'Call';\nexport default Call;\n","import Node from './node';\nimport Call from './call';\n\nclass Variable extends Node {\n constructor(name, index, currentFileInfo) {\n super();\n\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n }\n\n eval(context) {\n let variable;\n let name = this.name;\n\n if (name.indexOf('@@') === 0) {\n name = `@${new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value}`;\n }\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive variable definition for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n variable = this.find(context.frames, frame => {\n const v = frame.variable(name);\n if (v) {\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n // If in calc, wrap vars in a function call to cascade evaluate args first\n if (context.inCalc) {\n return (new Call('_SELF', [v.value])).eval(context);\n }\n else {\n return v.value.eval(context);\n }\n }\n });\n if (variable) {\n this.evaluating = false;\n return variable;\n } else {\n throw { type: 'Name',\n message: `variable ${name} is undefined`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n}\n\nVariable.prototype.type = 'Variable';\nexport default Variable;\n","import Node from './node';\nimport Declaration from './declaration';\n\nclass Property extends Node {\n constructor(name, index, currentFileInfo) {\n super();\n\n this.name = name;\n this._index = index;\n this._fileInfo = currentFileInfo;\n }\n\n eval(context) {\n let property;\n const name = this.name;\n // TODO: shorten this reference\n const mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules;\n\n if (this.evaluating) {\n throw { type: 'Name',\n message: `Recursive property reference for ${name}`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n this.evaluating = true;\n\n property = this.find(context.frames, frame => {\n let v;\n const vArr = frame.property(name);\n if (vArr) {\n for (let i = 0; i < vArr.length; i++) {\n v = vArr[i];\n\n vArr[i] = new Declaration(v.name,\n v.value,\n v.important,\n v.merge,\n v.index,\n v.currentFileInfo,\n v.inline,\n v.variable\n );\n }\n mergeRules(vArr);\n\n v = vArr[vArr.length - 1];\n if (v.important) {\n const importantScope = context.importantScope[context.importantScope.length - 1];\n importantScope.important = v.important;\n }\n v = v.value.eval(context);\n return v;\n }\n });\n if (property) {\n this.evaluating = false;\n return property;\n } else {\n throw { type: 'Name',\n message: `Property '${name}' is undefined`,\n filename: this.currentFileInfo.filename,\n index: this.index };\n }\n }\n\n find(obj, fun) {\n for (let i = 0, r; i < obj.length; i++) {\n r = fun.call(obj, obj[i]);\n if (r) { return r; }\n }\n return null;\n }\n}\n\nProperty.prototype.type = 'Property';\nexport default Property;\n","import Node from './node';\n\nclass Attribute extends Node {\n constructor(key, op, value) {\n super();\n\n this.key = key;\n this.op = op;\n this.value = value;\n }\n\n eval(context) {\n return new Attribute(this.key.eval ? this.key.eval(context) : this.key,\n this.op, (this.value && this.value.eval) ? this.value.eval(context) : this.value);\n }\n\n genCSS(context, output) {\n output.add(this.toCSS(context));\n }\n\n toCSS(context) {\n let value = this.key.toCSS ? this.key.toCSS(context) : this.key;\n\n if (this.op) {\n value += this.op;\n value += (this.value.toCSS ? this.value.toCSS(context) : this.value);\n }\n\n return `[${value}]`;\n }\n}\n\nAttribute.prototype.type = 'Attribute';\nexport default Attribute;\n","import Node from './node';\nimport Variable from './variable';\nimport Property from './property';\n\n\nclass Quoted extends Node {\n constructor(str, content, escaped, index, currentFileInfo) {\n super();\n\n this.escaped = (escaped == null) ? true : escaped;\n this.value = content || '';\n this.quote = str.charAt(0);\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.variableRegex = /@\\{([\\w-]+)\\}/g;\n this.propRegex = /\\$\\{([\\w-]+)\\}/g;\n this.allowRoot = escaped;\n }\n\n genCSS(context, output) {\n if (!this.escaped) {\n output.add(this.quote, this.fileInfo(), this.getIndex());\n }\n output.add(this.value);\n if (!this.escaped) {\n output.add(this.quote);\n }\n }\n\n containsVariables() {\n return this.value.match(this.variableRegex);\n }\n\n eval(context) {\n const that = this;\n let value = this.value;\n const variableReplacement = (_, name) => {\n const v = new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n const propertyReplacement = (_, name) => {\n const v = new Property(`$${name}`, that.getIndex(), that.fileInfo()).eval(context, true);\n return (v instanceof Quoted) ? v.value : v.toCSS();\n };\n function iterativeReplace(value, regexp, replacementFnc) {\n let evaluatedValue = value;\n do {\n value = evaluatedValue.toString();\n evaluatedValue = value.replace(regexp, replacementFnc);\n } while (value !== evaluatedValue);\n return evaluatedValue;\n }\n value = iterativeReplace(value, this.variableRegex, variableReplacement);\n value = iterativeReplace(value, this.propRegex, propertyReplacement);\n\n return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo());\n }\n\n compare(other) {\n // when comparing quoted strings allow the quote to differ\n if (other.type === 'Quoted' && !this.escaped && !other.escaped) {\n return Node.numericCompare(this.value, other.value);\n } else {\n return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;\n }\n }\n}\n\nQuoted.prototype.type = 'Quoted';\nexport default Quoted;\n","import Node from './node';\n\nclass URL extends Node {\n constructor(val, index, currentFileInfo, isEvald) {\n super();\n\n this.value = val;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.isEvald = isEvald;\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n genCSS(context, output) {\n output.add('url(');\n this.value.genCSS(context, output);\n output.add(')');\n }\n\n eval(context) {\n const val = this.value.eval(context);\n let rootpath;\n\n if (!this.isEvald) {\n // Add the rootpath if the URL requires a rewrite\n rootpath = this.fileInfo() && this.fileInfo().rootpath;\n if (typeof rootpath === 'string' &&\n typeof val.value === 'string' &&\n context.pathRequiresRewrite(val.value)) {\n if (!val.quote) {\n rootpath = escapePath(rootpath);\n }\n val.value = context.rewritePath(val.value, rootpath);\n } else {\n val.value = context.normalizePath(val.value);\n }\n\n // Add url args if enabled\n if (context.urlArgs) {\n if (!val.value.match(/^\\s*data:/)) {\n const delimiter = val.value.indexOf('?') === -1 ? '?' : '&';\n const urlArgs = delimiter + context.urlArgs;\n if (val.value.indexOf('#') !== -1) {\n val.value = val.value.replace('#', `${urlArgs}#`);\n } else {\n val.value += urlArgs;\n }\n }\n }\n }\n\n return new URL(val, this.getIndex(), this.fileInfo(), true);\n }\n}\n\nURL.prototype.type = 'Url';\n\nfunction escapePath(path) {\n return path.replace(/[\\(\\)'\"\\s]/g, match => `\\\\${match}`);\n}\n\nexport default URL;\n","import Ruleset from './ruleset';\nimport Value from './value';\nimport Selector from './selector';\nimport Anonymous from './anonymous';\nimport Expression from './expression';\nimport AtRule from './atrule';\nimport * as utils from '../utils';\n\nclass Media extends AtRule {\n constructor(value, features, index, currentFileInfo, visibilityInfo) {\n super();\n\n this._index = index;\n this._fileInfo = currentFileInfo;\n\n const selectors = (new Selector([], null, null, this._index, this._fileInfo)).createEmptySelectors();\n\n this.features = new Value(features);\n this.rules = [new Ruleset(selectors, value)];\n this.rules[0].allowImports = true;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n this.setParent(selectors, this);\n this.setParent(this.features, this);\n this.setParent(this.rules, this);\n }\n\n isRulesetLike() {\n return true;\n }\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n if (this.rules) {\n this.rules = visitor.visitArray(this.rules);\n }\n }\n\n genCSS(context, output) {\n output.add('@media ', this._fileInfo, this._index);\n this.features.genCSS(context, output);\n this.outputRuleset(context, output, this.rules);\n }\n\n eval(context) {\n if (!context.mediaBlocks) {\n context.mediaBlocks = [];\n context.mediaPath = [];\n }\n\n const media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo());\n if (this.debugInfo) {\n this.rules[0].debugInfo = this.debugInfo;\n media.debugInfo = this.debugInfo;\n }\n \n media.features = this.features.eval(context);\n\n context.mediaPath.push(media);\n context.mediaBlocks.push(media);\n\n this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit();\n context.frames.unshift(this.rules[0]);\n media.rules = [this.rules[0].eval(context)];\n context.frames.shift();\n\n context.mediaPath.pop();\n\n return context.mediaPath.length === 0 ? media.evalTop(context) :\n media.evalNested(context);\n }\n\n evalTop(context) {\n let result = this;\n\n // Render all dependent Media blocks.\n if (context.mediaBlocks.length > 1) {\n const selectors = (new Selector([], null, null, this.getIndex(), this.fileInfo())).createEmptySelectors();\n result = new Ruleset(selectors, context.mediaBlocks);\n result.multiMedia = true;\n result.copyVisibilityInfo(this.visibilityInfo());\n this.setParent(result, this);\n }\n\n delete context.mediaBlocks;\n delete context.mediaPath;\n\n return result;\n }\n\n evalNested(context) {\n let i;\n let value;\n const path = context.mediaPath.concat([this]);\n\n // Extract the media-query conditions separated with `,` (OR).\n for (i = 0; i < path.length; i++) {\n value = path[i].features instanceof Value ?\n path[i].features.value : path[i].features;\n path[i] = Array.isArray(value) ? value : [value];\n }\n\n // Trace all permutations to generate the resulting media-query.\n //\n // (a, b and c) with nested (d, e) ->\n // a and d\n // a and e\n // b and c and d\n // b and c and e\n this.features = new Value(this.permute(path).map(path => {\n path = path.map(fragment => fragment.toCSS ? fragment : new Anonymous(fragment));\n\n for (i = path.length - 1; i > 0; i--) {\n path.splice(i, 0, new Anonymous('and'));\n }\n\n return new Expression(path);\n }));\n this.setParent(this.features, this);\n\n // Fake a tree-node that doesn't output anything.\n return new Ruleset([], []);\n }\n\n permute(arr) {\n if (arr.length === 0) {\n return [];\n } else if (arr.length === 1) {\n return arr[0];\n } else {\n const result = [];\n const rest = this.permute(arr.slice(1));\n for (let i = 0; i < rest.length; i++) {\n for (let j = 0; j < arr[0].length; j++) {\n result.push([arr[0][j]].concat(rest[i]));\n }\n }\n return result;\n }\n }\n\n bubbleSelectors(selectors) {\n if (!selectors) {\n return;\n }\n this.rules = [new Ruleset(utils.copyArray(selectors), [this.rules[0]])];\n this.setParent(this.rules, this);\n }\n}\n\nMedia.prototype.type = 'Media';\nexport default Media;\n","import Node from './node';\nimport Media from './media';\nimport URL from './url';\nimport Quoted from './quoted';\nimport Ruleset from './ruleset';\nimport Anonymous from './anonymous';\nimport * as utils from '../utils';\nimport LessError from '../less-error';\n\n//\n// CSS @import node\n//\n// The general strategy here is that we don't want to wait\n// for the parsing to be completed, before we start importing\n// the file. That's because in the context of a browser,\n// most of the time will be spent waiting for the server to respond.\n//\n// On creation, we push the import path to our import queue, though\n// `import,push`, we also pass it a callback, which it'll call once\n// the file has been fetched, and parsed.\n//\nclass Import extends Node {\n constructor(path, features, options, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.options = options;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.path = path;\n this.features = features;\n this.allowRoot = true;\n\n if (this.options.less !== undefined || this.options.inline) {\n this.css = !this.options.less || this.options.inline;\n } else {\n const pathValue = this.getPath();\n if (pathValue && /[#\\.\\&\\?]css([\\?;].*)?$/.test(pathValue)) {\n this.css = true;\n }\n }\n this.copyVisibilityInfo(visibilityInfo);\n this.setParent(this.features, this);\n this.setParent(this.path, this);\n }\n\n accept(visitor) {\n if (this.features) {\n this.features = visitor.visit(this.features);\n }\n this.path = visitor.visit(this.path);\n if (!this.options.isPlugin && !this.options.inline && this.root) {\n this.root = visitor.visit(this.root);\n }\n }\n\n genCSS(context, output) {\n if (this.css && this.path._fileInfo.reference === undefined) {\n output.add('@import ', this._fileInfo, this._index);\n this.path.genCSS(context, output);\n if (this.features) {\n output.add(' ');\n this.features.genCSS(context, output);\n }\n output.add(';');\n }\n }\n\n getPath() {\n return (this.path instanceof URL) ?\n this.path.value.value : this.path.value;\n }\n\n isVariableImport() {\n let path = this.path;\n if (path instanceof URL) {\n path = path.value;\n }\n if (path instanceof Quoted) {\n return path.containsVariables();\n }\n\n return true;\n }\n\n evalForImport(context) {\n let path = this.path;\n\n if (path instanceof URL) {\n path = path.value;\n }\n\n return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo());\n }\n\n evalPath(context) {\n const path = this.path.eval(context);\n const fileInfo = this._fileInfo;\n\n if (!(path instanceof URL)) {\n // Add the rootpath if the URL requires a rewrite\n const pathValue = path.value;\n if (fileInfo &&\n pathValue &&\n context.pathRequiresRewrite(pathValue)) {\n path.value = context.rewritePath(pathValue, fileInfo.rootpath);\n } else {\n path.value = context.normalizePath(path.value);\n }\n }\n\n return path;\n }\n\n eval(context) {\n const result = this.doEval(context);\n if (this.options.reference || this.blocksVisibility()) {\n if (result.length || result.length === 0) {\n result.forEach(node => {\n node.addVisibilityBlock();\n }\n );\n } else {\n result.addVisibilityBlock();\n }\n }\n return result;\n }\n\n doEval(context) {\n let ruleset;\n let registry;\n const features = this.features && this.features.eval(context);\n\n if (this.options.isPlugin) {\n if (this.root && this.root.eval) {\n try {\n this.root.eval(context);\n }\n catch (e) {\n e.message = 'Plugin error during evaluation';\n throw new LessError(e, this.root.imports, this.root.filename);\n }\n }\n registry = context.frames[0] && context.frames[0].functionRegistry;\n if ( registry && this.root && this.root.functions ) {\n registry.addMultiple( this.root.functions );\n }\n\n return [];\n }\n\n if (this.skip) {\n if (typeof this.skip === 'function') {\n this.skip = this.skip();\n }\n if (this.skip) {\n return [];\n }\n }\n if (this.options.inline) {\n const contents = new Anonymous(this.root, 0,\n {\n filename: this.importedFilename,\n reference: this.path._fileInfo && this.path._fileInfo.reference\n }, true, true);\n\n return this.features ? new Media([contents], this.features.value) : [contents];\n } else if (this.css) {\n const newImport = new Import(this.evalPath(context), features, this.options, this._index);\n if (!newImport.css && this.error) {\n throw this.error;\n }\n return newImport;\n } else {\n ruleset = new Ruleset(null, utils.copyArray(this.root.rules));\n ruleset.evalImports(context);\n\n return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules;\n }\n }\n}\n\nImport.prototype.type = 'Import';\nexport default Import;\n","import Node from './node';\nimport Variable from './variable';\n\nclass JsEvalNode extends Node {\n evaluateJavaScript(expression, context) {\n let result;\n const that = this;\n const evalContext = {};\n\n if (!context.javascriptEnabled) {\n throw { message: 'Inline JavaScript is not enabled. Is it set in your options?',\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n expression = expression.replace(/@\\{([\\w-]+)\\}/g, (_, name) => that.jsify(new Variable(`@${name}`, that.getIndex(), that.fileInfo()).eval(context)));\n\n try {\n expression = new Function(`return (${expression})`);\n } catch (e) {\n throw { message: `JavaScript evaluation error: ${e.message} from \\`${expression}\\`` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n\n const variables = context.frames[0].variables();\n for (const k in variables) {\n if (variables.hasOwnProperty(k)) {\n /* jshint loopfunc:true */\n evalContext[k.slice(1)] = {\n value: variables[k].value,\n toJS: function () {\n return this.value.eval(context).toCSS();\n }\n };\n }\n }\n\n try {\n result = expression.call(evalContext);\n } catch (e) {\n throw { message: `JavaScript evaluation error: '${e.name}: ${e.message.replace(/[\"]/g, '\\'')}'` ,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n return result;\n }\n\n jsify(obj) {\n if (Array.isArray(obj.value) && (obj.value.length > 1)) {\n return `[${obj.value.map(v => v.toCSS()).join(', ')}]`;\n } else {\n return obj.toCSS();\n }\n }\n}\n\nexport default JsEvalNode;\n","import JsEvalNode from './js-eval-node';\nimport Dimension from './dimension';\nimport Quoted from './quoted';\nimport Anonymous from './anonymous';\n\nclass JavaScript extends JsEvalNode {\n constructor(string, escaped, index, currentFileInfo) {\n super();\n\n this.escaped = escaped;\n this.expression = string;\n this._index = index;\n this._fileInfo = currentFileInfo;\n }\n\n eval(context) {\n const result = this.evaluateJavaScript(this.expression, context);\n const type = typeof result;\n\n if (type === 'number' && !isNaN(result)) {\n return new Dimension(result);\n } else if (type === 'string') {\n return new Quoted(`\"${result}\"`, result, this.escaped, this._index);\n } else if (Array.isArray(result)) {\n return new Anonymous(result.join(', '));\n } else {\n return new Anonymous(result);\n }\n }\n}\n\nJavaScript.prototype.type = 'JavaScript';\nexport default JavaScript;\n","import Node from './node';\n\nclass Assignment extends Node {\n constructor(key, val) {\n super();\n\n this.key = key;\n this.value = val;\n }\n\n accept(visitor) {\n this.value = visitor.visit(this.value);\n }\n\n eval(context) {\n if (this.value.eval) {\n return new Assignment(this.key, this.value.eval(context));\n }\n return this;\n }\n\n genCSS(context, output) {\n output.add(`${this.key}=`);\n if (this.value.genCSS) {\n this.value.genCSS(context, output);\n } else {\n output.add(this.value);\n }\n }\n}\n\nAssignment.prototype.type = 'Assignment';\nexport default Assignment;\n","import Node from './node';\n\nclass Condition extends Node {\n constructor(op, l, r, i, negate) {\n super();\n\n this.op = op.trim();\n this.lvalue = l;\n this.rvalue = r;\n this._index = i;\n this.negate = negate;\n }\n\n accept(visitor) {\n this.lvalue = visitor.visit(this.lvalue);\n this.rvalue = visitor.visit(this.rvalue);\n }\n\n eval(context) {\n const result = ((op, a, b) => {\n switch (op) {\n case 'and': return a && b;\n case 'or': return a || b;\n default:\n switch (Node.compare(a, b)) {\n case -1:\n return op === '<' || op === '=<' || op === '<=';\n case 0:\n return op === '=' || op === '>=' || op === '=<' || op === '<=';\n case 1:\n return op === '>' || op === '>=';\n default:\n return false;\n }\n }\n })(this.op, this.lvalue.eval(context), this.rvalue.eval(context));\n\n return this.negate ? !result : result;\n }\n}\n\nCondition.prototype.type = 'Condition';\nexport default Condition;\n","import Node from './node';\n\nclass UnicodeDescriptor extends Node {\n constructor(value) {\n super();\n\n this.value = value;\n }\n}\n\nUnicodeDescriptor.prototype.type = 'UnicodeDescriptor';\n\nexport default UnicodeDescriptor;\n","import Node from './node';\nimport Operation from './operation';\nimport Dimension from './dimension';\n\nclass Negative extends Node {\n constructor(node) {\n super();\n\n this.value = node;\n }\n\n genCSS(context, output) {\n output.add('-');\n this.value.genCSS(context, output);\n }\n\n eval(context) {\n if (context.isMathOn()) {\n return (new Operation('*', [new Dimension(-1), this.value])).eval(context);\n }\n return new Negative(this.value.eval(context));\n }\n}\n\nNegative.prototype.type = 'Negative';\nexport default Negative;\n","import Node from './node';\nimport Selector from './selector';\n\nclass Extend extends Node {\n constructor(selector, option, index, currentFileInfo, visibilityInfo) {\n super();\n\n this.selector = selector;\n this.option = option;\n this.object_id = Extend.next_id++;\n this.parent_ids = [this.object_id];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n\n switch (option) {\n case 'all':\n this.allowBefore = true;\n this.allowAfter = true;\n break;\n default:\n this.allowBefore = false;\n this.allowAfter = false;\n break;\n }\n this.setParent(this.selector, this);\n }\n\n accept(visitor) {\n this.selector = visitor.visit(this.selector);\n }\n\n eval(context) {\n return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n }\n\n clone(context) {\n return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo());\n }\n\n // it concatenates (joins) all selectors in selector array\n findSelfSelectors(selectors) {\n let selfElements = [];\n let i;\n let selectorElements;\n\n for (i = 0; i < selectors.length; i++) {\n selectorElements = selectors[i].elements;\n // duplicate the logic in genCSS function inside the selector node.\n // future TODO - move both logics into the selector joiner visitor\n if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === '') {\n selectorElements[0].combinator.value = ' ';\n }\n selfElements = selfElements.concat(selectors[i].elements);\n }\n\n this.selfSelectors = [new Selector(selfElements)];\n this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo());\n }\n}\n\nExtend.next_id = 0;\n\nExtend.prototype.type = 'Extend';\nexport default Extend;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport DetachedRuleset from './detached-ruleset';\nimport LessError from '../less-error';\n\nclass VariableCall extends Node {\n constructor(variable, index, currentFileInfo) {\n super();\n\n this.variable = variable;\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.allowRoot = true;\n }\n\n eval(context) {\n let rules;\n let detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context);\n const error = new LessError({message: `Could not evaluate variable call ${this.variable}`});\n\n if (!detachedRuleset.ruleset) {\n if (detachedRuleset.rules) {\n rules = detachedRuleset;\n }\n else if (Array.isArray(detachedRuleset)) {\n rules = new Ruleset('', detachedRuleset);\n }\n else if (Array.isArray(detachedRuleset.value)) {\n rules = new Ruleset('', detachedRuleset.value);\n }\n else {\n throw error;\n }\n detachedRuleset = new DetachedRuleset(rules);\n }\n\n if (detachedRuleset.ruleset) {\n return detachedRuleset.callEval(context);\n }\n throw error;\n }\n}\n\nVariableCall.prototype.type = 'VariableCall';\nexport default VariableCall;\n","import Node from './node';\nimport Variable from './variable';\nimport Ruleset from './ruleset';\nimport Selector from './selector';\n\nclass NamespaceValue extends Node {\n constructor(ruleCall, lookups, index, fileInfo) {\n super();\n\n this.value = ruleCall;\n this.lookups = lookups;\n this._index = index;\n this._fileInfo = fileInfo;\n }\n\n eval(context) {\n let i;\n let j;\n let name;\n let rules = this.value.eval(context);\n\n for (i = 0; i < this.lookups.length; i++) {\n name = this.lookups[i];\n\n /**\n * Eval'd DRs return rulesets.\n * Eval'd mixins return rules, so let's make a ruleset if we need it.\n * We need to do this because of late parsing of values\n */\n if (Array.isArray(rules)) {\n rules = new Ruleset([new Selector()], rules);\n }\n\n if (name === '') {\n rules = rules.lastDeclaration();\n }\n else if (name.charAt(0) === '@') {\n if (name.charAt(1) === '@') {\n name = `@${new Variable(name.substr(1)).eval(context).value}`;\n }\n if (rules.variables) {\n rules = rules.variable(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `variable ${name} not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n }\n else {\n if (name.substring(0, 2) === '$@') {\n name = `$${new Variable(name.substr(1)).eval(context).value}`;\n }\n else {\n name = name.charAt(0) === '$' ? name : `$${name}`;\n }\n if (rules.properties) {\n rules = rules.property(name);\n }\n \n if (!rules) {\n throw { type: 'Name',\n message: `property \"${name.substr(1)}\" not found`,\n filename: this.fileInfo().filename,\n index: this.getIndex() };\n }\n // Properties are an array of values, since a ruleset can have multiple props.\n // We pick the last one (the \"cascaded\" value)\n rules = rules[rules.length - 1];\n }\n\n if (rules.value) {\n rules = rules.eval(context).value;\n }\n if (rules.ruleset) {\n rules = rules.ruleset.eval(context);\n }\n }\n return rules;\n }\n}\n\nNamespaceValue.prototype.type = 'NamespaceValue';\nexport default NamespaceValue;\n","import Selector from './selector';\nimport Element from './element';\nimport Ruleset from './ruleset';\nimport Declaration from './declaration';\nimport DetachedRuleset from './detached-ruleset';\nimport Expression from './expression';\nimport contexts from '../contexts';\nimport * as utils from '../utils';\n\nclass Definition extends Ruleset {\n constructor(name, params, rules, condition, variadic, frames, visibilityInfo) {\n super();\n\n this.name = name || 'anonymous mixin';\n this.selectors = [new Selector([new Element(null, name, false, this._index, this._fileInfo)])];\n this.params = params;\n this.condition = condition;\n this.variadic = variadic;\n this.arity = params.length;\n this.rules = rules;\n this._lookups = {};\n const optionalParameters = [];\n this.required = params.reduce((count, p) => {\n if (!p.name || (p.name && !p.value)) {\n return count + 1;\n }\n else {\n optionalParameters.push(p.name);\n return count;\n }\n }, 0);\n this.optionalParameters = optionalParameters;\n this.frames = frames;\n this.copyVisibilityInfo(visibilityInfo);\n this.allowRoot = true;\n }\n\n accept(visitor) {\n if (this.params && this.params.length) {\n this.params = visitor.visitArray(this.params);\n }\n this.rules = visitor.visitArray(this.rules);\n if (this.condition) {\n this.condition = visitor.visit(this.condition);\n }\n }\n\n evalParams(context, mixinEnv, args, evaldArguments) {\n /* jshint boss:true */\n const frame = new Ruleset(null, null);\n\n let varargs;\n let arg;\n const params = utils.copyArray(this.params);\n let i;\n let j;\n let val;\n let name;\n let isNamedFound;\n let argIndex;\n let argsLength = 0;\n\n if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) {\n frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit();\n }\n mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames));\n\n if (args) {\n args = utils.copyArray(args);\n argsLength = args.length;\n\n for (i = 0; i < argsLength; i++) {\n arg = args[i];\n if (name = (arg && arg.name)) {\n isNamedFound = false;\n for (j = 0; j < params.length; j++) {\n if (!evaldArguments[j] && name === params[j].name) {\n evaldArguments[j] = arg.value.eval(context);\n frame.prependRule(new Declaration(name, arg.value.eval(context)));\n isNamedFound = true;\n break;\n }\n }\n if (isNamedFound) {\n args.splice(i, 1);\n i--;\n continue;\n } else {\n throw { type: 'Runtime', message: `Named argument for ${this.name} ${args[i].name} not found` };\n }\n }\n }\n }\n argIndex = 0;\n for (i = 0; i < params.length; i++) {\n if (evaldArguments[i]) { continue; }\n\n arg = args && args[argIndex];\n\n if (name = params[i].name) {\n if (params[i].variadic) {\n varargs = [];\n for (j = argIndex; j < argsLength; j++) {\n varargs.push(args[j].value.eval(context));\n }\n frame.prependRule(new Declaration(name, new Expression(varargs).eval(context)));\n } else {\n val = arg && arg.value;\n if (val) {\n // This was a mixin call, pass in a detached ruleset of it's eval'd rules\n if (Array.isArray(val)) {\n val = new DetachedRuleset(new Ruleset('', val));\n }\n else {\n val = val.eval(context);\n }\n } else if (params[i].value) {\n val = params[i].value.eval(mixinEnv);\n frame.resetCache();\n } else {\n throw { type: 'Runtime', message: `wrong number of arguments for ${this.name} (${argsLength} for ${this.arity})` };\n }\n\n frame.prependRule(new Declaration(name, val));\n evaldArguments[i] = val;\n }\n }\n\n if (params[i].variadic && args) {\n for (j = argIndex; j < argsLength; j++) {\n evaldArguments[j] = args[j].value.eval(context);\n }\n }\n argIndex++;\n }\n\n return frame;\n }\n\n makeImportant() {\n const rules = !this.rules ? this.rules : this.rules.map(r => {\n if (r.makeImportant) {\n return r.makeImportant(true);\n } else {\n return r;\n }\n });\n const result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames);\n return result;\n }\n\n eval(context) {\n return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || utils.copyArray(context.frames));\n }\n\n evalCall(context, args, important) {\n const _arguments = [];\n const mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames;\n const frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments);\n let rules;\n let ruleset;\n\n frame.prependRule(new Declaration('@arguments', new Expression(_arguments).eval(context)));\n\n rules = utils.copyArray(this.rules);\n\n ruleset = new Ruleset(null, rules);\n ruleset.originalRuleset = this;\n ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames)));\n if (important) {\n ruleset = ruleset.makeImportant();\n }\n return ruleset;\n }\n\n matchCondition(args, context) {\n if (this.condition && !this.condition.eval(\n new contexts.Eval(context,\n [this.evalParams(context, /* the parameter variables */\n new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])]\n .concat(this.frames || []) // the parent namespace/mixin frames\n .concat(context.frames)))) { // the current environment frames\n return false;\n }\n return true;\n }\n\n matchArgs(args, context) {\n const allArgsCnt = (args && args.length) || 0;\n let len;\n const optionalParameters = this.optionalParameters;\n const requiredArgsCnt = !args ? 0 : args.reduce((count, p) => {\n if (optionalParameters.indexOf(p.name) < 0) {\n return count + 1;\n } else {\n return count;\n }\n }, 0);\n\n if (!this.variadic) {\n if (requiredArgsCnt < this.required) {\n return false;\n }\n if (allArgsCnt > this.params.length) {\n return false;\n }\n } else {\n if (requiredArgsCnt < (this.required - 1)) {\n return false;\n }\n }\n\n // check patterns\n len = Math.min(requiredArgsCnt, this.arity);\n\n for (let i = 0; i < len; i++) {\n if (!this.params[i].name && !this.params[i].variadic) {\n if (args[i].value.eval(context).toCSS() != this.params[i].value.eval(context).toCSS()) {\n return false;\n }\n }\n }\n return true;\n }\n}\n\nDefinition.prototype.type = 'MixinDefinition';\nDefinition.prototype.evalFirst = true;\nexport default Definition;\n","import Node from './node';\nimport Selector from './selector';\nimport MixinDefinition from './mixin-definition';\nimport defaultFunc from '../functions/default';\n\nclass MixinCall extends Node {\n constructor(elements, args, index, currentFileInfo, important) {\n super();\n\n this.selector = new Selector(elements);\n this.arguments = args || [];\n this._index = index;\n this._fileInfo = currentFileInfo;\n this.important = important;\n this.allowRoot = true;\n this.setParent(this.selector, this);\n }\n\n accept(visitor) {\n if (this.selector) {\n this.selector = visitor.visit(this.selector);\n }\n if (this.arguments.length) {\n this.arguments = visitor.visitArray(this.arguments);\n }\n }\n\n eval(context) {\n let mixins;\n let mixin;\n let mixinPath;\n const args = [];\n let arg;\n let argValue;\n const rules = [];\n let match = false;\n let i;\n let m;\n let f;\n let isRecursive;\n let isOneFound;\n const candidates = [];\n let candidate;\n const conditionResult = [];\n let defaultResult;\n const defFalseEitherCase = -1;\n const defNone = 0;\n const defTrue = 1;\n const defFalse = 2;\n let count;\n let originalRuleset;\n let noArgumentsFilter;\n\n this.selector = this.selector.eval(context);\n\n function calcDefGroup(mixin, mixinPath) {\n let f;\n let p;\n let namespace;\n\n for (f = 0; f < 2; f++) {\n conditionResult[f] = true;\n defaultFunc.value(f);\n for (p = 0; p < mixinPath.length && conditionResult[f]; p++) {\n namespace = mixinPath[p];\n if (namespace.matchCondition) {\n conditionResult[f] = conditionResult[f] && namespace.matchCondition(null, context);\n }\n }\n if (mixin.matchCondition) {\n conditionResult[f] = conditionResult[f] && mixin.matchCondition(args, context);\n }\n }\n if (conditionResult[0] || conditionResult[1]) {\n if (conditionResult[0] != conditionResult[1]) {\n return conditionResult[1] ?\n defTrue : defFalse;\n }\n\n return defNone;\n }\n return defFalseEitherCase;\n }\n\n for (i = 0; i < this.arguments.length; i++) {\n arg = this.arguments[i];\n argValue = arg.value.eval(context);\n if (arg.expand && Array.isArray(argValue.value)) {\n argValue = argValue.value;\n for (m = 0; m < argValue.length; m++) {\n args.push({value: argValue[m]});\n }\n } else {\n args.push({name: arg.name, value: argValue});\n }\n }\n\n noArgumentsFilter = rule => rule.matchArgs(null, context);\n\n for (i = 0; i < context.frames.length; i++) {\n if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) {\n isOneFound = true;\n\n // To make `default()` function independent of definition order we have two \"subpasses\" here.\n // At first we evaluate each guard *twice* (with `default() == true` and `default() == false`),\n // and build candidate list with corresponding flags. Then, when we know all possible matches,\n // we make a final decision.\n\n for (m = 0; m < mixins.length; m++) {\n mixin = mixins[m].rule;\n mixinPath = mixins[m].path;\n isRecursive = false;\n for (f = 0; f < context.frames.length; f++) {\n if ((!(mixin instanceof MixinDefinition)) && mixin === (context.frames[f].originalRuleset || context.frames[f])) {\n isRecursive = true;\n break;\n }\n }\n if (isRecursive) {\n continue;\n }\n\n if (mixin.matchArgs(args, context)) {\n candidate = {mixin, group: calcDefGroup(mixin, mixinPath)};\n\n if (candidate.group !== defFalseEitherCase) {\n candidates.push(candidate);\n }\n\n match = true;\n }\n }\n\n defaultFunc.reset();\n\n count = [0, 0, 0];\n for (m = 0; m < candidates.length; m++) {\n count[candidates[m].group]++;\n }\n\n if (count[defNone] > 0) {\n defaultResult = defFalse;\n } else {\n defaultResult = defTrue;\n if ((count[defTrue] + count[defFalse]) > 1) {\n throw { type: 'Runtime',\n message: `Ambiguous use of \\`default()\\` found when matching for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n for (m = 0; m < candidates.length; m++) {\n candidate = candidates[m].group;\n if ((candidate === defNone) || (candidate === defaultResult)) {\n try {\n mixin = candidates[m].mixin;\n if (!(mixin instanceof MixinDefinition)) {\n originalRuleset = mixin.originalRuleset || mixin;\n mixin = new MixinDefinition('', [], mixin.rules, null, false, null, originalRuleset.visibilityInfo());\n mixin.originalRuleset = originalRuleset;\n }\n const newRules = mixin.evalCall(context, args, this.important).rules;\n this._setVisibilityToReplacement(newRules);\n Array.prototype.push.apply(rules, newRules);\n } catch (e) {\n throw { message: e.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e.stack };\n }\n }\n }\n\n if (match) {\n return rules;\n }\n }\n }\n if (isOneFound) {\n throw { type: 'Runtime',\n message: `No matching definition was found for \\`${this.format(args)}\\``,\n index: this.getIndex(), filename: this.fileInfo().filename };\n } else {\n throw { type: 'Name',\n message: `${this.selector.toCSS().trim()} is undefined`,\n index: this.getIndex(), filename: this.fileInfo().filename };\n }\n }\n\n _setVisibilityToReplacement(replacement) {\n let i;\n let rule;\n if (this.blocksVisibility()) {\n for (i = 0; i < replacement.length; i++) {\n rule = replacement[i];\n rule.addVisibilityBlock();\n }\n }\n }\n\n format(args) {\n return `${this.selector.toCSS().trim()}(${args ? args.map(a => {\n let argValue = '';\n if (a.name) {\n argValue += `${a.name}:`;\n }\n if (a.value.toCSS) {\n argValue += a.value.toCSS();\n } else {\n argValue += '???';\n }\n return argValue;\n }).join(', ') : ''})`;\n }\n}\n\nMixinCall.prototype.type = 'MixinCall';\nexport default MixinCall;\n","const tree = Object.create(null);\n\nimport Node from './node';\nimport Color from './color';\nimport AtRule from './atrule';\nimport DetachedRuleset from './detached-ruleset';\nimport Operation from './operation';\nimport Dimension from './dimension';\nimport Unit from './unit';\nimport Keyword from './keyword';\nimport Variable from './variable';\nimport Property from './property';\nimport Ruleset from './ruleset';\nimport Element from './element';\nimport Attribute from './attribute';\nimport Combinator from './combinator';\nimport Selector from './selector';\nimport Quoted from './quoted';\nimport Expression from './expression';\nimport Declaration from './declaration';\nimport Call from './call';\nimport URL from './url';\nimport Import from './import';\nimport Comment from './comment';\nimport Anonymous from './anonymous';\nimport Value from './value';\nimport JavaScript from './javascript';\nimport Assignment from './assignment';\nimport Condition from './condition';\nimport Paren from './paren';\nimport Media from './media';\nimport UnicodeDescriptor from './unicode-descriptor';\nimport Negative from './negative';\nimport Extend from './extend';\nimport VariableCall from './variable-call';\nimport NamespaceValue from './namespace-value';\n\n// mixins\nimport MixinCall from './mixin-call';\nimport MixinDefinition from './mixin-definition';\n\nexport default {\n Node, Color, AtRule, DetachedRuleset, Operation,\n Dimension, Unit, Keyword, Variable, Property,\n Ruleset, Element, Attribute, Combinator, Selector,\n Quoted, Expression, Declaration, Call, URL, Import,\n Comment, Anonymous, Value, JavaScript, Assignment,\n Condition, Paren, Media, UnicodeDescriptor, Negative,\n Extend, VariableCall, NamespaceValue,\n mixin: {\n Call: MixinCall,\n Definition: MixinDefinition\n }\n};","export default {\n error: function(msg) {\n this._fireEvent('error', msg);\n },\n warn: function(msg) {\n this._fireEvent('warn', msg);\n },\n info: function(msg) {\n this._fireEvent('info', msg);\n },\n debug: function(msg) {\n this._fireEvent('debug', msg);\n },\n addListener: function(listener) {\n this._listeners.push(listener);\n },\n removeListener: function(listener) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n },\n _fireEvent: function(type, msg) {\n for (let i = 0; i < this._listeners.length; i++) {\n const logFunction = this._listeners[i][type];\n if (logFunction) {\n logFunction(msg);\n }\n }\n },\n _listeners: []\n};\n","/**\n * @todo Document why this abstraction exists, and the relationship between\n * environment, file managers, and plugin manager\n */\n\nimport logger from '../logger';\n\nclass environment {\n constructor(externalEnvironment, fileManagers) {\n this.fileManagers = fileManagers || [];\n externalEnvironment = externalEnvironment || {};\n\n const optionalFunctions = ['encodeBase64', 'mimeLookup', 'charsetLookup', 'getSourceMapGenerator'];\n const requiredFunctions = [];\n const functions = requiredFunctions.concat(optionalFunctions);\n\n for (let i = 0; i < functions.length; i++) {\n const propName = functions[i];\n const environmentFunc = externalEnvironment[propName];\n if (environmentFunc) {\n this[propName] = environmentFunc.bind(externalEnvironment);\n } else if (i < requiredFunctions.length) {\n this.warn(`missing required function in environment - ${propName}`);\n }\n }\n }\n\n getFileManager(filename, currentDirectory, options, environment, isSync) {\n\n if (!filename) {\n logger.warn('getFileManager called with no filename.. Please report this issue. continuing.');\n }\n if (currentDirectory == null) {\n logger.warn('getFileManager called with null directory.. Please report this issue. continuing.');\n }\n\n let fileManagers = this.fileManagers;\n if (options.pluginManager) {\n fileManagers = [].concat(fileManagers).concat(options.pluginManager.getFileManagers());\n }\n for (let i = fileManagers.length - 1; i >= 0 ; i--) {\n const fileManager = fileManagers[i];\n if (fileManager[isSync ? 'supportsSync' : 'supports'](filename, currentDirectory, options, environment)) {\n return fileManager;\n }\n }\n return null;\n }\n\n addFileManager(fileManager) {\n this.fileManagers.push(fileManager);\n }\n\n clearFileManagers() {\n this.fileManagers = [];\n }\n}\n\nexport default environment;\n","class AbstractFileManager {\n getPath(filename) {\n let j = filename.lastIndexOf('?');\n if (j > 0) {\n filename = filename.slice(0, j);\n }\n j = filename.lastIndexOf('/');\n if (j < 0) {\n j = filename.lastIndexOf('\\\\');\n }\n if (j < 0) {\n return '';\n }\n return filename.slice(0, j + 1);\n }\n\n tryAppendExtension(path, ext) {\n return /(\\.[a-z]*$)|([\\?;].*)$/.test(path) ? path : path + ext;\n }\n\n tryAppendLessExtension(path) {\n return this.tryAppendExtension(path, '.less');\n };\n\n supportsSync() { return false; }\n\n alwaysMakePathsAbsolute() { return false; }\n\n isPathAbsolute(filename) {\n return (/^(?:[a-z-]+:|\\/|\\\\|#)/i).test(filename);\n }\n // TODO: pull out / replace?\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return basePath + laterPath;\n };\n\n pathDiff(url, baseUrl) {\n // diff between two paths to create a relative path\n const urlParts = this.extractUrlParts(url);\n const baseUrlParts = this.extractUrlParts(baseUrl);\n\n let i;\n let max;\n let urlDirectories;\n let baseUrlDirectories;\n let diff = '';\n if (urlParts.hostPart !== baseUrlParts.hostPart) {\n return '';\n }\n max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);\n for (i = 0; i < max; i++) {\n if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }\n }\n baseUrlDirectories = baseUrlParts.directories.slice(i);\n urlDirectories = urlParts.directories.slice(i);\n for (i = 0; i < baseUrlDirectories.length - 1; i++) {\n diff += '../';\n }\n for (i = 0; i < urlDirectories.length - 1; i++) {\n diff += `${urlDirectories[i]}/`;\n }\n return diff;\n };\n // helper function, not part of API\n extractUrlParts(url, baseUrl) {\n // urlParts[1] = protocol://hostname/ OR /\n // urlParts[2] = / if path relative to host base\n // urlParts[3] = directories\n // urlParts[4] = filename\n // urlParts[5] = parameters\n\n const urlPartsRegex = /^((?:[a-z-]+:)?\\/{2}(?:[^\\/\\?#]*\\/)|([\\/\\\\]))?((?:[^\\/\\\\\\?#]*[\\/\\\\])*)([^\\/\\\\\\?#]*)([#\\?].*)?$/i;\n\n const urlParts = url.match(urlPartsRegex);\n const returner = {};\n let rawDirectories = [];\n const directories = [];\n let i;\n let baseUrlParts;\n\n if (!urlParts) {\n throw new Error(`Could not parse sheet href - '${url}'`);\n }\n\n // Stylesheets in IE don't always return the full path\n if (baseUrl && (!urlParts[1] || urlParts[2])) {\n baseUrlParts = baseUrl.match(urlPartsRegex);\n if (!baseUrlParts) {\n throw new Error(`Could not parse page url - '${baseUrl}'`);\n }\n urlParts[1] = urlParts[1] || baseUrlParts[1] || '';\n if (!urlParts[2]) {\n urlParts[3] = baseUrlParts[3] + urlParts[3];\n }\n }\n\n if (urlParts[3]) {\n rawDirectories = urlParts[3].replace(/\\\\/g, '/').split('/');\n\n // collapse '..' and skip '.'\n for (i = 0; i < rawDirectories.length; i++) {\n\n if (rawDirectories[i] === '..') {\n directories.pop();\n }\n else if (rawDirectories[i] !== '.') {\n directories.push(rawDirectories[i]);\n }\n \n }\n }\n\n returner.hostPart = urlParts[1];\n returner.directories = directories;\n returner.rawPath = (urlParts[1] || '') + rawDirectories.join('/');\n returner.path = (urlParts[1] || '') + directories.join('/');\n returner.filename = urlParts[4];\n returner.fileUrl = returner.path + (urlParts[4] || '');\n returner.url = returner.fileUrl + (urlParts[5] || '');\n return returner;\n };\n}\n\nexport default AbstractFileManager;","import functionRegistry from '../functions/function-registry';\nimport LessError from '../less-error';\n\nclass AbstractPluginLoader {\n constructor() {\n // Implemented by Node.js plugin loader\n this.require = () => null\n }\n\n evalPlugin(contents, context, imports, pluginOptions, fileInfo) {\n let loader;\n let registry;\n let pluginObj;\n let localModule;\n let pluginManager;\n let filename;\n let result;\n\n pluginManager = context.pluginManager;\n\n if (fileInfo) {\n if (typeof fileInfo === 'string') {\n filename = fileInfo;\n }\n else {\n filename = fileInfo.filename;\n }\n }\n const shortname = (new this.less.FileManager()).extractUrlParts(filename).filename;\n\n if (filename) {\n pluginObj = pluginManager.get(filename);\n\n if (pluginObj) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n return pluginObj;\n }\n }\n localModule = {\n exports: {},\n pluginManager,\n fileInfo\n };\n registry = functionRegistry.create();\n\n const registerPlugin = obj => {\n pluginObj = obj;\n };\n\n try {\n loader = new Function('module', 'require', 'registerPlugin', 'functions', 'tree', 'less', 'fileInfo', contents);\n loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo);\n }\n catch (e) {\n return new LessError(e, imports, filename);\n }\n\n if (!pluginObj) {\n pluginObj = localModule.exports;\n }\n pluginObj = this.validatePlugin(pluginObj, filename, shortname);\n\n if (pluginObj instanceof LessError) {\n return pluginObj;\n }\n\n if (pluginObj) {\n pluginObj.imports = imports;\n pluginObj.filename = filename;\n\n // For < 3.x (or unspecified minVersion) - setOptions() before install()\n if (!pluginObj.minVersion || this.compareVersion('3.0.0', pluginObj.minVersion) < 0) {\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n\n if (result) {\n return result;\n }\n }\n\n // Run on first load\n pluginManager.addPlugin(pluginObj, fileInfo.filename, registry);\n pluginObj.functions = registry.getLocalFunctions();\n\n // Need to call setOptions again because the pluginObj might have functions\n result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions);\n if (result) {\n return result;\n }\n\n // Run every @plugin call\n try {\n if (pluginObj.use) {\n pluginObj.use.call(this.context, pluginObj);\n }\n }\n catch (e) {\n e.message = e.message || 'Error during @plugin call';\n return new LessError(e, imports, filename);\n }\n\n }\n else {\n return new LessError({ message: 'Not a valid plugin' }, imports, filename);\n }\n\n return pluginObj;\n }\n\n trySetOptions(plugin, filename, name, options) {\n if (options && !plugin.setOptions) {\n return new LessError({\n message: `Options have been provided but the plugin ${name} does not support any options.`\n });\n }\n try {\n plugin.setOptions && plugin.setOptions(options);\n }\n catch (e) {\n return new LessError(e);\n }\n }\n\n validatePlugin(plugin, filename, name) {\n if (plugin) {\n // support plugins being a function\n // so that the plugin can be more usable programmatically\n if (typeof plugin === 'function') {\n plugin = new plugin();\n }\n\n if (plugin.minVersion) {\n if (this.compareVersion(plugin.minVersion, this.less.version) < 0) {\n return new LessError({\n message: `Plugin ${name} requires version ${this.versionToString(plugin.minVersion)}`\n });\n }\n }\n return plugin;\n }\n return null;\n }\n\n compareVersion(aVersion, bVersion) {\n if (typeof aVersion === 'string') {\n aVersion = aVersion.match(/^(\\d+)\\.?(\\d+)?\\.?(\\d+)?/);\n aVersion.shift();\n }\n for (let i = 0; i < aVersion.length; i++) {\n if (aVersion[i] !== bVersion[i]) {\n return parseInt(aVersion[i]) > parseInt(bVersion[i]) ? -1 : 1;\n }\n }\n return 0;\n }\n\n versionToString(version) {\n let versionString = '';\n for (let i = 0; i < version.length; i++) {\n versionString += (versionString ? '.' : '') + version[i];\n }\n return versionString;\n }\n\n printUsage(plugins) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin.printUsage) {\n plugin.printUsage();\n }\n }\n }\n}\n\nexport default AbstractPluginLoader;\n\n","import tree from '../tree';\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n // add .typeIndex to tree node types for lookup table\n let key;\n\n let child;\n for (key in parent) { \n /* eslint guard-for-in: 0 */\n child = parent[key];\n switch (typeof child) {\n case 'function':\n // ignore bound functions directly on tree which do not have a prototype\n // or aren't nodes\n if (child.prototype && child.prototype.type) {\n child.prototype.typeIndex = ticker++;\n }\n break;\n case 'object':\n ticker = indexNodeTypes(child, ticker);\n break;\n \n }\n }\n return ticker;\n}\n\nclass Visitor {\n constructor(implementation) {\n this._implementation = implementation;\n this._visitInCache = {};\n this._visitOutCache = {};\n\n if (!_hasIndexed) {\n indexNodeTypes(tree, 1);\n _hasIndexed = true;\n }\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n\n const nodeTypeIndex = node.typeIndex;\n if (!nodeTypeIndex) {\n // MixinCall args aren't a node type?\n if (node.value && node.value.typeIndex) {\n this.visit(node.value);\n }\n return node;\n }\n\n const impl = this._implementation;\n let func = this._visitInCache[nodeTypeIndex];\n let funcOut = this._visitOutCache[nodeTypeIndex];\n const visitArgs = _visitArgs;\n let fnName;\n\n visitArgs.visitDeeper = true;\n\n if (!func) {\n fnName = `visit${node.type}`;\n func = impl[fnName] || _noop;\n funcOut = impl[`${fnName}Out`] || _noop;\n this._visitInCache[nodeTypeIndex] = func;\n this._visitOutCache[nodeTypeIndex] = funcOut;\n }\n\n if (func !== _noop) {\n const newNode = func.call(impl, node, visitArgs);\n if (node && impl.isReplacing) {\n node = newNode;\n }\n }\n\n if (visitArgs.visitDeeper && node) {\n if (node.length) {\n for (var i = 0, cnt = node.length; i < cnt; i++) {\n if (node[i].accept) {\n node[i].accept(this);\n }\n }\n } else if (node.accept) {\n node.accept(this);\n }\n }\n\n if (funcOut != _noop) {\n funcOut.call(impl, node);\n }\n\n return node;\n }\n\n visitArray(nodes, nonReplacing) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n\n // Non-replacing\n if (nonReplacing || !this._implementation.isReplacing) {\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n // Replacing\n const out = [];\n for (i = 0; i < cnt; i++) {\n const evald = this.visit(nodes[i]);\n if (evald === undefined) { continue; }\n if (!evald.splice) {\n out.push(evald);\n } else if (evald.length) {\n this.flatten(evald, out);\n }\n }\n return out;\n }\n\n flatten(arr, out) {\n if (!out) {\n out = [];\n }\n\n let cnt;\n let i;\n let item;\n let nestedCnt;\n let j;\n let nestedItem;\n\n for (i = 0, cnt = arr.length; i < cnt; i++) {\n item = arr[i];\n if (item === undefined) {\n continue;\n }\n if (!item.splice) {\n out.push(item);\n continue;\n }\n\n for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n nestedItem = item[j];\n if (nestedItem === undefined) {\n continue;\n }\n if (!nestedItem.splice) {\n out.push(nestedItem);\n } else if (nestedItem.length) {\n this.flatten(nestedItem, out);\n }\n }\n }\n\n return out;\n }\n}\n\nexport default Visitor;\n","class ImportSequencer {\n constructor(onSequencerEmpty) {\n this.imports = [];\n this.variableImports = [];\n this._onSequencerEmpty = onSequencerEmpty;\n this._currentDepth = 0;\n }\n\n addImport(callback) {\n const importSequencer = this;\n\n const importItem = {\n callback,\n args: null,\n isReady: false\n };\n\n this.imports.push(importItem);\n return function(...args) {\n importItem.args = Array.prototype.slice.call(args, 0);\n importItem.isReady = true;\n importSequencer.tryRun();\n };\n }\n\n addVariableImport(callback) {\n this.variableImports.push(callback);\n }\n\n tryRun() {\n this._currentDepth++;\n try {\n while (true) {\n while (this.imports.length > 0) {\n const importItem = this.imports[0];\n if (!importItem.isReady) {\n return;\n }\n this.imports = this.imports.slice(1);\n importItem.callback.apply(null, importItem.args);\n }\n if (this.variableImports.length === 0) {\n break;\n }\n const variableImport = this.variableImports[0];\n this.variableImports = this.variableImports.slice(1);\n variableImport();\n }\n } finally {\n this._currentDepth--;\n }\n if (this._currentDepth === 0 && this._onSequencerEmpty) {\n this._onSequencerEmpty();\n }\n }\n}\n\nexport default ImportSequencer;\n","import contexts from '../contexts';\nimport Visitor from './visitor';\nimport ImportSequencer from './import-sequencer';\nimport * as utils from '../utils';\n\nconst ImportVisitor = function(importer, finish) {\n\n this._visitor = new Visitor(this);\n this._importer = importer;\n this._finish = finish;\n this.context = new contexts.Eval();\n this.importCount = 0;\n this.onceFileDetectionMap = {};\n this.recursionDetector = {};\n this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this));\n};\n\nImportVisitor.prototype = {\n isReplacing: false,\n run: function (root) {\n try {\n // process the contents\n this._visitor.visit(root);\n }\n catch (e) {\n this.error = e;\n }\n\n this.isFinished = true;\n this._sequencer.tryRun();\n },\n _onSequencerEmpty: function() {\n if (!this.isFinished) {\n return;\n }\n this._finish(this.error);\n },\n visitImport: function (importNode, visitArgs) {\n const inlineCSS = importNode.options.inline;\n\n if (!importNode.css || inlineCSS) {\n\n const context = new contexts.Eval(this.context, utils.copyArray(this.context.frames));\n const importParent = context.frames[0];\n\n this.importCount++;\n if (importNode.isVariableImport()) {\n this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent));\n } else {\n this.processImportNode(importNode, context, importParent);\n }\n }\n visitArgs.visitDeeper = false;\n },\n processImportNode: function(importNode, context, importParent) {\n let evaldImportNode;\n const inlineCSS = importNode.options.inline;\n\n try {\n evaldImportNode = importNode.evalForImport(context);\n } catch (e) {\n if (!e.filename) { e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename; }\n // attempt to eval properly and treat as css\n importNode.css = true;\n // if that fails, this error will be thrown\n importNode.error = e;\n }\n\n if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) {\n if (evaldImportNode.options.multiple) {\n context.importMultiple = true;\n }\n\n // try appending if we haven't determined if it is css or not\n const tryAppendLessExtension = evaldImportNode.css === undefined;\n\n for (let i = 0; i < importParent.rules.length; i++) {\n if (importParent.rules[i] === importNode) {\n importParent.rules[i] = evaldImportNode;\n break;\n }\n }\n\n const onImported = this.onImported.bind(this, evaldImportNode, context);\n const sequencedOnImported = this._sequencer.addImport(onImported);\n\n this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(),\n evaldImportNode.options, sequencedOnImported);\n } else {\n this.importCount--;\n if (this.isFinished) {\n this._sequencer.tryRun();\n }\n }\n },\n onImported: function (importNode, context, e, root, importedAtRoot, fullPath) {\n if (e) {\n if (!e.filename) {\n e.index = importNode.getIndex(); e.filename = importNode.fileInfo().filename;\n }\n this.error = e;\n }\n\n const importVisitor = this;\n const inlineCSS = importNode.options.inline;\n const isPlugin = importNode.options.isPlugin;\n const isOptional = importNode.options.optional;\n const duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector;\n\n if (!context.importMultiple) {\n if (duplicateImport) {\n importNode.skip = true;\n } else {\n importNode.skip = () => {\n if (fullPath in importVisitor.onceFileDetectionMap) {\n return true;\n }\n importVisitor.onceFileDetectionMap[fullPath] = true;\n return false;\n };\n }\n }\n\n if (!fullPath && isOptional) {\n importNode.skip = true;\n }\n\n if (root) {\n importNode.root = root;\n importNode.importedFilename = fullPath;\n\n if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) {\n importVisitor.recursionDetector[fullPath] = true;\n\n const oldContext = this.context;\n this.context = context;\n try {\n this._visitor.visit(root);\n } catch (e) {\n this.error = e;\n }\n this.context = oldContext;\n }\n }\n\n importVisitor.importCount--;\n\n if (importVisitor.isFinished) {\n importVisitor._sequencer.tryRun();\n }\n },\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.unshift(declNode);\n } else {\n visitArgs.visitDeeper = false;\n }\n },\n visitDeclarationOut: function(declNode) {\n if (declNode.value.type === 'DetachedRuleset') {\n this.context.frames.shift();\n }\n },\n visitAtRule: function (atRuleNode, visitArgs) {\n this.context.frames.unshift(atRuleNode);\n },\n visitAtRuleOut: function (atRuleNode) {\n this.context.frames.shift();\n },\n visitMixinDefinition: function (mixinDefinitionNode, visitArgs) {\n this.context.frames.unshift(mixinDefinitionNode);\n },\n visitMixinDefinitionOut: function (mixinDefinitionNode) {\n this.context.frames.shift();\n },\n visitRuleset: function (rulesetNode, visitArgs) {\n this.context.frames.unshift(rulesetNode);\n },\n visitRulesetOut: function (rulesetNode) {\n this.context.frames.shift();\n },\n visitMedia: function (mediaNode, visitArgs) {\n this.context.frames.unshift(mediaNode.rules[0]);\n },\n visitMediaOut: function (mediaNode) {\n this.context.frames.shift();\n }\n};\nexport default ImportVisitor;\n","class SetTreeVisibilityVisitor {\n constructor(visible) {\n this.visible = visible;\n }\n\n run(root) {\n this.visit(root);\n }\n\n visitArray(nodes) {\n if (!nodes) {\n return nodes;\n }\n\n const cnt = nodes.length;\n let i;\n for (i = 0; i < cnt; i++) {\n this.visit(nodes[i]);\n }\n return nodes;\n }\n\n visit(node) {\n if (!node) {\n return node;\n }\n if (node.constructor === Array) {\n return this.visitArray(node);\n }\n\n if (!node.blocksVisibility || node.blocksVisibility()) {\n return node;\n }\n if (this.visible) {\n node.ensureVisibility();\n } else {\n node.ensureInvisibility();\n }\n\n node.accept(this);\n return node;\n }\n}\n\nexport default SetTreeVisibilityVisitor;","import tree from '../tree';\nimport Visitor from './visitor';\nimport logger from '../logger';\nimport * as utils from '../utils';\n\n/* jshint loopfunc:true */\n\nclass ExtendFinderVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n this.contexts = [];\n this.allExtendsStack = [[]];\n }\n\n run(root) {\n root = this._visitor.visit(root);\n root.allExtends = this.allExtendsStack[0];\n return root;\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n\n let i;\n let j;\n let extend;\n const allSelectorsExtendList = [];\n let extendList;\n\n // get &:extend(.a); rules which apply to all selectors in this ruleset\n const rules = rulesetNode.rules;\n\n const ruleCnt = rules ? rules.length : 0;\n for (i = 0; i < ruleCnt; i++) {\n if (rulesetNode.rules[i] instanceof tree.Extend) {\n allSelectorsExtendList.push(rules[i]);\n rulesetNode.extendOnEveryPath = true;\n }\n }\n\n // now find every selector and apply the extends that apply to all extends\n // and the ones which apply to an individual extend\n const paths = rulesetNode.paths;\n for (i = 0; i < paths.length; i++) {\n const selectorPath = paths[i];\n const selector = selectorPath[selectorPath.length - 1];\n const selExtendList = selector.extendList;\n\n extendList = selExtendList ? utils.copyArray(selExtendList).concat(allSelectorsExtendList)\n : allSelectorsExtendList;\n\n if (extendList) {\n extendList = extendList.map(allSelectorsExtend => allSelectorsExtend.clone());\n }\n\n for (j = 0; j < extendList.length; j++) {\n this.foundExtends = true;\n extend = extendList[j];\n extend.findSelfSelectors(selectorPath);\n extend.ruleset = rulesetNode;\n if (j === 0) { extend.firstExtendOnThisSelectorPath = true; }\n this.allExtendsStack[this.allExtendsStack.length - 1].push(extend);\n }\n }\n\n this.contexts.push(rulesetNode.selectors);\n }\n\n visitRulesetOut(rulesetNode) {\n if (!rulesetNode.root) {\n this.contexts.length = this.contexts.length - 1;\n }\n }\n\n visitMedia(mediaNode, visitArgs) {\n mediaNode.allExtends = [];\n this.allExtendsStack.push(mediaNode.allExtends);\n }\n\n visitMediaOut(mediaNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n atRuleNode.allExtends = [];\n this.allExtendsStack.push(atRuleNode.allExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n this.allExtendsStack.length = this.allExtendsStack.length - 1;\n }\n}\n\nclass ProcessExtendsVisitor {\n constructor() {\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n const extendFinder = new ExtendFinderVisitor();\n this.extendIndices = {};\n extendFinder.run(root);\n if (!extendFinder.foundExtends) { return root; }\n root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));\n this.allExtendsStack = [root.allExtends];\n const newRoot = this._visitor.visit(root);\n this.checkExtendsForNonMatched(root.allExtends);\n return newRoot;\n }\n\n checkExtendsForNonMatched(extendList) {\n const indices = this.extendIndices;\n extendList.filter(extend => !extend.hasFoundMatches && extend.parent_ids.length == 1).forEach(extend => {\n let selector = '_unknown_';\n try {\n selector = extend.selector.toCSS({});\n }\n catch (_) {}\n\n if (!indices[`${extend.index} ${selector}`]) {\n indices[`${extend.index} ${selector}`] = true;\n logger.warn(`extend '${selector}' has no matches`);\n }\n });\n }\n\n doExtendChaining(extendsList, extendsListTarget, iterationCount) {\n //\n // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering\n // and pasting the selector we would do normally, but we are also adding an extend with the same target selector\n // this means this new extend can then go and alter other extends\n //\n // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors\n // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already\n // processed if we look at each selector at a time, as is done in visitRuleset\n\n let extendIndex;\n\n let targetExtendIndex;\n let matches;\n const extendsToAdd = [];\n let newSelector;\n const extendVisitor = this;\n let selectorPath;\n let extend;\n let targetExtend;\n let newExtend;\n\n iterationCount = iterationCount || 0;\n\n // loop through comparing every extend with every target extend.\n // a target extend is the one on the ruleset we are looking at copy/edit/pasting in place\n // e.g. .a:extend(.b) {} and .b:extend(.c) {} then the first extend extends the second one\n // and the second is the target.\n // the separation into two lists allows us to process a subset of chains with a bigger set, as is the\n // case when processing media queries\n for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) {\n for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) {\n\n extend = extendsList[extendIndex];\n targetExtend = extendsListTarget[targetExtendIndex];\n\n // look for circular references\n if ( extend.parent_ids.indexOf( targetExtend.object_id ) >= 0 ) { continue; }\n\n // find a match in the target extends self selector (the bit before :extend)\n selectorPath = [targetExtend.selfSelectors[0]];\n matches = extendVisitor.findMatch(extend, selectorPath);\n\n if (matches.length) {\n extend.hasFoundMatches = true;\n\n // we found a match, so for each self selector..\n extend.selfSelectors.forEach(selfSelector => {\n const info = targetExtend.visibilityInfo();\n\n // process the extend as usual\n newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible());\n\n // but now we create a new extend from it\n newExtend = new(tree.Extend)(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info);\n newExtend.selfSelectors = newSelector;\n\n // add the extend onto the list of extends for that selector\n newSelector[newSelector.length - 1].extendList = [newExtend];\n\n // record that we need to add it.\n extendsToAdd.push(newExtend);\n newExtend.ruleset = targetExtend.ruleset;\n\n // remember its parents for circular references\n newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids);\n\n // only process the selector once.. if we have :extend(.a,.b) then multiple\n // extends will look at the same selector path, so when extending\n // we know that any others will be duplicates in terms of what is added to the css\n if (targetExtend.firstExtendOnThisSelectorPath) {\n newExtend.firstExtendOnThisSelectorPath = true;\n targetExtend.ruleset.paths.push(newSelector);\n }\n });\n }\n }\n }\n\n if (extendsToAdd.length) {\n // try to detect circular references to stop a stack overflow.\n // may no longer be needed.\n this.extendChainCount++;\n if (iterationCount > 100) {\n let selectorOne = '{unable to calculate}';\n let selectorTwo = '{unable to calculate}';\n try {\n selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();\n selectorTwo = extendsToAdd[0].selector.toCSS();\n }\n catch (e) {}\n throw { message: `extend circular reference detected. One of the circular extends is currently:${selectorOne}:extend(${selectorTwo})`};\n }\n\n // now process the new extends on the existing rules so that we can handle a extending b extending c extending\n // d extending e...\n return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1));\n } else {\n return extendsToAdd;\n }\n }\n\n visitDeclaration(ruleNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitSelector(selectorNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n if (rulesetNode.root) {\n return;\n }\n let matches;\n let pathIndex;\n let extendIndex;\n const allExtends = this.allExtendsStack[this.allExtendsStack.length - 1];\n const selectorsToAdd = [];\n const extendVisitor = this;\n let selectorPath;\n\n // look at each selector path in the ruleset, find any extend matches and then copy, find and replace\n\n for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) {\n for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) {\n selectorPath = rulesetNode.paths[pathIndex];\n\n // extending extends happens initially, before the main pass\n if (rulesetNode.extendOnEveryPath) { continue; }\n const extendList = selectorPath[selectorPath.length - 1].extendList;\n if (extendList && extendList.length) { continue; }\n\n matches = this.findMatch(allExtends[extendIndex], selectorPath);\n\n if (matches.length) {\n allExtends[extendIndex].hasFoundMatches = true;\n\n allExtends[extendIndex].selfSelectors.forEach(selfSelector => {\n let extendedSelectors;\n extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible());\n selectorsToAdd.push(extendedSelectors);\n });\n }\n }\n }\n rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd);\n }\n\n findMatch(extend, haystackSelectorPath) {\n //\n // look through the haystack selector path to try and find the needle - extend.selector\n // returns an array of selector matches that can then be replaced\n //\n let haystackSelectorIndex;\n\n let hackstackSelector;\n let hackstackElementIndex;\n let haystackElement;\n let targetCombinator;\n let i;\n const extendVisitor = this;\n const needleElements = extend.selector.elements;\n const potentialMatches = [];\n let potentialMatch;\n const matches = [];\n\n // loop through the haystack elements\n for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) {\n hackstackSelector = haystackSelectorPath[haystackSelectorIndex];\n\n for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) {\n\n haystackElement = hackstackSelector.elements[hackstackElementIndex];\n\n // if we allow elements before our match we can add a potential match every time. otherwise only at the first element.\n if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) {\n potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0,\n initialCombinator: haystackElement.combinator});\n }\n\n for (i = 0; i < potentialMatches.length; i++) {\n potentialMatch = potentialMatches[i];\n\n // selectors add \" \" onto the first element. When we use & it joins the selectors together, but if we don't\n // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to\n // work out what the resulting combinator will be\n targetCombinator = haystackElement.combinator.value;\n if (targetCombinator === '' && hackstackElementIndex === 0) {\n targetCombinator = ' ';\n }\n\n // if we don't match, null our match to indicate failure\n if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) ||\n (potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator)) {\n potentialMatch = null;\n } else {\n potentialMatch.matched++;\n }\n\n // if we are still valid and have finished, test whether we have elements after and whether these are allowed\n if (potentialMatch) {\n potentialMatch.finished = potentialMatch.matched === needleElements.length;\n if (potentialMatch.finished &&\n (!extend.allowAfter &&\n (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) {\n potentialMatch = null;\n }\n }\n // if null we remove, if not, we are still valid, so either push as a valid match or continue\n if (potentialMatch) {\n if (potentialMatch.finished) {\n potentialMatch.length = needleElements.length;\n potentialMatch.endPathIndex = haystackSelectorIndex;\n potentialMatch.endPathElementIndex = hackstackElementIndex + 1; // index after end of match\n potentialMatches.length = 0; // we don't allow matches to overlap, so start matching again\n matches.push(potentialMatch);\n }\n } else {\n potentialMatches.splice(i, 1);\n i--;\n }\n }\n }\n }\n return matches;\n }\n\n isElementValuesEqual(elementValue1, elementValue2) {\n if (typeof elementValue1 === 'string' || typeof elementValue2 === 'string') {\n return elementValue1 === elementValue2;\n }\n if (elementValue1 instanceof tree.Attribute) {\n if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) {\n return false;\n }\n if (!elementValue1.value || !elementValue2.value) {\n if (elementValue1.value || elementValue2.value) {\n return false;\n }\n return true;\n }\n elementValue1 = elementValue1.value.value || elementValue1.value;\n elementValue2 = elementValue2.value.value || elementValue2.value;\n return elementValue1 === elementValue2;\n }\n elementValue1 = elementValue1.value;\n elementValue2 = elementValue2.value;\n if (elementValue1 instanceof tree.Selector) {\n if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) {\n return false;\n }\n for (let i = 0; i < elementValue1.elements.length; i++) {\n if (elementValue1.elements[i].combinator.value !== elementValue2.elements[i].combinator.value) {\n if (i !== 0 || (elementValue1.elements[i].combinator.value || ' ') !== (elementValue2.elements[i].combinator.value || ' ')) {\n return false;\n }\n }\n if (!this.isElementValuesEqual(elementValue1.elements[i].value, elementValue2.elements[i].value)) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n\n extendSelector(matches, selectorPath, replacementSelector, isVisible) {\n // for a set of matches, replace each match with the replacement selector\n\n let currentSelectorPathIndex = 0;\n\n let currentSelectorPathElementIndex = 0;\n let path = [];\n let matchIndex;\n let selector;\n let firstElement;\n let match;\n let newElements;\n\n for (matchIndex = 0; matchIndex < matches.length; matchIndex++) {\n match = matches[matchIndex];\n selector = selectorPath[match.pathIndex];\n firstElement = new tree.Element(\n match.initialCombinator,\n replacementSelector.elements[0].value,\n replacementSelector.elements[0].isVariable,\n replacementSelector.elements[0].getIndex(),\n replacementSelector.elements[0].fileInfo()\n );\n\n if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n\n newElements = selector.elements\n .slice(currentSelectorPathElementIndex, match.index)\n .concat([firstElement])\n .concat(replacementSelector.elements.slice(1));\n\n if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) {\n path[path.length - 1].elements =\n path[path.length - 1].elements.concat(newElements);\n } else {\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex));\n\n path.push(new tree.Selector(\n newElements\n ));\n }\n currentSelectorPathIndex = match.endPathIndex;\n currentSelectorPathElementIndex = match.endPathElementIndex;\n if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) {\n currentSelectorPathElementIndex = 0;\n currentSelectorPathIndex++;\n }\n }\n\n if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) {\n path[path.length - 1].elements = path[path.length - 1]\n .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex));\n currentSelectorPathIndex++;\n }\n\n path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length));\n path = path.map(currentValue => {\n // we can re-use elements here, because the visibility property matters only for selectors\n const derived = currentValue.createDerived(currentValue.elements);\n if (isVisible) {\n derived.ensureVisibility();\n } else {\n derived.ensureInvisibility();\n }\n return derived;\n });\n return path;\n }\n\n visitMedia(mediaNode, visitArgs) {\n let newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitMediaOut(mediaNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n let newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]);\n newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends));\n this.allExtendsStack.push(newAllExtends);\n }\n\n visitAtRuleOut(atRuleNode) {\n const lastIndex = this.allExtendsStack.length - 1;\n this.allExtendsStack.length = lastIndex;\n }\n}\n\nexport default ProcessExtendsVisitor;\n","import Visitor from './visitor';\n\nclass JoinSelectorVisitor {\n constructor() {\n this.contexts = [[]];\n this._visitor = new Visitor(this);\n }\n\n run(root) {\n return this._visitor.visit(root);\n }\n\n visitDeclaration(declNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitMixinDefinition(mixinDefinitionNode, visitArgs) {\n visitArgs.visitDeeper = false;\n }\n\n visitRuleset(rulesetNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n const paths = [];\n let selectors;\n\n this.contexts.push(paths);\n\n if (!rulesetNode.root) {\n selectors = rulesetNode.selectors;\n if (selectors) {\n selectors = selectors.filter(selector => selector.getIsOutput());\n rulesetNode.selectors = selectors.length ? selectors : (selectors = null);\n if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); }\n }\n if (!selectors) { rulesetNode.rules = null; }\n rulesetNode.paths = paths;\n }\n }\n\n visitRulesetOut(rulesetNode) {\n this.contexts.length = this.contexts.length - 1;\n }\n\n visitMedia(mediaNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n mediaNode.rules[0].root = (context.length === 0 || context[0].multiMedia);\n }\n\n visitAtRule(atRuleNode, visitArgs) {\n const context = this.contexts[this.contexts.length - 1];\n if (atRuleNode.rules && atRuleNode.rules.length) {\n atRuleNode.rules[0].root = (atRuleNode.isRooted || context.length === 0 || null);\n }\n }\n}\n\nexport default JoinSelectorVisitor;\n","import tree from '../tree';\nimport Visitor from './visitor';\n\nclass CSSVisitorUtils {\n constructor(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n }\n\n containsSilentNonBlockedChild(bodyRules) {\n let rule;\n if (!bodyRules) {\n return false;\n }\n for (let r = 0; r < bodyRules.length; r++) {\n rule = bodyRules[r];\n if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) {\n // the atrule contains something that was referenced (likely by extend)\n // therefore it needs to be shown in output too\n return true;\n }\n }\n return false;\n }\n\n keepOnlyVisibleChilds(owner) {\n if (owner && owner.rules) {\n owner.rules = owner.rules.filter(thing => thing.isVisible());\n }\n }\n\n isEmpty(owner) {\n return (owner && owner.rules) \n ? (owner.rules.length === 0) : true;\n }\n\n hasVisibleSelector(rulesetNode) {\n return (rulesetNode && rulesetNode.paths)\n ? (rulesetNode.paths.length > 0) : false;\n }\n\n resolveVisibility(node, originalRules) {\n if (!node.blocksVisibility()) {\n if (this.isEmpty(node) && !this.containsSilentNonBlockedChild(originalRules)) {\n return ;\n }\n\n return node;\n }\n\n const compiledRulesBody = node.rules[0];\n this.keepOnlyVisibleChilds(compiledRulesBody);\n\n if (this.isEmpty(compiledRulesBody)) {\n return ;\n }\n\n node.ensureVisibility();\n node.removeVisibilityBlock();\n\n return node;\n }\n\n isVisibleRuleset(rulesetNode) {\n if (rulesetNode.firstRoot) {\n return true;\n }\n\n if (this.isEmpty(rulesetNode)) {\n return false;\n }\n\n if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) {\n return false;\n }\n\n return true;\n }\n}\n\nconst ToCSSVisitor = function(context) {\n this._visitor = new Visitor(this);\n this._context = context;\n this.utils = new CSSVisitorUtils(context);\n};\n\nToCSSVisitor.prototype = {\n isReplacing: true,\n run: function (root) {\n return this._visitor.visit(root);\n },\n\n visitDeclaration: function (declNode, visitArgs) {\n if (declNode.blocksVisibility() || declNode.variable) {\n return;\n }\n return declNode;\n },\n\n visitMixinDefinition: function (mixinNode, visitArgs) {\n // mixin definitions do not get eval'd - this means they keep state\n // so we have to clear that state here so it isn't used if toCSS is called twice\n mixinNode.frames = [];\n },\n\n visitExtend: function (extendNode, visitArgs) {\n },\n\n visitComment: function (commentNode, visitArgs) {\n if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) {\n return;\n }\n return commentNode;\n },\n\n visitMedia: function(mediaNode, visitArgs) {\n const originalRules = mediaNode.rules[0].rules;\n mediaNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n return this.utils.resolveVisibility(mediaNode, originalRules);\n },\n\n visitImport: function (importNode, visitArgs) {\n if (importNode.blocksVisibility()) {\n return ;\n }\n return importNode;\n },\n\n visitAtRule: function(atRuleNode, visitArgs) {\n if (atRuleNode.rules && atRuleNode.rules.length) {\n return this.visitAtRuleWithBody(atRuleNode, visitArgs);\n } else {\n return this.visitAtRuleWithoutBody(atRuleNode, visitArgs);\n }\n },\n\n visitAnonymous: function(anonymousNode, visitArgs) {\n if (!anonymousNode.blocksVisibility()) {\n anonymousNode.accept(this._visitor);\n return anonymousNode;\n }\n },\n\n visitAtRuleWithBody: function(atRuleNode, visitArgs) {\n // if there is only one nested ruleset and that one has no path, then it is\n // just fake ruleset\n function hasFakeRuleset(atRuleNode) {\n const bodyRules = atRuleNode.rules;\n return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0);\n }\n function getBodyRules(atRuleNode) {\n const nodeRules = atRuleNode.rules;\n if (hasFakeRuleset(atRuleNode)) {\n return nodeRules[0].rules;\n }\n\n return nodeRules;\n }\n // it is still true that it is only one ruleset in array\n // this is last such moment\n // process childs\n const originalRules = getBodyRules(atRuleNode);\n atRuleNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n\n if (!this.utils.isEmpty(atRuleNode)) {\n this._mergeRules(atRuleNode.rules[0].rules);\n }\n\n return this.utils.resolveVisibility(atRuleNode, originalRules);\n },\n\n visitAtRuleWithoutBody: function(atRuleNode, visitArgs) {\n if (atRuleNode.blocksVisibility()) {\n return;\n }\n\n if (atRuleNode.name === '@charset') {\n // Only output the debug info together with subsequent @charset definitions\n // a comment (or @media statement) before the actual @charset atrule would\n // be considered illegal css as it has to be on the first line\n if (this.charset) {\n if (atRuleNode.debugInfo) {\n const comment = new tree.Comment(`/* ${atRuleNode.toCSS(this._context).replace(/\\n/g, '')} */\\n`);\n comment.debugInfo = atRuleNode.debugInfo;\n return this._visitor.visit(comment);\n }\n return;\n }\n this.charset = true;\n }\n\n return atRuleNode;\n },\n\n checkValidNodes: function(rules, isRoot) {\n if (!rules) {\n return;\n }\n\n for (let i = 0; i < rules.length; i++) {\n const ruleNode = rules[i];\n if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) {\n throw { message: 'Properties must be inside selector blocks. They cannot be in the root',\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode instanceof tree.Call) {\n throw { message: `Function '${ruleNode.name}' is undefined`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n if (ruleNode.type && !ruleNode.allowRoot) {\n throw { message: `${ruleNode.type} node returned by a function is not valid here`,\n index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename};\n }\n }\n },\n\n visitRuleset: function (rulesetNode, visitArgs) {\n // at this point rulesets are nested into each other\n let rule;\n\n const rulesets = [];\n\n this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot);\n\n if (!rulesetNode.root) {\n // remove invisible paths\n this._compileRulesetPaths(rulesetNode);\n\n // remove rulesets from this ruleset body and compile them separately\n const nodeRules = rulesetNode.rules;\n\n let nodeRuleCnt = nodeRules ? nodeRules.length : 0;\n for (let i = 0; i < nodeRuleCnt; ) {\n rule = nodeRules[i];\n if (rule && rule.rules) {\n // visit because we are moving them out from being a child\n rulesets.push(this._visitor.visit(rule));\n nodeRules.splice(i, 1);\n nodeRuleCnt--;\n continue;\n }\n i++;\n }\n // accept the visitor to remove rules and refactor itself\n // then we can decide nogw whether we want it or not\n // compile body\n if (nodeRuleCnt > 0) {\n rulesetNode.accept(this._visitor);\n } else {\n rulesetNode.rules = null;\n }\n visitArgs.visitDeeper = false;\n } else { // if (! rulesetNode.root) {\n rulesetNode.accept(this._visitor);\n visitArgs.visitDeeper = false;\n }\n\n if (rulesetNode.rules) {\n this._mergeRules(rulesetNode.rules);\n this._removeDuplicateRules(rulesetNode.rules);\n }\n\n // now decide whether we keep the ruleset\n if (this.utils.isVisibleRuleset(rulesetNode)) {\n rulesetNode.ensureVisibility();\n rulesets.splice(0, 0, rulesetNode);\n }\n\n if (rulesets.length === 1) {\n return rulesets[0];\n }\n return rulesets;\n },\n\n _compileRulesetPaths: function(rulesetNode) {\n if (rulesetNode.paths) {\n rulesetNode.paths = rulesetNode.paths\n .filter(p => {\n let i;\n if (p[0].elements[0].combinator.value === ' ') {\n p[0].elements[0].combinator = new(tree.Combinator)('');\n }\n for (i = 0; i < p.length; i++) {\n if (p[i].isVisible() && p[i].getIsOutput()) {\n return true;\n }\n }\n return false;\n });\n }\n },\n\n _removeDuplicateRules: function(rules) {\n if (!rules) { return; }\n\n // remove duplicates\n const ruleCache = {};\n\n let ruleList;\n let rule;\n let i;\n\n for (i = rules.length - 1; i >= 0 ; i--) {\n rule = rules[i];\n if (rule instanceof tree.Declaration) {\n if (!ruleCache[rule.name]) {\n ruleCache[rule.name] = rule;\n } else {\n ruleList = ruleCache[rule.name];\n if (ruleList instanceof tree.Declaration) {\n ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)];\n }\n const ruleCSS = rule.toCSS(this._context);\n if (ruleList.indexOf(ruleCSS) !== -1) {\n rules.splice(i, 1);\n } else {\n ruleList.push(ruleCSS);\n }\n }\n }\n }\n },\n\n _mergeRules: function(rules) {\n if (!rules) {\n return; \n }\n\n const groups = {};\n const groupsArr = [];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n if (rule.merge) {\n const key = rule.name;\n groups[key] ? rules.splice(i--, 1) : \n groupsArr.push(groups[key] = []);\n groups[key].push(rule);\n }\n }\n\n groupsArr.forEach(group => {\n if (group.length > 0) {\n const result = group[0];\n let space = [];\n const comma = [new tree.Expression(space)];\n group.forEach(rule => {\n if ((rule.merge === '+') && (space.length > 0)) {\n comma.push(new tree.Expression(space = []));\n }\n space.push(rule.value);\n result.important = result.important || rule.important;\n });\n result.value = new tree.Value(comma);\n }\n });\n }\n};\n\nexport default ToCSSVisitor;\n","import Visitor from './visitor';\nimport ImportVisitor from './import-visitor';\nimport MarkVisibleSelectorsVisitor from './set-tree-visibility-visitor';\nimport ExtendVisitor from './extend-visitor';\nimport JoinSelectorVisitor from './join-selector-visitor';\nimport ToCSSVisitor from './to-css-visitor';\n\nexport default {\n Visitor,\n ImportVisitor,\n MarkVisibleSelectorsVisitor,\n ExtendVisitor,\n JoinSelectorVisitor,\n ToCSSVisitor\n};\n","import chunker from './chunker';\n\nexport default () => {\n let // Less input string\n input;\n\n let // current chunk\n j;\n\n const // holds state for backtracking\n saveStack = [];\n\n let // furthest index the parser has gone to\n furthest;\n\n let // if this is furthest we got to, this is the probably cause\n furthestPossibleErrorMessage;\n\n let // chunkified input\n chunks;\n\n let // current chunk\n current;\n\n let // index of current chunk, in `input`\n currentPos;\n\n const parserInput = {};\n const CHARCODE_SPACE = 32;\n const CHARCODE_TAB = 9;\n const CHARCODE_LF = 10;\n const CHARCODE_CR = 13;\n const CHARCODE_PLUS = 43;\n const CHARCODE_COMMA = 44;\n const CHARCODE_FORWARD_SLASH = 47;\n const CHARCODE_9 = 57;\n\n function skipWhitespace(length) {\n const oldi = parserInput.i;\n const oldj = j;\n const curr = parserInput.i - currentPos;\n const endIndex = parserInput.i + current.length - curr;\n const mem = (parserInput.i += length);\n const inp = input;\n let c;\n let nextChar;\n let comment;\n\n for (; parserInput.i < endIndex; parserInput.i++) {\n c = inp.charCodeAt(parserInput.i);\n\n if (parserInput.autoCommentAbsorb && c === CHARCODE_FORWARD_SLASH) {\n nextChar = inp.charAt(parserInput.i + 1);\n if (nextChar === '/') {\n comment = {index: parserInput.i, isLineComment: true};\n let nextNewLine = inp.indexOf('\\n', parserInput.i + 2);\n if (nextNewLine < 0) {\n nextNewLine = endIndex;\n }\n parserInput.i = nextNewLine;\n comment.text = inp.substr(comment.index, parserInput.i - comment.index);\n parserInput.commentStore.push(comment);\n continue;\n } else if (nextChar === '*') {\n const nextStarSlash = inp.indexOf('*/', parserInput.i + 2);\n if (nextStarSlash >= 0) {\n comment = {\n index: parserInput.i,\n text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i),\n isLineComment: false\n };\n parserInput.i += comment.text.length - 1;\n parserInput.commentStore.push(comment);\n continue;\n }\n }\n break;\n }\n\n if ((c !== CHARCODE_SPACE) && (c !== CHARCODE_LF) && (c !== CHARCODE_TAB) && (c !== CHARCODE_CR)) {\n break;\n }\n }\n\n current = current.slice(length + parserInput.i - mem + curr);\n currentPos = parserInput.i;\n\n if (!current.length) {\n if (j < chunks.length - 1) {\n current = chunks[++j];\n skipWhitespace(0); // skip space at the beginning of a chunk\n return true; // things changed\n }\n parserInput.finished = true;\n }\n\n return oldi !== parserInput.i || oldj !== j;\n }\n\n parserInput.save = () => {\n currentPos = parserInput.i;\n saveStack.push( { current, i: parserInput.i, j });\n };\n parserInput.restore = possibleErrorMessage => {\n\n if (parserInput.i > furthest || (parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage)) {\n furthest = parserInput.i;\n furthestPossibleErrorMessage = possibleErrorMessage;\n }\n const state = saveStack.pop();\n current = state.current;\n currentPos = parserInput.i = state.i;\n j = state.j;\n };\n parserInput.forget = () => {\n saveStack.pop();\n };\n parserInput.isWhitespace = offset => {\n const pos = parserInput.i + (offset || 0);\n const code = input.charCodeAt(pos);\n return (code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF);\n };\n\n // Specialization of $(tok)\n parserInput.$re = tok => {\n if (parserInput.i > currentPos) {\n current = current.slice(parserInput.i - currentPos);\n currentPos = parserInput.i;\n }\n\n const m = tok.exec(current);\n if (!m) {\n return null;\n }\n\n skipWhitespace(m[0].length);\n if (typeof m === 'string') {\n return m;\n }\n\n return m.length === 1 ? m[0] : m;\n };\n\n parserInput.$char = tok => {\n if (input.charAt(parserInput.i) !== tok) {\n return null;\n }\n skipWhitespace(1);\n return tok;\n };\n\n parserInput.$str = tok => {\n const tokLength = tok.length;\n\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tokLength; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return null;\n }\n }\n\n skipWhitespace(tokLength);\n return tok;\n };\n\n parserInput.$quoted = loc => {\n const pos = loc || parserInput.i;\n const startChar = input.charAt(pos);\n\n if (startChar !== '\\'' && startChar !== '\"') {\n return;\n }\n const length = input.length;\n const currentPosition = pos;\n\n for (let i = 1; i + currentPosition < length; i++) {\n const nextChar = input.charAt(i + currentPosition);\n switch (nextChar) {\n case '\\\\':\n i++;\n continue;\n case '\\r':\n case '\\n':\n break;\n case startChar:\n const str = input.substr(currentPosition, i + 1);\n if (!loc && loc !== 0) {\n skipWhitespace(i + 1);\n return str\n }\n return [startChar, str];\n default:\n }\n }\n return null;\n };\n\n /**\n * Permissive parsing. Ignores everything except matching {} [] () and quotes\n * until matching token (outside of blocks)\n */\n parserInput.$parseUntil = tok => {\n let quote = '';\n let returnVal = null;\n let inComment = false;\n let blockDepth = 0;\n const blockStack = [];\n const parseGroups = [];\n const length = input.length;\n const startPos = parserInput.i;\n let lastPos = parserInput.i;\n let i = parserInput.i;\n let loop = true;\n let testChar;\n\n if (typeof tok === 'string') {\n testChar = char => char === tok\n } else {\n testChar = char => tok.test(char)\n }\n\n do {\n let prevChar;\n let nextChar = input.charAt(i);\n if (blockDepth === 0 && testChar(nextChar)) {\n returnVal = input.substr(lastPos, i - lastPos);\n if (returnVal) {\n parseGroups.push(returnVal);\n }\n else {\n parseGroups.push(' ');\n }\n returnVal = parseGroups;\n skipWhitespace(i - startPos);\n loop = false\n } else {\n if (inComment) {\n if (nextChar === '*' && \n input.charAt(i + 1) === '/') {\n i++;\n blockDepth--;\n inComment = false;\n }\n i++;\n continue;\n }\n switch (nextChar) {\n case '\\\\':\n i++;\n nextChar = input.charAt(i);\n parseGroups.push(input.substr(lastPos, i - lastPos + 1));\n lastPos = i + 1;\n break;\n case '/':\n if (input.charAt(i + 1) === '*') {\n i++;\n inComment = true;\n blockDepth++;\n }\n break;\n case '\\'':\n case '\"':\n quote = parserInput.$quoted(i);\n if (quote) {\n parseGroups.push(input.substr(lastPos, i - lastPos), quote);\n i += quote[1].length - 1;\n lastPos = i + 1;\n }\n else {\n skipWhitespace(i - startPos);\n returnVal = nextChar;\n loop = false;\n }\n break;\n case '{':\n blockStack.push('}');\n blockDepth++;\n break;\n case '(':\n blockStack.push(')');\n blockDepth++;\n break;\n case '[':\n blockStack.push(']');\n blockDepth++;\n break;\n case '}':\n case ')':\n case ']':\n const expected = blockStack.pop();\n if (nextChar === expected) {\n blockDepth--;\n } else {\n // move the parser to the error and return expected\n skipWhitespace(i - startPos);\n returnVal = expected;\n loop = false;\n }\n }\n i++;\n if (i > length) {\n loop = false;\n }\n }\n prevChar = nextChar;\n } while (loop);\n\n return returnVal ? returnVal : null;\n }\n\n parserInput.autoCommentAbsorb = true;\n parserInput.commentStore = [];\n parserInput.finished = false;\n\n // Same as $(), but don't change the state of the parser,\n // just return the match.\n parserInput.peek = tok => {\n if (typeof tok === 'string') {\n // https://jsperf.com/string-startswith/21\n for (let i = 0; i < tok.length; i++) {\n if (input.charAt(parserInput.i + i) !== tok.charAt(i)) {\n return false;\n }\n }\n return true;\n } else {\n return tok.test(current);\n }\n };\n\n // Specialization of peek()\n // TODO remove or change some currentChar calls to peekChar\n parserInput.peekChar = tok => input.charAt(parserInput.i) === tok;\n\n parserInput.currentChar = () => input.charAt(parserInput.i);\n\n parserInput.prevChar = () => input.charAt(parserInput.i - 1);\n\n parserInput.getInput = () => input;\n\n parserInput.peekNotNumeric = () => {\n const c = input.charCodeAt(parserInput.i);\n // Is the first char of the dimension 0-9, '.', '+' or '-'\n return (c > CHARCODE_9 || c < CHARCODE_PLUS) || c === CHARCODE_FORWARD_SLASH || c === CHARCODE_COMMA;\n };\n\n parserInput.start = (str, chunkInput, failFunction) => {\n input = str;\n parserInput.i = j = currentPos = furthest = 0;\n\n // chunking apparently makes things quicker (but my tests indicate\n // it might actually make things slower in node at least)\n // and it is a non-perfect parse - it can't recognise\n // unquoted urls, meaning it can't distinguish comments\n // meaning comments with quotes or {}() in them get 'counted'\n // and then lead to parse errors.\n // In addition if the chunking chunks in the wrong place we might\n // not be able to parse a parser statement in one go\n // this is officially deprecated but can be switched on via an option\n // in the case it causes too much performance issues.\n if (chunkInput) {\n chunks = chunker(str, failFunction);\n } else {\n chunks = [str];\n }\n\n current = chunks[0];\n\n skipWhitespace(0);\n };\n\n parserInput.end = () => {\n let message;\n const isFinished = parserInput.i >= input.length;\n\n if (parserInput.i < furthest) {\n message = furthestPossibleErrorMessage;\n parserInput.i = furthest;\n }\n return {\n isFinished,\n furthest: parserInput.i,\n furthestPossibleErrorMessage: message,\n furthestReachedEnd: parserInput.i >= input.length - 1,\n furthestChar: input[parserInput.i]\n };\n };\n\n return parserInput;\n};\n","// Split the input into chunks.\nexport default (input, fail) => {\n const len = input.length;\n let level = 0;\n let parenLevel = 0;\n let lastOpening;\n let lastOpeningParen;\n let lastMultiComment;\n let lastMultiCommentEndBrace;\n const chunks = [];\n let emitFrom = 0;\n let chunkerCurrentIndex;\n let currentChunkStartIndex;\n let cc;\n let cc2;\n let matched;\n\n function emitChunk(force) {\n const len = chunkerCurrentIndex - emitFrom;\n if (((len < 512) && !force) || !len) {\n return;\n }\n chunks.push(input.slice(emitFrom, chunkerCurrentIndex + 1));\n emitFrom = chunkerCurrentIndex + 1;\n }\n\n for (chunkerCurrentIndex = 0; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc = input.charCodeAt(chunkerCurrentIndex);\n if (((cc >= 97) && (cc <= 122)) || (cc < 34)) {\n // a-z or whitespace\n continue;\n }\n\n switch (cc) {\n case 40: // (\n parenLevel++;\n lastOpeningParen = chunkerCurrentIndex;\n continue;\n case 41: // )\n if (--parenLevel < 0) {\n return fail('missing opening `(`', chunkerCurrentIndex);\n }\n continue;\n case 59: // ;\n if (!parenLevel) { emitChunk(); }\n continue;\n case 123: // {\n level++;\n lastOpening = chunkerCurrentIndex;\n continue;\n case 125: // }\n if (--level < 0) {\n return fail('missing opening `{`', chunkerCurrentIndex);\n }\n if (!level && !parenLevel) { emitChunk(); }\n continue;\n case 92: // \\\n if (chunkerCurrentIndex < len - 1) { chunkerCurrentIndex++; continue; }\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n case 34:\n case 39:\n case 96: // \", ' and `\n matched = 0;\n currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 > 96) { continue; }\n if (cc2 == cc) { matched = 1; break; }\n if (cc2 == 92) { // \\\n if (chunkerCurrentIndex == len - 1) {\n return fail('unescaped `\\\\`', chunkerCurrentIndex);\n }\n chunkerCurrentIndex++;\n }\n }\n if (matched) { continue; }\n return fail(`unmatched \\`${String.fromCharCode(cc)}\\``, currentChunkStartIndex);\n case 47: // /, check for comment\n if (parenLevel || (chunkerCurrentIndex == len - 1)) { continue; }\n cc2 = input.charCodeAt(chunkerCurrentIndex + 1);\n if (cc2 == 47) {\n // //, find lnfeed\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if ((cc2 <= 13) && ((cc2 == 10) || (cc2 == 13))) { break; }\n }\n } else if (cc2 == 42) {\n // /*, find */\n lastMultiComment = currentChunkStartIndex = chunkerCurrentIndex;\n for (chunkerCurrentIndex = chunkerCurrentIndex + 2; chunkerCurrentIndex < len - 1; chunkerCurrentIndex++) {\n cc2 = input.charCodeAt(chunkerCurrentIndex);\n if (cc2 == 125) { lastMultiCommentEndBrace = chunkerCurrentIndex; }\n if (cc2 != 42) { continue; }\n if (input.charCodeAt(chunkerCurrentIndex + 1) == 47) { break; }\n }\n if (chunkerCurrentIndex == len - 1) {\n return fail('missing closing `*/`', currentChunkStartIndex);\n }\n chunkerCurrentIndex++;\n }\n continue;\n case 42: // *, check for unmatched */\n if ((chunkerCurrentIndex < len - 1) && (input.charCodeAt(chunkerCurrentIndex + 1) == 47)) {\n return fail('unmatched `/*`', chunkerCurrentIndex);\n }\n continue;\n }\n }\n\n if (level !== 0) {\n if ((lastMultiComment > lastOpening) && (lastMultiCommentEndBrace > lastMultiComment)) {\n return fail('missing closing `}` or `*/`', lastOpening);\n } else {\n return fail('missing closing `}`', lastOpening);\n }\n } else if (parenLevel !== 0) {\n return fail('missing closing `)`', lastOpeningParen);\n }\n\n emitChunk(true);\n return chunks;\n};\n","import LessError from '../less-error';\nimport tree from '../tree';\nimport visitors from '../visitors';\nimport getParserInput from './parser-input';\nimport * as utils from '../utils';\nimport functionRegistry from '../functions/function-registry';\n\n//\n// less.js - parser\n//\n// A relatively straight-forward predictive parser.\n// There is no tokenization/lexing stage, the input is parsed\n// in one sweep.\n//\n// To make the parser fast enough to run in the browser, several\n// optimization had to be made:\n//\n// - Matching and slicing on a huge input is often cause of slowdowns.\n// The solution is to chunkify the input into smaller strings.\n// The chunks are stored in the `chunks` var,\n// `j` holds the current chunk index, and `currentPos` holds\n// the index of the current chunk in relation to `input`.\n// This gives us an almost 4x speed-up.\n//\n// - In many cases, we don't need to match individual tokens;\n// for example, if a value doesn't hold any variables, operations\n// or dynamic references, the parser can effectively 'skip' it,\n// treating it as a literal.\n// An example would be '1px solid #000' - which evaluates to itself,\n// we don't need to know what the individual components are.\n// The drawback, of course is that you don't get the benefits of\n// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,\n// and a smaller speed-up in the code-gen.\n//\n//\n// Token matching is done with the `$` function, which either takes\n// a terminal string or regexp, or a non-terminal function to call.\n// It also takes care of moving all the indices forwards.\n//\n\nconst Parser = function Parser(context, imports, fileInfo) {\n let parsers;\n const parserInput = getParserInput();\n\n function error(msg, type) {\n throw new LessError(\n {\n index: parserInput.i,\n filename: fileInfo.filename,\n type: type || 'Syntax',\n message: msg\n },\n imports\n );\n }\n\n function expect(arg, msg) {\n // some older browsers return typeof 'function' for RegExp\n const result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);\n if (result) {\n return result;\n }\n \n error(msg || (typeof arg === 'string'\n ? `expected '${arg}' got '${parserInput.currentChar()}'`\n : 'unexpected token'));\n }\n\n // Specialization of expect()\n function expectChar(arg, msg) {\n if (parserInput.$char(arg)) {\n return arg;\n }\n error(msg || `expected '${arg}' got '${parserInput.currentChar()}'`);\n }\n\n function getDebugInfo(index) {\n const filename = fileInfo.filename;\n\n return {\n lineNumber: utils.getLocation(index, parserInput.getInput()).line + 1,\n fileName: filename\n };\n }\n\n /**\n * Used after initial parsing to create nodes on the fly\n * \n * @param {String} str - string to parse \n * @param {Array} parseList - array of parsers to run input through e.g. [\"value\", \"important\"]\n * @param {Number} currentIndex - start number to begin indexing\n * @param {Object} fileInfo - fileInfo to attach to created nodes\n */\n function parseNode(str, parseList, currentIndex, fileInfo, callback) {\n let result;\n const returnNodes = [];\n const parser = parserInput;\n\n try {\n parser.start(str, false, function fail(msg, index) {\n callback({\n message: msg,\n index: index + currentIndex\n });\n });\n for (let x = 0, p, i; (p = parseList[x]); x++) {\n i = parser.i;\n result = parsers[p]();\n if (result) {\n try {\n result._index = i + currentIndex;\n result._fileInfo = fileInfo;\n } catch (e) {}\n returnNodes.push(result);\n }\n else {\n returnNodes.push(null);\n }\n }\n\n const endInfo = parser.end();\n if (endInfo.isFinished) {\n callback(null, returnNodes);\n }\n else {\n callback(true, null);\n }\n } catch (e) {\n throw new LessError({\n index: e.index + currentIndex,\n message: e.message\n }, imports, fileInfo.filename);\n }\n }\n\n //\n // The Parser\n //\n return {\n parserInput,\n imports,\n fileInfo,\n parseNode,\n //\n // Parse an input string into an abstract syntax tree,\n // @param str A string containing 'less' markup\n // @param callback call `callback` when done.\n // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply\n //\n parse: function (str, callback, additionalData) {\n let root;\n let error = null;\n let globalVars;\n let modifyVars;\n let ignored;\n let preText = '';\n\n globalVars = (additionalData && additionalData.globalVars) ? `${Parser.serializeVars(additionalData.globalVars)}\\n` : '';\n modifyVars = (additionalData && additionalData.modifyVars) ? `\\n${Parser.serializeVars(additionalData.modifyVars)}` : '';\n\n if (context.pluginManager) {\n const preProcessors = context.pluginManager.getPreProcessors();\n for (let i = 0; i < preProcessors.length; i++) {\n str = preProcessors[i].process(str, { context, imports, fileInfo });\n }\n }\n\n if (globalVars || (additionalData && additionalData.banner)) {\n preText = ((additionalData && additionalData.banner) ? additionalData.banner : '') + globalVars;\n ignored = imports.contentsIgnoredChars;\n ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0;\n ignored[fileInfo.filename] += preText.length;\n }\n\n str = str.replace(/\\r\\n?/g, '\\n');\n // Remove potential UTF Byte Order Mark\n str = preText + str.replace(/^\\uFEFF/, '') + modifyVars;\n imports.contents[fileInfo.filename] = str;\n\n // Start with the primary rule.\n // The whole syntax tree is held under a Ruleset node,\n // with the `root` property set to true, so no `{}` are\n // output. The callback is called when the input is parsed.\n try {\n parserInput.start(str, context.chunkInput, function fail(msg, index) {\n throw new LessError({\n index,\n type: 'Parse',\n message: msg,\n filename: fileInfo.filename\n }, imports);\n });\n\n tree.Node.prototype.parse = this;\n root = new tree.Ruleset(null, this.parsers.primary());\n tree.Node.prototype.rootNode = root;\n root.root = true;\n root.firstRoot = true;\n root.functionRegistry = functionRegistry.inherit();\n \n } catch (e) {\n return callback(new LessError(e, imports, fileInfo.filename));\n }\n\n // If `i` is smaller than the `input.length - 1`,\n // it means the parser wasn't able to parse the whole\n // string, so we've got a parsing error.\n //\n // We try to extract a \\n delimited string,\n // showing the line where the parse error occurred.\n // We split it up into two parts (the part which parsed,\n // and the part which didn't), so we can color them differently.\n const endInfo = parserInput.end();\n if (!endInfo.isFinished) {\n\n let message = endInfo.furthestPossibleErrorMessage;\n\n if (!message) {\n message = 'Unrecognised input';\n if (endInfo.furthestChar === '}') {\n message += '. Possibly missing opening \\'{\\'';\n } else if (endInfo.furthestChar === ')') {\n message += '. Possibly missing opening \\'(\\'';\n } else if (endInfo.furthestReachedEnd) {\n message += '. Possibly missing something';\n }\n }\n\n error = new LessError({\n type: 'Parse',\n message,\n index: endInfo.furthest,\n filename: fileInfo.filename\n }, imports);\n }\n\n const finish = e => {\n e = error || e || imports.error;\n\n if (e) {\n if (!(e instanceof LessError)) {\n e = new LessError(e, imports, fileInfo.filename);\n }\n\n return callback(e);\n }\n else {\n return callback(null, root);\n }\n };\n\n if (context.processImports !== false) {\n new visitors.ImportVisitor(imports, finish)\n .run(root);\n } else {\n return finish();\n }\n },\n\n //\n // Here in, the parsing rules/functions\n //\n // The basic structure of the syntax tree generated is as follows:\n //\n // Ruleset -> Declaration -> Value -> Expression -> Entity\n //\n // Here's some Less code:\n //\n // .class {\n // color: #fff;\n // border: 1px solid #000;\n // width: @w + 4px;\n // > .child {...}\n // }\n //\n // And here's what the parse tree might look like:\n //\n // Ruleset (Selector '.class', [\n // Declaration (\"color\", Value ([Expression [Color #fff]]))\n // Declaration (\"border\", Value ([Expression [Dimension 1px][Keyword \"solid\"][Color #000]]))\n // Declaration (\"width\", Value ([Expression [Operation \" + \" [Variable \"@w\"][Dimension 4px]]]))\n // Ruleset (Selector [Element '>', '.child'], [...])\n // ])\n //\n // In general, most rules will try to parse a token with the `$re()` function, and if the return\n // value is truly, will return a new node, of the relevant type. Sometimes, we need to check\n // first, before parsing, that's when we use `peek()`.\n //\n parsers: parsers = {\n //\n // The `primary` rule is the *entry* and *exit* point of the parser.\n // The rules here can appear at any level of the parse tree.\n //\n // The recursive nature of the grammar is an interplay between the `block`\n // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,\n // as represented by this simplified grammar:\n //\n // primary → (ruleset | declaration)+\n // ruleset → selector+ block\n // block → '{' primary '}'\n //\n // Only at one point is the primary rule not called from the\n // block rule: at the root level.\n //\n primary: function () {\n const mixin = this.mixin;\n let root = [];\n let node;\n\n while (true) {\n while (true) {\n node = this.comment();\n if (!node) { break; }\n root.push(node);\n }\n // always process comments before deciding if finished\n if (parserInput.finished) {\n break;\n }\n if (parserInput.peek('}')) {\n break;\n }\n\n node = this.extendRule();\n if (node) {\n root = root.concat(node);\n continue;\n }\n\n node = mixin.definition() || this.declaration() || mixin.call(false, false) || \n this.ruleset() || this.variableCall() || this.entities.call() || this.atrule();\n if (node) {\n root.push(node);\n } else {\n let foundSemiColon = false;\n while (parserInput.$char(';')) {\n foundSemiColon = true;\n }\n if (!foundSemiColon) {\n break;\n }\n }\n }\n\n return root;\n },\n\n // comments are collected by the main parsing mechanism and then assigned to nodes\n // where the current structure allows it\n comment: function () {\n if (parserInput.commentStore.length) {\n const comment = parserInput.commentStore.shift();\n return new(tree.Comment)(comment.text, comment.isLineComment, comment.index, fileInfo);\n }\n },\n\n //\n // Entities are tokens which can be found inside an Expression\n //\n entities: {\n mixinLookup: function() {\n return parsers.mixin.call(true, true);\n },\n //\n // A string, which supports escaping \" and '\n //\n // \"milky way\" 'he\\'s the one!'\n //\n quoted: function (forceEscaped) {\n let str;\n const index = parserInput.i;\n let isEscaped = false;\n\n parserInput.save();\n if (parserInput.$char('~')) {\n isEscaped = true;\n } else if (forceEscaped) {\n parserInput.restore();\n return;\n }\n\n str = parserInput.$quoted();\n if (!str) {\n parserInput.restore();\n return;\n }\n parserInput.forget();\n\n return new(tree.Quoted)(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index, fileInfo);\n },\n\n //\n // A catch-all word, such as:\n //\n // black border-collapse\n //\n keyword: function () {\n const k = parserInput.$char('%') || parserInput.$re(/^\\[?(?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\\]?/);\n if (k) {\n return tree.Color.fromKeyword(k) || new(tree.Keyword)(k);\n }\n },\n\n //\n // A function call\n //\n // rgb(255, 0, 255)\n //\n // The arguments are parsed with the `entities.arguments` parser.\n //\n call: function () {\n let name;\n let args;\n let func;\n const index = parserInput.i;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (parserInput.peek(/^url\\(/i)) {\n return;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^([\\w-]+|%|progid:[\\w\\.]+)\\(/);\n if (!name) {\n parserInput.forget(); \n return;\n }\n\n name = name[1];\n func = this.customFuncCall(name);\n if (func) {\n args = func.parse();\n if (args && func.stop) {\n parserInput.forget();\n return args;\n }\n }\n\n args = this.arguments(args);\n\n if (!parserInput.$char(')')) {\n parserInput.restore('Could not parse call arguments or missing \\')\\'');\n return;\n }\n\n parserInput.forget();\n\n return new(tree.Call)(name, args, index, fileInfo);\n },\n \n //\n // Parsing rules for functions with non-standard args, e.g.:\n //\n // boolean(not(2 > 1))\n //\n // This is a quick prototype, to be modified/improved when\n // more custom-parsed funcs come (e.g. `selector(...)`)\n //\n\n customFuncCall: function (name) {\n /* Ideally the table is to be moved out of here for faster perf.,\n but it's quite tricky since it relies on all these `parsers`\n and `expect` available only here */\n return {\n alpha: f(parsers.ieAlpha, true),\n boolean: f(condition),\n 'if': f(condition)\n }[name.toLowerCase()];\n\n function f(parse, stop) {\n return {\n parse, // parsing function\n stop // when true - stop after parse() and return its result, \n // otherwise continue for plain args\n };\n }\n \n function condition() {\n return [expect(parsers.condition, 'expected condition')];\n }\n },\n\n arguments: function (prevArgs) {\n let argsComma = prevArgs || [];\n const argsSemiColon = [];\n let isSemiColonSeparated;\n let value;\n\n parserInput.save();\n\n while (true) {\n if (prevArgs) {\n prevArgs = false;\n } else {\n value = parsers.detachedRuleset() || this.assignment() || parsers.expression();\n if (!value) {\n break;\n }\n\n if (value.value && value.value.length == 1) {\n value = value.value[0];\n }\n\n argsComma.push(value);\n }\n\n if (parserInput.$char(',')) {\n continue;\n }\n\n if (parserInput.$char(';') || isSemiColonSeparated) {\n isSemiColonSeparated = true;\n value = (argsComma.length < 1) ? argsComma[0]\n : new tree.Value(argsComma);\n argsSemiColon.push(value);\n argsComma = [];\n }\n }\n\n parserInput.forget();\n return isSemiColonSeparated ? argsSemiColon : argsComma;\n },\n literal: function () {\n return this.dimension() ||\n this.color() ||\n this.quoted() ||\n this.unicodeDescriptor();\n },\n\n // Assignments are argument entities for calls.\n // They are present in ie filter properties as shown below.\n //\n // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )\n //\n\n assignment: function () {\n let key;\n let value;\n parserInput.save();\n key = parserInput.$re(/^\\w+(?=\\s?=)/i);\n if (!key) {\n parserInput.restore();\n return;\n }\n if (!parserInput.$char('=')) {\n parserInput.restore();\n return;\n }\n value = parsers.entity();\n if (value) {\n parserInput.forget();\n return new(tree.Assignment)(key, value);\n } else {\n parserInput.restore();\n }\n },\n\n //\n // Parse url() tokens\n //\n // We use a specific rule for urls, because they don't really behave like\n // standard function calls. The difference is that the argument doesn't have\n // to be enclosed within a string, so it can't be parsed as an Expression.\n //\n url: function () {\n let value;\n const index = parserInput.i;\n\n parserInput.autoCommentAbsorb = false;\n\n if (!parserInput.$str('url(')) {\n parserInput.autoCommentAbsorb = true;\n return;\n }\n\n value = this.quoted() || this.variable() || this.property() ||\n parserInput.$re(/^(?:(?:\\\\[\\(\\)'\"])|[^\\(\\)'\"])+/) || '';\n\n parserInput.autoCommentAbsorb = true;\n\n expectChar(')');\n\n return new(tree.URL)((value.value != null || \n value instanceof tree.Variable || \n value instanceof tree.Property) ?\n value : new(tree.Anonymous)(value, index), index, fileInfo);\n },\n\n //\n // A Variable entity, such as `@fink`, in\n //\n // width: @fink + 2px\n //\n // We use a different parser for variable definitions,\n // see `parsers.variable`.\n //\n variable: function () {\n let ch;\n let name;\n const index = parserInput.i;\n\n parserInput.save();\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^@@?[\\w-]+/))) {\n ch = parserInput.currentChar();\n if (ch === '(' || ch === '[' && !parserInput.prevChar().match(/^\\s/)) {\n // this may be a VariableCall lookup\n const result = parsers.variableCall(name);\n if (result) {\n parserInput.forget();\n return result;\n }\n }\n parserInput.forget();\n return new(tree.Variable)(name, index, fileInfo);\n }\n parserInput.restore();\n },\n\n // A variable entity using the protective {} e.g. @{var}\n variableCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '@' && (curly = parserInput.$re(/^@\\{([\\w-]+)\\}/))) {\n return new(tree.Variable)(`@${curly[1]}`, index, fileInfo);\n }\n },\n //\n // A Property accessor, such as `$color`, in\n //\n // background-color: $color\n //\n property: function () {\n let name;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (name = parserInput.$re(/^\\$[\\w-]+/))) {\n return new(tree.Property)(name, index, fileInfo);\n }\n },\n\n // A property entity useing the protective {} e.g. ${prop}\n propertyCurly: function () {\n let curly;\n const index = parserInput.i;\n\n if (parserInput.currentChar() === '$' && (curly = parserInput.$re(/^\\$\\{([\\w-]+)\\}/))) {\n return new(tree.Property)(`$${curly[1]}`, index, fileInfo);\n }\n },\n //\n // A Hexadecimal color\n //\n // #4F3C2F\n //\n // `rgb` and `hsl` colors are parsed through the `entities.call` parser.\n //\n color: function () {\n let rgb;\n parserInput.save();\n\n if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\\w.#\\[])?/))) {\n if (!rgb[2]) {\n parserInput.forget();\n return new(tree.Color)(rgb[1], undefined, rgb[0]);\n } \n }\n parserInput.restore();\n },\n\n colorKeyword: function () {\n parserInput.save();\n const autoCommentAbsorb = parserInput.autoCommentAbsorb;\n parserInput.autoCommentAbsorb = false;\n const k = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/);\n parserInput.autoCommentAbsorb = autoCommentAbsorb;\n if (!k) {\n parserInput.forget();\n return;\n }\n parserInput.restore();\n const color = tree.Color.fromKeyword(k);\n if (color) {\n parserInput.$str(k);\n return color;\n }\n },\n\n //\n // A Dimension, that is, a number and a unit\n //\n // 0.5em 95%\n //\n dimension: function () {\n if (parserInput.peekNotNumeric()) {\n return;\n }\n\n const value = parserInput.$re(/^([+-]?\\d*\\.?\\d+)(%|[a-z_]+)?/i);\n if (value) {\n return new(tree.Dimension)(value[1], value[2]);\n }\n },\n\n //\n // A unicode descriptor, as is used in unicode-range\n //\n // U+0?? or U+00A1-00A9\n //\n unicodeDescriptor: function () {\n let ud;\n\n ud = parserInput.$re(/^U\\+[0-9a-fA-F?]+(\\-[0-9a-fA-F?]+)?/);\n if (ud) {\n return new(tree.UnicodeDescriptor)(ud[0]);\n }\n },\n\n //\n // JavaScript code to be evaluated\n //\n // `window.location.href`\n //\n javascript: function () {\n let js;\n const index = parserInput.i;\n\n parserInput.save();\n\n const escape = parserInput.$char('~');\n const jsQuote = parserInput.$char('`');\n\n if (!jsQuote) {\n parserInput.restore();\n return;\n }\n\n js = parserInput.$re(/^[^`]*`/);\n if (js) {\n parserInput.forget();\n return new(tree.JavaScript)(js.substr(0, js.length - 1), Boolean(escape), index, fileInfo);\n }\n parserInput.restore('invalid javascript definition');\n }\n },\n\n //\n // The variable part of a variable definition. Used in the `rule` parser\n //\n // @fink:\n //\n variable: function () {\n let name;\n\n if (parserInput.currentChar() === '@' && (name = parserInput.$re(/^(@[\\w-]+)\\s*:/))) { return name[1]; }\n },\n\n //\n // Call a variable value to retrieve a detached ruleset\n // or a value from a detached ruleset's rules.\n //\n // @fink();\n // @fink;\n // color: @fink[@color];\n //\n variableCall: function (parsedName) {\n let lookups;\n const i = parserInput.i;\n const inValue = !!parsedName;\n let name = parsedName;\n\n parserInput.save();\n\n if (name || (parserInput.currentChar() === '@'\n && (name = parserInput.$re(/^(@[\\w-]+)(\\(\\s*\\))?/)))) {\n\n lookups = this.mixin.ruleLookups();\n\n if (!lookups && ((inValue && parserInput.$str('()') !== '()') || (name[2] !== '()'))) {\n parserInput.restore('Missing \\'[...]\\' lookup in variable call');\n return;\n }\n\n if (!inValue) {\n name = name[1];\n }\n\n const call = new tree.VariableCall(name, i, fileInfo);\n if (!inValue && parsers.end()) {\n parserInput.forget();\n return call;\n }\n else {\n parserInput.forget();\n return new tree.NamespaceValue(call, lookups, i, fileInfo);\n }\n }\n\n parserInput.restore();\n },\n\n //\n // extend syntax - used to extend selectors\n //\n extend: function(isRule) {\n let elements;\n let e;\n const index = parserInput.i;\n let option;\n let extendList;\n let extend;\n\n if (!parserInput.$str(isRule ? '&:extend(' : ':extend(')) {\n return;\n }\n\n do {\n option = null;\n elements = null;\n while (!(option = parserInput.$re(/^(all)(?=\\s*(\\)|,))/))) {\n e = this.element();\n if (!e) {\n break;\n }\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n }\n\n option = option && option[1];\n if (!elements) {\n error('Missing target selector for :extend().');\n }\n extend = new(tree.Extend)(new(tree.Selector)(elements), option, index, fileInfo);\n if (extendList) {\n extendList.push(extend);\n } else {\n extendList = [ extend ];\n }\n } while (parserInput.$char(','));\n\n expect(/^\\)/);\n\n if (isRule) {\n expect(/^;/);\n }\n\n return extendList;\n },\n\n //\n // extendRule - used in a rule to extend all the parent selectors\n //\n extendRule: function() {\n return this.extend(true);\n },\n\n //\n // Mixins\n //\n mixin: {\n //\n // A Mixin call, with an optional argument list\n //\n // #mixins > .square(#fff);\n // #mixins.square(#fff);\n // .rounded(4px, black);\n // .button;\n //\n // We can lookup / return a value using the lookup syntax:\n //\n // color: #mixin.square(#fff)[@color];\n //\n // The `while` loop is there because mixins can be\n // namespaced, but we only support the child and descendant\n // selector for now.\n //\n call: function (inValue, getLookup) {\n const s = parserInput.currentChar();\n let important = false;\n let lookups;\n const index = parserInput.i;\n let elements;\n let args;\n let hasParens;\n\n if (s !== '.' && s !== '#') { return; }\n\n parserInput.save(); // stop us absorbing part of an invalid selector\n\n elements = this.elements();\n\n if (elements) {\n if (parserInput.$char('(')) {\n args = this.args(true).args;\n expectChar(')');\n hasParens = true;\n }\n\n if (getLookup !== false) {\n lookups = this.ruleLookups();\n }\n if (getLookup === true && !lookups) {\n parserInput.restore();\n return;\n }\n\n if (inValue && !lookups && !hasParens) {\n // This isn't a valid in-value mixin call\n parserInput.restore();\n return;\n }\n\n if (!inValue && parsers.important()) {\n important = true;\n }\n\n if (inValue || parsers.end()) {\n parserInput.forget();\n const mixin = new(tree.mixin.Call)(elements, args, index, fileInfo, !lookups && important);\n if (lookups) {\n return new tree.NamespaceValue(mixin, lookups);\n }\n else {\n return mixin;\n }\n }\n }\n\n parserInput.restore();\n },\n /**\n * Matching elements for mixins\n * (Start with . or # and can have > )\n */\n elements: function() {\n let elements;\n let e;\n let c;\n let elem;\n let elemIndex;\n const re = /^[#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/;\n while (true) {\n elemIndex = parserInput.i;\n e = parserInput.$re(re);\n \n if (!e) {\n break;\n }\n elem = new(tree.Element)(c, e, false, elemIndex, fileInfo);\n if (elements) {\n elements.push(elem);\n } else {\n elements = [ elem ];\n }\n c = parserInput.$char('>');\n }\n return elements;\n },\n args: function (isCall) {\n const entities = parsers.entities;\n const returner = { args:null, variadic: false };\n let expressions = [];\n const argsSemiColon = [];\n const argsComma = [];\n let isSemiColonSeparated;\n let expressionContainsNamed;\n let name;\n let nameLoop;\n let value;\n let arg;\n let expand;\n let hasSep = true;\n\n parserInput.save();\n\n while (true) {\n if (isCall) {\n arg = parsers.detachedRuleset() || parsers.expression();\n } else {\n parserInput.commentStore.length = 0;\n if (parserInput.$str('...')) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ variadic: true });\n break;\n }\n arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);\n }\n\n if (!arg || !hasSep) {\n break;\n }\n\n nameLoop = null;\n if (arg.throwAwayComments) {\n arg.throwAwayComments();\n }\n value = arg;\n let val = null;\n\n if (isCall) {\n // Variable\n if (arg.value && arg.value.length == 1) {\n val = arg.value[0];\n }\n } else {\n val = arg;\n }\n\n if (val && (val instanceof tree.Variable || val instanceof tree.Property)) {\n if (parserInput.$char(':')) {\n if (expressions.length > 0) {\n if (isSemiColonSeparated) {\n error('Cannot mix ; and , as delimiter types');\n }\n expressionContainsNamed = true;\n }\n\n value = parsers.detachedRuleset() || parsers.expression();\n\n if (!value) {\n if (isCall) {\n error('could not understand value for named argument');\n } else {\n parserInput.restore();\n returner.args = [];\n return returner;\n }\n }\n nameLoop = (name = val.name);\n } else if (parserInput.$str('...')) {\n if (!isCall) {\n returner.variadic = true;\n if (parserInput.$char(';') && !isSemiColonSeparated) {\n isSemiColonSeparated = true;\n }\n (isSemiColonSeparated ? argsSemiColon : argsComma)\n .push({ name: arg.name, variadic: true });\n break;\n } else {\n expand = true;\n }\n } else if (!isCall) {\n name = nameLoop = val.name;\n value = null;\n }\n }\n\n if (value) {\n expressions.push(value);\n }\n\n argsComma.push({ name:nameLoop, value, expand });\n\n if (parserInput.$char(',')) {\n hasSep = true;\n continue;\n }\n hasSep = parserInput.$char(';') === ';';\n\n if (hasSep || isSemiColonSeparated) {\n\n if (expressionContainsNamed) {\n error('Cannot mix ; and , as delimiter types');\n }\n\n isSemiColonSeparated = true;\n\n if (expressions.length > 1) {\n value = new(tree.Value)(expressions);\n }\n argsSemiColon.push({ name, value, expand });\n\n name = null;\n expressions = [];\n expressionContainsNamed = false;\n }\n }\n\n parserInput.forget();\n returner.args = isSemiColonSeparated ? argsSemiColon : argsComma;\n return returner;\n },\n //\n // A Mixin definition, with a list of parameters\n //\n // .rounded (@radius: 2px, @color) {\n // ...\n // }\n //\n // Until we have a finer grained state-machine, we have to\n // do a look-ahead, to make sure we don't have a mixin call.\n // See the `rule` function for more information.\n //\n // We start by matching `.rounded (`, and then proceed on to\n // the argument list, which has optional default values.\n // We store the parameters in `params`, with a `value` key,\n // if there is a value, such as in the case of `@radius`.\n //\n // Once we've got our params list, and a closing `)`, we parse\n // the `{...}` block.\n //\n definition: function () {\n let name;\n let params = [];\n let match;\n let ruleset;\n let cond;\n let variadic = false;\n if ((parserInput.currentChar() !== '.' && parserInput.currentChar() !== '#') ||\n parserInput.peek(/^[^{]*\\}/)) {\n return;\n }\n\n parserInput.save();\n\n match = parserInput.$re(/^([#.](?:[\\w-]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\\s*\\(/);\n if (match) {\n name = match[1];\n\n const argInfo = this.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n\n // .mixincall(\"@{a}\");\n // looks a bit like a mixin definition..\n // also\n // .mixincall(@a: {rule: set;});\n // so we have to be nice and restore\n if (!parserInput.$char(')')) {\n parserInput.restore('Missing closing \\')\\'');\n return;\n }\n\n parserInput.commentStore.length = 0;\n\n if (parserInput.$str('when')) { // Guard\n cond = expect(parsers.conditions, 'expected condition');\n }\n\n ruleset = parsers.block();\n\n if (ruleset) {\n parserInput.forget();\n return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);\n } else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n \n ruleLookups: function() {\n let rule;\n let args;\n const lookups = [];\n\n if (parserInput.currentChar() !== '[') { \n return;\n }\n\n while (true) {\n parserInput.save();\n args = null;\n rule = this.lookupValue();\n if (!rule && rule !== '') {\n parserInput.restore();\n break;\n }\n lookups.push(rule);\n parserInput.forget();\n }\n if (lookups.length > 0) {\n return lookups;\n }\n },\n \n lookupValue: function() {\n parserInput.save();\n \n if (!parserInput.$char('[')) { \n parserInput.restore();\n return;\n }\n \n const name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/);\n \n if (!parserInput.$char(']')) {\n parserInput.restore();\n return;\n } \n\n if (name || name === '') {\n parserInput.forget();\n return name;\n }\n \n parserInput.restore();\n }\n },\n //\n // Entities are the smallest recognized token,\n // and can be found inside a rule's value.\n //\n entity: function () {\n const entities = this.entities;\n\n return this.comment() || entities.literal() || entities.variable() || entities.url() ||\n entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) ||\n entities.javascript();\n },\n\n //\n // A Declaration terminator. Note that we use `peek()` to check for '}',\n // because the `block` rule will be expecting it, but we still need to make sure\n // it's there, if ';' was omitted.\n //\n end: function () {\n return parserInput.$char(';') || parserInput.peek('}');\n },\n\n //\n // IE's alpha function\n //\n // alpha(opacity=88)\n //\n ieAlpha: function () {\n let value;\n\n // http://jsperf.com/case-insensitive-regex-vs-strtolower-then-regex/18\n if (!parserInput.$re(/^opacity=/i)) { return; }\n value = parserInput.$re(/^\\d+/);\n if (!value) {\n value = expect(parsers.entities.variable, 'Could not parse alpha');\n value = `@{${value.name.slice(1)}}`;\n }\n expectChar(')');\n return new tree.Quoted('', `alpha(opacity=${value})`);\n },\n\n //\n // A Selector Element\n //\n // div\n // + h1\n // #socks\n // input[type=\"text\"]\n //\n // Elements are the building blocks for Selectors,\n // they are made out of a `Combinator` (see combinator rule),\n // and an element name, such as a tag a class, or `*`.\n //\n element: function () {\n let e;\n let c;\n let v;\n const index = parserInput.i;\n\n c = this.combinator();\n\n e = parserInput.$re(/^(?:\\d+\\.\\d+|\\d+)%/) ||\n parserInput.$re(/^(?:[.#]?|:*)(?:[\\w-]|[^\\x00-\\x9f]|\\\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||\n parserInput.$char('*') || parserInput.$char('&') || this.attribute() ||\n parserInput.$re(/^\\([^&()@]+\\)/) || parserInput.$re(/^[\\.#:](?=@)/) ||\n this.entities.variableCurly();\n\n if (!e) {\n parserInput.save();\n if (parserInput.$char('(')) {\n if ((v = this.selector(false)) && parserInput.$char(')')) {\n e = new(tree.Paren)(v);\n parserInput.forget();\n } else {\n parserInput.restore('Missing closing \\')\\'');\n }\n } else {\n parserInput.forget();\n }\n }\n\n if (e) { return new(tree.Element)(c, e, e instanceof tree.Variable, index, fileInfo); }\n },\n\n //\n // Combinators combine elements together, in a Selector.\n //\n // Because our parser isn't white-space sensitive, special care\n // has to be taken, when parsing the descendant combinator, ` `,\n // as it's an empty space. We have to check the previous character\n // in the input, to see if it's a ` ` character. More info on how\n // we deal with this in *combinator.js*.\n //\n combinator: function () {\n let c = parserInput.currentChar();\n\n if (c === '/') {\n parserInput.save();\n const slashedCombinator = parserInput.$re(/^\\/[a-z]+\\//i);\n if (slashedCombinator) {\n parserInput.forget();\n return new(tree.Combinator)(slashedCombinator);\n }\n parserInput.restore();\n }\n\n if (c === '>' || c === '+' || c === '~' || c === '|' || c === '^') {\n parserInput.i++;\n if (c === '^' && parserInput.currentChar() === '^') {\n c = '^^';\n parserInput.i++;\n }\n while (parserInput.isWhitespace()) { parserInput.i++; }\n return new(tree.Combinator)(c);\n } else if (parserInput.isWhitespace(-1)) {\n return new(tree.Combinator)(' ');\n } else {\n return new(tree.Combinator)(null);\n }\n },\n //\n // A CSS Selector\n // with less extensions e.g. the ability to extend and guard\n //\n // .class > div + h1\n // li a:hover\n //\n // Selectors are made out of one or more Elements, see above.\n //\n selector: function (isLess) {\n const index = parserInput.i;\n let elements;\n let extendList;\n let c;\n let e;\n let allExtends;\n let when;\n let condition;\n isLess = isLess !== false;\n while ((isLess && (extendList = this.extend())) || (isLess && (when = parserInput.$str('when'))) || (e = this.element())) {\n if (when) {\n condition = expect(this.conditions, 'expected condition');\n } else if (condition) {\n error('CSS guard can only be used at the end of selector');\n } else if (extendList) {\n if (allExtends) {\n allExtends = allExtends.concat(extendList);\n } else {\n allExtends = extendList;\n }\n } else {\n if (allExtends) { error('Extend can only be used at the end of selector'); }\n c = parserInput.currentChar();\n if (elements) {\n elements.push(e);\n } else {\n elements = [ e ];\n }\n e = null;\n }\n if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') {\n break;\n }\n }\n\n if (elements) { return new(tree.Selector)(elements, allExtends, condition, index, fileInfo); }\n if (allExtends) { error('Extend must be used to extend a selector, it cannot be used on its own'); }\n },\n selectors: function () {\n let s;\n let selectors;\n while (true) {\n s = this.selector();\n if (!s) {\n break;\n }\n if (selectors) {\n selectors.push(s);\n } else {\n selectors = [ s ];\n }\n parserInput.commentStore.length = 0;\n if (s.condition && selectors.length > 1) {\n error(\"Guards are only currently allowed on a single selector.\");\n }\n if (!parserInput.$char(',')) { break; }\n if (s.condition) {\n error(\"Guards are only currently allowed on a single selector.\");\n }\n parserInput.commentStore.length = 0;\n }\n return selectors;\n },\n attribute: function () {\n if (!parserInput.$char('[')) { return; }\n\n const entities = this.entities;\n let key;\n let val;\n let op;\n\n if (!(key = entities.variableCurly())) {\n key = expect(/^(?:[_A-Za-z0-9-\\*]*\\|)?(?:[_A-Za-z0-9-]|\\\\.)+/);\n }\n\n op = parserInput.$re(/^[|~*$^]?=/);\n if (op) {\n val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\\w-]+/) || entities.variableCurly();\n }\n\n expectChar(']');\n\n return new(tree.Attribute)(key, op, val);\n },\n\n //\n // The `block` rule is used by `ruleset` and `mixin.definition`.\n // It's a wrapper around the `primary` rule, with added `{}`.\n //\n block: function () {\n let content;\n if (parserInput.$char('{') && (content = this.primary()) && parserInput.$char('}')) {\n return content;\n }\n },\n\n blockRuleset: function() {\n let block = this.block();\n\n if (block) {\n block = new tree.Ruleset(null, block);\n }\n return block;\n },\n\n detachedRuleset: function() {\n let argInfo;\n let params;\n let variadic;\n\n parserInput.save();\n if (parserInput.$re(/^[.#]\\(/)) {\n /**\n * DR args currently only implemented for each() function, and not \n * yet settable as `@dr: #(@arg) {}`\n * This should be done when DRs are merged with mixins.\n * See: https://github.com/less/less-meta/issues/16\n */\n argInfo = this.mixin.args(false);\n params = argInfo.args;\n variadic = argInfo.variadic;\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return;\n }\n }\n const blockRuleset = this.blockRuleset();\n if (blockRuleset) {\n parserInput.forget();\n if (params) {\n return new tree.mixin.Definition(null, params, blockRuleset, null, variadic);\n }\n return new tree.DetachedRuleset(blockRuleset);\n }\n parserInput.restore();\n },\n\n //\n // div, .class, body > p {...}\n //\n ruleset: function () {\n let selectors;\n let rules;\n let debugInfo;\n\n parserInput.save();\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(parserInput.i);\n }\n\n selectors = this.selectors();\n\n if (selectors && (rules = this.block())) {\n parserInput.forget();\n const ruleset = new(tree.Ruleset)(selectors, rules, context.strictImports);\n if (context.dumpLineNumbers) {\n ruleset.debugInfo = debugInfo;\n }\n return ruleset;\n } else {\n parserInput.restore();\n }\n },\n declaration: function () {\n let name;\n let value;\n const index = parserInput.i;\n let hasDR;\n const c = parserInput.currentChar();\n let important;\n let merge;\n let isVariable;\n\n if (c === '.' || c === '#' || c === '&' || c === ':') { return; }\n\n parserInput.save();\n\n name = this.variable() || this.ruleProperty();\n if (name) {\n isVariable = typeof name === 'string';\n\n if (isVariable) {\n value = this.detachedRuleset();\n if (value) {\n hasDR = true;\n }\n }\n\n parserInput.commentStore.length = 0;\n if (!value) {\n // a name returned by this.ruleProperty() is always an array of the form:\n // [string-1, ..., string-n, \"\"] or [string-1, ..., string-n, \"+\"]\n // where each item is a tree.Keyword or tree.Variable\n merge = !isVariable && name.length > 1 && name.pop().value;\n\n // Custom property values get permissive parsing\n if (name[0].value && name[0].value.slice(0, 2) === '--') {\n value = this.permissiveValue();\n }\n // Try to store values as anonymous\n // If we need the value later we'll re-parse it in ruleset.parseValue\n else {\n value = this.anonymousValue();\n }\n if (value) {\n parserInput.forget();\n // anonymous values absorb the end ';' which is required for them to work\n return new(tree.Declaration)(name, value, false, merge, index, fileInfo);\n }\n\n if (!value) {\n value = this.value();\n }\n\n if (value) {\n important = this.important();\n } else if (isVariable) {\n // As a last resort, try permissiveValue\n value = this.permissiveValue();\n }\n }\n\n if (value && (this.end() || hasDR)) {\n parserInput.forget();\n return new(tree.Declaration)(name, value, important, merge, index, fileInfo);\n }\n else {\n parserInput.restore();\n }\n } else {\n parserInput.restore();\n }\n },\n anonymousValue: function () {\n const index = parserInput.i;\n const match = parserInput.$re(/^([^.#@\\$+\\/'\"*`(;{}-]*);/);\n if (match) {\n return new(tree.Anonymous)(match[1], index);\n }\n },\n /**\n * Used for custom properties, at-rules, and variables (as fallback)\n * Parses almost anything inside of {} [] () \"\" blocks\n * until it reaches outer-most tokens.\n * \n * First, it will try to parse comments and entities to reach\n * the end. This is mostly like the Expression parser except no\n * math is allowed.\n */\n permissiveValue: function (untilTokens) {\n let i;\n let e;\n let done;\n let value;\n const tok = untilTokens || ';';\n const index = parserInput.i;\n const result = [];\n\n function testCurrentChar() {\n const char = parserInput.currentChar();\n if (typeof tok === 'string') {\n return char === tok;\n } else {\n return tok.test(char);\n }\n }\n if (testCurrentChar()) {\n return;\n }\n value = [];\n do {\n e = this.comment();\n if (e) {\n value.push(e);\n continue;\n }\n e = this.entity();\n if (e) {\n value.push(e);\n }\n } while (e);\n\n done = testCurrentChar();\n\n if (value.length > 0) {\n value = new(tree.Expression)(value);\n if (done) {\n return value;\n }\n else {\n result.push(value);\n }\n // Preserve space before $parseUntil as it will not\n if (parserInput.prevChar() === ' ') {\n result.push(new tree.Anonymous(' ', index));\n }\n }\n parserInput.save();\n\n value = parserInput.$parseUntil(tok);\n\n if (value) {\n if (typeof value === 'string') {\n error(`Expected '${value}'`, 'Parse');\n }\n if (value.length === 1 && value[0] === ' ') {\n parserInput.forget();\n return new tree.Anonymous('', index);\n }\n let item;\n for (i = 0; i < value.length; i++) {\n item = value[i];\n if (Array.isArray(item)) {\n // Treat actual quotes as normal quoted values\n result.push(new tree.Quoted(item[0], item[1], true, index, fileInfo));\n }\n else {\n if (i === value.length - 1) {\n item = item.trim();\n }\n // Treat like quoted values, but replace vars like unquoted expressions\n const quote = new tree.Quoted('\\'', item, true, index, fileInfo);\n quote.variableRegex = /@([\\w-]+)/g;\n quote.propRegex = /\\$([\\w-]+)/g;\n result.push(quote);\n }\n }\n parserInput.forget();\n return new tree.Expression(result, true);\n }\n parserInput.restore();\n },\n\n //\n // An @import atrule\n //\n // @import \"lib\";\n //\n // Depending on our environment, importing is done differently:\n // In the browser, it's an XHR request, in Node, it would be a\n // file-system operation. The function used for importing is\n // stored in `import`, which we pass to the Import constructor.\n //\n 'import': function () {\n let path;\n let features;\n const index = parserInput.i;\n\n const dir = parserInput.$re(/^@import?\\s+/);\n\n if (dir) {\n const options = (dir ? this.importOptions() : null) || {};\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n features = this.mediaFeatures();\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon or unrecognised media features on import');\n }\n features = features && new(tree.Value)(features);\n return new(tree.Import)(path, features, options, index, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed import statement');\n }\n }\n },\n\n importOptions: function() {\n let o;\n const options = {};\n let optionName;\n let value;\n\n // list of options, surrounded by parens\n if (!parserInput.$char('(')) { return null; }\n do {\n o = this.importOption();\n if (o) {\n optionName = o;\n value = true;\n switch (optionName) {\n case 'css':\n optionName = 'less';\n value = false;\n break;\n case 'once':\n optionName = 'multiple';\n value = false;\n break;\n }\n options[optionName] = value;\n if (!parserInput.$char(',')) { break; }\n }\n } while (o);\n expectChar(')');\n return options;\n },\n\n importOption: function() {\n const opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/);\n if (opt) {\n return opt[1];\n }\n },\n\n mediaFeature: function () {\n const entities = this.entities;\n const nodes = [];\n let e;\n let p;\n parserInput.save();\n do {\n e = entities.keyword() || entities.variable() || entities.mixinLookup();\n if (e) {\n nodes.push(e);\n } else if (parserInput.$char('(')) {\n p = this.property();\n e = this.value();\n if (parserInput.$char(')')) {\n if (p && e) {\n nodes.push(new(tree.Paren)(new(tree.Declaration)(p, e, null, null, parserInput.i, fileInfo, true)));\n } else if (e) {\n nodes.push(new(tree.Paren)(e));\n } else {\n error('badly formed media feature definition');\n }\n } else {\n error('Missing closing \\')\\'', 'Parse');\n }\n }\n } while (e);\n\n parserInput.forget();\n if (nodes.length > 0) {\n return new(tree.Expression)(nodes);\n }\n },\n\n mediaFeatures: function () {\n const entities = this.entities;\n const features = [];\n let e;\n do {\n e = this.mediaFeature();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n } else {\n e = entities.variable() || entities.mixinLookup();\n if (e) {\n features.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n }\n } while (e);\n\n return features.length > 0 ? features : null;\n },\n\n media: function () {\n let features;\n let rules;\n let media;\n let debugInfo;\n const index = parserInput.i;\n\n if (context.dumpLineNumbers) {\n debugInfo = getDebugInfo(index);\n }\n\n parserInput.save();\n\n if (parserInput.$str('@media')) {\n features = this.mediaFeatures();\n\n rules = this.block();\n\n if (!rules) {\n error('media definitions require block statements after any features');\n }\n\n parserInput.forget();\n\n media = new(tree.Media)(rules, features, index, fileInfo);\n if (context.dumpLineNumbers) {\n media.debugInfo = debugInfo;\n }\n\n return media;\n }\n\n parserInput.restore();\n },\n\n //\n\n // A @plugin directive, used to import plugins dynamically.\n //\n // @plugin (args) \"lib\";\n //\n plugin: function () {\n let path;\n let args;\n let options;\n const index = parserInput.i;\n const dir = parserInput.$re(/^@plugin?\\s+/);\n\n if (dir) {\n args = this.pluginArgs();\n\n if (args) {\n options = {\n pluginArgs: args,\n isPlugin: true\n };\n }\n else {\n options = { isPlugin: true };\n }\n\n if ((path = this.entities.quoted() || this.entities.url())) {\n\n if (!parserInput.$char(';')) {\n parserInput.i = index;\n error('missing semi-colon on @plugin');\n }\n return new(tree.Import)(path, null, options, index, fileInfo);\n }\n else {\n parserInput.i = index;\n error('malformed @plugin statement');\n }\n }\n },\n\n pluginArgs: function() {\n // list of options, surrounded by parens\n parserInput.save();\n if (!parserInput.$char('(')) {\n parserInput.restore();\n return null;\n }\n const args = parserInput.$re(/^\\s*([^\\);]+)\\)\\s*/);\n if (args[1]) {\n parserInput.forget();\n return args[1].trim();\n }\n else { \n parserInput.restore();\n return null;\n }\n },\n\n //\n // A CSS AtRule\n //\n // @charset \"utf-8\";\n //\n atrule: function () {\n const index = parserInput.i;\n let name;\n let value;\n let rules;\n let nonVendorSpecificName;\n let hasIdentifier;\n let hasExpression;\n let hasUnknown;\n let hasBlock = true;\n let isRooted = true;\n\n if (parserInput.currentChar() !== '@') { return; }\n\n value = this['import']() || this.plugin() || this.media();\n if (value) {\n return value;\n }\n\n parserInput.save();\n\n name = parserInput.$re(/^@[a-z-]+/);\n\n if (!name) { return; }\n\n nonVendorSpecificName = name;\n if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {\n nonVendorSpecificName = `@${name.slice(name.indexOf('-', 2) + 1)}`;\n }\n\n switch (nonVendorSpecificName) {\n case '@charset':\n hasIdentifier = true;\n hasBlock = false;\n break;\n case '@namespace':\n hasExpression = true;\n hasBlock = false;\n break;\n case '@keyframes':\n case '@counter-style':\n hasIdentifier = true;\n break;\n case '@document':\n case '@supports':\n hasUnknown = true;\n isRooted = false;\n break;\n default:\n hasUnknown = true;\n break;\n }\n\n parserInput.commentStore.length = 0;\n\n if (hasIdentifier) {\n value = this.entity();\n if (!value) {\n error(`expected ${name} identifier`);\n }\n } else if (hasExpression) {\n value = this.expression();\n if (!value) {\n error(`expected ${name} expression`);\n }\n } else if (hasUnknown) {\n value = this.permissiveValue(/^[{;]/);\n hasBlock = (parserInput.currentChar() === '{');\n if (!value) {\n if (!hasBlock && parserInput.currentChar() !== ';') {\n error(`${name} rule is missing block or ending semi-colon`);\n }\n }\n else if (!value.value) {\n value = null;\n }\n }\n\n if (hasBlock) {\n rules = this.blockRuleset();\n }\n\n if (rules || (!hasBlock && value && parserInput.$char(';'))) {\n parserInput.forget();\n return new(tree.AtRule)(name, value, rules, index, fileInfo,\n context.dumpLineNumbers ? getDebugInfo(index) : null,\n isRooted\n );\n }\n\n parserInput.restore('at-rule options not recognised');\n },\n\n //\n // A Value is a comma-delimited list of Expressions\n //\n // font-family: Baskerville, Georgia, serif;\n //\n // In a Rule, a Value represents everything after the `:`,\n // and before the `;`.\n //\n value: function () {\n let e;\n const expressions = [];\n const index = parserInput.i;\n\n do {\n e = this.expression();\n if (e) {\n expressions.push(e);\n if (!parserInput.$char(',')) { break; }\n }\n } while (e);\n\n if (expressions.length > 0) {\n return new(tree.Value)(expressions, index);\n }\n },\n important: function () {\n if (parserInput.currentChar() === '!') {\n return parserInput.$re(/^! *important/);\n }\n },\n sub: function () {\n let a;\n let e;\n\n parserInput.save();\n if (parserInput.$char('(')) {\n a = this.addition();\n if (a && parserInput.$char(')')) {\n parserInput.forget();\n e = new(tree.Expression)([a]);\n e.parens = true;\n return e;\n }\n parserInput.restore('Expected \\')\\'');\n return;\n }\n parserInput.restore();\n },\n multiplication: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.operand();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n if (parserInput.peek(/^\\/[*\\/]/)) {\n break;\n }\n\n parserInput.save();\n\n op = parserInput.$char('/') || parserInput.$char('*') || parserInput.$str('./');\n\n if (!op) { parserInput.forget(); break; }\n\n a = this.operand();\n\n if (!a) { parserInput.restore(); break; }\n parserInput.forget();\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n addition: function () {\n let m;\n let a;\n let op;\n let operation;\n let isSpaced;\n m = this.multiplication();\n if (m) {\n isSpaced = parserInput.isWhitespace(-1);\n while (true) {\n op = parserInput.$re(/^[-+]\\s+/) || (!isSpaced && (parserInput.$char('+') || parserInput.$char('-')));\n if (!op) {\n break;\n }\n a = this.multiplication();\n if (!a) {\n break;\n }\n\n m.parensInOp = true;\n a.parensInOp = true;\n operation = new(tree.Operation)(op, [operation || m, a], isSpaced);\n isSpaced = parserInput.isWhitespace(-1);\n }\n return operation || m;\n }\n },\n conditions: function () {\n let a;\n let b;\n const index = parserInput.i;\n let condition;\n\n a = this.condition(true);\n if (a) {\n while (true) {\n if (!parserInput.peek(/^,\\s*(not\\s*)?\\(/) || !parserInput.$char(',')) {\n break;\n }\n b = this.condition(true);\n if (!b) {\n break;\n }\n condition = new(tree.Condition)('or', condition || a, b, index);\n }\n return condition || a;\n }\n },\n condition: function (needsParens) {\n let result;\n let logical;\n let next;\n function or() {\n return parserInput.$str('or');\n }\n\n result = this.conditionAnd(needsParens);\n if (!result) {\n return ;\n }\n logical = or();\n if (logical) {\n next = this.condition(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n conditionAnd: function (needsParens) {\n let result;\n let logical;\n let next;\n const self = this;\n function insideCondition() {\n const cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);\n if (!cond && !needsParens) {\n return self.atomicCondition(needsParens);\n }\n return cond;\n }\n function and() {\n return parserInput.$str('and');\n }\n\n result = insideCondition();\n if (!result) {\n return ;\n }\n logical = and();\n if (logical) {\n next = this.conditionAnd(needsParens);\n if (next) {\n result = new(tree.Condition)(logical, result, next);\n } else {\n return ;\n }\n }\n return result;\n },\n negatedCondition: function (needsParens) {\n if (parserInput.$str('not')) {\n const result = this.parenthesisCondition(needsParens);\n if (result) {\n result.negate = !result.negate;\n }\n return result;\n }\n },\n parenthesisCondition: function (needsParens) {\n function tryConditionFollowedByParenthesis(me) {\n let body;\n parserInput.save();\n body = me.condition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore();\n return ;\n }\n parserInput.forget();\n return body;\n }\n\n let body;\n parserInput.save();\n if (!parserInput.$str('(')) {\n parserInput.restore();\n return ;\n }\n body = tryConditionFollowedByParenthesis(this);\n if (body) {\n parserInput.forget();\n return body;\n }\n\n body = this.atomicCondition(needsParens);\n if (!body) {\n parserInput.restore();\n return ;\n }\n if (!parserInput.$char(')')) {\n parserInput.restore(`expected ')' got '${parserInput.currentChar()}'`);\n return ;\n }\n parserInput.forget();\n return body;\n },\n atomicCondition: function (needsParens) {\n const entities = this.entities;\n const index = parserInput.i;\n let a;\n let b;\n let c;\n let op;\n\n function cond() {\n return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup();\n }\n cond = cond.bind(this);\n\n a = cond();\n if (a) {\n if (parserInput.$char('>')) {\n if (parserInput.$char('=')) {\n op = '>=';\n } else {\n op = '>';\n }\n } else\n if (parserInput.$char('<')) {\n if (parserInput.$char('=')) {\n op = '<=';\n } else {\n op = '<';\n }\n } else\n if (parserInput.$char('=')) {\n if (parserInput.$char('>')) {\n op = '=>';\n } else if (parserInput.$char('<')) {\n op = '=<';\n } else {\n op = '=';\n }\n }\n if (op) {\n b = cond();\n if (b) {\n c = new(tree.Condition)(op, a, b, index, false);\n } else {\n error('expected expression');\n }\n } else {\n c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index, false);\n }\n return c;\n }\n },\n\n //\n // An operand is anything that can be part of an operation,\n // such as a Color, or a Variable\n //\n operand: function () {\n const entities = this.entities;\n let negate;\n\n if (parserInput.peek(/^-[@\\$\\(]/)) {\n negate = parserInput.$char('-');\n }\n\n let o = this.sub() || entities.dimension() ||\n entities.color() || entities.variable() ||\n entities.property() || entities.call() ||\n entities.quoted(true) || entities.colorKeyword() ||\n entities.mixinLookup();\n\n if (negate) {\n o.parensInOp = true;\n o = new(tree.Negative)(o);\n }\n\n return o;\n },\n\n //\n // Expressions either represent mathematical operations,\n // or white-space delimited Entities.\n //\n // 1px solid black\n // @var * 2\n //\n expression: function () {\n const entities = [];\n let e;\n let delim;\n const index = parserInput.i;\n\n do {\n e = this.comment();\n if (e) {\n entities.push(e);\n continue;\n }\n e = this.addition() || this.entity();\n\n if (e instanceof tree.Comment) {\n e = null;\n }\n\n if (e) {\n entities.push(e);\n // operations do not allow keyword \"/\" dimension (e.g. small/20px) so we support that here\n if (!parserInput.peek(/^\\/[\\/*]/)) {\n delim = parserInput.$char('/');\n if (delim) {\n entities.push(new(tree.Anonymous)(delim, index));\n }\n }\n }\n } while (e);\n if (entities.length > 0) {\n return new(tree.Expression)(entities);\n }\n },\n property: function () {\n const name = parserInput.$re(/^(\\*?-?[_a-zA-Z0-9-]+)\\s*:/);\n if (name) {\n return name[1];\n }\n },\n ruleProperty: function () {\n let name = [];\n const index = [];\n let s;\n let k;\n\n parserInput.save();\n\n const simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\\s*:/);\n if (simpleProperty) {\n name = [new(tree.Keyword)(simpleProperty[1])];\n parserInput.forget();\n return name;\n }\n\n function match(re) {\n const i = parserInput.i;\n const chunk = parserInput.$re(re);\n if (chunk) {\n index.push(i);\n return name.push(chunk[1]);\n }\n }\n\n match(/^(\\*?)/);\n while (true) {\n if (!match(/^((?:[\\w-]+)|(?:[@\\$]\\{[\\w-]+\\}))/)) {\n break;\n }\n }\n\n if ((name.length > 1) && match(/^((?:\\+_|\\+)?)\\s*:/)) {\n parserInput.forget();\n\n // at last, we have the complete match now. move forward,\n // convert name particles to tree objects and return:\n if (name[0] === '') {\n name.shift();\n index.shift();\n }\n for (k = 0; k < name.length; k++) {\n s = name[k];\n name[k] = (s.charAt(0) !== '@' && s.charAt(0) !== '$') ?\n new(tree.Keyword)(s) :\n (s.charAt(0) === '@' ?\n new(tree.Variable)(`@${s.slice(2, -1)}`, index[k], fileInfo) :\n new(tree.Property)(`$${s.slice(2, -1)}`, index[k], fileInfo));\n }\n return name;\n }\n parserInput.restore();\n }\n }\n };\n};\nParser.serializeVars = vars => {\n let s = '';\n\n for (const name in vars) {\n if (Object.hasOwnProperty.call(vars, name)) {\n const value = vars[name];\n s += `${((name[0] === '@') ? '' : '@') + name}: ${value}${(String(value).slice(-1) === ';') ? '' : ';'}`;\n }\n }\n\n return s;\n};\n\nexport default Parser;\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nlet colorFunctions;\n\nfunction clamp(val) {\n return Math.min(1, Math.max(0, val));\n}\nfunction hsla(origColor, hsl) {\n const color = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a);\n if (color) {\n if (origColor.value && \n /^(rgb|hsl)/.test(origColor.value)) {\n color.value = origColor.value;\n } else {\n color.value = 'rgb';\n }\n return color;\n }\n}\nfunction toHSL(color) {\n if (color.toHSL) {\n return color.toHSL();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction toHSV(color) {\n if (color.toHSV) {\n return color.toHSV();\n } else {\n throw new Error('Argument cannot be evaluated to a color');\n }\n}\n\nfunction number(n) {\n if (n instanceof Dimension) {\n return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);\n } else if (typeof n === 'number') {\n return n;\n } else {\n throw {\n type: 'Argument',\n message: 'color functions take numbers as parameters'\n };\n }\n}\nfunction scaled(n, size) {\n if (n instanceof Dimension && n.unit.is('%')) {\n return parseFloat(n.value * size / 100);\n } else {\n return number(n);\n }\n}\ncolorFunctions = {\n rgb: function (r, g, b) {\n const color = colorFunctions.rgba(r, g, b, 1.0);\n if (color) {\n color.value = 'rgb';\n return color;\n }\n },\n rgba: function (r, g, b, a) {\n try {\n if (r instanceof Color) {\n if (g) {\n a = number(g);\n } else {\n a = r.alpha;\n }\n return new Color(r.rgb, a, 'rgba');\n }\n const rgb = [r, g, b].map(c => scaled(c, 255));\n a = number(a);\n return new Color(rgb, a, 'rgba');\n }\n catch (e) {}\n },\n hsl: function (h, s, l) {\n const color = colorFunctions.hsla(h, s, l, 1.0);\n if (color) {\n color.value = 'hsl';\n return color;\n }\n },\n hsla: function (h, s, l, a) {\n try {\n if (h instanceof Color) {\n if (s) {\n a = number(s);\n } else {\n a = h.alpha;\n }\n return new Color(h.rgb, a, 'hsla');\n }\n\n let m1;\n let m2;\n\n function hue(h) {\n h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n else if (h * 2 < 1) {\n return m2;\n }\n else if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n else {\n return m1;\n }\n }\n\n h = (number(h) % 360) / 360;\n s = clamp(number(s));l = clamp(number(l));a = clamp(number(a));\n\n m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n m1 = l * 2 - m2;\n\n const rgb = [\n hue(h + 1 / 3) * 255,\n hue(h) * 255,\n hue(h - 1 / 3) * 255\n ];\n a = number(a);\n return new Color(rgb, a, 'hsla');\n }\n catch (e) {}\n },\n\n hsv: function(h, s, v) {\n return colorFunctions.hsva(h, s, v, 1.0);\n },\n\n hsva: function(h, s, v, a) {\n h = ((number(h) % 360) / 360) * 360;\n s = number(s);v = number(v);a = number(a);\n\n let i;\n let f;\n i = Math.floor((h / 60) % 6);\n f = (h / 60) - i;\n\n const vs = [v,\n v * (1 - s),\n v * (1 - f * s),\n v * (1 - (1 - f) * s)];\n const perm = [[0, 3, 1],\n [2, 0, 1],\n [1, 0, 3],\n [1, 2, 0],\n [3, 1, 0],\n [0, 1, 2]];\n\n return colorFunctions.rgba(vs[perm[i][0]] * 255,\n vs[perm[i][1]] * 255,\n vs[perm[i][2]] * 255,\n a);\n },\n\n hue: function (color) {\n return new Dimension(toHSL(color).h);\n },\n saturation: function (color) {\n return new Dimension(toHSL(color).s * 100, '%');\n },\n lightness: function (color) {\n return new Dimension(toHSL(color).l * 100, '%');\n },\n hsvhue: function(color) {\n return new Dimension(toHSV(color).h);\n },\n hsvsaturation: function (color) {\n return new Dimension(toHSV(color).s * 100, '%');\n },\n hsvvalue: function (color) {\n return new Dimension(toHSV(color).v * 100, '%');\n },\n red: function (color) {\n return new Dimension(color.rgb[0]);\n },\n green: function (color) {\n return new Dimension(color.rgb[1]);\n },\n blue: function (color) {\n return new Dimension(color.rgb[2]);\n },\n alpha: function (color) {\n return new Dimension(toHSL(color).a);\n },\n luma: function (color) {\n return new Dimension(color.luma() * color.alpha * 100, '%');\n },\n luminance: function (color) {\n const luminance =\n (0.2126 * color.rgb[0] / 255) +\n (0.7152 * color.rgb[1] / 255) +\n (0.0722 * color.rgb[2] / 255);\n\n return new Dimension(luminance * color.alpha * 100, '%');\n },\n saturate: function (color, amount, method) {\n // filter: saturate(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s += hsl.s * amount.value / 100;\n }\n else {\n hsl.s += amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n desaturate: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.s -= hsl.s * amount.value / 100;\n }\n else {\n hsl.s -= amount.value / 100;\n }\n hsl.s = clamp(hsl.s);\n return hsla(color, hsl);\n },\n lighten: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l += hsl.l * amount.value / 100;\n }\n else {\n hsl.l += amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n darken: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.l -= hsl.l * amount.value / 100;\n }\n else {\n hsl.l -= amount.value / 100;\n }\n hsl.l = clamp(hsl.l);\n return hsla(color, hsl);\n },\n fadein: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a += hsl.a * amount.value / 100;\n }\n else {\n hsl.a += amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fadeout: function (color, amount, method) {\n const hsl = toHSL(color);\n\n if (typeof method !== 'undefined' && method.value === 'relative') {\n hsl.a -= hsl.a * amount.value / 100;\n }\n else {\n hsl.a -= amount.value / 100;\n }\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n fade: function (color, amount) {\n const hsl = toHSL(color);\n\n hsl.a = amount.value / 100;\n hsl.a = clamp(hsl.a);\n return hsla(color, hsl);\n },\n spin: function (color, amount) {\n const hsl = toHSL(color);\n const hue = (hsl.h + amount.value) % 360;\n\n hsl.h = hue < 0 ? 360 + hue : hue;\n\n return hsla(color, hsl);\n },\n //\n // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein\n // http://sass-lang.com\n //\n mix: function (color1, color2, weight) {\n if (!weight) {\n weight = new Dimension(50);\n }\n const p = weight.value / 100.0;\n const w = p * 2 - 1;\n const a = toHSL(color1).a - toHSL(color2).a;\n\n const w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n const w2 = 1 - w1;\n\n const rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,\n color1.rgb[1] * w1 + color2.rgb[1] * w2,\n color1.rgb[2] * w1 + color2.rgb[2] * w2];\n\n const alpha = color1.alpha * p + color2.alpha * (1 - p);\n\n return new Color(rgb, alpha);\n },\n greyscale: function (color) {\n return colorFunctions.desaturate(color, new Dimension(100));\n },\n contrast: function (color, dark, light, threshold) {\n // filter: contrast(3.2);\n // should be kept as is, so check for color\n if (!color.rgb) {\n return null;\n }\n if (typeof light === 'undefined') {\n light = colorFunctions.rgba(255, 255, 255, 1.0);\n }\n if (typeof dark === 'undefined') {\n dark = colorFunctions.rgba(0, 0, 0, 1.0);\n }\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n const t = light;\n light = dark;\n dark = t;\n }\n if (typeof threshold === 'undefined') {\n threshold = 0.43;\n } else {\n threshold = number(threshold);\n }\n if (color.luma() < threshold) {\n return light;\n } else {\n return dark;\n }\n },\n // Changes made in 2.7.0 - Reverted in 3.0.0\n // contrast: function (color, color1, color2, threshold) {\n // // Return which of `color1` and `color2` has the greatest contrast with `color`\n // // according to the standard WCAG contrast ratio calculation.\n // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n // // The threshold param is no longer used, in line with SASS.\n // // filter: contrast(3.2);\n // // should be kept as is, so check for color\n // if (!color.rgb) {\n // return null;\n // }\n // if (typeof color1 === 'undefined') {\n // color1 = colorFunctions.rgba(0, 0, 0, 1.0);\n // }\n // if (typeof color2 === 'undefined') {\n // color2 = colorFunctions.rgba(255, 255, 255, 1.0);\n // }\n // var contrast1, contrast2;\n // var luma = color.luma();\n // var luma1 = color1.luma();\n // var luma2 = color2.luma();\n // // Calculate contrast ratios for each color\n // if (luma > luma1) {\n // contrast1 = (luma + 0.05) / (luma1 + 0.05);\n // } else {\n // contrast1 = (luma1 + 0.05) / (luma + 0.05);\n // }\n // if (luma > luma2) {\n // contrast2 = (luma + 0.05) / (luma2 + 0.05);\n // } else {\n // contrast2 = (luma2 + 0.05) / (luma + 0.05);\n // }\n // if (contrast1 > contrast2) {\n // return color1;\n // } else {\n // return color2;\n // }\n // },\n argb: function (color) {\n return new Anonymous(color.toARGB());\n },\n color: function(c) {\n if ((c instanceof Quoted) &&\n (/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c.value))) {\n const val = c.value.slice(1);\n return new Color(val, undefined, `#${val}`);\n }\n if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) {\n c.value = undefined;\n return c;\n }\n throw {\n type: 'Argument',\n message: 'argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF'\n };\n },\n tint: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount);\n },\n shade: function(color, amount) {\n return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount);\n }\n};\n\nexport default colorFunctions;\n","import Anonymous from '../tree/anonymous';\nimport Keyword from '../tree/keyword';\n\nfunction boolean(condition) {\n return condition ? Keyword.True : Keyword.False;\n}\n\nfunction If(condition, trueValue, falseValue) {\n return condition ? trueValue\n : (falseValue || new Anonymous);\n}\n\nexport default { boolean, 'if': If };\n","import Color from '../tree/color';\n\n// Color Blending\n// ref: http://www.w3.org/TR/compositing-1\n\nfunction colorBlend(mode, color1, color2) {\n const ab = color1.alpha; // result\n\n let // backdrop\n cb;\n\n const as = color2.alpha;\n\n let // source\n cs;\n\n let ar;\n let cr;\n const r = [];\n\n ar = as + ab * (1 - as);\n for (let i = 0; i < 3; i++) {\n cb = color1.rgb[i] / 255;\n cs = color2.rgb[i] / 255;\n cr = mode(cb, cs);\n if (ar) {\n cr = (as * cs + ab * (cb -\n as * (cb + cs - cr))) / ar;\n }\n r[i] = cr * 255;\n }\n\n return new Color(r, ar);\n}\n\nconst colorBlendModeFunctions = {\n multiply: function(cb, cs) {\n return cb * cs;\n },\n screen: function(cb, cs) {\n return cb + cs - cb * cs;\n },\n overlay: function(cb, cs) {\n cb *= 2;\n return (cb <= 1) ?\n colorBlendModeFunctions.multiply(cb, cs) :\n colorBlendModeFunctions.screen(cb - 1, cs);\n },\n softlight: function(cb, cs) {\n let d = 1;\n let e = cb;\n if (cs > 0.5) {\n e = 1;\n d = (cb > 0.25) ? Math.sqrt(cb)\n : ((16 * cb - 12) * cb + 4) * cb;\n }\n return cb - (1 - 2 * cs) * e * (d - cb);\n },\n hardlight: function(cb, cs) {\n return colorBlendModeFunctions.overlay(cs, cb);\n },\n difference: function(cb, cs) {\n return Math.abs(cb - cs);\n },\n exclusion: function(cb, cs) {\n return cb + cs - 2 * cb * cs;\n },\n\n // non-w3c functions:\n average: function(cb, cs) {\n return (cb + cs) / 2;\n },\n negation: function(cb, cs) {\n return 1 - Math.abs(cb + cs - 1);\n }\n};\n\nfor (const f in colorBlendModeFunctions) {\n if (colorBlendModeFunctions.hasOwnProperty(f)) {\n colorBlend[f] = colorBlend.bind(null, colorBlendModeFunctions[f]);\n }\n}\n\nexport default colorBlend;\n","import Comment from '../tree/comment';\nimport Dimension from '../tree/dimension';\nimport Declaration from '../tree/declaration';\nimport Expression from '../tree/expression';\nimport Ruleset from '../tree/ruleset';\nimport Selector from '../tree/selector';\nimport Element from '../tree/element';\nimport Quote from '../tree/quoted';\n\nconst getItemsFromNode = node => {\n // handle non-array values as an array of length 1\n // return 'undefined' if index is invalid\n const items = Array.isArray(node.value) ?\n node.value : Array(node);\n\n return items;\n};\n\nexport default {\n _SELF: function(n) {\n return n;\n },\n extract: function(values, index) {\n // (1-based index)\n index = index.value - 1;\n\n return getItemsFromNode(values)[index];\n },\n length: function(values) {\n return new Dimension(getItemsFromNode(values).length);\n },\n /**\n * Creates a Less list of incremental values.\n * Modeled after Lodash's range function, also exists natively in PHP\n * \n * @param {Dimension} [start=1]\n * @param {Dimension} end - e.g. 10 or 10px - unit is added to output\n * @param {Dimension} [step=1] \n */\n range: function(start, end, step) {\n let from;\n let to;\n let stepValue = 1;\n const list = [];\n if (end) {\n to = end;\n from = start.value;\n if (step) {\n stepValue = step.value;\n }\n }\n else {\n from = 1;\n to = start;\n }\n\n for (let i = from; i <= to.value; i += stepValue) {\n list.push(new Dimension(i, to.unit));\n }\n\n return new Expression(list);\n },\n each: function(list, rs) {\n const rules = [];\n let newRules;\n let iterator;\n\n if (list.value && !(list instanceof Quote)) {\n if (Array.isArray(list.value)) {\n iterator = list.value;\n } else {\n iterator = [list.value];\n }\n } else if (list.ruleset) {\n iterator = list.ruleset.rules;\n } else if (list.rules) {\n iterator = list.rules;\n } else if (Array.isArray(list)) {\n iterator = list;\n } else {\n iterator = [list];\n }\n\n let valueName = '@value';\n let keyName = '@key';\n let indexName = '@index';\n\n if (rs.params) {\n valueName = rs.params[0] && rs.params[0].name;\n keyName = rs.params[1] && rs.params[1].name;\n indexName = rs.params[2] && rs.params[2].name;\n rs = rs.rules;\n } else {\n rs = rs.ruleset;\n }\n\n for (let i = 0; i < iterator.length; i++) {\n let key;\n let value;\n const item = iterator[i];\n if (item instanceof Declaration) {\n key = typeof item.name === 'string' ? item.name : item.name[0].value;\n value = item.value;\n } else {\n key = new Dimension(i + 1);\n value = item;\n }\n\n if (item instanceof Comment) {\n continue;\n }\n\n newRules = rs.rules.slice(0);\n if (valueName) {\n newRules.push(new Declaration(valueName,\n value,\n false, false, this.index, this.currentFileInfo));\n }\n if (indexName) {\n newRules.push(new Declaration(indexName,\n new Dimension(i + 1),\n false, false, this.index, this.currentFileInfo));\n }\n if (keyName) {\n newRules.push(new Declaration(keyName,\n key,\n false, false, this.index, this.currentFileInfo));\n }\n\n rules.push(new Ruleset([ new(Selector)([ new Element(\"\", '&') ]) ],\n newRules,\n rs.strictImports,\n rs.visibilityInfo()\n ));\n }\n\n return new Ruleset([ new(Selector)([ new Element(\"\", '&') ]) ],\n rules,\n rs.strictImports,\n rs.visibilityInfo()\n ).eval(this.context);\n }\n};\n","import Dimension from '../tree/dimension';\n\nconst MathHelper = (fn, unit, n) => {\n if (!(n instanceof Dimension)) {\n throw { type: 'Argument', message: 'argument must be a number' };\n }\n if (unit == null) {\n unit = n.unit;\n } else {\n n = n.unify();\n }\n return new Dimension(fn(parseFloat(n.value)), unit);\n};\n\nexport default MathHelper;","import mathHelper from './math-helper.js';\n\nconst mathFunctions = {\n // name, unit\n ceil: null,\n floor: null,\n sqrt: null,\n abs: null,\n tan: '',\n sin: '',\n cos: '',\n atan: 'rad',\n asin: 'rad',\n acos: 'rad'\n};\n\nfor (const f in mathFunctions) {\n if (mathFunctions.hasOwnProperty(f)) {\n mathFunctions[f] = mathHelper.bind(null, Math[f], mathFunctions[f]);\n }\n}\n\nmathFunctions.round = (n, f) => {\n const fraction = typeof f === 'undefined' ? 0 : f.value;\n return mathHelper(num => num.toFixed(fraction), null, n);\n};\n\nexport default mathFunctions;\n","import Dimension from '../tree/dimension';\nimport Anonymous from '../tree/anonymous';\nimport mathHelper from './math-helper.js';\n\nconst minMax = function (isMin, args) {\n args = Array.prototype.slice.call(args);\n switch (args.length) {\n case 0: throw { type: 'Argument', message: 'one or more arguments required' };\n }\n let i; // key is the unit.toString() for unified Dimension values,\n let j;\n let current;\n let currentUnified;\n let referenceUnified;\n let unit;\n let unitStatic;\n let unitClone;\n\n const // elems only contains original argument values.\n order = [];\n\n const values = {};\n // value is the index into the order array.\n for (i = 0; i < args.length; i++) {\n current = args[i];\n if (!(current instanceof Dimension)) {\n if (Array.isArray(args[i].value)) {\n Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value));\n }\n continue;\n }\n currentUnified = current.unit.toString() === '' && unitClone !== undefined ? new Dimension(current.value, unitClone).unify() : current.unify();\n unit = currentUnified.unit.toString() === '' && unitStatic !== undefined ? unitStatic : currentUnified.unit.toString();\n unitStatic = unit !== '' && unitStatic === undefined || unit !== '' && order[0].unify().unit.toString() === '' ? unit : unitStatic;\n unitClone = unit !== '' && unitClone === undefined ? current.unit.toString() : unitClone;\n j = values[''] !== undefined && unit !== '' && unit === unitStatic ? values[''] : values[unit];\n if (j === undefined) {\n if (unitStatic !== undefined && unit !== unitStatic) {\n throw { type: 'Argument', message: 'incompatible types' };\n }\n values[unit] = order.length;\n order.push(current);\n continue;\n }\n referenceUnified = order[j].unit.toString() === '' && unitClone !== undefined ? new Dimension(order[j].value, unitClone).unify() : order[j].unify();\n if ( isMin && currentUnified.value < referenceUnified.value ||\n !isMin && currentUnified.value > referenceUnified.value) {\n order[j] = current;\n }\n }\n if (order.length == 1) {\n return order[0];\n }\n args = order.map(function (a) { return a.toCSS(this.context); }).join(this.context.compress ? ',' : ', ');\n return new Anonymous(`${isMin ? 'min' : 'max'}(${args})`);\n};\n\nexport default {\n min: function(...args) {\n return minMax(true, args);\n },\n max: function(...args) {\n return minMax(false, args);\n },\n convert: function (val, unit) {\n return val.convertTo(unit.value);\n },\n pi: function () {\n return new Dimension(Math.PI);\n },\n mod: function(a, b) {\n return new Dimension(a.value % b.value, a.unit);\n },\n pow: function(x, y) {\n if (typeof x === 'number' && typeof y === 'number') {\n x = new Dimension(x);\n y = new Dimension(y);\n } else if (!(x instanceof Dimension) || !(y instanceof Dimension)) {\n throw { type: 'Argument', message: 'arguments must be numbers' };\n }\n\n return new Dimension(Math.pow(x.value, y.value), x.unit);\n },\n percentage: function (n) {\n const result = mathHelper(num => num * 100, '%', n);\n\n return result;\n }\n};\n","/**\n * Plugin Manager\n */\nclass PluginManager {\n constructor(less) {\n this.less = less;\n this.visitors = [];\n this.preProcessors = [];\n this.postProcessors = [];\n this.installedPlugins = [];\n this.fileManagers = [];\n this.iterator = -1;\n this.pluginCache = {};\n this.Loader = new less.PluginLoader(less);\n }\n\n /**\n * Adds all the plugins in the array\n * @param {Array} plugins\n */\n addPlugins(plugins) {\n if (plugins) {\n for (let i = 0; i < plugins.length; i++) {\n this.addPlugin(plugins[i]);\n }\n }\n }\n\n /**\n *\n * @param plugin\n * @param {String} filename\n */\n addPlugin(plugin, filename, functionRegistry) {\n this.installedPlugins.push(plugin);\n if (filename) {\n this.pluginCache[filename] = plugin;\n }\n if (plugin.install) {\n plugin.install(this.less, this, functionRegistry || this.less.functions.functionRegistry);\n }\n }\n\n /**\n *\n * @param filename\n */\n get(filename) {\n return this.pluginCache[filename];\n }\n\n /**\n * Adds a visitor. The visitor object has options on itself to determine\n * when it should run.\n * @param visitor\n */\n addVisitor(visitor) {\n this.visitors.push(visitor);\n }\n\n /**\n * Adds a pre processor object\n * @param {object} preProcessor\n * @param {number} priority - guidelines 1 = before import, 1000 = import, 2000 = after import\n */\n addPreProcessor(preProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) {\n if (this.preProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.preProcessors.splice(indexToInsertAt, 0, {preProcessor, priority});\n }\n\n /**\n * Adds a post processor object\n * @param {object} postProcessor\n * @param {number} priority - guidelines 1 = before compression, 1000 = compression, 2000 = after compression\n */\n addPostProcessor(postProcessor, priority) {\n let indexToInsertAt;\n for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) {\n if (this.postProcessors[indexToInsertAt].priority >= priority) {\n break;\n }\n }\n this.postProcessors.splice(indexToInsertAt, 0, {postProcessor, priority});\n }\n\n /**\n *\n * @param manager\n */\n addFileManager(manager) {\n this.fileManagers.push(manager);\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPreProcessors() {\n const preProcessors = [];\n for (let i = 0; i < this.preProcessors.length; i++) {\n preProcessors.push(this.preProcessors[i].preProcessor);\n }\n return preProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getPostProcessors() {\n const postProcessors = [];\n for (let i = 0; i < this.postProcessors.length; i++) {\n postProcessors.push(this.postProcessors[i].postProcessor);\n }\n return postProcessors;\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getVisitors() {\n return this.visitors;\n }\n\n visitor() {\n const self = this;\n return {\n first: function() {\n self.iterator = -1;\n return self.visitors[self.iterator];\n },\n get: function() {\n self.iterator += 1;\n return self.visitors[self.iterator];\n }\n };\n }\n\n /**\n *\n * @returns {Array}\n * @private\n */\n getFileManagers() {\n return this.fileManagers;\n }\n}\n\nlet pm;\n\nfunction PluginManagerFactory(less, newFactory) {\n if (newFactory || !pm) {\n pm = new PluginManager(less);\n }\n return pm;\n};\n\n//\nexport default PluginManagerFactory;\n","import Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport JavaScript from '../tree/javascript';\n\nexport default {\n e: function (str) {\n return new Quoted('\"', str instanceof JavaScript ? str.evaluated : str.value, true);\n },\n escape: function (str) {\n return new Anonymous(\n encodeURI(str.value).replace(/=/g, '%3D').replace(/:/g, '%3A').replace(/#/g, '%23').replace(/;/g, '%3B')\n .replace(/\\(/g, '%28').replace(/\\)/g, '%29'));\n },\n replace: function (string, pattern, replacement, flags) {\n let result = string.value;\n replacement = (replacement.type === 'Quoted') ?\n replacement.value : replacement.toCSS();\n result = result.replace(new RegExp(pattern.value, flags ? flags.value : ''), replacement);\n return new Quoted(string.quote || '', result, string.escaped);\n },\n '%': function (string /* arg, arg, ... */) {\n const args = Array.prototype.slice.call(arguments, 1);\n let result = string.value;\n\n for (let i = 0; i < args.length; i++) {\n /* jshint loopfunc:true */\n result = result.replace(/%[sda]/i, token => {\n const value = ((args[i].type === 'Quoted') &&\n token.match(/s/i)) ? args[i].value : args[i].toCSS();\n return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;\n });\n }\n result = result.replace(/%%/g, '%');\n return new Quoted(string.quote || '', result, string.escaped);\n }\n};\n","import Keyword from '../tree/keyword';\nimport DetachedRuleset from '../tree/detached-ruleset';\nimport Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Quoted from '../tree/quoted';\nimport Anonymous from '../tree/anonymous';\nimport URL from '../tree/url';\nimport Operation from '../tree/operation';\n\nconst isa = (n, Type) => (n instanceof Type) ? Keyword.True : Keyword.False;\nconst isunit = (n, unit) => {\n if (unit === undefined) {\n throw { type: 'Argument', message: 'missing the required second argument to isunit.' };\n }\n unit = typeof unit.value === 'string' ? unit.value : unit;\n if (typeof unit !== 'string') {\n throw { type: 'Argument', message: 'Second argument to isunit should be a unit or a string.' };\n }\n return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False;\n};\n\nexport default {\n isruleset: function (n) {\n return isa(n, DetachedRuleset);\n },\n iscolor: function (n) {\n return isa(n, Color);\n },\n isnumber: function (n) {\n return isa(n, Dimension);\n },\n isstring: function (n) {\n return isa(n, Quoted);\n },\n iskeyword: function (n) {\n return isa(n, Keyword);\n },\n isurl: function (n) {\n return isa(n, URL);\n },\n ispixel: function (n) {\n return isunit(n, 'px');\n },\n ispercentage: function (n) {\n return isunit(n, '%');\n },\n isem: function (n) {\n return isunit(n, 'em');\n },\n isunit,\n unit: function (val, unit) {\n if (!(val instanceof Dimension)) {\n throw { type: 'Argument',\n message: `the first argument to unit must be a number${val instanceof Operation ? '. Have you forgotten parenthesis?' : ''}` };\n }\n if (unit) {\n if (unit instanceof Keyword) {\n unit = unit.value;\n } else {\n unit = unit.toCSS();\n }\n } else {\n unit = '';\n }\n return new Dimension(val.value, unit);\n },\n 'get-unit': function (n) {\n return new Anonymous(n.unit);\n }\n};\n","import functionRegistry from './function-registry';\nimport functionCaller from './function-caller';\n\nimport boolean from './boolean';\nimport defaultFunc from './default';\nimport color from './color';\nimport colorBlending from './color-blending';\nimport dataUri from './data-uri';\nimport list from './list';\nimport math from './math';\nimport number from './number';\nimport string from './string';\nimport svg from './svg';\nimport types from './types';\n\nexport default environment => {\n const functions = { functionRegistry, functionCaller };\n\n // register functions\n functionRegistry.addMultiple(boolean);\n functionRegistry.add('default', defaultFunc.eval.bind(defaultFunc));\n functionRegistry.addMultiple(color);\n functionRegistry.addMultiple(colorBlending);\n functionRegistry.addMultiple(dataUri(environment));\n functionRegistry.addMultiple(list);\n functionRegistry.addMultiple(math);\n functionRegistry.addMultiple(number);\n functionRegistry.addMultiple(string);\n functionRegistry.addMultiple(svg(environment));\n functionRegistry.addMultiple(types);\n\n return functions;\n};\n","import Quoted from '../tree/quoted';\nimport URL from '../tree/url';\nimport * as utils from '../utils';\nimport logger from '../logger';\n\nexport default environment => {\n \n const fallback = (functionThis, node) => new URL(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); \n\n return { 'data-uri': function(mimetypeNode, filePathNode) {\n\n if (!filePathNode) {\n filePathNode = mimetypeNode;\n mimetypeNode = null;\n }\n\n let mimetype = mimetypeNode && mimetypeNode.value;\n let filePath = filePathNode.value;\n const currentFileInfo = this.currentFileInfo;\n const currentDirectory = currentFileInfo.rewriteUrls ?\n currentFileInfo.currentDirectory : currentFileInfo.entryPath;\n\n const fragmentStart = filePath.indexOf('#');\n let fragment = '';\n if (fragmentStart !== -1) {\n fragment = filePath.slice(fragmentStart);\n filePath = filePath.slice(0, fragmentStart);\n }\n const context = utils.clone(this.context);\n context.rawBuffer = true;\n\n const fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true);\n\n if (!fileManager) {\n return fallback(this, filePathNode);\n }\n\n let useBase64 = false;\n\n // detect the mimetype if not given\n if (!mimetypeNode) {\n\n mimetype = environment.mimeLookup(filePath);\n\n if (mimetype === 'image/svg+xml') {\n useBase64 = false;\n } else {\n // use base 64 unless it's an ASCII or UTF-8 format\n const charset = environment.charsetLookup(mimetype);\n useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;\n }\n if (useBase64) { mimetype += ';base64'; }\n }\n else {\n useBase64 = /;base64$/.test(mimetype);\n }\n\n const fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment);\n if (!fileSync.contents) {\n logger.warn(`Skipped data-uri embedding of ${filePath} because file not found`);\n return fallback(this, filePathNode || mimetypeNode);\n }\n let buf = fileSync.contents;\n if (useBase64 && !environment.encodeBase64) {\n return fallback(this, filePathNode);\n }\n\n buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);\n\n const uri = `data:${mimetype},${buf}${fragment}`;\n\n return new URL(new Quoted(`\"${uri}\"`, uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default environment => {\n return { 'svg-gradient': function(direction) {\n let stops;\n let gradientDirectionSvg;\n let gradientType = 'linear';\n let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n const renderEnv = {compress: false};\n let returner;\n const directionValue = direction.toCSS(renderEnv);\n let i;\n let color;\n let position;\n let positionValue;\n let alpha;\n\n function throwArgumentDescriptor() {\n throw { type: 'Argument',\n message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n ' end_color [end_position] or direction, color list' };\n }\n\n if (arguments.length == 2) {\n if (arguments[1].value.length < 2) {\n throwArgumentDescriptor();\n }\n stops = arguments[1].value;\n } else if (arguments.length < 3) {\n throwArgumentDescriptor();\n } else {\n stops = Array.prototype.slice.call(arguments, 1);\n }\n\n switch (directionValue) {\n case 'to bottom':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n break;\n case 'to right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'to bottom right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n break;\n case 'to top right':\n gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n break;\n case 'ellipse':\n case 'ellipse at center':\n gradientType = 'radial';\n gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n break;\n default:\n throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n }\n returner = `<${gradientType}Gradient id=\"g\" ${gradientDirectionSvg}>`;\n\n for (i = 0; i < stops.length; i += 1) {\n if (stops[i] instanceof Expression) {\n color = stops[i].value[0];\n position = stops[i].value[1];\n } else {\n color = stops[i];\n position = undefined;\n }\n\n if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) {\n throwArgumentDescriptor();\n }\n positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';\n alpha = color.alpha;\n returner += ``;\n }\n returner += ``;\n\n returner = encodeURIComponent(returner);\n\n returner = `data:image/svg+xml,${returner}`;\n return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n }};\n};\n","import contexts from './contexts';\nimport visitor from './visitors';\nimport tree from './tree';\n\nexport default (root, options = {}) => {\n let evaldRoot;\n let variables = options.variables;\n const evalEnv = new contexts.Eval(options);\n\n //\n // Allows setting variables with a hash, so:\n //\n // `{ color: new tree.Color('#f01') }` will become:\n //\n // new tree.Declaration('@color',\n // new tree.Value([\n // new tree.Expression([\n // new tree.Color('#f01')\n // ])\n // ])\n // )\n //\n if (typeof variables === 'object' && !Array.isArray(variables)) {\n variables = Object.keys(variables).map(k => {\n let value = variables[k];\n\n if (!(value instanceof tree.Value)) {\n if (!(value instanceof tree.Expression)) {\n value = new tree.Expression([value]);\n }\n value = new tree.Value([value]);\n }\n return new tree.Declaration(`@${k}`, value, false, null, 0);\n });\n evalEnv.frames = [new tree.Ruleset(null, variables)];\n }\n\n const visitors = [\n new visitor.JoinSelectorVisitor(),\n new visitor.MarkVisibleSelectorsVisitor(true),\n new visitor.ExtendVisitor(),\n new visitor.ToCSSVisitor({compress: Boolean(options.compress)})\n ];\n\n const preEvalVisitors = [];\n let v;\n let visitorIterator;\n\n /**\n * first() / get() allows visitors to be added while visiting\n * \n * @todo Add scoping for visitors just like functions for @plugin; right now they're global\n */\n if (options.pluginManager) {\n visitorIterator = options.pluginManager.visitor();\n for (var i = 0; i < 2; i++) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (v.isPreEvalVisitor) {\n if (i === 0 || preEvalVisitors.indexOf(v) === -1) {\n preEvalVisitors.push(v);\n v.run(root);\n }\n }\n else {\n if (i === 0 || visitors.indexOf(v) === -1) {\n if (v.isPreVisitor) {\n visitors.unshift(v);\n }\n else {\n visitors.push(v);\n }\n }\n }\n }\n }\n }\n\n evaldRoot = root.eval(evalEnv);\n\n for (var i = 0; i < visitors.length; i++) {\n visitors[i].run(evaldRoot);\n }\n\n // Run any remaining visitors added after eval pass\n if (options.pluginManager) {\n visitorIterator.first();\n while ((v = visitorIterator.get())) {\n if (visitors.indexOf(v) === -1 && preEvalVisitors.indexOf(v) === -1) {\n v.run(evaldRoot);\n }\n }\n }\n\n return evaldRoot;\n};\n","/* global window, XMLHttpRequest */\n\nimport AbstractFileManager from '../less/environment/abstract-file-manager.js';\n\nlet options;\nlet logger;\nlet fileCache = {};\n\n// TODOS - move log somewhere. pathDiff and doing something similar in node. use pathDiff in the other browser file for the initial load\nclass FileManager extends AbstractFileManager {\n alwaysMakePathsAbsolute() {\n return true;\n }\n\n join(basePath, laterPath) {\n if (!basePath) {\n return laterPath;\n }\n return this.extractUrlParts(laterPath, basePath).path;\n }\n\n doXHR(url, type, callback, errback) {\n const xhr = new XMLHttpRequest();\n const async = options.isFileProtocol ? options.fileAsync : true;\n\n if (typeof xhr.overrideMimeType === 'function') {\n xhr.overrideMimeType('text/css');\n }\n logger.debug(`XHR: Getting '${url}'`);\n xhr.open('GET', url, async);\n xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');\n xhr.send(null);\n\n function handleResponse(xhr, callback, errback) {\n if (xhr.status >= 200 && xhr.status < 300) {\n callback(xhr.responseText,\n xhr.getResponseHeader('Last-Modified'));\n } else if (typeof errback === 'function') {\n errback(xhr.status, url);\n }\n }\n\n if (options.isFileProtocol && !options.fileAsync) {\n if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {\n callback(xhr.responseText);\n } else {\n errback(xhr.status, url);\n }\n } else if (async) {\n xhr.onreadystatechange = () => {\n if (xhr.readyState == 4) {\n handleResponse(xhr, callback, errback);\n }\n };\n } else {\n handleResponse(xhr, callback, errback);\n }\n }\n\n supports() {\n return true;\n }\n\n clearFileCache() {\n fileCache = {};\n }\n\n loadFile(filename, currentDirectory, options, environment) {\n // TODO: Add prefix support like less-node?\n // What about multiple paths?\n\n if (currentDirectory && !this.isPathAbsolute(filename)) {\n filename = currentDirectory + filename;\n }\n\n filename = options.ext ? this.tryAppendExtension(filename, options.ext) : filename;\n\n options = options || {};\n\n // sheet may be set to the stylesheet for the initial load or a collection of properties including\n // some context variables for imports\n const hrefParts = this.extractUrlParts(filename, window.location.href);\n const href = hrefParts.url;\n const self = this;\n \n return new Promise((resolve, reject) => {\n if (options.useFileCache && fileCache[href]) {\n try {\n const lessText = fileCache[href];\n return resolve({ contents: lessText, filename: href, webInfo: { lastModified: new Date() }});\n } catch (e) {\n return reject({ filename: href, message: `Error loading file ${href} error was ${e.message}` });\n }\n }\n\n self.doXHR(href, options.mime, function doXHRCallback(data, lastModified) {\n // per file cache\n fileCache[href] = data;\n\n // Use remote copy (re-parse)\n resolve({ contents: data, filename: href, webInfo: { lastModified }});\n }, function doXHRError(status, url) {\n reject({ type: 'File', message: `'${url}' wasn't found (${status})`, href });\n });\n });\n }\n}\n\nexport default (opts, log) => {\n options = opts;\n logger = log;\n return FileManager;\n}\n","import data from './data';\nimport tree from './tree';\nimport Environment from './environment/environment';\nimport AbstractFileManager from './environment/abstract-file-manager';\nimport AbstractPluginLoader from './environment/abstract-plugin-loader';\nimport visitors from './visitors';\nimport Parser from './parser/parser';\nimport Functions from './functions';\nimport contexts from './contexts';\nimport sourceMapOutput from './source-map-output';\nimport sourceMapBuilder from './source-map-builder';\nimport parseTree from './parse-tree';\nimport importManager from './import-manager';\nimport Render from './render';\nimport Parse from './parse';\nimport LessError from './less-error';\nimport transformTree from './transform-tree';\nimport * as utils from './utils';\nimport PluginManager from './plugin-manager';\nimport logger from './logger';\n\nexport default (environment, fileManagers) => {\n /**\n * @todo\n * This original code could be improved quite a bit.\n * Many classes / modules currently add side-effects / mutations to passed in objects,\n * which makes it hard to refactor and reason about. \n */\n environment = new Environment(environment, fileManagers);\n\n const SourceMapOutput = sourceMapOutput(environment);\n const SourceMapBuilder = sourceMapBuilder(SourceMapOutput, environment);\n const ParseTree = parseTree(SourceMapBuilder);\n const ImportManager = importManager(environment);\n const render = Render(environment, ParseTree, ImportManager);\n const parse = Parse(environment, ParseTree, ImportManager);\n const functions = Functions(environment);\n\n /**\n * @todo\n * This root properties / methods need to be organized.\n * It's not clear what should / must be public and why.\n */\n const initial = {\n version: [3, 11, 3],\n data,\n tree,\n Environment,\n AbstractFileManager,\n AbstractPluginLoader,\n environment,\n visitors,\n Parser,\n functions,\n contexts,\n SourceMapOutput,\n SourceMapBuilder,\n ParseTree,\n ImportManager,\n render,\n parse,\n LessError,\n transformTree,\n utils,\n PluginManager,\n logger\n };\n\n // Create a public API\n const ctor = t => function (...args) {\n return new t(...args);\n };\n\n let t;\n const api = Object.create(initial);\n for (const n in initial.tree) {\n /* eslint guard-for-in: 0 */\n t = initial.tree[n];\n if (typeof t === 'function') {\n api[n.toLowerCase()] = ctor(t);\n }\n else {\n api[n] = Object.create(null);\n for (const o in t) {\n /* eslint guard-for-in: 0 */\n api[n][o.toLowerCase()] = ctor(t[o]);\n }\n }\n }\n\n return api;\n};\n","export default environment => {\n class SourceMapOutput {\n constructor(options) {\n this._css = [];\n this._rootNode = options.rootNode;\n this._contentsMap = options.contentsMap;\n this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;\n if (options.sourceMapFilename) {\n this._sourceMapFilename = options.sourceMapFilename.replace(/\\\\/g, '/');\n }\n this._outputFilename = options.outputFilename;\n this.sourceMapURL = options.sourceMapURL;\n if (options.sourceMapBasepath) {\n this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\\\/g, '/');\n }\n if (options.sourceMapRootpath) {\n this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\\\/g, '/');\n if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {\n this._sourceMapRootpath += '/';\n }\n } else {\n this._sourceMapRootpath = '';\n }\n this._outputSourceFiles = options.outputSourceFiles;\n this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();\n\n this._lineNumber = 0;\n this._column = 0;\n }\n\n removeBasepath(path) {\n if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {\n path = path.substring(this._sourceMapBasepath.length);\n if (path.charAt(0) === '\\\\' || path.charAt(0) === '/') {\n path = path.substring(1);\n }\n }\n\n return path;\n }\n\n normalizeFilename(filename) {\n filename = filename.replace(/\\\\/g, '/');\n filename = this.removeBasepath(filename);\n return (this._sourceMapRootpath || '') + filename;\n }\n\n add(chunk, fileInfo, index, mapLines) {\n // ignore adding empty strings\n if (!chunk) {\n return;\n }\n\n let lines;\n let sourceLines;\n let columns;\n let sourceColumns;\n let i;\n\n if (fileInfo && fileInfo.filename) {\n let inputSource = this._contentsMap[fileInfo.filename];\n\n // remove vars/banner added to the top of the file\n if (this._contentsIgnoredCharsMap[fileInfo.filename]) {\n // adjust the index\n index -= this._contentsIgnoredCharsMap[fileInfo.filename];\n if (index < 0) { index = 0; }\n // adjust the source\n inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);\n }\n\n // ignore empty content\n if (inputSource === undefined) {\n return;\n }\n\n inputSource = inputSource.substring(0, index);\n sourceLines = inputSource.split('\\n');\n sourceColumns = sourceLines[sourceLines.length - 1];\n }\n\n lines = chunk.split('\\n');\n columns = lines[lines.length - 1];\n\n if (fileInfo && fileInfo.filename) {\n if (!mapLines) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column},\n original: { line: sourceLines.length, column: sourceColumns.length},\n source: this.normalizeFilename(fileInfo.filename)});\n } else {\n for (i = 0; i < lines.length; i++) {\n this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0},\n original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0},\n source: this.normalizeFilename(fileInfo.filename)});\n }\n }\n }\n\n if (lines.length === 1) {\n this._column += columns.length;\n } else {\n this._lineNumber += lines.length - 1;\n this._column = columns.length;\n }\n\n this._css.push(chunk);\n }\n\n isEmpty() {\n return this._css.length === 0;\n }\n\n toCSS(context) {\n this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });\n\n if (this._outputSourceFiles) {\n for (const filename in this._contentsMap) {\n if (this._contentsMap.hasOwnProperty(filename)) {\n let source = this._contentsMap[filename];\n if (this._contentsIgnoredCharsMap[filename]) {\n source = source.slice(this._contentsIgnoredCharsMap[filename]);\n }\n this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source);\n }\n }\n }\n\n this._rootNode.genCSS(context, this);\n\n if (this._css.length > 0) {\n let sourceMapURL;\n const sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());\n\n if (this.sourceMapURL) {\n sourceMapURL = this.sourceMapURL;\n } else if (this._sourceMapFilename) {\n sourceMapURL = this._sourceMapFilename;\n }\n this.sourceMapURL = sourceMapURL;\n\n this.sourceMap = sourceMapContent;\n }\n\n return this._css.join('');\n }\n }\n\n return SourceMapOutput;\n};\n","export default (SourceMapOutput, environment) => {\n class SourceMapBuilder {\n constructor(options) {\n this.options = options;\n }\n\n toCSS(rootNode, options, imports) {\n const sourceMapOutput = new SourceMapOutput(\n {\n contentsIgnoredCharsMap: imports.contentsIgnoredChars,\n rootNode,\n contentsMap: imports.contents,\n sourceMapFilename: this.options.sourceMapFilename,\n sourceMapURL: this.options.sourceMapURL,\n outputFilename: this.options.sourceMapOutputFilename,\n sourceMapBasepath: this.options.sourceMapBasepath,\n sourceMapRootpath: this.options.sourceMapRootpath,\n outputSourceFiles: this.options.outputSourceFiles,\n sourceMapGenerator: this.options.sourceMapGenerator,\n sourceMapFileInline: this.options.sourceMapFileInline\n });\n\n const css = sourceMapOutput.toCSS(options);\n this.sourceMap = sourceMapOutput.sourceMap;\n this.sourceMapURL = sourceMapOutput.sourceMapURL;\n if (this.options.sourceMapInputFilename) {\n this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename);\n }\n if (this.options.sourceMapBasepath !== undefined && this.sourceMapURL !== undefined) {\n this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL);\n }\n return css + this.getCSSAppendage();\n }\n\n getCSSAppendage() {\n\n let sourceMapURL = this.sourceMapURL;\n if (this.options.sourceMapFileInline) {\n if (this.sourceMap === undefined) {\n return '';\n }\n sourceMapURL = `data:application/json;base64,${environment.encodeBase64(this.sourceMap)}`;\n }\n\n if (sourceMapURL) {\n return `/*# sourceMappingURL=${sourceMapURL} */`;\n }\n return '';\n }\n\n getExternalSourceMap() {\n return this.sourceMap;\n }\n\n setExternalSourceMap(sourceMap) {\n this.sourceMap = sourceMap;\n }\n\n isInline() {\n return this.options.sourceMapFileInline;\n }\n\n getSourceMapURL() {\n return this.sourceMapURL;\n }\n\n getOutputFilename() {\n return this.options.sourceMapOutputFilename;\n }\n\n getInputFilename() {\n return this.sourceMapInputFilename;\n }\n }\n\n return SourceMapBuilder;\n};\n","import LessError from './less-error';\nimport transformTree from './transform-tree';\nimport logger from './logger';\n\nexport default SourceMapBuilder => {\n class ParseTree {\n constructor(root, imports) {\n this.root = root;\n this.imports = imports;\n }\n\n toCSS(options) {\n let evaldRoot;\n const result = {};\n let sourceMapBuilder;\n try {\n evaldRoot = transformTree(this.root, options);\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n try {\n const compress = Boolean(options.compress);\n if (compress) {\n logger.warn('The compress option has been deprecated. ' + \n 'We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.');\n }\n\n const toCSSOptions = {\n compress,\n dumpLineNumbers: options.dumpLineNumbers,\n strictUnits: Boolean(options.strictUnits),\n numPrecision: 8};\n\n if (options.sourceMap) {\n sourceMapBuilder = new SourceMapBuilder(options.sourceMap);\n result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports);\n } else {\n result.css = evaldRoot.toCSS(toCSSOptions);\n }\n } catch (e) {\n throw new LessError(e, this.imports);\n }\n\n if (options.pluginManager) {\n const postProcessors = options.pluginManager.getPostProcessors();\n for (let i = 0; i < postProcessors.length; i++) {\n result.css = postProcessors[i].process(result.css, { sourceMap: sourceMapBuilder, options, imports: this.imports });\n }\n }\n if (options.sourceMap) {\n result.map = sourceMapBuilder.getExternalSourceMap();\n }\n\n const rootFilename = this.imports.rootFilename\n result.imports = this.imports.files.filter(file => file !== rootFilename);\n return result;\n }\n }\n\n return ParseTree;\n};\n","import contexts from './contexts';\nimport Parser from './parser/parser';\nimport LessError from './less-error';\nimport * as utils from './utils';\nimport logger from './logger';\n\nexport default environment => {\n // FileInfo = {\n // 'rewriteUrls' - option - whether to adjust URL's to be relative\n // 'filename' - full resolved filename of current file\n // 'rootpath' - path to append to normal URLs for this node\n // 'currentDirectory' - path to the current file, absolute\n // 'rootFilename' - filename of the base file\n // 'entryPath' - absolute path to the entry file\n // 'reference' - whether the file should not be output and only output parts that are referenced\n\n class ImportManager {\n constructor(less, context, rootFileInfo) {\n this.less = less;\n this.rootFilename = rootFileInfo.filename;\n this.paths = context.paths || []; // Search paths, when importing\n this.contents = {}; // map - filename to contents of all the files\n this.contentsIgnoredChars = {}; // map - filename to lines at the beginning of each file to ignore\n this.mime = context.mime;\n this.error = null;\n this.context = context;\n // Deprecated? Unused outside of here, could be useful.\n this.queue = []; // Files which haven't been imported yet\n this.files = []; // List of files imported\n }\n\n /**\n * Add an import to be imported\n * @param path - the raw path\n * @param tryAppendExtension - whether to try appending a file extension (.less or .js if the path has no extension)\n * @param currentFileInfo - the current file info (used for instance to work out relative paths)\n * @param importOptions - import options\n * @param callback - callback for when it is imported\n */\n push(path, tryAppendExtension, currentFileInfo, importOptions, callback) {\n const importManager = this;\n const pluginLoader = this.context.pluginManager.Loader;\n\n this.queue.push(path);\n\n const fileParsedFunc = (e, root, fullPath) => {\n importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue\n\n const importedEqualsRoot = fullPath === importManager.rootFilename;\n if (importOptions.optional && e) {\n callback(null, {rules:[]}, false, null);\n logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`);\n }\n else {\n const files = importManager.files\n if (files.indexOf(fullPath) === -1) {\n files.push(fullPath)\n }\n if (e && !importManager.error) { importManager.error = e; }\n callback(e, root, importedEqualsRoot, fullPath);\n }\n };\n\n const newFileInfo = {\n rewriteUrls: this.context.rewriteUrls,\n entryPath: currentFileInfo.entryPath,\n rootpath: currentFileInfo.rootpath,\n rootFilename: currentFileInfo.rootFilename\n };\n\n const fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment);\n\n if (!fileManager) {\n fileParsedFunc({ message: `Could not find a file-manager for ${path}` });\n return;\n }\n\n const loadFileCallback = loadedFile => {\n let plugin;\n const resolvedFilename = loadedFile.filename;\n const contents = loadedFile.contents.replace(/^\\uFEFF/, '');\n\n // Pass on an updated rootpath if path of imported file is relative and file\n // is in a (sub|sup) directory\n //\n // Examples:\n // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',\n // then rootpath should become 'less/module/nav/'\n // - If path of imported file is '../mixins.less' and rootpath is 'less/',\n // then rootpath should become 'less/../'\n newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename);\n if (newFileInfo.rewriteUrls) {\n newFileInfo.rootpath = fileManager.join(\n (importManager.context.rootpath || ''),\n fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath));\n\n if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) {\n newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath);\n }\n }\n newFileInfo.filename = resolvedFilename;\n\n const newEnv = new contexts.Parse(importManager.context);\n\n newEnv.processImports = false;\n importManager.contents[resolvedFilename] = contents;\n\n if (currentFileInfo.reference || importOptions.reference) {\n newFileInfo.reference = true;\n }\n\n if (importOptions.isPlugin) {\n plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo);\n if (plugin instanceof LessError) {\n fileParsedFunc(plugin, null, resolvedFilename);\n }\n else {\n fileParsedFunc(null, plugin, resolvedFilename);\n }\n } else if (importOptions.inline) {\n fileParsedFunc(null, contents, resolvedFilename);\n } else {\n new Parser(newEnv, importManager, newFileInfo).parse(contents, (e, root) => {\n fileParsedFunc(e, root, resolvedFilename);\n });\n }\n };\n let promise;\n const context = utils.clone(this.context);\n\n if (tryAppendExtension) {\n context.ext = importOptions.isPlugin ? '.js' : '.less';\n }\n\n if (importOptions.isPlugin) {\n context.mime = 'application/javascript';\n promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager);\n }\n else {\n promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment,\n (err, loadedFile) => {\n if (err) {\n fileParsedFunc(err);\n } else {\n loadFileCallback(loadedFile);\n }\n });\n }\n if (promise) {\n promise.then(loadFileCallback, fileParsedFunc);\n }\n }\n }\n\n return ImportManager;\n};\n","let PromiseConstructor;\nimport * as utils from './utils';\n\nexport default (environment, ParseTree, ImportManager) => {\n const render = function (input, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise((resolve, reject) => {\n render.call(self, input, options, (err, output) => {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n this.parse(input, options, (err, root, imports, options) => {\n if (err) { return callback(err); }\n\n let result;\n try {\n const parseTree = new ParseTree(root, imports);\n result = parseTree.toCSS(options);\n }\n catch (err) { return callback(err); }\n\n callback(null, result);\n });\n }\n };\n\n return render;\n};\n","let PromiseConstructor;\nimport contexts from './contexts';\nimport Parser from './parser/parser';\nimport PluginManager from './plugin-manager';\nimport LessError from './less-error';\nimport * as utils from './utils';\n\nexport default (environment, ParseTree, ImportManager) => {\n const parse = function (input, options, callback) {\n\n if (typeof options === 'function') {\n callback = options;\n options = utils.copyOptions(this.options, {});\n }\n else {\n options = utils.copyOptions(this.options, options || {});\n }\n\n if (!callback) {\n const self = this;\n return new Promise((resolve, reject) => {\n parse.call(self, input, options, (err, output) => {\n if (err) {\n reject(err);\n } else {\n resolve(output);\n }\n });\n });\n } else {\n let context;\n let rootFileInfo;\n const pluginManager = new PluginManager(this, !options.reUsePluginManager);\n\n options.pluginManager = pluginManager;\n\n context = new contexts.Parse(options);\n\n if (options.rootFileInfo) {\n rootFileInfo = options.rootFileInfo;\n } else {\n const filename = options.filename || 'input';\n const entryPath = filename.replace(/[^\\/\\\\]*$/, '');\n rootFileInfo = {\n filename,\n rewriteUrls: context.rewriteUrls,\n rootpath: context.rootpath || '',\n currentDirectory: entryPath,\n entryPath,\n rootFilename: filename\n };\n // add in a missing trailing slash\n if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== '/') {\n rootFileInfo.rootpath += '/';\n }\n }\n\n const imports = new ImportManager(this, context, rootFileInfo);\n this.importManager = imports;\n\n // TODO: allow the plugins to be just a list of paths or names\n // Do an async plugin queue like lessc\n\n if (options.plugins) {\n options.plugins.forEach(plugin => {\n let evalResult;\n let contents;\n if (plugin.fileContent) {\n contents = plugin.fileContent.replace(/^\\uFEFF/, '');\n evalResult = pluginManager.Loader.evalPlugin(contents, context, imports, plugin.options, plugin.filename);\n if (evalResult instanceof LessError) {\n return callback(evalResult);\n }\n }\n else {\n pluginManager.addPlugin(plugin);\n }\n });\n }\n\n new Parser(context, imports, rootFileInfo)\n .parse(input, (e, root) => {\n if (e) { return callback(e); }\n callback(null, root, imports, options);\n }, options);\n }\n };\n return parse;\n};\n","// TODO: Add tests for browser @plugin\n/* global window */\n\nimport AbstractPluginLoader from '../less/environment/abstract-plugin-loader.js';\n\n/**\n * Browser Plugin Loader\n */\nclass PluginLoader extends AbstractPluginLoader {\n constructor(less) {\n super();\n\n this.less = less;\n // Should we shim this.require for browser? Probably not?\n }\n\n loadPlugin(filename, basePath, context, environment, fileManager) {\n return new Promise((fulfill, reject) => {\n fileManager.loadFile(filename, basePath, context, environment)\n .then(fulfill).catch(reject);\n });\n }\n}\n\nexport default PluginLoader;\n\n","import * as utils from './utils';\nimport browser from './browser';\n\nexport default (window, less, options) => {\n\n function errorHTML(e, rootHref) {\n const id = `less-error-message:${utils.extractId(rootHref || '')}`;\n const template = '
  • {content}
  • ';\n const elem = window.document.createElement('div');\n let timer;\n let content;\n const errors = [];\n const filename = e.filename || rootHref;\n const filenameNoPath = filename.match(/([^\\/]+(\\?.*)?)$/)[1];\n\n elem.id = id;\n elem.className = 'less-error-message';\n\n content = `

    ${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'}` + \n `

    in ${filenameNoPath} `;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += `on line ${e.line}, column ${e.column + 1}:

      ${errors.join('')}
    `;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `
    Stack Trace
    ${e.stack.split('\\n').slice(1).join('
    ')}`;\n }\n elem.innerHTML = content;\n\n // CSS for error messages\n browser.createCSS(window.document, [\n '.less-error-message ul, .less-error-message li {',\n 'list-style-type: none;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message label {',\n 'font-size: 12px;',\n 'margin-right: 15px;',\n 'padding: 4px 0;',\n 'color: #cc7777;',\n '}',\n '.less-error-message pre {',\n 'color: #dd6666;',\n 'padding: 4px 0;',\n 'margin: 0;',\n 'display: inline-block;',\n '}',\n '.less-error-message pre.line {',\n 'color: #ff0000;',\n '}',\n '.less-error-message h3 {',\n 'font-size: 20px;',\n 'font-weight: bold;',\n 'padding: 15px 0 5px 0;',\n 'margin: 0;',\n '}',\n '.less-error-message a {',\n 'color: #10a',\n '}',\n '.less-error-message .error {',\n 'color: red;',\n 'font-weight: bold;',\n 'padding-bottom: 2px;',\n 'border-bottom: 1px dashed red;',\n '}'\n ].join('\\n'), { title: 'error-message' });\n\n elem.style.cssText = [\n 'font-family: Arial, sans-serif',\n 'border: 1px solid #e00',\n 'background-color: #eee',\n 'border-radius: 5px',\n '-webkit-border-radius: 5px',\n '-moz-border-radius: 5px',\n 'color: #e00',\n 'padding: 15px',\n 'margin-bottom: 15px'\n ].join(';');\n\n if (options.env === 'development') {\n timer = setInterval(() => {\n const document = window.document;\n const body = document.body;\n if (body) {\n if (document.getElementById(id)) {\n body.replaceChild(elem, document.getElementById(id));\n } else {\n body.insertBefore(elem, body.firstChild);\n }\n clearInterval(timer);\n }\n }, 10);\n }\n }\n\n function removeErrorHTML(path) {\n const node = window.document.getElementById(`less-error-message:${utils.extractId(path)}`);\n if (node) {\n node.parentNode.removeChild(node);\n }\n }\n\n function removeErrorConsole(path) {\n // no action\n }\n\n function removeError(path) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n removeErrorHTML(path);\n } else if (options.errorReporting === 'console') {\n removeErrorConsole(path);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('remove', path);\n }\n }\n\n function errorConsole(e, rootHref) {\n const template = '{line} {content}';\n const filename = e.filename || rootHref;\n const errors = [];\n let content = `${e.type || 'Syntax'}Error: ${e.message || 'There is an error in your .less file'} in ${filename}`;\n\n const errorline = (e, i, classname) => {\n if (e.extract[i] !== undefined) {\n errors.push(template.replace(/\\{line\\}/, (parseInt(e.line, 10) || 0) + (i - 1))\n .replace(/\\{class\\}/, classname)\n .replace(/\\{content\\}/, e.extract[i]));\n }\n };\n\n if (e.line) {\n errorline(e, 0, '');\n errorline(e, 1, 'line');\n errorline(e, 2, '');\n content += ` on line ${e.line}, column ${e.column + 1}:\\n${errors.join('\\n')}`;\n }\n if (e.stack && (e.extract || options.logLevel >= 4)) {\n content += `\\nStack Trace\\n${e.stack}`;\n }\n less.logger.error(content);\n }\n\n function error(e, rootHref) {\n if (!options.errorReporting || options.errorReporting === 'html') {\n errorHTML(e, rootHref);\n } else if (options.errorReporting === 'console') {\n errorConsole(e, rootHref);\n } else if (typeof options.errorReporting === 'function') {\n options.errorReporting('add', e, rootHref);\n }\n }\n\n return {\n add: error,\n remove: removeError\n };\n};\n","/**\n * Kicks off less and compiles any stylesheets\n * used in the browser distributed version of less\n * to kick-start less using the browser api\n */\n/* global window, document */\n\nimport defaultOptions from '../less/default-options';\nimport addDefaultOptions from './add-default-options';\nimport root from './index';\n\nconst options = defaultOptions();\n\nif (window.less) {\n for (const key in window.less) {\n if (window.less.hasOwnProperty(key)) {\n options[key] = window.less[key];\n }\n }\n}\naddDefaultOptions(window, options);\n\noptions.plugins = options.plugins || [];\n\nif (window.LESS_PLUGINS) {\n options.plugins = options.plugins.concat(window.LESS_PLUGINS);\n}\n\nconst less = root(window, options);\nexport default less;\n\nwindow.less = less;\n\nlet css;\nlet head;\nlet style;\n\n// Always restore page visibility\nfunction resolveOrReject(data) {\n if (data.filename) {\n console.warn(data);\n }\n if (!options.async) {\n head.removeChild(style);\n }\n}\n\nif (options.onReady) {\n if (/!watch/.test(window.location.hash)) {\n less.watch();\n }\n // Simulate synchronous stylesheet loading by hiding page rendering\n if (!options.async) {\n css = 'body { display: none !important }';\n head = document.head || document.getElementsByTagName('head')[0];\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n less.registerStylesheetsImmediately();\n less.pageLoadFinished = less.refresh(less.env === 'development').then(resolveOrReject, resolveOrReject);\n}\n","// Export a new default each time\nexport default () => ({\n /* Inline Javascript - @plugin still allowed */\n javascriptEnabled: false,\n\n /* Outputs a makefile import dependency list to stdout. */\n depends: false,\n\n /* (DEPRECATED) Compress using less built-in compression. \n * This does an okay job but does not utilise all the tricks of \n * dedicated css compression. */\n compress: false,\n\n /* Runs the less parser and just reports errors without any output. */\n lint: false,\n\n /* Sets available include paths.\n * If the file in an @import rule does not exist at that exact location, \n * less will look for it at the location(s) passed to this option. \n * You might use this for instance to specify a path to a library which \n * you want to be referenced simply and relatively in the less files. */\n paths: [],\n\n /* color output in the terminal */\n color: true,\n\n /* The strictImports controls whether the compiler will allow an @import inside of either \n * @media blocks or (a later addition) other selector blocks.\n * See: https://github.com/less/less.js/issues/656 */\n strictImports: false,\n\n /* Allow Imports from Insecure HTTPS Hosts */\n insecure: false,\n\n /* Allows you to add a path to every generated import and url in your css. \n * This does not affect less import statements that are processed, just ones \n * that are left in the output css. */\n rootpath: '',\n\n /* By default URLs are kept as-is, so if you import a file in a sub-directory \n * that references an image, exactly the same URL will be output in the css. \n * This option allows you to re-write URL's in imported files so that the \n * URL is always relative to the base imported file */\n rewriteUrls: false,\n\n /* How to process math \n * 0 always - eagerly try to solve all operations\n * 1 parens-division - require parens for division \"/\"\n * 2 parens | strict - require parens for all operations\n * 3 strict-legacy - legacy strict behavior (super-strict)\n */\n math: 0,\n\n /* Without this option, less attempts to guess at the output unit when it does maths. */\n strictUnits: false,\n\n /* Effectively the declaration is put at the top of your base Less file, \n * meaning it can be used but it also can be overridden if this variable \n * is defined in the file. */\n globalVars: null,\n\n /* As opposed to the global variable option, this puts the declaration at the\n * end of your base file, meaning it will override anything defined in your Less file. */\n modifyVars: null,\n\n /* This option allows you to specify a argument to go on to every URL. */\n urlArgs: ''\n});","import {addDataAttr} from './utils';\nimport browser from './browser';\n\nexport default (window, options) => {\n\n // use options from the current script tag data attribues\n addDataAttr(options, browser.currentScript(window));\n\n if (options.isFileProtocol === undefined) {\n options.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window.location.protocol);\n }\n\n // Load styles asynchronously (default: false)\n //\n // This is set to `false` by default, so that the body\n // doesn't start loading before the stylesheets are parsed.\n // Setting this to `true` can result in flickering.\n //\n options.async = options.async || false;\n options.fileAsync = options.fileAsync || false;\n\n // Interval between watch polls\n options.poll = options.poll || (options.isFileProtocol ? 1000 : 1500);\n\n options.env = options.env || (window.location.hostname == '127.0.0.1' ||\n window.location.hostname == '0.0.0.0' ||\n window.location.hostname == 'localhost' ||\n (window.location.port &&\n window.location.port.length > 0) ||\n options.isFileProtocol ? 'development'\n : 'production');\n\n const dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window.location.hash);\n if (dumpLineNumbers) {\n options.dumpLineNumbers = dumpLineNumbers[1];\n }\n\n if (options.useFileCache === undefined) {\n options.useFileCache = true;\n }\n\n if (options.onReady === undefined) {\n options.onReady = true;\n }\n\n if (options.relativeUrls) {\n options.rewriteUrls = 'all';\n }\n};\n","//\n// index.js\n// Should expose the additional browser functions on to the less object\n//\nimport {addDataAttr} from './utils';\nimport lessRoot from '../less';\nimport browser from './browser';\nimport FM from './file-manager';\nimport PluginLoader from './plugin-loader';\nimport LogListener from './log-listener';\nimport ErrorReporting from './error-reporting';\nimport Cache from './cache';\nimport ImageSize from './image-size';\n\nexport default (window, options) => {\n const document = window.document;\n const less = lessRoot();\n\n less.options = options;\n const environment = less.environment;\n const FileManager = FM(options, less.logger);\n const fileManager = new FileManager();\n environment.addFileManager(fileManager);\n less.FileManager = FileManager;\n less.PluginLoader = PluginLoader;\n\n LogListener(less, options);\n const errors = ErrorReporting(window, less, options);\n const cache = less.cache = options.cache || Cache(window, options, less.logger);\n ImageSize(less.environment);\n\n // Setup user functions - Deprecate?\n if (options.functions) {\n less.functions.functionRegistry.addMultiple(options.functions);\n }\n\n const typePattern = /^text\\/(x-)?less$/;\n\n function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n }\n\n // only really needed for phantom\n function bind(func, thisArg) {\n const curryArgs = Array.prototype.slice.call(arguments, 2);\n return function() {\n const args = curryArgs.concat(Array.prototype.slice.call(arguments, 0));\n return func.apply(thisArg, args);\n };\n }\n\n function loadStyles(modifyVars) {\n const styles = document.getElementsByTagName('style');\n let style;\n\n for (let i = 0; i < styles.length; i++) {\n style = styles[i];\n if (style.type.match(typePattern)) {\n const instanceOptions = clone(options);\n instanceOptions.modifyVars = modifyVars;\n const lessText = style.innerHTML || '';\n instanceOptions.filename = document.location.href.replace(/#.*$/, '');\n\n /* jshint loopfunc:true */\n // use closure to store current style\n less.render(lessText, instanceOptions,\n bind((style, e, result) => {\n if (e) {\n errors.add(e, 'inline');\n } else {\n style.type = 'text/css';\n if (style.styleSheet) {\n style.styleSheet.cssText = result.css;\n } else {\n style.innerHTML = result.css;\n }\n }\n }, null, style));\n }\n }\n }\n\n function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) {\n\n const instanceOptions = clone(options);\n addDataAttr(instanceOptions, sheet);\n instanceOptions.mime = sheet.type;\n\n if (modifyVars) {\n instanceOptions.modifyVars = modifyVars;\n }\n\n function loadInitialFileCallback(loadedFile) {\n const data = loadedFile.contents;\n const path = loadedFile.filename;\n const webInfo = loadedFile.webInfo;\n\n const newFileInfo = {\n currentDirectory: fileManager.getPath(path),\n filename: path,\n rootFilename: path,\n rewriteUrls: instanceOptions.rewriteUrls\n };\n\n newFileInfo.entryPath = newFileInfo.currentDirectory;\n newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory;\n\n if (webInfo) {\n webInfo.remaining = remaining;\n\n const css = cache.getCSS(path, webInfo, instanceOptions.modifyVars);\n if (!reload && css) {\n webInfo.local = true;\n callback(null, css, data, sheet, webInfo, path);\n return;\n }\n\n }\n\n // TODO add tests around how this behaves when reloading\n errors.remove(path);\n\n instanceOptions.rootFileInfo = newFileInfo;\n less.render(data, instanceOptions, (e, result) => {\n if (e) {\n e.href = path;\n callback(e);\n } else {\n cache.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css);\n callback(null, result.css, data, sheet, webInfo, path);\n }\n });\n }\n\n fileManager.loadFile(sheet.href, null, instanceOptions, environment)\n .then(loadedFile => {\n loadInitialFileCallback(loadedFile);\n }).catch(err => {\n console.log(err);\n callback(err);\n });\n\n }\n\n function loadStyleSheets(callback, reload, modifyVars) {\n for (let i = 0; i < less.sheets.length; i++) {\n loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1), modifyVars);\n }\n }\n\n function initRunningMode() {\n if (less.env === 'development') {\n less.watchTimer = setInterval(() => {\n if (less.watchMode) {\n fileManager.clearFileCache();\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n } else if (css) {\n browser.createCSS(window.document, css, sheet);\n }\n });\n }\n }, options.poll);\n }\n }\n\n //\n // Watch mode\n //\n less.watch = function () {\n if (!less.watchMode ) {\n less.env = 'development';\n initRunningMode();\n }\n this.watchMode = true;\n return true;\n };\n\n less.unwatch = function () {clearInterval(less.watchTimer); this.watchMode = false; return false; };\n\n //\n // Synchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\".\n //\n less.registerStylesheetsImmediately = () => {\n const links = document.getElementsByTagName('link');\n less.sheets = [];\n\n for (let i = 0; i < links.length; i++) {\n if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&\n (links[i].type.match(typePattern)))) {\n less.sheets.push(links[i]);\n }\n }\n };\n\n //\n // Asynchronously get all tags with the 'rel' attribute set to\n // \"stylesheet/less\", returning a Promise.\n //\n less.registerStylesheets = () => new Promise((resolve, reject) => {\n less.registerStylesheetsImmediately();\n resolve();\n });\n\n //\n // With this function, it's possible to alter variables and re-render\n // CSS without reloading less-files\n //\n less.modifyVars = record => less.refresh(true, record, false);\n\n less.refresh = (reload, modifyVars, clearFileCache) => {\n if ((reload || clearFileCache) && clearFileCache !== false) {\n fileManager.clearFileCache();\n }\n return new Promise((resolve, reject) => {\n let startTime;\n let endTime;\n let totalMilliseconds;\n let remainingSheets;\n startTime = endTime = new Date();\n\n // Set counter for remaining unprocessed sheets\n remainingSheets = less.sheets.length;\n\n if (remainingSheets === 0) {\n\n endTime = new Date();\n totalMilliseconds = endTime - startTime;\n less.logger.info('Less has finished and no sheets were loaded.');\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n\n } else {\n // Relies on less.sheets array, callback seems to be guaranteed to be called for every element of the array\n loadStyleSheets((e, css, _, sheet, webInfo) => {\n if (e) {\n errors.add(e, e.href || sheet.href);\n reject(e);\n return;\n }\n if (webInfo.local) {\n less.logger.info(`Loading ${sheet.href} from cache.`);\n } else {\n less.logger.info(`Rendered ${sheet.href} successfully.`);\n }\n browser.createCSS(window.document, css, sheet);\n less.logger.info(`CSS for ${sheet.href} generated in ${new Date() - endTime}ms`);\n\n // Count completed sheet\n remainingSheets--;\n\n // Check if the last remaining sheet was processed and then call the promise\n if (remainingSheets === 0) {\n totalMilliseconds = new Date() - startTime;\n less.logger.info(`Less has finished. CSS generated in ${totalMilliseconds}ms`);\n resolve({\n startTime,\n endTime,\n totalMilliseconds,\n sheets: less.sheets.length\n });\n }\n endTime = new Date();\n }, reload, modifyVars);\n }\n\n loadStyles(modifyVars);\n });\n };\n\n less.refreshStyles = loadStyles;\n return less;\n};\n","export default (less, options) => {\n const logLevel_debug = 4;\n const logLevel_info = 3;\n const logLevel_warn = 2;\n const logLevel_error = 1;\n\n // The amount of logging in the javascript console.\n // 3 - Debug, information and errors\n // 2 - Information and errors\n // 1 - Errors\n // 0 - None\n // Defaults to 2\n options.logLevel = typeof options.logLevel !== 'undefined' ? options.logLevel : (options.env === 'development' ? logLevel_info : logLevel_error);\n\n if (!options.loggers) {\n options.loggers = [{\n debug: function(msg) {\n if (options.logLevel >= logLevel_debug) {\n console.log(msg);\n }\n },\n info: function(msg) {\n if (options.logLevel >= logLevel_info) {\n console.log(msg);\n }\n },\n warn: function(msg) {\n if (options.logLevel >= logLevel_warn) {\n console.warn(msg);\n }\n },\n error: function(msg) {\n if (options.logLevel >= logLevel_error) {\n console.error(msg);\n }\n }\n }];\n }\n for (let i = 0; i < options.loggers.length; i++) {\n less.logger.addListener(options.loggers[i]);\n }\n};\n","// Cache system is a bit outdated and could do with work\n\nexport default (window, options, logger) => {\n let cache = null;\n if (options.env !== 'development') {\n try {\n cache = (typeof window.localStorage === 'undefined') ? null : window.localStorage;\n } catch (_) {}\n }\n return {\n setCSS: function(path, lastModified, modifyVars, styles) {\n if (cache) {\n logger.info(`saving ${path} to cache.`);\n try {\n cache.setItem(path, styles);\n cache.setItem(`${path}:timestamp`, lastModified);\n if (modifyVars) {\n cache.setItem(`${path}:vars`, JSON.stringify(modifyVars));\n }\n } catch (e) {\n // TODO - could do with adding more robust error handling\n logger.error(`failed to save \"${path}\" to local storage for caching.`);\n }\n }\n },\n getCSS: function(path, webInfo, modifyVars) {\n const css = cache && cache.getItem(path);\n const timestamp = cache && cache.getItem(`${path}:timestamp`);\n let vars = cache && cache.getItem(`${path}:vars`);\n\n modifyVars = modifyVars || {};\n vars = vars || \"{}\"; // if not set, treat as the JSON representation of an empty object\n\n if (timestamp && webInfo.lastModified &&\n (new Date(webInfo.lastModified).valueOf() ===\n new Date(timestamp).valueOf()) &&\n JSON.stringify(modifyVars) === vars) {\n // Use local copy\n return css;\n }\n }\n };\n};\n","\nimport functionRegistry from './../less/functions/function-registry';\n\nexport default () => {\n function imageSize() {\n throw {\n type: 'Runtime',\n message: 'Image size functions are not supported in browser version of less'\n };\n }\n\n const imageFunctions = {\n 'image-size': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-width': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n },\n 'image-height': function(filePathNode) {\n imageSize(this, filePathNode);\n return -1;\n }\n };\n\n functionRegistry.addMultiple(imageFunctions);\n};\n"],"names":["extractId","href","replace","addDataAttr","options","tag","opt","dataset","hasOwnProperty","JSON","parse","_","document","styles","sheet","id","title","utils.extractId","oldStyleNode","getElementById","keepOldStyleNode","styleNode","createElement","setAttribute","media","styleSheet","appendChild","createTextNode","childNodes","length","firstChild","nodeValue","head","getElementsByTagName","nextEl","nextSibling","parentNode","insertBefore","removeChild","cssText","e","Error","window","scripts","currentScript","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","m","cm","mm","in","px","pt","pc","duration","s","ms","angle","rad","Math","PI","deg","grad","turn","colors","unitConversions","this","parent","visibilityBlocks","undefined","nodeVisible","rootNode","parsed","self","Object","defineProperty","get","fileInfo","getIndex","Node","nodes","set","node","Array","isArray","forEach","_index","_fileInfo","context","strs","genCSS","add","chunk","index","push","isEmpty","join","output","value","visitor","visit","op","a","b","precision","numPrecision","Number","toFixed","info","compare","type","i_1","numericCompare","rgb","originalForm","_super","_this","match","map","c","i","parseInt","alpha","split","__extends","Color","r","g","pow","toCSS","doNotCompress","color","colorFunction","compress","args","fround","indexOf","clamp","round","concat","toHSL","h","l","toRGB","splitcolor","other","_operate","toHex","max","min","d","v","x","toString","prototype","fromKeyword","keyword","key","toLowerCase","slice","Paren","eval","_noSpaceCombinators"," ","|","emptyOrWhitespace","trim","Combinator","spaceOrEmpty","combinator","isVariable","currentFileInfo","visibilityInfo","copyVisibilityInfo","setParent","Element","firstSelector","charAt","ALWAYS","PARENS_DIVISION","PARENS","STRICT_LEGACY","RewriteUrls","clone","_instanceof","obj","nativeMap","nativeSet","nativePromise","Map","Set","Promise","circular","depth","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","Infinity","_clone","child","proto","resolve","reject","then","err","__isArray","__isRegExp","RegExp","source","__getRegExpFlags","lastIndex","__isDate","Date","getTime","isBuffer","allocUnsafe","copy","create","getPrototypeOf","keyChild","valueChild","entryChild","attrs","getOwnPropertyDescriptor","getOwnPropertySymbols","symbols","symbol","descriptor","enumerable","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","o","call","re","flags","global","ignoreCase","multiline","clonePrototype","module","exports","getLocation","inputStream","n","line","column","copyArray","arr","cloned","prop","defaults","obj1","obj2","newObj","_defaults","defaults_1","CloneHelper","assign","copyOptions","opts","strictMath","math","Constants.Math","relativeUrls","rewriteUrls","Constants.RewriteUrls","flattenArray","result","length_1","anonymousFunc","LessError","fileContentMap","currentFilename","filename","message","stack","input","contents","loc","utils.getLocation","col","callLine","lines","found","func","Function","lineAdjust","callExtract","extract","F","constructor","error","stylize","str","errorTxt","substr","elements","extendList","condition","evaldCondition","getElements","mixinElements_","Selector","visitArray","newSelector","mediaEmpty","els","parseNode","imports","sels","olen","len","mixinElements","shift","extend","createDerived","Value","Keyword","True","False","mapLines","rulesetLike","allowRoot","Anonymous","Boolean","MATH","name","important","merge","inline","variable","Declaration","lastRule","prevMath","evaldValue","mathBypass","evalName","importantScope","importantResult","pop","debugInfo","ctx","lineSeparator","dumpLineNumbers","asComment","asMediaQuery","lineNumber","fileName","filenameWithProtocol","test","isLineComment","Comment","getDebugInfo","isCompressed","contexts","copyFromOriginal","original","destination","propertiesToCopy","parseCopyProperties","Parse","paths","evalCopyProperties","isPathRelative","path","isPathLocalRelative","Eval","frames","inCalc","mathOn","calcStack","parensStack","rootpath","newPath","normalizePath","segment","segments","reverse","makeRegistry","base","_data","addMultiple","functions","keys","getLocalFunctions","inherit","defaultFunc","value_","error_","reset","selectors","rules","strictImports","_lookups","_variables","_properties","Ruleset","selCnt","selector","hasVariable","hasOnePassingSelector","j","toParseSelectors","utils.flattenArray","rule","subRule","utils.copyArray","ruleset","originalRuleset","root","firstRoot","allowImports","functionRegistry","globalFunctionRegistry","ctxFrames","unshift","ctxSelectors","evalImports","rsRules","evalFirst","mediaBlockCount","mediaBlocks","filter","splice","resetCache","isJustParentSelector","bubbleSelectors","importRules","makeImportant","lastSelector","_rulesets","reduce","hash","variables","vars","name_1","name_2","decl","parseValue","properties","toParse","transformDeclaration","nodes_1","filtRules","isRuleset","foundMixins","rulesets","find","i_2","apply","ruleNodes","tabLevel","sep","tabRuleStr","tabSetStr","charsetNodeIndex","importNodeIndex","isCharset","pathCnt","pathSubCnt","currentLastRule","isRulesetLike","isVisible","joinSelector","createParenthesis","elementsToPak","originalElement","replacementParen","insideParent","createSelector","containedElement","element","addReplacementIntoPath","beginningPath","addPath","replacedElement","originalSelector","newSelectorPath","newJoinedSelector","parentEl","restOfPath","addAllReplacementsIntoPath","addPaths","mergeElementsOnToSelectors","sel","deriveSelector","deriveFrom","newPaths","replaceParentSelector","inSelector","k","currentElements","newSelectors","selectorsMultiplied","el","maybeSelector","hadParentSelector","nestedSelector","replaced","nestedPaths","replacedNewSelectors","concatenated","bind","isRooted","createEmptySelectors","AtRule","outputRuleset","mediaPathBackup","mediaBlocksBackup","mediaPath","_i","ruleCnt","DetachedRuleset","numerator","denominator","backupUnit","sort","Unit","strictUnits","returnStr","is","unitString","toUpperCase","callback","group","mapUnit","groupName","atomicUnit","counter","count","unit","parseFloat","isNaN","Dimension","isSingular","strValue","String","isLength","convertTo","usedUnits","cancel","unify","conversions","targetUnit","applyUnit","derivedConversions","operands","isSpaced","Operation","isMathOn","toColor","operate","noSpacing","Expression","returnValue","inParenthesis","parens","parensInOp","doubleParen","outOfParenthesis","functionCaller","item","subNodes","calc","Call","currentMathContext","enterCalc","exitCalc","funcCaller","FunctionCaller","isValid","columnNumber","Variable","evaluating","frame","fun","Property","property","mergeRules","pluginManager","less","visitors","ToCSSVisitor","_mergeRules","vArr","Attribute","content","escaped","quote","variableRegex","propRegex","Quoted","that","iterativeReplace","regexp","replacementFnc","evaluatedValue","val","isEvald","URL","pathRequiresRewrite","rewritePath","urlArgs","features","Media","evalTop","evalNested","multiMedia","permute","fragment","rest","css","pathValue","getPath","Import","isPlugin","reference","containsVariables","doEval","blocksVisibility","addVisibilityBlock","registry","skip","importedFilename","newImport","evalPath","string","expression","JavaScript","evaluateJavaScript","JsEvalNode","evalContext","javascriptEnabled","jsify","toJS","Assignment","negate","lvalue","rvalue","Condition","UnicodeDescriptor","Negative","option","object_id","Extend","next_id","parent_ids","allowBefore","allowAfter","selectorElements","selfElements","selfSelectors","VariableCall","detachedRuleset","callEval","ruleCall","lookups","NamespaceValue","lastDeclaration","substring","params","variadic","arity","optionalParameters","required","p","Definition","mixinEnv","evaldArguments","varargs","arg","isNamedFound","argIndex","argsLength","prependRule","_arguments","mixinFrames","evalParams","allArgsCnt","requiredArgsCnt","arguments","MixinCall","mixins","mixin","mixinPath","argValue","f","isRecursive","isOneFound","candidate","defaultResult","noArgumentsFilter","candidates","conditionResult","calcDefGroup","namespace","matchCondition","expand","matchArgs","MixinDefinition","format","newRules","evalCall","_setVisibilityToReplacement","replacement","msg","_fireEvent","warn","debug","addListener","listener","_listeners","removeListener","logFunction","externalEnvironment","fileManagers","requiredFunctions","propName","environmentFunc","environment","currentDirectory","isSync","logger","getFileManagers","fileManager","AbstractFileManager","lastIndexOf","ext","tryAppendExtension","basePath","laterPath","url","baseUrl","urlDirectories","baseUrlDirectories","urlParts","extractUrlParts","baseUrlParts","diff","hostPart","directories","urlPartsRegex","returner","rawDirectories","rawPath","fileUrl","require","AbstractPluginLoader","pluginOptions","pluginObj","localModule","shortname","FileManager","trySetOptions","use","loader","tree","validatePlugin","minVersion","compareVersion","addPlugin","plugin","setOptions","version","versionToString","aVersion","bVersion","versionString","plugins","i_3","printUsage","_visitArgs","visitDeeper","_hasIndexed","_noop","implementation","_implementation","_visitInCache","_visitOutCache","indexNodeTypes","ticker","typeIndex","Visitor","nodeTypeIndex","fnName","impl","funcOut","visitArgs","newNode","isReplacing","cnt","accept","nonReplacing","out","evald","flatten","nestedCnt","nestedItem","onSequencerEmpty","variableImports","_onSequencerEmpty","_currentDepth","ImportSequencer","importSequencer","importItem","isReady","tryRun","variableImport","ImportVisitor","importer","finish","_visitor","_importer","_finish","importCount","onceFileDetectionMap","recursionDetector","_sequencer","run","isFinished","visitImport","importNode","inlineCSS","importParent","isVariableImport","addVariableImport","processImportNode","evaldImportNode","evalForImport","multiple","importMultiple","tryAppendLessExtension","onImported","sequencedOnImported","addImport","importedAtRoot","fullPath","importVisitor","isOptional","optional","duplicateImport","oldContext","visitDeclaration","declNode","visitDeclarationOut","visitAtRule","atRuleNode","visitAtRuleOut","visitMixinDefinition","mixinDefinitionNode","visitMixinDefinitionOut","visitRuleset","rulesetNode","visitRulesetOut","visitMedia","mediaNode","visitMediaOut","visible","SetTreeVisibilityVisitor","ensureVisibility","ensureInvisibility","allExtendsStack","ExtendFinderVisitor","allExtends","allSelectorsExtendList","extendOnEveryPath","selectorPath","selExtendList","allSelectorsExtend","foundExtends","findSelfSelectors","firstExtendOnThisSelectorPath","ProcessExtendsVisitor","extendFinder","extendIndices","doExtendChaining","newRoot","checkExtendsForNonMatched","indices","hasFoundMatches","extendsList","extendsListTarget","iterationCount","extendIndex","targetExtendIndex","matches","targetExtend","newExtend","extendsToAdd","extendVisitor","findMatch","selfSelector","extendSelector","extendChainCount","selectorOne","selectorTwo","ruleNode","selectorNode","pathIndex","selectorsToAdd","extendedSelectors","haystackSelectorPath","haystackSelectorIndex","hackstackSelector","hackstackElementIndex","haystackElement","targetCombinator","potentialMatch","needleElements","potentialMatches","matched","initialCombinator","isElementValuesEqual","finished","endPathIndex","endPathElementIndex","elementValue1","elementValue2","replacementSelector","matchIndex","firstElement","newElements","currentSelectorPathIndex","currentSelectorPathElementIndex","currentValue","derived","newAllExtends","JoinSelectorVisitor","getIsOutput","joinSelectors","_context","CSSVisitorUtils","bodyRules","isSilent","owner","thing","originalRules","containsSilentNonBlockedChild","compiledRulesBody","keepOnlyVisibleChilds","removeVisibilityBlock","hasVisibleSelector","utils","mixinNode","visitExtend","extendNode","visitComment","commentNode","resolveVisibility","visitAtRuleWithBody","visitAtRuleWithoutBody","visitAnonymous","anonymousNode","nodeRules","hasFakeRuleset","getBodyRules","charset","comment","checkValidNodes","isRoot","_compileRulesetPaths","nodeRuleCnt","_removeDuplicateRules","isVisibleRuleset","ruleList","ruleCache","ruleCSS","groups","groupsArr","result_1","space_1","comma_1","MarkVisibleSelectorsVisitor","ExtendVisitor","furthest","furthestPossibleErrorMessage","chunks","current","currentPos","saveStack","parserInput","skipWhitespace","nextChar","oldi","oldj","curr","endIndex","mem","inp","charCodeAt","autoCommentAbsorb","nextNewLine","text","commentStore","nextStarSlash","save","restore","possibleErrorMessage","state","forget","isWhitespace","offset","pos","code","$re","tok","exec","$char","$str","tokLength","$quoted","startChar","currentPosition","$parseUntil","testChar","returnVal","inComment","blockDepth","blockStack","parseGroups","startPos","lastPos","loop","char","expected","peek","peekChar","currentChar","prevChar","getInput","peekNotNumeric","start","chunkInput","failFunction","fail","lastOpening","lastOpeningParen","lastMultiComment","lastMultiCommentEndBrace","chunkerCurrentIndex","currentChunkStartIndex","cc","cc2","level","parenLevel","emitFrom","emitChunk","force","fromCharCode","chunker","end","furthestReachedEnd","furthestChar","Parser","parsers","getParserInput","expect","expectChar","parseList","currentIndex","returnNodes","parser","additionalData","globalVars","modifyVars","ignored","preText","serializeVars","preProcessors","getPreProcessors","process","banner","contentsIgnoredChars","primary","endInfo","processImports","extendRule","definition","declaration","variableCall","entities","atrule","foundSemiColon","mixinLookup","quoted","forceEscaped","isEscaped","customFuncCall","stop","ieAlpha","boolean","if","prevArgs","isSemiColonSeparated","argsComma","argsSemiColon","assignment","literal","dimension","unicodeDescriptor","entity","ch","variableCurly","curly","propertyCurly","colorKeyword","ud","javascript","js","escape","parsedName","inValue","ruleLookups","isRule","getLookup","hasParens","elem","elemIndex","isCall","expressionContainsNamed","nameLoop","expressions","hasSep","throwAwayComments","cond","argInfo","conditions","block","lookupValue","attribute","slashedCombinator","isLess","when","blockRuleset","hasDR","ruleProperty","permissiveValue","anonymousValue","untilTokens","done","testCurrentChar","import","dir","options_1","importOptions","mediaFeatures","optionName","importOption","mediaFeature","pluginArgs","nonVendorSpecificName","hasIdentifier","hasExpression","hasUnknown","hasBlock","sub","addition","multiplication","operation","operand","needsParens","logical","next","conditionAnd","negatedCondition","parenthesisCondition","atomicCondition","body","me","tryConditionFollowedByParenthesis","delim","simpleProperty","colorFunctions","trueValue","falseValue","hsla","origColor","hsl","toHSV","number","rgba","size","m1_1","m2_1","hue","hsv","hsva","vs","floor","perm","saturation","lightness","hsvhue","hsvsaturation","hsvvalue","luma","luminance","saturate","amount","method","desaturate","lighten","darken","fadein","fadeout","fade","spin","mix","color1","color2","weight","w","w1","w2","greyscale","contrast","dark","light","threshold","t","argb","toARGB","tint","shade","colorBlend","mode","cb","cs","ar","cr","ab","as","colorBlendModeFunctions","multiply","screen","overlay","softlight","sqrt","hardlight","difference","abs","exclusion","average","negation","getItemsFromNode","_SELF","values","range","step","from","to","stepValue","list","each","rs","iterator","Quote","valueName","keyName","indexName","MathHelper","fn","mathFunctions","ceil","sin","cos","atan","asin","acos","mathHelper","fraction","num","pm","minMax","isMin","currentUnified","referenceUnified","unitStatic","unitClone","order","convert","pi","mod","y","percentage","evaluated","encodeURI","pattern","%","token","encodeURIComponent","isa","Type","isunit","isruleset","iscolor","isnumber","isstring","iskeyword","isurl","ispixel","ispercentage","isem","get-unit","colorBlending","fallback","functionThis","data-uri","mimetypeNode","filePathNode","mimetype","filePath","entryPath","fragmentStart","utils.clone","rawBuffer","getFileManager","useBase64","mimeLookup","charsetLookup","fileSync","loadFileSync","buf","encodeBase64","uri","dataUri","svg-gradient","direction","stops","gradientDirectionSvg","position","positionValue","gradientType","rectangleDimension","renderEnv","directionValue","throwArgumentDescriptor","types","evaldRoot","evalEnv","visitorIterator","preEvalVisitors","first","isPreEvalVisitor","isPreVisitor","postProcessors","installedPlugins","pluginCache","Loader","PluginLoader","PluginManager","install","preProcessor","priority","indexToInsertAt","postProcessor","manager","PluginManagerFactory","newFactory","SourceMapOutput","_css","_rootNode","_contentsMap","contentsMap","_contentsIgnoredCharsMap","contentsIgnoredCharsMap","sourceMapFilename","_sourceMapFilename","_outputFilename","outputFilename","sourceMapURL","sourceMapBasepath","_sourceMapBasepath","sourceMapRootpath","_sourceMapRootpath","_outputSourceFiles","outputSourceFiles","_sourceMapGeneratorConstructor","getSourceMapGenerator","_lineNumber","_column","removeBasepath","sourceLines","columns","sourceColumns","inputSource","_sourceMapGenerator","addMapping","generated","normalizeFilename","file","sourceRoot","setSourceContent","sourceMapContent","stringify","toJSON","sourceMap","sourceMapOutput","Environment","SourceMapBuilder","sourceMapOutputFilename","sourceMapGenerator","sourceMapFileInline","sourceMapInputFilename","getCSSAppendage","sourceMapBuilder","ParseTree","transformTree","toCSSOptions","getPostProcessors","getExternalSourceMap","rootFilename","files","parseTree","ImportManager","rootFileInfo","mime","queue","importManager","pluginLoader","fileParsedFunc","importedEqualsRoot","newFileInfo","promise","loadFileCallback","loadedFile","resolvedFilename","pathDiff","isPathAbsolute","alwaysMakePathsAbsolute","newEnv","evalPlugin","loadPlugin","loadFile","render","utils.copyOptions","self_1","Render","context_1","pluginManager_1","reUsePluginManager","imports_1","evalResult","fileContent","Functions","initial","data","ctor","api","fileCache","errback","xhr","XMLHttpRequest","async","isFileProtocol","fileAsync","handleResponse","status","responseText","getResponseHeader","overrideMimeType","open","setRequestHeader","send","onreadystatechange","readyState","location","useFileCache","lessText_1","webInfo","lastModified","doXHR","log","fulfill","catch","rootHref","errorReporting","errors","errorline","classname","logLevel","errorConsole","timer","filenameNoPath","className","innerHTML","browser","style","env","setInterval","replaceChild","clearInterval","errorHTML","remove","removeErrorHTML","depends","lint","insecure","protocol","poll","hostname","port","onReady","addDefaultOptions","LESS_PLUGINS","lessRoot","FM","addFileManager","loggers","console","LogListener","ErrorReporting","cache","localStorage","setCSS","setItem","getCSS","getItem","timestamp","valueOf","Cache","imageSize","imageFunctions","image-size","image-width","image-height","ImageSize","typePattern","thisArg","curryArgs","loadStyles","instanceOptions","loadStyleSheet","reload","remaining","local","loadInitialFileCallback","loadStyleSheets","sheets","watch","watchMode","watchTimer","clearFileCache","unwatch","registerStylesheetsImmediately","links","rel","registerStylesheets","record","refresh","startTime","endTime","totalMilliseconds","remainingSheets","refreshStyles","resolveOrReject","pageLoadFinished"],"mappings":";;;;;;;;;oMACgBA,EAAUC,GACtB,OAAOA,EAAKC,QAAQ,sBAAuB,IACtCA,QAAQ,uBAAwB,IAChCA,QAAQ,MAAO,IACfA,QAAQ,eAAgB,IACxBA,QAAQ,aAAc,KACtBA,QAAQ,MAAO,cAGRC,EAAYC,EAASC,GACjC,IAAK,IAAMC,KAAOD,EAAIE,QAClB,GAAIF,EAAIE,QAAQC,eAAeF,GAC3B,GAAY,QAARA,GAAyB,oBAARA,GAAqC,aAARA,GAA8B,mBAARA,EACpEF,EAAQE,GAAOD,EAAIE,QAAQD,QAE3B,IACIF,EAAQE,GAAOG,KAAK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-manager.js b/lib/less/import-manager.js index 5b25707b1..444c23b07 100644 --- a/lib/less/import-manager.js +++ b/lib/less/import-manager.js @@ -26,6 +26,7 @@ export default environment => { this.context = context; // Deprecated? Unused outside of here, could be useful. this.queue = []; // Files which haven't been imported yet + this.files = []; // List of files imported } /** @@ -51,6 +52,10 @@ export default environment => { logger.info(`The file ${fullPath} was skipped because it was not found and the import was marked optional.`); } else { + const files = importManager.files + if (files.indexOf(fullPath) === -1) { + files.push(fullPath) + } if (e && !importManager.error) { importManager.error = e; } callback(e, root, importedEqualsRoot, fullPath); } diff --git a/lib/less/index.js b/lib/less/index.js index c18ee2860..9ea022214 100644 --- a/lib/less/index.js +++ b/lib/less/index.js @@ -42,7 +42,7 @@ export default (environment, fileManagers) => { * It's not clear what should / must be public and why. */ const initial = { - version: [3, 11, 2], + version: [3, 11, 3], data, tree, Environment, diff --git a/lib/less/parse-tree.js b/lib/less/parse-tree.js index 462de6fd5..2741a0441 100644 --- a/lib/less/parse-tree.js +++ b/lib/less/parse-tree.js @@ -52,12 +52,8 @@ export default SourceMapBuilder => { result.map = sourceMapBuilder.getExternalSourceMap(); } - result.imports = []; - for (const file in this.imports.files) { - if (this.imports.files.hasOwnProperty(file) && file !== this.imports.rootFilename) { - result.imports.push(file); - } - } + const rootFilename = this.imports.rootFilename + result.imports = this.imports.files.filter(file => file !== rootFilename); return result; } } diff --git a/package.json b/package.json index 83f459a95..ebfd5dfdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "3.11.2", + "version": "3.11.3", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { diff --git a/test/index.js b/test/index.js index 98e885849..47d71154c 100644 --- a/test/index.js +++ b/test/index.js @@ -48,6 +48,12 @@ var testMap = [ } return path.join('test/sourcemaps', filename) + '.json'; }], + + [{math: 'strict', strictUnits: true, globalVars: true }, 'import/json/', + lessTester.testImports, null, true, + function(filename, type, baseFolder) { + return path.join(baseFolder, filename) + '.json'; + }], [{math: 'strict', strictUnits: true, sourceMap: {sourceMapFileInline: true}}, 'sourcemaps-empty/', lessTester.testEmptySourcemap], [{globalVars: true, banner: '/**\n * Test\n */\n'}, 'globalVars/', diff --git a/test/less-test.js b/test/less-test.js index 5e127ab91..9cc61bfb6 100644 --- a/test/less-test.js +++ b/test/less-test.js @@ -140,6 +140,42 @@ module.exports = function() { } } + function testImports(name, err, compiledLess, doReplacements, sourcemap, baseFolder, imports) { + if (err) { + fail('ERROR: ' + (err && err.message)); + return; + } + + function stringify(str) { + return JSON.stringify(imports, null, ' ') + } + + /** Imports are not sorted */ + const importsString = stringify(imports.sort()) + + fs.readFile(path.join('test/less/', name) + '.json', 'utf8', function (e, expectedImports) { + if (e) { + fail('ERROR: ' + (e && e.message)); + return; + } + process.stdout.write('- ' + path.join(baseFolder, name) + ': '); + expectedImports = stringify(JSON.parse(expectedImports).sort()); + expectedImports = globalReplacements(expectedImports, baseFolder); + + if (expectedImports === importsString) { + ok('OK'); + } else if (err) { + fail('ERROR: ' + (err && err.message)); + if (isVerbose) { + process.stdout.write('\n'); + process.stdout.write(err.stack + '\n'); + } + } else { + difference('FAIL', expectedImports, importsString); + } + }); + } + function testErrors(name, err, compiledLess, doReplacements, sourcemap, baseFolder) { fs.readFile(path.join(baseFolder, name) + '.txt', 'utf8', function (e, expectedErr) { process.stdout.write('- ' + path.join(baseFolder, name) + ': '); @@ -303,8 +339,13 @@ module.exports = function() { } doubleCallCheck = (new Error()).stack; + /** + * @todo - refactor so the result object is sent to the verify function + */ if (verifyFunction) { - var verificationResult = verifyFunction(name, err, result && result.css, doReplacements, result && result.map, baseFolder); + var verificationResult = verifyFunction( + name, err, result && result.css, doReplacements, result && result.map, baseFolder, result && result.imports + ); release(); return verificationResult; } @@ -362,7 +403,7 @@ module.exports = function() { process.stdout.write(stylize(msg, 'yellow') + '\n'); failedTests++; - diff(left, right); + diff(left || '', right || ''); endTest(); } @@ -452,6 +493,7 @@ module.exports = function() { testSyncronous: testSyncronous, testErrors: testErrors, testSourcemap: testSourcemap, + testImports: testImports, testEmptySourcemap: testEmptySourcemap, testNoOptions: testNoOptions, prepBomTest: prepBomTest, diff --git a/test/less/import/json/index.json b/test/less/import/json/index.json new file mode 100644 index 000000000..4dc72c3c8 --- /dev/null +++ b/test/less/import/json/index.json @@ -0,0 +1,11 @@ +[ + "{path}/import/import-test-a.less", + "{path}/import/import-test-b.less", + "{path}/import/deeper/url-import.less", + "{path}/import/urls.less", + "{path}/import/import-test-c.less", + "{path}/import/deeper/deeper-2/url-import.less", + "{path}/import/deeper/deeper-2/url-import-2.less", + "{path}/import/import-test-f.less", + "{path}/import/import-test-e.less" +] \ No newline at end of file diff --git a/test/less/import/json/index.less b/test/less/import/json/index.less new file mode 100644 index 000000000..f865e531c --- /dev/null +++ b/test/less/import/json/index.less @@ -0,0 +1 @@ +@import "../import-test-a"; \ No newline at end of file