From e000c78597559c9708a3d6077c7485591eee3d63 Mon Sep 17 00:00:00 2001 From: Moez Bouhlel Date: Sun, 26 Oct 2014 21:26:14 +0100 Subject: [PATCH 01/29] fix rootpath without / at the end handling --- lib/less/render.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/less/render.js b/lib/less/render.js index 2a164f90..4dce5ef0 100644 --- a/lib/less/render.js +++ b/lib/less/render.js @@ -45,6 +45,9 @@ module.exports = function(environment, ParseTree, ImportManager) { }; } + if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== "/") + rootFileInfo.rootpath += "/"; + var imports = new ImportManager(context, rootFileInfo); var parser = new Parser(context, imports, rootFileInfo); From e8aa9442aab2105e73474958af6ef89790c7062c Mon Sep 17 00:00:00 2001 From: Bass Jobsen Date: Tue, 13 Jan 2015 21:39:05 +0100 Subject: [PATCH 02/29] message when sourcemap has been written --- bin/lessc | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/lessc b/bin/lessc index b2607f7d..ee7368e8 100755 --- a/bin/lessc +++ b/bin/lessc @@ -345,6 +345,7 @@ if (!sourceMapFileInline) { var filename = sourceMapOptions.sourceMapFullFilename; ensureDirectory(filename); fs.writeFileSync(filename, output, 'utf8'); + less.logger.info('lessc: wrote ' + filename); }; } From 7f8026284acebb9e042e4b9a0bdf1ac2fa65b60e Mon Sep 17 00:00:00 2001 From: shaun Date: Tue, 13 Jan 2015 19:48:03 -0800 Subject: [PATCH 03/29] Remove BOM in imports. Modified tests to run against a copy of the test files with BOMs inserted into each .less and .css file (the copies are generated automatically if the /test/less-bom folder doesn't exist or is empty). --- .gitignore | 1 + bin/lessc | 2 ++ lib/less/import-manager.js | 2 +- test/copy-bom.js | 66 ++++++++++++++++++++++++++++++++++++++ test/index.js | 22 ++++++------- test/less-test.js | 46 ++++++++++++++++++-------- 6 files changed, 114 insertions(+), 25 deletions(-) create mode 100644 test/copy-bom.js diff --git a/.gitignore b/.gitignore index e1445711..f461f61d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ test/browser/less.js test/sourcemaps/**/*.map test/sourcemaps/*.map test/sourcemaps/*.css +test/less-bom # grunt .grunt diff --git a/bin/lessc b/bin/lessc index b2607f7d..577186b5 100755 --- a/bin/lessc +++ b/bin/lessc @@ -355,6 +355,8 @@ var parseLessFile = function (e, data) { return; } + data = data.replace(/^\uFEFF/, ''); + options.paths = [path.dirname(input)].concat(options.paths); options.filename = input; diff --git a/lib/less/import-manager.js b/lib/less/import-manager.js index 57bc447d..d70c1605 100644 --- a/lib/less/import-manager.js +++ b/lib/less/import-manager.js @@ -68,7 +68,7 @@ module.exports = function(environment) { var loadFileCallback = function(loadedFile) { var resolvedFilename = loadedFile.filename, - contents = loadedFile.contents; + contents = loadedFile.contents.replace(/^\uFEFF/, ''); // Pass on an updated rootpath if path of imported file is relative and file // is in a (sub|sup) directory diff --git a/test/copy-bom.js b/test/copy-bom.js new file mode 100644 index 00000000..d1d38878 --- /dev/null +++ b/test/copy-bom.js @@ -0,0 +1,66 @@ +/*jshint latedef: nofunc */ + +// This is used to copy a folder (the test/less/* files & sub-folders), adding a BOM to the start of each LESS and CSS file. +// This is a based on the copySync method from fs-extra (https://github.com/jprichardson/node-fs-extra/). + +module.exports = function() { + var path = require('path'), + fs = require('fs'); + + var BUF_LENGTH = 64 * 1024; + var _buff = new Buffer(BUF_LENGTH); + + function copyFolderWithBom(src, dest) { + var stats = fs.lstatSync(src); + var destFolder = path.dirname(dest); + var destFolderExists = fs.existsSync(destFolder); + var performCopy = false; + + if (stats.isFile()) { + if (!destFolderExists) + fs.mkdirSync(destFolder); + if (src.match(/\.(css|less)$/)) + copyFileAddingBomSync(src, dest); + else + copyFileSync(src, dest) + } + else if (stats.isDirectory()) { + if (!fs.existsSync(destFolder)) + fs.mkdirSync(destFolder); + if (!fs.existsSync(dest)) + fs.mkdirSync(dest); + fs.readdirSync(src).forEach(function(d) { + if (d !== 'bom') + copyFolderWithBom(path.join(src, d), path.join(dest, d)); + }); + } + } + + function copyFileAddingBomSync(srcFile, destFile) { + var contents = fs.readFileSync(srcFile, { encoding: 'utf8' }); + if (!contents.length || contents.charCodeAt(0) !== 0xFEFF) + contents = '\ufeff' + contents; + fs.writeFileSync(destFile, contents, { encoding: 'utf8' }); + } + + function copyFileSync(srcFile, destFile) { + var fdr = fs.openSync(srcFile, 'r') + var stat = fs.fstatSync(fdr) + var fdw = fs.openSync(destFile, 'w', stat.mode) + var bytesRead = 1 + var pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + fs.closeSync(fdr) + fs.closeSync(fdw) + } + + return { + copyFolderWithBom: copyFolderWithBom + }; +}; diff --git a/test/index.js b/test/index.js index 1146ff57..33e9cb87 100644 --- a/test/index.js +++ b/test/index.js @@ -4,12 +4,11 @@ var lessTest = require("./less-test"), stylize = require('../lib/less-node/lessc-helper').stylize; function getErrorPathReplacementFunction(dir) { - return function(input) { - return input.replace( - /\{path\}/g, path.join(process.cwd(), "/test/less/" + dir + "/")) - .replace(/\{node\}/g, "") - .replace(/\{\/node\}/g, "") - .replace(/\{pathrel\}/g, path.join("test", "less", dir + "/")) + return function(input, baseDir) { + return input.replace(/\{path\}/g, path.join(process.cwd(), baseDir, dir + "/")) + .replace(/\{node\}/g, "") + .replace(/\{\/node\}/g, "") + .replace(/\{pathrel\}/g, path.join(baseDir, dir + "/")) .replace(/\{pathhref\}/g, "") .replace(/\{404status\}/g, "") .replace(/\r\n/g, '\n'); @@ -17,6 +16,7 @@ function getErrorPathReplacementFunction(dir) { } console.log("\n" + stylize("Less", 'underline') + "\n"); +lessTester.prepBomTest(); lessTester.runTestSet({strictMath: true, relativeUrls: true, silent: true}); lessTester.runTestSet({strictMath: true, strictUnits: true}, "errors/", lessTester.testErrors, null, getErrorPathReplacementFunction("errors")); @@ -32,18 +32,18 @@ lessTester.runTestSet({strictMath: true, relativeUrls: false, rootpath: "folder lessTester.runTestSet({strictMath: true, compress: true}, "compression/"); lessTester.runTestSet({strictMath: true, strictUnits: true}, "strict-units/"); lessTester.runTestSet({}, "legacy/"); -lessTester.runTestSet({strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, "sourcemaps/", +lessTester.runTestSetNormalOnly({strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, "sourcemaps/", lessTester.testSourcemap, null, null, - function(filename, type) { + function(filename, type, baseFolder) { if (type === "vars") { - return path.join('test/less/', filename) + '.json'; + return path.join(baseFolder, filename) + '.json'; } return path.join('test/sourcemaps', filename) + '.json'; }); lessTester.runTestSet({globalVars: true, banner: "/**\n * Test\n */\n"}, "globalVars/", - null, null, null, function(name) { return path.join('test/less/', name) + '.json'; }); + null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }); lessTester.runTestSet({modifyVars: true}, "modifyVars/", - null, null, null, function(name) { return path.join('test/less/', name) + '.json'; }); + null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }); lessTester.runTestSet({urlArgs: '424242'}, "url-args/"); lessTester.runTestSet({paths: ['test/data/','test/less/import/']}, "include-path/"); lessTester.testSyncronous({syncImport: true}, "import"); diff --git a/test/less-test.js b/test/less-test.js index 8a9dc4b6..09b7e06c 100644 --- a/test/less-test.js +++ b/test/less-test.js @@ -3,6 +3,7 @@ module.exports = function() { var path = require('path'), fs = require('fs'); + copyBom = require('./copy-bom')(); var less = require('../lib/less-node'); var stylize = require('../lib/less-node/lessc-helper').stylize; @@ -14,6 +15,9 @@ module.exports = function() { var isVerbose = process.env.npm_config_loglevel === 'verbose'; + var normalFolder = 'test/less'; + var bomFolder = 'test/less-bom'; + less.logger.addListener({ info: function(msg) { if (isVerbose) { @@ -84,10 +88,10 @@ module.exports = function() { }); } - function testErrors(name, err, compiledLess, doReplacements) { - fs.readFile(path.join('test/less/', name) + '.txt', 'utf8', function (e, expectedErr) { + function testErrors(name, err, compiledLess, doReplacements, sourcemap, baseFolder) { + fs.readFile(path.join(baseFolder, name) + '.txt', 'utf8', function (e, expectedErr) { process.stdout.write("- " + name + ": "); - expectedErr = doReplacements(expectedErr, 'test/less/errors/'); + expectedErr = doReplacements(expectedErr, baseFolder); if (!err) { if (compiledLess) { fail("No Error", 'red'); @@ -131,7 +135,7 @@ module.exports = function() { totalTests++; queue(function() { var isSync = true; - toCSS(options, path.join('test/less/', filenameNoExtension + ".less"), function (err, result) { + toCSS(options, path.join(normalFolder, filenameNoExtension + ".less"), function (err, result) { process.stdout.write("- Test Sync " + filenameNoExtension + ": "); if (isSync) { @@ -145,7 +149,21 @@ module.exports = function() { }); } + function prepBomTest() { + if (!fs.existsSync(bomFolder) || fs.readdirSync(bomFolder).length == 0) + copyBom.copyFolderWithBom(normalFolder, bomFolder); + } + function runTestSet(options, foldername, verifyFunction, nameModifier, doReplacements, getFilename) { + runTestSetInternal(normalFolder, options, foldername, verifyFunction, nameModifier, doReplacements, getFilename); + runTestSetInternal(bomFolder, options, foldername, verifyFunction, nameModifier, doReplacements, getFilename); + } + + function runTestSetNormalOnly(options, foldername, verifyFunction, nameModifier, doReplacements, getFilename) { + runTestSetInternal(normalFolder, options, foldername, verifyFunction, nameModifier, doReplacements, getFilename); + } + + function runTestSetInternal(baseFolder, options, foldername, verifyFunction, nameModifier, doReplacements, getFilename) { foldername = foldername || ""; if(!doReplacements) { @@ -156,7 +174,7 @@ module.exports = function() { return foldername + path.basename(file, '.less'); } - fs.readdirSync(path.join('test/less/', foldername)).forEach(function (file) { + fs.readdirSync(path.join(baseFolder, foldername)).forEach(function (file) { if (! /\.less/.test(file)) { return; } var name = getBasename(file); @@ -169,19 +187,19 @@ module.exports = function() { if (options.sourceMap) { options.sourceMapOutputFilename = name + ".css"; - options.sourceMapBasepath = path.join(process.cwd(), "test/less"); + options.sourceMapBasepath = path.join(process.cwd(), baseFolder); options.sourceMapRootpath = "testweb/"; // TODO separate options? options.sourceMap = options; } options.getVars = function(file) { - return JSON.parse(fs.readFileSync(getFilename(getBasename(file), 'vars'), 'utf8')); + return JSON.parse(fs.readFileSync(getFilename(getBasename(file), 'vars', baseFolder), 'utf8')); }; - var doubleCallCheck = false; + var doubleCallCheck = false; queue(function() { - toCSS(options, path.join('test/less/', foldername + file), function (err, result) { + toCSS(options, path.join(baseFolder, foldername + file), function (err, result) { if (doubleCallCheck) { totalTests++; fail("less is calling back twice"); @@ -192,7 +210,7 @@ module.exports = function() { doubleCallCheck = (new Error()).stack; if (verifyFunction) { - var verificationResult = verifyFunction(name, err, result && result.css, doReplacements, result && result.map); + var verificationResult = verifyFunction(name, err, result && result.css, doReplacements, result && result.map, baseFolder); release(); return verificationResult; } @@ -210,7 +228,7 @@ module.exports = function() { fs.readFile(path.join('test/css', css_name) + '.css', 'utf8', function (e, css) { process.stdout.write("- " + css_name + ": "); - css = css && doReplacements(css, 'test/less/' + foldername); + css = css && doReplacements(css, path.join(baseFolder, foldername)); if (result.css === css) { ok('OK'); } else { difference("FAIL", css, result.css); @@ -225,10 +243,10 @@ module.exports = function() { function diff(left, right) { require('diff').diffLines(left, right).forEach(function(item) { if(item.added || item.removed) { - var text = item.value.replace("\n", String.fromCharCode(182) + "\n"); + var text = item.value.replace("\n", String.fromCharCode(182) + "\n").replace('\ufeff', '[[BOM]]'); process.stdout.write(stylize(text, item.added ? 'green' : 'red')); } else { - process.stdout.write(item.value); + process.stdout.write(item.value.replace('\ufeff', '[[BOM]]')); } }); process.stdout.write("\n"); @@ -327,10 +345,12 @@ module.exports = function() { return { runTestSet: runTestSet, + runTestSetNormalOnly: runTestSetNormalOnly, testSyncronous: testSyncronous, testErrors: testErrors, testSourcemap: testSourcemap, testNoOptions: testNoOptions, + prepBomTest: prepBomTest, finished: finished }; }; From 023dd62c88d82741a265995e6cd91d37931bceb5 Mon Sep 17 00:00:00 2001 From: shaun Date: Wed, 14 Jan 2015 08:26:39 -0800 Subject: [PATCH 04/29] Make copy of options before each test set. Some operations modify the options object, which could influence the next test set. Modified the test labels in the output to include the folder (to distinguish between the normal and BOM tests). Modified warning message from data-uri file-not-found to include the filename. --- lib/less/functions/data-uri.js | 2 +- test/index.js | 2 +- test/less-test.js | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/less/functions/data-uri.js b/lib/less/functions/data-uri.js index ad75d97d..798b5a7d 100644 --- a/lib/less/functions/data-uri.js +++ b/lib/less/functions/data-uri.js @@ -54,7 +54,7 @@ module.exports = function(environment) { var fileSync = fileManager.loadFileSync(filePath, currentDirectory, this.context, environment); if (!fileSync.contents) { - logger.warn("Skipped data-uri embedding because file not found"); + logger.warn("Skipped data-uri embedding of " + filePath + " because file not found"); return fallback(this, filePathNode || mimetypeNode); } var buf = fileSync.contents; diff --git a/test/index.js b/test/index.js index 33e9cb87..7ae15600 100644 --- a/test/index.js +++ b/test/index.js @@ -32,7 +32,7 @@ lessTester.runTestSet({strictMath: true, relativeUrls: false, rootpath: "folder lessTester.runTestSet({strictMath: true, compress: true}, "compression/"); lessTester.runTestSet({strictMath: true, strictUnits: true}, "strict-units/"); lessTester.runTestSet({}, "legacy/"); -lessTester.runTestSetNormalOnly({strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, "sourcemaps/", +lessTester.runTestSet({strictMath: true, strictUnits: true, sourceMap: true, globalVars: true }, "sourcemaps/", lessTester.testSourcemap, null, null, function(filename, type, baseFolder) { if (type === "vars") { diff --git a/test/less-test.js b/test/less-test.js index 09b7e06c..e9d41a6c 100644 --- a/test/less-test.js +++ b/test/less-test.js @@ -71,9 +71,9 @@ module.exports = function() { } }); - function testSourcemap(name, err, compiledLess, doReplacements, sourcemap) { + function testSourcemap(name, err, compiledLess, doReplacements, sourcemap, baseFolder) { fs.readFile(path.join('test/', name) + '.json', 'utf8', function (e, expectedSourcemap) { - process.stdout.write("- " + name + ": "); + process.stdout.write("- " + path.join(baseFolder, name) + ": "); if (sourcemap === expectedSourcemap) { ok('OK'); } else if (err) { @@ -90,7 +90,7 @@ module.exports = function() { function testErrors(name, err, compiledLess, doReplacements, sourcemap, baseFolder) { fs.readFile(path.join(baseFolder, name) + '.txt', 'utf8', function (e, expectedErr) { - process.stdout.write("- " + name + ": "); + process.stdout.write("- " + path.join(baseFolder, name) + ": "); expectedErr = doReplacements(expectedErr, baseFolder); if (!err) { if (compiledLess) { @@ -155,8 +155,9 @@ module.exports = function() { } function runTestSet(options, foldername, verifyFunction, nameModifier, doReplacements, getFilename) { + var options2 = options ? JSON.parse(JSON.stringify(options)) : {}; runTestSetInternal(normalFolder, options, foldername, verifyFunction, nameModifier, doReplacements, getFilename); - runTestSetInternal(bomFolder, options, foldername, verifyFunction, nameModifier, doReplacements, getFilename); + runTestSetInternal(bomFolder, options2, foldername, verifyFunction, nameModifier, doReplacements, getFilename); } function runTestSetNormalOnly(options, foldername, verifyFunction, nameModifier, doReplacements, getFilename) { @@ -226,7 +227,7 @@ module.exports = function() { var css_name = name; if(nameModifier) { css_name = nameModifier(name); } fs.readFile(path.join('test/css', css_name) + '.css', 'utf8', function (e, css) { - process.stdout.write("- " + css_name + ": "); + process.stdout.write("- " + path.join(baseFolder, css_name) + ": "); css = css && doReplacements(css, path.join(baseFolder, foldername)); if (result.css === css) { ok('OK'); } From 297ac17ddad19c8b284f5318ae5c579ae72cabc5 Mon Sep 17 00:00:00 2001 From: Justineo Date: Thu, 15 Jan 2015 12:12:39 +0800 Subject: [PATCH 05/29] add support for `isruleset` --- lib/less/functions/types.js | 4 ++++ test/css/functions.css | 1 + test/less/functions.less | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/lib/less/functions/types.js b/lib/less/functions/types.js index 42a5190d..adc13472 100644 --- a/lib/less/functions/types.js +++ b/lib/less/functions/types.js @@ -1,4 +1,5 @@ var Keyword = require("../tree/keyword"), + DetachedRuleset = require("../tree/detached-ruleset"), Dimension = require("../tree/dimension"), Color = require("../tree/color"), Quoted = require("../tree/quoted"), @@ -21,6 +22,9 @@ var isa = function (n, Type) { return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False; }; functionRegistry.addMultiple({ + isruleset: function (n) { + return isa(n, DetachedRuleset); + }, iscolor: function (n) { return isa(n, Color); }, diff --git a/test/css/functions.css b/test/css/functions.css index 37bbfdf7..62eac50e 100644 --- a/test/css/functions.css +++ b/test/css/functions.css @@ -127,6 +127,7 @@ mixt: rgba(255, 0, 0, 0.5); } #built-in .is-a { + ruleset: true; color: true; color1: true; color2: true; diff --git a/test/less/functions.less b/test/less/functions.less index 6a02e709..947b9f2d 100644 --- a/test/less/functions.less +++ b/test/less/functions.less @@ -137,6 +137,10 @@ mixt: mix(#ff0000, transparent); .is-a { + @rules: { + color: red; + }; + ruleset: isruleset(@rules); color: iscolor(#ddd); color1: iscolor(red); color2: iscolor(rgb(0, 0, 0)); From d7f79be40dcacf32940c9c848a0e0f9b7ef27cbd Mon Sep 17 00:00:00 2001 From: shaun Date: Wed, 14 Jan 2015 20:49:36 -0800 Subject: [PATCH 06/29] Always copy/create BOM tests, even if they already exist. Useful if editing tests, so you don't have to keep deleting the test/less-bom folder between each test. --- test/less-test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/less-test.js b/test/less-test.js index e9d41a6c..f37a89a0 100644 --- a/test/less-test.js +++ b/test/less-test.js @@ -150,8 +150,7 @@ module.exports = function() { } function prepBomTest() { - if (!fs.existsSync(bomFolder) || fs.readdirSync(bomFolder).length == 0) - copyBom.copyFolderWithBom(normalFolder, bomFolder); + copyBom.copyFolderWithBom(normalFolder, bomFolder); } function runTestSet(options, foldername, verifyFunction, nameModifier, doReplacements, getFilename) { From 4d18bc3114b86b79b04f0a332a3b8d4b03eab377 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Thu, 15 Jan 2015 06:02:17 +0000 Subject: [PATCH 07/29] Clean less-bom --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 0a48da2a..4c6bc178 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -306,7 +306,7 @@ module.exports = function (grunt) { // Clean the version of less built for the tests clean: { - test: ['test/browser/less.js', 'tmp'], + test: ['test/browser/less.js', 'tmp', 'test/less-bom'], "sourcemap-test": ['test/sourcemaps/*.css', 'test/sourcemaps/*.map'], sauce_log: ["sc_*.log"] } From 12969de390dc01cb3a91905fa771a78044f95644 Mon Sep 17 00:00:00 2001 From: Bass Jobsen Date: Mon, 19 Jan 2015 09:09:14 +0100 Subject: [PATCH 08/29] optional imports should fix https://github.com/less/less.js/issues/2145 --- lib/less/import-manager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/less/import-manager.js b/lib/less/import-manager.js index d70c1605..386320aa 100644 --- a/lib/less/import-manager.js +++ b/lib/less/import-manager.js @@ -40,12 +40,14 @@ module.exports = function(environment) { importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue var importedEqualsRoot = fullPath === importManager.rootFilename; - + if (importOptions.optional && e) { + callback(null, {rules:[]}, false, null); + } + else { importManager.files[fullPath] = root; - if (e && !importManager.error) { importManager.error = e; } - callback(e, root, importedEqualsRoot, fullPath); + } }; var newFileInfo = { From 1aec38f440122631a87914acb617ed36cc36d69d Mon Sep 17 00:00:00 2001 From: Bass Jobsen Date: Mon, 19 Jan 2015 09:13:49 +0100 Subject: [PATCH 09/29] Update parser.js --- lib/less/parser/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index f1cf119b..7b016d1f 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -1169,7 +1169,7 @@ var Parser = function Parser(context, imports, fileInfo) { }, importOption: function() { - var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference)/); + var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/); if (opt) { return opt[1]; } From e064ac0ef205f9818378bfe38b73900b906605ee Mon Sep 17 00:00:00 2001 From: jurcovicovam Date: Tue, 20 Jan 2015 16:08:02 +0100 Subject: [PATCH 10/29] Allow selector interpolation inside pseudoselectors. #1294 --- lib/less/parser/parser.js | 2 +- test/css/selectors.css | 2 +- test/less/selectors.less | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index f1cf119b..f23b1969 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -858,7 +858,7 @@ var Parser = function Parser(context, imports, fileInfo) { c = this.combinator(); e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || - parserInput.$char('*') || parserInput.$char('&') || this.attribute() || parserInput.$re(/^\([^()@]+\)/) || parserInput.$re(/^[\.#](?=@)/) || + parserInput.$char('*') || parserInput.$char('&') || this.attribute() || parserInput.$re(/^\([^()@]+\)/) || parserInput.$re(/^[\.#:](?=@)/) || this.entities.variableCurly(); if (! e) { diff --git a/test/css/selectors.css b/test/css/selectors.css index 85f95b56..ed370359 100644 --- a/test/css/selectors.css +++ b/test/css/selectors.css @@ -119,7 +119,7 @@ p a span { .bloodred { color: green; } -#blood.blood.red.black { +#blood.blood.red.black:blood { color: black; } :nth-child(3) { diff --git a/test/less/selectors.less b/test/less/selectors.less index 42aa29e7..2680fbac 100644 --- a/test/less/selectors.less +++ b/test/less/selectors.less @@ -117,7 +117,7 @@ a { color: green; } .red { - #@{theme}.@{theme}&.black { + #@{theme}.@{theme}&.black:@{theme} { color:black; } } From d0e217e7436060969e51060b03479eb93b5dff8f Mon Sep 17 00:00:00 2001 From: jurcovicovam Date: Wed, 21 Jan 2015 14:54:48 +0100 Subject: [PATCH 11/29] Important on parametrized mixin #2394 The !important flag on mixin call prevented proper evaluation of variables inside nested mixins. #2394 --- lib/less/tree/ruleset.js | 18 +++++++++--------- test/css/mixins-important.css | 6 ++++++ test/less/mixins-important.less | 12 ++++++++++++ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/lib/less/tree/ruleset.js b/lib/less/tree/ruleset.js index aa86214d..934fce0b 100644 --- a/lib/less/tree/ruleset.js +++ b/lib/less/tree/ruleset.js @@ -182,15 +182,15 @@ Ruleset.prototype.evalImports = function(context) { } }; Ruleset.prototype.makeImportant = function() { - return new Ruleset(this.selectors, this.rules.map(function (r) { - if (r.makeImportant) { - return r.makeImportant(); - } else { - return r; - } - }), this.strictImports); -}; -Ruleset.prototype.matchArgs = function (args) { + this.rules = this.rules.map(function (r) { + if (r.makeImportant) { + return r.makeImportant(); + } else { + return r; + } + }); + return this; +};Ruleset.prototype.matchArgs = function (args) { return !args || args.length === 0; }; // lets you call a css selector with a guard diff --git a/test/css/mixins-important.css b/test/css/mixins-important.css index b100af7f..1b9faa1e 100644 --- a/test/css/mixins-important.css +++ b/test/css/mixins-important.css @@ -43,3 +43,9 @@ .class .inner { test: 9; } +.when-calling-nested-issue-2394 { + width: auto !important; +} +.when-calling-nested-with-param-issue-2394 { + width: 10px !important; +} diff --git a/test/less/mixins-important.less b/test/less/mixins-important.less index 5014e816..0a1ff180 100644 --- a/test/less/mixins-important.less +++ b/test/less/mixins-important.less @@ -23,3 +23,15 @@ .mixin !important; .mixin(9); } +.size(@aaa: auto) { + .set-width(@aaa) { + width: @aaa; + } + .set-width(@aaa); +} +.when-calling-nested-issue-2394 { + .size() !important; +} +.when-calling-nested-with-param-issue-2394 { + .size(10px) !important; +} \ No newline at end of file From ed9b6efb1302939d122429f5a3e5aa8345960565 Mon Sep 17 00:00:00 2001 From: jurcovicovam Date: Thu, 22 Jan 2015 14:03:00 +0100 Subject: [PATCH 12/29] Keyframes, supports and other directives should work with import reference. #2008 --- lib/less/tree/directive.js | 5 +++-- test/css/import-reference.css | 11 +++++++++++ test/less/import-reference.less | 4 +++- test/less/import/import-reference.less | 15 +++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/less/tree/directive.js b/lib/less/tree/directive.js index e189128d..1bbe506d 100644 --- a/lib/less/tree/directive.js +++ b/lib/less/tree/directive.js @@ -1,7 +1,7 @@ var Node = require("./node"), Ruleset = require("./ruleset"); -var Directive = function (name, value, rules, index, currentFileInfo, debugInfo) { +var Directive = function (name, value, rules, index, currentFileInfo, debugInfo, isReferenced) { this.name = name; this.value = value; if (rules) { @@ -11,6 +11,7 @@ var Directive = function (name, value, rules, index, currentFileInfo, debugInfo) this.index = index; this.currentFileInfo = currentFileInfo; this.debugInfo = debugInfo; + this.isReferenced = isReferenced; }; Directive.prototype = new Node(); @@ -56,7 +57,7 @@ Directive.prototype.eval = function (context) { rules.root = true; } return new Directive(this.name, value, rules, - this.index, this.currentFileInfo, this.debugInfo); + this.index, this.currentFileInfo, this.debugInfo, this.isReferenced); }; Directive.prototype.variable = function (name) { if (this.rules) return Ruleset.prototype.variable.call(this.rules, name); }; Directive.prototype.find = function () { if (this.rules) return Ruleset.prototype.find.apply(this.rules, arguments); }; diff --git a/test/css/import-reference.css b/test/css/import-reference.css index f25f4b1d..27a14db7 100644 --- a/test/css/import-reference.css +++ b/test/css/import-reference.css @@ -66,3 +66,14 @@ div#id.class[a=1][b=2].class:not(1) { color: red; } } +@keyframes some-name { + property: value; +} +@supports (animation-name: test) { + @keyframes some-name { + property: value; + } + .selector { + color: red; + } +} diff --git a/test/less/import-reference.less b/test/less/import-reference.less index 93160ab5..97a628c5 100644 --- a/test/less/import-reference.less +++ b/test/less/import-reference.less @@ -18,4 +18,6 @@ } .class:extend(.class all) { -} \ No newline at end of file +} + +.mixin-with-directives(some-name); \ No newline at end of file diff --git a/test/less/import/import-reference.less b/test/less/import/import-reference.less index c77f692e..33be5dce 100644 --- a/test/less/import/import-reference.less +++ b/test/less/import/import-reference.less @@ -48,4 +48,19 @@ @media (max-size: @max-size) { color: red; } +} +.mixin-with-directives(@keyframeName) { + @keyframes @keyframeName { + @rules1(); + } + @supports (animation-name: test) { + @keyframes @keyframeName { + @rules2(); + } + .selector { + color: red; + } + } + @rules1: {property: value;}; + @rules2: {property: value;}; } \ No newline at end of file From 8f1c35a8149c2e95fafd5b1675f0253b70b8608b Mon Sep 17 00:00:00 2001 From: jurcovicovam Date: Fri, 23 Jan 2015 17:48:26 +0100 Subject: [PATCH 13/29] Extend looses @supports imported by reference New logic: directive with body that contains something referenced (for example by extend) will be shown in output too. @Media works with the same logic - it shows up in output if it contains something visible. Related to: #2359 --- lib/less/tree/directive.js | 3 ++ lib/less/tree/ruleset.js | 39 +++++++++++++++++++++++--- lib/less/visitors/to-css-visitor.js | 37 ++++++++++++++++++++++-- test/css/import-reference.css | 8 ++++++ test/less/import-reference.less | 2 +- test/less/import/import-reference.less | 16 ++++++++++- 6 files changed, 96 insertions(+), 9 deletions(-) diff --git a/lib/less/tree/directive.js b/lib/less/tree/directive.js index e189128d..5a22abca 100644 --- a/lib/less/tree/directive.js +++ b/lib/less/tree/directive.js @@ -73,6 +73,9 @@ Directive.prototype.markReferenced = function () { } } }; +Directive.prototype.getIsReferenced = function () { + return !this.currentFileInfo || !this.currentFileInfo.reference || this.isReferenced; +}; Directive.prototype.outputRuleset = function (context, output, rules) { var ruleCnt = rules.length, i; context.tabLevel = (context.tabLevel | 0) + 1; diff --git a/lib/less/tree/ruleset.js b/lib/less/tree/ruleset.js index aa86214d..ce3cb541 100644 --- a/lib/less/tree/ruleset.js +++ b/lib/less/tree/ruleset.js @@ -414,13 +414,44 @@ Ruleset.prototype.genCSS = function (context, output) { } }; Ruleset.prototype.markReferenced = function () { - if (!this.selectors) { - return; + var s; + if (this.selectors) { + for (s = 0; s < this.selectors.length; s++) { + this.selectors[s].markReferenced(); + } } - for (var s = 0; s < this.selectors.length; s++) { - this.selectors[s].markReferenced(); + + if (this.rules) { + for (s = 0; s < this.rules.length; s++) { + if (this.rules[s].markReferenced) + this.rules[s].markReferenced(); + } } }; +Ruleset.prototype.getIsReferenced = function() { + var i, j, path, selector; + + if (this.paths) { + for (i=0; i Date: Fri, 23 Jan 2015 18:42:02 +0100 Subject: [PATCH 14/29] Added unit test for referenced parent selectors Name: Parent selectors not working within mixins using (reference) Number: #1979 --- test/css/import-reference.css | 6 ++++++ test/less/import-reference.less | 1 + test/less/import/import-reference.less | 11 ++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/test/css/import-reference.css b/test/css/import-reference.css index 4dc5490b..0d06c2bf 100644 --- a/test/css/import-reference.css +++ b/test/css/import-reference.css @@ -74,3 +74,9 @@ div#id.class[a=1][b=2].class:not(1) { color: red; } } +.test { + color: red; +} +.test:first-child { + color: blue; +} diff --git a/test/less/import-reference.less b/test/less/import-reference.less index e1477c50..77df43ba 100644 --- a/test/less/import-reference.less +++ b/test/less/import-reference.less @@ -19,3 +19,4 @@ .class:extend(.class all) { } +.mixin-with-nested-selectors(); \ No newline at end of file diff --git a/test/less/import/import-reference.less b/test/less/import/import-reference.less index f8f96425..f4c9c74d 100644 --- a/test/less/import/import-reference.less +++ b/test/less/import/import-reference.less @@ -49,7 +49,7 @@ color: red; } } - +//https://github.com/less/less.js/issues/2359 @supports (something: else) { .class { something: else; @@ -63,3 +63,12 @@ something: else; } } +//https://github.com/less/less.js/issues/1979 +.mixin-with-nested-selectors() { + .test { + color: red; + &:first-child { + color: blue; + } + } +} \ No newline at end of file From aa19d9578d8897221743895f80a70e607471da30 Mon Sep 17 00:00:00 2001 From: Bass Jobsen Date: Mon, 26 Jan 2015 09:52:22 +0100 Subject: [PATCH 15/29] explain inline maps explain inline maps are as base64 data uri's --- lib/less-node/lessc-helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/less-node/lessc-helper.js b/lib/less-node/lessc-helper.js index 8a7fe600..4e24800e 100644 --- a/lib/less-node/lessc-helper.js +++ b/lib/less-node/lessc-helper.js @@ -41,7 +41,7 @@ var lessc_helper = { console.log(" --source-map-rootpath=X Adds this path onto the sourcemap filename and less file paths."); console.log(" --source-map-basepath=X Sets sourcemap base path, defaults to current working directory."); console.log(" --source-map-less-inline Puts the less files into the map instead of referencing them."); - console.log(" --source-map-map-inline Puts the map (and any less files) into the output css file."); + console.log(" --source-map-map-inline Puts the map (and any less files) as a base64 data uri into the output css file."); console.log(" --source-map-url=URL Sets a custom URL to map file, for sourceMappingURL comment"); console.log(" in generated CSS file."); console.log(" -rp, --rootpath=URL Sets rootpath for url rewriting in relative imports and urls"); From ea122a8ea5c914f5ac48bc627e42a5d4705f5cd9 Mon Sep 17 00:00:00 2001 From: jurcovicovam Date: Mon, 26 Jan 2015 10:49:47 +0100 Subject: [PATCH 16/29] Added error handling to file write for both css file and source map file. #2408 --- bin/lessc | 88 ++++++++++++++++++++++++++++++++++++++++------------ package.json | 7 +++-- 2 files changed, 72 insertions(+), 23 deletions(-) diff --git a/bin/lessc b/bin/lessc index 247bdcc3..ca1cd94d 100755 --- a/bin/lessc +++ b/bin/lessc @@ -3,8 +3,15 @@ var path = require('path'), fs = require('../lib/less-node/fs'), os = require('os'), + errno, mkdirp; +try { + errno = require('errno'); +} catch (err) { + errno = null; +} + var less = require('../lib/less-node'), pluginLoader = new less.PluginLoader(less), plugin, @@ -341,14 +348,67 @@ if (options.depends) { } if (!sourceMapFileInline) { - var writeSourceMap = function(output) { + var writeSourceMap = function(output, onDone) { var filename = sourceMapOptions.sourceMapFullFilename; ensureDirectory(filename); - fs.writeFileSync(filename, output, 'utf8'); - less.logger.info('lessc: wrote ' + filename); + fs.writeFile(filename, output, 'utf8', function (err) { + if (err) { + var description = "Error: "; + if (errno && errno.errno[err.errno]) { + description += errno.errno[err.errno].description; + } else { + description += err.code + " " + err.message; + } + less.logger.error('lessc: failed to create file ' + filename); + less.logger.error(description); + } else { + less.logger.info('lessc: wrote ' + filename); + } + onDone(); + }); }; } +var writeSourceMapIfNeeded = function(output, onDone) { + if (options.sourceMap && !sourceMapFileInline) { + writeSourceMap(output, onDone); + } +}; + +var writeOutput = function(output, result, onSuccess) { + if (output) { + ensureDirectory(output); + fs.writeFile(output, result.css, {encoding: 'utf8'}, function (err) { + if (err) { + var description = "Error: "; + if (errno && errno.errno[err.errno]) { + description += errno.errno[err.errno].description; + } else { + description += err.code + " " + err.message; + } + less.logger.error('lessc: failed to create file ' + output); + less.logger.error(description); + } else { + less.logger.info('lessc: wrote ' + output); + onSuccess(); + } + }); + } else if (!options.depends) { + process.stdout.write(result.css); + onSuccess(); + } +}; + +var logDependencies = function(options, result) { + if (options.depends) { + var depends = ""; + for(var i = 0; i < result.imports.length; i++) { + depends += result.imports[i] + " "; + } + console.log(depends); + } +}; + var parseLessFile = function (e, data) { if (e) { console.log("lessc: " + e.message); @@ -390,23 +450,11 @@ var parseLessFile = function (e, data) { less.render(data, options) .then(function(result) { if(!options.lint) { - if (output) { - ensureDirectory(output); - fs.writeFileSync(output, result.css, 'utf8'); - less.logger.info('lessc: wrote ' + output); - } else if (!options.depends) { - process.stdout.write(result.css); - } - if (options.sourceMap && !sourceMapFileInline) { - writeSourceMap(result.map); - } - if (options.depends) { - var depends = ""; - for(var i = 0; i < result.imports.length; i++) { - depends += result.imports[i] + " "; - } - console.log(depends); - } + writeOutput(output, result, function() { + writeSourceMapIfNeeded(result.map, function() { + logDependencies(options, result); + }); + }); } }, function(err) { diff --git a/package.json b/package.json index d9f686e9..763dfedf 100644 --- a/package.json +++ b/package.json @@ -40,13 +40,14 @@ "test": "grunt test" }, "optionalDependencies": { + "errno": "^0.1.1", "graceful-fs": "^3.0.5", + "image-size": "~0.3.5", "mime": "^1.2.11", - "request": "^2.51.0", "mkdirp": "^0.5.0", - "source-map": "^0.1.x", "promise": "^6.0.1", - "image-size": "~0.3.5" + "request": "^2.51.0", + "source-map": "^0.1.x" }, "devDependencies": { "diff": "^1.0", From 5e6e16ed8ce9aed18b0ce71460891b47593612bd Mon Sep 17 00:00:00 2001 From: Luke Page Date: Mon, 26 Jan 2015 19:52:56 +0000 Subject: [PATCH 17/29] pick up comments on the end of the file --- lib/less/parser/parser.js | 6 +++++- test/css/comments.css | 1 + test/less/comments.less | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index f1cf119b..64a4641e 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -231,13 +231,17 @@ var Parser = function Parser(context, imports, fileInfo) { primary: function () { var mixin = this.mixin, root = [], node; - while (!parserInput.finished) + while (true) { while(true) { node = this.comment(); if (!node) { break; } root.push(node); } + // always process comments before deciding if finished + if (parserInput.finished) { + break; + } if (parserInput.peek('}')) { break; } diff --git a/test/css/comments.css b/test/css/comments.css index 31e23f7f..c8475cd9 100644 --- a/test/css/comments.css +++ b/test/css/comments.css @@ -80,3 +80,4 @@ #output-block { comment: /* // Not commented out // */; } +/*comment on last line*/ diff --git a/test/less/comments.less b/test/less/comments.less index 3cb6d162..e1d66e8f 100644 --- a/test/less/comments.less +++ b/test/less/comments.less @@ -99,3 +99,4 @@ /*by block */ @string_w_comment: ~"/* // Not commented out // */"; #output-block { comment: @string_w_comment; } +/*comment on last line*/ \ No newline at end of file From b09f30e079eeddb922bcb61b10ec655cbcabebaf Mon Sep 17 00:00:00 2001 From: Luke Page Date: Mon, 26 Jan 2015 20:17:27 +0000 Subject: [PATCH 18/29] support variables passed to data-uri --- lib/less/functions/data-uri.js | 5 +++-- test/css/urls.css | 1 + test/less/urls.less | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/less/functions/data-uri.js b/lib/less/functions/data-uri.js index 798b5a7d..35d9c563 100644 --- a/lib/less/functions/data-uri.js +++ b/lib/less/functions/data-uri.js @@ -16,8 +16,9 @@ module.exports = function(environment) { var mimetype = mimetypeNode && mimetypeNode.value; var filePath = filePathNode.value; - var currentDirectory = filePathNode.currentFileInfo.relativeUrls ? - filePathNode.currentFileInfo.currentDirectory : filePathNode.currentFileInfo.entryPath; + var currentFileInfo = this.currentFileInfo; + var currentDirectory = currentFileInfo.relativeUrls ? + currentFileInfo.currentDirectory : currentFileInfo.entryPath; var fragmentStart = filePath.indexOf('#'); var fragment = ''; diff --git a/test/css/urls.css b/test/css/urls.css index fda916e1..6503b4db 100644 --- a/test/css/urls.css +++ b/test/css/urls.css @@ -57,6 +57,7 @@ } #data-uri { uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=="); + background-image: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=="); uri-fragment: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==#fragment"); } #data-uri-guess { diff --git a/test/less/urls.less b/test/less/urls.less index 8ed07a1a..0479d369 100644 --- a/test/less/urls.less +++ b/test/less/urls.less @@ -45,6 +45,8 @@ #data-uri { uri: data-uri('image/jpeg;base64', '../data/image.jpg'); + @var: replace('../data/replace.jpg', "replace", "image"); + background-image: data-uri(@var); uri-fragment: data-uri('image/jpeg;base64', '../data/image.jpg#fragment'); } From 8ba6080171534314dadbdd6e509cf9a30eedc668 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Mon, 26 Jan 2015 20:20:13 +0000 Subject: [PATCH 19/29] also test for using string functions with data-uri as that used to fail --- test/css/urls.css | 2 +- test/less/urls.less | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/css/urls.css b/test/css/urls.css index 6503b4db..c43118c6 100644 --- a/test/css/urls.css +++ b/test/css/urls.css @@ -57,7 +57,7 @@ } #data-uri { uri: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=="); - background-image: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=="); + background-image: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=="), url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg=="); uri-fragment: url("data:image/jpeg;base64,bm90IGFjdHVhbGx5IGEganBlZyBmaWxlCg==#fragment"); } #data-uri-guess { diff --git a/test/less/urls.less b/test/less/urls.less index 0479d369..c3f65b47 100644 --- a/test/less/urls.less +++ b/test/less/urls.less @@ -46,7 +46,8 @@ #data-uri { uri: data-uri('image/jpeg;base64', '../data/image.jpg'); @var: replace('../data/replace.jpg', "replace", "image"); - background-image: data-uri(@var); + background-image: data-uri(@var), data-uri(replace('../data/image.filext', "filext", "jpg")); + uri-fragment: data-uri('image/jpeg;base64', '../data/image.jpg#fragment'); } From 10586f0a92dfa723def0e5dfb9ef1a2832c634bd Mon Sep 17 00:00:00 2001 From: Luke Page Date: Mon, 26 Jan 2015 21:53:02 +0000 Subject: [PATCH 20/29] make node available in tree --- lib/less/tree/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/less/tree/index.js b/lib/less/tree/index.js index a6004465..c4624dd6 100644 --- a/lib/less/tree/index.js +++ b/lib/less/tree/index.js @@ -1,5 +1,6 @@ var tree = {}; +tree.Node = require('./node'); tree.Alpha = require('./alpha'); tree.Color = require('./color'); tree.Directive = require('./directive'); From 70fb045df4f5c5b39a36bd96015fb80241b82d6f Mon Sep 17 00:00:00 2001 From: Luke Page Date: Mon, 26 Jan 2015 22:34:22 +0000 Subject: [PATCH 21/29] Added test for optional --- test/less/import.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/less/import.less b/test/less/import.less index 9f8b2914..e59754fa 100644 --- a/test/less/import.less +++ b/test/less/import.less @@ -2,6 +2,8 @@ @import url(/absolute/something.css) screen and (color) and (max-width: 600px); +@import (optional) "file-does-not-exist.does-not-exist"; + @var: 100px; @import url("//ha.com/file.css") (min-width:@var); From 31c3d04980c94f7b34b4f97a0934a01d5664bb4e Mon Sep 17 00:00:00 2001 From: Luke Page Date: Mon, 26 Jan 2015 23:34:35 +0000 Subject: [PATCH 22/29] jscs style checking. Fixed whitespace issues. --- .jscsrc | 6 + .jshintrc | 1 - Gruntfile.js | 52 +- bin/lessc | 740 +++++++++--------- lib/less-browser/add-default-options.js | 6 +- lib/less-browser/bootstrap.js | 18 +- lib/less-browser/index.js | 28 +- lib/less-node/file-manager.js | 6 +- lib/less-node/image-size.js | 48 +- lib/less-node/lessc-helper.js | 4 +- lib/less-rhino/index.js | 2 - lib/less/contexts.js | 1 - lib/less/functions/data-uri.js | 28 +- lib/less/import-manager.js | 8 +- lib/less/parse-tree.js | 12 +- lib/less/parser/parser.js | 22 +- lib/less/tree/assignment.js | 1 - lib/less/tree/directive.js | 6 +- lib/less/tree/ruleset.js | 4 +- lib/less/visitors/extend-visitor.js | 2 +- lib/less/visitors/import-sequencer.js | 44 +- lib/less/visitors/import-visitor.js | 20 +- package.json | 1 + test/browser/common.js | 2 +- test/browser/jasmine-jsreporter.js | 1 - test/browser/runner-errors-options.js | 1 - test/browser/runner-errors-spec.js | 1 - test/browser/runner-legacy-options.js | 1 - test/browser/runner-no-js-errors-spec.js | 1 - test/browser/runner-production-options.js | 1 - test/browser/runner-relative-urls-options.js | 1 - test/browser/runner-rootpath-options.js | 1 - .../runner-rootpath-relative-options.js | 1 - test/browser/runner-strict-units-options.js | 1 - test/less-test.js | 71 +- 35 files changed, 572 insertions(+), 571 deletions(-) create mode 100644 .jscsrc diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 00000000..c42a02e8 --- /dev/null +++ b/.jscsrc @@ -0,0 +1,6 @@ +{ + "disallowImplicitTypeConversion": [/*"numeric", "boolean", "binary", "string"*/], /* should be true*/ + "disallowMixedSpacesAndTabs": true, + "disallowMultipleLineBreaks": true, + "disallowTrailingWhitespace": true +} \ No newline at end of file diff --git a/.jshintrc b/.jshintrc index 5c31e91c..42606dc0 100644 --- a/.jshintrc +++ b/.jshintrc @@ -5,7 +5,6 @@ "node": true, "undef": true, "unused": "vars", - "trailing": true, "noarg": true, "eqnull": true, "forin": true, diff --git a/Gruntfile.js b/Gruntfile.js index 4c6bc178..b9dd6706 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -5,8 +5,8 @@ module.exports = function (grunt) { // Report the elapsed execution time of tasks. require('time-grunt')(grunt); - - var COMPRESS_FOR_TESTS = true; + + var COMPRESS_FOR_TESTS = true; // Project configuration. grunt.initConfig({ @@ -96,18 +96,18 @@ module.exports = function (grunt) { options: { banner: '<%= meta.banner %>', mangle: true, - compress: { - pure_getters: true - } + compress: { + pure_getters: true + } }, dist: { src: ['<%= concat.dist.dest %>'], dest: 'dist/less.min.js' }, - test: { - src: '<%= browserify.browser.dest %>', - dest: 'tmp/less.min.js' - } + test: { + src: '<%= browserify.browser.dest %>', + dest: 'tmp/less.min.js' + } }, jshint: { @@ -124,6 +124,13 @@ module.exports = function (grunt) { } }, + jscs: { + src: ["test/**/*.js", "lib/less*/**/*.js", "bin/lessc"], + options: { + config: ".jscsrc" + } + }, + connect: { server: { options: { @@ -347,7 +354,7 @@ module.exports = function (grunt) { // Create the browser version of less.js grunt.registerTask('browsertest-lessjs', [ 'browserify:browser', - 'uglify:test', + 'uglify:test', 'concat:browsertest' ]); @@ -365,19 +372,19 @@ module.exports = function (grunt) { 'connect::keepalive' ]); - var previous_force_state = grunt.option("force"); + var previous_force_state = grunt.option("force"); - grunt.registerTask("force",function(set){ - if (set === "on") { - grunt.option("force",true); - } - else if (set === "off") { - grunt.option("force",false); - } - else if (set === "restore") { - grunt.option("force",previous_force_state); - } - }); + grunt.registerTask("force",function(set){ + if (set === "on") { + grunt.option("force",true); + } + else if (set === "off") { + grunt.option("force",false); + } + else if (set === "restore") { + grunt.option("force",previous_force_state); + } + }); grunt.registerTask('sauce', [ 'browsertest-lessjs', @@ -395,6 +402,7 @@ module.exports = function (grunt) { var testTasks = [ 'clean', 'jshint', + 'jscs', 'shell:test', 'browsertest' ]; diff --git a/bin/lessc b/bin/lessc index ca1cd94d..46f64219 100755 --- a/bin/lessc +++ b/bin/lessc @@ -80,401 +80,403 @@ function printUsage() { continueProcessing = false; } -args = args.filter(function (arg) { - var match; +// self executing function so we can return +(function() { + args = args.filter(function (arg) { + var match; - match = arg.match(/^-I(.+)$/); - if (match) { - options.paths.push(match[1]); - return false; - } - - match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=(.*))?$/i); - if (match) { arg = match[1]; } - else { return arg; } - - switch (arg) { - case 'v': - case 'version': - console.log("lessc " + less.version.join('.') + " (Less Compiler) [JavaScript]"); - continueProcessing = false; - break; - case 'verbose': - verbose = true; - break; - case 's': - case 'silent': - silent = true; - break; - case 'l': - case 'lint': - options.lint = true; - break; - case 'strict-imports': - options.strictImports = true; - break; - case 'h': - case 'help': - printUsage(); - break; - case 'x': - case 'compress': - options.compress = true; - break; - case 'insecure': - options.insecure = true; - break; - case 'M': - case 'depends': - options.depends = true; - break; - case 'max-line-len': - if (checkArgFunc(arg, match[2])) { - options.maxLineLen = parseInt(match[2], 10); - if (options.maxLineLen <= 0) { - options.maxLineLen = -1; - } - } - break; - case 'no-color': - options.color = false; - break; - case 'no-ie-compat': - options.ieCompat = false; - break; - case 'no-js': - options.javascriptEnabled = false; - break; - case 'include-path': - if (checkArgFunc(arg, match[2])) { - options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':') - .map(function(p) { - if (p) { - return path.resolve(process.cwd(), p); - } - }); - } - break; - case 'line-numbers': - if (checkArgFunc(arg, match[2])) { - options.dumpLineNumbers = match[2]; - } - break; - case 'source-map': - options.sourceMap = true; - if (match[2]) { - sourceMapOptions.sourceMapFullFilename = match[2]; - } - break; - case 'source-map-rootpath': - if (checkArgFunc(arg, match[2])) { - sourceMapOptions.sourceMapRootpath = match[2]; - } - break; - case 'source-map-basepath': - if (checkArgFunc(arg, match[2])) { - sourceMapOptions.sourceMapBasepath = match[2]; - } - break; - case 'source-map-map-inline': - sourceMapFileInline = true; - options.sourceMap = true; - break; - case 'source-map-less-inline': - sourceMapOptions.outputSourceFiles = true; - break; - case 'source-map-url': - if (checkArgFunc(arg, match[2])) { - sourceMapOptions.sourceMapURL = match[2]; - } - break; - case 'rp': - case 'rootpath': - if (checkArgFunc(arg, match[2])) { - options.rootpath = match[2].replace(/\\/g, '/'); - } - break; - case "ru": - case "relative-urls": - options.relativeUrls = true; - break; - case "sm": - case "strict-math": - if (checkArgFunc(arg, match[2])) { - options.strictMath = checkBooleanArg(match[2]); - } - break; - case "su": - case "strict-units": - if (checkArgFunc(arg, match[2])) { - options.strictUnits = checkBooleanArg(match[2]); - } - break; - case "global-var": - if (checkArgFunc(arg, match[2])) { - if (!options.globalVars) { - options.globalVars = {}; - } - parseVariableOption(match[2], options.globalVars); - } - break; - case "modify-var": - if (checkArgFunc(arg, match[2])) { - if (!options.modifyVars) { - options.modifyVars = {}; - } - - parseVariableOption(match[2], options.modifyVars); - } - break; - case 'url-args': - if (checkArgFunc(arg, match[2])) { - options.urlArgs = match[2]; - } - break; - case 'plugin': - var splitupArg = match[2].match(/^([^=]+)(=(.*))?/), - name = splitupArg[1], - pluginOptions = splitupArg[3]; - - plugin = pluginLoader.tryLoadPlugin(name, pluginOptions); - if (plugin) { - plugins.push(plugin); - } else { - console.log("Unable to load plugin " + name + " please make sure that it is installed under or at the same level as less"); - console.log(); - printUsage(); - currentErrorcode = 1; - } - break; - default: - plugin = pluginLoader.tryLoadPlugin("less-plugin-" + arg, match[2]); - if (plugin) { - plugins.push(plugin); - } else { - console.log("Unable to interpret argument " + arg + " - if it is a plugin (less-plugin-" + arg + "), make sure that it is installed under or at the same level as less"); - console.log(); - printUsage(); - currentErrorcode = 1; - } - break; - } -}); - -if (!continueProcessing) { - return; -} - -var input = args[1]; -if (input && input != '-') { - input = path.resolve(process.cwd(), input); -} -var output = args[2]; -var outputbase = args[2]; -if (output) { - output = path.resolve(process.cwd(), output); - if (warningMessages) { - console.log(warningMessages); - } -} - -if (options.sourceMap) { - - sourceMapOptions.sourceMapInputFilename = input; - if (!sourceMapOptions.sourceMapFullFilename) { - if (!output && !sourceMapFileInline) { - console.log("the sourcemap option only has an optional filename if the css filename is given"); - console.log("consider adding --source-map-map-inline which embeds the sourcemap into the css"); - return; + match = arg.match(/^-I(.+)$/); + if (match) { + options.paths.push(match[1]); + return false; } - // its in the same directory, so always just the basename - sourceMapOptions.sourceMapOutputFilename = path.basename(output); - sourceMapOptions.sourceMapFullFilename = output + ".map"; - // its in the same directory, so always just the basename - sourceMapOptions.sourceMapFilename = path.basename(sourceMapOptions.sourceMapFullFilename); - } else if (options.sourceMap && !sourceMapFileInline) { - var mapFilename = path.resolve(process.cwd(), sourceMapOptions.sourceMapFullFilename), - mapDir = path.dirname(mapFilename), - outputDir = path.dirname(output); - // find the path from the map to the output file - sourceMapOptions.sourceMapOutputFilename = path.join( - path.relative(mapDir, outputDir), path.basename(output)); - // make the sourcemap filename point to the sourcemap relative to the css file output directory - sourceMapOptions.sourceMapFilename = path.join( - path.relative(outputDir, mapDir), path.basename(sourceMapOptions.sourceMapFullFilename)); - } -} + match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=(.*))?$/i); + if (match) { arg = match[1]; } + else { return arg; } -if (sourceMapOptions.sourceMapBasepath === undefined) { - sourceMapOptions.sourceMapBasepath = input ? path.dirname(input) : process.cwd(); -} + switch (arg) { + case 'v': + case 'version': + console.log("lessc " + less.version.join('.') + " (Less Compiler) [JavaScript]"); + continueProcessing = false; + break; + case 'verbose': + verbose = true; + break; + case 's': + case 'silent': + silent = true; + break; + case 'l': + case 'lint': + options.lint = true; + break; + case 'strict-imports': + options.strictImports = true; + break; + case 'h': + case 'help': + printUsage(); + break; + case 'x': + case 'compress': + options.compress = true; + break; + case 'insecure': + options.insecure = true; + break; + case 'M': + case 'depends': + options.depends = true; + break; + case 'max-line-len': + if (checkArgFunc(arg, match[2])) { + options.maxLineLen = parseInt(match[2], 10); + if (options.maxLineLen <= 0) { + options.maxLineLen = -1; + } + } + break; + case 'no-color': + options.color = false; + break; + case 'no-ie-compat': + options.ieCompat = false; + break; + case 'no-js': + options.javascriptEnabled = false; + break; + case 'include-path': + if (checkArgFunc(arg, match[2])) { + options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':') + .map(function(p) { + if (p) { + return path.resolve(process.cwd(), p); + } + }); + } + break; + case 'line-numbers': + if (checkArgFunc(arg, match[2])) { + options.dumpLineNumbers = match[2]; + } + break; + case 'source-map': + options.sourceMap = true; + if (match[2]) { + sourceMapOptions.sourceMapFullFilename = match[2]; + } + break; + case 'source-map-rootpath': + if (checkArgFunc(arg, match[2])) { + sourceMapOptions.sourceMapRootpath = match[2]; + } + break; + case 'source-map-basepath': + if (checkArgFunc(arg, match[2])) { + sourceMapOptions.sourceMapBasepath = match[2]; + } + break; + case 'source-map-map-inline': + sourceMapFileInline = true; + options.sourceMap = true; + break; + case 'source-map-less-inline': + sourceMapOptions.outputSourceFiles = true; + break; + case 'source-map-url': + if (checkArgFunc(arg, match[2])) { + sourceMapOptions.sourceMapURL = match[2]; + } + break; + case 'rp': + case 'rootpath': + if (checkArgFunc(arg, match[2])) { + options.rootpath = match[2].replace(/\\/g, '/'); + } + break; + case "ru": + case "relative-urls": + options.relativeUrls = true; + break; + case "sm": + case "strict-math": + if (checkArgFunc(arg, match[2])) { + options.strictMath = checkBooleanArg(match[2]); + } + break; + case "su": + case "strict-units": + if (checkArgFunc(arg, match[2])) { + options.strictUnits = checkBooleanArg(match[2]); + } + break; + case "global-var": + if (checkArgFunc(arg, match[2])) { + if (!options.globalVars) { + options.globalVars = {}; + } + parseVariableOption(match[2], options.globalVars); + } + break; + case "modify-var": + if (checkArgFunc(arg, match[2])) { + if (!options.modifyVars) { + options.modifyVars = {}; + } -if (sourceMapOptions.sourceMapRootpath === undefined) { - var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename), - pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename); - sourceMapOptions.sourceMapRootpath = path.relative(pathToMap, pathToInput); -} + parseVariableOption(match[2], options.modifyVars); + } + break; + case 'url-args': + if (checkArgFunc(arg, match[2])) { + options.urlArgs = match[2]; + } + break; + case 'plugin': + var splitupArg = match[2].match(/^([^=]+)(=(.*))?/), + name = splitupArg[1], + pluginOptions = splitupArg[3]; - -if (! input) { - console.log("lessc: no input files"); - console.log(""); - printUsage(); - currentErrorcode = 1; - return; -} - -var ensureDirectory = function (filepath) { - var dir = path.dirname(filepath), - cmd, - existsSync = fs.existsSync || path.existsSync; - if (!existsSync(dir)) { - if (mkdirp === undefined) { - try {mkdirp = require('mkdirp');} - catch(e) { mkdirp = null; } + plugin = pluginLoader.tryLoadPlugin(name, pluginOptions); + if (plugin) { + plugins.push(plugin); + } else { + console.log("Unable to load plugin " + name + " please make sure that it is installed under or at the same level as less"); + console.log(); + printUsage(); + currentErrorcode = 1; + } + break; + default: + plugin = pluginLoader.tryLoadPlugin("less-plugin-" + arg, match[2]); + if (plugin) { + plugins.push(plugin); + } else { + console.log("Unable to interpret argument " + arg + " - if it is a plugin (less-plugin-" + arg + "), make sure that it is installed under or at the same level as less"); + console.log(); + printUsage(); + currentErrorcode = 1; + } + break; } - cmd = mkdirp && mkdirp.sync || fs.mkdirSync; - cmd(dir); - } -}; + }); -if (options.depends) { - if (!outputbase) { - console.log("option --depends requires an output path to be specified"); + if (!continueProcessing) { return; } - process.stdout.write(outputbase + ": "); -} -if (!sourceMapFileInline) { - var writeSourceMap = function(output, onDone) { - var filename = sourceMapOptions.sourceMapFullFilename; - ensureDirectory(filename); - fs.writeFile(filename, output, 'utf8', function (err) { - if (err) { - var description = "Error: "; - if (errno && errno.errno[err.errno]) { - description += errno.errno[err.errno].description; - } else { - description += err.code + " " + err.message; - } - less.logger.error('lessc: failed to create file ' + filename); - less.logger.error(description); - } else { - less.logger.info('lessc: wrote ' + filename); - } - onDone(); - }); - }; -} - -var writeSourceMapIfNeeded = function(output, onDone) { - if (options.sourceMap && !sourceMapFileInline) { - writeSourceMap(output, onDone); + var input = args[1]; + if (input && input != '-') { + input = path.resolve(process.cwd(), input); } -}; - -var writeOutput = function(output, result, onSuccess) { + var output = args[2]; + var outputbase = args[2]; if (output) { - ensureDirectory(output); - fs.writeFile(output, result.css, {encoding: 'utf8'}, function (err) { - if (err) { - var description = "Error: "; - if (errno && errno.errno[err.errno]) { - description += errno.errno[err.errno].description; - } else { - description += err.code + " " + err.message; - } - less.logger.error('lessc: failed to create file ' + output); - less.logger.error(description); - } else { - less.logger.info('lessc: wrote ' + output); - onSuccess(); - } - }); - } else if (!options.depends) { - process.stdout.write(result.css); - onSuccess(); - } -}; - -var logDependencies = function(options, result) { - if (options.depends) { - var depends = ""; - for(var i = 0; i < result.imports.length; i++) { - depends += result.imports[i] + " "; + output = path.resolve(process.cwd(), output); + if (warningMessages) { + console.log(warningMessages); } - console.log(depends); } -}; -var parseLessFile = function (e, data) { - if (e) { - console.log("lessc: " + e.message); + if (options.sourceMap) { + + sourceMapOptions.sourceMapInputFilename = input; + if (!sourceMapOptions.sourceMapFullFilename) { + if (!output && !sourceMapFileInline) { + console.log("the sourcemap option only has an optional filename if the css filename is given"); + console.log("consider adding --source-map-map-inline which embeds the sourcemap into the css"); + return; + } + // its in the same directory, so always just the basename + sourceMapOptions.sourceMapOutputFilename = path.basename(output); + sourceMapOptions.sourceMapFullFilename = output + ".map"; + // its in the same directory, so always just the basename + sourceMapOptions.sourceMapFilename = path.basename(sourceMapOptions.sourceMapFullFilename); + } else if (options.sourceMap && !sourceMapFileInline) { + var mapFilename = path.resolve(process.cwd(), sourceMapOptions.sourceMapFullFilename), + mapDir = path.dirname(mapFilename), + outputDir = path.dirname(output); + // find the path from the map to the output file + sourceMapOptions.sourceMapOutputFilename = path.join( + path.relative(mapDir, outputDir), path.basename(output)); + + // make the sourcemap filename point to the sourcemap relative to the css file output directory + sourceMapOptions.sourceMapFilename = path.join( + path.relative(outputDir, mapDir), path.basename(sourceMapOptions.sourceMapFullFilename)); + } + } + + if (sourceMapOptions.sourceMapBasepath === undefined) { + sourceMapOptions.sourceMapBasepath = input ? path.dirname(input) : process.cwd(); + } + + if (sourceMapOptions.sourceMapRootpath === undefined) { + var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename), + pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename); + sourceMapOptions.sourceMapRootpath = path.relative(pathToMap, pathToInput); + } + + if (! input) { + console.log("lessc: no input files"); + console.log(""); + printUsage(); currentErrorcode = 1; return; } - data = data.replace(/^\uFEFF/, ''); + var ensureDirectory = function (filepath) { + var dir = path.dirname(filepath), + cmd, + existsSync = fs.existsSync || path.existsSync; + if (!existsSync(dir)) { + if (mkdirp === undefined) { + try {mkdirp = require('mkdirp');} + catch(e) { mkdirp = null; } + } + cmd = mkdirp && mkdirp.sync || fs.mkdirSync; + cmd(dir); + } + }; - options.paths = [path.dirname(input)].concat(options.paths); - options.filename = input; - - if (options.lint) { - options.sourceMap = false; - } - sourceMapOptions.sourceMapFileInline = sourceMapFileInline; - - if (options.sourceMap) { - options.sourceMap = sourceMapOptions; + if (options.depends) { + if (!outputbase) { + console.log("option --depends requires an output path to be specified"); + return; + } + process.stdout.write(outputbase + ": "); } - less.logger.addListener({ - info: function(msg) { - if (verbose) { + if (!sourceMapFileInline) { + var writeSourceMap = function(output, onDone) { + var filename = sourceMapOptions.sourceMapFullFilename; + ensureDirectory(filename); + fs.writeFile(filename, output, 'utf8', function (err) { + if (err) { + var description = "Error: "; + if (errno && errno.errno[err.errno]) { + description += errno.errno[err.errno].description; + } else { + description += err.code + " " + err.message; + } + less.logger.error('lessc: failed to create file ' + filename); + less.logger.error(description); + } else { + less.logger.info('lessc: wrote ' + filename); + } + onDone(); + }); + }; + } + + var writeSourceMapIfNeeded = function(output, onDone) { + if (options.sourceMap && !sourceMapFileInline) { + writeSourceMap(output, onDone); + } + }; + + var writeOutput = function(output, result, onSuccess) { + if (output) { + ensureDirectory(output); + fs.writeFile(output, result.css, {encoding: 'utf8'}, function (err) { + if (err) { + var description = "Error: "; + if (errno && errno.errno[err.errno]) { + description += errno.errno[err.errno].description; + } else { + description += err.code + " " + err.message; + } + less.logger.error('lessc: failed to create file ' + output); + less.logger.error(description); + } else { + less.logger.info('lessc: wrote ' + output); + onSuccess(); + } + }); + } else if (!options.depends) { + process.stdout.write(result.css); + onSuccess(); + } + }; + + var logDependencies = function(options, result) { + if (options.depends) { + var depends = ""; + for(var i = 0; i < result.imports.length; i++) { + depends += result.imports[i] + " "; + } + console.log(depends); + } + }; + + var parseLessFile = function (e, data) { + if (e) { + console.log("lessc: " + e.message); + currentErrorcode = 1; + return; + } + + data = data.replace(/^\uFEFF/, ''); + + options.paths = [path.dirname(input)].concat(options.paths); + options.filename = input; + + if (options.lint) { + options.sourceMap = false; + } + sourceMapOptions.sourceMapFileInline = sourceMapFileInline; + + if (options.sourceMap) { + options.sourceMap = sourceMapOptions; + } + + less.logger.addListener({ + info: function(msg) { + if (verbose) { + console.log(msg); + } + }, + warn: function(msg) { + // do not show warning if outputting css to the console or the silent option is used + if (!silent && output) { + console.warn(msg); + } + }, + error: function(msg) { console.log(msg); } - }, - warn: function(msg) { - // do not show warning if outputting css to the console or the silent option is used - if (!silent && output) { - console.warn(msg); - } - }, - error: function(msg) { - console.log(msg); - } - }); - - less.render(data, options) - .then(function(result) { - if(!options.lint) { - writeOutput(output, result, function() { - writeSourceMapIfNeeded(result.map, function() { - logDependencies(options, result); - }); - }); - } - }, - function(err) { - less.writeError(err, options); - currentErrorcode = 1; }); -}; -if (input != '-') { - fs.readFile(input, 'utf8', parseLessFile); -} else { - process.stdin.resume(); - process.stdin.setEncoding('utf8'); + less.render(data, options) + .then(function(result) { + if(!options.lint) { + writeOutput(output, result, function() { + writeSourceMapIfNeeded(result.map, function() { + logDependencies(options, result); + }); + }); + } + }, + function(err) { + less.writeError(err, options); + currentErrorcode = 1; + }); + }; - var buffer = ''; - process.stdin.on('data', function(data) { - buffer += data; - }); + if (input != '-') { + fs.readFile(input, 'utf8', parseLessFile); + } else { + process.stdin.resume(); + process.stdin.setEncoding('utf8'); - process.stdin.on('end', function() { - parseLessFile(false, buffer); - }); -} + var buffer = ''; + process.stdin.on('data', function(data) { + buffer += data; + }); + + process.stdin.on('end', function() { + parseLessFile(false, buffer); + }); + } +})(); \ No newline at end of file diff --git a/lib/less-browser/add-default-options.js b/lib/less-browser/add-default-options.js index 9742fe4d..b06c58f1 100644 --- a/lib/less-browser/add-default-options.js +++ b/lib/less-browser/add-default-options.js @@ -39,8 +39,8 @@ module.exports = function(window, options) { options.useFileCache = true; } - if (options.onReady === undefined) { - options.onReady = true; - } + if (options.onReady === undefined) { + options.onReady = true; + } }; diff --git a/lib/less-browser/bootstrap.js b/lib/less-browser/bootstrap.js index 642214c2..706f98bf 100644 --- a/lib/less-browser/bootstrap.js +++ b/lib/less-browser/bootstrap.js @@ -14,13 +14,13 @@ require("./add-default-options")(window, options); var less = module.exports = require("./index")(window, options); if (options.onReady) { - if (/!watch/.test(window.location.hash)) { - less.watch(); - } - - less.pageLoadFinished = less.registerStylesheets().then( - function () { - return less.refresh(less.env === 'development'); - } - ); + if (/!watch/.test(window.location.hash)) { + less.watch(); + } + + less.pageLoadFinished = less.registerStylesheets().then( + function () { + return less.refresh(less.env === 'development'); + } + ); } \ No newline at end of file diff --git a/lib/less-browser/index.js b/lib/less-browser/index.js index 3708f539..7455b480 100644 --- a/lib/less-browser/index.js +++ b/lib/less-browser/index.js @@ -112,14 +112,14 @@ function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { if (webInfo) { webInfo.remaining = remaining; - if (!instanceOptions.modifyVars) { - var css = cache.getCSS(path, webInfo); - if (!reload && css) { - webInfo.local = true; - callback(null, css, data, sheet, webInfo, path); - return; - } - } + if (!instanceOptions.modifyVars) { + var css = cache.getCSS(path, webInfo); + if (!reload && css) { + webInfo.local = true; + callback(null, css, data, sheet, webInfo, path); + return; + } + } } //TODO add tests around how this behaves when reloading @@ -131,11 +131,11 @@ function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { e.href = path; callback(e); } else { - result.css = postProcessCSS(result.css); - if (!instanceOptions.modifyVars) { - cache.setCSS(sheet.href, webInfo.lastModified, result.css); - } - callback(null, result.css, data, sheet, webInfo, path); + result.css = postProcessCSS(result.css); + if (!instanceOptions.modifyVars) { + cache.setCSS(sheet.href, webInfo.lastModified, result.css); + } + callback(null, result.css, data, sheet, webInfo, path); } }); } @@ -232,7 +232,7 @@ less.refresh = function (reload, modifyVars, clearFileCache) { } else { less.logger.info("rendered " + sheet.href + " successfully."); } - browser.createCSS(window.document, css, sheet); + browser.createCSS(window.document, css, sheet); less.logger.info("css for " + sheet.href + " generated in " + (new Date() - endTime) + 'ms'); if (webInfo.remaining === 0) { totalMilliseconds = new Date() - startTime; diff --git a/lib/less-node/file-manager.js b/lib/less-node/file-manager.js index 46802504..76092897 100644 --- a/lib/less-node/file-manager.js +++ b/lib/less-node/file-manager.js @@ -39,10 +39,10 @@ FileManager.prototype.loadFile = function(filename, currentDirectory, options, e return new PromiseConstructor(function(fulfill, reject) { (function tryPathIndex(i) { if (i < paths.length) { - fullFilename = filename; - if (paths[i]) { + fullFilename = filename; + if (paths[i]) { fullFilename = path.join(paths[i], fullFilename); - } + } fs.stat(fullFilename, function (err) { if (err) { filenamesTried.push(fullFilename); diff --git a/lib/less-node/image-size.js b/lib/less-node/image-size.js index eb118354..492153e7 100644 --- a/lib/less-node/image-size.js +++ b/lib/less-node/image-size.js @@ -1,34 +1,34 @@ var Dimension = require("../less/tree/dimension"), - Expression = require("../less/tree/expression"), - functionRegistry = require("./../less/functions/function-registry"), - path = require("path"); + Expression = require("../less/tree/expression"), + functionRegistry = require("./../less/functions/function-registry"), + path = require("path"); function imageSize(filePathNode) { - var filePath = filePathNode.value; - var currentDirectory = filePathNode.currentFileInfo.relativeUrls ? - filePathNode.currentFileInfo.currentDirectory : filePathNode.currentFileInfo.entryPath; + var filePath = filePathNode.value; + var currentDirectory = filePathNode.currentFileInfo.relativeUrls ? + filePathNode.currentFileInfo.currentDirectory : filePathNode.currentFileInfo.entryPath; - var sizeOf = require('image-size'); - filePath = path.join(currentDirectory, filePath); - return sizeOf(filePath); + var sizeOf = require('image-size'); + filePath = path.join(currentDirectory, filePath); + return sizeOf(filePath); } var imageFunctions = { - "image-size": function(filePathNode) { - var size = imageSize(filePathNode); - return new Expression([ - new Dimension(size.width, "px"), - new Dimension(size.height, "px") - ]); - }, - "image-width": function(filePathNode) { - var size = imageSize(filePathNode); - return new Dimension(size.width, "px"); - }, - "image-height": function(filePathNode) { - var size = imageSize(filePathNode); - return new Dimension(size.height, "px"); - } + "image-size": function(filePathNode) { + var size = imageSize(filePathNode); + return new Expression([ + new Dimension(size.width, "px"), + new Dimension(size.height, "px") + ]); + }, + "image-width": function(filePathNode) { + var size = imageSize(filePathNode); + return new Dimension(size.width, "px"); + }, + "image-height": function(filePathNode) { + var size = imageSize(filePathNode); + return new Dimension(size.height, "px"); + } }; functionRegistry.addMultiple(imageFunctions); \ No newline at end of file diff --git a/lib/less-node/lessc-helper.js b/lib/less-node/lessc-helper.js index 4e24800e..30f17c45 100644 --- a/lib/less-node/lessc-helper.js +++ b/lib/less-node/lessc-helper.js @@ -70,8 +70,8 @@ var lessc_helper = { console.log(" media query which is compatible with the SASS"); console.log(" format, and 'all' which will do both."); console.log(" --verbose Be verbose."); - console.log(" -x, --compress Compresses output by removing some whitespaces."); - console.log(" We recommend you use a dedicated minifer like less-plugin-clean-css"); + console.log(" -x, --compress Compresses output by removing some whitespaces."); + console.log(" We recommend you use a dedicated minifer like less-plugin-clean-css"); console.log(""); console.log("Report bugs to: http://github.com/less/less.js/issues"); console.log("Home page: "); diff --git a/lib/less-rhino/index.js b/lib/less-rhino/index.js index d626b174..adf2de89 100644 --- a/lib/less-rhino/index.js +++ b/lib/less-rhino/index.js @@ -135,7 +135,6 @@ less.Parser.fileLoader = function (file, currentFileInfo, callback, env) { } }; - function writeFile(filename, content) { var fstream = new java.io.FileWriter(filename); var out = new java.io.BufferedWriter(fstream); @@ -371,7 +370,6 @@ function writeFile(filename, content) { options.sourceMapOutputFilename = options.sourceMap; } - if (!name) { console.log("lessc: no inout files"); console.log(""); diff --git a/lib/less/contexts.js b/lib/less/contexts.js index 52b902ef..d031b64f 100644 --- a/lib/less/contexts.js +++ b/lib/less/contexts.js @@ -108,4 +108,3 @@ contexts.Eval.prototype.normalizePath = function( path ) { }; //todo - do the same for the toCSS ? - diff --git a/lib/less/functions/data-uri.js b/lib/less/functions/data-uri.js index 35d9c563..ce8e50da 100644 --- a/lib/less/functions/data-uri.js +++ b/lib/less/functions/data-uri.js @@ -16,7 +16,7 @@ module.exports = function(environment) { var mimetype = mimetypeNode && mimetypeNode.value; var filePath = filePathNode.value; - var currentFileInfo = this.currentFileInfo; + var currentFileInfo = this.currentFileInfo; var currentDirectory = currentFileInfo.relativeUrls ? currentFileInfo.currentDirectory : currentFileInfo.entryPath; @@ -40,7 +40,7 @@ module.exports = function(environment) { mimetype = environment.mimeLookup(filePath); - if (mimetype === "image/svg+xml") { + if (mimetype === "image/svg+xml") { useBase64 = false; } else { // use base 64 unless it's an ASCII or UTF-8 format @@ -59,25 +59,25 @@ module.exports = function(environment) { return fallback(this, filePathNode || mimetypeNode); } var buf = fileSync.contents; - if (useBase64 && !environment.encodeBase64) { - return fallback(this, filePathNode); - } + if (useBase64 && !environment.encodeBase64) { + return fallback(this, filePathNode); + } buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf); var uri = "data:" + mimetype + ',' + buf + fragment; - // IE8 cannot handle a data-uri larger than 32,768 characters. If this is exceeded - // and the --ieCompat flag is enabled, return a normal url() instead. - var DATA_URI_MAX = 32768; - if (uri.length >= DATA_URI_MAX) { + // IE8 cannot handle a data-uri larger than 32,768 characters. If this is exceeded + // and the --ieCompat flag is enabled, return a normal url() instead. + var DATA_URI_MAX = 32768; + if (uri.length >= DATA_URI_MAX) { - if (this.context.ieCompat !== false) { - logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length + " characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!"); + if (this.context.ieCompat !== false) { + logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length + " characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!"); - return fallback(this, filePathNode || mimetypeNode); - } - } + return fallback(this, filePathNode || mimetypeNode); + } + } return new URL(new Quoted('"' + uri + '"', uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); }); diff --git a/lib/less/import-manager.js b/lib/less/import-manager.js index 386320aa..79ac50eb 100644 --- a/lib/less/import-manager.js +++ b/lib/less/import-manager.js @@ -41,13 +41,13 @@ module.exports = function(environment) { var importedEqualsRoot = fullPath === importManager.rootFilename; if (importOptions.optional && e) { - callback(null, {rules:[]}, false, null); - } - else { + callback(null, {rules:[]}, false, null); + } + else { importManager.files[fullPath] = root; if (e && !importManager.error) { importManager.error = e; } callback(e, root, importedEqualsRoot, fullPath); - } + } }; var newFileInfo = { diff --git a/lib/less/parse-tree.js b/lib/less/parse-tree.js index 73b49b16..93045e0c 100644 --- a/lib/less/parse-tree.js +++ b/lib/less/parse-tree.js @@ -1,6 +1,6 @@ var LessError = require('./less-error'), transformTree = require("./transform-tree"), - logger = require("./logger"); + logger = require("./logger"); module.exports = function(SourceMapBuilder) { var ParseTree = function(root, imports) { @@ -17,11 +17,11 @@ ParseTree.prototype.toCSS = function(options) { } try { - var compress = Boolean(options.compress); - if (compress) { - logger.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css."); - } - + var compress = Boolean(options.compress); + if (compress) { + logger.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css."); + } + var toCSSOptions = { compress: compress, dumpLineNumbers: options.dumpLineNumbers, diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index 60c414df..22738698 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -238,10 +238,10 @@ var Parser = function Parser(context, imports, fileInfo) { if (!node) { break; } root.push(node); } - // always process comments before deciding if finished - if (parserInput.finished) { - break; - } + // always process comments before deciding if finished + if (parserInput.finished) { + break; + } if (parserInput.peek('}')) { break; } @@ -1387,19 +1387,19 @@ var Parser = function Parser(context, imports, fileInfo) { sub: function () { var a, e; - parserInput.save(); + parserInput.save(); if (parserInput.$char('(')) { a = this.addition(); if (a && parserInput.$char(')')) { - parserInput.forget(); - e = new(tree.Expression)([a]); - e.parens = true; + parserInput.forget(); + e = new(tree.Expression)([a]); + e.parens = true; return e; } - parserInput.restore("Expected ')'"); - return; + parserInput.restore("Expected ')'"); + return; } - parserInput.restore(); + parserInput.restore(); }, multiplication: function () { var m, a, op, operation, isSpaced; diff --git a/lib/less/tree/assignment.js b/lib/less/tree/assignment.js index ec91263e..9c38879d 100644 --- a/lib/less/tree/assignment.js +++ b/lib/less/tree/assignment.js @@ -25,4 +25,3 @@ Assignment.prototype.genCSS = function (context, output) { } }; module.exports = Assignment; - diff --git a/lib/less/tree/directive.js b/lib/less/tree/directive.js index 12165c53..20c0eb31 100644 --- a/lib/less/tree/directive.js +++ b/lib/less/tree/directive.js @@ -39,9 +39,9 @@ Directive.prototype.genCSS = function (context, output) { value.genCSS(context, output); } if (rules) { - if (rules.type === "Ruleset") { - rules = [rules]; - } + if (rules.type === "Ruleset") { + rules = [rules]; + } this.outputRuleset(context, output, rules); } else { output.add(';'); diff --git a/lib/less/tree/ruleset.js b/lib/less/tree/ruleset.js index 39198d6c..cd63e85d 100644 --- a/lib/less/tree/ruleset.js +++ b/lib/less/tree/ruleset.js @@ -220,7 +220,7 @@ Ruleset.prototype.variables = function () { } // when evaluating variables in an import statement, imports have not been eval'd // so we need to go inside import statements. - // guard against root being a string (in the case of inlined less) + // guard against root being a string (in the case of inlined less) if (r.type === "Import" && r.root && r.root.variables) { var vars = r.root.variables(); for(var name in vars) { @@ -451,12 +451,12 @@ Ruleset.prototype.getIsReferenced = function() { return false; }; - Ruleset.prototype.joinSelectors = function (paths, context, selectors) { for (var s = 0; s < selectors.length; s++) { this.joinSelector(paths, context, selectors[s]); } }; + Ruleset.prototype.joinSelector = function (paths, context, selector) { var i, j, k, diff --git a/lib/less/visitors/extend-visitor.js b/lib/less/visitors/extend-visitor.js index 2aaba722..5df87df0 100644 --- a/lib/less/visitors/extend-visitor.js +++ b/lib/less/visitors/extend-visitor.js @@ -116,7 +116,7 @@ ProcessExtendsVisitor.prototype = { if(!indicies[extend.index + ' ' + selector]) { indicies[extend.index + ' ' + selector] = true; - logger.warn("extend '"+selector+"' has no matches"); + logger.warn("extend '"+selector+"' has no matches"); } }); }, diff --git a/lib/less/visitors/import-sequencer.js b/lib/less/visitors/import-sequencer.js index b9e27e9e..b3e1fcfa 100644 --- a/lib/less/visitors/import-sequencer.js +++ b/lib/less/visitors/import-sequencer.js @@ -2,7 +2,7 @@ function ImportSequencer(onSequencerEmpty) { this.imports = []; this.variableImports = []; this._onSequencerEmpty = onSequencerEmpty; - this._currentDepth = 0; + this._currentDepth = 0; } ImportSequencer.prototype.addImport = function(callback) { @@ -25,27 +25,27 @@ ImportSequencer.prototype.addVariableImport = function(callback) { }; ImportSequencer.prototype.tryRun = function() { - this._currentDepth++; - try { - while(true) { - while(this.imports.length > 0) { - var importItem = this.imports[0]; - if (!importItem.isReady) { - return; - } - this.imports = this.imports.slice(1); - importItem.callback.apply(null, importItem.args); - } - if (this.variableImports.length === 0) { - break; - } - var variableImport = this.variableImports[0]; - this.variableImports = this.variableImports.slice(1); - variableImport(); - } - } finally { - this._currentDepth--; - } + this._currentDepth++; + try { + while(true) { + while(this.imports.length > 0) { + var importItem = this.imports[0]; + if (!importItem.isReady) { + return; + } + this.imports = this.imports.slice(1); + importItem.callback.apply(null, importItem.args); + } + if (this.variableImports.length === 0) { + break; + } + var variableImport = this.variableImports[0]; + this.variableImports = this.variableImports.slice(1); + variableImport(); + } + } finally { + this._currentDepth--; + } if (this._currentDepth === 0 && this._onSequencerEmpty) { this._onSequencerEmpty(); } diff --git a/lib/less/visitors/import-visitor.js b/lib/less/visitors/import-visitor.js index f7e3070f..e9faf912 100644 --- a/lib/less/visitors/import-visitor.js +++ b/lib/less/visitors/import-visitor.js @@ -28,12 +28,12 @@ ImportVisitor.prototype = { this.isFinished = true; this._sequencer.tryRun(); }, - _onSequencerEmpty: function() { - if (!this.isFinished) { - return; - } - this._finish(this.error); - }, + _onSequencerEmpty: function() { + if (!this.isFinished) { + return; + } + this._finish(this.error); + }, visitImport: function (importNode, visitArgs) { var inlineCSS = importNode.options.inline; @@ -87,9 +87,9 @@ ImportVisitor.prototype = { this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.currentFileInfo, evaldImportNode.options, sequencedOnImported); } else { this.importCount--; - if (this.isFinished) { - this._sequencer.tryRun(); - } + if (this.isFinished) { + this._sequencer.tryRun(); + } } }, onImported: function (importNode, context, e, root, importedAtRoot, fullPath) { @@ -139,7 +139,7 @@ ImportVisitor.prototype = { importVisitor.importCount--; if (importVisitor.isFinished) { - importVisitor._sequencer.tryRun(); + importVisitor._sequencer.tryRun(); } }, visitRule: function (ruleNode, visitArgs) { diff --git a/package.json b/package.json index 763dfedf..bfc44daa 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "grunt-contrib-jasmine": "^0.8.1", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-uglify": "^0.7.0", + "grunt-jscs": "^1.2.0", "grunt-shell": "^1.1.1", "grunt-browserify": "^3.2.0", "matchdep": "^0.3.0", diff --git a/test/browser/common.js b/test/browser/common.js index 5b6772d0..9e89a768 100644 --- a/test/browser/common.js +++ b/test/browser/common.js @@ -149,7 +149,7 @@ var testErrorSheet = function (sheet) { .replace(/\{pathrel\}/g, "") .replace(/\{pathhref\}/g, "http://localhost:8081/test/less/errors/") .replace(/\{404status\}/g, " (404)") - .replace(/\{node\}.*\{\/node\}/g, "") + .replace(/\{node\}.*\{\/node\}/g, "") .replace(/\n$/, ""); expect(actualErrorMsg).toEqual(errorTxt); if (errorTxt == actualErrorMsg) { diff --git a/test/browser/jasmine-jsreporter.js b/test/browser/jasmine-jsreporter.js index 47553176..4fd5569a 100644 --- a/test/browser/jasmine-jsreporter.js +++ b/test/browser/jasmine-jsreporter.js @@ -180,7 +180,6 @@ // export public jasmine.JSReporter = JSReporter; - // ------------------------------------------------------------------------ // Jasmine JSReporter for Jasmine 2.0 // ------------------------------------------------------------------------ diff --git a/test/browser/runner-errors-options.js b/test/browser/runner-errors-options.js index 1ed092ee..8ba00e27 100644 --- a/test/browser/runner-errors-options.js +++ b/test/browser/runner-errors-options.js @@ -2,4 +2,3 @@ var less = { strictUnits: true, strictMath: true, logLevel: 4 }; - diff --git a/test/browser/runner-errors-spec.js b/test/browser/runner-errors-spec.js index 0b720676..8f59c597 100644 --- a/test/browser/runner-errors-spec.js +++ b/test/browser/runner-errors-spec.js @@ -1,4 +1,3 @@ describe("less.js error tests", function() { testLessErrorsInDocument(); }); - diff --git a/test/browser/runner-legacy-options.js b/test/browser/runner-legacy-options.js index eb53e353..ed93fbd4 100644 --- a/test/browser/runner-legacy-options.js +++ b/test/browser/runner-legacy-options.js @@ -3,4 +3,3 @@ var less = { errorReporting: "console", strictMath: false, strictUnits: false }; - diff --git a/test/browser/runner-no-js-errors-spec.js b/test/browser/runner-no-js-errors-spec.js index 6c0e0840..6ee7611b 100644 --- a/test/browser/runner-no-js-errors-spec.js +++ b/test/browser/runner-no-js-errors-spec.js @@ -1,4 +1,3 @@ describe("less.js javascript disabled error tests", function() { testLessErrorsInDocument(); }); - diff --git a/test/browser/runner-production-options.js b/test/browser/runner-production-options.js index 2737aba2..c93773f2 100644 --- a/test/browser/runner-production-options.js +++ b/test/browser/runner-production-options.js @@ -1,4 +1,3 @@ var less = {logLevel: 4, errorReporting: "console"}; less.env = "production"; - diff --git a/test/browser/runner-relative-urls-options.js b/test/browser/runner-relative-urls-options.js index 3dcbad19..e5ebfd2b 100644 --- a/test/browser/runner-relative-urls-options.js +++ b/test/browser/runner-relative-urls-options.js @@ -1,4 +1,3 @@ var less = {logLevel: 4, errorReporting: "console"}; less.relativeUrls = true; - diff --git a/test/browser/runner-rootpath-options.js b/test/browser/runner-rootpath-options.js index f1aa52c4..ca9e9a44 100644 --- a/test/browser/runner-rootpath-options.js +++ b/test/browser/runner-rootpath-options.js @@ -1,4 +1,3 @@ var less = {logLevel: 4, errorReporting: "console"}; less.rootpath = "https://localhost/"; - diff --git a/test/browser/runner-rootpath-relative-options.js b/test/browser/runner-rootpath-relative-options.js index df4d883c..641bab8f 100644 --- a/test/browser/runner-rootpath-relative-options.js +++ b/test/browser/runner-rootpath-relative-options.js @@ -2,4 +2,3 @@ var less = {logLevel: 4, errorReporting: "console"}; less.rootpath = "https://www.github.com/cloudhead/less.js/"; less.relativeUrls = true; - diff --git a/test/browser/runner-strict-units-options.js b/test/browser/runner-strict-units-options.js index e292310a..4353405f 100644 --- a/test/browser/runner-strict-units-options.js +++ b/test/browser/runner-strict-units-options.js @@ -3,4 +3,3 @@ var less = { errorReporting: "console", strictMath: true, strictUnits: true }; - diff --git a/test/less-test.js b/test/less-test.js index f37a89a0..1da18132 100644 --- a/test/less-test.js +++ b/test/less-test.js @@ -11,7 +11,7 @@ module.exports = function() { var globals = Object.keys(global); var oneTestOnly = process.argv[2], - isFinished = false; + isFinished = false; var isVerbose = process.env.npm_config_loglevel === 'verbose'; @@ -25,10 +25,10 @@ module.exports = function() { } }, warn: function(msg) { - process.stdout.write(msg + "\n"); + process.stdout.write(msg + "\n"); }, error: function(msg) { - process.stdout.write(msg + "\n"); + process.stdout.write(msg + "\n"); } }); @@ -36,21 +36,21 @@ module.exports = function() { queueRunning = false; function queue(func) { if (queueRunning) { - //console.log("adding to queue"); + //console.log("adding to queue"); queueList.push(func); } else { - //console.log("first in queue - starting"); + //console.log("first in queue - starting"); queueRunning = true; func(); } } function release() { if (queueList.length) { - //console.log("running next in queue"); + //console.log("running next in queue"); var func = queueList.shift(); - setTimeout(func, 0); + setTimeout(func, 0); } else { - //console.log("stopping queue"); + //console.log("stopping queue"); queueRunning = false; } } @@ -129,10 +129,10 @@ module.exports = function() { } function testSyncronous(options, filenameNoExtension) { - if (oneTestOnly && ("Test Sync " + filenameNoExtension) !== oneTestOnly) { - return; - } - totalTests++; + if (oneTestOnly && ("Test Sync " + filenameNoExtension) !== oneTestOnly) { + return; + } + totalTests++; queue(function() { var isSync = true; toCSS(options, path.join(normalFolder, filenameNoExtension + ".less"), function (err, result) { @@ -143,7 +143,7 @@ module.exports = function() { } else { fail("Not Sync"); } - release(); + release(); }); isSync = false; }); @@ -200,19 +200,19 @@ module.exports = function() { var doubleCallCheck = false; queue(function() { toCSS(options, path.join(baseFolder, foldername + file), function (err, result) { - if (doubleCallCheck) { - totalTests++; - fail("less is calling back twice"); - process.stdout.write(doubleCallCheck + "\n"); - process.stdout.write((new Error()).stack + "\n"); - return; - } - doubleCallCheck = (new Error()).stack; + if (doubleCallCheck) { + totalTests++; + fail("less is calling back twice"); + process.stdout.write(doubleCallCheck + "\n"); + process.stdout.write((new Error()).stack + "\n"); + return; + } + doubleCallCheck = (new Error()).stack; if (verifyFunction) { var verificationResult = verifyFunction(name, err, result && result.css, doReplacements, result && result.map, baseFolder); - release(); - return verificationResult; + release(); + return verificationResult; } if (err) { fail("ERROR: " + (err && err.message)); @@ -271,16 +271,16 @@ module.exports = function() { passedTests++; endTest(); } - - function finished() { - isFinished = true; - endTest(); - } + + function finished() { + isFinished = true; + endTest(); + } function endTest() { if (isFinished && ((failedTests + passedTests) >= totalTests)) { - var leaked = checkGlobalLeaks(); - + var leaked = checkGlobalLeaks(); + process.stdout.write("\n"); if (failedTests > 0) { process.stdout.write(failedTests + stylize(" Failed", "red") + ", " + passedTests + " passed\n"); @@ -307,8 +307,7 @@ module.exports = function() { return false; } - - function toCSS(options, path, callback) { + function toCSS(options, path, callback) { options = options || {}; var str = fs.readFileSync(path, 'utf8'), addPath = require('path').dirname(path); @@ -329,9 +328,9 @@ module.exports = function() { } function testNoOptions() { - if (oneTestOnly && "Integration" !== oneTestOnly) { - return; - } + if (oneTestOnly && "Integration" !== oneTestOnly) { + return; + } totalTests++; try { process.stdout.write("- Integration - creating parser without options: "); @@ -351,6 +350,6 @@ module.exports = function() { testSourcemap: testSourcemap, testNoOptions: testNoOptions, prepBomTest: prepBomTest, - finished: finished + finished: finished }; }; From d0830141ef0300f33be9be71badbda7799b54562 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Tue, 27 Jan 2015 00:18:46 +0000 Subject: [PATCH 23/29] v2.3.0 --- CHANGELOG.md | 18 +++ bower.json | 2 +- dist/less.js | 378 ++++++++++++++++++++++++++++++---------------- dist/less.min.js | 12 +- lib/less/index.js | 2 +- package.json | 2 +- 6 files changed, 272 insertions(+), 142 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0596a3a..efce211b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +# 2.3.0 + +2015-01-27 + + - add isruleset function + - add optional import option, causing less to not fail if file not found + - Fix browsers-side cache. + - Many fixes to import reference - support `@support` and keyframe + - Selectors now interpolate pseudo selectors (e.g. `:@{hover}`) + - Fix comments missed off if they were at the end of the file + - Fix !important used with parametric mixins + - Emits warnings for extends when the target is not found + - include-path now works on data-uri + - variables and function calls work for path in data-uri + - Fix absolute paths not working on imports sometimes. + - Unicode BOM removed again + - Misc. bug fixes + # 2.2.0 2015-01-04 diff --git a/bower.json b/bower.json index 382b30cc..a17d2951 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "2.2.0", + "version": "2.3.0", "main": "dist/less.js", "ignore": [ "**/.*", diff --git a/dist/less.js b/dist/less.js index 718869f2..a3ec0f82 100644 --- a/dist/less.js +++ b/dist/less.js @@ -1,5 +1,5 @@ /*! - * Less - Leaner CSS v2.2.0 + * Less - Leaner CSS v2.3.0 * http://lesscss.org * * Copyright (c) 2009-2015, Alexis Sellier @@ -52,9 +52,9 @@ module.exports = function(window, options) { options.useFileCache = true; } - if (options.onReady === undefined) { - options.onReady = true; - } + if (options.onReady === undefined) { + options.onReady = true; + } }; @@ -75,15 +75,15 @@ require("./add-default-options")(window, options); var less = module.exports = require("./index")(window, options); if (options.onReady) { - if (/!watch/.test(window.location.hash)) { - less.watch(); - } - - less.pageLoadFinished = less.registerStylesheets().then( - function () { - return less.refresh(less.env === 'development'); - } - ); + if (/!watch/.test(window.location.hash)) { + less.watch(); + } + + less.pageLoadFinished = less.registerStylesheets().then( + function () { + return less.refresh(less.env === 'development'); + } + ); } },{"./add-default-options":1,"./index":7,"promise/polyfill.js":undefined}],3:[function(require,module,exports){ var utils = require("./utils"); @@ -596,14 +596,14 @@ function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { if (webInfo) { webInfo.remaining = remaining; - if (!instanceOptions.modifyVars) { - var css = cache.getCSS(path, webInfo); - if (!reload && css) { - webInfo.local = true; - callback(null, null, data, sheet, webInfo, path); - return; - } - } + if (!instanceOptions.modifyVars) { + var css = cache.getCSS(path, webInfo); + if (!reload && css) { + webInfo.local = true; + callback(null, css, data, sheet, webInfo, path); + return; + } + } } //TODO add tests around how this behaves when reloading @@ -615,11 +615,11 @@ function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { e.href = path; callback(e); } else { - result.css = postProcessCSS(result.css); - if (!instanceOptions.modifyVars) { - cache.setCSS(sheet.href, webInfo.lastModified, result.css); - } - callback(null, result.css, data, sheet, webInfo, path); + result.css = postProcessCSS(result.css); + if (!instanceOptions.modifyVars) { + cache.setCSS(sheet.href, webInfo.lastModified, result.css); + } + callback(null, result.css, data, sheet, webInfo, path); } }); } @@ -716,7 +716,7 @@ less.refresh = function (reload, modifyVars, clearFileCache) { } else { less.logger.info("rendered " + sheet.href + " successfully."); } - browser.createCSS(window.document, css, sheet); + browser.createCSS(window.document, css, sheet); less.logger.info("css for " + sheet.href + " generated in " + (new Date() - endTime) + 'ms'); if (webInfo.remaining === 0) { totalMilliseconds = new Date() - startTime; @@ -854,6 +854,7 @@ contexts.Parse = function(options) { }; var evalCopyProperties = [ + 'paths', // additional include paths 'compress', // whether to compress 'ieCompat', // whether to enforce IE compatibility (IE8 data-uri) 'strictMath', // whether math has to be within parenthesis @@ -921,7 +922,6 @@ contexts.Eval.prototype.normalizePath = function( path ) { //todo - do the same for the toCSS ? - },{}],11:[function(require,module,exports){ module.exports = { 'aliceblue':'#f0f8ff', @@ -1613,7 +1613,7 @@ colorFunctions = { return new Color(c.value.slice(1)); } if ((c instanceof Color) || (c = Color.fromKeyword(c.value))) { - c.keyword = undefined; + c.value = undefined; return c; } throw { @@ -1649,8 +1649,9 @@ module.exports = function(environment) { var mimetype = mimetypeNode && mimetypeNode.value; var filePath = filePathNode.value; - var currentDirectory = filePathNode.currentFileInfo.relativeUrls ? - filePathNode.currentFileInfo.currentDirectory : filePathNode.currentFileInfo.entryPath; + var currentFileInfo = this.currentFileInfo; + var currentDirectory = currentFileInfo.relativeUrls ? + currentFileInfo.currentDirectory : currentFileInfo.entryPath; var fragmentStart = filePath.indexOf('#'); var fragment = ''; @@ -1672,7 +1673,7 @@ module.exports = function(environment) { mimetype = environment.mimeLookup(filePath); - if (mimetype === "image/svg+xml") { + if (mimetype === "image/svg+xml") { useBase64 = false; } else { // use base 64 unless it's an ASCII or UTF-8 format @@ -1687,29 +1688,29 @@ module.exports = function(environment) { var fileSync = fileManager.loadFileSync(filePath, currentDirectory, this.context, environment); if (!fileSync.contents) { - logger.warn("Skipped data-uri embedding because file not found"); + logger.warn("Skipped data-uri embedding of " + filePath + " because file not found"); return fallback(this, filePathNode || mimetypeNode); } var buf = fileSync.contents; - if (useBase64 && !environment.encodeBase64) { - return fallback(this, filePathNode); - } + if (useBase64 && !environment.encodeBase64) { + return fallback(this, filePathNode); + } buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf); var uri = "data:" + mimetype + ',' + buf + fragment; - // IE8 cannot handle a data-uri larger than 32,768 characters. If this is exceeded - // and the --ieCompat flag is enabled, return a normal url() instead. - var DATA_URI_MAX = 32768; - if (uri.length >= DATA_URI_MAX) { + // IE8 cannot handle a data-uri larger than 32,768 characters. If this is exceeded + // and the --ieCompat flag is enabled, return a normal url() instead. + var DATA_URI_MAX = 32768; + if (uri.length >= DATA_URI_MAX) { - if (this.context.ieCompat !== false) { - logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length + " characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!"); + if (this.context.ieCompat !== false) { + logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length + " characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!"); - return fallback(this, filePathNode || mimetypeNode); - } - } + return fallback(this, filePathNode || mimetypeNode); + } + } return new URL(new Quoted('"' + uri + '"', uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); }); @@ -1964,6 +1965,7 @@ functionRegistry.addMultiple({ module.exports = function(environment) { var Dimension = require("../tree/dimension"), Color = require("../tree/color"), + Expression = require("../tree/expression"), Quoted = require("../tree/quoted"), URL = require("../tree/url"), functionRegistry = require("./function-registry"); @@ -2013,7 +2015,7 @@ module.exports = function(environment) { '<' + gradientType + 'Gradient id="gradient" gradientUnits="userSpaceOnUse" ' + gradientDirectionSvg + '>'; for (i = 0; i < stops.length; i+= 1) { - if (stops[i].value) { + if (stops[i] instanceof Expression) { color = stops[i].value[0]; position = stops[i].value[1]; } else { @@ -2038,8 +2040,9 @@ module.exports = function(environment) { }); }; -},{"../tree/color":47,"../tree/dimension":53,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],27:[function(require,module,exports){ +},{"../tree/color":47,"../tree/dimension":53,"../tree/expression":56,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],27:[function(require,module,exports){ var Keyword = require("../tree/keyword"), + DetachedRuleset = require("../tree/detached-ruleset"), Dimension = require("../tree/dimension"), Color = require("../tree/color"), Quoted = require("../tree/quoted"), @@ -2062,6 +2065,9 @@ var isa = function (n, Type) { return (n instanceof Dimension) && n.unit.is(unit) ? Keyword.True : Keyword.False; }; functionRegistry.addMultiple({ + isruleset: function (n) { + return isa(n, DetachedRuleset); + }, iscolor: function (n) { return isa(n, Color); }, @@ -2118,7 +2124,7 @@ functionRegistry.addMultiple({ } }); -},{"../tree/anonymous":43,"../tree/color":47,"../tree/dimension":53,"../tree/keyword":62,"../tree/operation":68,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],28:[function(require,module,exports){ +},{"../tree/anonymous":43,"../tree/color":47,"../tree/detached-ruleset":52,"../tree/dimension":53,"../tree/keyword":62,"../tree/operation":68,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],28:[function(require,module,exports){ var contexts = require("./contexts"), Parser = require('./parser/parser'); @@ -2161,12 +2167,14 @@ module.exports = function(environment) { importManager.queue.splice(importManager.queue.indexOf(path), 1); // Remove the path from the queue var importedEqualsRoot = fullPath === importManager.rootFilename; - + if (importOptions.optional && e) { + callback(null, {rules:[]}, false, null); + } + else { importManager.files[fullPath] = root; - if (e && !importManager.error) { importManager.error = e; } - callback(e, root, importedEqualsRoot, fullPath); + } }; var newFileInfo = { @@ -2189,7 +2197,7 @@ module.exports = function(environment) { var loadFileCallback = function(loadedFile) { var resolvedFilename = loadedFile.filename, - contents = loadedFile.contents; + contents = loadedFile.contents.replace(/^\uFEFF/, ''); // Pass on an updated rootpath if path of imported file is relative and file // is in a (sub|sup) directory @@ -2246,7 +2254,7 @@ module.exports = function(environment, fileManagers) { var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment; var less = { - version: [2, 2, 0], + version: [2, 3, 0], data: require('./data'), tree: require('./tree'), Environment: (Environment = require("./environment/environment")), @@ -2355,7 +2363,7 @@ module.exports = { },{}],32:[function(require,module,exports){ var LessError = require('./less-error'), transformTree = require("./transform-tree"), - logger = require("./logger"); + logger = require("./logger"); module.exports = function(SourceMapBuilder) { var ParseTree = function(root, imports) { @@ -2372,11 +2380,11 @@ ParseTree.prototype.toCSS = function(options) { } try { - var compress = Boolean(options.compress); - if (compress) { - logger.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css."); - } - + var compress = Boolean(options.compress); + if (compress) { + logger.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css."); + } + var toCSSOptions = { compress: compress, dumpLineNumbers: options.dumpLineNumbers, @@ -2463,6 +2471,10 @@ module.exports = function(environment, ParseTree, ImportManager) { entryPath: entryPath, rootFilename: filename }; + // add in a missing trailing slash + if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== "/") { + rootFileInfo.rootpath += "/"; + } } var imports = new ImportManager(context, rootFileInfo); @@ -3085,13 +3097,17 @@ var Parser = function Parser(context, imports, fileInfo) { primary: function () { var mixin = this.mixin, root = [], node; - while (!parserInput.finished) + while (true) { while(true) { node = this.comment(); if (!node) { break; } root.push(node); } + // always process comments before deciding if finished + if (parserInput.finished) { + break; + } if (parserInput.peek('}')) { break; } @@ -3712,7 +3728,7 @@ var Parser = function Parser(context, imports, fileInfo) { c = this.combinator(); e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || - parserInput.$char('*') || parserInput.$char('&') || this.attribute() || parserInput.$re(/^\([^()@]+\)/) || parserInput.$re(/^[\.#](?=@)/) || + parserInput.$char('*') || parserInput.$char('&') || this.attribute() || parserInput.$re(/^\([^()@]+\)/) || parserInput.$re(/^[\.#:](?=@)/) || this.entities.variableCurly(); if (! e) { @@ -4023,7 +4039,7 @@ var Parser = function Parser(context, imports, fileInfo) { }, importOption: function() { - var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference)/); + var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/); if (opt) { return opt[1]; } @@ -4237,19 +4253,19 @@ var Parser = function Parser(context, imports, fileInfo) { sub: function () { var a, e; - parserInput.save(); + parserInput.save(); if (parserInput.$char('(')) { a = this.addition(); if (a && parserInput.$char(')')) { - parserInput.forget(); - e = new(tree.Expression)([a]); - e.parens = true; + parserInput.forget(); + e = new(tree.Expression)([a]); + e.parens = true; return e; } - parserInput.restore("Expected ')'"); - return; + parserInput.restore("Expected ')'"); + return; } - parserInput.restore(); + parserInput.restore(); }, multiplication: function () { var m, a, op, operation, isSpaced; @@ -4963,7 +4979,6 @@ Assignment.prototype.genCSS = function (context, output) { }; module.exports = Assignment; - },{"./node":67}],45:[function(require,module,exports){ var Node = require("./node"); @@ -5116,11 +5131,11 @@ Color.prototype.genCSS = function (context, output) { Color.prototype.toCSS = function (context, doNotCompress) { var compress = context && context.compress && !doNotCompress, color, alpha; - // `keyword` is set if this color was originally + // `value` is set if this color was originally // converted from a named color string so we need // to respect this and try to output named color too. - if (this.keyword) { - return this.keyword; + if (this.value) { + return this.value; } // If we have some transparency, the only way to represent it @@ -5239,7 +5254,7 @@ Color.fromKeyword = function(keyword) { } if (c) { - c.keyword = keyword; + c.value = keyword; return c; } }; @@ -5555,7 +5570,7 @@ module.exports = Dimension; var Node = require("./node"), Ruleset = require("./ruleset"); -var Directive = function (name, value, rules, index, currentFileInfo, debugInfo) { +var Directive = function (name, value, rules, index, currentFileInfo, debugInfo, isReferenced) { this.name = name; this.value = value; if (rules) { @@ -5565,6 +5580,7 @@ var Directive = function (name, value, rules, index, currentFileInfo, debugInfo) this.index = index; this.currentFileInfo = currentFileInfo; this.debugInfo = debugInfo; + this.isReferenced = isReferenced; }; Directive.prototype = new Node(); @@ -5592,7 +5608,10 @@ Directive.prototype.genCSS = function (context, output) { value.genCSS(context, output); } if (rules) { - this.outputRuleset(context, output, [rules]); + if (rules.type === "Ruleset") { + rules = [rules]; + } + this.outputRuleset(context, output, rules); } else { output.add(';'); } @@ -5607,7 +5626,7 @@ Directive.prototype.eval = function (context) { rules.root = true; } return new Directive(this.name, value, rules, - this.index, this.currentFileInfo, this.debugInfo); + this.index, this.currentFileInfo, this.debugInfo, this.isReferenced); }; Directive.prototype.variable = function (name) { if (this.rules) return Ruleset.prototype.variable.call(this.rules, name); }; Directive.prototype.find = function () { if (this.rules) return Ruleset.prototype.find.apply(this.rules, arguments); }; @@ -5624,6 +5643,9 @@ Directive.prototype.markReferenced = function () { } } }; +Directive.prototype.getIsReferenced = function () { + return !this.currentFileInfo || !this.currentFileInfo.reference || this.isReferenced; +}; Directive.prototype.outputRuleset = function (context, output, rules) { var ruleCnt = rules.length, i; context.tabLevel = (context.tabLevel | 0) + 1; @@ -5720,7 +5742,7 @@ var Node = require("./node"), var Expression = function (value) { this.value = value; if (!value) { - throw new Error("Expression requires a array parameter"); + throw new Error("Expression requires an array parameter"); } }; Expression.prototype = new Node(); @@ -5968,6 +5990,7 @@ module.exports = Import; },{"./anonymous":43,"./media":63,"./node":67,"./quoted":70,"./ruleset":73,"./url":77}],59:[function(require,module,exports){ var tree = {}; +tree.Node = require('./node'); tree.Alpha = require('./alpha'); tree.Color = require('./color'); tree.Directive = require('./directive'); @@ -6007,7 +6030,7 @@ tree.RulesetCall = require('./ruleset-call'); module.exports = tree; -},{"./alpha":42,"./anonymous":43,"./assignment":44,"./attribute":45,"./call":46,"./color":47,"./combinator":48,"./comment":49,"./condition":50,"./detached-ruleset":52,"./dimension":53,"./directive":54,"./element":55,"./expression":56,"./extend":57,"./import":58,"./javascript":60,"./keyword":62,"./media":63,"./mixin-call":64,"./mixin-definition":65,"./negative":66,"./operation":68,"./paren":69,"./quoted":70,"./rule":71,"./ruleset":73,"./ruleset-call":72,"./selector":74,"./unicode-descriptor":75,"./unit":76,"./url":77,"./value":78,"./variable":79}],60:[function(require,module,exports){ +},{"./alpha":42,"./anonymous":43,"./assignment":44,"./attribute":45,"./call":46,"./color":47,"./combinator":48,"./comment":49,"./condition":50,"./detached-ruleset":52,"./dimension":53,"./directive":54,"./element":55,"./expression":56,"./extend":57,"./import":58,"./javascript":60,"./keyword":62,"./media":63,"./mixin-call":64,"./mixin-definition":65,"./negative":66,"./node":67,"./operation":68,"./paren":69,"./quoted":70,"./rule":71,"./ruleset":73,"./ruleset-call":72,"./selector":74,"./unicode-descriptor":75,"./unit":76,"./url":77,"./value":78,"./variable":79}],60:[function(require,module,exports){ var JsEvalNode = require("./js-eval-node"), Dimension = require("./dimension"), Quoted = require("./quoted"), @@ -7137,15 +7160,15 @@ Ruleset.prototype.evalImports = function(context) { } }; Ruleset.prototype.makeImportant = function() { - return new Ruleset(this.selectors, this.rules.map(function (r) { - if (r.makeImportant) { - return r.makeImportant(); - } else { - return r; - } - }), this.strictImports); -}; -Ruleset.prototype.matchArgs = function (args) { + this.rules = this.rules.map(function (r) { + if (r.makeImportant) { + return r.makeImportant(); + } else { + return r; + } + }); + return this; +};Ruleset.prototype.matchArgs = function (args) { return !args || args.length === 0; }; // lets you call a css selector with a guard @@ -7175,7 +7198,7 @@ Ruleset.prototype.variables = function () { } // when evaluating variables in an import statement, imports have not been eval'd // so we need to go inside import statements. - // guard against root being a string (in the case of inlined less) + // guard against root being a string (in the case of inlined less) if (r.type === "Import" && r.root && r.root.variables) { var vars = r.root.variables(); for(var name in vars) { @@ -7369,18 +7392,49 @@ Ruleset.prototype.genCSS = function (context, output) { } }; Ruleset.prototype.markReferenced = function () { - if (!this.selectors) { - return; + var s; + if (this.selectors) { + for (s = 0; s < this.selectors.length; s++) { + this.selectors[s].markReferenced(); + } } - for (var s = 0; s < this.selectors.length; s++) { - this.selectors[s].markReferenced(); + + if (this.rules) { + for (s = 0; s < this.rules.length; s++) { + if (this.rules[s].markReferenced) + this.rules[s].markReferenced(); + } } }; +Ruleset.prototype.getIsReferenced = function() { + var i, j, path, selector; + + if (this.paths) { + for (i=0; i 0) { - var importItem = this.imports[0]; - if (!importItem.isReady) { - return; - } - this.imports = this.imports.slice(1); - importItem.callback.apply(null, importItem.args); - } - if (this.variableImports.length === 0) { - break; - } - var variableImport = this.variableImports[0]; - this.variableImports = this.variableImports.slice(1); - variableImport(); - } - } finally { - this._currentDepth--; - } + this._currentDepth++; + try { + while(true) { + while(this.imports.length > 0) { + var importItem = this.imports[0]; + if (!importItem.isReady) { + return; + } + this.imports = this.imports.slice(1); + importItem.callback.apply(null, importItem.args); + } + if (this.variableImports.length === 0) { + break; + } + var variableImport = this.variableImports[0]; + this.variableImports = this.variableImports.slice(1); + variableImport(); + } + } finally { + this._currentDepth--; + } if (this._currentDepth === 0 && this._onSequencerEmpty) { this._onSequencerEmpty(); } @@ -8473,12 +8554,12 @@ ImportVisitor.prototype = { this.isFinished = true; this._sequencer.tryRun(); }, - _onSequencerEmpty: function() { - if (!this.isFinished) { - return; - } - this._finish(this.error); - }, + _onSequencerEmpty: function() { + if (!this.isFinished) { + return; + } + this._finish(this.error); + }, visitImport: function (importNode, visitArgs) { var inlineCSS = importNode.options.inline; @@ -8532,9 +8613,9 @@ ImportVisitor.prototype = { this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.currentFileInfo, evaldImportNode.options, sequencedOnImported); } else { this.importCount--; - if (this.isFinished) { - this._sequencer.tryRun(); - } + if (this.isFinished) { + this._sequencer.tryRun(); + } } }, onImported: function (importNode, context, e, root, importedAtRoot, fullPath) { @@ -8584,7 +8665,7 @@ ImportVisitor.prototype = { importVisitor.importCount--; if (importVisitor.isFinished) { - importVisitor._sequencer.tryRun(); + importVisitor._sequencer.tryRun(); } }, visitRule: function (ruleNode, visitArgs) { @@ -8724,10 +8805,10 @@ ToCSSVisitor.prototype = { }, visitDirective: function(directiveNode, visitArgs) { - if (directiveNode.currentFileInfo.reference && !directiveNode.isReferenced) { - return; - } if (directiveNode.name === "@charset") { + if (!directiveNode.getIsReferenced()) { + return; + } // Only output the debug info together with subsequent @charset definitions // a comment (or @media statement) before the actual @charset directive would // be considered illegal css as it has to be on the first line @@ -8743,6 +8824,37 @@ ToCSSVisitor.prototype = { } if (directiveNode.rules && directiveNode.rules.rules) { this._mergeRules(directiveNode.rules.rules); + //process childs + directiveNode.accept(this._visitor); + visitArgs.visitDeeper = false; + + // the directive was directly referenced and therefore needs to be shown in the output + if (directiveNode.getIsReferenced()) { + return directiveNode; + } + + if (!directiveNode.rules.rules) { + return ; + } + + //the directive was not directly referenced + for (var r = 0; r @@ -10,8 +10,8 @@ /** * @license Apache v2 */ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(a,b){c(b,d.currentScript(a)),void 0===b.isFileProtocol&&(b.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(a.location.protocol)),b.async=b.async||!1,b.fileAsync=b.fileAsync||!1,b.poll=b.poll||(b.isFileProtocol?1e3:1500),b.env=b.env||("127.0.0.1"==a.location.hostname||"0.0.0.0"==a.location.hostname||"localhost"==a.location.hostname||a.location.port&&a.location.port.length>0||b.isFileProtocol?"development":"production");var e=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);e&&(b.dumpLineNumbers=e[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":9}],2:[function(a,b){a("promise/polyfill.js");var c=window.less||{};a("./add-default-options")(window,c);var d=b.exports=a("./index")(window,c);c.onReady&&(/!watch/.test(window.location.hash)&&d.watch(),d.pageLoadFinished=d.registerStylesheets().then(function(){return d.refresh("development"===d.env)}))},{"./add-default-options":1,"./index":7,"promise/polyfill.js":void 0}],3:[function(a,b){var c=a("./utils");b.exports={createCSS:function(a,b,d){var e=d.href||"",f="less:"+(d.title||c.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),d.media&&i.setAttribute("media",d.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=d&&d.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":9}],4:[function(a,b){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,e),d.setItem(a+":timestamp",b)}catch(f){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b){var c=d&&d.getItem(a),e=d&&d.getItem(a+":timestamp");return e&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(e).valueOf()?c:void 0}}}},{}],5:[function(a,b){var c=a("./utils"),d=a("./browser");b.exports=function(a,b,e){function f(b,f){var g,h,i="less-error-message:"+c.extractId(f||""),j='
  • {content}
  • ',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="

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

    in '+n+" ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.extract&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":

      "+l.join("")+"
    "),b.stack&&(b.extract||e.logLevel>=4)&&(h+="
    Stack Trace
    "+b.stack.split("\n").slice(1).join("
    ")),k.innerHTML=h,d.createCSS(a.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"}),k.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"===e.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(a,b){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?k(a,b):"function"==typeof e.errorReporting&&e.errorReporting("add",a,b):f(a,b)}function h(b){var d=a.document.getElementById("less-error-message:"+c.extractId(b));d&&d.parentNode.removeChild(d)}function i(){}function j(a){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?i(a):"function"==typeof e.errorReporting&&e.errorReporting("remove",a):h(a)}function k(a,c){var d="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,b,c){void 0!==a.extract[b]&&g.push(d.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.extract&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||e.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}return{add:g,remove:j}}},{"./browser":3,"./utils":9}],6:[function(a,b){b.exports=function(b,c){function d(){if(window.XMLHttpRequest&&!("file:"===window.location.protocol&&"ActiveXObject"in window))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return c.error("browser doesn't support AJAX."),null}}var e=a("../less/environment/abstract-file-manager.js"),f={},g=function(){};return g.prototype=new e,g.prototype.alwaysMakePathsAbsolute=function(){return!0},g.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},g.prototype.doXHR=function(a,e,f,g){function h(b,c,d){b.status>=200&&300>b.status?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var i=d(),j=b.isFileProtocol?b.fileAsync:b.async;"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),i.open("GET",a,j),i.setRequestHeader("Accept",e||"text/x-less, text/css; q=0.9, */*; q=0.5"),i.send(null),b.isFileProtocol&&!b.fileAsync?0===i.status||i.status>=200&&300>i.status?f(i.responseText):g(i.status,a):j?i.onreadystatechange=function(){4==i.readyState&&h(i,f,g)}:h(i,f,g)},g.prototype.supports=function(){return!0},g.prototype.clearFileCache=function(){f={}},g.prototype.loadFile=function(a,b,c,d,e){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&f[h])try{var i=f[h];e(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){e({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){f[h]=a,e(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){e({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},g}},{"../less/environment/abstract-file-manager.js":14}],7:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(e,f){function g(a){return f.postProcessor&&"function"==typeof f.postProcessor&&(a=f.postProcessor.call(a,a)||a),a}function h(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function i(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function j(a){for(var b,c=n.getElementsByTagName("style"),d=0;c.length>d;d++)if(b=c[d],b.type.match(u)){var e=h(f);e.modifyVars=a;var g=b.innerHTML||"";e.filename=n.location.href.replace(/#.*$/,""),o.render(g,e,i(function(a,b,c){b?s.add(b,"inline"):(a.type="text/css",a.styleSheet?a.styleSheet.cssText=c.css:a.innerHTML=c.css)},null,b))}}function k(a,b,d,e,i){function j(c){var f=c.contents,h=c.filename,i=c.webInfo,j={currentDirectory:r.getPath(h),filename:h,rootFilename:h,relativeUrls:k.relativeUrls};if(j.entryPath=j.currentDirectory,j.rootpath=k.rootpath||j.currentDirectory,i&&(i.remaining=e,!k.modifyVars)){var l=t.getCSS(h,i);if(!d&&l)return i.local=!0,void b(null,null,f,a,i,h)}s.remove(h),k.rootFileInfo=j,o.render(f,k,function(c,d){c?(c.href=h,b(c)):(d.css=g(d.css),k.modifyVars||t.setCSS(a.href,i.lastModified,d.css),b(null,d.css,f,a,i,h))})}var k=h(f);c(k,a),k.mime=a.type,i&&(k.modifyVars=i),r.loadFile(a.href,null,k,p,function(a,c){return a?void b(a):void j(c)})}function l(a,b,c){for(var d=0;o.sheets.length>d;d++)k(o.sheets[d],a,b,o.sheets.length-(d+1),c)}function m(){"development"===o.env&&(o.watchTimer=setInterval(function(){o.watchMode&&(r.clearFileCache(),l(function(a,b,c,f){a?s.add(a,a.href||f.href):b&&d.createCSS(e.document,b,f)}))},f.poll))}var n=e.document,o=a("../less")();b.exports=o,o.options=f;var p=o.environment,q=a("./file-manager")(f,o.logger),r=new q;p.addFileManager(r),o.FileManager=q,a("./log-listener")(o,f);var s=a("./error-reporting")(e,o,f),t=o.cache=f.cache||a("./cache")(e,f,o.logger);f.functions&&o.functions.functionRegistry.addMultiple(f.functions);var u=/^text\/(x-)?less$/;return o.watch=function(){return o.watchMode||(o.env="development",m()),this.watchMode=!0,!0},o.unwatch=function(){return clearInterval(o.watchTimer),this.watchMode=!1,!1},o.registerStylesheets=function(){return new Promise(function(a){var b=n.getElementsByTagName("link");o.sheets=[];for(var c=0;b.length>c;c++)("stylesheet/less"===b[c].rel||b[c].rel.match(/stylesheet/)&&b[c].type.match(u))&&o.sheets.push(b[c]);a()})},o.modifyVars=function(a){return o.refresh(!0,a,!1)},o.refresh=function(a,b,c){return(a||c)&&c!==!1&&r.clearFileCache(),new Promise(function(c,f){var g,h,i;g=h=new Date,l(function(a,b,j,k,l){return a?(s.add(a,a.href||k.href),void f(a)):(o.logger.info(l.local?"loading "+k.href+" from cache.":"rendered "+k.href+" successfully."),d.createCSS(e.document,b,k),o.logger.info("css for "+k.href+" generated in "+(new Date-h)+"ms"),0===l.remaining&&(i=new Date-g,o.logger.info("less has finished. css generated in "+i+"ms"),c({startTime:g,endTime:h,totalMilliseconds:i,sheets:o.sheets.length})),void(h=new Date))},a,b),j(b)})},o.refreshStyles=j,o}},{"../less":29,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./log-listener":8,"./utils":9}],8:[function(a,b){b.exports=function(a,b){var c=4,d=3,e=2,f=1;b.logLevel="undefined"!=typeof b.logLevel?b.logLevel:"development"===b.env?d:f,b.loggers||(b.loggers=[{debug:function(a){b.logLevel>=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;b.loggers.length>g;g++)a.logger.addListener(b.loggers[g])}},{}],9:[function(a,b){b.exports={extractId:function(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/[\?\&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")},addDataAttr:function(a,b){for(var c in b.dataset)if(b.dataset.hasOwnProperty(c))if("env"===c||"dumpLineNumbers"===c||"rootpath"===c||"errorReporting"===c)a[c]=b.dataset[c];else try{a[c]=JSON.parse(b.dataset[c])}catch(d){}}}},{}],10:[function(a,b){var c={};b.exports=c;var d=function(a,b,c){if(a)for(var d=0;c.length>d;d++)a.hasOwnProperty(c[d])&&(b[c[d]]=a[c[d]])},e=["paths","relativeUrls","rootpath","strictImports","insecure","dumpLineNumbers","compress","syncImport","chunkInput","mime","useFileCache","processImports","reference","pluginManager"];c.Parse=function(a){d(a,this,e),"string"==typeof this.paths&&(this.paths=[this.paths])};var f=["compress","ieCompat","strictMath","strictUnits","sourceMap","importMultiple","urlArgs","javascriptEnabled","pluginManager","importantScope"];c.Eval=function(a,b){d(a,this,f),this.frames=b||[],this.importantScope=this.importantScope||[]},c.Eval.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},c.Eval.prototype.outOfParenthesis=function(){this.parensStack.pop()},c.Eval.prototype.isMathOn=function(){return this.strictMath?this.parensStack&&this.parensStack.length:!0},c.Eval.prototype.isPathRelative=function(a){return!/^(?:[a-z-]+:|\/)/i.test(a)},c.Eval.prototype.normalizePath=function(a){var b,c=a.split("/").reverse();for(a=[];0!==c.length;)switch(b=c.pop()){case".":break;case"..":0===a.length||".."===a[a.length-1]?a.push(b):a.pop();break;default:a.push(b)}return a.join("/")}},{}],11:[function(a,b){b.exports={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},{}],12:[function(a,b){b.exports={colors:a("./colors"),unitConversions:a("./unit-conversions")}},{"./colors":11,"./unit-conversions":13}],13:[function(a,b){b.exports={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}}},{}],14:[function(a,b){var c=function(){};c.prototype.getPath=function(a){var b=a.lastIndexOf("?");return b>0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),0>b&&(b=a.lastIndexOf("\\")),0>b?"":a.slice(0,b+1)},c.prototype.tryAppendLessExtension=function(a){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+".less"},c.prototype.supportsSync=function(){return!1},c.prototype.alwaysMakePathsAbsolute=function(){return!1},c.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\)/i.test(a)},c.prototype.join=function(a,b){return a?a+b:b},c.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;f.length-1>c;c++)i+="../";for(c=0;e.length-1>c;c++)i+=e[c]+"/";return i},c.prototype.extractUrlParts=function(a,b){var c,d,e=/^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i,f=a.match(e),g={},h=[];if(!f)throw new Error("Could not parse sheet href - '"+a+"'");if(b&&(!f[1]||f[2])){if(d=b.match(e),!d)throw new Error("Could not parse page url - '"+b+"'");f[1]=f[1]||d[1]||"",f[2]||(f[3]=d[3]+f[3])}if(f[3]){for(h=f[3].replace(/\\/g,"/").split("/"),c=0;h.length>c;c++)"."===h[c]&&(h.splice(c,1),c-=1);for(c=0;h.length>c;c++)".."===h[c]&&c>0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=c},{}],15:[function(a,b){var c=a("../logger"),d=function(a,b){this.fileManagers=b||[],a=a||{};for(var c=["encodeBase64","mimeLookup","charsetLookup","getSourceMapGenerator"],d=[],e=d.concat(c),f=0;e.length>f;f++){var g=e[f],h=a[g];h?this[g]=h.bind(a):d.length>f&&this.warn("missing required function in environment - "+g)}};d.prototype.getFileManager=function(a,b,d,e,f){a||c.warn("getFileManager called with no filename.. Please report this issue. continuing."),null==b&&c.warn("getFileManager called with null directory.. Please report this issue. continuing.");var g=this.fileManagers;d.pluginManager&&(g=[].concat(g).concat(d.pluginManager.getFileManagers()));for(var h=g.length-1;h>=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,d,e))return i}return null},d.prototype.addFileManager=function(a){this.fileManagers.push(a)},d.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=d},{"../logger":31}],16:[function(a){function b(a,b,d){var e,f,g,h,i=b.alpha,j=d.alpha,k=[];g=j+i*(1-j);for(var l=0;3>l;l++)e=b.rgb[l]/255,f=d.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new c(k,g)}var c=a("../tree/color"),d=a("./function-registry"),e={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?e.multiply(a,b):e.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return e.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var f in e)e.hasOwnProperty(f)&&(b[f]=b.bind(null,e[f]));d.addMultiple(b)},{"../tree/color":47,"./function-registry":21}],17:[function(a){function b(a){return Math.min(1,Math.max(0,a))}function c(a){return f.hsla(a.h,a.s,a.l,a.a)}function d(a){if(a instanceof g)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function e(a,b){return a instanceof g&&a.unit.is("%")?parseFloat(a.value*b/100):d(a)}var f,g=a("../tree/dimension"),h=a("../tree/color"),i=a("../tree/quoted"),j=a("../tree/anonymous"),k=a("./function-registry");f={rgb:function(a,b,c){return f.rgba(a,b,c,1)},rgba:function(a,b,c,f){var g=[a,b,c].map(function(a){return e(a,255)});return f=d(f),new h(g,f)},hsl:function(a,b,c){return f.hsla(a,b,c,1)},hsla:function(a,c,e,g){function h(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?j+(i-j)*a*6:1>2*a?i:2>3*a?j+(i-j)*(2/3-a)*6:j}a=d(a)%360/360,c=b(d(c)),e=b(d(e)),g=b(d(g));var i=.5>=e?e*(c+1):e+c-e*c,j=2*e-i;return f.rgba(255*h(a+1/3),255*h(a),255*h(a-1/3),g)},hsv:function(a,b,c){return f.hsva(a,b,c,1)},hsva:function(a,b,c,e){a=d(a)%360/360*360,b=d(b),c=d(c),e=d(e);var g,h;g=Math.floor(a/60%6),h=a/60-g;var i=[c,c*(1-b),c*(1-h*b),c*(1-(1-h)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return f.rgba(255*i[j[g][0]],255*i[j[g][1]],255*i[j[g][2]],e)},hue:function(a){return new g(a.toHSL().h)},saturation:function(a){return new g(100*a.toHSL().s,"%")},lightness:function(a){return new g(100*a.toHSL().l,"%")},hsvhue:function(a){return new g(a.toHSV().h)},hsvsaturation:function(a){return new g(100*a.toHSV().s,"%")},hsvvalue:function(a){return new g(100*a.toHSV().v,"%")},red:function(a){return new g(a.rgb[0])},green:function(a){return new g(a.rgb[1])},blue:function(a){return new g(a.rgb[2])},alpha:function(a){return new g(a.toHSL().a)},luma:function(a){return new g(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new g(b*a.alpha*100,"%")},saturate:function(a,d){if(!a.rgb)return null;var e=a.toHSL();return e.s+=d.value/100,e.s=b(e.s),c(e)},desaturate:function(a,d){var e=a.toHSL();return e.s-=d.value/100,e.s=b(e.s),c(e)},lighten:function(a,d){var e=a.toHSL();return e.l+=d.value/100,e.l=b(e.l),c(e)},darken:function(a,d){var e=a.toHSL();return e.l-=d.value/100,e.l=b(e.l),c(e)},fadein:function(a,d){var e=a.toHSL();return e.a+=d.value/100,e.a=b(e.a),c(e)},fadeout:function(a,d){var e=a.toHSL();return e.a-=d.value/100,e.a=b(e.a),c(e)},fade:function(a,d){var e=a.toHSL();return e.a=d.value/100,e.a=b(e.a),c(e)},spin:function(a,b){var d=a.toHSL(),e=(d.h+b.value)%360;return d.h=0>e?360+e:e,c(d)},mix:function(a,b,c){c||(c=new g(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,i=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,j=1-i,k=[a.rgb[0]*i+b.rgb[0]*j,a.rgb[1]*i+b.rgb[1]*j,a.rgb[2]*i+b.rgb[2]*j],l=a.alpha*d+b.alpha*(1-d);return new h(k,l)},greyscale:function(a){return f.desaturate(a,new g(100))},contrast:function(a,b,c,e){if(!a.rgb)return null;if("undefined"==typeof c&&(c=f.rgba(255,255,255,1)),"undefined"==typeof b&&(b=f.rgba(0,0,0,1)),b.luma()>c.luma()){var g=c;c=b,b=g}return e="undefined"==typeof e?.43:d(e),a.luma()=s&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+r.length+" characters) exceeds IE8-safe "+s+" characters!"),f(this,e||a)):new d(new c('"'+r+'"',r,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":31,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],19:[function(a,b){var c=a("../tree/keyword"),d=a("./function-registry"),e={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?c.True:c.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};d.add("default",e.eval.bind(e)),b.exports=e},{"../tree/keyword":62,"./function-registry":21}],20:[function(a,b){var c=a("./function-registry"),d=function(a,b,d,e){this.name=a.toLowerCase(),this.func=c.get(this.name),this.index=d,this.context=b,this.currentFileInfo=e};d.prototype.isValid=function(){return Boolean(this.func)},d.prototype.call=function(a){return this.func.apply(this,a)},b.exports=d},{"./function-registry":21}],21:[function(a,b){b.exports={_data:{},add:function(a,b){this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(a){return this._data[a]}}},{}],22:[function(a,b){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":17,"./color-blending":16,"./data-uri":18,"./default":19,"./function-caller":20,"./function-registry":21,"./math":23,"./number":24,"./string":25,"./svg":26,"./types":27}],23:[function(a){function b(a,b,d){if(!(d instanceof c))throw{type:"Argument",message:"argument must be a number"};return null==b?b=d.unit:d=d.unify(),new c(a(parseFloat(d.value)),b)}var c=a("../tree/dimension"),d=a("./function-registry"),e={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var f in e)e.hasOwnProperty(f)&&(e[f]=b.bind(null,Math[f],e[f]));e.round=function(a,c){var d="undefined"==typeof c?0:c.value;return b(function(a){return a.toFixed(d)},null,a)},d.addMultiple(e)},{"../tree/dimension":53,"./function-registry":21}],24:[function(a){var b=a("../tree/dimension"),c=a("../tree/anonymous"),d=a("./function-registry"),e=function(a,d){switch(d=Array.prototype.slice.call(d),d.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var e,f,g,h,i,j,k,l,m=[],n={};for(e=0;d.length>e;e++)if(g=d[e],g instanceof b)if(h=""===g.unit.toString()&&void 0!==l?new b(g.value,l).unify():g.unify(),j=""===h.unit.toString()&&void 0!==k?k:h.unit.toString(),k=""!==j&&void 0===k||""!==j&&""===m[0].unify().unit.toString()?j:k,l=""!==j&&void 0===l?g.unit.toString():l,f=void 0!==n[""]&&""!==j&&j===k?n[""]:n[j],void 0!==f)i=""===m[f].unit.toString()&&void 0!==l?new b(m[f].value,l).unify():m[f].unify(),(a&&i.value>h.value||!a&&h.value>i.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(d[e].value)&&Array.prototype.push.apply(d,Array.prototype.slice.call(d[e].value));return 1==m.length?m[0]:(d=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new c((a?"min":"max")+"("+d+")"))};d.addMultiple({min:function(){return e(!0,arguments)},max:function(){return e(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new b(Math.PI)},mod:function(a,c){return new b(a.value%c.value,a.unit)},pow:function(a,c){if("number"==typeof a&&"number"==typeof c)a=new b(a),c=new b(c);else if(!(a instanceof b&&c instanceof b))throw{type:"Argument",message:"arguments must be numbers"};return new b(Math.pow(a.value,c.value),a.unit)},percentage:function(a){return new b(100*a.value,"%")}})},{"../tree/anonymous":43,"../tree/dimension":53,"./function-registry":21}],25:[function(a){var b=a("../tree/quoted"),c=a("../tree/anonymous"),d=a("../tree/javascript"),e=a("./function-registry");e.addMultiple({e:function(a){return new c(a instanceof d?a.evaluated:a.value)},escape:function(a){return new c(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,c,d,e){var f=a.value;return f=f.replace(new RegExp(c.value,e?e.value:""),d.value),new b(a.quote||"",f,a.escaped)},"%":function(a){for(var c=Array.prototype.slice.call(arguments,1),d=a.value,e=0;c.length>e;e++)d=d.replace(/%[sda]/i,function(a){var b=a.match(/s/i)?c[e].value:c[e].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(b):b});return d=d.replace(/%%/g,"%"),new b(a.quote||"",d,a.escaped)}})},{"../tree/anonymous":43,"../tree/javascript":60,"../tree/quoted":70,"./function-registry":21}],26:[function(a,b){b.exports=function(){var b=a("../tree/dimension"),c=a("../tree/color"),d=a("../tree/quoted"),e=a("../tree/url"),f=a("./function-registry");f.add("svg-gradient",function(a){function f(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]"}}3>arguments.length&&f();var g,h,i,j,k,l,m,n=Array.prototype.slice.call(arguments,1),o="linear",p='x="0" y="0" width="1" height="1"',q={compress:!1},r=a.toCSS(q);switch(r){case"to bottom":g='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":g='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":g='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":g='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":o="radial",g='cx="50%" cy="50%" r="75%"',p='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(h='<'+o+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+g+">",i=0;n.length>i;i+=1)n[i].value?(j=n[i].value[0],k=n[i].value[1]):(j=n[i],k=void 0),j instanceof c&&((0===i||i+1===n.length)&&void 0===k||k instanceof b)||f(),l=k?k.toCSS(q):0===i?"0%":"100%",m=j.alpha,h+='m?' stop-opacity="'+m+'"':"")+"/>";return h+="',h=encodeURIComponent(h),h="data:image/svg+xml,"+h,new e(new d("'"+h+"'",h,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":47,"../tree/dimension":53,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],27:[function(a){var b=a("../tree/keyword"),c=a("../tree/dimension"),d=a("../tree/color"),e=a("../tree/quoted"),f=a("../tree/anonymous"),g=a("../tree/url"),h=a("../tree/operation"),i=a("./function-registry"),j=function(a,c){return a instanceof c?b.True:b.False},k=function(a,d){if(void 0===d)throw{type:"Argument",message:"missing the required second argument to isunit."};if(d="string"==typeof d.value?d.value:d,"string"!=typeof d)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."}; -return a instanceof c&&a.unit.is(d)?b.True:b.False};i.addMultiple({iscolor:function(a){return j(a,d)},isnumber:function(a){return j(a,c)},isstring:function(a){return j(a,e)},iskeyword:function(a){return j(a,b)},isurl:function(a){return j(a,g)},ispixel:function(a){return k(a,"px")},ispercentage:function(a){return k(a,"%")},isem:function(a){return k(a,"em")},isunit:k,unit:function(a,d){if(!(a instanceof c))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof h?". Have you forgotten parenthesis?":"")};return d=d?d instanceof b?d.value:d.toCSS():"",new c(a.value,d)},"get-unit":function(a){return new f(a.unit)},extract:function(a,b){return b=b.value-1,Array.isArray(a.value)?a.value[b]:Array(a)[b]},length:function(a){var b=Array.isArray(a.value)?a.value.length:1;return new c(b)}})},{"../tree/anonymous":43,"../tree/color":47,"../tree/dimension":53,"../tree/keyword":62,"../tree/operation":68,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],28:[function(a,b){var c=a("./contexts"),d=a("./parser/parser");b.exports=function(a){var b=function(a,b){this.rootFilename=b.filename,this.paths=a.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=a.mime,this.error=null,this.context=a,this.queue=[],this.files={}};return b.prototype.push=function(b,e,f,g,h){var i=this;this.queue.push(b);var j=function(a,c,d){i.queue.splice(i.queue.indexOf(b),1);var e=d===i.rootFilename;i.files[d]=c,a&&!i.error&&(i.error=a),h(a,c,e,d)},k={relativeUrls:this.context.relativeUrls,entryPath:f.entryPath,rootpath:f.rootpath,rootFilename:f.rootFilename},l=a.getFileManager(b,f.currentDirectory,this.context,a);if(!l)return void j({message:"Could not find a file-manager for "+b});e&&(b=l.tryAppendLessExtension(b));var m=function(a){var b=a.filename,e=a.contents;k.currentDirectory=l.getPath(b),k.relativeUrls&&(k.rootpath=l.join(i.context.rootpath||"",l.pathDiff(k.currentDirectory,k.entryPath)),!l.isPathAbsolute(k.rootpath)&&l.alwaysMakePathsAbsolute()&&(k.rootpath=l.join(k.entryPath,k.rootpath))),k.filename=b;var h=new c.Parse(i.context);h.processImports=!1,i.contents[b]=e,(f.reference||g.reference)&&(k.reference=!0),g.inline?j(null,e,b):new d(h,i,k).parse(e,function(a,c){j(a,c,b)})},n=l.loadFile(b,f.currentDirectory,this.context,a,function(a,b){a?j(a):m(b)});n&&n.then(m,j)},b}},{"./contexts":10,"./parser/parser":36}],29:[function(a,b){b.exports=function(b,c){var d,e,f,g,h,i={version:[2,2,0],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")};return i}},{"./contexts":10,"./data":12,"./environment/abstract-file-manager":14,"./environment/environment":15,"./functions":22,"./import-manager":28,"./less-error":30,"./logger":31,"./parse":33,"./parse-tree":32,"./parser/parser":36,"./plugin-manager":37,"./render":38,"./source-map-builder":39,"./source-map-output":40,"./transform-tree":41,"./tree":59,"./utils":80,"./visitors":84}],30:[function(a,b){var c=a("./utils"),d=b.exports=function(a,b,d){Error.call(this);var e=a.filename||d;if(b&&e){var f=b.contents[e],g=c.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&c.getLocation(a.call,f).line,k=f.split("\n");this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.callLine=j+1,this.callExtract=k[j],this.column=i,this.extract=[k[h-1],k[h],k[h+1]]}this.message=a.message,this.stack=a.stack};if("undefined"==typeof Object.create){var e=function(){};e.prototype=Error.prototype,d.prototype=new e}else d.prototype=Object.create(Error.prototype);d.prototype.constructor=d},{"./utils":80}],31:[function(a,b){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;this._listeners.length>b;b++)if(this._listeners[b]===a)return void this._listeners.splice(b,1)},_fireEvent:function(a,b){for(var c=0;this._listeners.length>c;c++){var d=this._listeners[c][a];d&&d(b)}},_listeners:[]}},{}],32:[function(a,b){var c=a("./less-error"),d=a("./transform-tree"),e=a("./logger");b.exports=function(a){var b=function(a,b){this.root=a,this.imports=b};return b.prototype.toCSS=function(b){var f,g,h={};try{f=d(this.root,b)}catch(i){throw new c(i,this.imports)}try{var j=Boolean(b.compress);j&&e.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");var k={compress:j,dumpLineNumbers:b.dumpLineNumbers,strictUnits:Boolean(b.strictUnits),numPrecision:8};b.sourceMap?(g=new a(b.sourceMap),h.css=g.toCSS(f,k,this.imports)):h.css=f.toCSS(k)}catch(i){throw new c(i,this.imports)}if(b.pluginManager)for(var l=b.pluginManager.getPostProcessors(),m=0;l.length>m;m++)h.css=l[m].process(h.css,{sourceMap:g,options:b,imports:this.imports});b.sourceMap&&(h.map=g.getExternalSourceMap()),h.imports=[];for(var n in this.imports.files)this.imports.files.hasOwnProperty(n)&&n!==this.imports.rootFilename&&h.imports.push(n);return h},b}},{"./less-error":30,"./logger":31,"./transform-tree":41}],33:[function(a,b){var c="undefined"==typeof Promise?a("promise"):Promise,d=a("./contexts"),e=a("./parser/parser"),f=a("./plugin-manager");b.exports=function(a,b,g){var h=function(a,b,i){if(b=b||{},"function"==typeof b&&(i=b,b={}),!i){var j=this;return new c(function(c,d){h.call(j,a,b,function(a,b){a?d(a):c(b)})})}var k,l,m=new f(this);if(m.addPlugins(b.plugins),b.pluginManager=m,k=new d.Parse(b),b.rootFileInfo)l=b.rootFileInfo;else{var n=b.filename||"input",o=n.replace(/[^\/\\]*$/,"");l={filename:n,relativeUrls:k.relativeUrls,rootpath:k.rootpath||"",currentDirectory:o,entryPath:o,rootFilename:n}}var p=new g(k,l);new e(k,p,l).parse(a,function(a,c){return a?i(a):void i(null,c,p,b)},b)};return h}},{"./contexts":10,"./parser/parser":36,"./plugin-manager":37,promise:void 0}],34:[function(a,b){b.exports=function(a,b){function c(b){var c=h-q;512>c&&!b||!c||(p.push(a.slice(q,h+1)),q=h+1)}var d,e,f,g,h,i,j,k,l,m=a.length,n=0,o=0,p=[],q=0;for(h=0;m>h;h++)if(j=a.charCodeAt(h),!(j>=97&&122>=j||34>j))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(m-1>h){h++;continue}return b("unescaped `\\`",h);case 34:case 39:case 96:for(l=0,i=h,h+=1;m>h;h++)if(k=a.charCodeAt(h),!(k>96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;m>h&&(k=a.charCodeAt(h),!(13>=k)||10!=k&&13!=k);h++);else if(42==k){for(f=i=h,h+=2;m-1>h&&(k=a.charCodeAt(h),125==k&&(g=h),42!=k||47!=a.charCodeAt(h+1));h++);if(h==m-1)return b("missing closing `*/`",i);h++}continue;case 42:if(m-1>h&&47==a.charCodeAt(h+1))return b("unmatched `/*`",h);continue}return 0!==n?f>d&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],35:[function(a,b){var c=a("./chunker");b.exports=function(){function a(){k.i>i&&(h=h.slice(k.i-i),i=k.i)}var b,d,e,f,g,h,i,j=[],k={};k.save=function(){i=k.i,j.push({current:h,i:k.i,j:d})},k.restore=function(a){(k.i>e||k.i===e&&a&&!f)&&(e=k.i,f=a);var b=j.pop();h=b.current,i=k.i=b.i,d=b.j},k.forget=function(){j.pop()},k.isWhitespace=function(a){var c=k.i+(a||0),d=b.charCodeAt(c);return d===l||d===o||d===m||d===n},k.$=function(c){var d,e,f=typeof c;return"string"===f?b.charAt(k.i)!==c?null:(t(1),c):(a(),(d=c.exec(h))?(e=d[0].length,t(e),"string"==typeof d?d:1===d.length?d[0]:d):null)},k.$re=function(a){k.i>i&&(h=h.slice(k.i-i),i=k.i);var b=a.exec(h);return b?(t(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null},k.$char=function(a){return b.charAt(k.i)!==a?null:(t(1),a)};var l=32,m=9,n=10,o=13,p=43,q=44,r=47,s=57;k.autoCommentAbsorb=!0,k.commentStore=[],k.finished=!1;var t=function(a){for(var c,e,f,j=k.i,p=d,q=k.i-i,s=k.i+h.length-q,u=k.i+=a,v=b;s>k.i;k.i++){if(c=v.charCodeAt(k.i),k.autoCommentAbsorb&&c===r){if(e=v.charAt(k.i+1),"/"===e){f={index:k.i,isLineComment:!0};var w=v.indexOf("\n",k.i+1);0>w&&(w=s),k.i=w,f.text=v.substr(f.i,k.i-f.i),k.commentStore.push(f);continue}if("*"===e){var x=v.substr(k.i),y=x.match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\//);if(y){f={index:k.i,text:y[0],isLineComment:!1},k.i+=f.text.length-1,k.commentStore.push(f);continue}}break}if(c!==l&&c!==n&&c!==m&&c!==o)break}if(h=h.slice(a+k.i-u+q),i=k.i,!h.length){if(g.length-1>d)return h=g[++d],t(0),!0;k.finished=!0}return j!==k.i||p!==d};return k.peek=function(a){return"string"==typeof a?b.charAt(k.i)===a:a.test(h)},k.peekChar=function(a){return b.charAt(k.i)===a},k.currentChar=function(){return b.charAt(k.i)},k.getInput=function(){return b},k.peekNotNumeric=function(){var a=b.charCodeAt(k.i);return a>s||p>a||a===r||a===q},k.start=function(a,f,j){b=a,k.i=d=i=e=0,g=f?c(a,j):[a],h=g[0],t(0)},k.end=function(){var a,c=k.i>=b.length;return e>k.i&&(a=f,k.i=e),{isFinished:c,furthest:k.i,furthestPossibleErrorMessage:a,furthestReachedEnd:k.i>=b.length-1,furthestChar:b[k.i]}},k}},{"./chunker":34}],36:[function(a,b){var c=a("../less-error"),d=a("../tree"),e=a("../visitors"),f=a("./parser-input"),g=a("../utils"),h=function i(a,b,h){function j(a,b){var c="[object Function]"===Object.prototype.toString.call(a)?a.call(n):o.$(a);return c?c:void l(b||("string"==typeof a?"expected '"+a+"' got '"+o.currentChar()+"'":"unexpected token"))}function k(a,b){return o.$char(a)?a:void l(b||"expected '"+a+"' got '"+o.currentChar()+"'")}function l(a,d){throw new c({index:o.i,filename:h.filename,type:d||"Syntax",message:a},b)}function m(a){var b=h.filename;return{lineNumber:g.getLocation(a,o.getInput()).line+1,fileName:b}}var n,o=f();return{parse:function(f,g,j){var k,l,m,n=null,p="";l=j&&j.globalVars?i.serializeVars(j.globalVars)+"\n":"",m=j&&j.modifyVars?"\n"+i.serializeVars(j.modifyVars):"",(l||j&&j.banner)&&(p=(j&&j.banner?j.banner:"")+l,b.contentsIgnoredChars[h.filename]=p.length),f=f.replace(/\r\n/g,"\n"),f=p+f.replace(/^\uFEFF/,"")+m,b.contents[h.filename]=f;try{o.start(f,a.chunkInput,function(a,d){throw c({index:d,type:"Parse",message:a,filename:h.filename},b)}),k=new d.Ruleset(null,this.parsers.primary()),k.root=!0,k.firstRoot=!0}catch(q){return g(new c(q,b,h.filename))}var r=o.end();if(!r.isFinished){var s=r.furthestPossibleErrorMessage;s||(s="Unrecognised input","}"===r.furthestChar?s+=". Possibly missing opening '{'":")"===r.furthestChar?s+=". Possibly missing opening '('":r.furthestReachedEnd&&(s+=". Possibly missing something")),n=new c({type:"Parse",message:s,index:r.furthest,filename:h.filename},b)}var t=function(a){return a=n||a||b.error,a?(a instanceof c||(a=new c(a,b,h.filename)),g(a)):g(null,k)};return a.processImports===!1?t():void new e.ImportVisitor(b,t).run(k)},parsers:n={primary:function(){for(var a,b=this.mixin,c=[];!o.finished;){for(;;){if(a=this.comment(),!a)break;c.push(a)}if(o.peek("}"))break;if(a=this.extendRule())c=c.concat(a);else if(a=b.definition()||this.rule()||this.ruleset()||b.call()||this.rulesetCall()||this.directive())c.push(a);else if(!o.$re(/^[\s\n]+/)&&!o.$re(/^;+/))break}return c},comment:function(){if(o.commentStore.length){var a=o.commentStore.shift();return new d.Comment(a.text,a.isLineComment,a.index,h)}},entities:{quoted:function(){var a,b=o.i;return a=o.$re(/^(~)?("((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)')/),a?new d.Quoted(a[2],a[3]||a[4],Boolean(a[1]),b,h):void 0},keyword:function(){var a=o.$re(/^%|^[_A-Za-z-][_A-Za-z0-9-]*/);return a?d.Color.fromKeyword(a)||new d.Keyword(a):void 0},call:function(){var a,b,c,e,f=o.i;if(!o.peek(/^url\(/i))return o.save(),(a=o.$re(/^([\w-]+|%|progid:[\w\.]+)\(/))?(a=a[1],b=a.toLowerCase(),"alpha"===b&&(e=n.alpha())?e:(c=this.arguments(),o.$char(")")?(o.forget(),new d.Call(a,c,f,h)):void o.restore("Could not parse call arguments or missing ')'"))):void o.forget()},arguments:function(){for(var a,b=[];;){if(a=this.assignment()||n.expression(),!a)break;if(b.push(a),!o.$char(","))break}return b},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return a=o.$re(/^\w+(?=\s?=)/i),a&&o.$char("=")?(b=n.entity(),b?new d.Assignment(a,b):void 0):void 0},url:function(){var a,b=o.i;return o.autoCommentAbsorb=!1,"u"===o.currentChar()&&o.$re(/^url\(/)?(a=this.quoted()||this.variable()||o.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",o.autoCommentAbsorb=!0,k(")"),new d.URL(null!=a.value||a instanceof d.Variable?a:new d.Anonymous(a),b,h)):void(o.autoCommentAbsorb=!0)},variable:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@@?[\w-]+/))?new d.Variable(a,b,h):void 0},variableCurly:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@\{([\w-]+)\}/))?new d.Variable("@"+a[1],b,h):void 0},color:function(){var a;if("#"===o.currentChar()&&(a=o.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||l("Invalid HEX color code"),new d.Color(a[1])}},dimension:function(){if(!o.peekNotNumeric()){var a=o.$re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/i);return a?new d.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;return a=o.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new d.UnicodeDescriptor(a[0]):void 0},javascript:function(){var a,b=o.i;return a=o.$re(/^(~)?`([^`]*)`/),a?new d.JavaScript(a[2],Boolean(a[1]),b,h):void 0}},variable:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*:/))?a[1]:void 0},rulesetCall:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*\(\s*\)\s*;/))?new d.RulesetCall(a[1]):void 0},extend:function(a){var b,c,e,f,g,h=o.i;if(o.$re(a?/^&:extend\(/:/^:extend\(/)){do{for(e=null,b=null;!(e=o.$re(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];e=e&&e[1],b||l("Missing target selector for :extend()."),g=new d.Extend(new d.Selector(b),e,h),f?f.push(g):f=[g]}while(o.$char(","));return j(/^\)/),a&&j(/^;/),f}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,c,e,f,g,i=o.currentChar(),j=!1,l=o.i;if("."===i||"#"===i){for(o.save();;){if(a=o.i,e=o.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!e)break;c=new d.Element(f,e,a,h),b?b.push(c):b=[c],f=o.$char(">")}return b&&(o.$char("(")&&(g=this.args(!0).args,k(")")),n.important()&&(j=!0),n.end())?(o.forget(),new d.mixin.Call(b,g,l,h,j)):void o.restore()}},args:function(a){var b,c,e,f,g,h,i=n.entities,j={args:null,variadic:!1},k=[],m=[],p=[];for(o.save();;){if(a)h=n.detachedRuleset()||n.expression();else{if(o.commentStore.length=0,"."===o.currentChar()&&o.$re(/^\.{3}/)){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({variadic:!0});break}h=i.variable()||i.literal()||i.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var q=null;if(a?h.value&&1==h.value.length&&(q=h.value[0]):q=h,q&&q instanceof d.Variable)if(o.$char(":")){if(k.length>0&&(b&&l("Cannot mix ; and , as delimiter types"),c=!0),g=a&&n.detachedRuleset()||n.expression(),!g){if(!a)return o.restore(),j.args=[],j;l("could not understand value for named argument")}f=e=q.name}else{if(!a&&o.$re(/^\.{3}/)){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({name:h.name,variadic:!0});break}a||(e=f=q.name,g=null)}g&&k.push(g),p.push({name:f,value:g}),o.$char(",")||(o.$char(";")||b)&&(c&&l("Cannot mix ; and , as delimiter types"),b=!0,k.length>1&&(g=new d.Value(k)),m.push({name:e,value:g}),e=null,k=[],c=!1)}return o.forget(),j.args=b?m:p,j},definition:function(){var a,b,c,e,f=[],g=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),b=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$re(/^when/)&&(e=j(n.conditions,"expected condition")),c=n.block())return o.forget(),new d.mixin.Definition(a,f,c,e,g);o.restore()}else o.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()},end:function(){return o.$char(";")||o.peek("}")},alpha:function(){var a;if(o.$re(/^opacity=/i))return a=o.$re(/^\d+/),a||(a=j(this.entities.variable,"Could not parse alpha")),k(")"),new d.Alpha(a)},element:function(){var a,b,c,e=o.i;return b=this.combinator(),a=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(),a||(o.save(),o.$char("(")?(c=this.selector())&&o.$char(")")?(a=new d.Paren(c),o.forget()):o.restore("Missing closing ')'"):o.forget()),a?new d.Element(b,a,e,h):void 0},combinator:function(){var a=o.currentChar();if("/"===a){o.save();var b=o.$re(/^\/[a-z]+\//i);if(b)return o.forget(),new d.Combinator(b);o.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(o.i++,"^"===a&&"^"===o.currentChar()&&(a="^^",o.i++);o.isWhitespace();)o.i++;return new d.Combinator(a)}return new d.Combinator(o.isWhitespace(-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(a){for(var b,c,e,f,g,i,k,m=o.i;(a&&(c=this.extend())||a&&(i=o.$re(/^when/))||(f=this.element()))&&(i?k=j(this.conditions,"expected condition"):k?l("CSS guard can only be used at the end of selector"):c?g=g?g.concat(c):c:(g&&l("Extend can only be used at the end of selector"),e=o.currentChar(),b?b.push(f):b=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return b?new d.Selector(b,g,k,m,h):void(g&&l("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(o.$char("[")){var a,b,c,e=this.entities;return(a=e.variableCurly())||(a=j(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=o.$re(/^[|~*$^]?=/),c&&(b=e.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||e.variableCurly()),k("]"),new d.Attribute(a,c,b)}},block:function(){var a;return o.$char("{")&&(a=this.primary())&&o.$char("}")?a:void 0},blockRuleset:function(){var a=this.block();return a&&(a=new d.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();return a?new d.DetachedRuleset(a):void 0},ruleset:function(){var b,c,e,f;for(o.save(),a.dumpLineNumbers&&(f=m(o.i));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],o.commentStore.length=0,c.condition&&b.length>1&&l("Guards are only currently allowed on a single selector."),!o.$char(","))break;c.condition&&l("Guards are only currently allowed on a single selector."),o.commentStore.length=0}if(b&&(e=this.block())){o.forget();var g=new d.Ruleset(b,e,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}o.restore()},rule:function(b){var c,e,f,g,i,j=o.i,k=o.currentChar();if("."!==k&&"#"!==k&&"&"!==k)if(o.save(),c=this.variable()||this.ruleProperty()){if(i="string"==typeof c,i&&(e=this.detachedRuleset()),o.commentStore.length=0,!e){g=!i&&c.pop().value;var l=!b&&(a.compress||i);if(l&&(e=this.value()),!e&&(e=this.anonymousValue()))return o.forget(),new d.Rule(c,e,!1,g,j,h);l||e||(e=this.value()),f=this.important()}if(e&&this.end())return o.forget(),new d.Rule(c,e,f,g,j,h);if(o.restore(),e&&!b)return this.rule(!0)}else o.forget()},anonymousValue:function(){var a=o.$re(/^([^@+\/'"*`(;{}-]*);/);return a?new d.Anonymous(a[1]):void 0},"import":function(){var a,b,c=o.i,e=o.$re(/^@import?\s+/);if(e){var f=(e?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),o.$(";")||(o.i=c,l("missing semi-colon or unrecognised media features on import")),b=b&&new d.Value(b),new d.Import(a,b,f,c,h);o.i=c,l("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!o.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!o.$char(","))break}while(a);return k(")"),d},importOption:function(){var a=o.$re(/^(less|css|multiple|once|inline|reference)/);return a?a[1]:void 0},mediaFeature:function(){var a,b,c=this.entities,e=[];o.save();do if(a=c.keyword()||c.variable())e.push(a);else if(o.$char("(")){if(b=this.property(),a=this.value(),!o.$char(")"))return o.restore("Missing closing ')'"),null;if(b&&a)e.push(new d.Paren(new d.Rule(b,a,null,null,o.i,h,!0)));else{if(!a)return o.restore("badly formed media feature definition"),null;e.push(new d.Paren(a))}}while(a);return o.forget(),e.length>0?new d.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!o.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!o.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,e,f;return a.dumpLineNumbers&&(f=m(o.i)),o.$re(/^@media/)&&(b=this.mediaFeatures(),c=this.block())?(e=new d.Media(c,b,o.i,h),a.dumpLineNumbers&&(e.debugInfo=f),e):void 0},directive:function(){var b,c,e,f,g,i,j,k=o.i,n=!0;if("@"===o.currentChar()){if(c=this["import"]()||this.media())return c;if(o.save(),b=o.$re(/^@[a-z-]+/)){switch(f=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(f="@"+b.slice(b.indexOf("-",2)+1)),f){case"@counter-style":g=!0,n=!0;break;case"@charset":g=!0,n=!1;break;case"@namespace":i=!0,n=!1;break;case"@keyframes":g=!0;break;case"@host":case"@page":case"@document":case"@supports":j=!0}return o.commentStore.length=0,g?(c=this.entity(),c||l("expected "+b+" identifier")):i?(c=this.expression(),c||l("expected "+b+" expression")):j&&(c=(o.$re(/^[^{;]+/)||"").trim(),c&&(c=new d.Anonymous(c))),n&&(e=this.blockRuleset()),e||!n&&c&&o.$char(";")?(o.forget(),new d.Directive(b,c,e,k,h,a.dumpLineNumbers?m(k):null)):void o.restore("directive options not recognised")}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!o.$char(",")))break;while(a);return b.length>0?new d.Value(b):void 0},important:function(){return"!"===o.currentChar()?o.$re(/^! *important/):void 0},sub:function(){var a,b;return o.save(),o.$char("(")?(a=this.addition(),a&&o.$char(")")?(o.forget(),b=new d.Expression([a]),b.parens=!0,b):void o.restore("Expected ')'")):void o.restore()},multiplication:function(){var a,b,c,e,f;if(a=this.operand()){for(f=o.isWhitespace(-1);;){if(o.peek(/^\/[*\/]/))break;if(o.save(),c=o.$char("/")||o.$char("*"),!c){o.forget();break}if(b=this.operand(),!b){o.restore();break}o.forget(),a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},addition:function(){var a,b,c,e,f;if(a=this.multiplication()){for(f=o.isWhitespace(-1);;){if(c=o.$re(/^[-+]\s+/)||!f&&(o.$char("+")||o.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},conditions:function(){var a,b,c,e=o.i;if(a=this.condition()){for(;;){if(!o.peek(/^,\s*(not\s*)?\(/)||!o.$char(","))break;if(b=this.condition(),!b)break;c=new d.Condition("or",c||a,b,e)}return c||a}},condition:function(){var a,b,c,e,f=this.entities,g=o.i,h=!1;return o.$re(/^not/)&&(h=!0),k("("),a=this.addition()||f.keyword()||f.quoted(),a?(e=o.$re(/^(?:>=|<=|=<|[<=>])/),e?(b=this.addition()||f.keyword()||f.quoted(),b?c=new d.Condition(e,a,b,g,h):l("expected expression")):c=new d.Condition("=",a,new d.Keyword("true"),g,h),k(")"),o.$re(/^and/)?new d.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities;o.peek(/^-[@\(]/)&&(a=o.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(c.parensInOp=!0,c=new d.Negative(c)),c},expression:function(){var a,b,c=[];do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),o.peek(/^\/[\/*]/)||(b=o.$char("/"),b&&c.push(new d.Anonymous(b)))));while(a);return c.length>0?new d.Expression(c):void 0},property:function(){var a=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function a(a){var b=o.i,c=o.$re(a);return c?(f.push(b),e.push(c[1])):void 0}var b,c,e=[],f=[];for(o.save(),a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/))break;if(e.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===e[0]&&(e.shift(),f.shift()),c=0;e.length>c;c++)b=e[c],e[c]="@"!==b.charAt(0)?new d.Keyword(b):new d.Variable("@"+b.slice(2,-1),f[c],h);return e}o.restore()}}}};h.serializeVars=function(a){var b="";for(var c in a)if(Object.hasOwnProperty.call(a,c)){var d=a[c];b+=("@"===c[0]?"":"@")+c+": "+d+(";"===(""+d).slice(-1)?"":";")}return b},b.exports=h},{"../less-error":30,"../tree":59,"../utils":80,"../visitors":84,"./parser-input":35}],37:[function(a,b){var c=function(a){this.less=a,this.visitors=[],this.postProcessors=[],this.installedPlugins=[],this.fileManagers=[]};c.prototype.addPlugins=function(a){if(a)for(var b=0;a.length>b;b++)this.addPlugin(a[b])},c.prototype.addPlugin=function(a){this.installedPlugins.push(a),a.install(this.less,this)},c.prototype.addVisitor=function(a){this.visitors.push(a)},c.prototype.addPostProcessor=function(a,b){var c;for(c=0;this.postProcessors.length>c&&!(this.postProcessors[c].priority>=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},c.prototype.addFileManager=function(a){this.fileManagers.push(a)},c.prototype.getPostProcessors=function(){for(var a=[],b=0;this.postProcessors.length>b;b++)a.push(this.postProcessors[b].postProcessor);return a},c.prototype.getVisitors=function(){return this.visitors},c.prototype.getFileManagers=function(){return this.fileManagers},b.exports=c},{}],38:[function(a,b){var c="undefined"==typeof Promise?a("promise"):Promise;b.exports=function(a,b){var d=function(a,e,f){if("function"==typeof e&&(f=e,e={}),!f){var g=this;return new c(function(b,c){d.call(g,a,e,function(a,d){a?c(a):b(d)})})}this.parse(a,e,function(a,c,d,e){if(a)return f(a);var g;try{var h=new b(c,d);g=h.toCSS(e)}catch(a){return f(a)}f(null,g)})};return d}},{promise:void 0}],39:[function(a,b){b.exports=function(a,b){var c=function(a){this.options=a};return c.prototype.toCSS=function(b,c,d){var e=new a({contentsIgnoredCharsMap:d.contentsIgnoredChars,rootNode:b,contentsMap:d.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}),f=e.toCSS(c);return this.sourceMap=e.sourceMap,this.sourceMapURL=e.sourceMapURL,this.options.sourceMapInputFilename&&(this.sourceMapInputFilename=e.normalizeFilename(this.options.sourceMapInputFilename)),f+this.getCSSAppendage()},c.prototype.getCSSAppendage=function(){var a=this.sourceMapURL;return this.options.sourceMapFileInline&&(a="data:application/json;base64,"+b.encodeBase64(this.sourceMap)),a?"/*# sourceMappingURL="+a+" */":""},c.prototype.getExternalSourceMap=function(){return this.sourceMap},c.prototype.setExternalSourceMap=function(a){this.sourceMap=a},c.prototype.isInline=function(){return this.options.sourceMapFileInline},c.prototype.getSourceMapURL=function(){return this.sourceMapURL},c.prototype.getOutputFilename=function(){return this.options.sourceMapOutputFilename},c.prototype.getInputFilename=function(){return this.sourceMapInputFilename},c}},{}],40:[function(a,b){b.exports=function(a){var b=function(b){this._css=[],this._rootNode=b.rootNode,this._contentsMap=b.contentsMap,this._contentsIgnoredCharsMap=b.contentsIgnoredCharsMap,b.sourceMapFilename&&(this._sourceMapFilename=b.sourceMapFilename.replace(/\\/g,"/")),this._outputFilename=b.outputFilename,this.sourceMapURL=b.sourceMapURL,b.sourceMapBasepath&&(this._sourceMapBasepath=b.sourceMapBasepath.replace(/\\/g,"/")),b.sourceMapRootpath?(this._sourceMapRootpath=b.sourceMapRootpath.replace(/\\/g,"/"),"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/")):this._sourceMapRootpath="",this._outputSourceFiles=b.outputSourceFiles,this._sourceMapGeneratorConstructor=a.getSourceMapGenerator(),this._lineNumber=0,this._column=0};return b.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},b.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;e.length>i;i++)this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+i+1,column:0===i?this._column:0},original:{line:f.length+i,column:0===i?h.length:0},source:this.normalizeFilename(b.filename)});else this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+1,column:this._column},original:{line:f.length,column:h.length},source:this.normalizeFilename(b.filename)});1===e.length?this._column+=g.length:(this._lineNumber+=e.length-1,this._column=g.length),this._css.push(a)}},b.prototype.isEmpty=function(){return 0===this._css.length},b.prototype.toCSS=function(a){if(this._sourceMapGenerator=new this._sourceMapGeneratorConstructor({file:this._outputFilename,sourceRoot:null}),this._outputSourceFiles)for(var b in this._contentsMap)if(this._contentsMap.hasOwnProperty(b)){var c=this._contentsMap[b];this._contentsIgnoredCharsMap[b]&&(c=c.slice(this._contentsIgnoredCharsMap[b])),this._sourceMapGenerator.setSourceContent(this.normalizeFilename(b),c)}if(this._rootNode.genCSS(a,this),this._css.length>0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],41:[function(a,b){var c=a("./contexts"),d=a("./visitors"),e=a("./tree");b.exports=function(a,b){b=b||{};var f,g=b.variables,h=new c.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b])),new e.Rule("@"+a,b,!1,null,0)}),h.frames=[new e.Ruleset(null,g)]);var i,j=[],k=[new d.JoinSelectorVisitor,new d.ExtendVisitor,new d.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager){var l=b.pluginManager.getVisitors();for(i=0;l.length>i;i++){var m=l[i];m.isPreEvalVisitor?j.push(m):m.isPreVisitor?k.splice(0,0,m):k.push(m)}}for(i=0;j.length>i;i++)j[i].run(a);for(f=a.eval(h),i=0;k.length>i;i++)k[i].run(f);return f}},{"./contexts":10,"./tree":59,"./visitors":84}],42:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Alpha",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},b.exports=d},{"./node":67}],43:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.value=a,this.index=b,this.mapLines=d,this.currentFileInfo=c,this.rulesetLike="undefined"==typeof e?!1:e -};d.prototype=new c,d.prototype.type="Anonymous",d.prototype.eval=function(){return new d(this.value,this.index,this.currentFileInfo,this.mapLines,this.rulesetLike)},d.prototype.compare=function(a){return a.toCSS&&this.toCSS()===a.toCSS()?0:void 0},d.prototype.isRulesetLike=function(){return this.rulesetLike},d.prototype.genCSS=function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},b.exports=d},{"./node":67}],44:[function(a,b){var c=a("./node"),d=function(a,b){this.key=a,this.value=b};d.prototype=new c,d.prototype.type="Assignment",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.key,this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},b.exports=d},{"./node":67}],45:[function(a,b){var c=a("./node"),d=function(a,b,c){this.key=a,this.op=b,this.value=c};d.prototype=new c,d.prototype.type="Attribute",d.prototype.eval=function(a){return new d(this.key.eval?this.key.eval(a):this.key,this.op,this.value&&this.value.eval?this.value.eval(a):this.value)},d.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},d.prototype.toCSS=function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"},b.exports=d},{"./node":67}],46:[function(a,b){var c=a("./node"),d=a("../functions/function-caller"),e=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Call",e.prototype.accept=function(a){this.args&&(this.args=a.visitArray(this.args))},e.prototype.eval=function(a){var b,c=this.args.map(function(b){return b.eval(a)}),f=new d(this.name,a,this.index,this.currentFileInfo);if(f.isValid())try{if(b=f.call(c),null!=b)return b}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new e(this.name,c,this.index,this.currentFileInfo)},e.prototype.genCSS=function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;this.args.length>c;c++)this.args[c].genCSS(a,b),this.args.length>c+1&&b.add(", ");b.add(")")},b.exports=e},{"../functions/function-caller":20,"./node":67}],47:[function(a,b){function c(a,b){return Math.min(Math.max(a,0),b)}function d(a){return"#"+a.map(function(a){return a=c(Math.round(a),255),(16>a?"0":"")+a.toString(16)}).join("")}var e=a("./node"),f=a("../data/colors"),g=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};g.prototype=new e,g.prototype.type="Color",g.prototype.luma=function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255;return a=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),b=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),c=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*a+.7152*b+.0722*c},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},g.prototype.toCSS=function(a,b){var d,e,f=a&&a.compress&&!b;if(this.keyword)return this.keyword;if(e=this.fround(a,this.alpha),1>e)return"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(e,1)).join(","+(f?"":" "))+")";if(d=this.toRGB(),f){var g=d.split("");g[1]===g[2]&&g[3]===g[4]&&g[5]===g[6]&&(d="#"+g[1]+g[3]+g[5])}return d},g.prototype.operate=function(a,b,c){for(var d=[],e=this.alpha*(1-c.alpha)+c.alpha,f=0;3>f;f++)d[f]=this._operate(a,b,this.rgb[f],c.rgb[f]);return new g(d,e)},g.prototype.toRGB=function(){return d(this.rgb)},g.prototype.toHSL=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},g.prototype.toHSV=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},g.prototype.toARGB=function(){return d([255*this.alpha].concat(this.rgb))},g.prototype.compare=function(a){return a.rgb&&a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:void 0},g.fromKeyword=function(a){var b,c=a.toLowerCase();return f.hasOwnProperty(c)?b=new g(f[c].slice(1)):"transparent"===c&&(b=new g([0,0,0],0)),b?(b.keyword=a,b):void 0},b.exports=g},{"../data/colors":11,"./node":67}],48:[function(a,b){var c=a("./node"),d=function(a){" "===a?(this.value=" ",this.emptyOrWhitespace=!0):(this.value=a?a.trim():"",this.emptyOrWhitespace=""===this.value)};d.prototype=new c,d.prototype.type="Combinator";var e={"":!0," ":!0,"|":!0};d.prototype.genCSS=function(a,b){var c=a.compress||e[this.value]?"":" ";b.add(c+this.value+c)},b.exports=d},{"./node":67}],49:[function(a,b){var c=a("./node"),d=a("./debug-info"),e=function(a,b,c,d){this.value=a,this.isLineComment=b,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Comment",e.prototype.genCSS=function(a,b){this.debugInfo&&b.add(d(a,this),this.currentFileInfo,this.index),b.add(this.value)},e.prototype.isSilent=function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&"!"!==this.value[2];return this.isLineComment||b||c},e.prototype.markReferenced=function(){this.isReferenced=!0},e.prototype.isRulesetLike=function(a){return Boolean(a)},b.exports=e},{"./debug-info":51,"./node":67}],50:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e};d.prototype=new c,d.prototype.type="Condition",d.prototype.accept=function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},d.prototype.eval=function(a){var b=function(a,b,d){switch(a){case"and":return b&&d;case"or":return b||d;default:switch(c.compare(b,d)){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=d},{"./node":67}],51:[function(a,b){var c=function(a,b,d){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=c.asComment(b);break;case"mediaquery":e=c.asMediaQuery(b);break;case"all":e=c.asComment(b)+(d||"")+c.asMediaQuery(b)}return e};c.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},c.asMediaQuery=function(a){return"@media -sass-debug-info{filename{font-family:"+("file://"+a.debugInfo.fileName).replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=c},{}],52:[function(a,b){var c=a("./node"),d=a("../contexts"),e=function(a,b){this.ruleset=a,this.frames=b};e.prototype=new c,e.prototype.type="DetachedRuleset",e.prototype.evalFirst=!0,e.prototype.accept=function(a){this.ruleset=a.visit(this.ruleset)},e.prototype.eval=function(a){var b=this.frames||a.frames.slice(0);return new e(this.ruleset,b)},e.prototype.callEval=function(a){return this.ruleset.eval(this.frames?new d.Eval(a,this.frames.concat(a.frames)):a)},b.exports=e},{"../contexts":10,"./node":67}],53:[function(a,b){var c=a("./node"),d=a("../data/unit-conversions"),e=a("./unit"),f=a("./color"),g=function(a,b){this.value=parseFloat(a),this.unit=b&&b instanceof e?b:new e(b?[b]:void 0)};g.prototype=new c,g.prototype.type="Dimension",g.prototype.accept=function(a){this.unit=a.visit(this.unit)},g.prototype.eval=function(){return this},g.prototype.toColor=function(){return new f([this.value,this.value,this.value])},g.prototype.genCSS=function(a,b){if(a&&a.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var c=this.fround(a,this.value),d=String(c);if(0!==c&&1e-6>c&&c>-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&1>c&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},g.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e.numerator=c.unit.numerator.slice(0),e.denominator=c.unit.denominator.slice(0);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new g(d,e)},g.prototype.compare=function(a){var b,d;if(!(a instanceof g))return void 0;if(this.unit.isEmpty()||a.unit.isEmpty())b=this,d=a;else if(b=this.unify(),d=a.unify(),0!==b.unit.compare(d.unit))return void 0;return c.numericCompare(b.value,d.value)},g.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},g.prototype.convertTo=function(a){var b,c,e,f,h,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in d)d[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}h=function(a,b){return e.hasOwnProperty(a)?(b?i/=e[a]/e[f]:i*=e[a]/e[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],e=d[c],j.map(h));return j.cancel(),new g(i,j)},b.exports=g},{"../data/unit-conversions":13,"./color":47,"./node":67,"./unit":76}],54:[function(a,b){var c=a("./node"),d=a("./ruleset"),e=function(a,b,c,d,e,f){this.name=a,this.value=b,c&&(this.rules=c,this.rules.allowImports=!0),this.index=d,this.currentFileInfo=e,this.debugInfo=f};e.prototype=new c,e.prototype.type="Directive",e.prototype.accept=function(a){var b=this.value,c=this.rules;c&&(this.rules=a.visit(c)),b&&(this.value=a.visit(b))},e.prototype.isRulesetLike=function(){return this.rules||!this.isCharset()},e.prototype.isCharset=function(){return"@charset"===this.name},e.prototype.genCSS=function(a,b){var c=this.value,d=this.rules;b.add(this.name,this.currentFileInfo,this.index),c&&(b.add(" "),c.genCSS(a,b)),d?this.outputRuleset(a,b,[d]):b.add(";")},e.prototype.eval=function(a){var b=this.value,c=this.rules;return b&&(b=b.eval(a)),c&&(c=c.eval(a),c.root=!0),new e(this.name,b,c,this.index,this.currentFileInfo,this.debugInfo)},e.prototype.variable=function(a){return this.rules?d.prototype.variable.call(this.rules,a):void 0},e.prototype.find=function(){return this.rules?d.prototype.find.apply(this.rules,arguments):void 0},e.prototype.rulesets=function(){return this.rules?d.prototype.rulesets.apply(this.rules):void 0},e.prototype.markReferenced=function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules.rules,a=0;b.length>a;a++)b[a].markReferenced&&b[a].markReferenced()},e.prototype.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),void a.tabLevel--}var f="\n"+Array(a.tabLevel).join(" "),g=f+" ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--},b.exports=e},{"./node":67,"./ruleset":73}],55:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./combinator"),f=function(a,b,c,d){this.combinator=a instanceof e?a:new e(a),this.value="string"==typeof b?b.trim():b?b:"",this.index=c,this.currentFileInfo=d};f.prototype=new c,f.prototype.type="Element",f.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},f.prototype.eval=function(a){return new f(this.combinator,this.value.eval?this.value.eval(a):this.value,this.index,this.currentFileInfo)},f.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.currentFileInfo,this.index)},f.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof d&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=f},{"./combinator":48,"./node":67,"./paren":69}],56:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./comment"),f=function(a){if(this.value=a,!a)throw new Error("Expression requires a array parameter")};f.prototype=new c,f.prototype.type="Expression",f.prototype.accept=function(a){this.value=a.visitArray(this.value)},f.prototype.eval=function(a){var b,c=this.parens&&!this.parensInOp,e=!1;return c&&a.inParenthesis(),this.value.length>1?b=new f(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!e&&(b=new d(b)),b},f.prototype.genCSS=function(a,b){for(var c=0;this.value.length>c;c++)this.value[c].genCSS(a,b),this.value.length>c+1&&b.add(" ")},f.prototype.throwAwayComments=function(){this.value=this.value.filter(function(a){return!(a instanceof e)})},b.exports=f},{"./comment":49,"./node":67,"./paren":69}],57:[function(a,b){var c=a("./node"),d=function e(a,b,c){switch(this.selector=a,this.option=b,this.index=c,this.object_id=e.next_id++,this.parent_ids=[this.object_id],b){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}};d.next_id=0,d.prototype=new c,d.prototype.type="Extend",d.prototype.accept=function(a){this.selector=a.visit(this.selector)},d.prototype.eval=function(a){return new d(this.selector.eval(a),this.option,this.index)},d.prototype.clone=function(){return new d(this.selector,this.option,this.index)},d.prototype.findSelfSelectors=function(a){var b,c,d=[];for(b=0;a.length>b;b++)c=a[b].elements,b>0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]},b.exports=d},{"./node":67}],58:[function(a,b){var c=a("./node"),d=a("./media"),e=a("./url"),f=a("./quoted"),g=a("./ruleset"),h=a("./anonymous"),i=function(a,b,c,d,e){if(this.options=c,this.index=d,this.path=a,this.features=b,this.currentFileInfo=e,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var f=this.getPath();f&&/[#\.\&\?\/]css([\?;].*)?$/.test(f)&&(this.css=!0)}};i.prototype=new c,i.prototype.type="Import",i.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),!this.options.inline&&this.root&&(this.root=a.visit(this.root))},i.prototype.genCSS=function(a,b){this.css&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},i.prototype.getPath=function(){return this.path instanceof f?this.path.value:this.path instanceof e?this.path.value.value:null},i.prototype.isVariableImport=function(){var a=this.path;return a instanceof e&&(a=a.value),a instanceof f?a.containsVariables():!0},i.prototype.evalForImport=function(a){var b=this.path;return b instanceof e&&(b=b.value),new i(b.eval(a),this.features,this.options,this.index,this.currentFileInfo)},i.prototype.evalPath=function(a){var b=this.path.eval(a),c=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(b instanceof e)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},i.prototype.eval=function(a){var b,c=this.features&&this.features.eval(a);if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var e=new h(this.root,0,{filename:this.importedFilename},!0,!0);return this.features?new d([e],this.features.value):[e]}if(this.css){var f=new i(this.evalPath(a),c,this.options,this.index);if(!f.css&&this.error)throw this.error;return f}return b=new g(null,this.root.rules.slice(0)),b.evalImports(a),this.features?new d(b.rules,this.features.value):b.rules},b.exports=i},{"./anonymous":43,"./media":63,"./node":67,"./quoted":70,"./ruleset":73,"./url":77}],59:[function(a,b){var c={};c.Alpha=a("./alpha"),c.Color=a("./color"),c.Directive=a("./directive"),c.DetachedRuleset=a("./detached-ruleset"),c.Operation=a("./operation"),c.Dimension=a("./dimension"),c.Unit=a("./unit"),c.Keyword=a("./keyword"),c.Variable=a("./variable"),c.Ruleset=a("./ruleset"),c.Element=a("./element"),c.Attribute=a("./attribute"),c.Combinator=a("./combinator"),c.Selector=a("./selector"),c.Quoted=a("./quoted"),c.Expression=a("./expression"),c.Rule=a("./rule"),c.Call=a("./call"),c.URL=a("./url"),c.Import=a("./import"),c.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},c.Comment=a("./comment"),c.Anonymous=a("./anonymous"),c.Value=a("./value"),c.JavaScript=a("./javascript"),c.Assignment=a("./assignment"),c.Condition=a("./condition"),c.Paren=a("./paren"),c.Media=a("./media"),c.UnicodeDescriptor=a("./unicode-descriptor"),c.Negative=a("./negative"),c.Extend=a("./extend"),c.RulesetCall=a("./ruleset-call"),b.exports=c},{"./alpha":42,"./anonymous":43,"./assignment":44,"./attribute":45,"./call":46,"./color":47,"./combinator":48,"./comment":49,"./condition":50,"./detached-ruleset":52,"./dimension":53,"./directive":54,"./element":55,"./expression":56,"./extend":57,"./import":58,"./javascript":60,"./keyword":62,"./media":63,"./mixin-call":64,"./mixin-definition":65,"./negative":66,"./operation":68,"./paren":69,"./quoted":70,"./rule":71,"./ruleset":73,"./ruleset-call":72,"./selector":74,"./unicode-descriptor":75,"./unit":76,"./url":77,"./value":78,"./variable":79}],60:[function(a,b){var c=a("./js-eval-node"),d=a("./dimension"),e=a("./quoted"),f=a("./anonymous"),g=function(a,b,c,d){this.escaped=b,this.expression=a,this.index=c,this.currentFileInfo=d};g.prototype=new c,g.prototype.type="JavaScript",g.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new d(b):"string"==typeof b?new e('"'+b+'"',b,this.escaped,this.index):new f(Array.isArray(b)?b.join(", "):b)},b.exports=g},{"./anonymous":43,"./dimension":53,"./js-eval-node":61,"./quoted":70}],61:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(){};e.prototype=new c,e.prototype.evaluateJavaScript=function(a,b){var c,e=this,f={};if(void 0!==b.javascriptEnabled&&!b.javascriptEnabled)throw{message:"You are using JavaScript, which has been disabled.",filename:this.currentFileInfo.filename,index:this.index};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return e.jsify(new d("@"+c,e.index,e.currentFileInfo).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.currentFileInfo.filename,index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.currentFileInfo.filename,index:this.index}}return c},e.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=e},{"./node":67,"./variable":79}],62:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Keyword",d.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},d.True=new d("true"),d.False=new d("false"),b.exports=d},{"./node":67}],63:[function(a,b){var c=a("./ruleset"),d=a("./value"),e=a("./element"),f=a("./selector"),g=a("./anonymous"),h=a("./expression"),i=a("./directive"),j=function(a,b,e,f){this.index=e,this.currentFileInfo=f;var g=this.emptySelectors();this.features=new d(b),this.rules=[new c(g,a)],this.rules[0].allowImports=!0};j.prototype=new i,j.prototype.type="Media",j.prototype.isRulesetLike=!0,j.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},j.prototype.genCSS=function(a,b){b.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},j.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new j(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},j.prototype.variable=function(a){return c.prototype.variable.call(this.rules[0],a)},j.prototype.find=function(){return c.prototype.find.apply(this.rules[0],arguments)},j.prototype.rulesets=function(){return c.prototype.rulesets.apply(this.rules[0])},j.prototype.emptySelectors=function(){var a=new e("","&",this.index,this.currentFileInfo),b=[new f([a],null,null,this.index,this.currentFileInfo)];return b[0].mediaEmpty=!0,b},j.prototype.markReferenced=function(){var a,b=this.rules[0].rules;for(this.rules[0].markReferenced(),this.isReferenced=!0,a=0;b.length>a;a++)b[a].markReferenced&&b[a].markReferenced()},j.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var d=this.emptySelectors();b=new c(d,a.mediaBlocks),b.multiMedia=!0}return delete a.mediaBlocks,delete a.mediaPath,b},j.prototype.evalNested=function(a){var b,e,f=a.mediaPath.concat([this]);for(b=0;f.length>b;b++)e=f[b].features instanceof d?f[b].features.value:f[b].features,f[b]=Array.isArray(e)?e:[e];return this.features=new d(this.permute(f).map(function(a){for(a=a.map(function(a){return a.toCSS?a:new g(a)}),b=a.length-1;b>0;b--)a.splice(b,0,new g("and"));return new h(a)})),new c([],[])},j.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;c.length>d;d++)for(var e=0;a[0].length>e;e++)b.push([a[0][e]].concat(c[d]));return b},j.prototype.bubbleSelectors=function(a){a&&(this.rules=[new c(a.slice(0),[this.rules[0]])])},b.exports=j},{"./anonymous":43,"./directive":54,"./element":55,"./expression":56,"./ruleset":73,"./selector":74,"./value":78}],64:[function(a,b){var c=a("./node"),d=a("./selector"),e=a("./mixin-definition"),f=a("../functions/default"),g=function(a,b,c,e,f){this.selector=new d(a),this.arguments=b&&b.length?b:null,this.index=c,this.currentFileInfo=e,this.important=f};g.prototype=new c,g.prototype.type="MixinCall",g.prototype.accept=function(a){this.selector&&(this.selector=a.visit(this.selector)),this.arguments&&(this.arguments=a.visitArray(this.arguments))},g.prototype.eval=function(a){function b(b,c){var d,e;for(k=0;2>k;k++){for(w[k]=!0,f.value(k),d=0;c.length>d&&w[k];d++)e=c[d],e.matchCondition&&(w[k]=w[k]&&e.matchCondition(null,a));b.matchCondition&&(w[k]=w[k]&&b.matchCondition(h,a))}return w[0]||w[1]?w[0]!=w[1]?w[1]?z:A:y:x}var c,d,g,h,i,j,k,l,m,n,o,p,q,r,s,t=[],u=!1,v=[],w=[],x=-1,y=0,z=1,A=2;for(h=this.arguments&&this.arguments.map(function(b){return{name:b.name,value:b.value.eval(a)}}),s=function(b){return b.matchArgs(null,a)},i=0;a.frames.length>i;i++)if((c=a.frames[i].find(this.selector,null,s)).length>0){for(m=!0,j=0;c.length>j;j++){for(d=c[j].rule,g=c[j].path,l=!1,k=0;a.frames.length>k;k++)if(!(d instanceof e)&&d===(a.frames[k].originalRuleset||a.frames[k])){l=!0;break}l||d.matchArgs(h,a)&&(o={mixin:d,group:b(d,g)},o.group!==x&&v.push(o),u=!0)}for(f.reset(),q=[0,0,0],j=0;v.length>j;j++)q[v[j].group]++;if(q[y]>0)p=A;else if(p=z,q[z]+q[A]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename};for(j=0;v.length>j;j++)if(o=v[j].group,o===y||o===p)try{d=v[j].mixin,d instanceof e||(r=d.originalRuleset||d,d=new e("",[],d.rules,null,!1),d.originalRuleset=r),Array.prototype.push.apply(t,d.evalCall(a,h,this.important).rules)}catch(B){throw{message:B.message,index:this.index,filename:this.currentFileInfo.filename,stack:B.stack}}if(u){if(!this.currentFileInfo||!this.currentFileInfo.reference)for(i=0;t.length>i;i++)n=t[i],n.markReferenced&&n.markReferenced();return t}}throw m?{type:"Runtime",message:"No matching definition was found for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename}:{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}},g.prototype.format=function(a){return this.selector.toCSS().trim()+"("+(a?a.map(function(a){var b="";return a.name&&(b+=a.name+":"),b+=a.value.toCSS?a.value.toCSS():"???"}).join(", "):"")+")"},b.exports=g},{"../functions/default":19,"./mixin-definition":65,"./node":67,"./selector":74}],65:[function(a,b){var c=a("./selector"),d=a("./element"),e=a("./ruleset"),f=a("./rule"),g=a("./expression"),h=a("../contexts"),i=function(a,b,e,f,g,h){this.name=a,this.selectors=[new c([new d(null,a,this.index,this.currentFileInfo)])],this.params=b,this.condition=f,this.variadic=g,this.arity=b.length,this.rules=e,this._lookups={},this.required=b.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:a},0),this.frames=h};i.prototype=new e,i.prototype.type="MixinDefinition",i.prototype.evalFirst=!0,i.prototype.accept=function(a){this.params&&this.params.length&&(this.params=a.visitArray(this.params)),this.rules=a.visitArray(this.rules),this.condition&&(this.condition=a.visit(this.condition))},i.prototype.evalParams=function(a,b,c,d){var i,j,k,l,m,n,o,p,q=new e(null,null),r=this.params.slice(0),s=0;if(b=new h.Eval(b,[q].concat(b.frames)),c)for(c=c.slice(0),s=c.length,k=0;s>k;k++)if(j=c[k],n=j&&j.name){for(o=!1,l=0;r.length>l;l++)if(!d[l]&&n===r[l].name){d[l]=j.value.eval(a),q.prependRule(new f(n,j.value.eval(a))),o=!0;break}if(o){c.splice(k,1),k--;continue}throw{type:"Runtime",message:"Named argument for "+this.name+" "+c[k].name+" not found"}}for(p=0,k=0;r.length>k;k++)if(!d[k]){if(j=c&&c[p],n=r[k].name)if(r[k].variadic){for(i=[],l=p;s>l;l++)i.push(c[l].value.eval(a));q.prependRule(new f(n,new g(i).eval(a)))}else{if(m=j&&j.value)m=m.eval(a);else{if(!r[k].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+s+" for "+this.arity+")"};m=r[k].value.eval(b),q.resetCache()}q.prependRule(new f(n,m)),d[k]=m}if(r[k].variadic&&c)for(l=p;s>l;l++)d[l]=c[l].value.eval(a);p++}return q},i.prototype.eval=function(a){return new i(this.name,this.params,this.rules,this.condition,this.variadic,this.frames||a.frames.slice(0))},i.prototype.evalCall=function(a,b,c){var d,i,j=[],k=this.frames?this.frames.concat(a.frames):a.frames,l=this.evalParams(a,new h.Eval(a,k),b,j);return l.prependRule(new f("@arguments",new g(j).eval(a))),d=this.rules.slice(0),i=new e(null,d),i.originalRuleset=this,i=i.eval(new h.Eval(a,[this,l].concat(k))),c&&(i=this.makeImportant.apply(i)),i},i.prototype.matchCondition=function(a,b){return this.condition&&!this.condition.eval(new h.Eval(b,[this.evalParams(b,new h.Eval(b,this.frames?this.frames.concat(b.frames):b.frames),a,[])].concat(this.frames).concat(b.frames)))?!1:!0},i.prototype.matchArgs=function(a,b){var c,d=a&&a.length||0;if(this.variadic){if(this.required-1>d)return!1}else{if(this.required>d)return!1;if(d>this.params.length)return!1}c=Math.min(d,this.arity);for(var e=0;c>e;e++)if(!this.params[e].name&&!this.params[e].variadic&&a[e].value.eval(b).toCSS()!=this.params[e].value.eval(b).toCSS())return!1;return!0},b.exports=i},{"../contexts":10,"./element":55,"./expression":56,"./rule":71,"./ruleset":73,"./selector":74}],66:[function(a,b){var c=a("./node"),d=a("./operation"),e=a("./dimension"),f=function(a){this.value=a};f.prototype=new c,f.prototype.type="Negative",f.prototype.genCSS=function(a,b){b.add("-"),this.value.genCSS(a,b)},f.prototype.eval=function(a){return a.isMathOn()?new d("*",[new e(-1),this.value]).eval(a):new f(this.value.eval(a))},b.exports=f},{"./dimension":53,"./node":67,"./operation":68}],67:[function(a,b){var c=function(){};c.prototype.toCSS=function(a){var b=[];return this.genCSS(a,{add:function(a){b.push(a)},isEmpty:function(){return 0===b.length}}),b.join("")},c.prototype.genCSS=function(a,b){b.add(this.value)},c.prototype.accept=function(a){this.value=a.visit(this.value)},c.prototype.eval=function(){return this},c.prototype._operate=function(a,b,c,d){switch(b){case"+":return c+d;case"-":return c-d;case"*":return c*d;case"/":return c/d}},c.prototype.fround=function(a,b){var c=a&&a.numPrecision;return null==c?b:Number((b+2e-16).toFixed(c))},c.compare=function(a,b){if(a.compare&&"Quoted"!==b.type&&"Anonymous"!==b.type)return a.compare(b);if(b.compare)return-b.compare(a);if(a.type!==b.type)return void 0;if(a=a.value,b=b.value,!Array.isArray(a))return a===b?0:void 0;if(a.length!==b.length)return void 0;for(var d=0;a.length>d;d++)if(0!==c.compare(a[d],b[d]))return void 0;return 0},c.numericCompare=function(a,b){return b>a?-1:a===b?0:a>b?1:void 0},b.exports=c},{}],68:[function(a,b){var c=a("./node"),d=a("./color"),e=a("./dimension"),f=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};f.prototype=new c,f.prototype.type="Operation",f.prototype.accept=function(a){this.operands=a.visit(this.operands)},f.prototype.eval=function(a){var b=this.operands[0].eval(a),c=this.operands[1].eval(a);if(a.isMathOn()){if(b instanceof e&&c instanceof d&&(b=b.toColor()),c instanceof e&&b instanceof d&&(c=c.toColor()),!b.operate)throw{type:"Operation",message:"Operation on an invalid type"};return b.operate(a,this.op,c)}return new f(this.op,[b,c],this.isSpaced)},f.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=f},{"./color":47,"./dimension":53,"./node":67}],69:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Paren",d.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},d.prototype.eval=function(a){return new d(this.value.eval(a))},b.exports=d},{"./node":67}],70:[function(a,b){var c=a("./node"),d=a("./js-eval-node"),e=a("./variable"),f=function(a,b,c,d,e){this.escaped=null==c?!0:c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e};f.prototype=new d,f.prototype.type="Quoted",f.prototype.genCSS=function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},f.prototype.containsVariables=function(){return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/)},f.prototype.eval=function(a){function b(a,b,c){var d=a;do a=d,d=a.replace(b,c);while(a!==d);return d}var c=this,d=this.value,g=function(b,d){return String(c.evaluateJavaScript(d,a))},h=function(b,d){var g=new e("@"+d,c.index,c.currentFileInfo).eval(a,!0);return g instanceof f?g.value:g.toCSS()};return d=b(d,/`([^`]+)`/g,g),d=b(d,/@\{([\w-]+)\}/g,h),new f(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},f.prototype.compare=function(a){return"Quoted"!==a.type||this.escaped||a.escaped?a.toCSS&&this.toCSS()===a.toCSS()?0:void 0:c.numericCompare(this.value,a.value)},b.exports=f},{"./js-eval-node":61,"./node":67,"./variable":79}],71:[function(a,b){function c(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;e>c;c++)b[c].eval(a).genCSS(a,f);return d}var d=a("./node"),e=a("./value"),f=a("./keyword"),g=function(a,b,c,f,g,h,i,j){this.name=a,this.value=b instanceof d?b:new e([b]),this.important=c?" "+c.trim():"",this.merge=f,this.index=g,this.currentFileInfo=h,this.inline=i||!1,this.variable=void 0!==j?j:a.charAt&&"@"===a.charAt(0) -};g.prototype=new d,g.prototype.type="Rule",g.prototype.genCSS=function(a,b){b.add(this.name+(a.compress?":":": "),this.currentFileInfo,this.index);try{this.value.genCSS(a,b)}catch(c){throw c.index=this.index,c.filename=this.currentFileInfo.filename,c}b.add(this.important+(this.inline||a.lastRule&&a.compress?"":";"),this.currentFileInfo,this.index)},g.prototype.eval=function(a){var b,d=!1,e=this.name,h=this.variable;"string"!=typeof e&&(e=1===e.length&&e[0]instanceof f?e[0].value:c(a,e),h=!1),"font"!==e||a.strictMath||(d=!0,a.strictMath=!0);try{if(a.importantScope.push({}),b=this.value.eval(a),!this.variable&&"DetachedRuleset"===b.type)throw{message:"Rulesets cannot be evaluated on a property.",index:this.index,filename:this.currentFileInfo.filename};var i=this.important,j=a.importantScope.pop();return!i&&j.important&&(i=j.important),new g(e,b,i,this.merge,this.index,this.currentFileInfo,this.inline,h)}catch(k){throw"number"!=typeof k.index&&(k.index=this.index,k.filename=this.currentFileInfo.filename),k}finally{d&&(a.strictMath=!1)}},g.prototype.makeImportant=function(){return new g(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)},b.exports=g},{"./keyword":62,"./node":67,"./value":78}],72:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(a){this.variable=a};e.prototype=new c,e.prototype.type="RulesetCall",e.prototype.eval=function(a){var b=new d(this.variable).eval(a);return b.callEval(a)},b.exports=e},{"./node":67,"./variable":79}],73:[function(a,b){var c=a("./node"),d=a("./rule"),e=a("./selector"),f=a("./element"),g=a("../contexts"),h=a("../functions/default"),i=a("./debug-info"),j=function(a,b,c){this.selectors=a,this.rules=b,this._lookups={},this.strictImports=c};j.prototype=new c,j.prototype.type="Ruleset",j.prototype.isRuleset=!0,j.prototype.isRulesetLike=!0,j.prototype.accept=function(a){this.paths?a.visitArray(this.paths,!0):this.selectors&&(this.selectors=a.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=a.visitArray(this.rules))},j.prototype.eval=function(a){var b,c,e,f,g=this.selectors,i=!1;if(g&&(c=g.length)){for(b=[],h.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),f=0;c>f;f++)e=g[f].eval(a),b.push(e),e.evaldCondition&&(i=!0);h.reset()}else i=!0;var k,l,m=this.rules?this.rules.slice(0):null,n=new j(b,m,this.strictImports);n.originalRuleset=this,n.root=this.root,n.firstRoot=this.firstRoot,n.allowImports=this.allowImports,this.debugInfo&&(n.debugInfo=this.debugInfo),i||(m.length=0);var o=a.frames;o.unshift(n);var p=a.selectors;p||(a.selectors=p=[]),p.unshift(this.selectors),(n.root||n.allowImports||!n.strictImports)&&n.evalImports(a);var q=n.rules,r=q?q.length:0;for(f=0;r>f;f++)q[f].evalFirst&&(q[f]=q[f].eval(a));var s=a.mediaBlocks&&a.mediaBlocks.length||0;for(f=0;r>f;f++)"MixinCall"===q[f].type?(m=q[f].eval(a).filter(function(a){return a instanceof d&&a.variable?!n.variable(a.name):!0}),q.splice.apply(q,[f,1].concat(m)),r+=m.length-1,f+=m.length-1,n.resetCache()):"RulesetCall"===q[f].type&&(m=q[f].eval(a).rules.filter(function(a){return a instanceof d&&a.variable?!1:!0}),q.splice.apply(q,[f,1].concat(m)),r+=m.length-1,f+=m.length-1,n.resetCache());for(f=0;q.length>f;f++)k=q[f],k.evalFirst||(q[f]=k=k.eval?k.eval(a):k);for(f=0;q.length>f;f++)if(k=q[f],k instanceof j&&k.selectors&&1===k.selectors.length&&k.selectors[0].isJustParentSelector()){q.splice(f--,1);for(var t=0;k.rules.length>t;t++)l=k.rules[t],l instanceof d&&l.variable||q.splice(++f,0,l)}if(o.shift(),p.shift(),a.mediaBlocks)for(f=s;a.mediaBlocks.length>f;f++)a.mediaBlocks[f].bubbleSelectors(b);return n},j.prototype.evalImports=function(a){var b,c,d=this.rules;if(d)for(b=0;d.length>b;b++)"Import"===d[b].type&&(c=d[b].eval(a),c&&c.length?(d.splice.apply(d,[b,1].concat(c)),b+=c.length-1):d.splice(b,1,c),this.resetCache())},j.prototype.makeImportant=function(){return new j(this.selectors,this.rules.map(function(a){return a.makeImportant?a.makeImportant():a}),this.strictImports)},j.prototype.matchArgs=function(a){return!a||0===a.length},j.prototype.matchCondition=function(a,b){var c=this.selectors[this.selectors.length-1];return c.evaldCondition?c.condition&&!c.condition.eval(new g.Eval(b,b.frames))?!1:!0:!1},j.prototype.resetCache=function(){this._rulesets=null,this._variables=null,this._lookups={}},j.prototype.variables=function(){return this._variables||(this._variables=this.rules?this.rules.reduce(function(a,b){if(b instanceof d&&b.variable===!0&&(a[b.name]=b),"Import"===b.type&&b.root&&b.root.variables){var c=b.root.variables();for(var e in c)c.hasOwnProperty(e)&&(a[e]=c[e])}return a},{}):{}),this._variables},j.prototype.variable=function(a){return this.variables()[a]},j.prototype.rulesets=function(){if(!this.rules)return null;var a,b,c=[],d=this.rules,e=d.length;for(a=0;e>a;a++)b=d[a],b.isRuleset&&c.push(b);return c},j.prototype.prependRule=function(a){var b=this.rules;b?b.unshift(a):this.rules=[a]},j.prototype.find=function(a,b,c){b=b||this;var d,f,g=[],h=a.toCSS();return h in this._lookups?this._lookups[h]:(this.rulesets().forEach(function(h){if(h!==b)for(var i=0;h.selectors.length>i;i++)if(d=a.match(h.selectors[i])){if(a.elements.length>d){if(!c||c(h)){f=h.find(new e(a.elements.slice(d)),b,c);for(var j=0;f.length>j;++j)f[j].path.push(h);Array.prototype.push.apply(g,f)}}else g.push({rule:h,path:[]});break}}),this._lookups[h]=g,g)},j.prototype.genCSS=function(a,b){function c(a,b){return"boolean"==typeof a.isRulesetLike?a.isRulesetLike:"function"==typeof a.isRulesetLike?a.isRulesetLike(b):!1}var d,e,f,g,h,j,k=[],l=[],m=[];a.tabLevel=a.tabLevel||0,this.root||a.tabLevel++;var n,o=a.compress?"":Array(a.tabLevel+1).join(" "),p=a.compress?"":Array(a.tabLevel).join(" ");for(d=0;this.rules.length>d;d++)h=this.rules[d],c(h,this.root)?m.push(h):h.isCharset&&h.isCharset()?k.push(h):l.push(h);if(l=k.concat(l),!this.root){g=i(a,this,p),g&&(b.add(g),b.add(p));var q,r=this.paths,s=r.length;for(n=a.compress?",":",\n"+p,d=0;s>d;d++)if(j=r[d],q=j.length)for(d>0&&b.add(n),a.firstSelector=!0,j[0].genCSS(a,b),a.firstSelector=!1,e=1;q>e;e++)j[e].genCSS(a,b);b.add((a.compress?"{":" {\n")+o)}for(d=0;l.length>d;d++)h=l[d],d+1!==l.length||this.root&&0!==m.length&&!this.firstRoot||(a.lastRule=!0),h.genCSS?h.genCSS(a,b):h.value&&b.add(h.value.toString()),a.lastRule?a.lastRule=!1:b.add(a.compress?"":"\n"+o);if(this.root||(b.add(a.compress?"}":"\n"+p+"}"),a.tabLevel--),n=(a.compress?"":"\n")+(this.root?o:p),f=m.length)for(l.length&&n&&b.add(n),m[0].genCSS(a,b),d=1;f>d;d++)n&&b.add(n),m[d].genCSS(a,b);b.isEmpty()||a.compress||!this.firstRoot||b.add("\n")},j.prototype.markReferenced=function(){if(this.selectors)for(var a=0;this.selectors.length>a;a++)this.selectors[a].markReferenced()},j.prototype.joinSelectors=function(a,b,c){for(var d=0;c.length>d;d++)this.joinSelector(a,b,c[d])},j.prototype.joinSelector=function(a,b,c){var d,e,g,h,i,j,k,l,m,n,o,p,q,r,s;for(d=0;c.elements.length>d;d++)j=c.elements[d],"&"===j.value&&(h=!0);if(h){for(r=[],i=[[]],d=0;c.elements.length>d;d++)if(j=c.elements[d],"&"!==j.value)r.push(j);else{for(s=[],r.length>0&&this.mergeElementsOnToSelectors(r,i),e=0;i.length>e;e++)if(k=i[e],0===b.length)k.length>0&&(k[0].elements=k[0].elements.slice(0),k[0].elements.push(new f(j.combinator,"",j.index,j.currentFileInfo))),s.push(k);else for(g=0;b.length>g;g++){if(l=b[g],m=[],n=[],p=!0,k.length>0?(m=k.slice(0),q=m.pop(),o=c.createDerived(q.elements.slice(0)),p=!1):o=c.createDerived([]),l.length>1&&(n=n.concat(l.slice(1))),l.length>0){p=!1;var t=j.combinator,u=l[0].elements[0];t.emptyOrWhitespace&&!u.combinator.emptyOrWhitespace&&(t=u.combinator),o.elements.push(new f(t,u.value,j.index,j.currentFileInfo)),o.elements=o.elements.concat(l[0].elements.slice(1))}p||m.push(o),m=m.concat(n),s.push(m)}i=s,r=[]}for(r.length>0&&this.mergeElementsOnToSelectors(r,i),d=0;i.length>d;d++)i[d].length>0&&a.push(i[d])}else if(b.length>0)for(d=0;b.length>d;d++)a.push(b[d].concat(c));else a.push([c])},j.prototype.mergeElementsOnToSelectors=function(a,b){var c,d;if(0===b.length)return void b.push([new e(a)]);for(c=0;b.length>c;c++)d=b[c],d.length>0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new e(a))},b.exports=j},{"../contexts":10,"../functions/default":19,"./debug-info":51,"./element":55,"./node":67,"./rule":71,"./selector":74}],74:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e,f){this.elements=a,this.extendList=b,this.condition=c,this.currentFileInfo=e||{},this.isReferenced=f,c||(this.evaldCondition=!0)};d.prototype=new c,d.prototype.type="Selector",d.prototype.accept=function(a){this.elements&&(this.elements=a.visitArray(this.elements)),this.extendList&&(this.extendList=a.visitArray(this.extendList)),this.condition&&(this.condition=a.visit(this.condition))},d.prototype.createDerived=function(a,b,c){c=null!=c?c:this.evaldCondition;var e=new d(a,b||this.extendList,null,this.index,this.currentFileInfo,this.isReferenced);return e.evaldCondition=c,e.mediaEmpty=this.mediaEmpty,e},d.prototype.match=function(a){var b,c,d=this.elements,e=d.length;if(a.CacheElements(),b=a._elements.length,0===b||b>e)return 0;for(c=0;b>c;c++)if(d[c].value!==a._elements[c])return 0;return b},d.prototype.CacheElements=function(){if(!this._elements){var a=this.elements.map(function(a){return a.combinator.value+(a.value.value||a.value)}).join("").match(/[,&#\*\.\w-]([\w-]|(\\.))*/g);a?"&"===a[0]&&a.shift():a=[],this._elements=a}},d.prototype.isJustParentSelector=function(){return!this.mediaEmpty&&1===this.elements.length&&"&"===this.elements[0].value&&(" "===this.elements[0].combinator.value||""===this.elements[0].combinator.value)},d.prototype.eval=function(a){var b=this.condition&&this.condition.eval(a),c=this.elements,d=this.extendList;return c=c&&c.map(function(b){return b.eval(a)}),d=d&&d.map(function(b){return b.eval(a)}),this.createDerived(c,d,b)},d.prototype.genCSS=function(a,b){var c,d;if(a&&a.firstSelector||""!==this.elements[0].combinator.value||b.add(" ",this.currentFileInfo,this.index),!this._css)for(c=0;this.elements.length>c;c++)d=this.elements[c],d.genCSS(a,b)},d.prototype.markReferenced=function(){this.isReferenced=!0},d.prototype.getIsReferenced=function(){return!this.currentFileInfo.reference||this.isReferenced},d.prototype.getIsOutput=function(){return this.evaldCondition},b.exports=d},{"./node":67}],75:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="UnicodeDescriptor",b.exports=d},{"./node":67}],76:[function(a,b){var c=a("./node"),d=a("../data/unit-conversions"),e=function(a,b,c){this.numerator=a?a.slice(0).sort():[],this.denominator=b?b.slice(0).sort():[],c?this.backupUnit=c:a&&a.length&&(this.backupUnit=a[0])};e.prototype=new c,e.prototype.type="Unit",e.prototype.clone=function(){return new e(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},e.prototype.genCSS=function(a,b){var c=a&&a.strictUnits;1===this.numerator.length?b.add(this.numerator[0]):!c&&this.backupUnit&&b.add(this.backupUnit)},e.prototype.toString=function(){var a,b=this.numerator.join("*");for(a=0;this.denominator.length>a;a++)b+="/"+this.denominator[a];return b},e.prototype.compare=function(a){return this.is(a.toString())?0:void 0},e.prototype.is=function(a){return this.toString().toUpperCase()===a.toUpperCase()},e.prototype.isLength=function(){return Boolean(this.toCSS().match(/px|em|%|in|cm|mm|pc|pt|ex/))},e.prototype.isEmpty=function(){return 0===this.numerator.length&&0===this.denominator.length},e.prototype.isSingular=function(){return 1>=this.numerator.length&&0===this.denominator.length},e.prototype.map=function(a){var b;for(b=0;this.numerator.length>b;b++)this.numerator[b]=a(this.numerator[b],!1);for(b=0;this.denominator.length>b;b++)this.denominator[b]=a(this.denominator[b],!0)},e.prototype.usedUnits=function(){var a,b,c={};b=function(b){return a.hasOwnProperty(b)&&!c[e]&&(c[e]=b),b};for(var e in d)d.hasOwnProperty(e)&&(a=d[e],this.map(b));return c},e.prototype.cancel=function(){var a,b,c={};for(b=0;this.numerator.length>b;b++)a=this.numerator[b],c[a]=(c[a]||0)+1;for(b=0;this.denominator.length>b;b++)a=this.denominator[b],c[a]=(c[a]||0)-1;this.numerator=[],this.denominator=[];for(a in c)if(c.hasOwnProperty(a)){var d=c[a];if(d>0)for(b=0;d>b;b++)this.numerator.push(a);else if(0>d)for(b=0;-d>b;b++)this.denominator.push(a)}this.numerator.sort(),this.denominator.sort()},b.exports=e},{"../data/unit-conversions":13,"./node":67}],77:[function(a,b){var c=a("./node"),d=function(a,b,c,d){this.value=a,this.currentFileInfo=c,this.index=b,this.isEvald=d};d.prototype=new c,d.prototype.type="Url",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.genCSS=function(a,b){b.add("url("),this.value.genCSS(a,b),b.add(")")},d.prototype.eval=function(a){var b,c=this.value.eval(a);if(!this.isEvald&&(b=this.currentFileInfo&&this.currentFileInfo.rootpath,b&&"string"==typeof c.value&&a.isPathRelative(c.value)&&(c.quote||(b=b.replace(/[\(\)'"\s]/g,function(a){return"\\"+a})),c.value=b+c.value),c.value=a.normalizePath(c.value),a.urlArgs&&!c.value.match(/^\s*data:/))){var e=-1===c.value.indexOf("?")?"?":"&",f=e+a.urlArgs;-1!==c.value.indexOf("#")?c.value=c.value.replace("#",f+"#"):c.value+=f}return new d(c,this.index,this.currentFileInfo,!0)},b.exports=d},{"./node":67}],78:[function(a,b){var c=a("./node"),d=function(a){if(this.value=a,!a)throw new Error("Value requires an array argument")};d.prototype=new c,d.prototype.type="Value",d.prototype.accept=function(a){this.value&&(this.value=a.visitArray(this.value))},d.prototype.eval=function(a){return 1===this.value.length?this.value[0].eval(a):new d(this.value.map(function(b){return b.eval(a)}))},d.prototype.genCSS=function(a,b){var c;for(c=0;this.value.length>c;c++)this.value[c].genCSS(a,b),this.value.length>c+1&&b.add(a&&a.compress?",":", ")},b.exports=d},{"./node":67}],79:[function(a,b){var c=a("./node"),d=function(a,b,c){this.name=a,this.index=b,this.currentFileInfo=c||{}};d.prototype=new c,d.prototype.type="Variable",d.prototype.eval=function(a){var b,c=this.name;if(0===c.indexOf("@@")&&(c="@"+new d(c.slice(1),this.index,this.currentFileInfo).eval(a).value),this.evaluating)throw{type:"Name",message:"Recursive variable definition for "+c,filename:this.currentFileInfo.filename,index:this.index};if(this.evaluating=!0,b=this.find(a.frames,function(b){var d=b.variable(c);if(d){if(d.important){var e=a.importantScope[a.importantScope.length-1];e.important=d.important}return d.value.eval(a)}}))return this.evaluating=!1,b;throw{type:"Name",message:"variable "+c+" is undefined",filename:this.currentFileInfo.filename,index:this.index}},d.prototype.find=function(a,b){for(var c,d=0;a.length>d;d++)if(c=b.call(a,a[d]))return c;return null},b.exports=d},{"./node":67}],80:[function(a,b){b.exports={getLocation:function(a,b){for(var c=a+1,d=null,e=-1;--c>=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}}},{}],81:[function(a,b){var c=a("../tree"),d=a("./visitor"),e=function(){this._visitor=new d(this),this.contexts=[],this.allExtendsStack=[[]]};e.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,d,e,f,g=[],h=a.rules,i=h?h.length:0;for(b=0;i>b;b++)a.rules[b]instanceof c.Extend&&(g.push(h[b]),a.extendOnEveryPath=!0);var j=a.paths;for(b=0;j.length>b;b++){var k=j[b],l=k[k.length-1],m=l.extendList;for(f=m?m.slice(0).concat(g):g,f&&(f=f.map(function(a){return a.clone()})),d=0;f.length>d;d++)this.foundExtends=!0,e=f[d],e.findSelfSelectors(k),e.ruleset=a,0===d&&(e.firstExtendOnThisSelectorPath=!0),this.allExtendsStack[this.allExtendsStack.length-1].push(e)}this.contexts.push(a.selectors)}},visitRulesetOut:function(a){a.root||(this.contexts.length=this.contexts.length-1)},visitMedia:function(a){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}};var f=function(){this._visitor=new d(this)};f.prototype={run:function(a){var b=new e;return b.run(a),b.foundExtends?(a.allExtends=a.allExtends.concat(this.doExtendChaining(a.allExtends,a.allExtends)),this.allExtendsStack=[a.allExtends],this._visitor.visit(a)):a},doExtendChaining:function(a,b,d){var e,f,g,h,i,j,k,l,m=[],n=this;for(d=d||0,e=0;a.length>e;e++)for(f=0;b.length>f;f++)j=a[e],k=b[f],j.parent_ids.indexOf(k.object_id)>=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&j.selfSelectors.forEach(function(a){h=n.extendSelector(g,i,a),l=new c.Extend(k.selector,k.option,0),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))}));if(m.length){if(this.extendChainCount++,d>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,d+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,c,d,e,f=this.allExtendsStack[this.allExtendsStack.length-1],g=[],h=this;for(d=0;f.length>d;d++)for(c=0;a.paths.length>c;c++)if(e=a.paths[c],!a.extendOnEveryPath){var i=e[e.length-1].extendList;i&&i.length||(b=this.findMatch(f[d],e),b.length&&f[d].selfSelectors.forEach(function(a){g.push(h.extendSelector(b,e,a))}))}a.paths=a.paths.concat(g)}},findMatch:function(a,b){var c,d,e,f,g,h,i,j=this,k=a.selector.elements,l=[],m=[];for(c=0;b.length>c;c++)for(d=b[c],e=0;d.elements.length>e;e++)for(f=d.elements[e],(a.allowBefore||0===c&&0===e)&&l.push({pathIndex:c,index:e,matched:0,initialCombinator:f.combinator}),h=0;l.length>h;h++)i=l[h],g=f.combinator.value,""===g&&0===e&&(g=" "),!j.isElementValuesEqual(k[i.matched].value,f.value)||i.matched>0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(d.elements.length>e+1||b.length>c+1)&&(i=null)),i?i.finished&&(i.length=k.length,i.endPathIndex=c,i.endPathElementIndex=e+1,l.length=0,m.push(i)):(l.splice(h,1),h--);return m},isElementValuesEqual:function(a,b){if("string"==typeof a||"string"==typeof b)return a===b;if(a instanceof c.Attribute)return a.op!==b.op||a.key!==b.key?!1:a.value&&b.value?(a=a.value.value||a.value,b=b.value.value||b.value,a===b):a.value||b.value?!1:!0;if(a=a.value,b=b.value,a instanceof c.Selector){if(!(b instanceof c.Selector)||a.elements.length!==b.elements.length)return!1;for(var d=0;a.elements.length>d;d++){if(a.elements[d].combinator.value!==b.elements[d].combinator.value&&(0!==d||(a.elements[d].combinator.value||" ")!==(b.elements[d].combinator.value||" ")))return!1;if(!this.isElementValuesEqual(a.elements[d].value,b.elements[d].value))return!1}return!0}return!1},extendSelector:function(a,b,d){var e,f,g,h,i,j=0,k=0,l=[];for(e=0;a.length>e;e++)h=a[e],f=b[h.pathIndex],g=new c.Element(h.initialCombinator,d.elements[0].value,d.elements[0].index,d.elements[0].currentFileInfo),h.pathIndex>j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(b[j].elements.slice(k)),k=0,j++),i=f.elements.slice(k,h.index).concat([g]).concat(d.elements.slice(1)),j===h.pathIndex&&e>0?l[l.length-1].elements=l[l.length-1].elements.concat(i):(l=l.concat(b.slice(j,h.pathIndex)),l.push(new c.Selector(i))),j=h.endPathIndex,k=h.endPathElementIndex,k>=b[j].elements.length&&(k=0,j++);return b.length>j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(b[j].elements.slice(k)),j++),l=l.concat(b.slice(j,b.length))},visitRulesetOut:function(){},visitMedia:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}},b.exports=f},{"../tree":59,"./visitor":87}],82:[function(a,b){function c(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}c.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},c.prototype.addVariableImport=function(a){this.variableImports.push(a)},c.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return;this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},b.exports=c},{}],83:[function(a,b){var c=a("../contexts"),d=a("./visitor"),e=a("./import-sequencer"),f=function(a,b){this._visitor=new d(this),this._importer=a,this._finish=b,this.context=new c.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new e(this._onSequencerEmpty.bind(this))};f.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var d=a.options.inline;if(!a.css||d){var e=new c.Eval(this.context,this.context.frames.slice(0)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.index,f.filename=a.currentFileInfo.filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;c.rules.length>h;h++)if(c.rules[h]===a){c.rules[h]=d;break}var i=this.onImported.bind(this,d,b),j=this._sequencer.addImport(i);this._importer.push(d.getPath(),g,d.currentFileInfo,d.options,j)}},onImported:function(a,b,c,d,e,f){c&&(c.filename||(c.index=a.index,c.filename=a.currentFileInfo.filename),this.error=c);var g=this,h=a.options.inline,i=e||f in g.recursionDetector;if(b.importMultiple||(a.skip=i?!0:function(){return f in g.onceFileDetectionMap?!0:(g.onceFileDetectionMap[f]=!0,!1)}),d&&(a.root=d,a.importedFilename=f,!h&&(b.importMultiple||!i))){g.recursionDetector[f]=!0;var j=this.context;this.context=b;try{this._visitor.visit(d)}catch(c){this.error=c}this.context=j}g.importCount--,g.isFinished&&g._sequencer.tryRun()},visitRule:function(a,b){b.visitDeeper=!1},visitDirective:function(a){this.context.frames.unshift(a)},visitDirectiveOut:function(){this.context.frames.shift()},visitMixinDefinition:function(a){this.context.frames.unshift(a)},visitMixinDefinitionOut:function(){this.context.frames.shift()},visitRuleset:function(a){this.context.frames.unshift(a)},visitRulesetOut:function(){this.context.frames.shift()},visitMedia:function(a){this.context.frames.unshift(a.rules[0])},visitMediaOut:function(){this.context.frames.shift()}},b.exports=f},{"../contexts":10,"./import-sequencer":82,"./visitor":87}],84:[function(a,b){var c={Visitor:a("./visitor"),ImportVisitor:a("./import-visitor"),ExtendVisitor:a("./extend-visitor"),JoinSelectorVisitor:a("./join-selector-visitor"),ToCSSVisitor:a("./to-css-visitor")};b.exports=c},{"./extend-visitor":81,"./import-visitor":83,"./join-selector-visitor":85,"./to-css-visitor":86,"./visitor":87}],85:[function(a,b){var c=a("./visitor"),d=function(){this.contexts=[[]],this._visitor=new c(this)};d.prototype={run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){var b,c=this.contexts[this.contexts.length-1],d=[];this.contexts.push(d),a.root||(b=a.selectors,b&&(b=b.filter(function(a){return a.getIsOutput()}),a.selectors=b.length?b:b=null,b&&a.joinSelectors(d,c,b)),b||(a.rules=null),a.paths=d)},visitRulesetOut:function(){this.contexts.length=this.contexts.length-1},visitMedia:function(a){var b=this.contexts[this.contexts.length-1];a.rules[0].root=0===b.length||b[0].multiMedia}},b.exports=d},{"./visitor":87}],86:[function(a,b){var c=a("../tree"),d=a("./visitor"),e=function(a){this._visitor=new d(this),this._context=a};e.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a){return a.variable?void 0:a},visitMixinDefinition:function(a){a.frames=[]},visitExtend:function(){},visitComment:function(a){return a.isSilent(this._context)?void 0:a},visitMedia:function(a,b){return a.accept(this._visitor),b.visitDeeper=!1,a.rules.length?a:void 0},visitDirective:function(a){if(!a.currentFileInfo.reference||a.isReferenced){if("@charset"===a.name){if(this.charset){if(a.debugInfo){var b=new c.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return b.debugInfo=a.debugInfo,this._visitor.visit(b)}return}this.charset=!0}return a.rules&&a.rules.rules&&this._mergeRules(a.rules.rules),a}},checkPropertiesInRoot:function(a){for(var b,d=0;a.length>d;d++)if(b=a[d],b instanceof c.Rule&&!b.variable)throw{message:"properties must be inside selector blocks, they cannot be in the root.",index:b.index,filename:b.currentFileInfo?b.currentFileInfo.filename:null}},visitRuleset:function(a,b){var d,e=[];if(a.firstRoot&&this.checkPropertiesInRoot(a.rules),a.root)a.accept(this._visitor),b.visitDeeper=!1,(a.firstRoot||a.rules&&a.rules.length>0)&&e.splice(0,0,a);else{a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new c.Combinator("")),b=0;a.length>b;b++)if(a[b].getIsReferenced()&&a[b].getIsOutput())return!0;return!1}));for(var f=a.rules,g=f?f.length:0,h=0;g>h;)d=f[h],d&&d.rules?(e.push(this._visitor.visit(d)),f.splice(h,1),g--):h++;g>0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1,f=a.rules,f&&(this._mergeRules(f),f=a.rules),f&&(this._removeDuplicateRules(f),f=a.rules),f&&f.length>0&&a.paths.length>0&&e.splice(0,0,a)}return 1===e.length?e[0]:e},_removeDuplicateRules:function(a){if(a){var b,d,e,f={};for(e=a.length-1;e>=0;e--)if(d=a[e],d instanceof c.Rule)if(f[d.name]){b=f[d.name],b instanceof c.Rule&&(b=f[d.name]=[f[d.name].toCSS(this._context)]);var g=d.toCSS(this._context);-1!==b.indexOf(g)?a.splice(e,1):b.push(g)}else f[d.name]=d}},_mergeRules:function(a){if(a){for(var b,d,e,f={},g=0;a.length>g;g++)d=a[g],d instanceof c.Rule&&d.merge&&(e=[d.name,d.important?"!":""].join(","),f[e]?a.splice(g--,1):f[e]=[],f[e].push(d));Object.keys(f).map(function(a){function e(a){return new c.Expression(a.map(function(a){return a.value}))}function g(a){return new c.Value(a.map(function(a){return a}))}if(b=f[a],b.length>1){d=b[0];var h=[],i=[];b.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),d.value=g(h)}})}}},b.exports=e},{"../tree":59,"./visitor":87}],87:[function(a,b){function c(a){return a}function d(a,b){var c,e;for(c in a)if(a.hasOwnProperty(c))switch(e=a[c],typeof e){case"function":e.prototype&&e.prototype.type&&(e.prototype.typeIndex=b++);break;case"object":b=d(e,b)}return b}var e=a("../tree"),f={visitDeeper:!0},g=!1,h=function(a){this._implementation=a,this._visitFnCache=[],g||(d(e,1),g=!0)};h.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a;var d,e=this._visitFnCache,g=this._implementation,h=b<<1,i=1|h,j=e[h],k=e[i],l=f;if(l.visitDeeper=!0,j||(d="visit"+a.type,j=g[d]||c,k=g[d+"Out"]||c,e[h]=j,e[i]=k),j!==c){var m=j.call(g,a,l);g.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=c&&k.call(g,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;d>c;c++)this.visit(a[c]);return a}var e=[];for(c=0;d>c;c++){var f=this.visit(a[c]);void 0!==f&&(f.splice?f.length&&this.flatten(f,e):e.push(f))}return e},flatten:function(a,b){b||(b=[]);var c,d,e,f,g,h;for(d=0,c=a.length;c>d;d++)if(e=a[d],void 0!==e)if(e.splice)for(g=0,f=e.length;f>g;g++)h=e[g],void 0!==h&&(h.splice?h.length&&this.flatten(h,b):b.push(h));else b.push(e);return b}},b.exports=h},{"../tree":59}],88:[function(a,b){function c(){}var d=b.exports={};d.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.MutationObserver,c="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};var d=[];if(b){var e=document.createElement("div"),f=new MutationObserver(function(){var a=d.slice();d.length=0,a.forEach(function(a){a()})});return f.observe(e,{attributes:!0}),function(a){d.length||e.setAttribute("yes","no"),d.push(a)}}return c?(window.addEventListener("message",function(a){var b=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),d.length>0)){var c=d.shift();c()}},!0),function(a){d.push(a),window.postMessage("process-tick","*")}):function(a){setTimeout(a,0)}}(),d.title="browser",d.browser=!0,d.env={},d.argv=[],d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(){throw new Error("process.chdir is not supported")}},{}],89:[function(a,b){"use strict";function c(a){function b(a){return null===i?void k.push(a):void f(function(){var b=i?a.onFulfilled:a.onRejected;if(null===b)return void(i?a.resolve:a.reject)(j);var c;try{c=b(j)}catch(d){return void a.reject(d)}a.resolve(c)})}function c(a){try{if(a===l)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var b=a.then;if("function"==typeof b)return void e(b.bind(a),c,g)}i=!0,j=a,h()}catch(d){g(d)}}function g(a){i=!1,j=a,h()}function h(){for(var a=0,c=k.length;c>a;a++)b(k[a]);k=null}if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");var i=null,j=null,k=[],l=this;this.then=function(a,c){return new l.constructor(function(e,f){b(new d(a,c,e,f))})},e(a,c,g)}function d(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function e(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var f=a("asap");b.exports=c},{asap:91}],90:[function(a,b){"use strict";function c(a){this.then=function(b){return"function"!=typeof b?this:new d(function(c,d){e(function(){try{c(b(a))}catch(e){d(e)}})})}}var d=a("./core.js"),e=a("asap");b.exports=d,c.prototype=d.prototype;var f=new c(!0),g=new c(!1),h=new c(null),i=new c(void 0),j=new c(0),k=new c("");d.resolve=function(a){if(a instanceof d)return a;if(null===a)return h;if(void 0===a)return i;if(a===!0)return f;if(a===!1)return g;if(0===a)return j;if(""===a)return k;if("object"==typeof a||"function"==typeof a)try{var b=a.then;if("function"==typeof b)return new d(b.bind(a))}catch(e){return new d(function(a,b){b(e)})}return new c(a) -},d.all=function(a){var b=Array.prototype.slice.call(a);return new d(function(a,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}b[f]=g,0===--e&&a(b)}catch(i){c(i)}}if(0===b.length)return a([]);for(var e=b.length,f=0;b.length>f;f++)d(f,b[f])})},d.reject=function(a){return new d(function(b,c){c(a)})},d.race=function(a){return new d(function(b,c){a.forEach(function(a){d.resolve(a).then(b,c)})})},d.prototype["catch"]=function(a){return this.then(null,a)}},{"./core.js":89,asap:91}],91:[function(a,b){(function(a){function c(){for(;e.next;){e=e.next;var a=e.task;e.task=void 0;var b=e.domain;b&&(e.domain=void 0,b.enter());try{a()}catch(d){if(i)throw b&&b.exit(),setTimeout(c,0),b&&b.enter(),d;setTimeout(function(){throw d},0)}b&&b.exit()}g=!1}function d(b){f=f.next={task:b,domain:i&&a.domain,next:null},g||(g=!0,h())}var e={task:void 0,next:null},f=e,g=!1,h=void 0,i=!1;if("undefined"!=typeof a&&a.nextTick)i=!0,h=function(){a.nextTick(c)};else if("function"==typeof setImmediate)h="undefined"!=typeof window?setImmediate.bind(window,c):function(){setImmediate(c)};else if("undefined"!=typeof MessageChannel){var j=new MessageChannel;j.port1.onmessage=c,h=function(){j.port2.postMessage(0)}}else h=function(){setTimeout(c,0)};b.exports=d}).call(this,a("_process"))},{_process:88}],92:[function(){"function"!=typeof Promise.prototype.done&&(Promise.prototype.done=function(){var a=arguments.length?this.then.apply(this,arguments):this;a.then(null,function(a){setTimeout(function(){throw a},0)})})},{}],"promise/polyfill.js":[function(a){a("asap");"undefined"==typeof Promise&&(Promise=a("./lib/core.js"),a("./lib/es6-extensions.js")),a("./polyfill-done.js")},{"./lib/core.js":89,"./lib/es6-extensions.js":90,"./polyfill-done.js":92,asap:91}]},{},[2])(2)}); \ No newline at end of file +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(a,b){c(b,d.currentScript(a)),void 0===b.isFileProtocol&&(b.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(a.location.protocol)),b.async=b.async||!1,b.fileAsync=b.fileAsync||!1,b.poll=b.poll||(b.isFileProtocol?1e3:1500),b.env=b.env||("127.0.0.1"==a.location.hostname||"0.0.0.0"==a.location.hostname||"localhost"==a.location.hostname||a.location.port&&a.location.port.length>0||b.isFileProtocol?"development":"production");var e=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);e&&(b.dumpLineNumbers=e[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":9}],2:[function(a,b){a("promise/polyfill.js");var c=window.less||{};a("./add-default-options")(window,c);var d=b.exports=a("./index")(window,c);c.onReady&&(/!watch/.test(window.location.hash)&&d.watch(),d.pageLoadFinished=d.registerStylesheets().then(function(){return d.refresh("development"===d.env)}))},{"./add-default-options":1,"./index":7,"promise/polyfill.js":void 0}],3:[function(a,b){var c=a("./utils");b.exports={createCSS:function(a,b,d){var e=d.href||"",f="less:"+(d.title||c.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),d.media&&i.setAttribute("media",d.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=d&&d.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":9}],4:[function(a,b){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,e),d.setItem(a+":timestamp",b)}catch(f){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b){var c=d&&d.getItem(a),e=d&&d.getItem(a+":timestamp");return e&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(e).valueOf()?c:void 0}}}},{}],5:[function(a,b){var c=a("./utils"),d=a("./browser");b.exports=function(a,b,e){function f(b,f){var g,h,i="less-error-message:"+c.extractId(f||""),j='
  • {content}
  • ',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="

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

    in '+n+" ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.extract&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":

      "+l.join("")+"
    "),b.stack&&(b.extract||e.logLevel>=4)&&(h+="
    Stack Trace
    "+b.stack.split("\n").slice(1).join("
    ")),k.innerHTML=h,d.createCSS(a.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"}),k.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"===e.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(a,b){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?k(a,b):"function"==typeof e.errorReporting&&e.errorReporting("add",a,b):f(a,b)}function h(b){var d=a.document.getElementById("less-error-message:"+c.extractId(b));d&&d.parentNode.removeChild(d)}function i(){}function j(a){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?i(a):"function"==typeof e.errorReporting&&e.errorReporting("remove",a):h(a)}function k(a,c){var d="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,b,c){void 0!==a.extract[b]&&g.push(d.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.extract&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||e.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}return{add:g,remove:j}}},{"./browser":3,"./utils":9}],6:[function(a,b){b.exports=function(b,c){function d(){if(window.XMLHttpRequest&&!("file:"===window.location.protocol&&"ActiveXObject"in window))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return c.error("browser doesn't support AJAX."),null}}var e=a("../less/environment/abstract-file-manager.js"),f={},g=function(){};return g.prototype=new e,g.prototype.alwaysMakePathsAbsolute=function(){return!0},g.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},g.prototype.doXHR=function(a,e,f,g){function h(b,c,d){b.status>=200&&300>b.status?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var i=d(),j=b.isFileProtocol?b.fileAsync:b.async;"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),i.open("GET",a,j),i.setRequestHeader("Accept",e||"text/x-less, text/css; q=0.9, */*; q=0.5"),i.send(null),b.isFileProtocol&&!b.fileAsync?0===i.status||i.status>=200&&300>i.status?f(i.responseText):g(i.status,a):j?i.onreadystatechange=function(){4==i.readyState&&h(i,f,g)}:h(i,f,g)},g.prototype.supports=function(){return!0},g.prototype.clearFileCache=function(){f={}},g.prototype.loadFile=function(a,b,c,d,e){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&f[h])try{var i=f[h];e(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){e({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){f[h]=a,e(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){e({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},g}},{"../less/environment/abstract-file-manager.js":14}],7:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(e,f){function g(a){return f.postProcessor&&"function"==typeof f.postProcessor&&(a=f.postProcessor.call(a,a)||a),a}function h(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function i(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function j(a){for(var b,c=n.getElementsByTagName("style"),d=0;c.length>d;d++)if(b=c[d],b.type.match(u)){var e=h(f);e.modifyVars=a;var g=b.innerHTML||"";e.filename=n.location.href.replace(/#.*$/,""),o.render(g,e,i(function(a,b,c){b?s.add(b,"inline"):(a.type="text/css",a.styleSheet?a.styleSheet.cssText=c.css:a.innerHTML=c.css)},null,b))}}function k(a,b,d,e,i){function j(c){var f=c.contents,h=c.filename,i=c.webInfo,j={currentDirectory:r.getPath(h),filename:h,rootFilename:h,relativeUrls:k.relativeUrls};if(j.entryPath=j.currentDirectory,j.rootpath=k.rootpath||j.currentDirectory,i&&(i.remaining=e,!k.modifyVars)){var l=t.getCSS(h,i);if(!d&&l)return i.local=!0,void b(null,l,f,a,i,h)}s.remove(h),k.rootFileInfo=j,o.render(f,k,function(c,d){c?(c.href=h,b(c)):(d.css=g(d.css),k.modifyVars||t.setCSS(a.href,i.lastModified,d.css),b(null,d.css,f,a,i,h))})}var k=h(f);c(k,a),k.mime=a.type,i&&(k.modifyVars=i),r.loadFile(a.href,null,k,p,function(a,c){return a?void b(a):void j(c)})}function l(a,b,c){for(var d=0;o.sheets.length>d;d++)k(o.sheets[d],a,b,o.sheets.length-(d+1),c)}function m(){"development"===o.env&&(o.watchTimer=setInterval(function(){o.watchMode&&(r.clearFileCache(),l(function(a,b,c,f){a?s.add(a,a.href||f.href):b&&d.createCSS(e.document,b,f)}))},f.poll))}var n=e.document,o=a("../less")();b.exports=o,o.options=f;var p=o.environment,q=a("./file-manager")(f,o.logger),r=new q;p.addFileManager(r),o.FileManager=q,a("./log-listener")(o,f);var s=a("./error-reporting")(e,o,f),t=o.cache=f.cache||a("./cache")(e,f,o.logger);f.functions&&o.functions.functionRegistry.addMultiple(f.functions);var u=/^text\/(x-)?less$/;return o.watch=function(){return o.watchMode||(o.env="development",m()),this.watchMode=!0,!0},o.unwatch=function(){return clearInterval(o.watchTimer),this.watchMode=!1,!1},o.registerStylesheets=function(){return new Promise(function(a){var b=n.getElementsByTagName("link");o.sheets=[];for(var c=0;b.length>c;c++)("stylesheet/less"===b[c].rel||b[c].rel.match(/stylesheet/)&&b[c].type.match(u))&&o.sheets.push(b[c]);a()})},o.modifyVars=function(a){return o.refresh(!0,a,!1)},o.refresh=function(a,b,c){return(a||c)&&c!==!1&&r.clearFileCache(),new Promise(function(c,f){var g,h,i;g=h=new Date,l(function(a,b,j,k,l){return a?(s.add(a,a.href||k.href),void f(a)):(o.logger.info(l.local?"loading "+k.href+" from cache.":"rendered "+k.href+" successfully."),d.createCSS(e.document,b,k),o.logger.info("css for "+k.href+" generated in "+(new Date-h)+"ms"),0===l.remaining&&(i=new Date-g,o.logger.info("less has finished. css generated in "+i+"ms"),c({startTime:g,endTime:h,totalMilliseconds:i,sheets:o.sheets.length})),void(h=new Date))},a,b),j(b)})},o.refreshStyles=j,o}},{"../less":29,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./log-listener":8,"./utils":9}],8:[function(a,b){b.exports=function(a,b){var c=4,d=3,e=2,f=1;b.logLevel="undefined"!=typeof b.logLevel?b.logLevel:"development"===b.env?d:f,b.loggers||(b.loggers=[{debug:function(a){b.logLevel>=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;b.loggers.length>g;g++)a.logger.addListener(b.loggers[g])}},{}],9:[function(a,b){b.exports={extractId:function(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/[\?\&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")},addDataAttr:function(a,b){for(var c in b.dataset)if(b.dataset.hasOwnProperty(c))if("env"===c||"dumpLineNumbers"===c||"rootpath"===c||"errorReporting"===c)a[c]=b.dataset[c];else try{a[c]=JSON.parse(b.dataset[c])}catch(d){}}}},{}],10:[function(a,b){var c={};b.exports=c;var d=function(a,b,c){if(a)for(var d=0;c.length>d;d++)a.hasOwnProperty(c[d])&&(b[c[d]]=a[c[d]])},e=["paths","relativeUrls","rootpath","strictImports","insecure","dumpLineNumbers","compress","syncImport","chunkInput","mime","useFileCache","processImports","reference","pluginManager"];c.Parse=function(a){d(a,this,e),"string"==typeof this.paths&&(this.paths=[this.paths])};var f=["paths","compress","ieCompat","strictMath","strictUnits","sourceMap","importMultiple","urlArgs","javascriptEnabled","pluginManager","importantScope"];c.Eval=function(a,b){d(a,this,f),this.frames=b||[],this.importantScope=this.importantScope||[]},c.Eval.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},c.Eval.prototype.outOfParenthesis=function(){this.parensStack.pop()},c.Eval.prototype.isMathOn=function(){return this.strictMath?this.parensStack&&this.parensStack.length:!0},c.Eval.prototype.isPathRelative=function(a){return!/^(?:[a-z-]+:|\/)/i.test(a)},c.Eval.prototype.normalizePath=function(a){var b,c=a.split("/").reverse();for(a=[];0!==c.length;)switch(b=c.pop()){case".":break;case"..":0===a.length||".."===a[a.length-1]?a.push(b):a.pop();break;default:a.push(b)}return a.join("/")}},{}],11:[function(a,b){b.exports={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},{}],12:[function(a,b){b.exports={colors:a("./colors"),unitConversions:a("./unit-conversions")}},{"./colors":11,"./unit-conversions":13}],13:[function(a,b){b.exports={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}}},{}],14:[function(a,b){var c=function(){};c.prototype.getPath=function(a){var b=a.lastIndexOf("?");return b>0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),0>b&&(b=a.lastIndexOf("\\")),0>b?"":a.slice(0,b+1)},c.prototype.tryAppendLessExtension=function(a){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+".less"},c.prototype.supportsSync=function(){return!1},c.prototype.alwaysMakePathsAbsolute=function(){return!1},c.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\)/i.test(a)},c.prototype.join=function(a,b){return a?a+b:b},c.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;f.length-1>c;c++)i+="../";for(c=0;e.length-1>c;c++)i+=e[c]+"/";return i},c.prototype.extractUrlParts=function(a,b){var c,d,e=/^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i,f=a.match(e),g={},h=[];if(!f)throw new Error("Could not parse sheet href - '"+a+"'");if(b&&(!f[1]||f[2])){if(d=b.match(e),!d)throw new Error("Could not parse page url - '"+b+"'");f[1]=f[1]||d[1]||"",f[2]||(f[3]=d[3]+f[3])}if(f[3]){for(h=f[3].replace(/\\/g,"/").split("/"),c=0;h.length>c;c++)"."===h[c]&&(h.splice(c,1),c-=1);for(c=0;h.length>c;c++)".."===h[c]&&c>0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=c},{}],15:[function(a,b){var c=a("../logger"),d=function(a,b){this.fileManagers=b||[],a=a||{};for(var c=["encodeBase64","mimeLookup","charsetLookup","getSourceMapGenerator"],d=[],e=d.concat(c),f=0;e.length>f;f++){var g=e[f],h=a[g];h?this[g]=h.bind(a):d.length>f&&this.warn("missing required function in environment - "+g)}};d.prototype.getFileManager=function(a,b,d,e,f){a||c.warn("getFileManager called with no filename.. Please report this issue. continuing."),null==b&&c.warn("getFileManager called with null directory.. Please report this issue. continuing.");var g=this.fileManagers;d.pluginManager&&(g=[].concat(g).concat(d.pluginManager.getFileManagers()));for(var h=g.length-1;h>=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,d,e))return i}return null},d.prototype.addFileManager=function(a){this.fileManagers.push(a)},d.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=d},{"../logger":31}],16:[function(a){function b(a,b,d){var e,f,g,h,i=b.alpha,j=d.alpha,k=[];g=j+i*(1-j);for(var l=0;3>l;l++)e=b.rgb[l]/255,f=d.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new c(k,g)}var c=a("../tree/color"),d=a("./function-registry"),e={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?e.multiply(a,b):e.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return e.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var f in e)e.hasOwnProperty(f)&&(b[f]=b.bind(null,e[f]));d.addMultiple(b)},{"../tree/color":47,"./function-registry":21}],17:[function(a){function b(a){return Math.min(1,Math.max(0,a))}function c(a){return f.hsla(a.h,a.s,a.l,a.a)}function d(a){if(a instanceof g)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function e(a,b){return a instanceof g&&a.unit.is("%")?parseFloat(a.value*b/100):d(a)}var f,g=a("../tree/dimension"),h=a("../tree/color"),i=a("../tree/quoted"),j=a("../tree/anonymous"),k=a("./function-registry");f={rgb:function(a,b,c){return f.rgba(a,b,c,1)},rgba:function(a,b,c,f){var g=[a,b,c].map(function(a){return e(a,255)});return f=d(f),new h(g,f)},hsl:function(a,b,c){return f.hsla(a,b,c,1)},hsla:function(a,c,e,g){function h(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?j+(i-j)*a*6:1>2*a?i:2>3*a?j+(i-j)*(2/3-a)*6:j}a=d(a)%360/360,c=b(d(c)),e=b(d(e)),g=b(d(g));var i=.5>=e?e*(c+1):e+c-e*c,j=2*e-i;return f.rgba(255*h(a+1/3),255*h(a),255*h(a-1/3),g)},hsv:function(a,b,c){return f.hsva(a,b,c,1)},hsva:function(a,b,c,e){a=d(a)%360/360*360,b=d(b),c=d(c),e=d(e);var g,h;g=Math.floor(a/60%6),h=a/60-g;var i=[c,c*(1-b),c*(1-h*b),c*(1-(1-h)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return f.rgba(255*i[j[g][0]],255*i[j[g][1]],255*i[j[g][2]],e)},hue:function(a){return new g(a.toHSL().h)},saturation:function(a){return new g(100*a.toHSL().s,"%")},lightness:function(a){return new g(100*a.toHSL().l,"%")},hsvhue:function(a){return new g(a.toHSV().h)},hsvsaturation:function(a){return new g(100*a.toHSV().s,"%")},hsvvalue:function(a){return new g(100*a.toHSV().v,"%")},red:function(a){return new g(a.rgb[0])},green:function(a){return new g(a.rgb[1])},blue:function(a){return new g(a.rgb[2])},alpha:function(a){return new g(a.toHSL().a)},luma:function(a){return new g(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new g(b*a.alpha*100,"%")},saturate:function(a,d){if(!a.rgb)return null;var e=a.toHSL();return e.s+=d.value/100,e.s=b(e.s),c(e)},desaturate:function(a,d){var e=a.toHSL();return e.s-=d.value/100,e.s=b(e.s),c(e)},lighten:function(a,d){var e=a.toHSL();return e.l+=d.value/100,e.l=b(e.l),c(e)},darken:function(a,d){var e=a.toHSL();return e.l-=d.value/100,e.l=b(e.l),c(e)},fadein:function(a,d){var e=a.toHSL();return e.a+=d.value/100,e.a=b(e.a),c(e)},fadeout:function(a,d){var e=a.toHSL();return e.a-=d.value/100,e.a=b(e.a),c(e)},fade:function(a,d){var e=a.toHSL();return e.a=d.value/100,e.a=b(e.a),c(e)},spin:function(a,b){var d=a.toHSL(),e=(d.h+b.value)%360;return d.h=0>e?360+e:e,c(d)},mix:function(a,b,c){c||(c=new g(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,i=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,j=1-i,k=[a.rgb[0]*i+b.rgb[0]*j,a.rgb[1]*i+b.rgb[1]*j,a.rgb[2]*i+b.rgb[2]*j],l=a.alpha*d+b.alpha*(1-d);return new h(k,l)},greyscale:function(a){return f.desaturate(a,new g(100))},contrast:function(a,b,c,e){if(!a.rgb)return null;if("undefined"==typeof c&&(c=f.rgba(255,255,255,1)),"undefined"==typeof b&&(b=f.rgba(0,0,0,1)),b.luma()>c.luma()){var g=c;c=b,b=g}return e="undefined"==typeof e?.43:d(e),a.luma()=t&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+s.length+" characters) exceeds IE8-safe "+t+" characters!"),f(this,e||a)):new d(new c('"'+s+'"',s,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":31,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],19:[function(a,b){var c=a("../tree/keyword"),d=a("./function-registry"),e={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?c.True:c.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};d.add("default",e.eval.bind(e)),b.exports=e},{"../tree/keyword":62,"./function-registry":21}],20:[function(a,b){var c=a("./function-registry"),d=function(a,b,d,e){this.name=a.toLowerCase(),this.func=c.get(this.name),this.index=d,this.context=b,this.currentFileInfo=e};d.prototype.isValid=function(){return Boolean(this.func)},d.prototype.call=function(a){return this.func.apply(this,a)},b.exports=d},{"./function-registry":21}],21:[function(a,b){b.exports={_data:{},add:function(a,b){this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(a){return this._data[a]}}},{}],22:[function(a,b){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":17,"./color-blending":16,"./data-uri":18,"./default":19,"./function-caller":20,"./function-registry":21,"./math":23,"./number":24,"./string":25,"./svg":26,"./types":27}],23:[function(a){function b(a,b,d){if(!(d instanceof c))throw{type:"Argument",message:"argument must be a number"};return null==b?b=d.unit:d=d.unify(),new c(a(parseFloat(d.value)),b)}var c=a("../tree/dimension"),d=a("./function-registry"),e={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var f in e)e.hasOwnProperty(f)&&(e[f]=b.bind(null,Math[f],e[f]));e.round=function(a,c){var d="undefined"==typeof c?0:c.value;return b(function(a){return a.toFixed(d)},null,a)},d.addMultiple(e)},{"../tree/dimension":53,"./function-registry":21}],24:[function(a){var b=a("../tree/dimension"),c=a("../tree/anonymous"),d=a("./function-registry"),e=function(a,d){switch(d=Array.prototype.slice.call(d),d.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var e,f,g,h,i,j,k,l,m=[],n={};for(e=0;d.length>e;e++)if(g=d[e],g instanceof b)if(h=""===g.unit.toString()&&void 0!==l?new b(g.value,l).unify():g.unify(),j=""===h.unit.toString()&&void 0!==k?k:h.unit.toString(),k=""!==j&&void 0===k||""!==j&&""===m[0].unify().unit.toString()?j:k,l=""!==j&&void 0===l?g.unit.toString():l,f=void 0!==n[""]&&""!==j&&j===k?n[""]:n[j],void 0!==f)i=""===m[f].unit.toString()&&void 0!==l?new b(m[f].value,l).unify():m[f].unify(),(a&&i.value>h.value||!a&&h.value>i.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(d[e].value)&&Array.prototype.push.apply(d,Array.prototype.slice.call(d[e].value));return 1==m.length?m[0]:(d=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new c((a?"min":"max")+"("+d+")"))};d.addMultiple({min:function(){return e(!0,arguments)},max:function(){return e(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new b(Math.PI)},mod:function(a,c){return new b(a.value%c.value,a.unit)},pow:function(a,c){if("number"==typeof a&&"number"==typeof c)a=new b(a),c=new b(c);else if(!(a instanceof b&&c instanceof b))throw{type:"Argument",message:"arguments must be numbers"};return new b(Math.pow(a.value,c.value),a.unit)},percentage:function(a){return new b(100*a.value,"%")}})},{"../tree/anonymous":43,"../tree/dimension":53,"./function-registry":21}],25:[function(a){var b=a("../tree/quoted"),c=a("../tree/anonymous"),d=a("../tree/javascript"),e=a("./function-registry");e.addMultiple({e:function(a){return new c(a instanceof d?a.evaluated:a.value)},escape:function(a){return new c(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,c,d,e){var f=a.value;return f=f.replace(new RegExp(c.value,e?e.value:""),d.value),new b(a.quote||"",f,a.escaped)},"%":function(a){for(var c=Array.prototype.slice.call(arguments,1),d=a.value,e=0;c.length>e;e++)d=d.replace(/%[sda]/i,function(a){var b=a.match(/s/i)?c[e].value:c[e].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(b):b});return d=d.replace(/%%/g,"%"),new b(a.quote||"",d,a.escaped)}})},{"../tree/anonymous":43,"../tree/javascript":60,"../tree/quoted":70,"./function-registry":21}],26:[function(a,b){b.exports=function(){var b=a("../tree/dimension"),c=a("../tree/color"),d=a("../tree/expression"),e=a("../tree/quoted"),f=a("../tree/url"),g=a("./function-registry");g.add("svg-gradient",function(a){function g(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]"}}arguments.length<3&&g();var h,i,j,k,l,m,n,o=Array.prototype.slice.call(arguments,1),p="linear",q='x="0" y="0" width="1" height="1"',r={compress:!1},s=a.toCSS(r);switch(s){case"to bottom":h='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":h='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":h='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":h='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":p="radial",h='cx="50%" cy="50%" r="75%"',q='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(i='<'+p+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+h+">",j=0;o.length>j;j+=1)o[j]instanceof d?(k=o[j].value[0],l=o[j].value[1]):(k=o[j],l=void 0),k instanceof c&&((0===j||j+1===o.length)&&void 0===l||l instanceof b)||g(),m=l?l.toCSS(r):0===j?"0%":"100%",n=k.alpha,i+='n?' stop-opacity="'+n+'"':"")+"/>";return i+="',i=encodeURIComponent(i),i="data:image/svg+xml,"+i,new f(new e("'"+i+"'",i,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":47,"../tree/dimension":53,"../tree/expression":56,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],27:[function(a){var b=a("../tree/keyword"),c=a("../tree/detached-ruleset"),d=a("../tree/dimension"),e=a("../tree/color"),f=a("../tree/quoted"),g=a("../tree/anonymous"),h=a("../tree/url"),i=a("../tree/operation"),j=a("./function-registry"),k=function(a,c){return a instanceof c?b.True:b.False},l=function(a,c){if(void 0===c)throw{type:"Argument",message:"missing the required second argument to isunit."}; +if(c="string"==typeof c.value?c.value:c,"string"!=typeof c)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof d&&a.unit.is(c)?b.True:b.False};j.addMultiple({isruleset:function(a){return k(a,c)},iscolor:function(a){return k(a,e)},isnumber:function(a){return k(a,d)},isstring:function(a){return k(a,f)},iskeyword:function(a){return k(a,b)},isurl:function(a){return k(a,h)},ispixel:function(a){return l(a,"px")},ispercentage:function(a){return l(a,"%")},isem:function(a){return l(a,"em")},isunit:l,unit:function(a,c){if(!(a instanceof d))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof i?". Have you forgotten parenthesis?":"")};return c=c?c instanceof b?c.value:c.toCSS():"",new d(a.value,c)},"get-unit":function(a){return new g(a.unit)},extract:function(a,b){return b=b.value-1,Array.isArray(a.value)?a.value[b]:Array(a)[b]},length:function(a){var b=Array.isArray(a.value)?a.value.length:1;return new d(b)}})},{"../tree/anonymous":43,"../tree/color":47,"../tree/detached-ruleset":52,"../tree/dimension":53,"../tree/keyword":62,"../tree/operation":68,"../tree/quoted":70,"../tree/url":77,"./function-registry":21}],28:[function(a,b){var c=a("./contexts"),d=a("./parser/parser");b.exports=function(a){var b=function(a,b){this.rootFilename=b.filename,this.paths=a.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=a.mime,this.error=null,this.context=a,this.queue=[],this.files={}};return b.prototype.push=function(b,e,f,g,h){var i=this;this.queue.push(b);var j=function(a,c,d){i.queue.splice(i.queue.indexOf(b),1);var e=d===i.rootFilename;g.optional&&a?h(null,{rules:[]},!1,null):(i.files[d]=c,a&&!i.error&&(i.error=a),h(a,c,e,d))},k={relativeUrls:this.context.relativeUrls,entryPath:f.entryPath,rootpath:f.rootpath,rootFilename:f.rootFilename},l=a.getFileManager(b,f.currentDirectory,this.context,a);if(!l)return void j({message:"Could not find a file-manager for "+b});e&&(b=l.tryAppendLessExtension(b));var m=function(a){var b=a.filename,e=a.contents.replace(/^\uFEFF/,"");k.currentDirectory=l.getPath(b),k.relativeUrls&&(k.rootpath=l.join(i.context.rootpath||"",l.pathDiff(k.currentDirectory,k.entryPath)),!l.isPathAbsolute(k.rootpath)&&l.alwaysMakePathsAbsolute()&&(k.rootpath=l.join(k.entryPath,k.rootpath))),k.filename=b;var h=new c.Parse(i.context);h.processImports=!1,i.contents[b]=e,(f.reference||g.reference)&&(k.reference=!0),g.inline?j(null,e,b):new d(h,i,k).parse(e,function(a,c){j(a,c,b)})},n=l.loadFile(b,f.currentDirectory,this.context,a,function(a,b){a?j(a):m(b)});n&&n.then(m,j)},b}},{"./contexts":10,"./parser/parser":36}],29:[function(a,b){b.exports=function(b,c){var d,e,f,g,h,i={version:[2,3,0],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")};return i}},{"./contexts":10,"./data":12,"./environment/abstract-file-manager":14,"./environment/environment":15,"./functions":22,"./import-manager":28,"./less-error":30,"./logger":31,"./parse":33,"./parse-tree":32,"./parser/parser":36,"./plugin-manager":37,"./render":38,"./source-map-builder":39,"./source-map-output":40,"./transform-tree":41,"./tree":59,"./utils":80,"./visitors":84}],30:[function(a,b){var c=a("./utils"),d=b.exports=function(a,b,d){Error.call(this);var e=a.filename||d;if(b&&e){var f=b.contents[e],g=c.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&c.getLocation(a.call,f).line,k=f.split("\n");this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.callLine=j+1,this.callExtract=k[j],this.column=i,this.extract=[k[h-1],k[h],k[h+1]]}this.message=a.message,this.stack=a.stack};if("undefined"==typeof Object.create){var e=function(){};e.prototype=Error.prototype,d.prototype=new e}else d.prototype=Object.create(Error.prototype);d.prototype.constructor=d},{"./utils":80}],31:[function(a,b){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;this._listeners.length>b;b++)if(this._listeners[b]===a)return void this._listeners.splice(b,1)},_fireEvent:function(a,b){for(var c=0;this._listeners.length>c;c++){var d=this._listeners[c][a];d&&d(b)}},_listeners:[]}},{}],32:[function(a,b){var c=a("./less-error"),d=a("./transform-tree"),e=a("./logger");b.exports=function(a){var b=function(a,b){this.root=a,this.imports=b};return b.prototype.toCSS=function(b){var f,g,h={};try{f=d(this.root,b)}catch(i){throw new c(i,this.imports)}try{var j=Boolean(b.compress);j&&e.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");var k={compress:j,dumpLineNumbers:b.dumpLineNumbers,strictUnits:Boolean(b.strictUnits),numPrecision:8};b.sourceMap?(g=new a(b.sourceMap),h.css=g.toCSS(f,k,this.imports)):h.css=f.toCSS(k)}catch(i){throw new c(i,this.imports)}if(b.pluginManager)for(var l=b.pluginManager.getPostProcessors(),m=0;l.length>m;m++)h.css=l[m].process(h.css,{sourceMap:g,options:b,imports:this.imports});b.sourceMap&&(h.map=g.getExternalSourceMap()),h.imports=[];for(var n in this.imports.files)this.imports.files.hasOwnProperty(n)&&n!==this.imports.rootFilename&&h.imports.push(n);return h},b}},{"./less-error":30,"./logger":31,"./transform-tree":41}],33:[function(a,b){var c="undefined"==typeof Promise?a("promise"):Promise,d=a("./contexts"),e=a("./parser/parser"),f=a("./plugin-manager");b.exports=function(a,b,g){var h=function(a,b,i){if(b=b||{},"function"==typeof b&&(i=b,b={}),!i){var j=this;return new c(function(c,d){h.call(j,a,b,function(a,b){a?d(a):c(b)})})}var k,l,m=new f(this);if(m.addPlugins(b.plugins),b.pluginManager=m,k=new d.Parse(b),b.rootFileInfo)l=b.rootFileInfo;else{var n=b.filename||"input",o=n.replace(/[^\/\\]*$/,"");l={filename:n,relativeUrls:k.relativeUrls,rootpath:k.rootpath||"",currentDirectory:o,entryPath:o,rootFilename:n},l.rootpath&&"/"!==l.rootpath.slice(-1)&&(l.rootpath+="/")}var p=new g(k,l);new e(k,p,l).parse(a,function(a,c){return a?i(a):void i(null,c,p,b)},b)};return h}},{"./contexts":10,"./parser/parser":36,"./plugin-manager":37,promise:void 0}],34:[function(a,b){b.exports=function(a,b){function c(b){var c=h-q;512>c&&!b||!c||(p.push(a.slice(q,h+1)),q=h+1)}var d,e,f,g,h,i,j,k,l,m=a.length,n=0,o=0,p=[],q=0;for(h=0;m>h;h++)if(j=a.charCodeAt(h),!(j>=97&&122>=j||34>j))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(m-1>h){h++;continue}return b("unescaped `\\`",h);case 34:case 39:case 96:for(l=0,i=h,h+=1;m>h;h++)if(k=a.charCodeAt(h),!(k>96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;m>h&&(k=a.charCodeAt(h),!(13>=k)||10!=k&&13!=k);h++);else if(42==k){for(f=i=h,h+=2;m-1>h&&(k=a.charCodeAt(h),125==k&&(g=h),42!=k||47!=a.charCodeAt(h+1));h++);if(h==m-1)return b("missing closing `*/`",i);h++}continue;case 42:if(m-1>h&&47==a.charCodeAt(h+1))return b("unmatched `/*`",h);continue}return 0!==n?f>d&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],35:[function(a,b){var c=a("./chunker");b.exports=function(){function a(){k.i>i&&(h=h.slice(k.i-i),i=k.i)}var b,d,e,f,g,h,i,j=[],k={};k.save=function(){i=k.i,j.push({current:h,i:k.i,j:d})},k.restore=function(a){(k.i>e||k.i===e&&a&&!f)&&(e=k.i,f=a);var b=j.pop();h=b.current,i=k.i=b.i,d=b.j},k.forget=function(){j.pop()},k.isWhitespace=function(a){var c=k.i+(a||0),d=b.charCodeAt(c);return d===l||d===o||d===m||d===n},k.$=function(c){var d,e,f=typeof c;return"string"===f?b.charAt(k.i)!==c?null:(t(1),c):(a(),(d=c.exec(h))?(e=d[0].length,t(e),"string"==typeof d?d:1===d.length?d[0]:d):null)},k.$re=function(a){k.i>i&&(h=h.slice(k.i-i),i=k.i);var b=a.exec(h);return b?(t(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null},k.$char=function(a){return b.charAt(k.i)!==a?null:(t(1),a)};var l=32,m=9,n=10,o=13,p=43,q=44,r=47,s=57;k.autoCommentAbsorb=!0,k.commentStore=[],k.finished=!1;var t=function(a){for(var c,e,f,j=k.i,p=d,q=k.i-i,s=k.i+h.length-q,u=k.i+=a,v=b;s>k.i;k.i++){if(c=v.charCodeAt(k.i),k.autoCommentAbsorb&&c===r){if(e=v.charAt(k.i+1),"/"===e){f={index:k.i,isLineComment:!0};var w=v.indexOf("\n",k.i+1);0>w&&(w=s),k.i=w,f.text=v.substr(f.i,k.i-f.i),k.commentStore.push(f);continue}if("*"===e){var x=v.substr(k.i),y=x.match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\//);if(y){f={index:k.i,text:y[0],isLineComment:!1},k.i+=f.text.length-1,k.commentStore.push(f);continue}}break}if(c!==l&&c!==n&&c!==m&&c!==o)break}if(h=h.slice(a+k.i-u+q),i=k.i,!h.length){if(g.length-1>d)return h=g[++d],t(0),!0;k.finished=!0}return j!==k.i||p!==d};return k.peek=function(a){return"string"==typeof a?b.charAt(k.i)===a:a.test(h)},k.peekChar=function(a){return b.charAt(k.i)===a},k.currentChar=function(){return b.charAt(k.i)},k.getInput=function(){return b},k.peekNotNumeric=function(){var a=b.charCodeAt(k.i);return a>s||p>a||a===r||a===q},k.start=function(a,f,j){b=a,k.i=d=i=e=0,g=f?c(a,j):[a],h=g[0],t(0)},k.end=function(){var a,c=k.i>=b.length;return e>k.i&&(a=f,k.i=e),{isFinished:c,furthest:k.i,furthestPossibleErrorMessage:a,furthestReachedEnd:k.i>=b.length-1,furthestChar:b[k.i]}},k}},{"./chunker":34}],36:[function(a,b){var c=a("../less-error"),d=a("../tree"),e=a("../visitors"),f=a("./parser-input"),g=a("../utils"),h=function i(a,b,h){function j(a,b){var c="[object Function]"===Object.prototype.toString.call(a)?a.call(n):o.$(a);return c?c:void l(b||("string"==typeof a?"expected '"+a+"' got '"+o.currentChar()+"'":"unexpected token"))}function k(a,b){return o.$char(a)?a:void l(b||"expected '"+a+"' got '"+o.currentChar()+"'")}function l(a,d){throw new c({index:o.i,filename:h.filename,type:d||"Syntax",message:a},b)}function m(a){var b=h.filename;return{lineNumber:g.getLocation(a,o.getInput()).line+1,fileName:b}}var n,o=f();return{parse:function(f,g,j){var k,l,m,n=null,p="";l=j&&j.globalVars?i.serializeVars(j.globalVars)+"\n":"",m=j&&j.modifyVars?"\n"+i.serializeVars(j.modifyVars):"",(l||j&&j.banner)&&(p=(j&&j.banner?j.banner:"")+l,b.contentsIgnoredChars[h.filename]=p.length),f=f.replace(/\r\n/g,"\n"),f=p+f.replace(/^\uFEFF/,"")+m,b.contents[h.filename]=f;try{o.start(f,a.chunkInput,function(a,d){throw c({index:d,type:"Parse",message:a,filename:h.filename},b)}),k=new d.Ruleset(null,this.parsers.primary()),k.root=!0,k.firstRoot=!0}catch(q){return g(new c(q,b,h.filename))}var r=o.end();if(!r.isFinished){var s=r.furthestPossibleErrorMessage;s||(s="Unrecognised input","}"===r.furthestChar?s+=". Possibly missing opening '{'":")"===r.furthestChar?s+=". Possibly missing opening '('":r.furthestReachedEnd&&(s+=". Possibly missing something")),n=new c({type:"Parse",message:s,index:r.furthest,filename:h.filename},b)}var t=function(a){return a=n||a||b.error,a?(a instanceof c||(a=new c(a,b,h.filename)),g(a)):g(null,k)};return a.processImports===!1?t():void new e.ImportVisitor(b,t).run(k)},parsers:n={primary:function(){for(var a,b=this.mixin,c=[];;){for(;;){if(a=this.comment(),!a)break;c.push(a)}if(o.finished)break;if(o.peek("}"))break;if(a=this.extendRule())c=c.concat(a);else if(a=b.definition()||this.rule()||this.ruleset()||b.call()||this.rulesetCall()||this.directive())c.push(a);else if(!o.$re(/^[\s\n]+/)&&!o.$re(/^;+/))break}return c},comment:function(){if(o.commentStore.length){var a=o.commentStore.shift();return new d.Comment(a.text,a.isLineComment,a.index,h)}},entities:{quoted:function(){var a,b=o.i;return a=o.$re(/^(~)?("((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)')/),a?new d.Quoted(a[2],a[3]||a[4],Boolean(a[1]),b,h):void 0},keyword:function(){var a=o.$re(/^%|^[_A-Za-z-][_A-Za-z0-9-]*/);return a?d.Color.fromKeyword(a)||new d.Keyword(a):void 0},call:function(){var a,b,c,e,f=o.i;if(!o.peek(/^url\(/i))return o.save(),(a=o.$re(/^([\w-]+|%|progid:[\w\.]+)\(/))?(a=a[1],b=a.toLowerCase(),"alpha"===b&&(e=n.alpha())?e:(c=this.arguments(),o.$char(")")?(o.forget(),new d.Call(a,c,f,h)):void o.restore("Could not parse call arguments or missing ')'"))):void o.forget()},arguments:function(){for(var a,b=[];;){if(a=this.assignment()||n.expression(),!a)break;if(b.push(a),!o.$char(","))break}return b},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return a=o.$re(/^\w+(?=\s?=)/i),a&&o.$char("=")?(b=n.entity(),b?new d.Assignment(a,b):void 0):void 0},url:function(){var a,b=o.i;return o.autoCommentAbsorb=!1,"u"===o.currentChar()&&o.$re(/^url\(/)?(a=this.quoted()||this.variable()||o.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",o.autoCommentAbsorb=!0,k(")"),new d.URL(null!=a.value||a instanceof d.Variable?a:new d.Anonymous(a),b,h)):void(o.autoCommentAbsorb=!0)},variable:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@@?[\w-]+/))?new d.Variable(a,b,h):void 0},variableCurly:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@\{([\w-]+)\}/))?new d.Variable("@"+a[1],b,h):void 0},color:function(){var a;if("#"===o.currentChar()&&(a=o.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||l("Invalid HEX color code"),new d.Color(a[1])}},dimension:function(){if(!o.peekNotNumeric()){var a=o.$re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/i);return a?new d.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;return a=o.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new d.UnicodeDescriptor(a[0]):void 0},javascript:function(){var a,b=o.i;return a=o.$re(/^(~)?`([^`]*)`/),a?new d.JavaScript(a[2],Boolean(a[1]),b,h):void 0}},variable:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*:/))?a[1]:void 0},rulesetCall:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*\(\s*\)\s*;/))?new d.RulesetCall(a[1]):void 0},extend:function(a){var b,c,e,f,g,h=o.i;if(o.$re(a?/^&:extend\(/:/^:extend\(/)){do{for(e=null,b=null;!(e=o.$re(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];e=e&&e[1],b||l("Missing target selector for :extend()."),g=new d.Extend(new d.Selector(b),e,h),f?f.push(g):f=[g]}while(o.$char(","));return j(/^\)/),a&&j(/^;/),f}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,c,e,f,g,i=o.currentChar(),j=!1,l=o.i;if("."===i||"#"===i){for(o.save();;){if(a=o.i,e=o.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!e)break;c=new d.Element(f,e,a,h),b?b.push(c):b=[c],f=o.$char(">")}return b&&(o.$char("(")&&(g=this.args(!0).args,k(")")),n.important()&&(j=!0),n.end())?(o.forget(),new d.mixin.Call(b,g,l,h,j)):void o.restore()}},args:function(a){var b,c,e,f,g,h,i=n.entities,j={args:null,variadic:!1},k=[],m=[],p=[];for(o.save();;){if(a)h=n.detachedRuleset()||n.expression();else{if(o.commentStore.length=0,"."===o.currentChar()&&o.$re(/^\.{3}/)){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({variadic:!0});break}h=i.variable()||i.literal()||i.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var q=null;if(a?h.value&&1==h.value.length&&(q=h.value[0]):q=h,q&&q instanceof d.Variable)if(o.$char(":")){if(k.length>0&&(b&&l("Cannot mix ; and , as delimiter types"),c=!0),g=a&&n.detachedRuleset()||n.expression(),!g){if(!a)return o.restore(),j.args=[],j;l("could not understand value for named argument")}f=e=q.name}else{if(!a&&o.$re(/^\.{3}/)){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({name:h.name,variadic:!0});break}a||(e=f=q.name,g=null)}g&&k.push(g),p.push({name:f,value:g}),o.$char(",")||(o.$char(";")||b)&&(c&&l("Cannot mix ; and , as delimiter types"),b=!0,k.length>1&&(g=new d.Value(k)),m.push({name:e,value:g}),e=null,k=[],c=!1)}return o.forget(),j.args=b?m:p,j},definition:function(){var a,b,c,e,f=[],g=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),b=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$re(/^when/)&&(e=j(n.conditions,"expected condition")),c=n.block())return o.forget(),new d.mixin.Definition(a,f,c,e,g);o.restore()}else o.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()},end:function(){return o.$char(";")||o.peek("}")},alpha:function(){var a;if(o.$re(/^opacity=/i))return a=o.$re(/^\d+/),a||(a=j(this.entities.variable,"Could not parse alpha")),k(")"),new d.Alpha(a)},element:function(){var a,b,c,e=o.i;return b=this.combinator(),a=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(),a||(o.save(),o.$char("(")?(c=this.selector())&&o.$char(")")?(a=new d.Paren(c),o.forget()):o.restore("Missing closing ')'"):o.forget()),a?new d.Element(b,a,e,h):void 0},combinator:function(){var a=o.currentChar();if("/"===a){o.save();var b=o.$re(/^\/[a-z]+\//i);if(b)return o.forget(),new d.Combinator(b);o.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(o.i++,"^"===a&&"^"===o.currentChar()&&(a="^^",o.i++);o.isWhitespace();)o.i++;return new d.Combinator(a)}return new d.Combinator(o.isWhitespace(-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(a){for(var b,c,e,f,g,i,k,m=o.i;(a&&(c=this.extend())||a&&(i=o.$re(/^when/))||(f=this.element()))&&(i?k=j(this.conditions,"expected condition"):k?l("CSS guard can only be used at the end of selector"):c?g=g?g.concat(c):c:(g&&l("Extend can only be used at the end of selector"),e=o.currentChar(),b?b.push(f):b=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return b?new d.Selector(b,g,k,m,h):void(g&&l("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(o.$char("[")){var a,b,c,e=this.entities;return(a=e.variableCurly())||(a=j(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=o.$re(/^[|~*$^]?=/),c&&(b=e.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||e.variableCurly()),k("]"),new d.Attribute(a,c,b)}},block:function(){var a;return o.$char("{")&&(a=this.primary())&&o.$char("}")?a:void 0},blockRuleset:function(){var a=this.block();return a&&(a=new d.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();return a?new d.DetachedRuleset(a):void 0},ruleset:function(){var b,c,e,f;for(o.save(),a.dumpLineNumbers&&(f=m(o.i));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],o.commentStore.length=0,c.condition&&b.length>1&&l("Guards are only currently allowed on a single selector."),!o.$char(","))break;c.condition&&l("Guards are only currently allowed on a single selector."),o.commentStore.length=0}if(b&&(e=this.block())){o.forget();var g=new d.Ruleset(b,e,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}o.restore()},rule:function(b){var c,e,f,g,i,j=o.i,k=o.currentChar();if("."!==k&&"#"!==k&&"&"!==k)if(o.save(),c=this.variable()||this.ruleProperty()){if(i="string"==typeof c,i&&(e=this.detachedRuleset()),o.commentStore.length=0,!e){g=!i&&c.pop().value;var l=!b&&(a.compress||i);if(l&&(e=this.value()),!e&&(e=this.anonymousValue()))return o.forget(),new d.Rule(c,e,!1,g,j,h);l||e||(e=this.value()),f=this.important()}if(e&&this.end())return o.forget(),new d.Rule(c,e,f,g,j,h);if(o.restore(),e&&!b)return this.rule(!0)}else o.forget()},anonymousValue:function(){var a=o.$re(/^([^@+\/'"*`(;{}-]*);/);return a?new d.Anonymous(a[1]):void 0},"import":function(){var a,b,c=o.i,e=o.$re(/^@import?\s+/);if(e){var f=(e?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),o.$(";")||(o.i=c,l("missing semi-colon or unrecognised media features on import")),b=b&&new d.Value(b),new d.Import(a,b,f,c,h);o.i=c,l("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!o.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!o.$char(","))break}while(a);return k(")"),d},importOption:function(){var a=o.$re(/^(less|css|multiple|once|inline|reference|optional)/);return a?a[1]:void 0},mediaFeature:function(){var a,b,c=this.entities,e=[];o.save();do if(a=c.keyword()||c.variable())e.push(a);else if(o.$char("(")){if(b=this.property(),a=this.value(),!o.$char(")"))return o.restore("Missing closing ')'"),null;if(b&&a)e.push(new d.Paren(new d.Rule(b,a,null,null,o.i,h,!0)));else{if(!a)return o.restore("badly formed media feature definition"),null;e.push(new d.Paren(a))}}while(a);return o.forget(),e.length>0?new d.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!o.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!o.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,e,f;return a.dumpLineNumbers&&(f=m(o.i)),o.$re(/^@media/)&&(b=this.mediaFeatures(),c=this.block())?(e=new d.Media(c,b,o.i,h),a.dumpLineNumbers&&(e.debugInfo=f),e):void 0},directive:function(){var b,c,e,f,g,i,j,k=o.i,n=!0;if("@"===o.currentChar()){if(c=this["import"]()||this.media())return c;if(o.save(),b=o.$re(/^@[a-z-]+/)){switch(f=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(f="@"+b.slice(b.indexOf("-",2)+1)),f){case"@counter-style":g=!0,n=!0;break;case"@charset":g=!0,n=!1;break;case"@namespace":i=!0,n=!1;break;case"@keyframes":g=!0;break;case"@host":case"@page":case"@document":case"@supports":j=!0}return o.commentStore.length=0,g?(c=this.entity(),c||l("expected "+b+" identifier")):i?(c=this.expression(),c||l("expected "+b+" expression")):j&&(c=(o.$re(/^[^{;]+/)||"").trim(),c&&(c=new d.Anonymous(c))),n&&(e=this.blockRuleset()),e||!n&&c&&o.$char(";")?(o.forget(),new d.Directive(b,c,e,k,h,a.dumpLineNumbers?m(k):null)):void o.restore("directive options not recognised")}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!o.$char(",")))break;while(a);return b.length>0?new d.Value(b):void 0},important:function(){return"!"===o.currentChar()?o.$re(/^! *important/):void 0},sub:function(){var a,b;return o.save(),o.$char("(")?(a=this.addition(),a&&o.$char(")")?(o.forget(),b=new d.Expression([a]),b.parens=!0,b):void o.restore("Expected ')'")):void o.restore()},multiplication:function(){var a,b,c,e,f;if(a=this.operand()){for(f=o.isWhitespace(-1);;){if(o.peek(/^\/[*\/]/))break;if(o.save(),c=o.$char("/")||o.$char("*"),!c){o.forget();break}if(b=this.operand(),!b){o.restore();break}o.forget(),a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},addition:function(){var a,b,c,e,f;if(a=this.multiplication()){for(f=o.isWhitespace(-1);;){if(c=o.$re(/^[-+]\s+/)||!f&&(o.$char("+")||o.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},conditions:function(){var a,b,c,e=o.i;if(a=this.condition()){for(;;){if(!o.peek(/^,\s*(not\s*)?\(/)||!o.$char(","))break;if(b=this.condition(),!b)break;c=new d.Condition("or",c||a,b,e)}return c||a}},condition:function(){var a,b,c,e,f=this.entities,g=o.i,h=!1;return o.$re(/^not/)&&(h=!0),k("("),a=this.addition()||f.keyword()||f.quoted(),a?(e=o.$re(/^(?:>=|<=|=<|[<=>])/),e?(b=this.addition()||f.keyword()||f.quoted(),b?c=new d.Condition(e,a,b,g,h):l("expected expression")):c=new d.Condition("=",a,new d.Keyword("true"),g,h),k(")"),o.$re(/^and/)?new d.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities;o.peek(/^-[@\(]/)&&(a=o.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(c.parensInOp=!0,c=new d.Negative(c)),c},expression:function(){var a,b,c=[];do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),o.peek(/^\/[\/*]/)||(b=o.$char("/"),b&&c.push(new d.Anonymous(b)))));while(a);return c.length>0?new d.Expression(c):void 0},property:function(){var a=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function a(a){var b=o.i,c=o.$re(a);return c?(f.push(b),e.push(c[1])):void 0}var b,c,e=[],f=[];for(o.save(),a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/))break;if(e.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===e[0]&&(e.shift(),f.shift()),c=0;e.length>c;c++)b=e[c],e[c]="@"!==b.charAt(0)?new d.Keyword(b):new d.Variable("@"+b.slice(2,-1),f[c],h);return e}o.restore()}}}};h.serializeVars=function(a){var b="";for(var c in a)if(Object.hasOwnProperty.call(a,c)){var d=a[c];b+=("@"===c[0]?"":"@")+c+": "+d+(";"===(""+d).slice(-1)?"":";")}return b},b.exports=h},{"../less-error":30,"../tree":59,"../utils":80,"../visitors":84,"./parser-input":35}],37:[function(a,b){var c=function(a){this.less=a,this.visitors=[],this.postProcessors=[],this.installedPlugins=[],this.fileManagers=[]};c.prototype.addPlugins=function(a){if(a)for(var b=0;a.length>b;b++)this.addPlugin(a[b])},c.prototype.addPlugin=function(a){this.installedPlugins.push(a),a.install(this.less,this)},c.prototype.addVisitor=function(a){this.visitors.push(a)},c.prototype.addPostProcessor=function(a,b){var c;for(c=0;this.postProcessors.length>c&&!(this.postProcessors[c].priority>=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},c.prototype.addFileManager=function(a){this.fileManagers.push(a)},c.prototype.getPostProcessors=function(){for(var a=[],b=0;this.postProcessors.length>b;b++)a.push(this.postProcessors[b].postProcessor);return a},c.prototype.getVisitors=function(){return this.visitors},c.prototype.getFileManagers=function(){return this.fileManagers},b.exports=c},{}],38:[function(a,b){var c="undefined"==typeof Promise?a("promise"):Promise;b.exports=function(a,b){var d=function(a,e,f){if("function"==typeof e&&(f=e,e={}),!f){var g=this;return new c(function(b,c){d.call(g,a,e,function(a,d){a?c(a):b(d)})})}this.parse(a,e,function(a,c,d,e){if(a)return f(a);var g;try{var h=new b(c,d);g=h.toCSS(e)}catch(a){return f(a)}f(null,g)})};return d}},{promise:void 0}],39:[function(a,b){b.exports=function(a,b){var c=function(a){this.options=a};return c.prototype.toCSS=function(b,c,d){var e=new a({contentsIgnoredCharsMap:d.contentsIgnoredChars,rootNode:b,contentsMap:d.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}),f=e.toCSS(c);return this.sourceMap=e.sourceMap,this.sourceMapURL=e.sourceMapURL,this.options.sourceMapInputFilename&&(this.sourceMapInputFilename=e.normalizeFilename(this.options.sourceMapInputFilename)),f+this.getCSSAppendage()},c.prototype.getCSSAppendage=function(){var a=this.sourceMapURL;return this.options.sourceMapFileInline&&(a="data:application/json;base64,"+b.encodeBase64(this.sourceMap)),a?"/*# sourceMappingURL="+a+" */":""},c.prototype.getExternalSourceMap=function(){return this.sourceMap},c.prototype.setExternalSourceMap=function(a){this.sourceMap=a},c.prototype.isInline=function(){return this.options.sourceMapFileInline},c.prototype.getSourceMapURL=function(){return this.sourceMapURL},c.prototype.getOutputFilename=function(){return this.options.sourceMapOutputFilename},c.prototype.getInputFilename=function(){return this.sourceMapInputFilename},c}},{}],40:[function(a,b){b.exports=function(a){var b=function(b){this._css=[],this._rootNode=b.rootNode,this._contentsMap=b.contentsMap,this._contentsIgnoredCharsMap=b.contentsIgnoredCharsMap,b.sourceMapFilename&&(this._sourceMapFilename=b.sourceMapFilename.replace(/\\/g,"/")),this._outputFilename=b.outputFilename,this.sourceMapURL=b.sourceMapURL,b.sourceMapBasepath&&(this._sourceMapBasepath=b.sourceMapBasepath.replace(/\\/g,"/")),b.sourceMapRootpath?(this._sourceMapRootpath=b.sourceMapRootpath.replace(/\\/g,"/"),"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/")):this._sourceMapRootpath="",this._outputSourceFiles=b.outputSourceFiles,this._sourceMapGeneratorConstructor=a.getSourceMapGenerator(),this._lineNumber=0,this._column=0};return b.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},b.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;e.length>i;i++)this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+i+1,column:0===i?this._column:0},original:{line:f.length+i,column:0===i?h.length:0},source:this.normalizeFilename(b.filename)});else this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+1,column:this._column},original:{line:f.length,column:h.length},source:this.normalizeFilename(b.filename)});1===e.length?this._column+=g.length:(this._lineNumber+=e.length-1,this._column=g.length),this._css.push(a)}},b.prototype.isEmpty=function(){return 0===this._css.length},b.prototype.toCSS=function(a){if(this._sourceMapGenerator=new this._sourceMapGeneratorConstructor({file:this._outputFilename,sourceRoot:null}),this._outputSourceFiles)for(var b in this._contentsMap)if(this._contentsMap.hasOwnProperty(b)){var c=this._contentsMap[b];this._contentsIgnoredCharsMap[b]&&(c=c.slice(this._contentsIgnoredCharsMap[b])),this._sourceMapGenerator.setSourceContent(this.normalizeFilename(b),c)}if(this._rootNode.genCSS(a,this),this._css.length>0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],41:[function(a,b){var c=a("./contexts"),d=a("./visitors"),e=a("./tree");b.exports=function(a,b){b=b||{};var f,g=b.variables,h=new c.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b])),new e.Rule("@"+a,b,!1,null,0)}),h.frames=[new e.Ruleset(null,g)]);var i,j=[],k=[new d.JoinSelectorVisitor,new d.ExtendVisitor,new d.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager){var l=b.pluginManager.getVisitors();for(i=0;l.length>i;i++){var m=l[i];m.isPreEvalVisitor?j.push(m):m.isPreVisitor?k.splice(0,0,m):k.push(m)}}for(i=0;j.length>i;i++)j[i].run(a);for(f=a.eval(h),i=0;k.length>i;i++)k[i].run(f);return f}},{"./contexts":10,"./tree":59,"./visitors":84}],42:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Alpha",d.prototype.accept=function(a){this.value=a.visit(this.value) +},d.prototype.eval=function(a){return this.value.eval?new d(this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},b.exports=d},{"./node":67}],43:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.value=a,this.index=b,this.mapLines=d,this.currentFileInfo=c,this.rulesetLike="undefined"==typeof e?!1:e};d.prototype=new c,d.prototype.type="Anonymous",d.prototype.eval=function(){return new d(this.value,this.index,this.currentFileInfo,this.mapLines,this.rulesetLike)},d.prototype.compare=function(a){return a.toCSS&&this.toCSS()===a.toCSS()?0:void 0},d.prototype.isRulesetLike=function(){return this.rulesetLike},d.prototype.genCSS=function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},b.exports=d},{"./node":67}],44:[function(a,b){var c=a("./node"),d=function(a,b){this.key=a,this.value=b};d.prototype=new c,d.prototype.type="Assignment",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.key,this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},b.exports=d},{"./node":67}],45:[function(a,b){var c=a("./node"),d=function(a,b,c){this.key=a,this.op=b,this.value=c};d.prototype=new c,d.prototype.type="Attribute",d.prototype.eval=function(a){return new d(this.key.eval?this.key.eval(a):this.key,this.op,this.value&&this.value.eval?this.value.eval(a):this.value)},d.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},d.prototype.toCSS=function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"},b.exports=d},{"./node":67}],46:[function(a,b){var c=a("./node"),d=a("../functions/function-caller"),e=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Call",e.prototype.accept=function(a){this.args&&(this.args=a.visitArray(this.args))},e.prototype.eval=function(a){var b,c=this.args.map(function(b){return b.eval(a)}),f=new d(this.name,a,this.index,this.currentFileInfo);if(f.isValid())try{if(b=f.call(c),null!=b)return b}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new e(this.name,c,this.index,this.currentFileInfo)},e.prototype.genCSS=function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;this.args.length>c;c++)this.args[c].genCSS(a,b),this.args.length>c+1&&b.add(", ");b.add(")")},b.exports=e},{"../functions/function-caller":20,"./node":67}],47:[function(a,b){function c(a,b){return Math.min(Math.max(a,0),b)}function d(a){return"#"+a.map(function(a){return a=c(Math.round(a),255),(16>a?"0":"")+a.toString(16)}).join("")}var e=a("./node"),f=a("../data/colors"),g=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};g.prototype=new e,g.prototype.type="Color",g.prototype.luma=function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255;return a=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),b=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),c=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*a+.7152*b+.0722*c},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},g.prototype.toCSS=function(a,b){var d,e,f=a&&a.compress&&!b;if(this.value)return this.value;if(e=this.fround(a,this.alpha),1>e)return"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(e,1)).join(","+(f?"":" "))+")";if(d=this.toRGB(),f){var g=d.split("");g[1]===g[2]&&g[3]===g[4]&&g[5]===g[6]&&(d="#"+g[1]+g[3]+g[5])}return d},g.prototype.operate=function(a,b,c){for(var d=[],e=this.alpha*(1-c.alpha)+c.alpha,f=0;3>f;f++)d[f]=this._operate(a,b,this.rgb[f],c.rgb[f]);return new g(d,e)},g.prototype.toRGB=function(){return d(this.rgb)},g.prototype.toHSL=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},g.prototype.toHSV=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},g.prototype.toARGB=function(){return d([255*this.alpha].concat(this.rgb))},g.prototype.compare=function(a){return a.rgb&&a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:void 0},g.fromKeyword=function(a){var b,c=a.toLowerCase();return f.hasOwnProperty(c)?b=new g(f[c].slice(1)):"transparent"===c&&(b=new g([0,0,0],0)),b?(b.value=a,b):void 0},b.exports=g},{"../data/colors":11,"./node":67}],48:[function(a,b){var c=a("./node"),d=function(a){" "===a?(this.value=" ",this.emptyOrWhitespace=!0):(this.value=a?a.trim():"",this.emptyOrWhitespace=""===this.value)};d.prototype=new c,d.prototype.type="Combinator";var e={"":!0," ":!0,"|":!0};d.prototype.genCSS=function(a,b){var c=a.compress||e[this.value]?"":" ";b.add(c+this.value+c)},b.exports=d},{"./node":67}],49:[function(a,b){var c=a("./node"),d=a("./debug-info"),e=function(a,b,c,d){this.value=a,this.isLineComment=b,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Comment",e.prototype.genCSS=function(a,b){this.debugInfo&&b.add(d(a,this),this.currentFileInfo,this.index),b.add(this.value)},e.prototype.isSilent=function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&"!"!==this.value[2];return this.isLineComment||b||c},e.prototype.markReferenced=function(){this.isReferenced=!0},e.prototype.isRulesetLike=function(a){return Boolean(a)},b.exports=e},{"./debug-info":51,"./node":67}],50:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e};d.prototype=new c,d.prototype.type="Condition",d.prototype.accept=function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},d.prototype.eval=function(a){var b=function(a,b,d){switch(a){case"and":return b&&d;case"or":return b||d;default:switch(c.compare(b,d)){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=d},{"./node":67}],51:[function(a,b){var c=function(a,b,d){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=c.asComment(b);break;case"mediaquery":e=c.asMediaQuery(b);break;case"all":e=c.asComment(b)+(d||"")+c.asMediaQuery(b)}return e};c.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},c.asMediaQuery=function(a){return"@media -sass-debug-info{filename{font-family:"+("file://"+a.debugInfo.fileName).replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=c},{}],52:[function(a,b){var c=a("./node"),d=a("../contexts"),e=function(a,b){this.ruleset=a,this.frames=b};e.prototype=new c,e.prototype.type="DetachedRuleset",e.prototype.evalFirst=!0,e.prototype.accept=function(a){this.ruleset=a.visit(this.ruleset)},e.prototype.eval=function(a){var b=this.frames||a.frames.slice(0);return new e(this.ruleset,b)},e.prototype.callEval=function(a){return this.ruleset.eval(this.frames?new d.Eval(a,this.frames.concat(a.frames)):a)},b.exports=e},{"../contexts":10,"./node":67}],53:[function(a,b){var c=a("./node"),d=a("../data/unit-conversions"),e=a("./unit"),f=a("./color"),g=function(a,b){this.value=parseFloat(a),this.unit=b&&b instanceof e?b:new e(b?[b]:void 0)};g.prototype=new c,g.prototype.type="Dimension",g.prototype.accept=function(a){this.unit=a.visit(this.unit)},g.prototype.eval=function(){return this},g.prototype.toColor=function(){return new f([this.value,this.value,this.value])},g.prototype.genCSS=function(a,b){if(a&&a.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var c=this.fround(a,this.value),d=String(c);if(0!==c&&1e-6>c&&c>-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&1>c&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},g.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e.numerator=c.unit.numerator.slice(0),e.denominator=c.unit.denominator.slice(0);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new g(d,e)},g.prototype.compare=function(a){var b,d;if(!(a instanceof g))return void 0;if(this.unit.isEmpty()||a.unit.isEmpty())b=this,d=a;else if(b=this.unify(),d=a.unify(),0!==b.unit.compare(d.unit))return void 0;return c.numericCompare(b.value,d.value)},g.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},g.prototype.convertTo=function(a){var b,c,e,f,h,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in d)d[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}h=function(a,b){return e.hasOwnProperty(a)?(b?i/=e[a]/e[f]:i*=e[a]/e[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],e=d[c],j.map(h));return j.cancel(),new g(i,j)},b.exports=g},{"../data/unit-conversions":13,"./color":47,"./node":67,"./unit":76}],54:[function(a,b){var c=a("./node"),d=a("./ruleset"),e=function(a,b,c,d,e,f,g){this.name=a,this.value=b,c&&(this.rules=c,this.rules.allowImports=!0),this.index=d,this.currentFileInfo=e,this.debugInfo=f,this.isReferenced=g};e.prototype=new c,e.prototype.type="Directive",e.prototype.accept=function(a){var b=this.value,c=this.rules;c&&(this.rules=a.visit(c)),b&&(this.value=a.visit(b))},e.prototype.isRulesetLike=function(){return this.rules||!this.isCharset()},e.prototype.isCharset=function(){return"@charset"===this.name},e.prototype.genCSS=function(a,b){var c=this.value,d=this.rules;b.add(this.name,this.currentFileInfo,this.index),c&&(b.add(" "),c.genCSS(a,b)),d?("Ruleset"===d.type&&(d=[d]),this.outputRuleset(a,b,d)):b.add(";")},e.prototype.eval=function(a){var b=this.value,c=this.rules;return b&&(b=b.eval(a)),c&&(c=c.eval(a),c.root=!0),new e(this.name,b,c,this.index,this.currentFileInfo,this.debugInfo,this.isReferenced)},e.prototype.variable=function(a){return this.rules?d.prototype.variable.call(this.rules,a):void 0},e.prototype.find=function(){return this.rules?d.prototype.find.apply(this.rules,arguments):void 0},e.prototype.rulesets=function(){return this.rules?d.prototype.rulesets.apply(this.rules):void 0},e.prototype.markReferenced=function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules.rules,a=0;b.length>a;a++)b[a].markReferenced&&b[a].markReferenced()},e.prototype.getIsReferenced=function(){return!this.currentFileInfo||!this.currentFileInfo.reference||this.isReferenced},e.prototype.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),void a.tabLevel--}var f="\n"+Array(a.tabLevel).join(" "),g=f+" ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--},b.exports=e},{"./node":67,"./ruleset":73}],55:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./combinator"),f=function(a,b,c,d){this.combinator=a instanceof e?a:new e(a),this.value="string"==typeof b?b.trim():b?b:"",this.index=c,this.currentFileInfo=d};f.prototype=new c,f.prototype.type="Element",f.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},f.prototype.eval=function(a){return new f(this.combinator,this.value.eval?this.value.eval(a):this.value,this.index,this.currentFileInfo)},f.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.currentFileInfo,this.index)},f.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof d&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=f},{"./combinator":48,"./node":67,"./paren":69}],56:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./comment"),f=function(a){if(this.value=a,!a)throw new Error("Expression requires an array parameter")};f.prototype=new c,f.prototype.type="Expression",f.prototype.accept=function(a){this.value=a.visitArray(this.value)},f.prototype.eval=function(a){var b,c=this.parens&&!this.parensInOp,e=!1;return c&&a.inParenthesis(),this.value.length>1?b=new f(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!e&&(b=new d(b)),b},f.prototype.genCSS=function(a,b){for(var c=0;this.value.length>c;c++)this.value[c].genCSS(a,b),this.value.length>c+1&&b.add(" ")},f.prototype.throwAwayComments=function(){this.value=this.value.filter(function(a){return!(a instanceof e)})},b.exports=f},{"./comment":49,"./node":67,"./paren":69}],57:[function(a,b){var c=a("./node"),d=function e(a,b,c){switch(this.selector=a,this.option=b,this.index=c,this.object_id=e.next_id++,this.parent_ids=[this.object_id],b){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}};d.next_id=0,d.prototype=new c,d.prototype.type="Extend",d.prototype.accept=function(a){this.selector=a.visit(this.selector)},d.prototype.eval=function(a){return new d(this.selector.eval(a),this.option,this.index)},d.prototype.clone=function(){return new d(this.selector,this.option,this.index)},d.prototype.findSelfSelectors=function(a){var b,c,d=[];for(b=0;a.length>b;b++)c=a[b].elements,b>0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]},b.exports=d},{"./node":67}],58:[function(a,b){var c=a("./node"),d=a("./media"),e=a("./url"),f=a("./quoted"),g=a("./ruleset"),h=a("./anonymous"),i=function(a,b,c,d,e){if(this.options=c,this.index=d,this.path=a,this.features=b,this.currentFileInfo=e,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var f=this.getPath();f&&/[#\.\&\?\/]css([\?;].*)?$/.test(f)&&(this.css=!0)}};i.prototype=new c,i.prototype.type="Import",i.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),!this.options.inline&&this.root&&(this.root=a.visit(this.root))},i.prototype.genCSS=function(a,b){this.css&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},i.prototype.getPath=function(){return this.path instanceof f?this.path.value:this.path instanceof e?this.path.value.value:null},i.prototype.isVariableImport=function(){var a=this.path;return a instanceof e&&(a=a.value),a instanceof f?a.containsVariables():!0},i.prototype.evalForImport=function(a){var b=this.path;return b instanceof e&&(b=b.value),new i(b.eval(a),this.features,this.options,this.index,this.currentFileInfo)},i.prototype.evalPath=function(a){var b=this.path.eval(a),c=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(b instanceof e)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},i.prototype.eval=function(a){var b,c=this.features&&this.features.eval(a);if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var e=new h(this.root,0,{filename:this.importedFilename},!0,!0);return this.features?new d([e],this.features.value):[e]}if(this.css){var f=new i(this.evalPath(a),c,this.options,this.index);if(!f.css&&this.error)throw this.error;return f}return b=new g(null,this.root.rules.slice(0)),b.evalImports(a),this.features?new d(b.rules,this.features.value):b.rules},b.exports=i},{"./anonymous":43,"./media":63,"./node":67,"./quoted":70,"./ruleset":73,"./url":77}],59:[function(a,b){var c={};c.Node=a("./node"),c.Alpha=a("./alpha"),c.Color=a("./color"),c.Directive=a("./directive"),c.DetachedRuleset=a("./detached-ruleset"),c.Operation=a("./operation"),c.Dimension=a("./dimension"),c.Unit=a("./unit"),c.Keyword=a("./keyword"),c.Variable=a("./variable"),c.Ruleset=a("./ruleset"),c.Element=a("./element"),c.Attribute=a("./attribute"),c.Combinator=a("./combinator"),c.Selector=a("./selector"),c.Quoted=a("./quoted"),c.Expression=a("./expression"),c.Rule=a("./rule"),c.Call=a("./call"),c.URL=a("./url"),c.Import=a("./import"),c.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},c.Comment=a("./comment"),c.Anonymous=a("./anonymous"),c.Value=a("./value"),c.JavaScript=a("./javascript"),c.Assignment=a("./assignment"),c.Condition=a("./condition"),c.Paren=a("./paren"),c.Media=a("./media"),c.UnicodeDescriptor=a("./unicode-descriptor"),c.Negative=a("./negative"),c.Extend=a("./extend"),c.RulesetCall=a("./ruleset-call"),b.exports=c},{"./alpha":42,"./anonymous":43,"./assignment":44,"./attribute":45,"./call":46,"./color":47,"./combinator":48,"./comment":49,"./condition":50,"./detached-ruleset":52,"./dimension":53,"./directive":54,"./element":55,"./expression":56,"./extend":57,"./import":58,"./javascript":60,"./keyword":62,"./media":63,"./mixin-call":64,"./mixin-definition":65,"./negative":66,"./node":67,"./operation":68,"./paren":69,"./quoted":70,"./rule":71,"./ruleset":73,"./ruleset-call":72,"./selector":74,"./unicode-descriptor":75,"./unit":76,"./url":77,"./value":78,"./variable":79}],60:[function(a,b){var c=a("./js-eval-node"),d=a("./dimension"),e=a("./quoted"),f=a("./anonymous"),g=function(a,b,c,d){this.escaped=b,this.expression=a,this.index=c,this.currentFileInfo=d};g.prototype=new c,g.prototype.type="JavaScript",g.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new d(b):"string"==typeof b?new e('"'+b+'"',b,this.escaped,this.index):new f(Array.isArray(b)?b.join(", "):b)},b.exports=g},{"./anonymous":43,"./dimension":53,"./js-eval-node":61,"./quoted":70}],61:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(){};e.prototype=new c,e.prototype.evaluateJavaScript=function(a,b){var c,e=this,f={};if(void 0!==b.javascriptEnabled&&!b.javascriptEnabled)throw{message:"You are using JavaScript, which has been disabled.",filename:this.currentFileInfo.filename,index:this.index};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return e.jsify(new d("@"+c,e.index,e.currentFileInfo).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.currentFileInfo.filename,index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.currentFileInfo.filename,index:this.index}}return c},e.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=e},{"./node":67,"./variable":79}],62:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Keyword",d.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},d.True=new d("true"),d.False=new d("false"),b.exports=d},{"./node":67}],63:[function(a,b){var c=a("./ruleset"),d=a("./value"),e=a("./element"),f=a("./selector"),g=a("./anonymous"),h=a("./expression"),i=a("./directive"),j=function(a,b,e,f){this.index=e,this.currentFileInfo=f;var g=this.emptySelectors();this.features=new d(b),this.rules=[new c(g,a)],this.rules[0].allowImports=!0};j.prototype=new i,j.prototype.type="Media",j.prototype.isRulesetLike=!0,j.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},j.prototype.genCSS=function(a,b){b.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},j.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new j(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},j.prototype.variable=function(a){return c.prototype.variable.call(this.rules[0],a)},j.prototype.find=function(){return c.prototype.find.apply(this.rules[0],arguments)},j.prototype.rulesets=function(){return c.prototype.rulesets.apply(this.rules[0])},j.prototype.emptySelectors=function(){var a=new e("","&",this.index,this.currentFileInfo),b=[new f([a],null,null,this.index,this.currentFileInfo)];return b[0].mediaEmpty=!0,b},j.prototype.markReferenced=function(){var a,b=this.rules[0].rules;for(this.rules[0].markReferenced(),this.isReferenced=!0,a=0;b.length>a;a++)b[a].markReferenced&&b[a].markReferenced()},j.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var d=this.emptySelectors();b=new c(d,a.mediaBlocks),b.multiMedia=!0}return delete a.mediaBlocks,delete a.mediaPath,b},j.prototype.evalNested=function(a){var b,e,f=a.mediaPath.concat([this]);for(b=0;f.length>b;b++)e=f[b].features instanceof d?f[b].features.value:f[b].features,f[b]=Array.isArray(e)?e:[e];return this.features=new d(this.permute(f).map(function(a){for(a=a.map(function(a){return a.toCSS?a:new g(a)}),b=a.length-1;b>0;b--)a.splice(b,0,new g("and"));return new h(a)})),new c([],[])},j.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;c.length>d;d++)for(var e=0;a[0].length>e;e++)b.push([a[0][e]].concat(c[d]));return b},j.prototype.bubbleSelectors=function(a){a&&(this.rules=[new c(a.slice(0),[this.rules[0]])])},b.exports=j},{"./anonymous":43,"./directive":54,"./element":55,"./expression":56,"./ruleset":73,"./selector":74,"./value":78}],64:[function(a,b){var c=a("./node"),d=a("./selector"),e=a("./mixin-definition"),f=a("../functions/default"),g=function(a,b,c,e,f){this.selector=new d(a),this.arguments=b&&b.length?b:null,this.index=c,this.currentFileInfo=e,this.important=f};g.prototype=new c,g.prototype.type="MixinCall",g.prototype.accept=function(a){this.selector&&(this.selector=a.visit(this.selector)),this.arguments&&(this.arguments=a.visitArray(this.arguments))},g.prototype.eval=function(a){function b(b,c){var d,e;for(k=0;2>k;k++){for(w[k]=!0,f.value(k),d=0;c.length>d&&w[k];d++)e=c[d],e.matchCondition&&(w[k]=w[k]&&e.matchCondition(null,a));b.matchCondition&&(w[k]=w[k]&&b.matchCondition(h,a))}return w[0]||w[1]?w[0]!=w[1]?w[1]?z:A:y:x}var c,d,g,h,i,j,k,l,m,n,o,p,q,r,s,t=[],u=!1,v=[],w=[],x=-1,y=0,z=1,A=2;for(h=this.arguments&&this.arguments.map(function(b){return{name:b.name,value:b.value.eval(a)}}),s=function(b){return b.matchArgs(null,a)},i=0;a.frames.length>i;i++)if((c=a.frames[i].find(this.selector,null,s)).length>0){for(m=!0,j=0;c.length>j;j++){for(d=c[j].rule,g=c[j].path,l=!1,k=0;a.frames.length>k;k++)if(!(d instanceof e)&&d===(a.frames[k].originalRuleset||a.frames[k])){l=!0;break}l||d.matchArgs(h,a)&&(o={mixin:d,group:b(d,g)},o.group!==x&&v.push(o),u=!0)}for(f.reset(),q=[0,0,0],j=0;v.length>j;j++)q[v[j].group]++;if(q[y]>0)p=A;else if(p=z,q[z]+q[A]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename};for(j=0;v.length>j;j++)if(o=v[j].group,o===y||o===p)try{d=v[j].mixin,d instanceof e||(r=d.originalRuleset||d,d=new e("",[],d.rules,null,!1),d.originalRuleset=r),Array.prototype.push.apply(t,d.evalCall(a,h,this.important).rules)}catch(B){throw{message:B.message,index:this.index,filename:this.currentFileInfo.filename,stack:B.stack}}if(u){if(!this.currentFileInfo||!this.currentFileInfo.reference)for(i=0;t.length>i;i++)n=t[i],n.markReferenced&&n.markReferenced();return t}}throw m?{type:"Runtime",message:"No matching definition was found for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename}:{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}},g.prototype.format=function(a){return this.selector.toCSS().trim()+"("+(a?a.map(function(a){var b="";return a.name&&(b+=a.name+":"),b+=a.value.toCSS?a.value.toCSS():"???"}).join(", "):"")+")"},b.exports=g},{"../functions/default":19,"./mixin-definition":65,"./node":67,"./selector":74}],65:[function(a,b){var c=a("./selector"),d=a("./element"),e=a("./ruleset"),f=a("./rule"),g=a("./expression"),h=a("../contexts"),i=function(a,b,e,f,g,h){this.name=a,this.selectors=[new c([new d(null,a,this.index,this.currentFileInfo)])],this.params=b,this.condition=f,this.variadic=g,this.arity=b.length,this.rules=e,this._lookups={},this.required=b.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:a},0),this.frames=h};i.prototype=new e,i.prototype.type="MixinDefinition",i.prototype.evalFirst=!0,i.prototype.accept=function(a){this.params&&this.params.length&&(this.params=a.visitArray(this.params)),this.rules=a.visitArray(this.rules),this.condition&&(this.condition=a.visit(this.condition))},i.prototype.evalParams=function(a,b,c,d){var i,j,k,l,m,n,o,p,q=new e(null,null),r=this.params.slice(0),s=0;if(b=new h.Eval(b,[q].concat(b.frames)),c)for(c=c.slice(0),s=c.length,k=0;s>k;k++)if(j=c[k],n=j&&j.name){for(o=!1,l=0;r.length>l;l++)if(!d[l]&&n===r[l].name){d[l]=j.value.eval(a),q.prependRule(new f(n,j.value.eval(a))),o=!0;break}if(o){c.splice(k,1),k--;continue}throw{type:"Runtime",message:"Named argument for "+this.name+" "+c[k].name+" not found"}}for(p=0,k=0;r.length>k;k++)if(!d[k]){if(j=c&&c[p],n=r[k].name)if(r[k].variadic){for(i=[],l=p;s>l;l++)i.push(c[l].value.eval(a));q.prependRule(new f(n,new g(i).eval(a)))}else{if(m=j&&j.value)m=m.eval(a);else{if(!r[k].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+s+" for "+this.arity+")"};m=r[k].value.eval(b),q.resetCache()}q.prependRule(new f(n,m)),d[k]=m}if(r[k].variadic&&c)for(l=p;s>l;l++)d[l]=c[l].value.eval(a);p++}return q},i.prototype.eval=function(a){return new i(this.name,this.params,this.rules,this.condition,this.variadic,this.frames||a.frames.slice(0))},i.prototype.evalCall=function(a,b,c){var d,i,j=[],k=this.frames?this.frames.concat(a.frames):a.frames,l=this.evalParams(a,new h.Eval(a,k),b,j);return l.prependRule(new f("@arguments",new g(j).eval(a))),d=this.rules.slice(0),i=new e(null,d),i.originalRuleset=this,i=i.eval(new h.Eval(a,[this,l].concat(k))),c&&(i=this.makeImportant.apply(i)),i},i.prototype.matchCondition=function(a,b){return this.condition&&!this.condition.eval(new h.Eval(b,[this.evalParams(b,new h.Eval(b,this.frames?this.frames.concat(b.frames):b.frames),a,[])].concat(this.frames).concat(b.frames)))?!1:!0},i.prototype.matchArgs=function(a,b){var c,d=a&&a.length||0;if(this.variadic){if(this.required-1>d)return!1}else{if(this.required>d)return!1;if(d>this.params.length)return!1}c=Math.min(d,this.arity);for(var e=0;c>e;e++)if(!this.params[e].name&&!this.params[e].variadic&&a[e].value.eval(b).toCSS()!=this.params[e].value.eval(b).toCSS())return!1;return!0},b.exports=i},{"../contexts":10,"./element":55,"./expression":56,"./rule":71,"./ruleset":73,"./selector":74}],66:[function(a,b){var c=a("./node"),d=a("./operation"),e=a("./dimension"),f=function(a){this.value=a};f.prototype=new c,f.prototype.type="Negative",f.prototype.genCSS=function(a,b){b.add("-"),this.value.genCSS(a,b)},f.prototype.eval=function(a){return a.isMathOn()?new d("*",[new e(-1),this.value]).eval(a):new f(this.value.eval(a))},b.exports=f},{"./dimension":53,"./node":67,"./operation":68}],67:[function(a,b){var c=function(){};c.prototype.toCSS=function(a){var b=[];return this.genCSS(a,{add:function(a){b.push(a)},isEmpty:function(){return 0===b.length}}),b.join("")},c.prototype.genCSS=function(a,b){b.add(this.value)},c.prototype.accept=function(a){this.value=a.visit(this.value)},c.prototype.eval=function(){return this},c.prototype._operate=function(a,b,c,d){switch(b){case"+":return c+d;case"-":return c-d;case"*":return c*d;case"/":return c/d}},c.prototype.fround=function(a,b){var c=a&&a.numPrecision;return null==c?b:Number((b+2e-16).toFixed(c))},c.compare=function(a,b){if(a.compare&&"Quoted"!==b.type&&"Anonymous"!==b.type)return a.compare(b);if(b.compare)return-b.compare(a);if(a.type!==b.type)return void 0;if(a=a.value,b=b.value,!Array.isArray(a))return a===b?0:void 0;if(a.length!==b.length)return void 0;for(var d=0;a.length>d;d++)if(0!==c.compare(a[d],b[d]))return void 0;return 0},c.numericCompare=function(a,b){return b>a?-1:a===b?0:a>b?1:void 0},b.exports=c},{}],68:[function(a,b){var c=a("./node"),d=a("./color"),e=a("./dimension"),f=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};f.prototype=new c,f.prototype.type="Operation",f.prototype.accept=function(a){this.operands=a.visit(this.operands)},f.prototype.eval=function(a){var b=this.operands[0].eval(a),c=this.operands[1].eval(a);if(a.isMathOn()){if(b instanceof e&&c instanceof d&&(b=b.toColor()),c instanceof e&&b instanceof d&&(c=c.toColor()),!b.operate)throw{type:"Operation",message:"Operation on an invalid type"};return b.operate(a,this.op,c)}return new f(this.op,[b,c],this.isSpaced)},f.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=f},{"./color":47,"./dimension":53,"./node":67}],69:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Paren",d.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},d.prototype.eval=function(a){return new d(this.value.eval(a))},b.exports=d},{"./node":67}],70:[function(a,b){var c=a("./node"),d=a("./js-eval-node"),e=a("./variable"),f=function(a,b,c,d,e){this.escaped=null==c?!0:c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e};f.prototype=new d,f.prototype.type="Quoted",f.prototype.genCSS=function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},f.prototype.containsVariables=function(){return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/)},f.prototype.eval=function(a){function b(a,b,c){var d=a;do a=d,d=a.replace(b,c);while(a!==d);return d}var c=this,d=this.value,g=function(b,d){return String(c.evaluateJavaScript(d,a))},h=function(b,d){var g=new e("@"+d,c.index,c.currentFileInfo).eval(a,!0); +return g instanceof f?g.value:g.toCSS()};return d=b(d,/`([^`]+)`/g,g),d=b(d,/@\{([\w-]+)\}/g,h),new f(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},f.prototype.compare=function(a){return"Quoted"!==a.type||this.escaped||a.escaped?a.toCSS&&this.toCSS()===a.toCSS()?0:void 0:c.numericCompare(this.value,a.value)},b.exports=f},{"./js-eval-node":61,"./node":67,"./variable":79}],71:[function(a,b){function c(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;e>c;c++)b[c].eval(a).genCSS(a,f);return d}var d=a("./node"),e=a("./value"),f=a("./keyword"),g=function(a,b,c,f,g,h,i,j){this.name=a,this.value=b instanceof d?b:new e([b]),this.important=c?" "+c.trim():"",this.merge=f,this.index=g,this.currentFileInfo=h,this.inline=i||!1,this.variable=void 0!==j?j:a.charAt&&"@"===a.charAt(0)};g.prototype=new d,g.prototype.type="Rule",g.prototype.genCSS=function(a,b){b.add(this.name+(a.compress?":":": "),this.currentFileInfo,this.index);try{this.value.genCSS(a,b)}catch(c){throw c.index=this.index,c.filename=this.currentFileInfo.filename,c}b.add(this.important+(this.inline||a.lastRule&&a.compress?"":";"),this.currentFileInfo,this.index)},g.prototype.eval=function(a){var b,d=!1,e=this.name,h=this.variable;"string"!=typeof e&&(e=1===e.length&&e[0]instanceof f?e[0].value:c(a,e),h=!1),"font"!==e||a.strictMath||(d=!0,a.strictMath=!0);try{if(a.importantScope.push({}),b=this.value.eval(a),!this.variable&&"DetachedRuleset"===b.type)throw{message:"Rulesets cannot be evaluated on a property.",index:this.index,filename:this.currentFileInfo.filename};var i=this.important,j=a.importantScope.pop();return!i&&j.important&&(i=j.important),new g(e,b,i,this.merge,this.index,this.currentFileInfo,this.inline,h)}catch(k){throw"number"!=typeof k.index&&(k.index=this.index,k.filename=this.currentFileInfo.filename),k}finally{d&&(a.strictMath=!1)}},g.prototype.makeImportant=function(){return new g(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)},b.exports=g},{"./keyword":62,"./node":67,"./value":78}],72:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(a){this.variable=a};e.prototype=new c,e.prototype.type="RulesetCall",e.prototype.eval=function(a){var b=new d(this.variable).eval(a);return b.callEval(a)},b.exports=e},{"./node":67,"./variable":79}],73:[function(a,b){var c=a("./node"),d=a("./rule"),e=a("./selector"),f=a("./element"),g=a("../contexts"),h=a("../functions/default"),i=a("./debug-info"),j=function(a,b,c){this.selectors=a,this.rules=b,this._lookups={},this.strictImports=c};j.prototype=new c,j.prototype.type="Ruleset",j.prototype.isRuleset=!0,j.prototype.isRulesetLike=!0,j.prototype.accept=function(a){this.paths?a.visitArray(this.paths,!0):this.selectors&&(this.selectors=a.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=a.visitArray(this.rules))},j.prototype.eval=function(a){var b,c,e,f,g=this.selectors,i=!1;if(g&&(c=g.length)){for(b=[],h.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),f=0;c>f;f++)e=g[f].eval(a),b.push(e),e.evaldCondition&&(i=!0);h.reset()}else i=!0;var k,l,m=this.rules?this.rules.slice(0):null,n=new j(b,m,this.strictImports);n.originalRuleset=this,n.root=this.root,n.firstRoot=this.firstRoot,n.allowImports=this.allowImports,this.debugInfo&&(n.debugInfo=this.debugInfo),i||(m.length=0);var o=a.frames;o.unshift(n);var p=a.selectors;p||(a.selectors=p=[]),p.unshift(this.selectors),(n.root||n.allowImports||!n.strictImports)&&n.evalImports(a);var q=n.rules,r=q?q.length:0;for(f=0;r>f;f++)q[f].evalFirst&&(q[f]=q[f].eval(a));var s=a.mediaBlocks&&a.mediaBlocks.length||0;for(f=0;r>f;f++)"MixinCall"===q[f].type?(m=q[f].eval(a).filter(function(a){return a instanceof d&&a.variable?!n.variable(a.name):!0}),q.splice.apply(q,[f,1].concat(m)),r+=m.length-1,f+=m.length-1,n.resetCache()):"RulesetCall"===q[f].type&&(m=q[f].eval(a).rules.filter(function(a){return a instanceof d&&a.variable?!1:!0}),q.splice.apply(q,[f,1].concat(m)),r+=m.length-1,f+=m.length-1,n.resetCache());for(f=0;q.length>f;f++)k=q[f],k.evalFirst||(q[f]=k=k.eval?k.eval(a):k);for(f=0;q.length>f;f++)if(k=q[f],k instanceof j&&k.selectors&&1===k.selectors.length&&k.selectors[0].isJustParentSelector()){q.splice(f--,1);for(var t=0;k.rules.length>t;t++)l=k.rules[t],l instanceof d&&l.variable||q.splice(++f,0,l)}if(o.shift(),p.shift(),a.mediaBlocks)for(f=s;a.mediaBlocks.length>f;f++)a.mediaBlocks[f].bubbleSelectors(b);return n},j.prototype.evalImports=function(a){var b,c,d=this.rules;if(d)for(b=0;d.length>b;b++)"Import"===d[b].type&&(c=d[b].eval(a),c&&c.length?(d.splice.apply(d,[b,1].concat(c)),b+=c.length-1):d.splice(b,1,c),this.resetCache())},j.prototype.makeImportant=function(){return this.rules=this.rules.map(function(a){return a.makeImportant?a.makeImportant():a}),this},j.prototype.matchArgs=function(a){return!a||0===a.length},j.prototype.matchCondition=function(a,b){var c=this.selectors[this.selectors.length-1];return c.evaldCondition?c.condition&&!c.condition.eval(new g.Eval(b,b.frames))?!1:!0:!1},j.prototype.resetCache=function(){this._rulesets=null,this._variables=null,this._lookups={}},j.prototype.variables=function(){return this._variables||(this._variables=this.rules?this.rules.reduce(function(a,b){if(b instanceof d&&b.variable===!0&&(a[b.name]=b),"Import"===b.type&&b.root&&b.root.variables){var c=b.root.variables();for(var e in c)c.hasOwnProperty(e)&&(a[e]=c[e])}return a},{}):{}),this._variables},j.prototype.variable=function(a){return this.variables()[a]},j.prototype.rulesets=function(){if(!this.rules)return null;var a,b,c=[],d=this.rules,e=d.length;for(a=0;e>a;a++)b=d[a],b.isRuleset&&c.push(b);return c},j.prototype.prependRule=function(a){var b=this.rules;b?b.unshift(a):this.rules=[a]},j.prototype.find=function(a,b,c){b=b||this;var d,f,g=[],h=a.toCSS();return h in this._lookups?this._lookups[h]:(this.rulesets().forEach(function(h){if(h!==b)for(var i=0;h.selectors.length>i;i++)if(d=a.match(h.selectors[i])){if(a.elements.length>d){if(!c||c(h)){f=h.find(new e(a.elements.slice(d)),b,c);for(var j=0;f.length>j;++j)f[j].path.push(h);Array.prototype.push.apply(g,f)}}else g.push({rule:h,path:[]});break}}),this._lookups[h]=g,g)},j.prototype.genCSS=function(a,b){function c(a,b){return"boolean"==typeof a.isRulesetLike?a.isRulesetLike:"function"==typeof a.isRulesetLike?a.isRulesetLike(b):!1}var d,e,f,g,h,j,k=[],l=[],m=[];a.tabLevel=a.tabLevel||0,this.root||a.tabLevel++;var n,o=a.compress?"":Array(a.tabLevel+1).join(" "),p=a.compress?"":Array(a.tabLevel).join(" ");for(d=0;this.rules.length>d;d++)h=this.rules[d],c(h,this.root)?m.push(h):h.isCharset&&h.isCharset()?k.push(h):l.push(h);if(l=k.concat(l),!this.root){g=i(a,this,p),g&&(b.add(g),b.add(p));var q,r=this.paths,s=r.length;for(n=a.compress?",":",\n"+p,d=0;s>d;d++)if(j=r[d],q=j.length)for(d>0&&b.add(n),a.firstSelector=!0,j[0].genCSS(a,b),a.firstSelector=!1,e=1;q>e;e++)j[e].genCSS(a,b);b.add((a.compress?"{":" {\n")+o)}for(d=0;l.length>d;d++)h=l[d],d+1!==l.length||this.root&&0!==m.length&&!this.firstRoot||(a.lastRule=!0),h.genCSS?h.genCSS(a,b):h.value&&b.add(h.value.toString()),a.lastRule?a.lastRule=!1:b.add(a.compress?"":"\n"+o);if(this.root||(b.add(a.compress?"}":"\n"+p+"}"),a.tabLevel--),n=(a.compress?"":"\n")+(this.root?o:p),f=m.length)for(l.length&&n&&b.add(n),m[0].genCSS(a,b),d=1;f>d;d++)n&&b.add(n),m[d].genCSS(a,b);b.isEmpty()||a.compress||!this.firstRoot||b.add("\n")},j.prototype.markReferenced=function(){var a;if(this.selectors)for(a=0;this.selectors.length>a;a++)this.selectors[a].markReferenced();if(this.rules)for(a=0;this.rules.length>a;a++)this.rules[a].markReferenced&&this.rules[a].markReferenced()},j.prototype.getIsReferenced=function(){var a,b,c,d;if(this.paths)for(a=0;this.paths.length>a;a++)for(c=this.paths[a],b=0;c.length>b;b++)if(c[b].getIsReferenced&&c[b].getIsReferenced())return!0;if(this.selectors)for(a=0;this.selectors.length>a;a++)if(d=this.selectors[a],d.getIsReferenced&&d.getIsReferenced())return!0;return!1},j.prototype.joinSelectors=function(a,b,c){for(var d=0;c.length>d;d++)this.joinSelector(a,b,c[d])},j.prototype.joinSelector=function(a,b,c){var d,e,g,h,i,j,k,l,m,n,o,p,q,r,s;for(d=0;c.elements.length>d;d++)j=c.elements[d],"&"===j.value&&(h=!0);if(h){for(r=[],i=[[]],d=0;c.elements.length>d;d++)if(j=c.elements[d],"&"!==j.value)r.push(j);else{for(s=[],r.length>0&&this.mergeElementsOnToSelectors(r,i),e=0;i.length>e;e++)if(k=i[e],0===b.length)k.length>0&&(k[0].elements=k[0].elements.slice(0),k[0].elements.push(new f(j.combinator,"",j.index,j.currentFileInfo))),s.push(k);else for(g=0;b.length>g;g++){if(l=b[g],m=[],n=[],p=!0,k.length>0?(m=k.slice(0),q=m.pop(),o=c.createDerived(q.elements.slice(0)),p=!1):o=c.createDerived([]),l.length>1&&(n=n.concat(l.slice(1))),l.length>0){p=!1;var t=j.combinator,u=l[0].elements[0];t.emptyOrWhitespace&&!u.combinator.emptyOrWhitespace&&(t=u.combinator),o.elements.push(new f(t,u.value,j.index,j.currentFileInfo)),o.elements=o.elements.concat(l[0].elements.slice(1))}p||m.push(o),m=m.concat(n),s.push(m)}i=s,r=[]}for(r.length>0&&this.mergeElementsOnToSelectors(r,i),d=0;i.length>d;d++)i[d].length>0&&a.push(i[d])}else if(b.length>0)for(d=0;b.length>d;d++)a.push(b[d].concat(c));else a.push([c])},j.prototype.mergeElementsOnToSelectors=function(a,b){var c,d;if(0===b.length)return void b.push([new e(a)]);for(c=0;b.length>c;c++)d=b[c],d.length>0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new e(a))},b.exports=j},{"../contexts":10,"../functions/default":19,"./debug-info":51,"./element":55,"./node":67,"./rule":71,"./selector":74}],74:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e,f){this.elements=a,this.extendList=b,this.condition=c,this.currentFileInfo=e||{},this.isReferenced=f,c||(this.evaldCondition=!0)};d.prototype=new c,d.prototype.type="Selector",d.prototype.accept=function(a){this.elements&&(this.elements=a.visitArray(this.elements)),this.extendList&&(this.extendList=a.visitArray(this.extendList)),this.condition&&(this.condition=a.visit(this.condition))},d.prototype.createDerived=function(a,b,c){c=null!=c?c:this.evaldCondition;var e=new d(a,b||this.extendList,null,this.index,this.currentFileInfo,this.isReferenced);return e.evaldCondition=c,e.mediaEmpty=this.mediaEmpty,e},d.prototype.match=function(a){var b,c,d=this.elements,e=d.length;if(a.CacheElements(),b=a._elements.length,0===b||b>e)return 0;for(c=0;b>c;c++)if(d[c].value!==a._elements[c])return 0;return b},d.prototype.CacheElements=function(){if(!this._elements){var a=this.elements.map(function(a){return a.combinator.value+(a.value.value||a.value)}).join("").match(/[,&#\*\.\w-]([\w-]|(\\.))*/g);a?"&"===a[0]&&a.shift():a=[],this._elements=a}},d.prototype.isJustParentSelector=function(){return!this.mediaEmpty&&1===this.elements.length&&"&"===this.elements[0].value&&(" "===this.elements[0].combinator.value||""===this.elements[0].combinator.value)},d.prototype.eval=function(a){var b=this.condition&&this.condition.eval(a),c=this.elements,d=this.extendList;return c=c&&c.map(function(b){return b.eval(a)}),d=d&&d.map(function(b){return b.eval(a)}),this.createDerived(c,d,b)},d.prototype.genCSS=function(a,b){var c,d;if(a&&a.firstSelector||""!==this.elements[0].combinator.value||b.add(" ",this.currentFileInfo,this.index),!this._css)for(c=0;this.elements.length>c;c++)d=this.elements[c],d.genCSS(a,b)},d.prototype.markReferenced=function(){this.isReferenced=!0},d.prototype.getIsReferenced=function(){return!this.currentFileInfo.reference||this.isReferenced},d.prototype.getIsOutput=function(){return this.evaldCondition},b.exports=d},{"./node":67}],75:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="UnicodeDescriptor",b.exports=d},{"./node":67}],76:[function(a,b){var c=a("./node"),d=a("../data/unit-conversions"),e=function(a,b,c){this.numerator=a?a.slice(0).sort():[],this.denominator=b?b.slice(0).sort():[],c?this.backupUnit=c:a&&a.length&&(this.backupUnit=a[0])};e.prototype=new c,e.prototype.type="Unit",e.prototype.clone=function(){return new e(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},e.prototype.genCSS=function(a,b){var c=a&&a.strictUnits;1===this.numerator.length?b.add(this.numerator[0]):!c&&this.backupUnit&&b.add(this.backupUnit)},e.prototype.toString=function(){var a,b=this.numerator.join("*");for(a=0;this.denominator.length>a;a++)b+="/"+this.denominator[a];return b},e.prototype.compare=function(a){return this.is(a.toString())?0:void 0},e.prototype.is=function(a){return this.toString().toUpperCase()===a.toUpperCase()},e.prototype.isLength=function(){return Boolean(this.toCSS().match(/px|em|%|in|cm|mm|pc|pt|ex/))},e.prototype.isEmpty=function(){return 0===this.numerator.length&&0===this.denominator.length},e.prototype.isSingular=function(){return 1>=this.numerator.length&&0===this.denominator.length},e.prototype.map=function(a){var b;for(b=0;this.numerator.length>b;b++)this.numerator[b]=a(this.numerator[b],!1);for(b=0;this.denominator.length>b;b++)this.denominator[b]=a(this.denominator[b],!0)},e.prototype.usedUnits=function(){var a,b,c={};b=function(b){return a.hasOwnProperty(b)&&!c[e]&&(c[e]=b),b};for(var e in d)d.hasOwnProperty(e)&&(a=d[e],this.map(b));return c},e.prototype.cancel=function(){var a,b,c={};for(b=0;this.numerator.length>b;b++)a=this.numerator[b],c[a]=(c[a]||0)+1;for(b=0;this.denominator.length>b;b++)a=this.denominator[b],c[a]=(c[a]||0)-1;this.numerator=[],this.denominator=[];for(a in c)if(c.hasOwnProperty(a)){var d=c[a];if(d>0)for(b=0;d>b;b++)this.numerator.push(a);else if(0>d)for(b=0;-d>b;b++)this.denominator.push(a)}this.numerator.sort(),this.denominator.sort()},b.exports=e},{"../data/unit-conversions":13,"./node":67}],77:[function(a,b){var c=a("./node"),d=function(a,b,c,d){this.value=a,this.currentFileInfo=c,this.index=b,this.isEvald=d};d.prototype=new c,d.prototype.type="Url",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.genCSS=function(a,b){b.add("url("),this.value.genCSS(a,b),b.add(")")},d.prototype.eval=function(a){var b,c=this.value.eval(a);if(!this.isEvald&&(b=this.currentFileInfo&&this.currentFileInfo.rootpath,b&&"string"==typeof c.value&&a.isPathRelative(c.value)&&(c.quote||(b=b.replace(/[\(\)'"\s]/g,function(a){return"\\"+a})),c.value=b+c.value),c.value=a.normalizePath(c.value),a.urlArgs&&!c.value.match(/^\s*data:/))){var e=-1===c.value.indexOf("?")?"?":"&",f=e+a.urlArgs;-1!==c.value.indexOf("#")?c.value=c.value.replace("#",f+"#"):c.value+=f}return new d(c,this.index,this.currentFileInfo,!0)},b.exports=d},{"./node":67}],78:[function(a,b){var c=a("./node"),d=function(a){if(this.value=a,!a)throw new Error("Value requires an array argument")};d.prototype=new c,d.prototype.type="Value",d.prototype.accept=function(a){this.value&&(this.value=a.visitArray(this.value))},d.prototype.eval=function(a){return 1===this.value.length?this.value[0].eval(a):new d(this.value.map(function(b){return b.eval(a)}))},d.prototype.genCSS=function(a,b){var c;for(c=0;this.value.length>c;c++)this.value[c].genCSS(a,b),this.value.length>c+1&&b.add(a&&a.compress?",":", ")},b.exports=d},{"./node":67}],79:[function(a,b){var c=a("./node"),d=function(a,b,c){this.name=a,this.index=b,this.currentFileInfo=c||{}};d.prototype=new c,d.prototype.type="Variable",d.prototype.eval=function(a){var b,c=this.name;if(0===c.indexOf("@@")&&(c="@"+new d(c.slice(1),this.index,this.currentFileInfo).eval(a).value),this.evaluating)throw{type:"Name",message:"Recursive variable definition for "+c,filename:this.currentFileInfo.filename,index:this.index};if(this.evaluating=!0,b=this.find(a.frames,function(b){var d=b.variable(c);if(d){if(d.important){var e=a.importantScope[a.importantScope.length-1];e.important=d.important}return d.value.eval(a)}}))return this.evaluating=!1,b;throw{type:"Name",message:"variable "+c+" is undefined",filename:this.currentFileInfo.filename,index:this.index}},d.prototype.find=function(a,b){for(var c,d=0;a.length>d;d++)if(c=b.call(a,a[d]))return c;return null},b.exports=d},{"./node":67}],80:[function(a,b){b.exports={getLocation:function(a,b){for(var c=a+1,d=null,e=-1;--c>=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}}},{}],81:[function(a,b){var c=a("../tree"),d=a("./visitor"),e=a("../logger"),f=function(){this._visitor=new d(this),this.contexts=[],this.allExtendsStack=[[]]};f.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,d,e,f,g=[],h=a.rules,i=h?h.length:0;for(b=0;i>b;b++)a.rules[b]instanceof c.Extend&&(g.push(h[b]),a.extendOnEveryPath=!0);var j=a.paths;for(b=0;j.length>b;b++){var k=j[b],l=k[k.length-1],m=l.extendList;for(f=m?m.slice(0).concat(g):g,f&&(f=f.map(function(a){return a.clone()})),d=0;f.length>d;d++)this.foundExtends=!0,e=f[d],e.findSelfSelectors(k),e.ruleset=a,0===d&&(e.firstExtendOnThisSelectorPath=!0),this.allExtendsStack[this.allExtendsStack.length-1].push(e)}this.contexts.push(a.selectors)}},visitRulesetOut:function(a){a.root||(this.contexts.length=this.contexts.length-1)},visitMedia:function(a){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}};var g=function(){this._visitor=new d(this)};g.prototype={run:function(a){var b=new f;if(this.extendIndicies={},b.run(a),!b.foundExtends)return a;a.allExtends=a.allExtends.concat(this.doExtendChaining(a.allExtends,a.allExtends)),this.allExtendsStack=[a.allExtends];var c=this._visitor.visit(a);return this.checkExtendsForNonMatched(a.allExtends),c},checkExtendsForNonMatched:function(a){var b=this.extendIndicies;a.filter(function(a){return!a.hasFoundMatches&&1==a.parent_ids.length}).forEach(function(a){var c="_unknown_";try{c=a.selector.toCSS({})}catch(d){}b[a.index+" "+c]||(b[a.index+" "+c]=!0,e.warn("extend '"+c+"' has no matches"))})},doExtendChaining:function(a,b,d){var e,f,g,h,i,j,k,l,m=[],n=this;for(d=d||0,e=0;a.length>e;e++)for(f=0;b.length>f;f++)j=a[e],k=b[f],j.parent_ids.indexOf(k.object_id)>=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&(j.hasFoundMatches=!0,j.selfSelectors.forEach(function(a){h=n.extendSelector(g,i,a),l=new c.Extend(k.selector,k.option,0),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))})));if(m.length){if(this.extendChainCount++,d>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,d+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,c,d,e,f=this.allExtendsStack[this.allExtendsStack.length-1],g=[],h=this;for(d=0;f.length>d;d++)for(c=0;a.paths.length>c;c++)if(e=a.paths[c],!a.extendOnEveryPath){var i=e[e.length-1].extendList;i&&i.length||(b=this.findMatch(f[d],e),b.length&&(f[d].hasFoundMatches=!0,f[d].selfSelectors.forEach(function(a){g.push(h.extendSelector(b,e,a))})))}a.paths=a.paths.concat(g)}},findMatch:function(a,b){var c,d,e,f,g,h,i,j=this,k=a.selector.elements,l=[],m=[];for(c=0;b.length>c;c++)for(d=b[c],e=0;d.elements.length>e;e++)for(f=d.elements[e],(a.allowBefore||0===c&&0===e)&&l.push({pathIndex:c,index:e,matched:0,initialCombinator:f.combinator}),h=0;l.length>h;h++)i=l[h],g=f.combinator.value,""===g&&0===e&&(g=" "),!j.isElementValuesEqual(k[i.matched].value,f.value)||i.matched>0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(d.elements.length>e+1||b.length>c+1)&&(i=null)),i?i.finished&&(i.length=k.length,i.endPathIndex=c,i.endPathElementIndex=e+1,l.length=0,m.push(i)):(l.splice(h,1),h--);return m},isElementValuesEqual:function(a,b){if("string"==typeof a||"string"==typeof b)return a===b;if(a instanceof c.Attribute)return a.op!==b.op||a.key!==b.key?!1:a.value&&b.value?(a=a.value.value||a.value,b=b.value.value||b.value,a===b):a.value||b.value?!1:!0;if(a=a.value,b=b.value,a instanceof c.Selector){if(!(b instanceof c.Selector)||a.elements.length!==b.elements.length)return!1;for(var d=0;a.elements.length>d;d++){if(a.elements[d].combinator.value!==b.elements[d].combinator.value&&(0!==d||(a.elements[d].combinator.value||" ")!==(b.elements[d].combinator.value||" ")))return!1;if(!this.isElementValuesEqual(a.elements[d].value,b.elements[d].value))return!1}return!0}return!1},extendSelector:function(a,b,d){var e,f,g,h,i,j=0,k=0,l=[];for(e=0;a.length>e;e++)h=a[e],f=b[h.pathIndex],g=new c.Element(h.initialCombinator,d.elements[0].value,d.elements[0].index,d.elements[0].currentFileInfo),h.pathIndex>j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(b[j].elements.slice(k)),k=0,j++),i=f.elements.slice(k,h.index).concat([g]).concat(d.elements.slice(1)),j===h.pathIndex&&e>0?l[l.length-1].elements=l[l.length-1].elements.concat(i):(l=l.concat(b.slice(j,h.pathIndex)),l.push(new c.Selector(i))),j=h.endPathIndex,k=h.endPathElementIndex,k>=b[j].elements.length&&(k=0,j++);return b.length>j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(b[j].elements.slice(k)),j++),l=l.concat(b.slice(j,b.length))},visitRulesetOut:function(){},visitMedia:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitMediaOut:function(){var a=this.allExtendsStack.length-1;this.checkExtendsForNonMatched(this.allExtendsStack[a]),this.allExtendsStack.length=a},visitDirective:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitDirectiveOut:function(){var a=this.allExtendsStack.length-1;this.checkExtendsForNonMatched(this.allExtendsStack[a]),this.allExtendsStack.length=a}},b.exports=g},{"../logger":31,"../tree":59,"./visitor":87}],82:[function(a,b){function c(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}c.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},c.prototype.addVariableImport=function(a){this.variableImports.push(a)},c.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return;this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},b.exports=c},{}],83:[function(a,b){var c=a("../contexts"),d=a("./visitor"),e=a("./import-sequencer"),f=function(a,b){this._visitor=new d(this),this._importer=a,this._finish=b,this.context=new c.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new e(this._onSequencerEmpty.bind(this))};f.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var d=a.options.inline;if(!a.css||d){var e=new c.Eval(this.context,this.context.frames.slice(0)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.index,f.filename=a.currentFileInfo.filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;c.rules.length>h;h++)if(c.rules[h]===a){c.rules[h]=d;break}var i=this.onImported.bind(this,d,b),j=this._sequencer.addImport(i);this._importer.push(d.getPath(),g,d.currentFileInfo,d.options,j)}},onImported:function(a,b,c,d,e,f){c&&(c.filename||(c.index=a.index,c.filename=a.currentFileInfo.filename),this.error=c);var g=this,h=a.options.inline,i=e||f in g.recursionDetector;if(b.importMultiple||(a.skip=i?!0:function(){return f in g.onceFileDetectionMap?!0:(g.onceFileDetectionMap[f]=!0,!1)}),d&&(a.root=d,a.importedFilename=f,!h&&(b.importMultiple||!i))){g.recursionDetector[f]=!0;var j=this.context;this.context=b;try{this._visitor.visit(d)}catch(c){this.error=c}this.context=j}g.importCount--,g.isFinished&&g._sequencer.tryRun()},visitRule:function(a,b){b.visitDeeper=!1},visitDirective:function(a){this.context.frames.unshift(a)},visitDirectiveOut:function(){this.context.frames.shift()},visitMixinDefinition:function(a){this.context.frames.unshift(a)},visitMixinDefinitionOut:function(){this.context.frames.shift()},visitRuleset:function(a){this.context.frames.unshift(a)},visitRulesetOut:function(){this.context.frames.shift()},visitMedia:function(a){this.context.frames.unshift(a.rules[0])},visitMediaOut:function(){this.context.frames.shift()}},b.exports=f},{"../contexts":10,"./import-sequencer":82,"./visitor":87}],84:[function(a,b){var c={Visitor:a("./visitor"),ImportVisitor:a("./import-visitor"),ExtendVisitor:a("./extend-visitor"),JoinSelectorVisitor:a("./join-selector-visitor"),ToCSSVisitor:a("./to-css-visitor")};b.exports=c},{"./extend-visitor":81,"./import-visitor":83,"./join-selector-visitor":85,"./to-css-visitor":86,"./visitor":87}],85:[function(a,b){var c=a("./visitor"),d=function(){this.contexts=[[]],this._visitor=new c(this)};d.prototype={run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){var b,c=this.contexts[this.contexts.length-1],d=[];this.contexts.push(d),a.root||(b=a.selectors,b&&(b=b.filter(function(a){return a.getIsOutput()}),a.selectors=b.length?b:b=null,b&&a.joinSelectors(d,c,b)),b||(a.rules=null),a.paths=d)},visitRulesetOut:function(){this.contexts.length=this.contexts.length-1},visitMedia:function(a){var b=this.contexts[this.contexts.length-1];a.rules[0].root=0===b.length||b[0].multiMedia}},b.exports=d},{"./visitor":87}],86:[function(a,b){var c=a("../tree"),d=a("./visitor"),e=function(a){this._visitor=new d(this),this._context=a};e.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a){return a.variable?void 0:a},visitMixinDefinition:function(a){a.frames=[]},visitExtend:function(){},visitComment:function(a){return a.isSilent(this._context)?void 0:a},visitMedia:function(a,b){return a.accept(this._visitor),b.visitDeeper=!1,a.rules.length?a:void 0},visitDirective:function(a,b){if("@charset"===a.name){if(!a.getIsReferenced())return;if(this.charset){if(a.debugInfo){var d=new c.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return d.debugInfo=a.debugInfo,this._visitor.visit(d)}return}this.charset=!0}if(a.rules&&a.rules.rules){if(this._mergeRules(a.rules.rules),a.accept(this._visitor),b.visitDeeper=!1,a.getIsReferenced())return a;if(!a.rules.rules)return;for(var e=0;a.rules.rules.length>e;e++){var f=a.rules.rules[e];if(f.getIsReferenced&&f.getIsReferenced())return a.markReferenced(),a}}else if(a.getIsReferenced())return a},checkPropertiesInRoot:function(a){for(var b,d=0;a.length>d;d++)if(b=a[d],b instanceof c.Rule&&!b.variable)throw{message:"properties must be inside selector blocks, they cannot be in the root.",index:b.index,filename:b.currentFileInfo?b.currentFileInfo.filename:null}},visitRuleset:function(a,b){var d,e=[];if(a.firstRoot&&this.checkPropertiesInRoot(a.rules),a.root)a.accept(this._visitor),b.visitDeeper=!1,(a.firstRoot||a.rules&&a.rules.length>0)&&e.splice(0,0,a);else{a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new c.Combinator("")),b=0;a.length>b;b++)if(a[b].getIsReferenced()&&a[b].getIsOutput())return!0;return!1}));for(var f=a.rules,g=f?f.length:0,h=0;g>h;)d=f[h],d&&d.rules?(e.push(this._visitor.visit(d)),f.splice(h,1),g--):h++;g>0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1,f=a.rules,f&&(this._mergeRules(f),f=a.rules),f&&(this._removeDuplicateRules(f),f=a.rules),f&&f.length>0&&a.paths.length>0&&e.splice(0,0,a)}return 1===e.length?e[0]:e},_removeDuplicateRules:function(a){if(a){var b,d,e,f={};for(e=a.length-1;e>=0;e--)if(d=a[e],d instanceof c.Rule)if(f[d.name]){b=f[d.name],b instanceof c.Rule&&(b=f[d.name]=[f[d.name].toCSS(this._context)]);var g=d.toCSS(this._context);-1!==b.indexOf(g)?a.splice(e,1):b.push(g)}else f[d.name]=d}},_mergeRules:function(a){if(a){for(var b,d,e,f={},g=0;a.length>g;g++)d=a[g],d instanceof c.Rule&&d.merge&&(e=[d.name,d.important?"!":""].join(","),f[e]?a.splice(g--,1):f[e]=[],f[e].push(d));Object.keys(f).map(function(a){function e(a){return new c.Expression(a.map(function(a){return a.value}))}function g(a){return new c.Value(a.map(function(a){return a}))}if(b=f[a],b.length>1){d=b[0];var h=[],i=[];b.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),d.value=g(h)}})}}},b.exports=e},{"../tree":59,"./visitor":87}],87:[function(a,b){function c(a){return a}function d(a,b){var c,e;for(c in a)if(a.hasOwnProperty(c))switch(e=a[c],typeof e){case"function":e.prototype&&e.prototype.type&&(e.prototype.typeIndex=b++);break;case"object":b=d(e,b)}return b}var e=a("../tree"),f={visitDeeper:!0},g=!1,h=function(a){this._implementation=a,this._visitFnCache=[],g||(d(e,1),g=!0)};h.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a;var d,e=this._visitFnCache,g=this._implementation,h=b<<1,i=1|h,j=e[h],k=e[i],l=f;if(l.visitDeeper=!0,j||(d="visit"+a.type,j=g[d]||c,k=g[d+"Out"]||c,e[h]=j,e[i]=k),j!==c){var m=j.call(g,a,l);g.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=c&&k.call(g,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;d>c;c++)this.visit(a[c]);return a}var e=[];for(c=0;d>c;c++){var f=this.visit(a[c]);void 0!==f&&(f.splice?f.length&&this.flatten(f,e):e.push(f))}return e},flatten:function(a,b){b||(b=[]);var c,d,e,f,g,h;for(d=0,c=a.length;c>d;d++)if(e=a[d],void 0!==e)if(e.splice)for(g=0,f=e.length;f>g;g++)h=e[g],void 0!==h&&(h.splice?h.length&&this.flatten(h,b):b.push(h));else b.push(e);return b}},b.exports=h},{"../tree":59}],88:[function(a,b){function c(){}var d=b.exports={};d.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.MutationObserver,c="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};var d=[];if(b){var e=document.createElement("div"),f=new MutationObserver(function(){var a=d.slice();d.length=0,a.forEach(function(a){a()})});return f.observe(e,{attributes:!0}),function(a){d.length||e.setAttribute("yes","no"),d.push(a)}}return c?(window.addEventListener("message",function(a){var b=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),d.length>0)){var c=d.shift();c()}},!0),function(a){d.push(a),window.postMessage("process-tick","*")}):function(a){setTimeout(a,0)}}(),d.title="browser",d.browser=!0,d.env={},d.argv=[],d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(){throw new Error("process.binding is not supported") +},d.cwd=function(){return"/"},d.chdir=function(){throw new Error("process.chdir is not supported")}},{}],89:[function(a,b){"use strict";function c(a){function b(a){return null===i?void k.push(a):void f(function(){var b=i?a.onFulfilled:a.onRejected;if(null===b)return void(i?a.resolve:a.reject)(j);var c;try{c=b(j)}catch(d){return void a.reject(d)}a.resolve(c)})}function c(a){try{if(a===l)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var b=a.then;if("function"==typeof b)return void e(b.bind(a),c,g)}i=!0,j=a,h()}catch(d){g(d)}}function g(a){i=!1,j=a,h()}function h(){for(var a=0,c=k.length;c>a;a++)b(k[a]);k=null}if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");var i=null,j=null,k=[],l=this;this.then=function(a,c){return new l.constructor(function(e,f){b(new d(a,c,e,f))})},e(a,c,g)}function d(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function e(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var f=a("asap");b.exports=c},{asap:91}],90:[function(a,b){"use strict";function c(a){this.then=function(b){return"function"!=typeof b?this:new d(function(c,d){e(function(){try{c(b(a))}catch(e){d(e)}})})}}var d=a("./core.js"),e=a("asap");b.exports=d,c.prototype=d.prototype;var f=new c(!0),g=new c(!1),h=new c(null),i=new c(void 0),j=new c(0),k=new c("");d.resolve=function(a){if(a instanceof d)return a;if(null===a)return h;if(void 0===a)return i;if(a===!0)return f;if(a===!1)return g;if(0===a)return j;if(""===a)return k;if("object"==typeof a||"function"==typeof a)try{var b=a.then;if("function"==typeof b)return new d(b.bind(a))}catch(e){return new d(function(a,b){b(e)})}return new c(a)},d.all=function(a){var b=Array.prototype.slice.call(a);return new d(function(a,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}b[f]=g,0===--e&&a(b)}catch(i){c(i)}}if(0===b.length)return a([]);for(var e=b.length,f=0;b.length>f;f++)d(f,b[f])})},d.reject=function(a){return new d(function(b,c){c(a)})},d.race=function(a){return new d(function(b,c){a.forEach(function(a){d.resolve(a).then(b,c)})})},d.prototype["catch"]=function(a){return this.then(null,a)}},{"./core.js":89,asap:91}],91:[function(a,b){(function(a){function c(){for(;e.next;){e=e.next;var a=e.task;e.task=void 0;var b=e.domain;b&&(e.domain=void 0,b.enter());try{a()}catch(d){if(i)throw b&&b.exit(),setTimeout(c,0),b&&b.enter(),d;setTimeout(function(){throw d},0)}b&&b.exit()}g=!1}function d(b){f=f.next={task:b,domain:i&&a.domain,next:null},g||(g=!0,h())}var e={task:void 0,next:null},f=e,g=!1,h=void 0,i=!1;if("undefined"!=typeof a&&a.nextTick)i=!0,h=function(){a.nextTick(c)};else if("function"==typeof setImmediate)h="undefined"!=typeof window?setImmediate.bind(window,c):function(){setImmediate(c)};else if("undefined"!=typeof MessageChannel){var j=new MessageChannel;j.port1.onmessage=c,h=function(){j.port2.postMessage(0)}}else h=function(){setTimeout(c,0)};b.exports=d}).call(this,a("_process"))},{_process:88}],92:[function(){"function"!=typeof Promise.prototype.done&&(Promise.prototype.done=function(){var a=arguments.length?this.then.apply(this,arguments):this;a.then(null,function(a){setTimeout(function(){throw a},0)})})},{}],"promise/polyfill.js":[function(a){a("asap");"undefined"==typeof Promise&&(Promise=a("./lib/core.js"),a("./lib/es6-extensions.js")),a("./polyfill-done.js")},{"./lib/core.js":89,"./lib/es6-extensions.js":90,"./polyfill-done.js":92,asap:91}]},{},[2])(2)}); \ No newline at end of file diff --git a/lib/less/index.js b/lib/less/index.js index b16a4bcb..1b40fcc0 100644 --- a/lib/less/index.js +++ b/lib/less/index.js @@ -2,7 +2,7 @@ module.exports = function(environment, fileManagers) { var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment; var less = { - version: [2, 2, 0], + version: [2, 3, 0], data: require('./data'), tree: require('./tree'), Environment: (Environment = require("./environment/environment")), diff --git a/package.json b/package.json index bfc44daa..332d120b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "less", - "version": "2.2.0", + "version": "2.3.0", "description": "Leaner CSS", "homepage": "http://lesscss.org", "author": { From 7eb3d636321f494bf08a76583b602120b3f28748 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Tue, 27 Jan 2015 17:35:33 +0000 Subject: [PATCH 24/29] Prevent double protocol in debug info. Fixes #2383 --- lib/less/tree/debug-info.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/less/tree/debug-info.js b/lib/less/tree/debug-info.js index 2b9292a3..1e79f3de 100644 --- a/lib/less/tree/debug-info.js +++ b/lib/less/tree/debug-info.js @@ -21,8 +21,12 @@ debugInfo.asComment = function(ctx) { }; debugInfo.asMediaQuery = function(ctx) { + var filenameWithProtocol = ctx.debugInfo.fileName; + if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { + filenameWithProtocol = 'file://' + filenameWithProtocol; + } return '@media -sass-debug-info{filename{font-family:' + - ('file://' + ctx.debugInfo.fileName).replace(/([.:\/\\])/g, function (a) { + filenameWithProtocol.replace(/([.:\/\\])/g, function (a) { if (a == '\\') { a = '\/'; } From 379968773e76d41859d483b40e2f7f5065a9e644 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Tue, 27 Jan 2015 17:40:18 +0000 Subject: [PATCH 25/29] disallow weird type conversion --- .jscsrc | 2 +- lib/less/parser/parser.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.jscsrc b/.jscsrc index c42a02e8..c192399f 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,5 +1,5 @@ { - "disallowImplicitTypeConversion": [/*"numeric", "boolean", "binary", "string"*/], /* should be true*/ + "disallowImplicitTypeConversion": ["numeric", "boolean", "binary", "string"], "disallowMixedSpacesAndTabs": true, "disallowMultipleLineBreaks": true, "disallowTrailingWhitespace": true diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index 22738698..a56dc879 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -1607,7 +1607,7 @@ Parser.serializeVars = function(vars) { if (Object.hasOwnProperty.call(vars, name)) { var value = vars[name]; s += ((name[0] === '@') ? '' : '@') + name +': '+ value + - ((('' + value).slice(-1) === ';') ? '' : ';'); + ((String(value).slice(-1) === ';') ? '' : ';'); } } From 08a7f9ebeb918b57aaaee6cea2a78050c489225e Mon Sep 17 00:00:00 2001 From: Luke Page Date: Tue, 27 Jan 2015 21:38:13 +0000 Subject: [PATCH 26/29] more whitespace rules --- .jscsrc | 12 +++++++++- bin/lessc | 7 ++++-- lib/less/functions/data-uri.js | 3 ++- lib/less/functions/string.js | 4 +++- lib/less/functions/svg.js | 7 ++++-- lib/less/functions/types.js | 4 +++- lib/less/import-manager.js | 5 +++- lib/less/parser/parser.js | 11 +++++---- lib/less/tree/condition.js | 2 +- lib/less/tree/mixin-definition.js | 7 +++--- lib/less/visitors/extend-visitor.js | 36 ++++++++++++++++++----------- lib/less/visitors/import-visitor.js | 3 ++- 12 files changed, 69 insertions(+), 32 deletions(-) diff --git a/.jscsrc b/.jscsrc index c192399f..99b33aed 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,6 +1,16 @@ { "disallowImplicitTypeConversion": ["numeric", "boolean", "binary", "string"], + "disallowKeywords": ["with"], "disallowMixedSpacesAndTabs": true, "disallowMultipleLineBreaks": true, - "disallowTrailingWhitespace": true + "disallowOperatorBeforeLineBreak": ["."], + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"], + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "disallowSpacesInCallExpression": true, + "disallowSpacesInNamedFunctionExpression": { + "beforeOpeningRoundBrace": true + }, + "disallowTrailingComma": true, + "disallowTrailingWhitespace": true, + "maximumLineLength": 160 } \ No newline at end of file diff --git a/bin/lessc b/bin/lessc index 46f64219..b507b309 100755 --- a/bin/lessc +++ b/bin/lessc @@ -243,7 +243,8 @@ function printUsage() { if (plugin) { plugins.push(plugin); } else { - console.log("Unable to load plugin " + name + " please make sure that it is installed under or at the same level as less"); + console.log("Unable to load plugin " + name + + " please make sure that it is installed under or at the same level as less"); console.log(); printUsage(); currentErrorcode = 1; @@ -254,7 +255,9 @@ function printUsage() { if (plugin) { plugins.push(plugin); } else { - console.log("Unable to interpret argument " + arg + " - if it is a plugin (less-plugin-" + arg + "), make sure that it is installed under or at the same level as less"); + console.log("Unable to interpret argument " + arg + + " - if it is a plugin (less-plugin-" + arg + "), make sure that it is installed under or at" + + " the same level as less"); console.log(); printUsage(); currentErrorcode = 1; diff --git a/lib/less/functions/data-uri.js b/lib/less/functions/data-uri.js index ce8e50da..c4f0f4aa 100644 --- a/lib/less/functions/data-uri.js +++ b/lib/less/functions/data-uri.js @@ -73,7 +73,8 @@ module.exports = function(environment) { if (uri.length >= DATA_URI_MAX) { if (this.context.ieCompat !== false) { - logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length + " characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!"); + logger.warn("Skipped data-uri embedding of " + filePath + " because its size (" + uri.length + + " characters) exceeds IE8-safe " + DATA_URI_MAX + " characters!"); return fallback(this, filePathNode || mimetypeNode); } diff --git a/lib/less/functions/string.js b/lib/less/functions/string.js index 1b55d4cf..31fbf6bf 100644 --- a/lib/less/functions/string.js +++ b/lib/less/functions/string.js @@ -8,7 +8,9 @@ functionRegistry.addMultiple({ return new Anonymous(str instanceof JavaScript ? str.evaluated : str.value); }, escape: function (str) { - return new Anonymous(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29")); + return new Anonymous( + encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B") + .replace(/\(/g, "%28").replace(/\)/g, "%29")); }, replace: function (string, pattern, replacement, flags) { var result = string.value; diff --git a/lib/less/functions/svg.js b/lib/less/functions/svg.js index ceec5856..92336d13 100644 --- a/lib/less/functions/svg.js +++ b/lib/less/functions/svg.js @@ -9,7 +9,9 @@ module.exports = function(environment) { functionRegistry.add("svg-gradient", function(direction) { function throwArgumentDescriptor() { - throw { type: "Argument", message: "svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]" }; + throw { type: "Argument", + message: "svg-gradient expects direction, start_color [start_position], [color position,]...," + + " end_color [end_position]" }; } if (arguments.length < 3) { @@ -44,7 +46,8 @@ module.exports = function(environment) { rectangleDimension = 'x="-50" y="-50" width="101" height="101"'; break; default: - throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'" }; + throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right'," + + " 'to bottom right', 'to top right' or 'ellipse at center'" }; } returner = '' + '' + diff --git a/lib/less/functions/types.js b/lib/less/functions/types.js index adc13472..da712862 100644 --- a/lib/less/functions/types.js +++ b/lib/less/functions/types.js @@ -52,7 +52,9 @@ functionRegistry.addMultiple({ isunit: isunit, unit: function (val, unit) { if(!(val instanceof Dimension)) { - throw { type: "Argument", message: "the first argument to unit must be a number" + (val instanceof Operation ? ". Have you forgotten parenthesis?" : "") }; + throw { type: "Argument", + message: "the first argument to unit must be a number" + + (val instanceof Operation ? ". Have you forgotten parenthesis?" : "") }; } if (unit) { if (unit instanceof Keyword) { diff --git a/lib/less/import-manager.js b/lib/less/import-manager.js index 79ac50eb..316df791 100644 --- a/lib/less/import-manager.js +++ b/lib/less/import-manager.js @@ -82,7 +82,10 @@ module.exports = function(environment) { // then rootpath should become 'less/../' newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename); if(newFileInfo.relativeUrls) { - newFileInfo.rootpath = fileManager.join((importManager.context.rootpath || ""), fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath)); + newFileInfo.rootpath = fileManager.join( + (importManager.context.rootpath || ""), + fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath)); + if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) { newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath); } diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index a56dc879..5a30e555 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -454,7 +454,9 @@ var Parser = function Parser(context, imports, fileInfo) { var rgb; if (parserInput.currentChar() === '#' && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))) { - var colorCandidateString = rgb.input.match(/^#([\w]+).*/); // strip colons, brackets, whitespaces and other characters that should not definitely be part of color string + // strip colons, brackets, whitespaces and other characters that should not + // definitely be part of color string + var colorCandidateString = rgb.input.match(/^#([\w]+).*/); colorCandidateString = colorCandidateString[1]; if (!colorCandidateString.match(/^[A-Fa-f0-9]+$/)) { // verify if candidate consists only of allowed HEX characters error("Invalid HEX color code"); @@ -861,9 +863,10 @@ var Parser = function Parser(context, imports, fileInfo) { c = this.combinator(); - e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || - parserInput.$char('*') || parserInput.$char('&') || this.attribute() || parserInput.$re(/^\([^()@]+\)/) || parserInput.$re(/^[\.#:](?=@)/) || - this.entities.variableCurly(); + e = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || + parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || + parserInput.$char('*') || parserInput.$char('&') || this.attribute() || + parserInput.$re(/^\([^()@]+\)/) || parserInput.$re(/^[\.#:](?=@)/) || this.entities.variableCurly(); if (! e) { parserInput.save(); diff --git a/lib/less/tree/condition.js b/lib/less/tree/condition.js index a451593d..3278942b 100644 --- a/lib/less/tree/condition.js +++ b/lib/less/tree/condition.js @@ -26,7 +26,7 @@ Condition.prototype.eval = function (context) { default: return false; } } - }) (this.op, this.lvalue.eval(context), this.rvalue.eval(context)); + })(this.op, this.lvalue.eval(context), this.rvalue.eval(context)); return this.negate ? !result : result; }; diff --git a/lib/less/tree/mixin-definition.js b/lib/less/tree/mixin-definition.js index 41b74a18..5320c081 100644 --- a/lib/less/tree/mixin-definition.js +++ b/lib/less/tree/mixin-definition.js @@ -132,9 +132,10 @@ Definition.prototype.evalCall = function (context, args, important) { Definition.prototype.matchCondition = function (args, context) { if (this.condition && !this.condition.eval( new contexts.Eval(context, - [this.evalParams(context, new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])] // the parameter variables - .concat(this.frames) // the parent namespace/mixin frames - .concat(context.frames)))) { // the current environment frames + [this.evalParams(context, /* the parameter variables*/ + new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [])] + .concat(this.frames) // the parent namespace/mixin frames + .concat(context.frames)))) { // the current environment frames return false; } return true; diff --git a/lib/less/visitors/extend-visitor.js b/lib/less/visitors/extend-visitor.js index 5df87df0..df164367 100644 --- a/lib/less/visitors/extend-visitor.js +++ b/lib/less/visitors/extend-visitor.js @@ -122,15 +122,16 @@ ProcessExtendsVisitor.prototype = { }, doExtendChaining: function (extendsList, extendsListTarget, iterationCount) { // - // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering and pasting - // the selector we would do normally, but we are also adding an extend with the same target selector + // chaining is different from normal extension.. if we extend an extend then we are not just copying, altering + // and pasting the selector we would do normally, but we are also adding an extend with the same target selector // this means this new extend can then go and alter other extends // // this method deals with all the chaining work - without it, extend is flat and doesn't work on other extend selectors - // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already processed if - // we look at each selector at a time, as is done in visitRuleset + // this is also the most expensive.. and a match on one selector can cause an extension of a selector we had already + // processed if we look at each selector at a time, as is done in visitRuleset - var extendIndex, targetExtendIndex, matches, extendsToAdd = [], newSelector, extendVisitor = this, selectorPath, extend, targetExtend, newExtend; + var extendIndex, targetExtendIndex, matches, extendsToAdd = [], newSelector, extendVisitor = this, selectorPath, + extend, targetExtend, newExtend; iterationCount = iterationCount || 0; @@ -202,10 +203,12 @@ ProcessExtendsVisitor.prototype = { selectorTwo = extendsToAdd[0].selector.toCSS(); } catch(e) {} - throw {message: "extend circular reference detected. One of the circular extends is currently:"+selectorOne+":extend(" + selectorTwo+")"}; + throw { message: "extend circular reference detected. One of the circular extends is currently:" + + selectorOne + ":extend(" + selectorTwo + ")"}; } - // now process the new extends on the existing rules so that we can handle a extending b extending c ectending d extending e... + // now process the new extends on the existing rules so that we can handle a extending b extending c extending + // d extending e... return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount+1)); } else { return extendsToAdd; @@ -224,7 +227,8 @@ ProcessExtendsVisitor.prototype = { if (rulesetNode.root) { return; } - var matches, pathIndex, extendIndex, allExtends = this.allExtendsStack[this.allExtendsStack.length-1], selectorsToAdd = [], extendVisitor = this, selectorPath; + var matches, pathIndex, extendIndex, allExtends = this.allExtendsStack[this.allExtendsStack.length-1], + selectorsToAdd = [], extendVisitor = this, selectorPath; // look at each selector path in the ruleset, find any extend matches and then copy, find and replace @@ -271,15 +275,16 @@ ProcessExtendsVisitor.prototype = { // if we allow elements before our match we can add a potential match every time. otherwise only at the first element. if (extend.allowBefore || (haystackSelectorIndex === 0 && hackstackElementIndex === 0)) { - potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0, initialCombinator: haystackElement.combinator}); + potentialMatches.push({pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0, + initialCombinator: haystackElement.combinator}); } for(i = 0; i < potentialMatches.length; i++) { potentialMatch = potentialMatches[i]; // selectors add " " onto the first element. When we use & it joins the selectors together, but if we don't - // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to work out - // what the resulting combinator will be + // then each selector in haystackSelectorPath has a space before it added in the toCSS phase. so we need to + // work out what the resulting combinator will be targetCombinator = haystackElement.combinator.value; if (targetCombinator === '' && hackstackElementIndex === 0) { targetCombinator = ' '; @@ -297,7 +302,8 @@ ProcessExtendsVisitor.prototype = { if (potentialMatch) { potentialMatch.finished = potentialMatch.matched === needleElements.length; if (potentialMatch.finished && - (!extend.allowAfter && (hackstackElementIndex+1 < hackstackSelector.elements.length || haystackSelectorIndex+1 < haystackSelectorPath.length))) { + (!extend.allowAfter && + (hackstackElementIndex+1 < hackstackSelector.elements.length || haystackSelectorIndex+1 < haystackSelectorPath.length))) { potentialMatch = null; } } @@ -381,7 +387,8 @@ ProcessExtendsVisitor.prototype = { ); if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) { - path[path.length - 1].elements = path[path.length - 1].elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); + path[path.length - 1].elements = path[path.length - 1] + .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); currentSelectorPathElementIndex = 0; currentSelectorPathIndex++; } @@ -410,7 +417,8 @@ ProcessExtendsVisitor.prototype = { } if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) { - path[path.length - 1].elements = path[path.length - 1].elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); + path[path.length - 1].elements = path[path.length - 1] + .elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); currentSelectorPathIndex++; } diff --git a/lib/less/visitors/import-visitor.js b/lib/less/visitors/import-visitor.js index e9faf912..80ac2192 100644 --- a/lib/less/visitors/import-visitor.js +++ b/lib/less/visitors/import-visitor.js @@ -84,7 +84,8 @@ ImportVisitor.prototype = { var onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported); - this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.currentFileInfo, evaldImportNode.options, sequencedOnImported); + this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.currentFileInfo, + evaldImportNode.options, sequencedOnImported); } else { this.importCount--; if (this.isFinished) { From 28de1cf788548284c0118d25a70a4cfcffa4971a Mon Sep 17 00:00:00 2001 From: Luke Page Date: Tue, 27 Jan 2015 21:57:07 +0000 Subject: [PATCH 27/29] Require parenthesis --- .jscsrc | 12 +++++++++++- lib/less-node/file-manager.js | 10 +++++++--- lib/less/parser/parser.js | 3 ++- lib/less/tree/directive.js | 18 +++++++++++++++--- lib/less/tree/media.js | 5 +++-- lib/less/tree/ruleset.js | 9 ++++++--- lib/less/tree/selector.js | 3 ++- lib/less/visitors/to-css-visitor.js | 3 ++- test/copy-bom.js | 22 ++++++++++++++-------- test/modify-vars.js | 14 ++++++++------ 10 files changed, 70 insertions(+), 29 deletions(-) diff --git a/.jscsrc b/.jscsrc index 99b33aed..0634ec2d 100644 --- a/.jscsrc +++ b/.jscsrc @@ -12,5 +12,15 @@ }, "disallowTrailingComma": true, "disallowTrailingWhitespace": true, - "maximumLineLength": 160 + "maximumLineLength": 160, + "requireCommaBeforeLineBreak": true, + "requireCurlyBraces": [ + "if", + "else", + "for", + "while", + "do", + "try", + "catch" + ] } \ No newline at end of file diff --git a/lib/less-node/file-manager.js b/lib/less-node/file-manager.js index 76092897..242632bf 100644 --- a/lib/less-node/file-manager.js +++ b/lib/less-node/file-manager.js @@ -30,7 +30,7 @@ FileManager.prototype.loadFile = function(filename, currentDirectory, options, e } var paths = isAbsoluteFilename ? [""] : [currentDirectory]; - if (options.paths) paths.push.apply(paths, options.paths); + if (options.paths) { paths.push.apply(paths, options.paths); } if (!isAbsoluteFilename && paths.indexOf('.') === -1) { paths.push('.'); } // promise is guarenteed to be asyncronous @@ -67,8 +67,12 @@ FileManager.prototype.loadFileSync = function(filename, currentDirectory, option options = options || {}; paths = isAbsoluteFilename ? [""] : [currentDirectory]; - if (options.paths) paths.push.apply(paths, options.paths); - if (!isAbsoluteFilename && paths.indexOf('.') === -1) { paths.push('.'); } + if (options.paths) { + paths.push.apply(paths, options.paths); + } + if (!isAbsoluteFilename && paths.indexOf('.') === -1) { + paths.push('.'); + } var err, result; for (var i = 0; i < paths.length; i++) { diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index 5a30e555..43649161 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -552,8 +552,9 @@ var Parser = function Parser(context, imports, fileInfo) { } option = option && option[1]; - if (!elements) + if (!elements) { error("Missing target selector for :extend()."); + } extend = new(tree.Extend)(new(tree.Selector)(elements), option, index); if (extendList) { extendList.push(extend); } else { extendList = [ extend ]; } diff --git a/lib/less/tree/directive.js b/lib/less/tree/directive.js index 20c0eb31..d73268c3 100644 --- a/lib/less/tree/directive.js +++ b/lib/less/tree/directive.js @@ -59,9 +59,21 @@ Directive.prototype.eval = function (context) { return new Directive(this.name, value, rules, this.index, this.currentFileInfo, this.debugInfo, this.isReferenced); }; -Directive.prototype.variable = function (name) { if (this.rules) return Ruleset.prototype.variable.call(this.rules, name); }; -Directive.prototype.find = function () { if (this.rules) return Ruleset.prototype.find.apply(this.rules, arguments); }; -Directive.prototype.rulesets = function () { if (this.rules) return Ruleset.prototype.rulesets.apply(this.rules); }; +Directive.prototype.variable = function (name) { + if (this.rules) { + return Ruleset.prototype.variable.call(this.rules, name); + } +}; +Directive.prototype.find = function () { + if (this.rules) { + return Ruleset.prototype.find.apply(this.rules, arguments); + } +}; +Directive.prototype.rulesets = function () { + if (this.rules) { + return Ruleset.prototype.rulesets.apply(this.rules); + } +}; Directive.prototype.markReferenced = function () { var i, rules; this.isReferenced = true; diff --git a/lib/less/tree/media.js b/lib/less/tree/media.js index e1436c13..cd30b9c7 100644 --- a/lib/less/tree/media.js +++ b/lib/less/tree/media.js @@ -154,8 +154,9 @@ Media.prototype.permute = function (arr) { } }; Media.prototype.bubbleSelectors = function (selectors) { - if (!selectors) - return; + if (!selectors) { + return; + } this.rules = [new Ruleset(selectors.slice(0), [this.rules[0]])]; }; module.exports = Media; diff --git a/lib/less/tree/ruleset.js b/lib/less/tree/ruleset.js index cd63e85d..09239f33 100644 --- a/lib/less/tree/ruleset.js +++ b/lib/less/tree/ruleset.js @@ -423,8 +423,9 @@ Ruleset.prototype.markReferenced = function () { if (this.rules) { for (s = 0; s < this.rules.length; s++) { - if (this.rules[s].markReferenced) + if (this.rules[s].markReferenced) { this.rules[s].markReferenced(); + } } } }; @@ -435,8 +436,9 @@ Ruleset.prototype.getIsReferenced = function() { for (i=0; i Date: Tue, 27 Jan 2015 22:02:05 +0000 Subject: [PATCH 28/29] laxbreak --- .jscsrc | 18 +++++++++++++++++- .jshintrc | 1 - lib/less/functions/color-blending.js | 6 +++--- lib/less/functions/color.js | 6 +++--- lib/less/tree/mixin-call.js | 3 +-- lib/less/tree/rule.js | 5 ++--- 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.jscsrc b/.jscsrc index 0634ec2d..8c22adee 100644 --- a/.jscsrc +++ b/.jscsrc @@ -22,5 +22,21 @@ "do", "try", "catch" - ] + ], + "requireOperatorBeforeLineBreak": [ + "?", + "=", + "+", + "-", + "/", + "*", + "==", + "===", + "!=", + "!==", + ">", + ">=", + "<", + "<=" + ] } \ No newline at end of file diff --git a/.jshintrc b/.jshintrc index 42606dc0..c189e87d 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,6 +1,5 @@ { "evil": true, - "laxbreak": true, "latedef": true, "node": true, "undef": true, diff --git a/lib/less/functions/color-blending.js b/lib/less/functions/color-blending.js index 4d62c9a9..cc192b63 100644 --- a/lib/less/functions/color-blending.js +++ b/lib/less/functions/color-blending.js @@ -33,9 +33,9 @@ var colorBlendModeFunctions = { }, overlay: function(cb, cs) { cb *= 2; - return (cb <= 1) - ? colorBlendModeFunctions.multiply(cb, cs) - : colorBlendModeFunctions.screen(cb - 1, cs); + return (cb <= 1) ? + colorBlendModeFunctions.multiply(cb, cs) : + colorBlendModeFunctions.screen(cb - 1, cs); }, softlight: function(cb, cs) { var d = 1, e = cb; diff --git a/lib/less/functions/color.js b/lib/less/functions/color.js index 2499dcd5..85d03865 100644 --- a/lib/less/functions/color.js +++ b/lib/less/functions/color.js @@ -127,9 +127,9 @@ colorFunctions = { }, luminance: function (color) { var luminance = - (0.2126 * color.rgb[0] / 255) - + (0.7152 * color.rgb[1] / 255) - + (0.0722 * color.rgb[2] / 255); + (0.2126 * color.rgb[0] / 255) + + (0.7152 * color.rgb[1] / 255) + + (0.0722 * color.rgb[2] / 255); return new Dimension(luminance * color.alpha * 100, '%'); }, diff --git a/lib/less/tree/mixin-call.js b/lib/less/tree/mixin-call.js index c4cf32d9..5eecf714 100644 --- a/lib/less/tree/mixin-call.js +++ b/lib/less/tree/mixin-call.js @@ -105,8 +105,7 @@ MixinCall.prototype.eval = function (context) { defaultResult = defTrue; if ((count[defTrue] + count[defFalse]) > 1) { throw { type: 'Runtime', - message: 'Ambiguous use of `default()` found when matching for `' - + this.format(args) + '`', + message: 'Ambiguous use of `default()` found when matching for `' + this.format(args) + '`', index: this.index, filename: this.currentFileInfo.filename }; } } diff --git a/lib/less/tree/rule.js b/lib/less/tree/rule.js index 119cbafe..a9ebee03 100644 --- a/lib/less/tree/rule.js +++ b/lib/less/tree/rule.js @@ -42,9 +42,8 @@ Rule.prototype.eval = function (context) { if (typeof name !== "string") { // expand 'primitive' name directly to get // things faster (~10% for benchmark.less): - name = (name.length === 1) - && (name[0] instanceof Keyword) - ? name[0].value : evalName(context, name); + name = (name.length === 1) && (name[0] instanceof Keyword) ? + name[0].value : evalName(context, name); variable = false; // never treat expanded interpolation as new variable name } if (name === "font" && !context.strictMath) { From d206167c840fe4b20ab22164989714ee07778798 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Tue, 27 Jan 2015 22:24:12 +0000 Subject: [PATCH 29/29] enforce spaces between operators for consistency --- .jscsrc | 40 +++++++++---------- bin/lessc | 2 +- lib/less-browser/utils.js | 10 ++--- lib/less-node/file-manager.js | 2 +- lib/less-node/url-file-manager.js | 4 +- lib/less-rhino/index.js | 4 +- lib/less/data/unit-conversions.js | 6 +-- lib/less/environment/abstract-file-manager.js | 8 ++-- lib/less/functions/color.js | 8 ++-- lib/less/functions/data-uri.js | 2 +- lib/less/functions/svg.js | 2 +- lib/less/parser/parser.js | 4 +- lib/less/source-map-output.js | 6 +-- lib/less/transform-tree.js | 2 +- lib/less/tree/debug-info.js | 2 +- lib/less/tree/dimension.js | 2 +- lib/less/tree/import.js | 2 +- lib/less/tree/mixin-call.js | 4 +- lib/less/tree/quoted.js | 2 +- lib/less/tree/ruleset.js | 14 +++---- lib/less/tree/url.js | 2 +- lib/less/tree/value.js | 2 +- lib/less/tree/variable.js | 2 +- lib/less/visitors/extend-visitor.js | 20 +++++----- lib/less/visitors/to-css-visitor.js | 6 +-- test/browser/common.js | 6 +-- test/browser/jasmine-jsreporter.js | 4 +- test/index.js | 2 +- test/less-test.js | 4 +- 29 files changed, 85 insertions(+), 89 deletions(-) diff --git a/.jscsrc b/.jscsrc index 8c22adee..6ed2b674 100644 --- a/.jscsrc +++ b/.jscsrc @@ -8,35 +8,31 @@ "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], "disallowSpacesInCallExpression": true, "disallowSpacesInNamedFunctionExpression": { - "beforeOpeningRoundBrace": true - }, + "beforeOpeningRoundBrace": true}, "disallowTrailingComma": true, "disallowTrailingWhitespace": true, "maximumLineLength": 160, "requireCommaBeforeLineBreak": true, - "requireCurlyBraces": [ - "if", + "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", - "catch" - ], - "requireOperatorBeforeLineBreak": [ - "?", - "=", - "+", - "-", - "/", - "*", - "==", - "===", - "!=", - "!==", - ">", - ">=", - "<", - "<=" - ] + "catch"], + "requireOperatorBeforeLineBreak": [ "?", + "=", + "+", + "-", + "/", + "*", + "==", + "===", + "!=", + "!==", + ">", + ">=", + "<", + "<="], + "requireSpaceAfterBinaryOperators": true } \ No newline at end of file diff --git a/bin/lessc b/bin/lessc index b507b309..f1440cf6 100755 --- a/bin/lessc +++ b/bin/lessc @@ -59,7 +59,7 @@ var checkArgFunc = function(arg, option) { var checkBooleanArg = function(arg) { var onOff = /^((on|t|true|y|yes)|(off|f|false|n|no))$/i.exec(arg); if (!onOff) { - console.log(" unable to parse "+arg+" as a boolean. use one of on/t/true/y/yes/off/f/false/n/no"); + console.log(" unable to parse " + arg + " as a boolean. use one of on/t/true/y/yes/off/f/false/n/no"); continueProcessing = false; return false; } diff --git a/lib/less-browser/utils.js b/lib/less-browser/utils.js index 7a645b1b..61b01294 100644 --- a/lib/less-browser/utils.js +++ b/lib/less-browser/utils.js @@ -1,11 +1,11 @@ module.exports = { extractId: function(href) { return href.replace(/^[a-z-]+:\/+?[^\/]+/, '' ) // Remove protocol & domain - .replace(/[\?\&]livereload=\w+/,'' ) // Remove LiveReload cachebuster - .replace(/^\//, '' ) // Remove root / - .replace(/\.[a-zA-Z]+$/, '' ) // Remove simple extension - .replace(/[^\.\w-]+/g, '-') // Replace illegal characters - .replace(/\./g, ':'); // Replace dots with colons(for valid id) + .replace(/[\?\&]livereload=\w+/, '' ) // Remove LiveReload cachebuster + .replace(/^\//, '' ) // Remove root / + .replace(/\.[a-zA-Z]+$/, '' ) // Remove simple extension + .replace(/[^\.\w-]+/g, '-') // Replace illegal characters + .replace(/\./g, ':'); // Replace dots with colons(for valid id) }, addDataAttr: function(options, tag) { for (var opt in tag.dataset) { diff --git a/lib/less-node/file-manager.js b/lib/less-node/file-manager.js index 242632bf..b98628d8 100644 --- a/lib/less-node/file-manager.js +++ b/lib/less-node/file-manager.js @@ -63,7 +63,7 @@ FileManager.prototype.loadFile = function(filename, currentDirectory, options, e }; FileManager.prototype.loadFileSync = function(filename, currentDirectory, options, environment, encoding) { - var fullFilename, paths, filenamesTried=[], isAbsoluteFilename = this.isPathAbsolute(filename),data; + var fullFilename, paths, filenamesTried = [], isAbsoluteFilename = this.isPathAbsolute(filename) , data; options = options || {}; paths = isAbsoluteFilename ? [""] : [currentDirectory]; diff --git a/lib/less-node/url-file-manager.js b/lib/less-node/url-file-manager.js index 5413615c..3e6303ab 100644 --- a/lib/less-node/url-file-manager.js +++ b/lib/less-node/url-file-manager.js @@ -35,7 +35,7 @@ UrlFileManager.prototype.loadFile = function(filename, currentDirectory, options request.get({uri: urlStr, strictSSL: !options.insecure }, function (error, res, body) { if (error) { - reject({ type: 'File', message: "resource '" + urlStr + "' gave this Error:\n "+ error +"\n" }); + reject({ type: 'File', message: "resource '" + urlStr + "' gave this Error:\n " + error + "\n" }); return; } if (res && res.statusCode === 404) { @@ -43,7 +43,7 @@ UrlFileManager.prototype.loadFile = function(filename, currentDirectory, options return; } if (!body) { - logger.warn('Warning: Empty body (HTTP '+ res.statusCode + ') returned by "' + urlStr +'"'); + logger.warn('Warning: Empty body (HTTP '+ res.statusCode + ') returned by "' + urlStr + '"'); } fulfill({ contents: body, filename: urlStr }); }); diff --git a/lib/less-rhino/index.js b/lib/less-rhino/index.js index adf2de89..6efa0d6d 100644 --- a/lib/less-rhino/index.js +++ b/lib/less-rhino/index.js @@ -114,7 +114,7 @@ less.Parser.fileLoader = function (file, currentFileInfo, callback, env) { var j = file.lastIndexOf('/'); if(newFileInfo.relativeUrls && !/^(?:[a-z-]+:|\/)/.test(file) && j != -1) { - var relativeSubDirectory = file.slice(0, j+1); + var relativeSubDirectory = file.slice(0, j + 1); newFileInfo.rootpath = newFileInfo.rootpath + relativeSubDirectory; // append (sub|sup) directory path of imported file } newFileInfo.currentDirectory = path; @@ -177,7 +177,7 @@ function writeFile(filename, content) { var checkBooleanArg = function(arg) { var onOff = /^((on|t|true|y|yes)|(off|f|false|n|no))$/i.exec(arg); if (!onOff) { - print(" unable to parse "+arg+" as a boolean. use one of on/t/true/y/yes/off/f/false/n/no"); + print(" unable to parse " + arg + " as a boolean. use one of on/t/true/y/yes/off/f/false/n/no"); continueProcessing = false; return false; } diff --git a/lib/less/data/unit-conversions.js b/lib/less/data/unit-conversions.js index 628f13df..da292ab2 100644 --- a/lib/less/data/unit-conversions.js +++ b/lib/less/data/unit-conversions.js @@ -13,9 +13,9 @@ module.exports = { 'ms': 0.001 }, angle: { - 'rad': 1/(2*Math.PI), - 'deg': 1/360, - 'grad': 1/400, + 'rad': 1 / (2 * Math.PI), + 'deg': 1 / 360, + 'grad': 1 / 400, 'turn': 1 } }; \ No newline at end of file diff --git a/lib/less/environment/abstract-file-manager.js b/lib/less/environment/abstract-file-manager.js index 11d6f209..1efddbf4 100644 --- a/lib/less/environment/abstract-file-manager.js +++ b/lib/less/environment/abstract-file-manager.js @@ -53,10 +53,10 @@ abstractFileManager.prototype.pathDiff = function pathDiff(url, baseUrl) { } baseUrlDirectories = baseUrlParts.directories.slice(i); urlDirectories = urlParts.directories.slice(i); - for(i = 0; i < baseUrlDirectories.length-1; i++) { + for(i = 0; i < baseUrlDirectories.length - 1; i++) { diff += "../"; } - for(i = 0; i < urlDirectories.length-1; i++) { + for(i = 0; i < urlDirectories.length - 1; i++) { diff += urlDirectories[i] + "/"; } return diff; @@ -81,7 +81,7 @@ abstractFileManager.prototype.extractUrlParts = function extractUrlParts(url, ba if (baseUrl && (!urlParts[1] || urlParts[2])) { baseUrlParts = baseUrl.match(urlPartsRegex); if (!baseUrlParts) { - throw new Error("Could not parse page url - '"+baseUrl+"'"); + throw new Error("Could not parse page url - '" + baseUrl + "'"); } urlParts[1] = urlParts[1] || baseUrlParts[1] || ""; if (!urlParts[2]) { @@ -102,7 +102,7 @@ abstractFileManager.prototype.extractUrlParts = function extractUrlParts(url, ba for(i = 0; i < directories.length; i++) { if (directories[i] === ".." && i > 0) { - directories.splice(i-1, 2); + directories.splice(i - 1, 2); i -= 2; } } diff --git a/lib/less/functions/color.js b/lib/less/functions/color.js index 85d03865..0d29b42b 100644 --- a/lib/less/functions/color.js +++ b/lib/less/functions/color.js @@ -47,7 +47,7 @@ colorFunctions = { h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h); if (h * 6 < 1) { return m1 + (m2 - m1) * h * 6; } else if (h * 2 < 1) { return m2; } - else if (h * 3 < 2) { return m1 + (m2 - m1) * (2/3 - h) * 6; } + else if (h * 3 < 2) { return m1 + (m2 - m1) * (2 / 3 - h) * 6; } else { return m1; } } @@ -57,9 +57,9 @@ colorFunctions = { var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; var m1 = l * 2 - m2; - return colorFunctions.rgba(hue(h + 1/3) * 255, + return colorFunctions.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, - hue(h - 1/3) * 255, + hue(h - 1 / 3) * 255, a); }, @@ -268,7 +268,7 @@ colorFunctions = { }; }, tint: function(color, amount) { - return colorFunctions.mix(colorFunctions.rgb(255,255,255), color, amount); + return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color, amount); }, shade: function(color, amount) { return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color, amount); diff --git a/lib/less/functions/data-uri.js b/lib/less/functions/data-uri.js index c4f0f4aa..2bd37382 100644 --- a/lib/less/functions/data-uri.js +++ b/lib/less/functions/data-uri.js @@ -22,7 +22,7 @@ module.exports = function(environment) { var fragmentStart = filePath.indexOf('#'); var fragment = ''; - if (fragmentStart!==-1) { + if (fragmentStart !== -1) { fragment = filePath.slice(fragmentStart); filePath = filePath.slice(0, fragmentStart); } diff --git a/lib/less/functions/svg.js b/lib/less/functions/svg.js index 92336d13..a3a080c1 100644 --- a/lib/less/functions/svg.js +++ b/lib/less/functions/svg.js @@ -62,7 +62,7 @@ module.exports = function(environment) { position = undefined; } - if (!(color instanceof Color) || (!((i === 0 || i+1 === stops.length) && position === undefined) && !(position instanceof Dimension))) { + if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) { throwArgumentDescriptor(); } positionValue = position ? position.toCSS(renderEnv) : i === 0 ? "0%" : "100%"; diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index 43649161..daa3b716 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -204,7 +204,7 @@ var Parser = function Parser(context, imports, fileInfo) { // Ruleset (Selector '.class', [ // Rule ("color", Value ([Expression [Color #fff]])) // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) - // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]])) + // Rule ("width", Value ([Expression [Operation " + " [Variable "@w"][Dimension 4px]]])) // Ruleset (Selector [Element '>', '.child'], [...]) // ]) // @@ -1610,7 +1610,7 @@ Parser.serializeVars = function(vars) { for (var name in vars) { if (Object.hasOwnProperty.call(vars, name)) { var value = vars[name]; - s += ((name[0] === '@') ? '' : '@') + name +': '+ value + + s += ((name[0] === '@') ? '' : '@') + name + ': ' + value + ((String(value).slice(-1) === ';') ? '' : ';'); } } diff --git a/lib/less/source-map-output.js b/lib/less/source-map-output.js index c206f9fd..e5af818b 100644 --- a/lib/less/source-map-output.js +++ b/lib/less/source-map-output.js @@ -15,7 +15,7 @@ module.exports = function (environment) { } if (options.sourceMapRootpath) { this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\/g, '/'); - if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1) !== '/') { + if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') { this._sourceMapRootpath += '/'; } } else { @@ -66,11 +66,11 @@ module.exports = function (environment) { } inputSource = inputSource.substring(0, index); sourceLines = inputSource.split("\n"); - sourceColumns = sourceLines[sourceLines.length-1]; + sourceColumns = sourceLines[sourceLines.length - 1]; } lines = chunk.split("\n"); - columns = lines[lines.length-1]; + columns = lines[lines.length - 1]; if (fileInfo) { if (!mapLines) { diff --git a/lib/less/transform-tree.js b/lib/less/transform-tree.js index 5b2f1db4..51baef67 100644 --- a/lib/less/transform-tree.js +++ b/lib/less/transform-tree.js @@ -45,7 +45,7 @@ module.exports = function(root, options) { if (options.pluginManager) { var pluginVisitors = options.pluginManager.getVisitors(); - for(i =0; i < pluginVisitors.length; i++) { + for(i = 0; i < pluginVisitors.length; i++) { var pluginVisitor = pluginVisitors[i]; if (pluginVisitor.isPreEvalVisitor) { preEvalVisitors.push(pluginVisitor); diff --git a/lib/less/tree/debug-info.js b/lib/less/tree/debug-info.js index 1e79f3de..f169c224 100644 --- a/lib/less/tree/debug-info.js +++ b/lib/less/tree/debug-info.js @@ -1,5 +1,5 @@ var debugInfo = function(context, ctx, lineSeparator) { - var result=""; + var result = ""; if (context.dumpLineNumbers && !context.compress) { switch(context.dumpLineNumbers) { case 'comments': diff --git a/lib/less/tree/dimension.js b/lib/less/tree/dimension.js index 1f8de7bb..8afc9b48 100644 --- a/lib/less/tree/dimension.js +++ b/lib/less/tree/dimension.js @@ -25,7 +25,7 @@ Dimension.prototype.toColor = function () { }; Dimension.prototype.genCSS = function (context, output) { if ((context && context.strictUnits) && !this.unit.isSingular()) { - throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString()); + throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: " + this.unit.toString()); } var value = this.fround(context, this.value), diff --git a/lib/less/tree/import.js b/lib/less/tree/import.js index 62c33259..e88e6dce 100644 --- a/lib/less/tree/import.js +++ b/lib/less/tree/import.js @@ -100,7 +100,7 @@ Import.prototype.evalPath = function (context) { var pathValue = path.value; // Add the base path if the import is relative if (pathValue && context.isPathRelative(pathValue)) { - path.value = rootpath +pathValue; + path.value = rootpath + pathValue; } } path.value = context.normalizePath(path.value); diff --git a/lib/less/tree/mixin-call.js b/lib/less/tree/mixin-call.js index 5eecf714..56c7a07e 100644 --- a/lib/less/tree/mixin-call.js +++ b/lib/less/tree/mixin-call.js @@ -22,7 +22,7 @@ MixinCall.prototype.accept = function (visitor) { }; MixinCall.prototype.eval = function (context) { var mixins, mixin, mixinPath, args, rules = [], match = false, i, m, f, isRecursive, isOneFound, rule, - candidates = [], candidate, conditionResult = [], defaultResult, defFalseEitherCase=-1, + candidates = [], candidate, conditionResult = [], defaultResult, defFalseEitherCase = -1, defNone = 0, defTrue = 1, defFalse = 2, count, originalRuleset, noArgumentsFilter; function calcDefGroup(mixin, mixinPath) { @@ -84,7 +84,7 @@ MixinCall.prototype.eval = function (context) { if (mixin.matchArgs(args, context)) { candidate = {mixin: mixin, group: calcDefGroup(mixin, mixinPath)}; - if (candidate.group!==defFalseEitherCase) { + if (candidate.group !== defFalseEitherCase) { candidates.push(candidate); } diff --git a/lib/less/tree/quoted.js b/lib/less/tree/quoted.js index 55aafa03..7ad697d8 100644 --- a/lib/less/tree/quoted.js +++ b/lib/less/tree/quoted.js @@ -37,7 +37,7 @@ Quoted.prototype.eval = function (context) { do { value = evaluatedValue; evaluatedValue = value.replace(regexp, replacementFnc); - } while (value!==evaluatedValue); + } while (value !== evaluatedValue); return evaluatedValue; } value = iterativeReplace(value, /`([^`]+)`/g, javascriptReplacement); diff --git a/lib/less/tree/ruleset.js b/lib/less/tree/ruleset.js index 09239f33..2c1bb8a4 100644 --- a/lib/less/tree/ruleset.js +++ b/lib/less/tree/ruleset.js @@ -107,7 +107,7 @@ Ruleset.prototype.eval = function (context) { }); rsRules.splice.apply(rsRules, [i, 1].concat(rules)); rsRuleCnt += rules.length - 1; - i += rules.length-1; + i += rules.length - 1; ruleset.resetCache(); } else if (rsRules[i].type === "RulesetCall") { /*jshint loopfunc:true */ @@ -120,7 +120,7 @@ Ruleset.prototype.eval = function (context) { }); rsRules.splice.apply(rsRules, [i, 1].concat(rules)); rsRuleCnt += rules.length - 1; - i += rules.length-1; + i += rules.length - 1; ruleset.resetCache(); } } @@ -173,7 +173,7 @@ Ruleset.prototype.evalImports = function(context) { importRules = rules[i].eval(context); if (importRules && importRules.length) { rules.splice.apply(rules, [i, 1].concat(importRules)); - i+= importRules.length-1; + i+= importRules.length - 1; } else { rules.splice(i, 1, importRules); } @@ -195,7 +195,7 @@ Ruleset.prototype.makeImportant = function() { }; // lets you call a css selector with a guard Ruleset.prototype.matchCondition = function (args, context) { - var lastSelector = this.selectors[this.selectors.length-1]; + var lastSelector = this.selectors[this.selectors.length - 1]; if (!lastSelector.evaldCondition) { return false; } @@ -433,9 +433,9 @@ Ruleset.prototype.getIsReferenced = function() { var i, j, path, selector; if (this.paths) { - for (i=0; i 0) { spacedGroups.push(toExpression(lastSpacedGroup)); } diff --git a/test/browser/common.js b/test/browser/common.js index 9e89a768..6ab2da68 100644 --- a/test/browser/common.js +++ b/test/browser/common.js @@ -130,10 +130,10 @@ var testErrorSheet = function (sheet) { .replace(/

    |<\/?p>||<\/a>|
      |<\/?pre( class="?[^">]*"?)?>|<\/li>|<\/?label>/ig, "") .replace(/<\/h3>/ig, " ") .replace(/
    • |<\/ul>|
      /ig, "\n")) - .replace(/&/ig,"&") + .replace(/&/ig, "&") // for IE8 - .replace(/\r\n/g,"\n") - .replace(/\. \nin/,". in"); + .replace(/\r\n/g, "\n") + .replace(/\. \nin/, ". in"); actualErrorMsg = innerText .replace(/\n\d+/g, function (lineNo) { return lineNo + " "; diff --git a/test/browser/jasmine-jsreporter.js b/test/browser/jasmine-jsreporter.js index 4fd5569a..0d556299 100644 --- a/test/browser/jasmine-jsreporter.js +++ b/test/browser/jasmine-jsreporter.js @@ -239,7 +239,7 @@ suite.specs = []; suite.suites = []; suite.passed = true; - suite.parentId = this.suiteStack.slice(this.suiteStack.length -1)[0]; + suite.parentId = this.suiteStack.slice(this.suiteStack.length - 1)[0]; if (suite.parentId) { this.suites[suite.parentId].suites.push(suite); } else { @@ -272,7 +272,7 @@ spec = this._cacheSpec(spec); spec.timer = new Timer().start(); // build up suites->spec tree as we go - spec.suiteId = this.suiteStack.slice(this.suiteStack.length -1)[0]; + spec.suiteId = this.suiteStack.slice(this.suiteStack.length - 1)[0]; this.suites[spec.suiteId].specs.push(spec); }; diff --git a/test/index.js b/test/index.js index 7ae15600..c58e1e19 100644 --- a/test/index.js +++ b/test/index.js @@ -45,7 +45,7 @@ lessTester.runTestSet({globalVars: true, banner: "/**\n * Test\n */\n"}, "glob lessTester.runTestSet({modifyVars: true}, "modifyVars/", null, null, null, function(name, type, baseFolder) { return path.join(baseFolder, name) + '.json'; }); lessTester.runTestSet({urlArgs: '424242'}, "url-args/"); -lessTester.runTestSet({paths: ['test/data/','test/less/import/']}, "include-path/"); +lessTester.runTestSet({paths: ['test/data/', 'test/less/import/']}, "include-path/"); lessTester.testSyncronous({syncImport: true}, "import"); lessTester.testSyncronous({syncImport: true}, "css"); lessTester.testNoOptions(); diff --git a/test/less-test.js b/test/less-test.js index 1da18132..a69dfb28 100644 --- a/test/less-test.js +++ b/test/less-test.js @@ -112,8 +112,8 @@ module.exports = function() { function globalReplacements(input, directory) { var p = path.join(process.cwd(), directory), pathimport = path.join(process.cwd(), directory + "import/"), - pathesc = p.replace(/[.:/\\]/g, function(a) { return '\\' + (a=='\\' ? '\/' : a); }), - pathimportesc = pathimport.replace(/[.:/\\]/g, function(a) { return '\\' + (a=='\\' ? '\/' : a); }); + pathesc = p.replace(/[.:/\\]/g, function(a) { return '\\' + (a == '\\' ? '\/' : a); }), + pathimportesc = pathimport.replace(/[.:/\\]/g, function(a) { return '\\' + (a == '\\' ? '\/' : a); }); return input.replace(/\{path\}/g, p) .replace(/\{pathesc\}/g, pathesc)