Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7113)
+++ /controller/wpsg_ShopController.class.php	(revision 7114)
@@ -672,5 +672,5 @@
 		public function initShop($prefix)
 		{
-						
+		    
 			if (is_admin() && defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN == true)
 			{
@@ -711,4 +711,70 @@
 				}
 
+                if (isset($_REQUEST['wpsg_scss'])) {
+
+                    // Generierung der CSS Dateien
+                    $arFiles = [
+                        'css/frontend.css',
+                        'css/style.scss'
+                    ];
+
+                    $this->callMods('wpsg_scss', [&$arFiles]);
+                     //die(wpsg_debug($arFiles));
+                    $md5 = '';
+
+                    foreach ($arFiles as $k => $f) {
+
+                        $arFiles[$k] = $this->getRessourcePath($f);
+
+                        $md5 .= md5_file($arFiles[$k]);
+
+                    }
+
+                    $css = '';
+                    $scss_cache = $this->get_option('wpsg_scss_cache');
+                    $scss_cache_file = WPSG_PATH_UPLOADS.'scss_cache.css';
+
+                    header('Content-type: text/css');
+
+                    if ($scss_cache === false || $scss_cache !== $md5 || !file_exists($scss_cache_file)) {
+
+                        require_once WPSG_PATH_LIB.'vendor/autoload.php';
+
+                        $scss = new Leafo\ScssPhp\Compiler();
+
+                        foreach ($arFiles as $f) {
+
+                            try {
+
+                                $scss->setImportPaths(dirname($f));
+                                $css .= $scss->compile(file_get_contents($f));
+
+                            } catch (\Exception $e) {
+
+                            }
+
+                        }
+
+                        $minifier = new MatthiasMullie\Minify\CSS();
+                        $minifier->add($css);
+
+                        $css = $minifier->minify();
+
+                        file_put_contents($scss_cache_file, $css);
+
+                        $this->update_option('wpsg_scss_cache', $md5);
+
+                        echo $css;
+
+                    } else {
+
+                        readfile($scss_cache_file);
+
+                    }
+
+                    exit;
+
+                }
+				
 			}
 
@@ -778,5 +844,7 @@
 				if ($this->get_option('wpsg_load_bootstrap_glyphfont_css') == '1') wp_enqueue_style('wpsg-bscss', $GLOBALS['wpsg_sc']->getRessourceURL('js/bootstrap-3.3.6-dist/css/bootstrap-glyphfont.css'));
 
-				if ($this->get_option('wpsg_load_css') != '1') wp_enqueue_style('wpsg-frontendstyle', $this->getRessourceURL('css/frontend.css'));
+				//if ($this->get_option('wpsg_load_css') != '1') wp_enqueue_style('wpsg-frontendstyle', $this->getRessourceURL('css/frontend.css'));
+                if ($this->get_option('wpsg_load_css') != '1') wp_enqueue_style('wpsg-frontendstyle', '/?wpsg_scss');
+				
 				if ($this->get_option('wpsg_load_thickbox_js') == '1') wp_enqueue_script('thickbox', null, array('jquery'));
 				if ($this->get_option('wpsg_load_thickbox_css') == '1') 
@@ -913,18 +981,12 @@
 		 * Gibt ein Modul -1 zurÃŒck wird kein weiteres Modul mehr angefragt
 		 */
-		public function callMods($func_name, $arParam = array())
-		{
+		public function callMods($func_name, $arParam = array()) {
+		               
+		    \do_action('wpsg_'.$func_name, $arParam);
 		    
-		    //wpsg_debug($func_name);
-            //wpsg_debug($this->arModule);
-            
-			foreach ($this->arModule as $m_key => $m)
-			{
-
-				if (method_exists($m, $func_name))
-				{
-
-					//wpsg_debug_console($func_name.":".get_class($m));
-
+			foreach ($this->arModule as $m_key => $m) {
+
+				if (method_exists($m, $func_name)) {
+ 
 					$b = call_user_func_array(array($m, $func_name), $arParam);
 
@@ -943,11 +1005,9 @@
 		 * Ruft eine spezielle Funktion eines speziellen Moduls auf
 		 */
-		public function callMod($mod_key, $func_name, $arParam = array())
-		{
-
+		public function callMod($mod_key, $func_name, $arParam = array()) {
+    
 			if (!array_key_exists($mod_key, $this->arModule)) return;
-
-			if (method_exists($this->arModule[$mod_key], $func_name))
-			{
+			
+			if (method_exists($this->arModule[$mod_key], $func_name)) {
 
 				return call_user_func_array(array($this->arModule[$mod_key], $func_name), $arParam);
@@ -2452,9 +2512,7 @@
 			if ($this->isMultiBlog() && $this->get_option('wpsg_multiblog_standalone', true) != '1') $global = true;
 
-			while ($file = readdir($mod_dir))
-			{
-
-				if (!is_dir(WPSG_PATH_MOD."/".$file) && $file != "." && $file != ".." && preg_match("/(.*)\.class\.php/i", $file) && $file != "wpsg_mod_basic.class.php")
-				{
+			while ($file = readdir($mod_dir)) {
+
+				if (!is_dir(WPSG_PATH_MOD."/".$file) && $file != "." && $file != ".." && preg_match("/(.*)\.class\.php/i", $file) && $file != "wpsg_mod_basic.class.php") {
 
 					if (file_exists(WPSG_PATH_USERMOD.$file)) require_once(WPSG_PATH_USERMOD.$file);
@@ -2541,4 +2599,6 @@
 			}
 
+			\do_action('wpsg_loadModule', $all);
+						
             uasort($this->arModule, array($this, "cmp_mods"));
 
Index: /controller/wpsg_SystemController.class.php
===================================================================
--- /controller/wpsg_SystemController.class.php	(revision 7113)
+++ /controller/wpsg_SystemController.class.php	(revision 7114)
@@ -578,32 +578,33 @@
 		 * im user_views liegt und wenn ja dieser Pfad zurÃŒckgegeben
 		 */
-		public function getRessourcePath($path)
-		{
-
-			if (file_exists(WPSG_PATH_USERVIEW.$path))
-			{
+		public function getRessourcePath($path) {
+
+            $plugin_dir = ABSPATH.'wp-content/plugins/';
+                        
+            if (strpos(realpath($path), realpath ($plugin_dir)) === 0) {
+                
+                $view_path = preg_replace('/(.*)views/', '',realpath($path));
+                                
+            } else $view_path = $path;
+		    
+			if (file_exists(WPSG_PATH_USERVIEW.$view_path)) {
 			
 				// Datei existiert im UserView
-				return WPSG_PATH_USERVIEW.$path;
-				
-			}
-			else if (file_exists(WPSG_PATH_TEMPLATEVIEW.'/'.$path))
-			{
+				return WPSG_PATH_USERVIEW.$view_path;
+				
+			} else if (file_exists(WPSG_PATH_TEMPLATEVIEW.'/'.$view_path)) {
 				 
 				// Datei existiert im Template
-				return WPSG_PATH_TEMPLATEVIEW.'/'.$path;
-				
-			}
-			else if (file_exists(WPSG_PATH_USERVIEW_OLD.'/'.$path))
-			{
+				return WPSG_PATH_TEMPLATEVIEW.'/'.$view_path;
+				
+			} else if (file_exists(WPSG_PATH_USERVIEW_OLD.'/'.$view_path)) {
 
 				// Datei existiert im alten UserView
-				return WPSG_PATH_USERVIEW_OLD.'/'.$path;
-				
-			}
-			else
-			{
-
-				return WPSG_PATH_VIEW.'/'.$path;
+				return WPSG_PATH_USERVIEW_OLD.'/'.$view_path;
+				
+			} else {
+
+			    if ($path !== $view_path) return $path;
+			    else return WPSG_PATH_VIEW.'/'.$path;
 				
 			}
Index: /lib/composer.json
===================================================================
--- /lib/composer.json	(revision 7114)
+++ /lib/composer.json	(revision 7114)
@@ -0,0 +1,6 @@
+{
+  "require": { 
+    "leafo/scssphp": "v0.7.1",
+    "matthiasmullie/minify": "1.3.60"
+  }
+}
Index: /lib/composer.lock
===================================================================
--- /lib/composer.lock	(revision 7114)
+++ /lib/composer.lock	(revision 7114)
@@ -0,0 +1,179 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "12a22a3c84870878acb8d5985523a49c",
+    "packages": [
+        {
+            "name": "leafo/scssphp",
+            "version": "v0.7.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/leafo/scssphp.git",
+                "reference": "9eaf3a6db4d88ce2c265a89e3fc495fbec9bf7a6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/leafo/scssphp/zipball/9eaf3a6db4d88ce2c265a89e3fc495fbec9bf7a6",
+                "reference": "9eaf3a6db4d88ce2c265a89e3fc495fbec9bf7a6",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.4.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.6",
+                "squizlabs/php_codesniffer": "~2.5"
+            },
+            "bin": [
+                "bin/pscss"
+            ],
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Leafo\\ScssPhp\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Leaf Corcoran",
+                    "email": "leafot@gmail.com",
+                    "homepage": "http://leafo.net"
+                }
+            ],
+            "description": "scssphp is a compiler for SCSS written in PHP.",
+            "homepage": "http://leafo.github.io/scssphp/",
+            "keywords": [
+                "css",
+                "less",
+                "sass",
+                "scss",
+                "stylesheet"
+            ],
+            "time": "2017-10-13T15:53:00+00:00"
+        },
+        {
+            "name": "matthiasmullie/minify",
+            "version": "1.3.60",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/matthiasmullie/minify.git",
+                "reference": "ab7fea80ce5ce6549baaf272bc8bd926a7e08f90"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/ab7fea80ce5ce6549baaf272bc8bd926a7e08f90",
+                "reference": "ab7fea80ce5ce6549baaf272bc8bd926a7e08f90",
+                "shasum": ""
+            },
+            "require": {
+                "ext-pcre": "*",
+                "matthiasmullie/path-converter": "~1.1",
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "friendsofphp/php-cs-fixer": "~2.0",
+                "matthiasmullie/scrapbook": "~1.0",
+                "phpunit/phpunit": "~4.8"
+            },
+            "suggest": {
+                "psr/cache-implementation": "Cache implementation to use with Minify::cache"
+            },
+            "bin": [
+                "bin/minifycss",
+                "bin/minifyjs"
+            ],
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "MatthiasMullie\\Minify\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Matthias Mullie",
+                    "email": "minify@mullie.eu",
+                    "homepage": "http://www.mullie.eu",
+                    "role": "Developer"
+                }
+            ],
+            "description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.",
+            "homepage": "http://www.minifier.org",
+            "keywords": [
+                "JS",
+                "css",
+                "javascript",
+                "minifier",
+                "minify"
+            ],
+            "time": "2018-04-18T08:50:35+00:00"
+        },
+        {
+            "name": "matthiasmullie/path-converter",
+            "version": "1.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/matthiasmullie/path-converter.git",
+                "reference": "3082a6838be02b930239a97d38b5c9da4d693aca"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/3082a6838be02b930239a97d38b5c9da4d693aca",
+                "reference": "3082a6838be02b930239a97d38b5c9da4d693aca",
+                "shasum": ""
+            },
+            "require": {
+                "ext-pcre": "*",
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "MatthiasMullie\\PathConverter\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Matthias Mullie",
+                    "email": "pathconverter@mullie.eu",
+                    "homepage": "http://www.mullie.eu",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Relative path converter",
+            "homepage": "http://github.com/matthiasmullie/path-converter",
+            "keywords": [
+                "converter",
+                "path",
+                "paths",
+                "relative"
+            ],
+            "time": "2018-02-02T11:30:10+00:00"
+        }
+    ],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": [],
+    "platform-dev": []
+}
Index: /lib/vendor/autoload.php
===================================================================
--- /lib/vendor/autoload.php	(revision 7114)
+++ /lib/vendor/autoload.php	(revision 7114)
@@ -0,0 +1,7 @@
+<?php
+
+// autoload.php @generated by Composer
+
+require_once __DIR__ . '/composer/autoload_real.php';
+
+return ComposerAutoloaderInita3a889d9db8dedf25341ebba996e4f13::getLoader();
Index: /lib/vendor/bin/pscss
===================================================================
--- /lib/vendor/bin/pscss	(revision 7114)
+++ /lib/vendor/bin/pscss	(revision 7114)
@@ -0,0 +1,17 @@
+#!/usr/bin/env sh
+
+dir=$(d=${0%[/\\]*}; cd "$d" > /dev/null; cd "../leafo/scssphp/bin" && pwd)
+
+# See if we are running in Cygwin by checking for cygpath program
+if command -v 'cygpath' >/dev/null 2>&1; then
+	# Cygwin paths start with /cygdrive/ which will break windows PHP,
+	# so we need to translate the dir path to windows format. However
+	# we could be using cygwin PHP which does not require this, so we
+	# test if the path to PHP starts with /cygdrive/ rather than /usr/bin
+	if [[ $(which php) == /cygdrive/* ]]; then
+		dir=$(cygpath -m "$dir");
+	fi
+fi
+
+dir=$(echo $dir | sed 's/ /\ /g')
+"${dir}/pscss" "$@"
Index: /lib/vendor/bin/pscss.bat
===================================================================
--- /lib/vendor/bin/pscss.bat	(revision 7114)
+++ /lib/vendor/bin/pscss.bat	(revision 7114)
@@ -0,0 +1,4 @@
+@ECHO OFF
+setlocal DISABLEDELAYEDEXPANSION
+SET BIN_TARGET=%~dp0/../leafo/scssphp/bin/pscss
+php "%BIN_TARGET%" %*
Index: /lib/vendor/composer/ClassLoader.php
===================================================================
--- /lib/vendor/composer/ClassLoader.php	(revision 7114)
+++ /lib/vendor/composer/ClassLoader.php	(revision 7114)
@@ -0,0 +1,445 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman@naderman.de>
+ *     Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ *     $loader = new \Composer\Autoload\ClassLoader();
+ *
+ *     // register classes with namespaces
+ *     $loader->add('Symfony\Component', __DIR__.'/component');
+ *     $loader->add('Symfony',           __DIR__.'/framework');
+ *
+ *     // activate the autoloader
+ *     $loader->register();
+ *
+ *     // to enable searching the include path (eg. for PEAR packages)
+ *     $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jordi Boggiano <j.boggiano@seld.be>
+ * @see    http://www.php-fig.org/psr/psr-0/
+ * @see    http://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+    // PSR-4
+    private $prefixLengthsPsr4 = array();
+    private $prefixDirsPsr4 = array();
+    private $fallbackDirsPsr4 = array();
+
+    // PSR-0
+    private $prefixesPsr0 = array();
+    private $fallbackDirsPsr0 = array();
+
+    private $useIncludePath = false;
+    private $classMap = array();
+    private $classMapAuthoritative = false;
+    private $missingClasses = array();
+    private $apcuPrefix;
+
+    public function getPrefixes()
+    {
+        if (!empty($this->prefixesPsr0)) {
+            return call_user_func_array('array_merge', $this->prefixesPsr0);
+        }
+
+        return array();
+    }
+
+    public function getPrefixesPsr4()
+    {
+        return $this->prefixDirsPsr4;
+    }
+
+    public function getFallbackDirs()
+    {
+        return $this->fallbackDirsPsr0;
+    }
+
+    public function getFallbackDirsPsr4()
+    {
+        return $this->fallbackDirsPsr4;
+    }
+
+    public function getClassMap()
+    {
+        return $this->classMap;
+    }
+
+    /**
+     * @param array $classMap Class to filename map
+     */
+    public function addClassMap(array $classMap)
+    {
+        if ($this->classMap) {
+            $this->classMap = array_merge($this->classMap, $classMap);
+        } else {
+            $this->classMap = $classMap;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix, either
+     * appending or prepending to the ones previously set for this prefix.
+     *
+     * @param string       $prefix  The prefix
+     * @param array|string $paths   The PSR-0 root directories
+     * @param bool         $prepend Whether to prepend the directories
+     */
+    public function add($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            if ($prepend) {
+                $this->fallbackDirsPsr0 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr0
+                );
+            } else {
+                $this->fallbackDirsPsr0 = array_merge(
+                    $this->fallbackDirsPsr0,
+                    (array) $paths
+                );
+            }
+
+            return;
+        }
+
+        $first = $prefix[0];
+        if (!isset($this->prefixesPsr0[$first][$prefix])) {
+            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+            return;
+        }
+        if ($prepend) {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixesPsr0[$first][$prefix]
+            );
+        } else {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                $this->prefixesPsr0[$first][$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace, either
+     * appending or prepending to the ones previously set for this namespace.
+     *
+     * @param string       $prefix  The prefix/namespace, with trailing '\\'
+     * @param array|string $paths   The PSR-4 base directories
+     * @param bool         $prepend Whether to prepend the directories
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function addPsr4($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            // Register directories for the root namespace.
+            if ($prepend) {
+                $this->fallbackDirsPsr4 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr4
+                );
+            } else {
+                $this->fallbackDirsPsr4 = array_merge(
+                    $this->fallbackDirsPsr4,
+                    (array) $paths
+                );
+            }
+        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+            // Register directories for a new namespace.
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        } elseif ($prepend) {
+            // Prepend directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixDirsPsr4[$prefix]
+            );
+        } else {
+            // Append directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                $this->prefixDirsPsr4[$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix,
+     * replacing any others previously set for this prefix.
+     *
+     * @param string       $prefix The prefix
+     * @param array|string $paths  The PSR-0 base directories
+     */
+    public function set($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr0 = (array) $paths;
+        } else {
+            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace,
+     * replacing any others previously set for this namespace.
+     *
+     * @param string       $prefix The prefix/namespace, with trailing '\\'
+     * @param array|string $paths  The PSR-4 base directories
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function setPsr4($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr4 = (array) $paths;
+        } else {
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Turns on searching the include path for class files.
+     *
+     * @param bool $useIncludePath
+     */
+    public function setUseIncludePath($useIncludePath)
+    {
+        $this->useIncludePath = $useIncludePath;
+    }
+
+    /**
+     * Can be used to check if the autoloader uses the include path to check
+     * for classes.
+     *
+     * @return bool
+     */
+    public function getUseIncludePath()
+    {
+        return $this->useIncludePath;
+    }
+
+    /**
+     * Turns off searching the prefix and fallback directories for classes
+     * that have not been registered with the class map.
+     *
+     * @param bool $classMapAuthoritative
+     */
+    public function setClassMapAuthoritative($classMapAuthoritative)
+    {
+        $this->classMapAuthoritative = $classMapAuthoritative;
+    }
+
+    /**
+     * Should class lookup fail if not found in the current class map?
+     *
+     * @return bool
+     */
+    public function isClassMapAuthoritative()
+    {
+        return $this->classMapAuthoritative;
+    }
+
+    /**
+     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+     *
+     * @param string|null $apcuPrefix
+     */
+    public function setApcuPrefix($apcuPrefix)
+    {
+        $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
+    }
+
+    /**
+     * The APCu prefix in use, or null if APCu caching is not enabled.
+     *
+     * @return string|null
+     */
+    public function getApcuPrefix()
+    {
+        return $this->apcuPrefix;
+    }
+
+    /**
+     * Registers this instance as an autoloader.
+     *
+     * @param bool $prepend Whether to prepend the autoloader or not
+     */
+    public function register($prepend = false)
+    {
+        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+    }
+
+    /**
+     * Unregisters this instance as an autoloader.
+     */
+    public function unregister()
+    {
+        spl_autoload_unregister(array($this, 'loadClass'));
+    }
+
+    /**
+     * Loads the given class or interface.
+     *
+     * @param  string    $class The name of the class
+     * @return bool|null True if loaded, null otherwise
+     */
+    public function loadClass($class)
+    {
+        if ($file = $this->findFile($class)) {
+            includeFile($file);
+
+            return true;
+        }
+    }
+
+    /**
+     * Finds the path to the file where the class is defined.
+     *
+     * @param string $class The name of the class
+     *
+     * @return string|false The path if found, false otherwise
+     */
+    public function findFile($class)
+    {
+        // class map lookup
+        if (isset($this->classMap[$class])) {
+            return $this->classMap[$class];
+        }
+        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+            return false;
+        }
+        if (null !== $this->apcuPrefix) {
+            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+            if ($hit) {
+                return $file;
+            }
+        }
+
+        $file = $this->findFileWithExtension($class, '.php');
+
+        // Search for Hack files if we are running on HHVM
+        if (false === $file && defined('HHVM_VERSION')) {
+            $file = $this->findFileWithExtension($class, '.hh');
+        }
+
+        if (null !== $this->apcuPrefix) {
+            apcu_add($this->apcuPrefix.$class, $file);
+        }
+
+        if (false === $file) {
+            // Remember that this class does not exist.
+            $this->missingClasses[$class] = true;
+        }
+
+        return $file;
+    }
+
+    private function findFileWithExtension($class, $ext)
+    {
+        // PSR-4 lookup
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+        $first = $class[0];
+        if (isset($this->prefixLengthsPsr4[$first])) {
+            $subPath = $class;
+            while (false !== $lastPos = strrpos($subPath, '\\')) {
+                $subPath = substr($subPath, 0, $lastPos);
+                $search = $subPath.'\\';
+                if (isset($this->prefixDirsPsr4[$search])) {
+                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
+                        $length = $this->prefixLengthsPsr4[$first][$search];
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-4 fallback dirs
+        foreach ($this->fallbackDirsPsr4 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 lookup
+        if (false !== $pos = strrpos($class, '\\')) {
+            // namespaced class name
+            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+        } else {
+            // PEAR-like class name
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+        }
+
+        if (isset($this->prefixesPsr0[$first])) {
+            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+                if (0 === strpos($class, $prefix)) {
+                    foreach ($dirs as $dir) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-0 fallback dirs
+        foreach ($this->fallbackDirsPsr0 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 include paths.
+        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+            return $file;
+        }
+
+        return false;
+    }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ */
+function includeFile($file)
+{
+    include $file;
+}
Index: /lib/vendor/composer/LICENSE
===================================================================
--- /lib/vendor/composer/LICENSE	(revision 7114)
+++ /lib/vendor/composer/LICENSE	(revision 7114)
@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
Index: /lib/vendor/composer/autoload_classmap.php
===================================================================
--- /lib/vendor/composer/autoload_classmap.php	(revision 7114)
+++ /lib/vendor/composer/autoload_classmap.php	(revision 7114)
@@ -0,0 +1,9 @@
+<?php
+
+// autoload_classmap.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);
Index: /lib/vendor/composer/autoload_namespaces.php
===================================================================
--- /lib/vendor/composer/autoload_namespaces.php	(revision 7114)
+++ /lib/vendor/composer/autoload_namespaces.php	(revision 7114)
@@ -0,0 +1,9 @@
+<?php
+
+// autoload_namespaces.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);
Index: /lib/vendor/composer/autoload_psr4.php
===================================================================
--- /lib/vendor/composer/autoload_psr4.php	(revision 7114)
+++ /lib/vendor/composer/autoload_psr4.php	(revision 7114)
@@ -0,0 +1,12 @@
+<?php
+
+// autoload_psr4.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),
+    'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'),
+    'Leafo\\ScssPhp\\' => array($vendorDir . '/leafo/scssphp/src'),
+);
Index: /lib/vendor/composer/autoload_real.php
===================================================================
--- /lib/vendor/composer/autoload_real.php	(revision 7114)
+++ /lib/vendor/composer/autoload_real.php	(revision 7114)
@@ -0,0 +1,52 @@
+<?php
+
+// autoload_real.php @generated by Composer
+
+class ComposerAutoloaderInita3a889d9db8dedf25341ebba996e4f13
+{
+    private static $loader;
+
+    public static function loadClassLoader($class)
+    {
+        if ('Composer\Autoload\ClassLoader' === $class) {
+            require __DIR__ . '/ClassLoader.php';
+        }
+    }
+
+    public static function getLoader()
+    {
+        if (null !== self::$loader) {
+            return self::$loader;
+        }
+
+        spl_autoload_register(array('ComposerAutoloaderInita3a889d9db8dedf25341ebba996e4f13', 'loadClassLoader'), true, true);
+        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
+        spl_autoload_unregister(array('ComposerAutoloaderInita3a889d9db8dedf25341ebba996e4f13', 'loadClassLoader'));
+
+        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+        if ($useStaticLoader) {
+            require_once __DIR__ . '/autoload_static.php';
+
+            call_user_func(\Composer\Autoload\ComposerStaticInita3a889d9db8dedf25341ebba996e4f13::getInitializer($loader));
+        } else {
+            $map = require __DIR__ . '/autoload_namespaces.php';
+            foreach ($map as $namespace => $path) {
+                $loader->set($namespace, $path);
+            }
+
+            $map = require __DIR__ . '/autoload_psr4.php';
+            foreach ($map as $namespace => $path) {
+                $loader->setPsr4($namespace, $path);
+            }
+
+            $classMap = require __DIR__ . '/autoload_classmap.php';
+            if ($classMap) {
+                $loader->addClassMap($classMap);
+            }
+        }
+
+        $loader->register(true);
+
+        return $loader;
+    }
+}
Index: /lib/vendor/composer/autoload_static.php
===================================================================
--- /lib/vendor/composer/autoload_static.php	(revision 7114)
+++ /lib/vendor/composer/autoload_static.php	(revision 7114)
@@ -0,0 +1,44 @@
+<?php
+
+// autoload_static.php @generated by Composer
+
+namespace Composer\Autoload;
+
+class ComposerStaticInita3a889d9db8dedf25341ebba996e4f13
+{
+    public static $prefixLengthsPsr4 = array (
+        'M' => 
+        array (
+            'MatthiasMullie\\PathConverter\\' => 29,
+            'MatthiasMullie\\Minify\\' => 22,
+        ),
+        'L' => 
+        array (
+            'Leafo\\ScssPhp\\' => 14,
+        ),
+    );
+
+    public static $prefixDirsPsr4 = array (
+        'MatthiasMullie\\PathConverter\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/matthiasmullie/path-converter/src',
+        ),
+        'MatthiasMullie\\Minify\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/matthiasmullie/minify/src',
+        ),
+        'Leafo\\ScssPhp\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/leafo/scssphp/src',
+        ),
+    );
+
+    public static function getInitializer(ClassLoader $loader)
+    {
+        return \Closure::bind(function () use ($loader) {
+            $loader->prefixLengthsPsr4 = ComposerStaticInita3a889d9db8dedf25341ebba996e4f13::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInita3a889d9db8dedf25341ebba996e4f13::$prefixDirsPsr4;
+
+        }, null, ClassLoader::class);
+    }
+}
Index: /lib/vendor/composer/installed.json
===================================================================
--- /lib/vendor/composer/installed.json	(revision 7114)
+++ /lib/vendor/composer/installed.json	(revision 7114)
@@ -0,0 +1,169 @@
+[
+    {
+        "name": "leafo/scssphp",
+        "version": "v0.7.1",
+        "version_normalized": "0.7.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/leafo/scssphp.git",
+            "reference": "9eaf3a6db4d88ce2c265a89e3fc495fbec9bf7a6"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/leafo/scssphp/zipball/9eaf3a6db4d88ce2c265a89e3fc495fbec9bf7a6",
+            "reference": "9eaf3a6db4d88ce2c265a89e3fc495fbec9bf7a6",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.4.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "~4.6",
+            "squizlabs/php_codesniffer": "~2.5"
+        },
+        "time": "2017-10-13T15:53:00+00:00",
+        "bin": [
+            "bin/pscss"
+        ],
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "Leafo\\ScssPhp\\": "src/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Leaf Corcoran",
+                "email": "leafot@gmail.com",
+                "homepage": "http://leafo.net"
+            }
+        ],
+        "description": "scssphp is a compiler for SCSS written in PHP.",
+        "homepage": "http://leafo.github.io/scssphp/",
+        "keywords": [
+            "css",
+            "less",
+            "sass",
+            "scss",
+            "stylesheet"
+        ]
+    },
+    {
+        "name": "matthiasmullie/path-converter",
+        "version": "1.1.1",
+        "version_normalized": "1.1.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/matthiasmullie/path-converter.git",
+            "reference": "3082a6838be02b930239a97d38b5c9da4d693aca"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/3082a6838be02b930239a97d38b5c9da4d693aca",
+            "reference": "3082a6838be02b930239a97d38b5c9da4d693aca",
+            "shasum": ""
+        },
+        "require": {
+            "ext-pcre": "*",
+            "php": ">=5.3.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "~4.8"
+        },
+        "time": "2018-02-02T11:30:10+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "MatthiasMullie\\PathConverter\\": "src/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Matthias Mullie",
+                "email": "pathconverter@mullie.eu",
+                "homepage": "http://www.mullie.eu",
+                "role": "Developer"
+            }
+        ],
+        "description": "Relative path converter",
+        "homepage": "http://github.com/matthiasmullie/path-converter",
+        "keywords": [
+            "converter",
+            "path",
+            "paths",
+            "relative"
+        ]
+    },
+    {
+        "name": "matthiasmullie/minify",
+        "version": "1.3.60",
+        "version_normalized": "1.3.60.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/matthiasmullie/minify.git",
+            "reference": "ab7fea80ce5ce6549baaf272bc8bd926a7e08f90"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/ab7fea80ce5ce6549baaf272bc8bd926a7e08f90",
+            "reference": "ab7fea80ce5ce6549baaf272bc8bd926a7e08f90",
+            "shasum": ""
+        },
+        "require": {
+            "ext-pcre": "*",
+            "matthiasmullie/path-converter": "~1.1",
+            "php": ">=5.3.0"
+        },
+        "require-dev": {
+            "friendsofphp/php-cs-fixer": "~2.0",
+            "matthiasmullie/scrapbook": "~1.0",
+            "phpunit/phpunit": "~4.8"
+        },
+        "suggest": {
+            "psr/cache-implementation": "Cache implementation to use with Minify::cache"
+        },
+        "time": "2018-04-18T08:50:35+00:00",
+        "bin": [
+            "bin/minifycss",
+            "bin/minifyjs"
+        ],
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "MatthiasMullie\\Minify\\": "src/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Matthias Mullie",
+                "email": "minify@mullie.eu",
+                "homepage": "http://www.mullie.eu",
+                "role": "Developer"
+            }
+        ],
+        "description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.",
+        "homepage": "http://www.minifier.org",
+        "keywords": [
+            "JS",
+            "css",
+            "javascript",
+            "minifier",
+            "minify"
+        ]
+    }
+]
Index: /lib/vendor/leafo/scssphp/LICENSE.md
===================================================================
--- /lib/vendor/leafo/scssphp/LICENSE.md	(revision 7114)
+++ /lib/vendor/leafo/scssphp/LICENSE.md	(revision 7114)
@@ -0,0 +1,20 @@
+Copyright (c) 2015 Leaf Corcoran, http://leafo.github.io/scssphp
+ 
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+ 
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+ 
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index: /lib/vendor/leafo/scssphp/README.md
===================================================================
--- /lib/vendor/leafo/scssphp/README.md	(revision 7114)
+++ /lib/vendor/leafo/scssphp/README.md	(revision 7114)
@@ -0,0 +1,47 @@
+# scssphp
+### <http://leafo.github.io/scssphp>
+
+[![Build](https://travis-ci.org/leafo/scssphp.svg?branch=master)](http://travis-ci.org/leafo/scssphp)
+[![License](https://poser.pugx.org/leafo/scssphp/license.svg)](https://packagist.org/packages/leafo/scssphp)
+
+`scssphp` is a compiler for SCSS written in PHP.
+
+Checkout the homepage, <http://leafo.github.io/scssphp>, for directions on how to use.
+
+## Running Tests
+
+`scssphp` uses [PHPUnit](https://github.com/sebastianbergmann/phpunit) for testing.
+
+Run the following command from the root directory to run every test:
+
+    vendor/bin/phpunit tests
+
+There are several tests in the `tests/` directory:
+
+* `ApiTest.php` contains various unit tests that test the PHP interface.
+* `ExceptionTest.php` contains unit tests that test for exceptions thrown by the parser and compiler.
+* `FailingTest.php` contains tests reported in Github issues that demonstrate compatibility bugs.
+* `InputTest.php` compiles every `.scss` file in the `tests/inputs` directory
+  then compares to the respective `.css` file in the `tests/outputs` directory.
+* `ScssTest.php` extracts (ruby) `scss` tests from the `tests/scss_test.rb` file.
+* `ServerTest.php` contains functional tests for the `Server` class.
+
+When changing any of the tests in `tests/inputs`, the tests will most likely
+fail because the output has changed. Once you verify that the output is correct
+you can run the following command to rebuild all the tests:
+
+    BUILD=1 vendor/bin/phpunit tests
+
+This will compile all the tests, and save results into `tests/outputs`.
+
+To enable the `scss` compatibility tests:
+
+    TEST_SCSS_COMPAT=1 vendor/bin/phpunit tests
+
+## Coding Standard
+
+`scssphp` source conforms to [PSR2](http://www.php-fig.org/psr/psr-2/).
+
+Run the following command from the root directory to check the code for "sniffs".
+
+    vendor/bin/phpcs --standard=PSR2 bin src tests
Index: /lib/vendor/leafo/scssphp/bin/pscss
===================================================================
--- /lib/vendor/leafo/scssphp/bin/pscss	(revision 7114)
+++ /lib/vendor/leafo/scssphp/bin/pscss	(revision 7114)
@@ -0,0 +1,204 @@
+#!/usr/bin/env php
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2015 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+error_reporting(E_ALL);
+
+if (version_compare(PHP_VERSION, '5.4') < 0) {
+    die('Requires PHP 5.4 or above');
+}
+
+include __DIR__ . '/../scss.inc.php';
+
+use Leafo\ScssPhp\Compiler;
+use Leafo\ScssPhp\Parser;
+use Leafo\ScssPhp\Version;
+
+$style = null;
+$loadPaths = null;
+$precision = null;
+$dumpTree = false;
+$inputFile = null;
+$changeDir = false;
+$debugInfo = false;
+$lineNumbers = false;
+$ignoreErrors = false;
+$encoding = false;
+
+/**
+ * Parse argument
+ *
+ * @param integer $i
+ * @param array $options
+ *
+ * @return string|null
+ */
+function parseArgument(&$i, $options) {
+    global $argc;
+    global $argv;
+
+    if (! preg_match('/^(?:' . implode('|', (array) $options) . ')=?(.*)/', $argv[$i], $matches)) {
+        return;
+    }
+
+    if (strlen($matches[1])) {
+        return $matches[1];
+    }
+
+    if ($i + 1 < $argc) {
+        $i++;
+
+        return $argv[$i];
+    }
+}
+
+for ($i = 1; $i < $argc; $i++) {
+    if ($argv[$i] === '-h' || $argv[$i] === '--help') {
+        $exe = $argv[0];
+
+        $HELP = <<<EOT
+Usage: $exe [options] [input-file]
+
+Options include:
+
+    -h, --help          Show this message
+    --continue-on-error Continue compilation (as best as possible) when error encountered
+    --debug-info        Annotate selectors with CSS referring to the source file and line number
+    -f=format           Set the output format (compact, compressed, crunched, expanded, or nested)
+    -i=path             Set import path
+    --iso8859-1         Use iso8859-1 encoding instead of utf-8 (default utf-8)
+    --line-numbers      Annotate selectors with comments referring to the source file and line number
+    -p=precision        Set decimal number precision (default 5)
+    -T                  Dump formatted parse tree
+    -v, --version       Print the version
+
+EOT;
+        exit($HELP);
+    }
+
+    if ($argv[$i] === '-v' || $argv[$i] === '--version') {
+        exit(Version::VERSION . "\n");
+    }
+
+    if ($argv[$i] === '--continue-on-error') {
+        $ignoreErrors = true;
+        continue;
+    }
+
+    if ($argv[$i] === '--debug-info') {
+        $debugInfo = true;
+        continue;
+    }
+
+    if ($argv[$i] === '--iso8859-1') {
+        $encoding = 'iso8859-1';
+        continue;
+    }
+
+    if ($argv[$i] === '--line-numbers' || $argv[$i] === '--line-comments') {
+        $lineNumbers = true;
+        continue;
+    }
+
+    if ($argv[$i] === '-T') {
+        $dumpTree = true;
+        continue;
+    }
+
+    $value = parseArgument($i, array('-f', '--style'));
+
+    if (isset($value)) {
+        $style = $value;
+        continue;
+    }
+
+    $value = parseArgument($i, array('-i', '--load_paths'));
+
+    if (isset($value)) {
+        $loadPaths = $value;
+        continue;
+    }
+
+    $value = parseArgument($i, array('-p', '--precision'));
+
+    if (isset($value)) {
+        $precision = $value;
+        continue;
+    }
+
+    if (file_exists($argv[$i])) {
+        $inputFile = $argv[$i];
+        continue;
+    }
+}
+
+
+if ($inputFile) {
+    $data = file_get_contents($inputFile);
+
+    $newWorkingDir = dirname(realpath($inputFile));
+    $oldWorkingDir = getcwd();
+
+    if ($oldWorkingDir !== $newWorkingDir) {
+        $changeDir = chdir($newWorkingDir);
+        $inputFile = basename($inputFile);
+    }
+} else {
+    $data = '';
+
+    while (! feof(STDIN)) {
+        $data .= fread(STDIN, 8192);
+    }
+}
+
+if ($dumpTree) {
+    $parser = new Parser($inputFile);
+
+    print_r(json_decode(json_encode($parser->parse($data)), true));
+
+    exit();
+}
+
+$scss = new Compiler();
+
+if ($debugInfo) {
+    $scss->setLineNumberStyle(Compiler::DEBUG_INFO);
+}
+
+if ($lineNumbers) {
+    $scss->setLineNumberStyle(Compiler::LINE_COMMENTS);
+}
+
+if ($ignoreErrors) {
+    $scss->setIgnoreErrors($ignoreErrors);
+}
+
+if ($loadPaths) {
+    $scss->setImportPaths(explode(PATH_SEPARATOR, $loadPaths));
+}
+
+if ($precision) {
+    $scss->setNumberPrecision($precision);
+}
+
+if ($style) {
+    $scss->setFormatter('Leafo\\ScssPhp\\Formatter\\' . ucfirst($style));
+}
+
+if ($encoding) {
+    $scss->setEncoding($encoding);
+}
+
+echo $scss->compile($data, $inputFile);
+
+if ($changeDir) {
+    chdir($oldWorkingDir);
+}
Index: /lib/vendor/leafo/scssphp/composer.json
===================================================================
--- /lib/vendor/leafo/scssphp/composer.json	(revision 7114)
+++ /lib/vendor/leafo/scssphp/composer.json	(revision 7114)
@@ -0,0 +1,41 @@
+{
+    "name": "leafo/scssphp",
+    "type": "library",
+    "description": "scssphp is a compiler for SCSS written in PHP.",
+    "keywords": ["css", "stylesheet", "scss", "sass", "less"],
+    "homepage": "http://leafo.github.io/scssphp/",
+    "license": [
+        "MIT"
+    ],
+    "authors": [
+        {
+            "name": "Leaf Corcoran",
+            "email": "leafot@gmail.com",
+            "homepage": "http://leafo.net"
+        }
+    ],
+    "autoload": {
+        "psr-4": { "Leafo\\ScssPhp\\": "src/" }
+    },
+    "autoload-dev": {
+        "psr-4": { "Leafo\\ScssPhp\\Test\\": "tests/" }
+    },
+    "require": {
+        "php": ">=5.4.0"
+    },
+    "require-dev": {
+        "squizlabs/php_codesniffer": "~2.5",
+        "phpunit/phpunit": "~4.6"
+    },
+    "bin": ["bin/pscss"],
+    "archive": {
+        "exclude": [
+            "/Makefile",
+            "/.gitattributes",
+            "/.gitignore",
+            "/.travis.yml",
+            "/phpunit.xml.dist",
+            "/tests"
+        ]
+    }
+}
Index: /lib/vendor/leafo/scssphp/example/Server.php
===================================================================
--- /lib/vendor/leafo/scssphp/example/Server.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/example/Server.php	(revision 7114)
@@ -0,0 +1,452 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+use Leafo\ScssPhp\Compiler;
+use Leafo\ScssPhp\Exception\ServerException;
+use Leafo\ScssPhp\Version;
+
+/**
+ * Server
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Server
+{
+    /**
+     * @var boolean
+     */
+    private $showErrorsAsCSS;
+
+    /**
+     * @var string
+     */
+    private $dir;
+
+    /**
+     * @var string
+     */
+    private $cacheDir;
+
+    /**
+     * @var \Leafo\ScssPhp\Compiler
+     */
+    private $scss;
+
+    /**
+     * Join path components
+     *
+     * @param string $left  Path component, left of the directory separator
+     * @param string $right Path component, right of the directory separator
+     *
+     * @return string
+     */
+    protected function join($left, $right)
+    {
+        return rtrim($left, '/\\') . DIRECTORY_SEPARATOR . ltrim($right, '/\\');
+    }
+
+    /**
+     * Get name of requested .scss file
+     *
+     * @return string|null
+     */
+    protected function inputName()
+    {
+        switch (true) {
+            case isset($_GET['p']):
+                return $_GET['p'];
+            case isset($_SERVER['PATH_INFO']):
+                return $_SERVER['PATH_INFO'];
+            case isset($_SERVER['DOCUMENT_URI']):
+                return substr($_SERVER['DOCUMENT_URI'], strlen($_SERVER['SCRIPT_NAME']));
+        }
+    }
+
+    /**
+     * Get path to requested .scss file
+     *
+     * @return string
+     */
+    protected function findInput()
+    {
+        if (($input = $this->inputName())
+            && strpos($input, '..') === false
+            && substr($input, -5) === '.scss'
+        ) {
+            $name = $this->join($this->dir, $input);
+
+            if (is_file($name) && is_readable($name)) {
+                return $name;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Get path to cached .css file
+     *
+     * @return string
+     */
+    protected function cacheName($fname)
+    {
+        return $this->join($this->cacheDir, md5($fname) . '.css');
+    }
+
+    /**
+     * Get path to meta data
+     *
+     * @return string
+     */
+    protected function metadataName($out)
+    {
+        return $out . '.meta';
+    }
+
+    /**
+     * Determine whether .scss file needs to be re-compiled.
+     *
+     * @param string $out  Output path
+     * @param string $etag ETag
+     *
+     * @return boolean True if compile required.
+     */
+    protected function needsCompile($out, &$etag)
+    {
+        if (! is_file($out)) {
+            return true;
+        }
+
+        $mtime = filemtime($out);
+
+        $metadataName = $this->metadataName($out);
+
+        if (is_readable($metadataName)) {
+            $metadata = unserialize(file_get_contents($metadataName));
+
+            foreach ($metadata['imports'] as $import => $originalMtime) {
+                $currentMtime = filemtime($import);
+
+                if ($currentMtime !== $originalMtime || $currentMtime > $mtime) {
+                    return true;
+                }
+            }
+
+            $metaVars = crc32(serialize($this->scss->getVariables()));
+
+            if ($metaVars !== $metadata['vars']) {
+                return true;
+            }
+
+            $etag = $metadata['etag'];
+
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Get If-Modified-Since header from client request
+     *
+     * @return string|null
+     */
+    protected function getIfModifiedSinceHeader()
+    {
+        $modifiedSince = null;
+
+        if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
+            $modifiedSince = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
+
+            if (false !== ($semicolonPos = strpos($modifiedSince, ';'))) {
+                $modifiedSince = substr($modifiedSince, 0, $semicolonPos);
+            }
+        }
+
+        return $modifiedSince;
+    }
+
+    /**
+     * Get If-None-Match header from client request
+     *
+     * @return string|null
+     */
+    protected function getIfNoneMatchHeader()
+    {
+        $noneMatch = null;
+
+        if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
+            $noneMatch = $_SERVER['HTTP_IF_NONE_MATCH'];
+        }
+
+        return $noneMatch;
+    }
+
+    /**
+     * Compile .scss file
+     *
+     * @param string $in  Input path (.scss)
+     * @param string $out Output path (.css)
+     *
+     * @return array
+     */
+    protected function compile($in, $out)
+    {
+        $start   = microtime(true);
+        $css     = $this->scss->compile(file_get_contents($in), $in);
+        $elapsed = round((microtime(true) - $start), 4);
+
+        $v    = Version::VERSION;
+        $t    = date('r');
+        $css  = "/* compiled by scssphp $v on $t (${elapsed}s) */\n\n" . $css;
+        $etag = md5($css);
+
+        file_put_contents($out, $css);
+        file_put_contents(
+            $this->metadataName($out),
+            serialize([
+                'etag'    => $etag,
+                'imports' => $this->scss->getParsedFiles(),
+                'vars'    => crc32(serialize($this->scss->getVariables())),
+            ])
+        );
+
+        return [$css, $etag];
+    }
+
+    /**
+     * Format error as a pseudo-element in CSS
+     *
+     * @param \Exception $error
+     *
+     * @return string
+     */
+    protected function createErrorCSS(\Exception $error)
+    {
+        $message = str_replace(
+            ["'", "\n"],
+            ["\\'", "\\A"],
+            $error->getfile() . ":\n\n" . $error->getMessage()
+        );
+
+        return "body { display: none !important; }
+                html:after {
+                    background: white;
+                    color: black;
+                    content: '$message';
+                    display: block !important;
+                    font-family: mono;
+                    padding: 1em;
+                    white-space: pre;
+                }";
+    }
+
+    /**
+     * Render errors as a pseudo-element within valid CSS, displaying the errors on any
+     * page that includes this CSS.
+     *
+     * @param boolean $show
+     */
+    public function showErrorsAsCSS($show = true)
+    {
+        $this->showErrorsAsCSS = $show;
+    }
+
+    /**
+     * Compile .scss file
+     *
+     * @param string $in  Input file (.scss)
+     * @param string $out Output file (.css) optional
+     *
+     * @return string|bool
+     *
+     * @throws \Leafo\ScssPhp\Exception\ServerException
+     */
+    public function compileFile($in, $out = null)
+    {
+        if (! is_readable($in)) {
+            throw new ServerException('load error: failed to find ' . $in);
+        }
+
+        $pi = pathinfo($in);
+
+        $this->scss->addImportPath($pi['dirname'] . '/');
+
+        $compiled = $this->scss->compile(file_get_contents($in), $in);
+
+        if ($out !== null) {
+            return file_put_contents($out, $compiled);
+        }
+
+        return $compiled;
+    }
+
+    /**
+     * Check if file need compiling
+     *
+     * @param string $in  Input file (.scss)
+     * @param string $out Output file (.css)
+     *
+     * @return bool
+     */
+    public function checkedCompile($in, $out)
+    {
+        if (! is_file($out) || filemtime($in) > filemtime($out)) {
+            $this->compileFile($in, $out);
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Compile requested scss and serve css.  Outputs HTTP response.
+     *
+     * @param string $salt Prefix a string to the filename for creating the cache name hash
+     */
+    public function serve($salt = '')
+    {
+        $protocol = isset($_SERVER['SERVER_PROTOCOL'])
+            ? $_SERVER['SERVER_PROTOCOL']
+            : 'HTTP/1.0';
+
+        if ($input = $this->findInput()) {
+            $output = $this->cacheName($salt . $input);
+            $etag = $noneMatch = trim($this->getIfNoneMatchHeader(), '"');
+
+            if ($this->needsCompile($output, $etag)) {
+                try {
+                    list($css, $etag) = $this->compile($input, $output);
+
+                    $lastModified = gmdate('D, d M Y H:i:s', filemtime($output)) . ' GMT';
+
+                    header('Last-Modified: ' . $lastModified);
+                    header('Content-type: text/css');
+                    header('ETag: "' . $etag . '"');
+
+                    echo $css;
+                } catch (\Exception $e) {
+                    if ($this->showErrorsAsCSS) {
+                        header('Content-type: text/css');
+
+                        echo $this->createErrorCSS($e);
+                    } else {
+                        header($protocol . ' 500 Internal Server Error');
+                        header('Content-type: text/plain');
+
+                        echo 'Parse error: ' . $e->getMessage() . "\n";
+                    }
+                }
+
+                return;
+            }
+
+            header('X-SCSS-Cache: true');
+            header('Content-type: text/css');
+            header('ETag: "' . $etag . '"');
+
+            if ($etag === $noneMatch) {
+                header($protocol . ' 304 Not Modified');
+
+                return;
+            }
+
+            $modifiedSince = $this->getIfModifiedSinceHeader();
+            $mtime = filemtime($output);
+
+            if (strtotime($modifiedSince) === $mtime) {
+                header($protocol . ' 304 Not Modified');
+
+                return;
+            }
+
+            $lastModified  = gmdate('D, d M Y H:i:s', $mtime) . ' GMT';
+            header('Last-Modified: ' . $lastModified);
+
+            echo file_get_contents($output);
+
+            return;
+        }
+
+        header($protocol . ' 404 Not Found');
+        header('Content-type: text/plain');
+
+        $v = Version::VERSION;
+        echo "/* INPUT NOT FOUND scss $v */\n";
+    }
+
+    /**
+     * Based on explicit input/output files does a full change check on cache before compiling.
+     *
+     * @param string  $in
+     * @param string  $out
+     * @param boolean $force
+     *
+     * @return string Compiled CSS results
+     *
+     * @throws \Leafo\ScssPhp\Exception\ServerException
+     */
+    public function checkedCachedCompile($in, $out, $force = false)
+    {
+        if (! is_file($in) || ! is_readable($in)) {
+            throw new ServerException('Invalid or unreadable input file specified.');
+        }
+
+        if (is_dir($out) || ! is_writable(file_exists($out) ? $out : dirname($out))) {
+            throw new ServerException('Invalid or unwritable output file specified.');
+        }
+
+        if ($force || $this->needsCompile($out, $etag)) {
+            list($css, $etag) = $this->compile($in, $out);
+        } else {
+            $css = file_get_contents($out);
+        }
+
+        return $css;
+    }
+
+    /**
+     * Constructor
+     *
+     * @param string                       $dir      Root directory to .scss files
+     * @param string                       $cacheDir Cache directory
+     * @param \Leafo\ScssPhp\Compiler|null $scss     SCSS compiler instance
+     */
+    public function __construct($dir, $cacheDir = null, $scss = null)
+    {
+        $this->dir = $dir;
+
+        if (! isset($cacheDir)) {
+            $cacheDir = $this->join($dir, 'scss_cache');
+        }
+
+        $this->cacheDir = $cacheDir;
+
+        if (! is_dir($this->cacheDir)) {
+            throw new ServerException('Cache directory doesn\'t exist: ' . $cacheDir);
+        }
+
+        if (! isset($scss)) {
+            $scss = new Compiler();
+            $scss->setImportPaths($this->dir);
+        }
+
+        $this->scss = $scss;
+        $this->showErrorsAsCSS = false;
+
+        if (! ini_get('date.timezone')) {
+            throw new ServerException('Default date.timezone not set');
+        }
+    }
+}
Index: /lib/vendor/leafo/scssphp/scss.inc.php
===================================================================
--- /lib/vendor/leafo/scssphp/scss.inc.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/scss.inc.php	(revision 7114)
@@ -0,0 +1,29 @@
+<?php
+if (version_compare(PHP_VERSION, '5.4') < 0) {
+    throw new \Exception('scssphp requires PHP 5.4 or above');
+}
+
+if (! class_exists('Leafo\ScssPhp\Version', false)) {
+    include_once __DIR__ . '/src/Base/Range.php';
+    include_once __DIR__ . '/src/Block.php';
+    include_once __DIR__ . '/src/Colors.php';
+    include_once __DIR__ . '/src/Compiler.php';
+    include_once __DIR__ . '/src/Compiler/Environment.php';
+    include_once __DIR__ . '/src/Exception/CompilerException.php';
+    include_once __DIR__ . '/src/Exception/ParserException.php';
+    include_once __DIR__ . '/src/Exception/ServerException.php';
+    include_once __DIR__ . '/src/Formatter.php';
+    include_once __DIR__ . '/src/Formatter/Compact.php';
+    include_once __DIR__ . '/src/Formatter/Compressed.php';
+    include_once __DIR__ . '/src/Formatter/Crunched.php';
+    include_once __DIR__ . '/src/Formatter/Debug.php';
+    include_once __DIR__ . '/src/Formatter/Expanded.php';
+    include_once __DIR__ . '/src/Formatter/Nested.php';
+    include_once __DIR__ . '/src/Formatter/OutputBlock.php';
+    include_once __DIR__ . '/src/Node.php';
+    include_once __DIR__ . '/src/Node/Number.php';
+    include_once __DIR__ . '/src/Parser.php';
+    include_once __DIR__ . '/src/Type.php';
+    include_once __DIR__ . '/src/Util.php';
+    include_once __DIR__ . '/src/Version.php';
+}
Index: /lib/vendor/leafo/scssphp/src/Base/Range.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Base/Range.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Base/Range.php	(revision 7114)
@@ -0,0 +1,47 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Base;
+
+/**
+ * Range
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class Range
+{
+    public $first;
+    public $last;
+
+    /**
+     * Initialize range
+     *
+     * @param integer|float $first
+     * @param integer|float $last
+     */
+    public function __construct($first, $last)
+    {
+        $this->first = $first;
+        $this->last = $last;
+    }
+
+    /**
+     * Test for inclusion in range
+     *
+     * @param integer|float $value
+     *
+     * @return boolean
+     */
+    public function includes($value)
+    {
+        return $value >= $this->first && $value <= $this->last;
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Block.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Block.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Block.php	(revision 7114)
@@ -0,0 +1,60 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+/**
+ * Block
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class Block
+{
+    /**
+     * @var string
+     */
+    public $type;
+
+    /**
+     * @var \Leafo\ScssPhp\Block
+     */
+    public $parent;
+
+    /**
+     * @var integer
+     */
+    public $sourceIndex;
+
+    /**
+     * @var integer
+     */
+    public $sourceLine;
+
+    /**
+     * @var integer
+     */
+    public $sourceColumn;
+
+    /**
+     * @var array
+     */
+    public $selectors;
+
+    /**
+     * @var array
+     */
+    public $comments;
+
+    /**
+     * @var array
+     */
+    public $children;
+}
Index: /lib/vendor/leafo/scssphp/src/Colors.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Colors.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Colors.php	(revision 7114)
@@ -0,0 +1,179 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+/**
+ * CSS Colors
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Colors
+{
+    /**
+     * CSS Colors
+     *
+     * @see http://www.w3.org/TR/css3-color
+     *
+     * @var array
+     */
+    public static $cssColors = [
+        'aliceblue' => '240,248,255',
+        'antiquewhite' => '250,235,215',
+        'aqua' => '0,255,255',
+        'aquamarine' => '127,255,212',
+        'azure' => '240,255,255',
+        'beige' => '245,245,220',
+        'bisque' => '255,228,196',
+        'black' => '0,0,0',
+        'blanchedalmond' => '255,235,205',
+        'blue' => '0,0,255',
+        'blueviolet' => '138,43,226',
+        'brown' => '165,42,42',
+        'burlywood' => '222,184,135',
+        'cadetblue' => '95,158,160',
+        'chartreuse' => '127,255,0',
+        'chocolate' => '210,105,30',
+        'coral' => '255,127,80',
+        'cornflowerblue' => '100,149,237',
+        'cornsilk' => '255,248,220',
+        'crimson' => '220,20,60',
+        'cyan' => '0,255,255',
+        'darkblue' => '0,0,139',
+        'darkcyan' => '0,139,139',
+        'darkgoldenrod' => '184,134,11',
+        'darkgray' => '169,169,169',
+        'darkgreen' => '0,100,0',
+        'darkgrey' => '169,169,169',
+        'darkkhaki' => '189,183,107',
+        'darkmagenta' => '139,0,139',
+        'darkolivegreen' => '85,107,47',
+        'darkorange' => '255,140,0',
+        'darkorchid' => '153,50,204',
+        'darkred' => '139,0,0',
+        'darksalmon' => '233,150,122',
+        'darkseagreen' => '143,188,143',
+        'darkslateblue' => '72,61,139',
+        'darkslategray' => '47,79,79',
+        'darkslategrey' => '47,79,79',
+        'darkturquoise' => '0,206,209',
+        'darkviolet' => '148,0,211',
+        'deeppink' => '255,20,147',
+        'deepskyblue' => '0,191,255',
+        'dimgray' => '105,105,105',
+        'dimgrey' => '105,105,105',
+        'dodgerblue' => '30,144,255',
+        'firebrick' => '178,34,34',
+        'floralwhite' => '255,250,240',
+        'forestgreen' => '34,139,34',
+        'fuchsia' => '255,0,255',
+        'gainsboro' => '220,220,220',
+        'ghostwhite' => '248,248,255',
+        'gold' => '255,215,0',
+        'goldenrod' => '218,165,32',
+        'gray' => '128,128,128',
+        'green' => '0,128,0',
+        'greenyellow' => '173,255,47',
+        'grey' => '128,128,128',
+        'honeydew' => '240,255,240',
+        'hotpink' => '255,105,180',
+        'indianred' => '205,92,92',
+        'indigo' => '75,0,130',
+        'ivory' => '255,255,240',
+        'khaki' => '240,230,140',
+        'lavender' => '230,230,250',
+        'lavenderblush' => '255,240,245',
+        'lawngreen' => '124,252,0',
+        'lemonchiffon' => '255,250,205',
+        'lightblue' => '173,216,230',
+        'lightcoral' => '240,128,128',
+        'lightcyan' => '224,255,255',
+        'lightgoldenrodyellow' => '250,250,210',
+        'lightgray' => '211,211,211',
+        'lightgreen' => '144,238,144',
+        'lightgrey' => '211,211,211',
+        'lightpink' => '255,182,193',
+        'lightsalmon' => '255,160,122',
+        'lightseagreen' => '32,178,170',
+        'lightskyblue' => '135,206,250',
+        'lightslategray' => '119,136,153',
+        'lightslategrey' => '119,136,153',
+        'lightsteelblue' => '176,196,222',
+        'lightyellow' => '255,255,224',
+        'lime' => '0,255,0',
+        'limegreen' => '50,205,50',
+        'linen' => '250,240,230',
+        'magenta' => '255,0,255',
+        'maroon' => '128,0,0',
+        'mediumaquamarine' => '102,205,170',
+        'mediumblue' => '0,0,205',
+        'mediumorchid' => '186,85,211',
+        'mediumpurple' => '147,112,219',
+        'mediumseagreen' => '60,179,113',
+        'mediumslateblue' => '123,104,238',
+        'mediumspringgreen' => '0,250,154',
+        'mediumturquoise' => '72,209,204',
+        'mediumvioletred' => '199,21,133',
+        'midnightblue' => '25,25,112',
+        'mintcream' => '245,255,250',
+        'mistyrose' => '255,228,225',
+        'moccasin' => '255,228,181',
+        'navajowhite' => '255,222,173',
+        'navy' => '0,0,128',
+        'oldlace' => '253,245,230',
+        'olive' => '128,128,0',
+        'olivedrab' => '107,142,35',
+        'orange' => '255,165,0',
+        'orangered' => '255,69,0',
+        'orchid' => '218,112,214',
+        'palegoldenrod' => '238,232,170',
+        'palegreen' => '152,251,152',
+        'paleturquoise' => '175,238,238',
+        'palevioletred' => '219,112,147',
+        'papayawhip' => '255,239,213',
+        'peachpuff' => '255,218,185',
+        'peru' => '205,133,63',
+        'pink' => '255,192,203',
+        'plum' => '221,160,221',
+        'powderblue' => '176,224,230',
+        'purple' => '128,0,128',
+        'rebeccapurple' => '102,51,153',
+        'red' => '255,0,0',
+        'rosybrown' => '188,143,143',
+        'royalblue' => '65,105,225',
+        'saddlebrown' => '139,69,19',
+        'salmon' => '250,128,114',
+        'sandybrown' => '244,164,96',
+        'seagreen' => '46,139,87',
+        'seashell' => '255,245,238',
+        'sienna' => '160,82,45',
+        'silver' => '192,192,192',
+        'skyblue' => '135,206,235',
+        'slateblue' => '106,90,205',
+        'slategray' => '112,128,144',
+        'slategrey' => '112,128,144',
+        'snow' => '255,250,250',
+        'springgreen' => '0,255,127',
+        'steelblue' => '70,130,180',
+        'tan' => '210,180,140',
+        'teal' => '0,128,128',
+        'thistle' => '216,191,216',
+        'tomato' => '255,99,71',
+        'transparent' => '0,0,0,0',
+        'turquoise' => '64,224,208',
+        'violet' => '238,130,238',
+        'wheat' => '245,222,179',
+        'white' => '255,255,255',
+        'whitesmoke' => '245,245,245',
+        'yellow' => '255,255,0',
+        'yellowgreen' => '154,205,50',
+    ];
+}
Index: /lib/vendor/leafo/scssphp/src/Compiler.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Compiler.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Compiler.php	(revision 7114)
@@ -0,0 +1,5261 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+use Leafo\ScssPhp\Base\Range;
+use Leafo\ScssPhp\Block;
+use Leafo\ScssPhp\Colors;
+use Leafo\ScssPhp\Compiler\Environment;
+use Leafo\ScssPhp\Exception\CompilerException;
+use Leafo\ScssPhp\Formatter\OutputBlock;
+use Leafo\ScssPhp\Node;
+use Leafo\ScssPhp\Type;
+use Leafo\ScssPhp\Parser;
+use Leafo\ScssPhp\Util;
+
+/**
+ * The scss compiler and parser.
+ *
+ * Converting SCSS to CSS is a three stage process. The incoming file is parsed
+ * by `Parser` into a syntax tree, then it is compiled into another tree
+ * representing the CSS structure by `Compiler`. The CSS tree is fed into a
+ * formatter, like `Formatter` which then outputs CSS as a string.
+ *
+ * During the first compile, all values are *reduced*, which means that their
+ * types are brought to the lowest form before being dump as strings. This
+ * handles math equations, variable dereferences, and the like.
+ *
+ * The `compile` function of `Compiler` is the entry point.
+ *
+ * In summary:
+ *
+ * The `Compiler` class creates an instance of the parser, feeds it SCSS code,
+ * then transforms the resulting tree to a CSS tree. This class also holds the
+ * evaluation context, such as all available mixins and variables at any given
+ * time.
+ *
+ * The `Parser` class is only concerned with parsing its input.
+ *
+ * The `Formatter` takes a CSS tree, and dumps it to a formatted string,
+ * handling things like indentation.
+ */
+
+/**
+ * SCSS compiler
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Compiler
+{
+    const LINE_COMMENTS = 1;
+    const DEBUG_INFO    = 2;
+
+    const WITH_RULE     = 1;
+    const WITH_MEDIA    = 2;
+    const WITH_SUPPORTS = 4;
+    const WITH_ALL      = 7;
+
+    /**
+     * @var array
+     */
+    static protected $operatorNames = [
+        '+'   => 'add',
+        '-'   => 'sub',
+        '*'   => 'mul',
+        '/'   => 'div',
+        '%'   => 'mod',
+
+        '=='  => 'eq',
+        '!='  => 'neq',
+        '<'   => 'lt',
+        '>'   => 'gt',
+
+        '<='  => 'lte',
+        '>='  => 'gte',
+        '<=>' => 'cmp',
+    ];
+
+    /**
+     * @var array
+     */
+    static protected $namespaces = [
+        'special'  => '%',
+        'mixin'    => '@',
+        'function' => '^',
+    ];
+
+    static public $true = [Type::T_KEYWORD, 'true'];
+    static public $false = [Type::T_KEYWORD, 'false'];
+    static public $null = [Type::T_NULL];
+    static public $nullString = [Type::T_STRING, '', []];
+    static public $defaultValue = [Type::T_KEYWORD, ''];
+    static public $selfSelector = [Type::T_SELF];
+    static public $emptyList = [Type::T_LIST, '', []];
+    static public $emptyMap = [Type::T_MAP, [], []];
+    static public $emptyString = [Type::T_STRING, '"', []];
+    static public $with = [Type::T_KEYWORD, 'with'];
+    static public $without = [Type::T_KEYWORD, 'without'];
+
+    protected $importPaths = [''];
+    protected $importCache = [];
+    protected $importedFiles = [];
+    protected $userFunctions = [];
+    protected $registeredVars = [];
+    protected $registeredFeatures = [
+        'extend-selector-pseudoclass' => false,
+        'at-error'                    => true,
+        'units-level-3'               => false,
+        'global-variable-shadowing'   => false,
+    ];
+
+    protected $encoding = null;
+    protected $lineNumberStyle = null;
+
+    protected $formatter = 'Leafo\ScssPhp\Formatter\Nested';
+
+    protected $rootEnv;
+    protected $rootBlock;
+
+    protected $env;
+    protected $scope;
+    protected $storeEnv;
+    protected $charsetSeen;
+    protected $sourceNames;
+
+    private $indentLevel;
+    private $commentsSeen;
+    private $extends;
+    private $extendsMap;
+    private $parsedFiles;
+    private $parser;
+    private $sourceIndex;
+    private $sourceLine;
+    private $sourceColumn;
+    private $stderr;
+    private $shouldEvaluate;
+    private $ignoreErrors;
+
+    /**
+     * Constructor
+     */
+    public function __construct()
+    {
+        $this->parsedFiles = [];
+        $this->sourceNames = [];
+    }
+
+    /**
+     * Compile scss
+     *
+     * @api
+     *
+     * @param string $code
+     * @param string $path
+     *
+     * @return string
+     */
+    public function compile($code, $path = null)
+    {
+        $locale = setlocale(LC_NUMERIC, 0);
+        setlocale(LC_NUMERIC, 'C');
+
+        $this->indentLevel    = -1;
+        $this->commentsSeen   = [];
+        $this->extends        = [];
+        $this->extendsMap     = [];
+        $this->sourceIndex    = null;
+        $this->sourceLine     = null;
+        $this->sourceColumn   = null;
+        $this->env            = null;
+        $this->scope          = null;
+        $this->storeEnv       = null;
+        $this->charsetSeen    = null;
+        $this->shouldEvaluate = null;
+        $this->stderr         = fopen('php://stderr', 'w');
+
+        $this->parser = $this->parserFactory($path);
+        $tree = $this->parser->parse($code);
+        $this->parser = null;
+
+        $this->formatter = new $this->formatter();
+        $this->rootBlock = null;
+        $this->rootEnv   = $this->pushEnv($tree);
+
+        $this->injectVariables($this->registeredVars);
+        $this->compileRoot($tree);
+        $this->popEnv();
+
+        $out = $this->formatter->format($this->scope);
+
+        setlocale(LC_NUMERIC, $locale);
+
+        return $out;
+    }
+
+    /**
+     * Instantiate parser
+     *
+     * @param string $path
+     *
+     * @return \Leafo\ScssPhp\Parser
+     */
+    protected function parserFactory($path)
+    {
+        $parser = new Parser($path, count($this->sourceNames), $this->encoding);
+
+        $this->sourceNames[] = $path;
+        $this->addParsedFile($path);
+
+        return $parser;
+    }
+
+    /**
+     * Is self extend?
+     *
+     * @param array $target
+     * @param array $origin
+     *
+     * @return boolean
+     */
+    protected function isSelfExtend($target, $origin)
+    {
+        foreach ($origin as $sel) {
+            if (in_array($target, $sel)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Push extends
+     *
+     * @param array     $target
+     * @param array     $origin
+     * @param \stdClass $block
+     */
+    protected function pushExtends($target, $origin, $block)
+    {
+        if ($this->isSelfExtend($target, $origin)) {
+            return;
+        }
+
+        $i = count($this->extends);
+        $this->extends[] = [$target, $origin, $block];
+
+        foreach ($target as $part) {
+            if (isset($this->extendsMap[$part])) {
+                $this->extendsMap[$part][] = $i;
+            } else {
+                $this->extendsMap[$part] = [$i];
+            }
+        }
+    }
+
+    /**
+     * Make output block
+     *
+     * @param string $type
+     * @param array  $selectors
+     *
+     * @return \Leafo\ScssPhp\Formatter\OutputBlock
+     */
+    protected function makeOutputBlock($type, $selectors = null)
+    {
+        $out = new OutputBlock;
+        $out->type      = $type;
+        $out->lines     = [];
+        $out->children  = [];
+        $out->parent    = $this->scope;
+        $out->selectors = $selectors;
+        $out->depth     = $this->env->depth;
+
+        return $out;
+    }
+
+    /**
+     * Compile root
+     *
+     * @param \Leafo\ScssPhp\Block $rootBlock
+     */
+    protected function compileRoot(Block $rootBlock)
+    {
+        $this->rootBlock = $this->scope = $this->makeOutputBlock(Type::T_ROOT);
+
+        $this->compileChildrenNoReturn($rootBlock->children, $this->scope);
+        $this->flattenSelectors($this->scope);
+        $this->missingSelectors();
+    }
+
+    /**
+     * Report missing selectors
+     */
+    protected function missingSelectors()
+    {
+        foreach ($this->extends as $extend) {
+            if (isset($extend[3])) {
+                continue;
+            }
+
+            list($target, $origin, $block) = $extend;
+
+            // ignore if !optional
+            if ($block[2]) {
+                continue;
+            }
+
+            $target = implode(' ', $target);
+            $origin = $this->collapseSelectors($origin);
+
+            $this->sourceLine = $block[Parser::SOURCE_LINE];
+            $this->throwError("\"$origin\" failed to @extend \"$target\". The selector \"$target\" was not found.");
+        }
+    }
+
+    /**
+     * Flatten selectors
+     *
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $block
+     * @param string                               $parentKey
+     */
+    protected function flattenSelectors(OutputBlock $block, $parentKey = null)
+    {
+        if ($block->selectors) {
+            $selectors = [];
+
+            foreach ($block->selectors as $s) {
+                $selectors[] = $s;
+
+                if (! is_array($s)) {
+                    continue;
+                }
+
+                // check extends
+                if (! empty($this->extendsMap)) {
+                    $this->matchExtends($s, $selectors);
+
+                    // remove duplicates
+                    array_walk($selectors, function (&$value) {
+                        $value = serialize($value);
+                    });
+
+                    $selectors = array_unique($selectors);
+
+                    array_walk($selectors, function (&$value) {
+                        $value = unserialize($value);
+                    });
+                }
+            }
+
+            $block->selectors = [];
+            $placeholderSelector = false;
+
+            foreach ($selectors as $selector) {
+                if ($this->hasSelectorPlaceholder($selector)) {
+                    $placeholderSelector = true;
+                    continue;
+                }
+
+                $block->selectors[] = $this->compileSelector($selector);
+            }
+
+            if ($placeholderSelector && 0 === count($block->selectors) && null !== $parentKey) {
+                unset($block->parent->children[$parentKey]);
+
+                return;
+            }
+        }
+
+        foreach ($block->children as $key => $child) {
+            $this->flattenSelectors($child, $key);
+        }
+    }
+
+    /**
+     * Match extends
+     *
+     * @param array   $selector
+     * @param array   $out
+     * @param integer $from
+     * @param boolean $initial
+     */
+    protected function matchExtends($selector, &$out, $from = 0, $initial = true)
+    {
+        foreach ($selector as $i => $part) {
+            if ($i < $from) {
+                continue;
+            }
+
+            if ($this->matchExtendsSingle($part, $origin)) {
+                $after = array_slice($selector, $i + 1);
+                $before = array_slice($selector, 0, $i);
+
+                list($before, $nonBreakableBefore) = $this->extractRelationshipFromFragment($before);
+
+                foreach ($origin as $new) {
+                    $k = 0;
+
+                    // remove shared parts
+                    if ($initial) {
+                        while ($k < $i && isset($new[$k]) && $selector[$k] === $new[$k]) {
+                            $k++;
+                        }
+                    }
+
+                    $replacement = [];
+                    $tempReplacement = $k > 0 ? array_slice($new, $k) : $new;
+
+                    for ($l = count($tempReplacement) - 1; $l >= 0; $l--) {
+                        $slice = $tempReplacement[$l];
+                        array_unshift($replacement, $slice);
+
+                        if (! $this->isImmediateRelationshipCombinator(end($slice))) {
+                            break;
+                        }
+                    }
+
+                    $afterBefore = $l != 0 ? array_slice($tempReplacement, 0, $l) : [];
+
+                    // Merge shared direct relationships.
+                    $mergedBefore = $this->mergeDirectRelationships($afterBefore, $nonBreakableBefore);
+
+                    $result = array_merge(
+                        $before,
+                        $mergedBefore,
+                        $replacement,
+                        $after
+                    );
+
+                    if ($result === $selector) {
+                        continue;
+                    }
+
+                    $out[] = $result;
+
+                    // recursively check for more matches
+                    $this->matchExtends($result, $out, count($before) + count($mergedBefore), false);
+
+                    // selector sequence merging
+                    if (! empty($before) && count($new) > 1) {
+                        $sharedParts = $k > 0 ? array_slice($before, 0, $k) : [];
+                        $postSharedParts = $k > 0 ? array_slice($before, $k) : $before;
+
+                        list($injectBetweenSharedParts, $nonBreakable2) = $this->extractRelationshipFromFragment($afterBefore);
+
+                        $result2 = array_merge(
+                            $sharedParts,
+                            $injectBetweenSharedParts,
+                            $postSharedParts,
+                            $nonBreakable2,
+                            $nonBreakableBefore,
+                            $replacement,
+                            $after
+                        );
+
+                        $out[] = $result2;
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Match extends single
+     *
+     * @param array $rawSingle
+     * @param array $outOrigin
+     *
+     * @return boolean
+     */
+    protected function matchExtendsSingle($rawSingle, &$outOrigin)
+    {
+        $counts = [];
+        $single = [];
+
+        foreach ($rawSingle as $part) {
+            // matches Number
+            if (! is_string($part)) {
+                return false;
+            }
+
+            if (! preg_match('/^[\[.:#%]/', $part) && count($single)) {
+                $single[count($single) - 1] .= $part;
+            } else {
+                $single[] = $part;
+            }
+        }
+
+        $extendingDecoratedTag = false;
+
+        if (count($single) > 1) {
+            $matches = null;
+            $extendingDecoratedTag = preg_match('/^[a-z0-9]+$/i', $single[0], $matches) ? $matches[0] : false;
+        }
+
+        foreach ($single as $part) {
+            if (isset($this->extendsMap[$part])) {
+                foreach ($this->extendsMap[$part] as $idx) {
+                    $counts[$idx] = isset($counts[$idx]) ? $counts[$idx] + 1 : 1;
+                }
+            }
+        }
+
+        $outOrigin = [];
+        $found = false;
+
+        foreach ($counts as $idx => $count) {
+            list($target, $origin, /* $block */) = $this->extends[$idx];
+
+            // check count
+            if ($count !== count($target)) {
+                continue;
+            }
+
+            $this->extends[$idx][3] = true;
+
+            $rem = array_diff($single, $target);
+
+            foreach ($origin as $j => $new) {
+                // prevent infinite loop when target extends itself
+                if ($this->isSelfExtend($single, $origin)) {
+                    return false;
+                }
+
+                $replacement = end($new);
+
+                // Extending a decorated tag with another tag is not possible.
+                if ($extendingDecoratedTag && $replacement[0] != $extendingDecoratedTag &&
+                    preg_match('/^[a-z0-9]+$/i', $replacement[0])
+                ) {
+                    unset($origin[$j]);
+                    continue;
+                }
+
+                $combined = $this->combineSelectorSingle($replacement, $rem);
+
+                if (count(array_diff($combined, $origin[$j][count($origin[$j]) - 1]))) {
+                    $origin[$j][count($origin[$j]) - 1] = $combined;
+                }
+            }
+
+            $outOrigin = array_merge($outOrigin, $origin);
+
+            $found = true;
+        }
+
+        return $found;
+    }
+
+
+    /**
+     * Extract a relationship from the fragment.
+     *
+     * When extracting the last portion of a selector we will be left with a
+     * fragment which may end with a direction relationship combinator. This
+     * method will extract the relationship fragment and return it along side
+     * the rest.
+     *
+     * @param array $fragment The selector fragment maybe ending with a direction relationship combinator.
+     * @return array The selector without the relationship fragment if any, the relationship fragment.
+     */
+    protected function extractRelationshipFromFragment(array $fragment)
+    {
+        $parents = [];
+        $children = [];
+        $j = $i = count($fragment);
+
+        for (;;) {
+            $children = $j != $i ? array_slice($fragment, $j, $i - $j) : [];
+            $parents = array_slice($fragment, 0, $j);
+            $slice = end($parents);
+
+            if (empty($slice) || ! $this->isImmediateRelationshipCombinator($slice[0])) {
+                break;
+            }
+
+            $j -= 2;
+        }
+
+        return [$parents, $children];
+    }
+
+    /**
+     * Combine selector single
+     *
+     * @param array $base
+     * @param array $other
+     *
+     * @return array
+     */
+    protected function combineSelectorSingle($base, $other)
+    {
+        $tag = [];
+        $out = [];
+        $wasTag = true;
+
+        foreach ([$base, $other] as $single) {
+            foreach ($single as $part) {
+                if (preg_match('/^[\[.:#]/', $part)) {
+                    $out[] = $part;
+                    $wasTag = false;
+                } elseif (preg_match('/^[^_-]/', $part)) {
+                    $tag[] = $part;
+                    $wasTag = true;
+                } elseif ($wasTag) {
+                    $tag[count($tag) - 1] .= $part;
+                } else {
+                    $out[count($out) - 1] .= $part;
+                }
+            }
+        }
+
+        if (count($tag)) {
+            array_unshift($out, $tag[0]);
+        }
+
+        return $out;
+    }
+
+    /**
+     * Compile media
+     *
+     * @param \Leafo\ScssPhp\Block $media
+     */
+    protected function compileMedia(Block $media)
+    {
+        $this->pushEnv($media);
+
+        $mediaQuery = $this->compileMediaQuery($this->multiplyMedia($this->env));
+
+        if (! empty($mediaQuery)) {
+            $this->scope = $this->makeOutputBlock(Type::T_MEDIA, [$mediaQuery]);
+
+            $parentScope = $this->mediaParent($this->scope);
+            $parentScope->children[] = $this->scope;
+
+            // top level properties in a media cause it to be wrapped
+            $needsWrap = false;
+
+            foreach ($media->children as $child) {
+                $type = $child[0];
+
+                if ($type !== Type::T_BLOCK &&
+                    $type !== Type::T_MEDIA &&
+                    $type !== Type::T_DIRECTIVE &&
+                    $type !== Type::T_IMPORT
+                ) {
+                    $needsWrap = true;
+                    break;
+                }
+            }
+
+            if ($needsWrap) {
+                $wrapped = new Block;
+                $wrapped->sourceIndex  = $media->sourceIndex;
+                $wrapped->sourceLine   = $media->sourceLine;
+                $wrapped->sourceColumn = $media->sourceColumn;
+                $wrapped->selectors    = [];
+                $wrapped->comments     = [];
+                $wrapped->parent       = $media;
+                $wrapped->children     = $media->children;
+
+                $media->children = [[Type::T_BLOCK, $wrapped]];
+            }
+
+            $this->compileChildrenNoReturn($media->children, $this->scope);
+
+            $this->scope = $this->scope->parent;
+        }
+
+        $this->popEnv();
+    }
+
+    /**
+     * Media parent
+     *
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $scope
+     *
+     * @return \Leafo\ScssPhp\Formatter\OutputBlock
+     */
+    protected function mediaParent(OutputBlock $scope)
+    {
+        while (! empty($scope->parent)) {
+            if (! empty($scope->type) && $scope->type !== Type::T_MEDIA) {
+                break;
+            }
+
+            $scope = $scope->parent;
+        }
+
+        return $scope;
+    }
+
+    /**
+     * Compile directive
+     *
+     * @param \Leafo\ScssPhp\Block $block
+     */
+    protected function compileDirective(Block $block)
+    {
+        $s = '@' . $block->name;
+
+        if (! empty($block->value)) {
+            $s .= ' ' . $this->compileValue($block->value);
+        }
+
+        if ($block->name === 'keyframes' || substr($block->name, -10) === '-keyframes') {
+            $this->compileKeyframeBlock($block, [$s]);
+        } else {
+            $this->compileNestedBlock($block, [$s]);
+        }
+    }
+
+    /**
+     * Compile at-root
+     *
+     * @param \Leafo\ScssPhp\Block $block
+     */
+    protected function compileAtRoot(Block $block)
+    {
+        $env     = $this->pushEnv($block);
+        $envs    = $this->compactEnv($env);
+        $without = isset($block->with) ? $this->compileWith($block->with) : static::WITH_RULE;
+
+        // wrap inline selector
+        if ($block->selector) {
+            $wrapped = new Block;
+            $wrapped->sourceIndex  = $block->sourceIndex;
+            $wrapped->sourceLine   = $block->sourceLine;
+            $wrapped->sourceColumn = $block->sourceColumn;
+            $wrapped->selectors    = $block->selector;
+            $wrapped->comments     = [];
+            $wrapped->parent       = $block;
+            $wrapped->children     = $block->children;
+
+            $block->children = [[Type::T_BLOCK, $wrapped]];
+        }
+
+        $this->env = $this->filterWithout($envs, $without);
+        $newBlock  = $this->spliceTree($envs, $block, $without);
+
+        $saveScope   = $this->scope;
+        $this->scope = $this->rootBlock;
+
+        $this->compileChild($newBlock, $this->scope);
+
+        $this->scope = $saveScope;
+        $this->env   = $this->extractEnv($envs);
+
+        $this->popEnv();
+    }
+
+    /**
+     * Splice parse tree
+     *
+     * @param array                $envs
+     * @param \Leafo\ScssPhp\Block $block
+     * @param integer              $without
+     *
+     * @return array
+     */
+    private function spliceTree($envs, Block $block, $without)
+    {
+        $newBlock = null;
+
+        foreach ($envs as $e) {
+            if (! isset($e->block)) {
+                continue;
+            }
+
+            if ($e->block === $block) {
+                continue;
+            }
+
+            if (isset($e->block->type) && $e->block->type === Type::T_AT_ROOT) {
+                continue;
+            }
+
+            if ($e->block && $this->isWithout($without, $e->block)) {
+                continue;
+            }
+
+            $b = new Block;
+            $b->sourceIndex  = $e->block->sourceIndex;
+            $b->sourceLine   = $e->block->sourceLine;
+            $b->sourceColumn = $e->block->sourceColumn;
+            $b->selectors    = [];
+            $b->comments     = $e->block->comments;
+            $b->parent       = null;
+
+            if ($newBlock) {
+                $type = isset($newBlock->type) ? $newBlock->type : Type::T_BLOCK;
+
+                $b->children = [[$type, $newBlock]];
+
+                $newBlock->parent = $b;
+            } elseif (count($block->children)) {
+                foreach ($block->children as $child) {
+                    if ($child[0] === Type::T_BLOCK) {
+                        $child[1]->parent = $b;
+                    }
+                }
+
+                $b->children = $block->children;
+            }
+
+            if (isset($e->block->type)) {
+                $b->type = $e->block->type;
+            }
+
+            if (isset($e->block->name)) {
+                $b->name = $e->block->name;
+            }
+
+            if (isset($e->block->queryList)) {
+                $b->queryList = $e->block->queryList;
+            }
+
+            if (isset($e->block->value)) {
+                $b->value = $e->block->value;
+            }
+
+            $newBlock = $b;
+        }
+
+        $type = isset($newBlock->type) ? $newBlock->type : Type::T_BLOCK;
+
+        return [$type, $newBlock];
+    }
+
+    /**
+     * Compile @at-root's with: inclusion / without: exclusion into filter flags
+     *
+     * @param array $with
+     *
+     * @return integer
+     */
+    private function compileWith($with)
+    {
+        static $mapping = [
+            'rule'     => self::WITH_RULE,
+            'media'    => self::WITH_MEDIA,
+            'supports' => self::WITH_SUPPORTS,
+            'all'      => self::WITH_ALL,
+        ];
+
+        // exclude selectors by default
+        $without = static::WITH_RULE;
+
+        if ($this->libMapHasKey([$with, static::$with])) {
+            $without = static::WITH_ALL;
+
+            $list = $this->coerceList($this->libMapGet([$with, static::$with]));
+
+            foreach ($list[2] as $item) {
+                $keyword = $this->compileStringContent($this->coerceString($item));
+
+                if (array_key_exists($keyword, $mapping)) {
+                    $without &= ~($mapping[$keyword]);
+                }
+            }
+        }
+
+        if ($this->libMapHasKey([$with, static::$without])) {
+            $without = 0;
+
+            $list = $this->coerceList($this->libMapGet([$with, static::$without]));
+
+            foreach ($list[2] as $item) {
+                $keyword = $this->compileStringContent($this->coerceString($item));
+
+                if (array_key_exists($keyword, $mapping)) {
+                    $without |= $mapping[$keyword];
+                }
+            }
+        }
+
+        return $without;
+    }
+
+    /**
+     * Filter env stack
+     *
+     * @param array   $envs
+     * @param integer $without
+     *
+     * @return \Leafo\ScssPhp\Compiler\Environment
+     */
+    private function filterWithout($envs, $without)
+    {
+        $filtered = [];
+
+        foreach ($envs as $e) {
+            if ($e->block && $this->isWithout($without, $e->block)) {
+                continue;
+            }
+
+            $filtered[] = $e;
+        }
+
+        return $this->extractEnv($filtered);
+    }
+
+    /**
+     * Filter WITH rules
+     *
+     * @param integer              $without
+     * @param \Leafo\ScssPhp\Block $block
+     *
+     * @return boolean
+     */
+    private function isWithout($without, Block $block)
+    {
+        if ((($without & static::WITH_RULE) && isset($block->selectors)) ||
+            (($without & static::WITH_MEDIA) &&
+                isset($block->type) && $block->type === Type::T_MEDIA) ||
+            (($without & static::WITH_SUPPORTS) &&
+                isset($block->type) && $block->type === Type::T_DIRECTIVE &&
+                isset($block->name) && $block->name === 'supports')
+        ) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Compile keyframe block
+     *
+     * @param \Leafo\ScssPhp\Block $block
+     * @param array                $selectors
+     */
+    protected function compileKeyframeBlock(Block $block, $selectors)
+    {
+        $env = $this->pushEnv($block);
+
+        $envs = $this->compactEnv($env);
+
+        $this->env = $this->extractEnv(array_filter($envs, function (Environment $e) {
+            return ! isset($e->block->selectors);
+        }));
+
+        $this->scope = $this->makeOutputBlock($block->type, $selectors);
+        $this->scope->depth = 1;
+        $this->scope->parent->children[] = $this->scope;
+
+        $this->compileChildrenNoReturn($block->children, $this->scope);
+
+        $this->scope = $this->scope->parent;
+        $this->env   = $this->extractEnv($envs);
+
+        $this->popEnv();
+    }
+
+    /**
+     * Compile nested block
+     *
+     * @param \Leafo\ScssPhp\Block $block
+     * @param array                $selectors
+     */
+    protected function compileNestedBlock(Block $block, $selectors)
+    {
+        $this->pushEnv($block);
+
+        $this->scope = $this->makeOutputBlock($block->type, $selectors);
+        $this->scope->parent->children[] = $this->scope;
+
+        $this->compileChildrenNoReturn($block->children, $this->scope);
+
+        $this->scope = $this->scope->parent;
+
+        $this->popEnv();
+    }
+
+    /**
+     * Recursively compiles a block.
+     *
+     * A block is analogous to a CSS block in most cases. A single SCSS document
+     * is encapsulated in a block when parsed, but it does not have parent tags
+     * so all of its children appear on the root level when compiled.
+     *
+     * Blocks are made up of selectors and children.
+     *
+     * The children of a block are just all the blocks that are defined within.
+     *
+     * Compiling the block involves pushing a fresh environment on the stack,
+     * and iterating through the props, compiling each one.
+     *
+     * @see Compiler::compileChild()
+     *
+     * @param \Leafo\ScssPhp\Block $block
+     */
+    protected function compileBlock(Block $block)
+    {
+        $env = $this->pushEnv($block);
+        $env->selectors = $this->evalSelectors($block->selectors);
+
+        $out = $this->makeOutputBlock(null);
+
+        if (isset($this->lineNumberStyle) && count($env->selectors) && count($block->children)) {
+            $annotation = $this->makeOutputBlock(Type::T_COMMENT);
+            $annotation->depth = 0;
+
+            $file = $this->sourceNames[$block->sourceIndex];
+            $line = $block->sourceLine;
+
+            switch ($this->lineNumberStyle) {
+                case static::LINE_COMMENTS:
+                    $annotation->lines[] = '/* line ' . $line
+                                         . ($file ? ', ' . $file : '')
+                                         . ' */';
+                    break;
+
+                case static::DEBUG_INFO:
+                    $annotation->lines[] = '@media -sass-debug-info{'
+                                         . ($file ? 'filename{font-family:"' . $file . '"}' : '')
+                                         . 'line{font-family:' . $line . '}}';
+                    break;
+            }
+
+            $this->scope->children[] = $annotation;
+        }
+
+        $this->scope->children[] = $out;
+
+        if (count($block->children)) {
+            $out->selectors = $this->multiplySelectors($env);
+
+            $this->compileChildrenNoReturn($block->children, $out);
+        }
+
+        $this->formatter->stripSemicolon($out->lines);
+
+        $this->popEnv();
+    }
+
+    /**
+     * Compile root level comment
+     *
+     * @param array $block
+     */
+    protected function compileComment($block)
+    {
+        $out = $this->makeOutputBlock(Type::T_COMMENT);
+        $out->lines[] = $block[1];
+        $this->scope->children[] = $out;
+    }
+
+    /**
+     * Evaluate selectors
+     *
+     * @param array $selectors
+     *
+     * @return array
+     */
+    protected function evalSelectors($selectors)
+    {
+        $this->shouldEvaluate = false;
+
+        $selectors = array_map([$this, 'evalSelector'], $selectors);
+
+        // after evaluating interpolates, we might need a second pass
+        if ($this->shouldEvaluate) {
+            $buffer = $this->collapseSelectors($selectors);
+            $parser = $this->parserFactory(__METHOD__);
+
+            if ($parser->parseSelector($buffer, $newSelectors)) {
+                $selectors = array_map([$this, 'evalSelector'], $newSelectors);
+            }
+        }
+
+        return $selectors;
+    }
+
+    /**
+     * Evaluate selector
+     *
+     * @param array $selector
+     *
+     * @return array
+     */
+    protected function evalSelector($selector)
+    {
+        return array_map([$this, 'evalSelectorPart'], $selector);
+    }
+
+    /**
+     * Evaluate selector part; replaces all the interpolates, stripping quotes
+     *
+     * @param array $part
+     *
+     * @return array
+     */
+    protected function evalSelectorPart($part)
+    {
+        foreach ($part as &$p) {
+            if (is_array($p) && ($p[0] === Type::T_INTERPOLATE || $p[0] === Type::T_STRING)) {
+                $p = $this->compileValue($p);
+
+                // force re-evaluation
+                if (strpos($p, '&') !== false || strpos($p, ',') !== false) {
+                    $this->shouldEvaluate = true;
+                }
+            } elseif (is_string($p) && strlen($p) >= 2 &&
+                ($first = $p[0]) && ($first === '"' || $first === "'") &&
+                substr($p, -1) === $first
+            ) {
+                $p = substr($p, 1, -1);
+            }
+        }
+
+        return $this->flattenSelectorSingle($part);
+    }
+
+    /**
+     * Collapse selectors
+     *
+     * @param array $selectors
+     *
+     * @return string
+     */
+    protected function collapseSelectors($selectors)
+    {
+        $parts = [];
+
+        foreach ($selectors as $selector) {
+            $output = '';
+
+            array_walk_recursive(
+                $selector,
+                function ($value, $key) use (&$output) {
+                    $output .= $value;
+                }
+            );
+
+            $parts[] = $output;
+        }
+
+        return implode(', ', $parts);
+    }
+
+    /**
+     * Flatten selector single; joins together .classes and #ids
+     *
+     * @param array $single
+     *
+     * @return array
+     */
+    protected function flattenSelectorSingle($single)
+    {
+        $joined = [];
+
+        foreach ($single as $part) {
+            if (empty($joined) ||
+                ! is_string($part) ||
+                preg_match('/[\[.:#%]/', $part)
+            ) {
+                $joined[] = $part;
+                continue;
+            }
+
+            if (is_array(end($joined))) {
+                $joined[] = $part;
+            } else {
+                $joined[count($joined) - 1] .= $part;
+            }
+        }
+
+        return $joined;
+    }
+
+    /**
+     * Compile selector to string; self(&) should have been replaced by now
+     *
+     * @param array $selector
+     *
+     * @return string
+     */
+    protected function compileSelector($selector)
+    {
+        if (! is_array($selector)) {
+            return $selector; // media and the like
+        }
+
+        return implode(
+            ' ',
+            array_map(
+                [$this, 'compileSelectorPart'],
+                $selector
+            )
+        );
+    }
+
+    /**
+     * Compile selector part
+     *
+     * @param arary $piece
+     *
+     * @return string
+     */
+    protected function compileSelectorPart($piece)
+    {
+        foreach ($piece as &$p) {
+            if (! is_array($p)) {
+                continue;
+            }
+
+            switch ($p[0]) {
+                case Type::T_SELF:
+                    $p = '&';
+                    break;
+
+                default:
+                    $p = $this->compileValue($p);
+                    break;
+            }
+        }
+
+        return implode($piece);
+    }
+
+    /**
+     * Has selector placeholder?
+     *
+     * @param array $selector
+     *
+     * @return boolean
+     */
+    protected function hasSelectorPlaceholder($selector)
+    {
+        if (! is_array($selector)) {
+            return false;
+        }
+
+        foreach ($selector as $parts) {
+            foreach ($parts as $part) {
+                if (strlen($part) && '%' === $part[0]) {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Compile children and return result
+     *
+     * @param array                                $stms
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $out
+     *
+     * @return array
+     */
+    protected function compileChildren($stms, OutputBlock $out)
+    {
+        foreach ($stms as $stm) {
+            $ret = $this->compileChild($stm, $out);
+
+            if (isset($ret)) {
+                return $ret;
+            }
+        }
+    }
+
+    /**
+     * Compile children and throw exception if unexpected @return
+     *
+     * @param array                                $stms
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $out
+     *
+     * @throws \Exception
+     */
+    protected function compileChildrenNoReturn($stms, OutputBlock $out)
+    {
+        foreach ($stms as $stm) {
+            $ret = $this->compileChild($stm, $out);
+
+            if (isset($ret)) {
+                $this->throwError('@return may only be used within a function');
+
+                return;
+            }
+        }
+    }
+
+    /**
+     * Compile media query
+     *
+     * @param array $queryList
+     *
+     * @return string
+     */
+    protected function compileMediaQuery($queryList)
+    {
+        $out = '@media';
+        $first = true;
+
+        foreach ($queryList as $query) {
+            $type = null;
+            $parts = [];
+
+            foreach ($query as $q) {
+                switch ($q[0]) {
+                    case Type::T_MEDIA_TYPE:
+                        if ($type) {
+                            $type = $this->mergeMediaTypes(
+                                $type,
+                                array_map([$this, 'compileValue'], array_slice($q, 1))
+                            );
+
+                            if (empty($type)) { // merge failed
+                                return null;
+                            }
+                        } else {
+                            $type = array_map([$this, 'compileValue'], array_slice($q, 1));
+                        }
+                        break;
+
+                    case Type::T_MEDIA_EXPRESSION:
+                        if (isset($q[2])) {
+                            $parts[] = '('
+                                . $this->compileValue($q[1])
+                                . $this->formatter->assignSeparator
+                                . $this->compileValue($q[2])
+                                . ')';
+                        } else {
+                            $parts[] = '('
+                                . $this->compileValue($q[1])
+                                . ')';
+                        }
+                        break;
+
+                    case Type::T_MEDIA_VALUE:
+                        $parts[] = $this->compileValue($q[1]);
+                        break;
+                }
+            }
+
+            if ($type) {
+                array_unshift($parts, implode(' ', array_filter($type)));
+            }
+
+            if (! empty($parts)) {
+                if ($first) {
+                    $first = false;
+                    $out .= ' ';
+                } else {
+                    $out .= $this->formatter->tagSeparator;
+                }
+
+                $out .= implode(' and ', $parts);
+            }
+        }
+
+        return $out;
+    }
+
+    protected function mergeDirectRelationships($selectors1, $selectors2)
+    {
+        if (empty($selectors1) || empty($selectors2)) {
+            return array_merge($selectors1, $selectors2);
+        }
+
+        $part1 = end($selectors1);
+        $part2 = end($selectors2);
+
+        if (! $this->isImmediateRelationshipCombinator($part1[0]) || $part1 !== $part2) {
+            return array_merge($selectors1, $selectors2);
+        }
+
+        $merged = [];
+
+        do {
+            $part1 = array_pop($selectors1);
+            $part2 = array_pop($selectors2);
+
+            if ($this->isImmediateRelationshipCombinator($part1[0]) && $part1 !== $part2) {
+                $merged = array_merge($selectors1, [$part1], $selectors2, [$part2], $merged);
+                break;
+            }
+
+            array_unshift($merged, $part1);
+            array_unshift($merged, [array_pop($selectors1)[0] . array_pop($selectors2)[0]]);
+        } while (! empty($selectors1) && ! empty($selectors2));
+
+        return $merged;
+    }
+
+    /**
+     * Merge media types
+     *
+     * @param array $type1
+     * @param array $type2
+     *
+     * @return array|null
+     */
+    protected function mergeMediaTypes($type1, $type2)
+    {
+        if (empty($type1)) {
+            return $type2;
+        }
+
+        if (empty($type2)) {
+            return $type1;
+        }
+
+        $m1 = '';
+        $t1 = '';
+
+        if (count($type1) > 1) {
+            $m1= strtolower($type1[0]);
+            $t1= strtolower($type1[1]);
+        } else {
+            $t1 = strtolower($type1[0]);
+        }
+
+        $m2 = '';
+        $t2 = '';
+
+        if (count($type2) > 1) {
+            $m2 = strtolower($type2[0]);
+            $t2 = strtolower($type2[1]);
+        } else {
+            $t2 = strtolower($type2[0]);
+        }
+
+        if (($m1 === Type::T_NOT) ^ ($m2 === Type::T_NOT)) {
+            if ($t1 === $t2) {
+                return null;
+            }
+
+            return [
+                $m1 === Type::T_NOT ? $m2 : $m1,
+                $m1 === Type::T_NOT ? $t2 : $t1,
+            ];
+        }
+
+        if ($m1 === Type::T_NOT && $m2 === Type::T_NOT) {
+            // CSS has no way of representing "neither screen nor print"
+            if ($t1 !== $t2) {
+                return null;
+            }
+
+            return [Type::T_NOT, $t1];
+        }
+
+        if ($t1 !== $t2) {
+            return null;
+        }
+
+        // t1 == t2, neither m1 nor m2 are "not"
+        return [empty($m1)? $m2 : $m1, $t1];
+    }
+
+    /**
+     * Compile import; returns true if the value was something that could be imported
+     *
+     * @param array   $rawPath
+     * @param array   $out
+     * @param boolean $once
+     *
+     * @return boolean
+     */
+    protected function compileImport($rawPath, $out, $once = false)
+    {
+        if ($rawPath[0] === Type::T_STRING) {
+            $path = $this->compileStringContent($rawPath);
+
+            if ($path = $this->findImport($path)) {
+                if (! $once || ! in_array($path, $this->importedFiles)) {
+                    $this->importFile($path, $out);
+                    $this->importedFiles[] = $path;
+                }
+
+                return true;
+            }
+
+            return false;
+        }
+
+        if ($rawPath[0] === Type::T_LIST) {
+            // handle a list of strings
+            if (count($rawPath[2]) === 0) {
+                return false;
+            }
+
+            foreach ($rawPath[2] as $path) {
+                if ($path[0] !== Type::T_STRING) {
+                    return false;
+                }
+            }
+
+            foreach ($rawPath[2] as $path) {
+                $this->compileImport($path, $out);
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Compile child; returns a value to halt execution
+     *
+     * @param array                                $child
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $out
+     *
+     * @return array
+     */
+    protected function compileChild($child, OutputBlock $out)
+    {
+        $this->sourceIndex  = isset($child[Parser::SOURCE_INDEX]) ? $child[Parser::SOURCE_INDEX] : null;
+        $this->sourceLine   = isset($child[Parser::SOURCE_LINE]) ? $child[Parser::SOURCE_LINE] : -1;
+        $this->sourceColumn = isset($child[Parser::SOURCE_COLUMN]) ? $child[Parser::SOURCE_COLUMN] : -1;
+
+        switch ($child[0]) {
+            case Type::T_SCSSPHP_IMPORT_ONCE:
+                list(, $rawPath) = $child;
+
+                $rawPath = $this->reduce($rawPath);
+
+                if (! $this->compileImport($rawPath, $out, true)) {
+                    $out->lines[] = '@import ' . $this->compileValue($rawPath) . ';';
+                }
+                break;
+
+            case Type::T_IMPORT:
+                list(, $rawPath) = $child;
+
+                $rawPath = $this->reduce($rawPath);
+
+                if (! $this->compileImport($rawPath, $out)) {
+                    $out->lines[] = '@import ' . $this->compileValue($rawPath) . ';';
+                }
+                break;
+
+            case Type::T_DIRECTIVE:
+                $this->compileDirective($child[1]);
+                break;
+
+            case Type::T_AT_ROOT:
+                $this->compileAtRoot($child[1]);
+                break;
+
+            case Type::T_MEDIA:
+                $this->compileMedia($child[1]);
+                break;
+
+            case Type::T_BLOCK:
+                $this->compileBlock($child[1]);
+                break;
+
+            case Type::T_CHARSET:
+                if (! $this->charsetSeen) {
+                    $this->charsetSeen = true;
+
+                    $out->lines[] = '@charset ' . $this->compileValue($child[1]) . ';';
+                }
+                break;
+
+            case Type::T_ASSIGN:
+                list(, $name, $value) = $child;
+
+                if ($name[0] === Type::T_VARIABLE) {
+                    $flags = isset($child[3]) ? $child[3] : [];
+                    $isDefault = in_array('!default', $flags);
+                    $isGlobal = in_array('!global', $flags);
+
+                    if ($isGlobal) {
+                        $this->set($name[1], $this->reduce($value), false, $this->rootEnv);
+                        break;
+                    }
+
+                    $shouldSet = $isDefault &&
+                        (($result = $this->get($name[1], false)) === null
+                        || $result === static::$null);
+
+                    if (! $isDefault || $shouldSet) {
+                        $this->set($name[1], $this->reduce($value));
+                    }
+                    break;
+                }
+
+                $compiledName = $this->compileValue($name);
+
+                // handle shorthand syntax: size / line-height
+                if ($compiledName === 'font') {
+                    if ($value[0] === Type::T_EXPRESSION && $value[1] === '/') {
+                        $value = $this->expToString($value);
+                    } elseif ($value[0] === Type::T_LIST) {
+                        foreach ($value[2] as &$item) {
+                            if ($item[0] === Type::T_EXPRESSION && $item[1] === '/') {
+                                $item = $this->expToString($item);
+                            }
+                        }
+                    }
+                }
+
+                // if the value reduces to null from something else then
+                // the property should be discarded
+                if ($value[0] !== Type::T_NULL) {
+                    $value = $this->reduce($value);
+
+                    if ($value[0] === Type::T_NULL || $value === static::$nullString) {
+                        break;
+                    }
+                }
+
+                $compiledValue = $this->compileValue($value);
+
+                $out->lines[] = $this->formatter->property(
+                    $compiledName,
+                    $compiledValue
+                );
+                break;
+
+            case Type::T_COMMENT:
+                if ($out->type === Type::T_ROOT) {
+                    $this->compileComment($child);
+                    break;
+                }
+
+                $out->lines[] = $child[1];
+                break;
+
+            case Type::T_MIXIN:
+            case Type::T_FUNCTION:
+                list(, $block) = $child;
+
+                $this->set(static::$namespaces[$block->type] . $block->name, $block);
+                break;
+
+            case Type::T_EXTEND:
+                list(, $selectors) = $child;
+
+                foreach ($selectors as $sel) {
+                    $results = $this->evalSelectors([$sel]);
+
+                    foreach ($results as $result) {
+                        // only use the first one
+                        $result = current($result);
+
+                        $this->pushExtends($result, $out->selectors, $child);
+                    }
+                }
+                break;
+
+            case Type::T_IF:
+                list(, $if) = $child;
+
+                if ($this->isTruthy($this->reduce($if->cond, true))) {
+                    return $this->compileChildren($if->children, $out);
+                }
+
+                foreach ($if->cases as $case) {
+                    if ($case->type === Type::T_ELSE ||
+                        $case->type === Type::T_ELSEIF && $this->isTruthy($this->reduce($case->cond))
+                    ) {
+                        return $this->compileChildren($case->children, $out);
+                    }
+                }
+                break;
+
+            case Type::T_EACH:
+                list(, $each) = $child;
+
+                $list = $this->coerceList($this->reduce($each->list));
+
+                $this->pushEnv();
+
+                foreach ($list[2] as $item) {
+                    if (count($each->vars) === 1) {
+                        $this->set($each->vars[0], $item, true);
+                    } else {
+                        list(,, $values) = $this->coerceList($item);
+
+                        foreach ($each->vars as $i => $var) {
+                            $this->set($var, isset($values[$i]) ? $values[$i] : static::$null, true);
+                        }
+                    }
+
+                    $ret = $this->compileChildren($each->children, $out);
+
+                    if ($ret) {
+                        if ($ret[0] !== Type::T_CONTROL) {
+                            $this->popEnv();
+
+                            return $ret;
+                        }
+
+                        if ($ret[1]) {
+                            break;
+                        }
+                    }
+                }
+
+                $this->popEnv();
+                break;
+
+            case Type::T_WHILE:
+                list(, $while) = $child;
+
+                while ($this->isTruthy($this->reduce($while->cond, true))) {
+                    $ret = $this->compileChildren($while->children, $out);
+
+                    if ($ret) {
+                        if ($ret[0] !== Type::T_CONTROL) {
+                            return $ret;
+                        }
+
+                        if ($ret[1]) {
+                            break;
+                        }
+                    }
+                }
+                break;
+
+            case Type::T_FOR:
+                list(, $for) = $child;
+
+                $start = $this->reduce($for->start, true);
+                $start = $start[1];
+                $end = $this->reduce($for->end, true);
+                $end = $end[1];
+                $d = $start < $end ? 1 : -1;
+
+                for (;;) {
+                    if ((! $for->until && $start - $d == $end) ||
+                        ($for->until && $start == $end)
+                    ) {
+                        break;
+                    }
+
+                    $this->set($for->var, new Node\Number($start, ''));
+                    $start += $d;
+
+                    $ret = $this->compileChildren($for->children, $out);
+
+                    if ($ret) {
+                        if ($ret[0] !== Type::T_CONTROL) {
+                            return $ret;
+                        }
+
+                        if ($ret[1]) {
+                            break;
+                        }
+                    }
+                }
+                break;
+
+            case Type::T_BREAK:
+                return [Type::T_CONTROL, true];
+
+            case Type::T_CONTINUE:
+                return [Type::T_CONTROL, false];
+
+            case Type::T_RETURN:
+                return $this->reduce($child[1], true);
+
+            case Type::T_NESTED_PROPERTY:
+                list(, $prop) = $child;
+
+                $prefixed = [];
+                $prefix = $this->compileValue($prop->prefix) . '-';
+
+                foreach ($prop->children as $child) {
+                    switch ($child[0]) {
+                        case Type::T_ASSIGN:
+                            array_unshift($child[1][2], $prefix);
+                            break;
+
+                        case Type::T_NESTED_PROPERTY:
+                            array_unshift($child[1]->prefix[2], $prefix);
+                            break;
+                    }
+
+                    $prefixed[] = $child;
+                }
+
+                $this->compileChildrenNoReturn($prefixed, $out);
+                break;
+
+            case Type::T_INCLUDE:
+                // including a mixin
+                list(, $name, $argValues, $content) = $child;
+
+                $mixin = $this->get(static::$namespaces['mixin'] . $name, false);
+
+                if (! $mixin) {
+                    $this->throwError("Undefined mixin $name");
+                    break;
+                }
+
+                $callingScope = $this->getStoreEnv();
+
+                // push scope, apply args
+                $this->pushEnv();
+                $this->env->depth--;
+
+                $storeEnv = $this->storeEnv;
+                $this->storeEnv = $this->env;
+
+                if (isset($content)) {
+                    $content->scope = $callingScope;
+
+                    $this->setRaw(static::$namespaces['special'] . 'content', $content, $this->env);
+                }
+
+                if (isset($mixin->args)) {
+                    $this->applyArguments($mixin->args, $argValues);
+                }
+
+                $this->env->marker = 'mixin';
+
+                $this->compileChildrenNoReturn($mixin->children, $out);
+
+                $this->storeEnv = $storeEnv;
+
+                $this->popEnv();
+                break;
+
+            case Type::T_MIXIN_CONTENT:
+                $content = $this->get(static::$namespaces['special'] . 'content', false, $this->getStoreEnv())
+                         ?: $this->get(static::$namespaces['special'] . 'content', false, $this->env);
+
+                if (! $content) {
+                    $content = new \stdClass();
+                    $content->scope = new \stdClass();
+                    $content->children = $this->storeEnv->parent->block->children;
+                    break;
+                }
+
+                $storeEnv = $this->storeEnv;
+                $this->storeEnv = $content->scope;
+
+                $this->compileChildrenNoReturn($content->children, $out);
+
+                $this->storeEnv = $storeEnv;
+                break;
+
+            case Type::T_DEBUG:
+                list(, $value) = $child;
+
+                $line = $this->sourceLine;
+                $value = $this->compileValue($this->reduce($value, true));
+                fwrite($this->stderr, "Line $line DEBUG: $value\n");
+                break;
+
+            case Type::T_WARN:
+                list(, $value) = $child;
+
+                $line = $this->sourceLine;
+                $value = $this->compileValue($this->reduce($value, true));
+                fwrite($this->stderr, "Line $line WARN: $value\n");
+                break;
+
+            case Type::T_ERROR:
+                list(, $value) = $child;
+
+                $line = $this->sourceLine;
+                $value = $this->compileValue($this->reduce($value, true));
+                $this->throwError("Line $line ERROR: $value\n");
+                break;
+
+            case Type::T_CONTROL:
+                $this->throwError('@break/@continue not permitted in this scope');
+                break;
+
+            default:
+                $this->throwError("unknown child type: $child[0]");
+        }
+    }
+
+    /**
+     * Reduce expression to string
+     *
+     * @param array $exp
+     *
+     * @return array
+     */
+    protected function expToString($exp)
+    {
+        list(, $op, $left, $right, /* $inParens */, $whiteLeft, $whiteRight) = $exp;
+
+        $content = [$this->reduce($left)];
+
+        if ($whiteLeft) {
+            $content[] = ' ';
+        }
+
+        $content[] = $op;
+
+        if ($whiteRight) {
+            $content[] = ' ';
+        }
+
+        $content[] = $this->reduce($right);
+
+        return [Type::T_STRING, '', $content];
+    }
+
+    /**
+     * Is truthy?
+     *
+     * @param array $value
+     *
+     * @return array
+     */
+    protected function isTruthy($value)
+    {
+        return $value !== static::$false && $value !== static::$null;
+    }
+
+    /**
+     * Is the value a direct relationship combinator?
+     *
+     * @param string $value
+     *
+     * @return bool
+     */
+    protected function isImmediateRelationshipCombinator($value)
+    {
+        return $value === '>' || $value === '+' || $value === '~';
+    }
+
+    /**
+     * Should $value cause its operand to eval
+     *
+     * @param array $value
+     *
+     * @return boolean
+     */
+    protected function shouldEval($value)
+    {
+        switch ($value[0]) {
+            case Type::T_EXPRESSION:
+                if ($value[1] === '/') {
+                    return $this->shouldEval($value[2], $value[3]);
+                }
+
+                // fall-thru
+            case Type::T_VARIABLE:
+            case Type::T_FUNCTION_CALL:
+                return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Reduce value
+     *
+     * @param array   $value
+     * @param boolean $inExp
+     *
+     * @return array
+     */
+    protected function reduce($value, $inExp = false)
+    {
+        list($type) = $value;
+
+        switch ($type) {
+            case Type::T_EXPRESSION:
+                list(, $op, $left, $right, $inParens) = $value;
+
+                $opName = isset(static::$operatorNames[$op]) ? static::$operatorNames[$op] : $op;
+                $inExp = $inExp || $this->shouldEval($left) || $this->shouldEval($right);
+
+                $left = $this->reduce($left, true);
+
+                if ($op !== 'and' && $op !== 'or') {
+                    $right = $this->reduce($right, true);
+                }
+
+                // special case: looks like css shorthand
+                if ($opName == 'div' && ! $inParens && ! $inExp && isset($right[2])
+                    && (($right[0] !== Type::T_NUMBER && $right[2] != '')
+                    || ($right[0] === Type::T_NUMBER && ! $right->unitless()))
+                ) {
+                    return $this->expToString($value);
+                }
+
+                $left = $this->coerceForExpression($left);
+                $right = $this->coerceForExpression($right);
+
+                $ltype = $left[0];
+                $rtype = $right[0];
+
+                $ucOpName = ucfirst($opName);
+                $ucLType  = ucfirst($ltype);
+                $ucRType  = ucfirst($rtype);
+
+                // this tries:
+                // 1. op[op name][left type][right type]
+                // 2. op[left type][right type] (passing the op as first arg
+                // 3. op[op name]
+                $fn = "op${ucOpName}${ucLType}${ucRType}";
+
+                if (is_callable([$this, $fn]) ||
+                    (($fn = "op${ucLType}${ucRType}") &&
+                        is_callable([$this, $fn]) &&
+                        $passOp = true) ||
+                    (($fn = "op${ucOpName}") &&
+                        is_callable([$this, $fn]) &&
+                        $genOp = true)
+                ) {
+                    $coerceUnit = false;
+
+                    if (! isset($genOp) &&
+                        $left[0] === Type::T_NUMBER && $right[0] === Type::T_NUMBER
+                    ) {
+                        $coerceUnit = true;
+
+                        switch ($opName) {
+                            case 'mul':
+                                $targetUnit = $left[2];
+
+                                foreach ($right[2] as $unit => $exp) {
+                                    $targetUnit[$unit] = (isset($targetUnit[$unit]) ? $targetUnit[$unit] : 0) + $exp;
+                                }
+                                break;
+
+                            case 'div':
+                                $targetUnit = $left[2];
+
+                                foreach ($right[2] as $unit => $exp) {
+                                    $targetUnit[$unit] = (isset($targetUnit[$unit]) ? $targetUnit[$unit] : 0) - $exp;
+                                }
+                                break;
+
+                            case 'mod':
+                                $targetUnit = $left[2];
+                                break;
+
+                            default:
+                                $targetUnit = $left->unitless() ? $right[2] : $left[2];
+                        }
+
+                        if (! $left->unitless() && ! $right->unitless()) {
+                            $left = $left->normalize();
+                            $right = $right->normalize();
+                        }
+                    }
+
+                    $shouldEval = $inParens || $inExp;
+
+                    if (isset($passOp)) {
+                        $out = $this->$fn($op, $left, $right, $shouldEval);
+                    } else {
+                        $out = $this->$fn($left, $right, $shouldEval);
+                    }
+
+                    if (isset($out)) {
+                        if ($coerceUnit && $out[0] === Type::T_NUMBER) {
+                            $out = $out->coerce($targetUnit);
+                        }
+
+                        return $out;
+                    }
+                }
+
+                return $this->expToString($value);
+
+            case Type::T_UNARY:
+                list(, $op, $exp, $inParens) = $value;
+
+                $inExp = $inExp || $this->shouldEval($exp);
+                $exp = $this->reduce($exp);
+
+                if ($exp[0] === Type::T_NUMBER) {
+                    switch ($op) {
+                        case '+':
+                            return new Node\Number($exp[1], $exp[2]);
+
+                        case '-':
+                            return new Node\Number(-$exp[1], $exp[2]);
+                    }
+                }
+
+                if ($op === 'not') {
+                    if ($inExp || $inParens) {
+                        if ($exp === static::$false || $exp === static::$null) {
+                            return static::$true;
+                        }
+
+                        return static::$false;
+                    }
+
+                    $op = $op . ' ';
+                }
+
+                return [Type::T_STRING, '', [$op, $exp]];
+
+            case Type::T_VARIABLE:
+                list(, $name) = $value;
+
+                return $this->reduce($this->get($name));
+
+            case Type::T_LIST:
+                foreach ($value[2] as &$item) {
+                    $item = $this->reduce($item);
+                }
+
+                return $value;
+
+            case Type::T_MAP:
+                foreach ($value[1] as &$item) {
+                    $item = $this->reduce($item);
+                }
+
+                foreach ($value[2] as &$item) {
+                    $item = $this->reduce($item);
+                }
+
+                return $value;
+
+            case Type::T_STRING:
+                foreach ($value[2] as &$item) {
+                    if (is_array($item) || $item instanceof \ArrayAccess) {
+                        $item = $this->reduce($item);
+                    }
+                }
+
+                return $value;
+
+            case Type::T_INTERPOLATE:
+                $value[1] = $this->reduce($value[1]);
+
+                return $value;
+
+            case Type::T_FUNCTION_CALL:
+                list(, $name, $argValues) = $value;
+
+                return $this->fncall($name, $argValues);
+
+            default:
+                return $value;
+        }
+    }
+
+    /**
+     * Function caller
+     *
+     * @param string $name
+     * @param array  $argValues
+     *
+     * @return array|null
+     */
+    private function fncall($name, $argValues)
+    {
+        // SCSS @function
+        if ($this->callScssFunction($name, $argValues, $returnValue)) {
+            return $returnValue;
+        }
+
+        // native PHP functions
+        if ($this->callNativeFunction($name, $argValues, $returnValue)) {
+            return $returnValue;
+        }
+
+        // for CSS functions, simply flatten the arguments into a list
+        $listArgs = [];
+
+        foreach ((array) $argValues as $arg) {
+            if (empty($arg[0])) {
+                $listArgs[] = $this->reduce($arg[1]);
+            }
+        }
+
+        return [Type::T_FUNCTION, $name, [Type::T_LIST, ',', $listArgs]];
+    }
+
+    /**
+     * Normalize name
+     *
+     * @param string $name
+     *
+     * @return string
+     */
+    protected function normalizeName($name)
+    {
+        return str_replace('-', '_', $name);
+    }
+
+    /**
+     * Normalize value
+     *
+     * @param array $value
+     *
+     * @return array
+     */
+    public function normalizeValue($value)
+    {
+        $value = $this->coerceForExpression($this->reduce($value));
+        list($type) = $value;
+
+        switch ($type) {
+            case Type::T_LIST:
+                $value = $this->extractInterpolation($value);
+
+                if ($value[0] !== Type::T_LIST) {
+                    return [Type::T_KEYWORD, $this->compileValue($value)];
+                }
+
+                foreach ($value[2] as $key => $item) {
+                    $value[2][$key] = $this->normalizeValue($item);
+                }
+
+                return $value;
+
+            case Type::T_STRING:
+                return [$type, '"', [$this->compileStringContent($value)]];
+
+            case Type::T_NUMBER:
+                return $value->normalize();
+
+            case Type::T_INTERPOLATE:
+                return [Type::T_KEYWORD, $this->compileValue($value)];
+
+            default:
+                return $value;
+        }
+    }
+
+    /**
+     * Add numbers
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opAddNumberNumber($left, $right)
+    {
+        return new Node\Number($left[1] + $right[1], $left[2]);
+    }
+
+    /**
+     * Multiply numbers
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opMulNumberNumber($left, $right)
+    {
+        return new Node\Number($left[1] * $right[1], $left[2]);
+    }
+
+    /**
+     * Subtract numbers
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opSubNumberNumber($left, $right)
+    {
+        return new Node\Number($left[1] - $right[1], $left[2]);
+    }
+
+    /**
+     * Divide numbers
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opDivNumberNumber($left, $right)
+    {
+        if ($right[1] == 0) {
+            return [Type::T_STRING, '', [$left[1] . $left[2] . '/' . $right[1] . $right[2]]];
+        }
+
+        return new Node\Number($left[1] / $right[1], $left[2]);
+    }
+
+    /**
+     * Mod numbers
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opModNumberNumber($left, $right)
+    {
+        return new Node\Number($left[1] % $right[1], $left[2]);
+    }
+
+    /**
+     * Add strings
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opAdd($left, $right)
+    {
+        if ($strLeft = $this->coerceString($left)) {
+            if ($right[0] === Type::T_STRING) {
+                $right[1] = '';
+            }
+
+            $strLeft[2][] = $right;
+
+            return $strLeft;
+        }
+
+        if ($strRight = $this->coerceString($right)) {
+            if ($left[0] === Type::T_STRING) {
+                $left[1] = '';
+            }
+
+            array_unshift($strRight[2], $left);
+
+            return $strRight;
+        }
+    }
+
+    /**
+     * Boolean and
+     *
+     * @param array   $left
+     * @param array   $right
+     * @param boolean $shouldEval
+     *
+     * @return array
+     */
+    protected function opAnd($left, $right, $shouldEval)
+    {
+        if (! $shouldEval) {
+            return;
+        }
+
+        if ($left !== static::$false and $left !== static::$null) {
+            return $this->reduce($right, true);
+        }
+
+        return $left;
+    }
+
+    /**
+     * Boolean or
+     *
+     * @param array   $left
+     * @param array   $right
+     * @param boolean $shouldEval
+     *
+     * @return array
+     */
+    protected function opOr($left, $right, $shouldEval)
+    {
+        if (! $shouldEval) {
+            return;
+        }
+
+        if ($left !== static::$false and $left !== static::$null) {
+            return $left;
+        }
+
+        return $this->reduce($right, true);
+    }
+
+    /**
+     * Compare colors
+     *
+     * @param string $op
+     * @param array  $left
+     * @param array  $right
+     *
+     * @return array
+     */
+    protected function opColorColor($op, $left, $right)
+    {
+        $out = [Type::T_COLOR];
+
+        foreach ([1, 2, 3] as $i) {
+            $lval = isset($left[$i]) ? $left[$i] : 0;
+            $rval = isset($right[$i]) ? $right[$i] : 0;
+
+            switch ($op) {
+                case '+':
+                    $out[] = $lval + $rval;
+                    break;
+
+                case '-':
+                    $out[] = $lval - $rval;
+                    break;
+
+                case '*':
+                    $out[] = $lval * $rval;
+                    break;
+
+                case '%':
+                    $out[] = $lval % $rval;
+                    break;
+
+                case '/':
+                    if ($rval == 0) {
+                        $this->throwError("color: Can't divide by zero");
+                        break 2;
+                    }
+
+                    $out[] = (int) ($lval / $rval);
+                    break;
+
+                case '==':
+                    return $this->opEq($left, $right);
+
+                case '!=':
+                    return $this->opNeq($left, $right);
+
+                default:
+                    $this->throwError("color: unknown op $op");
+                    break 2;
+            }
+        }
+
+        if (isset($left[4])) {
+            $out[4] = $left[4];
+        } elseif (isset($right[4])) {
+            $out[4] = $right[4];
+        }
+
+        return $this->fixColor($out);
+    }
+
+    /**
+     * Compare color and number
+     *
+     * @param string $op
+     * @param array  $left
+     * @param array  $right
+     *
+     * @return array
+     */
+    protected function opColorNumber($op, $left, $right)
+    {
+        $value = $right[1];
+
+        return $this->opColorColor(
+            $op,
+            $left,
+            [Type::T_COLOR, $value, $value, $value]
+        );
+    }
+
+    /**
+     * Compare number and color
+     *
+     * @param string $op
+     * @param array  $left
+     * @param array  $right
+     *
+     * @return array
+     */
+    protected function opNumberColor($op, $left, $right)
+    {
+        $value = $left[1];
+
+        return $this->opColorColor(
+            $op,
+            [Type::T_COLOR, $value, $value, $value],
+            $right
+        );
+    }
+
+    /**
+     * Compare number1 == number2
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opEq($left, $right)
+    {
+        if (($lStr = $this->coerceString($left)) && ($rStr = $this->coerceString($right))) {
+            $lStr[1] = '';
+            $rStr[1] = '';
+
+            $left = $this->compileValue($lStr);
+            $right = $this->compileValue($rStr);
+        }
+
+        return $this->toBool($left === $right);
+    }
+
+    /**
+     * Compare number1 != number2
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opNeq($left, $right)
+    {
+        if (($lStr = $this->coerceString($left)) && ($rStr = $this->coerceString($right))) {
+            $lStr[1] = '';
+            $rStr[1] = '';
+
+            $left = $this->compileValue($lStr);
+            $right = $this->compileValue($rStr);
+        }
+
+        return $this->toBool($left !== $right);
+    }
+
+    /**
+     * Compare number1 >= number2
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opGteNumberNumber($left, $right)
+    {
+        return $this->toBool($left[1] >= $right[1]);
+    }
+
+    /**
+     * Compare number1 > number2
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opGtNumberNumber($left, $right)
+    {
+        return $this->toBool($left[1] > $right[1]);
+    }
+
+    /**
+     * Compare number1 <= number2
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opLteNumberNumber($left, $right)
+    {
+        return $this->toBool($left[1] <= $right[1]);
+    }
+
+    /**
+     * Compare number1 < number2
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opLtNumberNumber($left, $right)
+    {
+        return $this->toBool($left[1] < $right[1]);
+    }
+
+    /**
+     * Three-way comparison, aka spaceship operator
+     *
+     * @param array $left
+     * @param array $right
+     *
+     * @return array
+     */
+    protected function opCmpNumberNumber($left, $right)
+    {
+        $n = $left[1] - $right[1];
+
+        return new Node\Number($n ? $n / abs($n) : 0, '');
+    }
+
+    /**
+     * Cast to boolean
+     *
+     * @api
+     *
+     * @param mixed $thing
+     *
+     * @return array
+     */
+    public function toBool($thing)
+    {
+        return $thing ? static::$true : static::$false;
+    }
+
+    /**
+     * Compiles a primitive value into a CSS property value.
+     *
+     * Values in scssphp are typed by being wrapped in arrays, their format is
+     * typically:
+     *
+     *     array(type, contents [, additional_contents]*)
+     *
+     * The input is expected to be reduced. This function will not work on
+     * things like expressions and variables.
+     *
+     * @api
+     *
+     * @param array $value
+     *
+     * @return string
+     */
+    public function compileValue($value)
+    {
+        $value = $this->reduce($value);
+
+        list($type) = $value;
+
+        switch ($type) {
+            case Type::T_KEYWORD:
+                return $value[1];
+
+            case Type::T_COLOR:
+                // [1] - red component (either number for a %)
+                // [2] - green component
+                // [3] - blue component
+                // [4] - optional alpha component
+                list(, $r, $g, $b) = $value;
+
+                $r = round($r);
+                $g = round($g);
+                $b = round($b);
+
+                if (count($value) === 5 && $value[4] !== 1) { // rgba
+                    return 'rgba(' . $r . ', ' . $g . ', ' . $b . ', ' . $value[4] . ')';
+                }
+
+                $h = sprintf('#%02x%02x%02x', $r, $g, $b);
+
+                // Converting hex color to short notation (e.g. #003399 to #039)
+                if ($h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6]) {
+                    $h = '#' . $h[1] . $h[3] . $h[5];
+                }
+
+                return $h;
+
+            case Type::T_NUMBER:
+                return $value->output($this);
+
+            case Type::T_STRING:
+                return $value[1] . $this->compileStringContent($value) . $value[1];
+
+            case Type::T_FUNCTION:
+                $args = ! empty($value[2]) ? $this->compileValue($value[2]) : '';
+
+                return "$value[1]($args)";
+
+            case Type::T_LIST:
+                $value = $this->extractInterpolation($value);
+
+                if ($value[0] !== Type::T_LIST) {
+                    return $this->compileValue($value);
+                }
+
+                list(, $delim, $items) = $value;
+
+                if ($delim !== ' ') {
+                    $delim .= ' ';
+                }
+
+                $filtered = [];
+
+                foreach ($items as $item) {
+                    if ($item[0] === Type::T_NULL) {
+                        continue;
+                    }
+
+                    $filtered[] = $this->compileValue($item);
+                }
+
+                return implode("$delim", $filtered);
+
+            case Type::T_MAP:
+                $keys = $value[1];
+                $values = $value[2];
+                $filtered = [];
+
+                for ($i = 0, $s = count($keys); $i < $s; $i++) {
+                    $filtered[$this->compileValue($keys[$i])] = $this->compileValue($values[$i]);
+                }
+
+                array_walk($filtered, function (&$value, $key) {
+                    $value = $key . ': ' . $value;
+                });
+
+                return '(' . implode(', ', $filtered) . ')';
+
+            case Type::T_INTERPOLATED:
+                // node created by extractInterpolation
+                list(, $interpolate, $left, $right) = $value;
+                list(,, $whiteLeft, $whiteRight) = $interpolate;
+
+                $left = count($left[2]) > 0 ?
+                    $this->compileValue($left) . $whiteLeft : '';
+
+                $right = count($right[2]) > 0 ?
+                    $whiteRight . $this->compileValue($right) : '';
+
+                return $left . $this->compileValue($interpolate) . $right;
+
+            case Type::T_INTERPOLATE:
+                // raw parse node
+                list(, $exp) = $value;
+
+                // strip quotes if it's a string
+                $reduced = $this->reduce($exp);
+
+                switch ($reduced[0]) {
+                    case Type::T_LIST:
+                        $reduced = $this->extractInterpolation($reduced);
+
+                        if ($reduced[0] !== Type::T_LIST) {
+                            break;
+                        }
+
+                        list(, $delim, $items) = $reduced;
+
+                        if ($delim !== ' ') {
+                            $delim .= ' ';
+                        }
+
+                        $filtered = [];
+
+                        foreach ($items as $item) {
+                            if ($item[0] === Type::T_NULL) {
+                                continue;
+                            }
+
+                            $temp = $this->compileValue([Type::T_KEYWORD, $item]);
+                            if ($temp[0] === Type::T_STRING) {
+                                $filtered[] = $this->compileStringContent($temp);
+                            } elseif ($temp[0] === Type::T_KEYWORD) {
+                                $filtered[] = $temp[1];
+                            } else {
+                                $filtered[] = $this->compileValue($temp);
+                            }
+                        }
+
+                        $reduced = [Type::T_KEYWORD, implode("$delim", $filtered)];
+                        break;
+
+                    case Type::T_STRING:
+                        $reduced = [Type::T_KEYWORD, $this->compileStringContent($reduced)];
+                        break;
+
+                    case Type::T_NULL:
+                        $reduced = [Type::T_KEYWORD, ''];
+                }
+
+                return $this->compileValue($reduced);
+
+            case Type::T_NULL:
+                return 'null';
+
+            default:
+                $this->throwError("unknown value type: $type");
+        }
+    }
+
+    /**
+     * Flatten list
+     *
+     * @param array $list
+     *
+     * @return string
+     */
+    protected function flattenList($list)
+    {
+        return $this->compileValue($list);
+    }
+
+    /**
+     * Compile string content
+     *
+     * @param array $string
+     *
+     * @return string
+     */
+    protected function compileStringContent($string)
+    {
+        $parts = [];
+
+        foreach ($string[2] as $part) {
+            if (is_array($part) || $part instanceof \ArrayAccess) {
+                $parts[] = $this->compileValue($part);
+            } else {
+                $parts[] = $part;
+            }
+        }
+
+        return implode($parts);
+    }
+
+    /**
+     * Extract interpolation; it doesn't need to be recursive, compileValue will handle that
+     *
+     * @param array $list
+     *
+     * @return array
+     */
+    protected function extractInterpolation($list)
+    {
+        $items = $list[2];
+
+        foreach ($items as $i => $item) {
+            if ($item[0] === Type::T_INTERPOLATE) {
+                $before = [Type::T_LIST, $list[1], array_slice($items, 0, $i)];
+                $after  = [Type::T_LIST, $list[1], array_slice($items, $i + 1)];
+
+                return [Type::T_INTERPOLATED, $item, $before, $after];
+            }
+        }
+
+        return $list;
+    }
+
+    /**
+     * Find the final set of selectors
+     *
+     * @param \Leafo\ScssPhp\Compiler\Environment $env
+     *
+     * @return array
+     */
+    protected function multiplySelectors(Environment $env)
+    {
+        $envs            = $this->compactEnv($env);
+        $selectors       = [];
+        $parentSelectors = [[]];
+
+        while ($env = array_pop($envs)) {
+            if (empty($env->selectors)) {
+                continue;
+            }
+
+            $selectors = [];
+
+            foreach ($env->selectors as $selector) {
+                foreach ($parentSelectors as $parent) {
+                    $selectors[] = $this->joinSelectors($parent, $selector);
+                }
+            }
+
+            $parentSelectors = $selectors;
+        }
+
+        return $selectors;
+    }
+
+    /**
+     * Join selectors; looks for & to replace, or append parent before child
+     *
+     * @param array $parent
+     * @param array $child
+     *
+     * @return array
+     */
+    protected function joinSelectors($parent, $child)
+    {
+        $setSelf = false;
+        $out = [];
+
+        foreach ($child as $part) {
+            $newPart = [];
+
+            foreach ($part as $p) {
+                if ($p === static::$selfSelector) {
+                    $setSelf = true;
+
+                    foreach ($parent as $i => $parentPart) {
+                        if ($i > 0) {
+                            $out[] = $newPart;
+                            $newPart = [];
+                        }
+
+                        foreach ($parentPart as $pp) {
+                            $newPart[] = $pp;
+                        }
+                    }
+                } else {
+                    $newPart[] = $p;
+                }
+            }
+
+            $out[] = $newPart;
+        }
+
+        return $setSelf ? $out : array_merge($parent, $child);
+    }
+
+    /**
+     * Multiply media
+     *
+     * @param \Leafo\ScssPhp\Compiler\Environment $env
+     * @param array                               $childQueries
+     *
+     * @return array
+     */
+    protected function multiplyMedia(Environment $env = null, $childQueries = null)
+    {
+        if (! isset($env) ||
+            ! empty($env->block->type) && $env->block->type !== Type::T_MEDIA
+        ) {
+            return $childQueries;
+        }
+
+        // plain old block, skip
+        if (empty($env->block->type)) {
+            return $this->multiplyMedia($env->parent, $childQueries);
+        }
+
+        $parentQueries = isset($env->block->queryList)
+            ? $env->block->queryList
+            : [[[Type::T_MEDIA_VALUE, $env->block->value]]];
+
+        if ($childQueries === null) {
+            $childQueries = $parentQueries;
+        } else {
+            $originalQueries = $childQueries;
+            $childQueries = [];
+
+            foreach ($parentQueries as $parentQuery) {
+                foreach ($originalQueries as $childQuery) {
+                    $childQueries []= array_merge($parentQuery, $childQuery);
+                }
+            }
+        }
+
+        return $this->multiplyMedia($env->parent, $childQueries);
+    }
+
+    /**
+     * Convert env linked list to stack
+     *
+     * @param \Leafo\ScssPhp\Compiler\Environment $env
+     *
+     * @return array
+     */
+    private function compactEnv(Environment $env)
+    {
+        for ($envs = []; $env; $env = $env->parent) {
+            $envs[] = $env;
+        }
+
+        return $envs;
+    }
+
+    /**
+     * Convert env stack to singly linked list
+     *
+     * @param array $envs
+     *
+     * @return \Leafo\ScssPhp\Compiler\Environment
+     */
+    private function extractEnv($envs)
+    {
+        for ($env = null; $e = array_pop($envs);) {
+            $e->parent = $env;
+            $env = $e;
+        }
+
+        return $env;
+    }
+
+    /**
+     * Push environment
+     *
+     * @param \Leafo\ScssPhp\Block $block
+     *
+     * @return \Leafo\ScssPhp\Compiler\Environment
+     */
+    protected function pushEnv(Block $block = null)
+    {
+        $env = new Environment;
+        $env->parent = $this->env;
+        $env->store  = [];
+        $env->block  = $block;
+        $env->depth  = isset($this->env->depth) ? $this->env->depth + 1 : 0;
+
+        $this->env = $env;
+
+        return $env;
+    }
+
+    /**
+     * Pop environment
+     */
+    protected function popEnv()
+    {
+        $this->env = $this->env->parent;
+    }
+
+    /**
+     * Get store environment
+     *
+     * @return \Leafo\ScssPhp\Compiler\Environment
+     */
+    protected function getStoreEnv()
+    {
+        return isset($this->storeEnv) ? $this->storeEnv : $this->env;
+    }
+
+    /**
+     * Set variable
+     *
+     * @param string                              $name
+     * @param mixed                               $value
+     * @param boolean                             $shadow
+     * @param \Leafo\ScssPhp\Compiler\Environment $env
+     */
+    protected function set($name, $value, $shadow = false, Environment $env = null)
+    {
+        $name = $this->normalizeName($name);
+
+        if (! isset($env)) {
+            $env = $this->getStoreEnv();
+        }
+
+        if ($shadow) {
+            $this->setRaw($name, $value, $env);
+        } else {
+            $this->setExisting($name, $value, $env);
+        }
+    }
+
+    /**
+     * Set existing variable
+     *
+     * @param string                              $name
+     * @param mixed                               $value
+     * @param \Leafo\ScssPhp\Compiler\Environment $env
+     */
+    protected function setExisting($name, $value, Environment $env)
+    {
+        $storeEnv = $env;
+
+        $hasNamespace = $name[0] === '^' || $name[0] === '@' || $name[0] === '%';
+
+        for (;;) {
+            if (array_key_exists($name, $env->store)) {
+                break;
+            }
+
+            if (! $hasNamespace && isset($env->marker)) {
+                $env = $storeEnv;
+                break;
+            }
+
+            if (! isset($env->parent)) {
+                $env = $storeEnv;
+                break;
+            }
+
+            $env = $env->parent;
+        }
+
+        $env->store[$name] = $value;
+    }
+
+    /**
+     * Set raw variable
+     *
+     * @param string                              $name
+     * @param mixed                               $value
+     * @param \Leafo\ScssPhp\Compiler\Environment $env
+     */
+    protected function setRaw($name, $value, Environment $env)
+    {
+        $env->store[$name] = $value;
+    }
+
+    /**
+     * Get variable
+     *
+     * @api
+     *
+     * @param string                              $name
+     * @param boolean                             $shouldThrow
+     * @param \Leafo\ScssPhp\Compiler\Environment $env
+     *
+     * @return mixed
+     */
+    public function get($name, $shouldThrow = true, Environment $env = null)
+    {
+        $normalizedName = $this->normalizeName($name);
+        $specialContentKey = static::$namespaces['special'] . 'content';
+
+        if (! isset($env)) {
+            $env = $this->getStoreEnv();
+        }
+
+        $nextIsRoot = false;
+        $hasNamespace = $normalizedName[0] === '^' || $normalizedName[0] === '@' || $normalizedName[0] === '%';
+
+        for (;;) {
+            if (array_key_exists($normalizedName, $env->store)) {
+                return $env->store[$normalizedName];
+            }
+
+            if (! $hasNamespace && isset($env->marker)) {
+                if (! $nextIsRoot && ! empty($env->store[$specialContentKey])) {
+                    $env = $env->store[$specialContentKey]->scope;
+                    $nextIsRoot = true;
+                    continue;
+                }
+
+                $env = $this->rootEnv;
+                continue;
+            }
+
+            if (! isset($env->parent)) {
+                break;
+            }
+
+            $env = $env->parent;
+        }
+
+        if ($shouldThrow) {
+            $this->throwError("Undefined variable \$$name");
+        }
+
+        // found nothing
+    }
+
+    /**
+     * Has variable?
+     *
+     * @param string                              $name
+     * @param \Leafo\ScssPhp\Compiler\Environment $env
+     *
+     * @return boolean
+     */
+    protected function has($name, Environment $env = null)
+    {
+        return $this->get($name, false, $env) !== null;
+    }
+
+    /**
+     * Inject variables
+     *
+     * @param array $args
+     */
+    protected function injectVariables(array $args)
+    {
+        if (empty($args)) {
+            return;
+        }
+
+        $parser = $this->parserFactory(__METHOD__);
+
+        foreach ($args as $name => $strValue) {
+            if ($name[0] === '$') {
+                $name = substr($name, 1);
+            }
+
+            if (! $parser->parseValue($strValue, $value)) {
+                $value = $this->coerceValue($strValue);
+            }
+
+            $this->set($name, $value);
+        }
+    }
+
+    /**
+     * Set variables
+     *
+     * @api
+     *
+     * @param array $variables
+     */
+    public function setVariables(array $variables)
+    {
+        $this->registeredVars = array_merge($this->registeredVars, $variables);
+    }
+
+    /**
+     * Unset variable
+     *
+     * @api
+     *
+     * @param string $name
+     */
+    public function unsetVariable($name)
+    {
+        unset($this->registeredVars[$name]);
+    }
+
+    /**
+     * Returns list of variables
+     *
+     * @api
+     *
+     * @return array
+     */
+    public function getVariables()
+    {
+        return $this->registeredVars;
+    }
+
+    /**
+     * Adds to list of parsed files
+     *
+     * @api
+     *
+     * @param string $path
+     */
+    public function addParsedFile($path)
+    {
+        if (isset($path) && file_exists($path)) {
+            $this->parsedFiles[realpath($path)] = filemtime($path);
+        }
+    }
+
+    /**
+     * Returns list of parsed files
+     *
+     * @api
+     *
+     * @return array
+     */
+    public function getParsedFiles()
+    {
+        return $this->parsedFiles;
+    }
+
+    /**
+     * Add import path
+     *
+     * @api
+     *
+     * @param string $path
+     */
+    public function addImportPath($path)
+    {
+        if (! in_array($path, $this->importPaths)) {
+            $this->importPaths[] = $path;
+        }
+    }
+
+    /**
+     * Set import paths
+     *
+     * @api
+     *
+     * @param string|array $path
+     */
+    public function setImportPaths($path)
+    {
+        $this->importPaths = (array) $path;
+    }
+
+    /**
+     * Set number precision
+     *
+     * @api
+     *
+     * @param integer $numberPrecision
+     */
+    public function setNumberPrecision($numberPrecision)
+    {
+        Node\Number::$precision = $numberPrecision;
+    }
+
+    /**
+     * Set formatter
+     *
+     * @api
+     *
+     * @param string $formatterName
+     */
+    public function setFormatter($formatterName)
+    {
+        $this->formatter = $formatterName;
+    }
+
+    /**
+     * Set line number style
+     *
+     * @api
+     *
+     * @param string $lineNumberStyle
+     */
+    public function setLineNumberStyle($lineNumberStyle)
+    {
+        $this->lineNumberStyle = $lineNumberStyle;
+    }
+
+    /**
+     * Register function
+     *
+     * @api
+     *
+     * @param string   $name
+     * @param callable $func
+     * @param array    $prototype
+     */
+    public function registerFunction($name, $func, $prototype = null)
+    {
+        $this->userFunctions[$this->normalizeName($name)] = [$func, $prototype];
+    }
+
+    /**
+     * Unregister function
+     *
+     * @api
+     *
+     * @param string $name
+     */
+    public function unregisterFunction($name)
+    {
+        unset($this->userFunctions[$this->normalizeName($name)]);
+    }
+
+    /**
+     * Add feature
+     *
+     * @api
+     *
+     * @param string $name
+     */
+    public function addFeature($name)
+    {
+        $this->registeredFeatures[$name] = true;
+    }
+
+    /**
+     * Import file
+     *
+     * @param string $path
+     * @param array  $out
+     */
+    protected function importFile($path, $out)
+    {
+        // see if tree is cached
+        $realPath = realpath($path);
+
+        if (isset($this->importCache[$realPath])) {
+            $this->handleImportLoop($realPath);
+
+            $tree = $this->importCache[$realPath];
+        } else {
+            $code   = file_get_contents($path);
+            $parser = $this->parserFactory($path);
+            $tree   = $parser->parse($code);
+
+            $this->importCache[$realPath] = $tree;
+        }
+
+        $pi = pathinfo($path);
+        array_unshift($this->importPaths, $pi['dirname']);
+        $this->compileChildrenNoReturn($tree->children, $out);
+        array_shift($this->importPaths);
+    }
+
+    /**
+     * Return the file path for an import url if it exists
+     *
+     * @api
+     *
+     * @param string $url
+     *
+     * @return string|null
+     */
+    public function findImport($url)
+    {
+        $urls = [];
+
+        // for "normal" scss imports (ignore vanilla css and external requests)
+        if (! preg_match('/\.css$|^https?:\/\//', $url)) {
+            // try both normal and the _partial filename
+            $urls = [$url, preg_replace('/[^\/]+$/', '_\0', $url)];
+        }
+
+        $hasExtension = preg_match('/[.]s?css$/', $url);
+
+        foreach ($this->importPaths as $dir) {
+            if (is_string($dir)) {
+                // check urls for normal import paths
+                foreach ($urls as $full) {
+                    $full = $dir
+                        . (! empty($dir) && substr($dir, -1) !== '/' ? '/' : '')
+                        . $full;
+
+                    if ($this->fileExists($file = $full . '.scss') ||
+                        ($hasExtension && $this->fileExists($file = $full))
+                    ) {
+                        return $file;
+                    }
+                }
+            } elseif (is_callable($dir)) {
+                // check custom callback for import path
+                $file = call_user_func($dir, $url);
+
+                if ($file !== null) {
+                    return $file;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Set encoding
+     *
+     * @api
+     *
+     * @param string $encoding
+     */
+    public function setEncoding($encoding)
+    {
+        $this->encoding = $encoding;
+    }
+
+    /**
+     * Ignore errors?
+     *
+     * @api
+     *
+     * @param boolean $ignoreErrors
+     *
+     * @return \Leafo\ScssPhp\Compiler
+     */
+    public function setIgnoreErrors($ignoreErrors)
+    {
+        $this->ignoreErrors = $ignoreErrors;
+    }
+
+    /**
+     * Throw error (exception)
+     *
+     * @api
+     *
+     * @param string $msg Message with optional sprintf()-style vararg parameters
+     *
+     * @throws \Leafo\ScssPhp\Exception\CompilerException
+     */
+    public function throwError($msg)
+    {
+        if ($this->ignoreErrors) {
+            return;
+        }
+
+        if (func_num_args() > 1) {
+            $msg = call_user_func_array('sprintf', func_get_args());
+        }
+
+        $line = $this->sourceLine;
+        $msg = "$msg: line: $line";
+
+        throw new CompilerException($msg);
+    }
+
+    /**
+     * Handle import loop
+     *
+     * @param string $name
+     *
+     * @throws \Exception
+     */
+    protected function handleImportLoop($name)
+    {
+        for ($env = $this->env; $env; $env = $env->parent) {
+            $file = $this->sourceNames[$env->block->sourceIndex];
+
+            if (realpath($file) === $name) {
+                $this->throwError('An @import loop has been found: %s imports %s', $file, basename($file));
+                break;
+            }
+        }
+    }
+
+    /**
+     * Does file exist?
+     *
+     * @param string $name
+     *
+     * @return boolean
+     */
+    protected function fileExists($name)
+    {
+        return file_exists($name) && is_file($name);
+    }
+
+    /**
+     * Call SCSS @function
+     *
+     * @param string $name
+     * @param array  $args
+     * @param array  $returnValue
+     *
+     * @return boolean Returns true if returnValue is set; otherwise, false
+     */
+    protected function callScssFunction($name, $argValues, &$returnValue)
+    {
+        $func = $this->get(static::$namespaces['function'] . $name, false);
+
+        if (! $func) {
+            return false;
+        }
+
+        $this->pushEnv();
+
+        $storeEnv = $this->storeEnv;
+        $this->storeEnv = $this->env;
+
+        // set the args
+        if (isset($func->args)) {
+            $this->applyArguments($func->args, $argValues);
+        }
+
+        // throw away lines and children
+        $tmp = new OutputBlock;
+        $tmp->lines    = [];
+        $tmp->children = [];
+
+        $this->env->marker = 'function';
+
+        $ret = $this->compileChildren($func->children, $tmp);
+
+        $this->storeEnv = $storeEnv;
+
+        $this->popEnv();
+
+        $returnValue = ! isset($ret) ? static::$defaultValue : $ret;
+
+        return true;
+    }
+
+    /**
+     * Call built-in and registered (PHP) functions
+     *
+     * @param string $name
+     * @param array  $args
+     * @param array  $returnValue
+     *
+     * @return boolean Returns true if returnValue is set; otherwise, false
+     */
+    protected function callNativeFunction($name, $args, &$returnValue)
+    {
+        // try a lib function
+        $name = $this->normalizeName($name);
+
+        if (isset($this->userFunctions[$name])) {
+            // see if we can find a user function
+            list($f, $prototype) = $this->userFunctions[$name];
+        } elseif (($f = $this->getBuiltinFunction($name)) && is_callable($f)) {
+            $libName   = $f[1];
+            $prototype = isset(static::$$libName) ? static::$$libName : null;
+        } else {
+            return false;
+        }
+
+        list($sorted, $kwargs) = $this->sortArgs($prototype, $args);
+
+        if ($name !== 'if' && $name !== 'call') {
+            foreach ($sorted as &$val) {
+                $val = $this->reduce($val, true);
+            }
+        }
+
+        $returnValue = call_user_func($f, $sorted, $kwargs);
+
+        if (! isset($returnValue)) {
+            return false;
+        }
+
+        $returnValue = $this->coerceValue($returnValue);
+
+        return true;
+    }
+
+    /**
+     * Get built-in function
+     *
+     * @param string $name Normalized name
+     *
+     * @return array
+     */
+    protected function getBuiltinFunction($name)
+    {
+        $libName = 'lib' . preg_replace_callback(
+            '/_(.)/',
+            function ($m) {
+                return ucfirst($m[1]);
+            },
+            ucfirst($name)
+        );
+
+        return [$this, $libName];
+    }
+
+    /**
+     * Sorts keyword arguments
+     *
+     * @param array $prototype
+     * @param array $args
+     *
+     * @return array
+     */
+    protected function sortArgs($prototype, $args)
+    {
+        $keyArgs = [];
+        $posArgs = [];
+
+        // separate positional and keyword arguments
+        foreach ($args as $arg) {
+            list($key, $value) = $arg;
+
+            $key = $key[1];
+
+            if (empty($key)) {
+                $posArgs[] = $value;
+            } else {
+                $keyArgs[$key] = $value;
+            }
+        }
+
+        if (! isset($prototype)) {
+            return [$posArgs, $keyArgs];
+        }
+
+        // copy positional args
+        $finalArgs = array_pad($posArgs, count($prototype), null);
+
+        // overwrite positional args with keyword args
+        foreach ($prototype as $i => $names) {
+            foreach ((array) $names as $name) {
+                if (isset($keyArgs[$name])) {
+                    $finalArgs[$i] = $keyArgs[$name];
+                }
+            }
+        }
+
+        return [$finalArgs, $keyArgs];
+    }
+
+    /**
+     * Apply argument values per definition
+     *
+     * @param array $argDef
+     * @param array $argValues
+     *
+     * @throws \Exception
+     */
+    protected function applyArguments($argDef, $argValues)
+    {
+        $storeEnv = $this->getStoreEnv();
+
+        $env = new Environment;
+        $env->store = $storeEnv->store;
+
+        $hasVariable = false;
+        $args = [];
+
+        foreach ($argDef as $i => $arg) {
+            list($name, $default, $isVariable) = $argDef[$i];
+
+            $args[$name] = [$i, $name, $default, $isVariable];
+            $hasVariable |= $isVariable;
+        }
+
+        $keywordArgs = [];
+        $deferredKeywordArgs = [];
+        $remaining = [];
+
+        // assign the keyword args
+        foreach ((array) $argValues as $arg) {
+            if (! empty($arg[0])) {
+                if (! isset($args[$arg[0][1]])) {
+                    if ($hasVariable) {
+                        $deferredKeywordArgs[$arg[0][1]] = $arg[1];
+                    } else {
+                        $this->throwError("Mixin or function doesn't have an argument named $%s.", $arg[0][1]);
+                        break;
+                    }
+                } elseif ($args[$arg[0][1]][0] < count($remaining)) {
+                    $this->throwError("The argument $%s was passed both by position and by name.", $arg[0][1]);
+                    break;
+                } else {
+                    $keywordArgs[$arg[0][1]] = $arg[1];
+                }
+            } elseif (count($keywordArgs)) {
+                $this->throwError('Positional arguments must come before keyword arguments.');
+                break;
+            } elseif ($arg[2] === true) {
+                $val = $this->reduce($arg[1], true);
+
+                if ($val[0] === Type::T_LIST) {
+                    foreach ($val[2] as $name => $item) {
+                        if (! is_numeric($name)) {
+                            $keywordArgs[$name] = $item;
+                        } else {
+                            $remaining[] = $item;
+                        }
+                    }
+                } elseif ($val[0] === Type::T_MAP) {
+                    foreach ($val[1] as $i => $name) {
+                        $name = $this->compileStringContent($this->coerceString($name));
+                        $item = $val[2][$i];
+
+                        if (! is_numeric($name)) {
+                            $keywordArgs[$name] = $item;
+                        } else {
+                            $remaining[] = $item;
+                        }
+                    }
+                } else {
+                    $remaining[] = $val;
+                }
+            } else {
+                $remaining[] = $arg[1];
+            }
+        }
+
+        foreach ($args as $arg) {
+            list($i, $name, $default, $isVariable) = $arg;
+
+            if ($isVariable) {
+                $val = [Type::T_LIST, ',', [], $isVariable];
+
+                for ($count = count($remaining); $i < $count; $i++) {
+                    $val[2][] = $remaining[$i];
+                }
+
+                foreach ($deferredKeywordArgs as $itemName => $item) {
+                    $val[2][$itemName] = $item;
+                }
+            } elseif (isset($remaining[$i])) {
+                $val = $remaining[$i];
+            } elseif (isset($keywordArgs[$name])) {
+                $val = $keywordArgs[$name];
+            } elseif (! empty($default)) {
+                continue;
+            } else {
+                $this->throwError("Missing argument $name");
+                break;
+            }
+
+            $this->set($name, $this->reduce($val, true), true, $env);
+        }
+
+        $storeEnv->store = $env->store;
+
+        foreach ($args as $arg) {
+            list($i, $name, $default, $isVariable) = $arg;
+
+            if ($isVariable || isset($remaining[$i]) || isset($keywordArgs[$name]) || empty($default)) {
+                continue;
+            }
+
+            $this->set($name, $this->reduce($default, true), true);
+        }
+    }
+
+    /**
+     * Coerce a php value into a scss one
+     *
+     * @param mixed $value
+     *
+     * @return array
+     */
+    private function coerceValue($value)
+    {
+        if (is_array($value) || $value instanceof \ArrayAccess) {
+            return $value;
+        }
+
+        if (is_bool($value)) {
+            return $this->toBool($value);
+        }
+
+        if ($value === null) {
+            return static::$null;
+        }
+
+        if (is_numeric($value)) {
+            return new Node\Number($value, '');
+        }
+
+        if ($value === '') {
+            return static::$emptyString;
+        }
+
+        if (preg_match('/^(#([0-9a-f]{6})|#([0-9a-f]{3}))$/i', $value, $m)) {
+            $color = [Type::T_COLOR];
+
+            if (isset($m[3])) {
+                $num = hexdec($m[3]);
+
+                foreach ([3, 2, 1] as $i) {
+                    $t = $num & 0xf;
+                    $color[$i] = $t << 4 | $t;
+                    $num >>= 4;
+                }
+            } else {
+                $num = hexdec($m[2]);
+
+                foreach ([3, 2, 1] as $i) {
+                    $color[$i] = $num & 0xff;
+                    $num >>= 8;
+                }
+            }
+
+            return $color;
+        }
+
+        return [Type::T_KEYWORD, $value];
+    }
+
+    /**
+     * Coerce something to map
+     *
+     * @param array $item
+     *
+     * @return array
+     */
+    protected function coerceMap($item)
+    {
+        if ($item[0] === Type::T_MAP) {
+            return $item;
+        }
+
+        if ($item === static::$emptyList) {
+            return static::$emptyMap;
+        }
+
+        return [Type::T_MAP, [$item], [static::$null]];
+    }
+
+    /**
+     * Coerce something to list
+     *
+     * @param array $item
+     *
+     * @return array
+     */
+    protected function coerceList($item, $delim = ',')
+    {
+        if (isset($item) && $item[0] === Type::T_LIST) {
+            return $item;
+        }
+
+        if (isset($item) && $item[0] === Type::T_MAP) {
+            $keys = $item[1];
+            $values = $item[2];
+            $list = [];
+
+            for ($i = 0, $s = count($keys); $i < $s; $i++) {
+                $key = $keys[$i];
+                $value = $values[$i];
+
+                $list[] = [
+                    Type::T_LIST,
+                    '',
+                    [[Type::T_KEYWORD, $this->compileStringContent($this->coerceString($key))], $value]
+                ];
+            }
+
+            return [Type::T_LIST, ',', $list];
+        }
+
+        return [Type::T_LIST, $delim, ! isset($item) ? []: [$item]];
+    }
+
+    /**
+     * Coerce color for expression
+     *
+     * @param array $value
+     *
+     * @return array|null
+     */
+    protected function coerceForExpression($value)
+    {
+        if ($color = $this->coerceColor($value)) {
+            return $color;
+        }
+
+        return $value;
+    }
+
+    /**
+     * Coerce value to color
+     *
+     * @param array $value
+     *
+     * @return array|null
+     */
+    protected function coerceColor($value)
+    {
+        switch ($value[0]) {
+            case Type::T_COLOR:
+                return $value;
+
+            case Type::T_KEYWORD:
+                $name = strtolower($value[1]);
+
+                if (isset(Colors::$cssColors[$name])) {
+                    $rgba = explode(',', Colors::$cssColors[$name]);
+
+                    return isset($rgba[3])
+                        ? [Type::T_COLOR, (int) $rgba[0], (int) $rgba[1], (int) $rgba[2], (int) $rgba[3]]
+                        : [Type::T_COLOR, (int) $rgba[0], (int) $rgba[1], (int) $rgba[2]];
+                }
+
+                return null;
+        }
+
+        return null;
+    }
+
+    /**
+     * Coerce value to string
+     *
+     * @param array $value
+     *
+     * @return array|null
+     */
+    protected function coerceString($value)
+    {
+        if ($value[0] === Type::T_STRING) {
+            return $value;
+        }
+
+        return [Type::T_STRING, '', [$this->compileValue($value)]];
+    }
+
+    /**
+     * Coerce value to a percentage
+     *
+     * @param array $value
+     *
+     * @return integer|float
+     */
+    protected function coercePercent($value)
+    {
+        if ($value[0] === Type::T_NUMBER) {
+            if (! empty($value[2]['%'])) {
+                return $value[1] / 100;
+            }
+
+            return $value[1];
+        }
+
+        return 0;
+    }
+
+    /**
+     * Assert value is a map
+     *
+     * @api
+     *
+     * @param array $value
+     *
+     * @return array
+     *
+     * @throws \Exception
+     */
+    public function assertMap($value)
+    {
+        $value = $this->coerceMap($value);
+
+        if ($value[0] !== Type::T_MAP) {
+            $this->throwError('expecting map');
+        }
+
+        return $value;
+    }
+
+    /**
+     * Assert value is a list
+     *
+     * @api
+     *
+     * @param array $value
+     *
+     * @return array
+     *
+     * @throws \Exception
+     */
+    public function assertList($value)
+    {
+        if ($value[0] !== Type::T_LIST) {
+            $this->throwError('expecting list');
+        }
+
+        return $value;
+    }
+
+    /**
+     * Assert value is a color
+     *
+     * @api
+     *
+     * @param array $value
+     *
+     * @return array
+     *
+     * @throws \Exception
+     */
+    public function assertColor($value)
+    {
+        if ($color = $this->coerceColor($value)) {
+            return $color;
+        }
+
+        $this->throwError('expecting color');
+    }
+
+    /**
+     * Assert value is a number
+     *
+     * @api
+     *
+     * @param array $value
+     *
+     * @return integer|float
+     *
+     * @throws \Exception
+     */
+    public function assertNumber($value)
+    {
+        if ($value[0] !== Type::T_NUMBER) {
+            $this->throwError('expecting number');
+        }
+
+        return $value[1];
+    }
+
+    /**
+     * Make sure a color's components don't go out of bounds
+     *
+     * @param array $c
+     *
+     * @return array
+     */
+    protected function fixColor($c)
+    {
+        foreach ([1, 2, 3] as $i) {
+            if ($c[$i] < 0) {
+                $c[$i] = 0;
+            }
+
+            if ($c[$i] > 255) {
+                $c[$i] = 255;
+            }
+        }
+
+        return $c;
+    }
+
+    /**
+     * Convert RGB to HSL
+     *
+     * @api
+     *
+     * @param integer $red
+     * @param integer $green
+     * @param integer $blue
+     *
+     * @return array
+     */
+    public function toHSL($red, $green, $blue)
+    {
+        $min = min($red, $green, $blue);
+        $max = max($red, $green, $blue);
+
+        $l = $min + $max;
+        $d = $max - $min;
+
+        if ((int) $d === 0) {
+            $h = $s = 0;
+        } else {
+            if ($l < 255) {
+                $s = $d / $l;
+            } else {
+                $s = $d / (510 - $l);
+            }
+
+            if ($red == $max) {
+                $h = 60 * ($green - $blue) / $d;
+            } elseif ($green == $max) {
+                $h = 60 * ($blue - $red) / $d + 120;
+            } elseif ($blue == $max) {
+                $h = 60 * ($red - $green) / $d + 240;
+            }
+        }
+
+        return [Type::T_HSL, fmod($h, 360), $s * 100, $l / 5.1];
+    }
+
+    /**
+     * Hue to RGB helper
+     *
+     * @param float $m1
+     * @param float $m2
+     * @param float $h
+     *
+     * @return float
+     */
+    private function hueToRGB($m1, $m2, $h)
+    {
+        if ($h < 0) {
+            $h += 1;
+        } elseif ($h > 1) {
+            $h -= 1;
+        }
+
+        if ($h * 6 < 1) {
+            return $m1 + ($m2 - $m1) * $h * 6;
+        }
+
+        if ($h * 2 < 1) {
+            return $m2;
+        }
+
+        if ($h * 3 < 2) {
+            return $m1 + ($m2 - $m1) * (2/3 - $h) * 6;
+        }
+
+        return $m1;
+    }
+
+    /**
+     * Convert HSL to RGB
+     *
+     * @api
+     *
+     * @param integer $hue        H from 0 to 360
+     * @param integer $saturation S from 0 to 100
+     * @param integer $lightness  L from 0 to 100
+     *
+     * @return array
+     */
+    public function toRGB($hue, $saturation, $lightness)
+    {
+        if ($hue < 0) {
+            $hue += 360;
+        }
+
+        $h = $hue / 360;
+        $s = min(100, max(0, $saturation)) / 100;
+        $l = min(100, max(0, $lightness)) / 100;
+
+        $m2 = $l <= 0.5 ? $l * ($s + 1) : $l + $s - $l * $s;
+        $m1 = $l * 2 - $m2;
+
+        $r = $this->hueToRGB($m1, $m2, $h + 1/3) * 255;
+        $g = $this->hueToRGB($m1, $m2, $h) * 255;
+        $b = $this->hueToRGB($m1, $m2, $h - 1/3) * 255;
+
+        $out = [Type::T_COLOR, $r, $g, $b];
+
+        return $out;
+    }
+
+    // Built in functions
+
+    //protected static $libCall = ['name', 'args...'];
+    protected function libCall($args, $kwargs)
+    {
+        $name = $this->compileStringContent($this->coerceString($this->reduce(array_shift($args), true)));
+
+        $args = array_map(
+            function ($a) {
+                return [null, $a, false];
+            },
+            $args
+        );
+
+        if (count($kwargs)) {
+            foreach ($kwargs as $key => $value) {
+                $args[] = [[Type::T_VARIABLE, $key], $value, false];
+            }
+        }
+
+        return $this->reduce([Type::T_FUNCTION_CALL, $name, $args]);
+    }
+
+    protected static $libIf = ['condition', 'if-true', 'if-false'];
+    protected function libIf($args)
+    {
+        list($cond, $t, $f) = $args;
+
+        if (! $this->isTruthy($this->reduce($cond, true))) {
+            return $this->reduce($f, true);
+        }
+
+        return $this->reduce($t, true);
+    }
+
+    protected static $libIndex = ['list', 'value'];
+    protected function libIndex($args)
+    {
+        list($list, $value) = $args;
+
+        if ($value[0] === Type::T_MAP) {
+            return static::$null;
+        }
+
+        if ($list[0] === Type::T_MAP ||
+            $list[0] === Type::T_STRING ||
+            $list[0] === Type::T_KEYWORD ||
+            $list[0] === Type::T_INTERPOLATE
+        ) {
+            $list = $this->coerceList($list, ' ');
+        }
+
+        if ($list[0] !== Type::T_LIST) {
+            return static::$null;
+        }
+
+        $values = [];
+
+        foreach ($list[2] as $item) {
+            $values[] = $this->normalizeValue($item);
+        }
+
+        $key = array_search($this->normalizeValue($value), $values);
+
+        return false === $key ? static::$null : $key + 1;
+    }
+
+    protected static $libRgb = ['red', 'green', 'blue'];
+    protected function libRgb($args)
+    {
+        list($r, $g, $b) = $args;
+
+        return [Type::T_COLOR, $r[1], $g[1], $b[1]];
+    }
+
+    protected static $libRgba = [
+        ['red', 'color'],
+        'green', 'blue', 'alpha'];
+    protected function libRgba($args)
+    {
+        if ($color = $this->coerceColor($args[0])) {
+            $num = ! isset($args[1]) ? $args[3] : $args[1];
+            $alpha = $this->assertNumber($num);
+            $color[4] = $alpha;
+
+            return $color;
+        }
+
+        list($r, $g, $b, $a) = $args;
+
+        return [Type::T_COLOR, $r[1], $g[1], $b[1], $a[1]];
+    }
+
+    // helper function for adjust_color, change_color, and scale_color
+    protected function alterColor($args, $fn)
+    {
+        $color = $this->assertColor($args[0]);
+
+        foreach ([1, 2, 3, 7] as $i) {
+            if (isset($args[$i])) {
+                $val = $this->assertNumber($args[$i]);
+                $ii = $i === 7 ? 4 : $i; // alpha
+                $color[$ii] = call_user_func($fn, isset($color[$ii]) ? $color[$ii] : 0, $val, $i);
+            }
+        }
+
+        if (isset($args[4]) || isset($args[5]) || isset($args[6])) {
+            $hsl = $this->toHSL($color[1], $color[2], $color[3]);
+
+            foreach ([4, 5, 6] as $i) {
+                if (isset($args[$i])) {
+                    $val = $this->assertNumber($args[$i]);
+                    $hsl[$i - 3] = call_user_func($fn, $hsl[$i - 3], $val, $i);
+                }
+            }
+
+            $rgb = $this->toRGB($hsl[1], $hsl[2], $hsl[3]);
+
+            if (isset($color[4])) {
+                $rgb[4] = $color[4];
+            }
+
+            $color = $rgb;
+        }
+
+        return $color;
+    }
+
+    protected static $libAdjustColor = [
+        'color', 'red', 'green', 'blue',
+        'hue', 'saturation', 'lightness', 'alpha'
+    ];
+    protected function libAdjustColor($args)
+    {
+        return $this->alterColor($args, function ($base, $alter, $i) {
+            return $base + $alter;
+        });
+    }
+
+    protected static $libChangeColor = [
+        'color', 'red', 'green', 'blue',
+        'hue', 'saturation', 'lightness', 'alpha'
+    ];
+    protected function libChangeColor($args)
+    {
+        return $this->alterColor($args, function ($base, $alter, $i) {
+            return $alter;
+        });
+    }
+
+    protected static $libScaleColor = [
+        'color', 'red', 'green', 'blue',
+        'hue', 'saturation', 'lightness', 'alpha'
+    ];
+    protected function libScaleColor($args)
+    {
+        return $this->alterColor($args, function ($base, $scale, $i) {
+            // 1, 2, 3 - rgb
+            // 4, 5, 6 - hsl
+            // 7 - a
+            switch ($i) {
+                case 1:
+                case 2:
+                case 3:
+                    $max = 255;
+                    break;
+
+                case 4:
+                    $max = 360;
+                    break;
+
+                case 7:
+                    $max = 1;
+                    break;
+
+                default:
+                    $max = 100;
+            }
+
+            $scale = $scale / 100;
+
+            if ($scale < 0) {
+                return $base * $scale + $base;
+            }
+
+            return ($max - $base) * $scale + $base;
+        });
+    }
+
+    protected static $libIeHexStr = ['color'];
+    protected function libIeHexStr($args)
+    {
+        $color = $this->coerceColor($args[0]);
+        $color[4] = isset($color[4]) ? round(255 * $color[4]) : 255;
+
+        return sprintf('#%02X%02X%02X%02X', $color[4], $color[1], $color[2], $color[3]);
+    }
+
+    protected static $libRed = ['color'];
+    protected function libRed($args)
+    {
+        $color = $this->coerceColor($args[0]);
+
+        return $color[1];
+    }
+
+    protected static $libGreen = ['color'];
+    protected function libGreen($args)
+    {
+        $color = $this->coerceColor($args[0]);
+
+        return $color[2];
+    }
+
+    protected static $libBlue = ['color'];
+    protected function libBlue($args)
+    {
+        $color = $this->coerceColor($args[0]);
+
+        return $color[3];
+    }
+
+    protected static $libAlpha = ['color'];
+    protected function libAlpha($args)
+    {
+        if ($color = $this->coerceColor($args[0])) {
+            return isset($color[4]) ? $color[4] : 1;
+        }
+
+        // this might be the IE function, so return value unchanged
+        return null;
+    }
+
+    protected static $libOpacity = ['color'];
+    protected function libOpacity($args)
+    {
+        $value = $args[0];
+
+        if ($value[0] === Type::T_NUMBER) {
+            return null;
+        }
+
+        return $this->libAlpha($args);
+    }
+
+    // mix two colors
+    protected static $libMix = ['color-1', 'color-2', 'weight'];
+    protected function libMix($args)
+    {
+        list($first, $second, $weight) = $args;
+
+        $first = $this->assertColor($first);
+        $second = $this->assertColor($second);
+
+        if (! isset($weight)) {
+            $weight = 0.5;
+        } else {
+            $weight = $this->coercePercent($weight);
+        }
+
+        $firstAlpha = isset($first[4]) ? $first[4] : 1;
+        $secondAlpha = isset($second[4]) ? $second[4] : 1;
+
+        $w = $weight * 2 - 1;
+        $a = $firstAlpha - $secondAlpha;
+
+        $w1 = (($w * $a === -1 ? $w : ($w + $a) / (1 + $w * $a)) + 1) / 2.0;
+        $w2 = 1.0 - $w1;
+
+        $new = [Type::T_COLOR,
+            $w1 * $first[1] + $w2 * $second[1],
+            $w1 * $first[2] + $w2 * $second[2],
+            $w1 * $first[3] + $w2 * $second[3],
+        ];
+
+        if ($firstAlpha != 1.0 || $secondAlpha != 1.0) {
+            $new[] = $firstAlpha * $weight + $secondAlpha * ($weight - 1);
+        }
+
+        return $this->fixColor($new);
+    }
+
+    protected static $libHsl = ['hue', 'saturation', 'lightness'];
+    protected function libHsl($args)
+    {
+        list($h, $s, $l) = $args;
+
+        return $this->toRGB($h[1], $s[1], $l[1]);
+    }
+
+    protected static $libHsla = ['hue', 'saturation', 'lightness', 'alpha'];
+    protected function libHsla($args)
+    {
+        list($h, $s, $l, $a) = $args;
+
+        $color = $this->toRGB($h[1], $s[1], $l[1]);
+        $color[4] = $a[1];
+
+        return $color;
+    }
+
+    protected static $libHue = ['color'];
+    protected function libHue($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $hsl = $this->toHSL($color[1], $color[2], $color[3]);
+
+        return new Node\Number($hsl[1], 'deg');
+    }
+
+    protected static $libSaturation = ['color'];
+    protected function libSaturation($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $hsl = $this->toHSL($color[1], $color[2], $color[3]);
+
+        return new Node\Number($hsl[2], '%');
+    }
+
+    protected static $libLightness = ['color'];
+    protected function libLightness($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $hsl = $this->toHSL($color[1], $color[2], $color[3]);
+
+        return new Node\Number($hsl[3], '%');
+    }
+
+    protected function adjustHsl($color, $idx, $amount)
+    {
+        $hsl = $this->toHSL($color[1], $color[2], $color[3]);
+        $hsl[$idx] += $amount;
+        $out = $this->toRGB($hsl[1], $hsl[2], $hsl[3]);
+
+        if (isset($color[4])) {
+            $out[4] = $color[4];
+        }
+
+        return $out;
+    }
+
+    protected static $libAdjustHue = ['color', 'degrees'];
+    protected function libAdjustHue($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $degrees = $this->assertNumber($args[1]);
+
+        return $this->adjustHsl($color, 1, $degrees);
+    }
+
+    protected static $libLighten = ['color', 'amount'];
+    protected function libLighten($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $amount = Util::checkRange('amount', new Range(0, 100), $args[1], '%');
+
+        return $this->adjustHsl($color, 3, $amount);
+    }
+
+    protected static $libDarken = ['color', 'amount'];
+    protected function libDarken($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $amount = Util::checkRange('amount', new Range(0, 100), $args[1], '%');
+
+        return $this->adjustHsl($color, 3, -$amount);
+    }
+
+    protected static $libSaturate = ['color', 'amount'];
+    protected function libSaturate($args)
+    {
+        $value = $args[0];
+
+        if ($value[0] === Type::T_NUMBER) {
+            return null;
+        }
+
+        $color = $this->assertColor($value);
+        $amount = 100 * $this->coercePercent($args[1]);
+
+        return $this->adjustHsl($color, 2, $amount);
+    }
+
+    protected static $libDesaturate = ['color', 'amount'];
+    protected function libDesaturate($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $amount = 100 * $this->coercePercent($args[1]);
+
+        return $this->adjustHsl($color, 2, -$amount);
+    }
+
+    protected static $libGrayscale = ['color'];
+    protected function libGrayscale($args)
+    {
+        $value = $args[0];
+
+        if ($value[0] === Type::T_NUMBER) {
+            return null;
+        }
+
+        return $this->adjustHsl($this->assertColor($value), 2, -100);
+    }
+
+    protected static $libComplement = ['color'];
+    protected function libComplement($args)
+    {
+        return $this->adjustHsl($this->assertColor($args[0]), 1, 180);
+    }
+
+    protected static $libInvert = ['color'];
+    protected function libInvert($args)
+    {
+        $value = $args[0];
+
+        if ($value[0] === Type::T_NUMBER) {
+            return null;
+        }
+
+        $color = $this->assertColor($value);
+        $color[1] = 255 - $color[1];
+        $color[2] = 255 - $color[2];
+        $color[3] = 255 - $color[3];
+
+        return $color;
+    }
+
+    // increases opacity by amount
+    protected static $libOpacify = ['color', 'amount'];
+    protected function libOpacify($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $amount = $this->coercePercent($args[1]);
+
+        $color[4] = (isset($color[4]) ? $color[4] : 1) + $amount;
+        $color[4] = min(1, max(0, $color[4]));
+
+        return $color;
+    }
+
+    protected static $libFadeIn = ['color', 'amount'];
+    protected function libFadeIn($args)
+    {
+        return $this->libOpacify($args);
+    }
+
+    // decreases opacity by amount
+    protected static $libTransparentize = ['color', 'amount'];
+    protected function libTransparentize($args)
+    {
+        $color = $this->assertColor($args[0]);
+        $amount = $this->coercePercent($args[1]);
+
+        $color[4] = (isset($color[4]) ? $color[4] : 1) - $amount;
+        $color[4] = min(1, max(0, $color[4]));
+
+        return $color;
+    }
+
+    protected static $libFadeOut = ['color', 'amount'];
+    protected function libFadeOut($args)
+    {
+        return $this->libTransparentize($args);
+    }
+
+    protected static $libUnquote = ['string'];
+    protected function libUnquote($args)
+    {
+        $str = $args[0];
+
+        if ($str[0] === Type::T_STRING) {
+            $str[1] = '';
+        }
+
+        return $str;
+    }
+
+    protected static $libQuote = ['string'];
+    protected function libQuote($args)
+    {
+        $value = $args[0];
+
+        if ($value[0] === Type::T_STRING && ! empty($value[1])) {
+            return $value;
+        }
+
+        return [Type::T_STRING, '"', [$value]];
+    }
+
+    protected static $libPercentage = ['value'];
+    protected function libPercentage($args)
+    {
+        return new Node\Number($this->coercePercent($args[0]) * 100, '%');
+    }
+
+    protected static $libRound = ['value'];
+    protected function libRound($args)
+    {
+        $num = $args[0];
+        $num[1] = round($num[1]);
+
+        return $num;
+    }
+
+    protected static $libFloor = ['value'];
+    protected function libFloor($args)
+    {
+        $num = $args[0];
+        $num[1] = floor($num[1]);
+
+        return $num;
+    }
+
+    protected static $libCeil = ['value'];
+    protected function libCeil($args)
+    {
+        $num = $args[0];
+        $num[1] = ceil($num[1]);
+
+        return $num;
+    }
+
+    protected static $libAbs = ['value'];
+    protected function libAbs($args)
+    {
+        $num = $args[0];
+        $num[1] = abs($num[1]);
+
+        return $num;
+    }
+
+    protected function libMin($args)
+    {
+        $numbers = $this->getNormalizedNumbers($args);
+        $min = null;
+
+        foreach ($numbers as $key => $number) {
+            if (null === $min || $number[1] <= $min[1]) {
+                $min = [$key, $number[1]];
+            }
+        }
+
+        return $args[$min[0]];
+    }
+
+    protected function libMax($args)
+    {
+        $numbers = $this->getNormalizedNumbers($args);
+        $max = null;
+
+        foreach ($numbers as $key => $number) {
+            if (null === $max || $number[1] >= $max[1]) {
+                $max = [$key, $number[1]];
+            }
+        }
+
+        return $args[$max[0]];
+    }
+
+    /**
+     * Helper to normalize args containing numbers
+     *
+     * @param array $args
+     *
+     * @return array
+     */
+    protected function getNormalizedNumbers($args)
+    {
+        $unit = null;
+        $originalUnit = null;
+        $numbers = [];
+
+        foreach ($args as $key => $item) {
+            if ($item[0] !== Type::T_NUMBER) {
+                $this->throwError('%s is not a number', $item[0]);
+                break;
+            }
+
+            $number = $item->normalize();
+
+            if (null === $unit) {
+                $unit = $number[2];
+                $originalUnit = $item->unitStr();
+            } elseif ($unit !== $number[2]) {
+                $this->throwError('Incompatible units: "%s" and "%s".', $originalUnit, $item->unitStr());
+                break;
+            }
+
+            $numbers[$key] = $number;
+        }
+
+        return $numbers;
+    }
+
+    protected static $libLength = ['list'];
+    protected function libLength($args)
+    {
+        $list = $this->coerceList($args[0]);
+
+        return count($list[2]);
+    }
+
+    //protected static $libListSeparator = ['list...'];
+    protected function libListSeparator($args)
+    {
+        if (count($args) > 1) {
+            return 'comma';
+        }
+
+        $list = $this->coerceList($args[0]);
+
+        if (count($list[2]) <= 1) {
+            return 'space';
+        }
+
+        if ($list[1] === ',') {
+            return 'comma';
+        }
+
+        return 'space';
+    }
+
+    protected static $libNth = ['list', 'n'];
+    protected function libNth($args)
+    {
+        $list = $this->coerceList($args[0]);
+        $n = $this->assertNumber($args[1]);
+
+        if ($n > 0) {
+            $n--;
+        } elseif ($n < 0) {
+            $n += count($list[2]);
+        }
+
+        return isset($list[2][$n]) ? $list[2][$n] : static::$defaultValue;
+    }
+
+    protected static $libSetNth = ['list', 'n', 'value'];
+    protected function libSetNth($args)
+    {
+        $list = $this->coerceList($args[0]);
+        $n = $this->assertNumber($args[1]);
+
+        if ($n > 0) {
+            $n--;
+        } elseif ($n < 0) {
+            $n += count($list[2]);
+        }
+
+        if (! isset($list[2][$n])) {
+            $this->throwError('Invalid argument for "n"');
+
+            return;
+        }
+
+        $list[2][$n] = $args[2];
+
+        return $list;
+    }
+
+    protected static $libMapGet = ['map', 'key'];
+    protected function libMapGet($args)
+    {
+        $map = $this->assertMap($args[0]);
+        $key = $this->compileStringContent($this->coerceString($args[1]));
+
+        for ($i = count($map[1]) - 1; $i >= 0; $i--) {
+            if ($key === $this->compileStringContent($this->coerceString($map[1][$i]))) {
+                return $map[2][$i];
+            }
+        }
+
+        return static::$null;
+    }
+
+    protected static $libMapKeys = ['map'];
+    protected function libMapKeys($args)
+    {
+        $map = $this->assertMap($args[0]);
+        $keys = $map[1];
+
+        return [Type::T_LIST, ',', $keys];
+    }
+
+    protected static $libMapValues = ['map'];
+    protected function libMapValues($args)
+    {
+        $map = $this->assertMap($args[0]);
+        $values = $map[2];
+
+        return [Type::T_LIST, ',', $values];
+    }
+
+    protected static $libMapRemove = ['map', 'key'];
+    protected function libMapRemove($args)
+    {
+        $map = $this->assertMap($args[0]);
+        $key = $this->compileStringContent($this->coerceString($args[1]));
+
+        for ($i = count($map[1]) - 1; $i >= 0; $i--) {
+            if ($key === $this->compileStringContent($this->coerceString($map[1][$i]))) {
+                array_splice($map[1], $i, 1);
+                array_splice($map[2], $i, 1);
+            }
+        }
+
+        return $map;
+    }
+
+    protected static $libMapHasKey = ['map', 'key'];
+    protected function libMapHasKey($args)
+    {
+        $map = $this->assertMap($args[0]);
+        $key = $this->compileStringContent($this->coerceString($args[1]));
+
+        for ($i = count($map[1]) - 1; $i >= 0; $i--) {
+            if ($key === $this->compileStringContent($this->coerceString($map[1][$i]))) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    protected static $libMapMerge = ['map-1', 'map-2'];
+    protected function libMapMerge($args)
+    {
+        $map1 = $this->assertMap($args[0]);
+        $map2 = $this->assertMap($args[1]);
+
+        return [Type::T_MAP, array_merge($map1[1], $map2[1]), array_merge($map1[2], $map2[2])];
+    }
+
+    protected static $libKeywords = ['args'];
+    protected function libKeywords($args)
+    {
+        $this->assertList($args[0]);
+
+        $keys = [];
+        $values = [];
+
+        foreach ($args[0][2] as $name => $arg) {
+            $keys[] = [Type::T_KEYWORD, $name];
+            $values[] = $arg;
+        }
+
+        return [Type::T_MAP, $keys, $values];
+    }
+
+    protected function listSeparatorForJoin($list1, $sep)
+    {
+        if (! isset($sep)) {
+            return $list1[1];
+        }
+
+        switch ($this->compileValue($sep)) {
+            case 'comma':
+                return ',';
+
+            case 'space':
+                return '';
+
+            default:
+                return $list1[1];
+        }
+    }
+
+    protected static $libJoin = ['list1', 'list2', 'separator'];
+    protected function libJoin($args)
+    {
+        list($list1, $list2, $sep) = $args;
+
+        $list1 = $this->coerceList($list1, ' ');
+        $list2 = $this->coerceList($list2, ' ');
+        $sep = $this->listSeparatorForJoin($list1, $sep);
+
+        return [Type::T_LIST, $sep, array_merge($list1[2], $list2[2])];
+    }
+
+    protected static $libAppend = ['list', 'val', 'separator'];
+    protected function libAppend($args)
+    {
+        list($list1, $value, $sep) = $args;
+
+        $list1 = $this->coerceList($list1, ' ');
+        $sep = $this->listSeparatorForJoin($list1, $sep);
+
+        return [Type::T_LIST, $sep, array_merge($list1[2], [$value])];
+    }
+
+    protected function libZip($args)
+    {
+        foreach ($args as $arg) {
+            $this->assertList($arg);
+        }
+
+        $lists = [];
+        $firstList = array_shift($args);
+
+        foreach ($firstList[2] as $key => $item) {
+            $list = [Type::T_LIST, '', [$item]];
+
+            foreach ($args as $arg) {
+                if (isset($arg[2][$key])) {
+                    $list[2][] = $arg[2][$key];
+                } else {
+                    break 2;
+                }
+            }
+
+            $lists[] = $list;
+        }
+
+        return [Type::T_LIST, ',', $lists];
+    }
+
+    protected static $libTypeOf = ['value'];
+    protected function libTypeOf($args)
+    {
+        $value = $args[0];
+
+        switch ($value[0]) {
+            case Type::T_KEYWORD:
+                if ($value === static::$true || $value === static::$false) {
+                    return 'bool';
+                }
+
+                if ($this->coerceColor($value)) {
+                    return 'color';
+                }
+
+                // fall-thru
+            case Type::T_FUNCTION:
+                return 'string';
+
+            case Type::T_LIST:
+                if (isset($value[3]) && $value[3]) {
+                    return 'arglist';
+                }
+
+                // fall-thru
+            default:
+                return $value[0];
+        }
+    }
+
+    protected static $libUnit = ['number'];
+    protected function libUnit($args)
+    {
+        $num = $args[0];
+
+        if ($num[0] === Type::T_NUMBER) {
+            return [Type::T_STRING, '"', [$num->unitStr()]];
+        }
+
+        return '';
+    }
+
+    protected static $libUnitless = ['number'];
+    protected function libUnitless($args)
+    {
+        $value = $args[0];
+
+        return $value[0] === Type::T_NUMBER && $value->unitless();
+    }
+
+    protected static $libComparable = ['number-1', 'number-2'];
+    protected function libComparable($args)
+    {
+        list($number1, $number2) = $args;
+
+        if (! isset($number1[0]) || $number1[0] !== Type::T_NUMBER ||
+            ! isset($number2[0]) || $number2[0] !== Type::T_NUMBER
+        ) {
+            $this->throwError('Invalid argument(s) for "comparable"');
+
+            return;
+        }
+
+        $number1 = $number1->normalize();
+        $number2 = $number2->normalize();
+
+        return $number1[2] === $number2[2] || $number1->unitless() || $number2->unitless();
+    }
+
+    protected static $libStrIndex = ['string', 'substring'];
+    protected function libStrIndex($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $stringContent = $this->compileStringContent($string);
+
+        $substring = $this->coerceString($args[1]);
+        $substringContent = $this->compileStringContent($substring);
+
+        $result = strpos($stringContent, $substringContent);
+
+        return $result === false ? static::$null : new Node\Number($result + 1, '');
+    }
+
+    protected static $libStrInsert = ['string', 'insert', 'index'];
+    protected function libStrInsert($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $stringContent = $this->compileStringContent($string);
+
+        $insert = $this->coerceString($args[1]);
+        $insertContent = $this->compileStringContent($insert);
+
+        list(, $index) = $args[2];
+
+        $string[2] = [substr_replace($stringContent, $insertContent, $index - 1, 0)];
+
+        return $string;
+    }
+
+    protected static $libStrLength = ['string'];
+    protected function libStrLength($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $stringContent = $this->compileStringContent($string);
+
+        return new Node\Number(strlen($stringContent), '');
+    }
+
+    protected static $libStrSlice = ['string', 'start-at', 'end-at'];
+    protected function libStrSlice($args)
+    {
+        if (isset($args[2]) && $args[2][1] == 0) {
+            return static::$nullString;
+        }
+
+        $string = $this->coerceString($args[0]);
+        $stringContent = $this->compileStringContent($string);
+
+        $start = (int) $args[1][1];
+
+        if ($start > 0) {
+            $start--;
+        }
+
+        $end    = (int) $args[2][1];
+        $length = $end < 0 ? $end + 1 : ($end > 0 ? $end - $start : $end);
+
+        $string[2] = $length
+            ? [substr($stringContent, $start, $length)]
+            : [substr($stringContent, $start)];
+
+        return $string;
+    }
+
+    protected static $libToLowerCase = ['string'];
+    protected function libToLowerCase($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $stringContent = $this->compileStringContent($string);
+
+        $string[2] = [mb_strtolower($stringContent)];
+
+        return $string;
+    }
+
+    protected static $libToUpperCase = ['string'];
+    protected function libToUpperCase($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $stringContent = $this->compileStringContent($string);
+
+        $string[2] = [mb_strtoupper($stringContent)];
+
+        return $string;
+    }
+
+    protected static $libFeatureExists = ['feature'];
+    protected function libFeatureExists($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $name = $this->compileStringContent($string);
+
+        return $this->toBool(
+            array_key_exists($name, $this->registeredFeatures) ? $this->registeredFeatures[$name] : false
+        );
+    }
+
+    protected static $libFunctionExists = ['name'];
+    protected function libFunctionExists($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $name = $this->compileStringContent($string);
+
+        // user defined functions
+        if ($this->has(static::$namespaces['function'] . $name)) {
+            return true;
+        }
+
+        $name = $this->normalizeName($name);
+
+        if (isset($this->userFunctions[$name])) {
+            return true;
+        }
+
+        // built-in functions
+        $f = $this->getBuiltinFunction($name);
+
+        return $this->toBool(is_callable($f));
+    }
+
+    protected static $libGlobalVariableExists = ['name'];
+    protected function libGlobalVariableExists($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $name = $this->compileStringContent($string);
+
+        return $this->has($name, $this->rootEnv);
+    }
+
+    protected static $libMixinExists = ['name'];
+    protected function libMixinExists($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $name = $this->compileStringContent($string);
+
+        return $this->has(static::$namespaces['mixin'] . $name);
+    }
+
+    protected static $libVariableExists = ['name'];
+    protected function libVariableExists($args)
+    {
+        $string = $this->coerceString($args[0]);
+        $name = $this->compileStringContent($string);
+
+        return $this->has($name);
+    }
+
+    /**
+     * Workaround IE7's content counter bug.
+     *
+     * @param array $args
+     */
+    protected function libCounter($args)
+    {
+        $list = array_map([$this, 'compileValue'], $args);
+
+        return [Type::T_STRING, '', ['counter(' . implode(',', $list) . ')']];
+    }
+
+    protected static $libRandom = ['limit'];
+    protected function libRandom($args)
+    {
+        if (isset($args[0])) {
+            $n = $this->assertNumber($args[0]);
+
+            if ($n < 1) {
+                $this->throwError("limit must be greater than or equal to 1");
+
+                return;
+            }
+
+            return new Node\Number(mt_rand(1, $n), '');
+        }
+
+        return new Node\Number(mt_rand(1, mt_getrandmax()), '');
+    }
+
+    protected function libUniqueId()
+    {
+        static $id;
+
+        if (! isset($id)) {
+            $id = mt_rand(0, pow(36, 8));
+        }
+
+        $id += mt_rand(0, 10) + 1;
+
+        return [Type::T_STRING, '', ['u' . str_pad(base_convert($id, 10, 36), 8, '0', STR_PAD_LEFT)]];
+    }
+
+    protected static $libInspect = ['value'];
+    protected function libInspect($args)
+    {
+        if ($args[0] === static::$null) {
+            return [Type::T_KEYWORD, 'null'];
+        }
+
+        return $args[0];
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Compiler/Environment.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Compiler/Environment.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Compiler/Environment.php	(revision 7114)
@@ -0,0 +1,40 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Compiler;
+
+/**
+ * Compiler environment
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class Environment
+{
+    /**
+     * @var \Leafo\ScssPhp\Block
+     */
+    public $block;
+
+    /**
+     * @var \Leafo\ScssPhp\Compiler\Environment
+     */
+    public $parent;
+
+    /**
+     * @var array
+     */
+    public $store;
+
+    /**
+     * @var integer
+     */
+    public $depth;
+}
Index: /lib/vendor/leafo/scssphp/src/Exception/CompilerException.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Exception/CompilerException.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Exception/CompilerException.php	(revision 7114)
@@ -0,0 +1,21 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Exception;
+
+/**
+ * Compiler exception
+ *
+ * @author Oleksandr Savchenko <traveltino@gmail.com>
+ */
+class CompilerException extends \Exception
+{
+}
Index: /lib/vendor/leafo/scssphp/src/Exception/ParserException.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Exception/ParserException.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Exception/ParserException.php	(revision 7114)
@@ -0,0 +1,21 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Exception;
+
+/**
+ * Parser Exception
+ *
+ * @author Oleksandr Savchenko <traveltino@gmail.com>
+ */
+class ParserException extends \Exception
+{
+}
Index: /lib/vendor/leafo/scssphp/src/Exception/RangeException.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Exception/RangeException.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Exception/RangeException.php	(revision 7114)
@@ -0,0 +1,21 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Exception;
+
+/**
+ * Range exception
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class RangeException extends \Exception
+{
+}
Index: /lib/vendor/leafo/scssphp/src/Exception/ServerException.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Exception/ServerException.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Exception/ServerException.php	(revision 7114)
@@ -0,0 +1,21 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Exception;
+
+/**
+ * Server Exception
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class ServerException extends \Exception
+{
+}
Index: /lib/vendor/leafo/scssphp/src/Formatter.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Formatter.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Formatter.php	(revision 7114)
@@ -0,0 +1,216 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+use Leafo\ScssPhp\Formatter\OutputBlock;
+
+/**
+ * Base formatter
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+abstract class Formatter
+{
+    /**
+     * @var integer
+     */
+    public $indentLevel;
+
+    /**
+     * @var string
+     */
+    public $indentChar;
+
+    /**
+     * @var string
+     */
+    public $break;
+
+    /**
+     * @var string
+     */
+    public $open;
+
+    /**
+     * @var string
+     */
+    public $close;
+
+    /**
+     * @var string
+     */
+    public $tagSeparator;
+
+    /**
+     * @var string
+     */
+    public $assignSeparator;
+
+    /**
+     * @var boolea
+     */
+    public $keepSemicolons;
+
+    /**
+     * Initialize formatter
+     *
+     * @api
+     */
+    abstract public function __construct();
+
+    /**
+     * Return indentation (whitespace)
+     *
+     * @return string
+     */
+    protected function indentStr()
+    {
+        return '';
+    }
+
+    /**
+     * Return property assignment
+     *
+     * @api
+     *
+     * @param string $name
+     * @param mixed  $value
+     *
+     * @return string
+     */
+    public function property($name, $value)
+    {
+        return rtrim($name) . $this->assignSeparator . $value . ';';
+    }
+
+    /**
+     * Strip semi-colon appended by property(); it's a separator, not a terminator
+     *
+     * @api
+     *
+     * @param array $lines
+     */
+    public function stripSemicolon(&$lines)
+    {
+        if ($this->keepSemicolons) {
+            return;
+        }
+
+        if (($count = count($lines))
+            && substr($lines[$count - 1], -1) === ';'
+        ) {
+            $lines[$count - 1] = substr($lines[$count - 1], 0, -1);
+        }
+    }
+
+    /**
+     * Output lines inside a block
+     *
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $block
+     */
+    protected function blockLines(OutputBlock $block)
+    {
+        $inner = $this->indentStr();
+
+        $glue = $this->break . $inner;
+
+        echo $inner . implode($glue, $block->lines);
+
+        if (! empty($block->children)) {
+            echo $this->break;
+        }
+    }
+
+    /**
+     * Output block selectors
+     *
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $block
+     */
+    protected function blockSelectors(OutputBlock $block)
+    {
+        $inner = $this->indentStr();
+
+        echo $inner
+            . implode($this->tagSeparator, $block->selectors)
+            . $this->open . $this->break;
+    }
+
+    /**
+     * Output block children
+     *
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $block
+     */
+    protected function blockChildren(OutputBlock $block)
+    {
+        foreach ($block->children as $child) {
+            $this->block($child);
+        }
+    }
+
+    /**
+     * Output non-empty block
+     *
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $block
+     */
+    protected function block(OutputBlock $block)
+    {
+        if (empty($block->lines) && empty($block->children)) {
+            return;
+        }
+
+        $pre = $this->indentStr();
+
+        if (! empty($block->selectors)) {
+            $this->blockSelectors($block);
+
+            $this->indentLevel++;
+        }
+
+        if (! empty($block->lines)) {
+            $this->blockLines($block);
+        }
+
+        if (! empty($block->children)) {
+            $this->blockChildren($block);
+        }
+
+        if (! empty($block->selectors)) {
+            $this->indentLevel--;
+
+            if (empty($block->children)) {
+                echo $this->break;
+            }
+
+            echo $pre . $this->close . $this->break;
+        }
+    }
+
+    /**
+     * Entry point to formatting a block
+     *
+     * @api
+     *
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $block An abstract syntax tree
+     *
+     * @return string
+     */
+    public function format(OutputBlock $block)
+    {
+        ob_start();
+
+        $this->block($block);
+
+        $out = ob_get_clean();
+
+        return $out;
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Formatter/Compact.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Formatter/Compact.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Formatter/Compact.php	(revision 7114)
@@ -0,0 +1,45 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Formatter;
+
+use Leafo\ScssPhp\Formatter;
+
+/**
+ * Compact formatter
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Compact extends Formatter
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct()
+    {
+        $this->indentLevel = 0;
+        $this->indentChar = '';
+        $this->break = '';
+        $this->open = ' {';
+        $this->close = "}\n\n";
+        $this->tagSeparator = ',';
+        $this->assignSeparator = ':';
+        $this->keepSemicolons = true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function indentStr()
+    {
+        return ' ';
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Formatter/Compressed.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Formatter/Compressed.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Formatter/Compressed.php	(revision 7114)
@@ -0,0 +1,62 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Formatter;
+
+use Leafo\ScssPhp\Formatter;
+use Leafo\ScssPhp\Formatter\OutputBlock;
+
+/**
+ * Compressed formatter
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Compressed extends Formatter
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct()
+    {
+        $this->indentLevel = 0;
+        $this->indentChar = '  ';
+        $this->break = '';
+        $this->open = '{';
+        $this->close = '}';
+        $this->tagSeparator = ',';
+        $this->assignSeparator = ':';
+        $this->keepSemicolons = false;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function blockLines(OutputBlock $block)
+    {
+        $inner = $this->indentStr();
+
+        $glue = $this->break . $inner;
+
+        foreach ($block->lines as $index => $line) {
+            if (substr($line, 0, 2) === '/*' && substr($line, 2, 1) !== '!') {
+                unset($block->lines[$index]);
+            } elseif (substr($line, 0, 3) === '/*!') {
+                $block->lines[$index] = '/*' . substr($line, 3);
+            }
+        }
+
+        echo $inner . implode($glue, $block->lines);
+
+        if (! empty($block->children)) {
+            echo $this->break;
+        }
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Formatter/Crunched.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Formatter/Crunched.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Formatter/Crunched.php	(revision 7114)
@@ -0,0 +1,60 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Formatter;
+
+use Leafo\ScssPhp\Formatter;
+use Leafo\ScssPhp\Formatter\OutputBlock;
+
+/**
+ * Crunched formatter
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class Crunched extends Formatter
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct()
+    {
+        $this->indentLevel = 0;
+        $this->indentChar = '  ';
+        $this->break = '';
+        $this->open = '{';
+        $this->close = '}';
+        $this->tagSeparator = ',';
+        $this->assignSeparator = ':';
+        $this->keepSemicolons = false;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function blockLines(OutputBlock $block)
+    {
+        $inner = $this->indentStr();
+
+        $glue = $this->break . $inner;
+
+        foreach ($block->lines as $index => $line) {
+            if (substr($line, 0, 2) === '/*') {
+                unset($block->lines[$index]);
+            }
+        }
+
+        echo $inner . implode($glue, $block->lines);
+
+        if (! empty($block->children)) {
+            echo $this->break;
+        }
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Formatter/Debug.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Formatter/Debug.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Formatter/Debug.php	(revision 7114)
@@ -0,0 +1,119 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Formatter;
+
+use Leafo\ScssPhp\Formatter;
+use Leafo\ScssPhp\Formatter\OutputBlock;
+
+/**
+ * Debug formatter
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class Debug extends Formatter
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct()
+    {
+        $this->indentLevel = 0;
+        $this->indentChar = '';
+        $this->break = "\n";
+        $this->open = ' {';
+        $this->close = ' }';
+        $this->tagSeparator = ', ';
+        $this->assignSeparator = ': ';
+        $this->keepSemicolons = true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function indentStr()
+    {
+        return str_repeat('  ', $this->indentLevel);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function blockLines(OutputBlock $block)
+    {
+        $indent = $this->indentStr();
+
+        if (empty($block->lines)) {
+            echo "{$indent}block->lines: []\n";
+
+            return;
+        }
+
+        foreach ($block->lines as $index => $line) {
+            echo "{$indent}block->lines[{$index}]: $line\n";
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function blockSelectors(OutputBlock $block)
+    {
+        $indent = $this->indentStr();
+
+        if (empty($block->selectors)) {
+            echo "{$indent}block->selectors: []\n";
+
+            return;
+        }
+
+        foreach ($block->selectors as $index => $selector) {
+            echo "{$indent}block->selectors[{$index}]: $selector\n";
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function blockChildren(OutputBlock $block)
+    {
+        $indent = $this->indentStr();
+
+        if (empty($block->children)) {
+            echo "{$indent}block->children: []\n";
+
+            return;
+        }
+
+        $this->indentLevel++;
+
+        foreach ($block->children as $i => $child) {
+            $this->block($child);
+        }
+
+        $this->indentLevel--;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function block(OutputBlock $block)
+    {
+        $indent = $this->indentStr();
+
+        echo "{$indent}block->type: {$block->type}\n" .
+             "{$indent}block->depth: {$block->depth}\n";
+
+        $this->blockSelectors($block);
+        $this->blockLines($block);
+        $this->blockChildren($block);
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Formatter/Expanded.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Formatter/Expanded.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Formatter/Expanded.php	(revision 7114)
@@ -0,0 +1,68 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Formatter;
+
+use Leafo\ScssPhp\Formatter;
+use Leafo\ScssPhp\Formatter\OutputBlock;
+
+/**
+ * Expanded formatter
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Expanded extends Formatter
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct()
+    {
+        $this->indentLevel = 0;
+        $this->indentChar = '  ';
+        $this->break = "\n";
+        $this->open = ' {';
+        $this->close = '}';
+        $this->tagSeparator = ', ';
+        $this->assignSeparator = ': ';
+        $this->keepSemicolons = true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function indentStr()
+    {
+        return str_repeat($this->indentChar, $this->indentLevel);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function blockLines(OutputBlock $block)
+    {
+        $inner = $this->indentStr();
+
+        $glue = $this->break . $inner;
+
+        foreach ($block->lines as $index => $line) {
+            if (substr($line, 0, 2) === '/*') {
+                $block->lines[$index] = preg_replace('/(\r|\n)+/', $glue, $line);
+            }
+        }
+
+        echo $inner . implode($glue, $block->lines);
+
+        if (empty($block->selectors) || ! empty($block->children)) {
+            echo $this->break;
+        }
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Formatter/Nested.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Formatter/Nested.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Formatter/Nested.php	(revision 7114)
@@ -0,0 +1,198 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Formatter;
+
+use Leafo\ScssPhp\Formatter;
+use Leafo\ScssPhp\Formatter\OutputBlock;
+
+/**
+ * Nested formatter
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Nested extends Formatter
+{
+    /**
+     * @var integer
+     */
+    private $depth;
+
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct()
+    {
+        $this->indentLevel = 0;
+        $this->indentChar = '  ';
+        $this->break = "\n";
+        $this->open = ' {';
+        $this->close = ' }';
+        $this->tagSeparator = ', ';
+        $this->assignSeparator = ': ';
+        $this->keepSemicolons = true;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function indentStr()
+    {
+        $n = $this->depth - 1;
+
+        return str_repeat($this->indentChar, max($this->indentLevel + $n, 0));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function blockLines(OutputBlock $block)
+    {
+        $inner = $this->indentStr();
+
+        $glue = $this->break . $inner;
+
+        foreach ($block->lines as $index => $line) {
+            if (substr($line, 0, 2) === '/*') {
+                $block->lines[$index] = preg_replace('/(\r|\n)+/', $glue, $line);
+            }
+        }
+
+        echo $inner . implode($glue, $block->lines);
+
+        if (! empty($block->children)) {
+            echo $this->break;
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function blockSelectors(OutputBlock $block)
+    {
+        $inner = $this->indentStr();
+
+        echo $inner
+            . implode($this->tagSeparator, $block->selectors)
+            . $this->open . $this->break;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function blockChildren(OutputBlock $block)
+    {
+        foreach ($block->children as $i => $child) {
+            $this->block($child);
+
+            if ($i < count($block->children) - 1) {
+                echo $this->break;
+
+                if (isset($block->children[$i + 1])) {
+                    $next = $block->children[$i + 1];
+
+                    if ($next->depth === max($block->depth, 1) && $child->depth >= $next->depth) {
+                        echo $this->break;
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function block(OutputBlock $block)
+    {
+        if ($block->type === 'root') {
+            $this->adjustAllChildren($block);
+        }
+
+        if (empty($block->lines) && empty($block->children)) {
+            return;
+        }
+
+        $this->depth = $block->depth;
+
+        if (! empty($block->selectors)) {
+            $this->blockSelectors($block);
+
+            $this->indentLevel++;
+        }
+
+        if (! empty($block->lines)) {
+            $this->blockLines($block);
+        }
+
+        if (! empty($block->children)) {
+            $this->blockChildren($block);
+        }
+
+        if (! empty($block->selectors)) {
+            $this->indentLevel--;
+
+            echo $this->close;
+        }
+
+        if ($block->type === 'root') {
+            echo $this->break;
+        }
+    }
+
+    /**
+     * Adjust the depths of all children, depth first
+     *
+     * @param \Leafo\ScssPhp\Formatter\OutputBlock $block
+     */
+    private function adjustAllChildren(OutputBlock $block)
+    {
+        // flatten empty nested blocks
+        $children = [];
+
+        foreach ($block->children as $i => $child) {
+            if (empty($child->lines) && empty($child->children)) {
+                if (isset($block->children[$i + 1])) {
+                    $block->children[$i + 1]->depth = $child->depth;
+                }
+
+                continue;
+            }
+
+            $children[] = $child;
+        }
+
+        $count = count($children);
+
+        for ($i = 0; $i < $count; $i++) {
+            $depth = $children[$i]->depth;
+            $j = $i + 1;
+
+            if (isset($children[$j]) && $depth < $children[$j]->depth) {
+                $childDepth = $children[$j]->depth;
+
+                for (; $j < $count; $j++) {
+                    if ($depth < $children[$j]->depth && $childDepth >= $children[$j]->depth) {
+                        $children[$j]->depth = $depth + 1;
+                    }
+                }
+            }
+        }
+
+        $block->children = $children;
+
+        // make relative to parent
+        foreach ($block->children as $child) {
+            $this->adjustAllChildren($child);
+
+            $child->depth = $child->depth - $block->depth;
+        }
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Formatter/OutputBlock.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Formatter/OutputBlock.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Formatter/OutputBlock.php	(revision 7114)
@@ -0,0 +1,50 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Formatter;
+
+/**
+ * Output block
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class OutputBlock
+{
+    /**
+     * @var string
+     */
+    public $type;
+
+    /**
+     * @var integer
+     */
+    public $depth;
+
+    /**
+     * @var array
+     */
+    public $selectors;
+
+    /**
+     * @var array
+     */
+    public $lines;
+
+    /**
+     * @var array
+     */
+    public $children;
+
+    /**
+     * @var \Leafo\ScssPhp\Formatter\OutputBlock
+     */
+    public $parent;
+}
Index: /lib/vendor/leafo/scssphp/src/Node.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Node.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Node.php	(revision 7114)
@@ -0,0 +1,40 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+/**
+ * Base node
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+abstract class Node
+{
+    /**
+     * @var string
+     */
+    public $type;
+
+    /**
+     * @var integer
+     */
+    public $sourceIndex;
+
+    /**
+     * @var integer
+     */
+    public $sourceLine;
+
+    /**
+     * @var integer
+     */
+    public $sourceColumn;
+}
Index: /lib/vendor/leafo/scssphp/src/Node/Number.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Node/Number.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Node/Number.php	(revision 7114)
@@ -0,0 +1,329 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp\Node;
+
+use Leafo\ScssPhp\Compiler;
+use Leafo\ScssPhp\Node;
+use Leafo\ScssPhp\Type;
+
+/**
+ * Dimension + optional units
+ *
+ * {@internal
+ *     This is a work-in-progress.
+ *
+ *     The \ArrayAccess interface is temporary until the migration is complete.
+ * }}
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class Number extends Node implements \ArrayAccess
+{
+    /**
+     * @var integer
+     */
+    static public $precision = 5;
+
+    /**
+     * @see http://www.w3.org/TR/2012/WD-css3-values-20120308/
+     *
+     * @var array
+     */
+    static protected $unitTable = [
+        'in' => [
+            'in' => 1,
+            'pc' => 6,
+            'pt' => 72,
+            'px' => 96,
+            'cm' => 2.54,
+            'mm' => 25.4,
+            'q'  => 101.6,
+        ],
+        'turn' => [
+            'deg'  => 360,
+            'grad' => 400,
+            'rad'  => 6.28318530717958647692528676, // 2 * M_PI
+            'turn' => 1,
+        ],
+        's' => [
+            's'  => 1,
+            'ms' => 1000,
+        ],
+        'Hz' => [
+            'Hz'  => 1,
+            'kHz' => 0.001,
+        ],
+        'dpi' => [
+            'dpi'  => 1,
+            'dpcm' => 2.54,
+            'dppx' => 96,
+        ],
+    ];
+
+    /**
+     * @var integer|float
+     */
+    public $dimension;
+
+    /**
+     * @var array
+     */
+    public $units;
+
+    /**
+     * Initialize number
+     *
+     * @param mixed $dimension
+     * @param mixed $initialUnit
+     */
+    public function __construct($dimension, $initialUnit)
+    {
+        $this->type      = Type::T_NUMBER;
+        $this->dimension = $dimension;
+        $this->units     = is_array($initialUnit)
+            ? $initialUnit
+            : ($initialUnit ? [$initialUnit => 1]
+                            : []);
+    }
+
+    /**
+     * Coerce number to target units
+     *
+     * @param array $units
+     *
+     * @return \Leafo\ScssPhp\Node\Number
+     */
+    public function coerce($units)
+    {
+        if ($this->unitless()) {
+            return new Number($this->dimension, $units);
+        }
+
+        $dimension = $this->dimension;
+
+        foreach (static::$unitTable['in'] as $unit => $conv) {
+            $from       = isset($this->units[$unit]) ? $this->units[$unit] : 0;
+            $to         = isset($units[$unit]) ? $units[$unit] : 0;
+            $factor     = pow($conv, $from - $to);
+            $dimension /= $factor;
+        }
+
+        return new Number($dimension, $units);
+    }
+
+    /**
+     * Normalize number
+     *
+     * @return \Leafo\ScssPhp\Node\Number
+     */
+    public function normalize()
+    {
+        $dimension = $this->dimension;
+        $units     = [];
+
+        $this->normalizeUnits($dimension, $units, 'in');
+
+        return new Number($dimension, $units);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function offsetExists($offset)
+    {
+        if ($offset === -3) {
+            return $this->sourceColumn !== null;
+        }
+
+        if ($offset === -2) {
+            return $this->sourceLine !== null;
+        }
+
+        if ($offset === -1
+            || $offset === 0
+            || $offset === 1
+            || $offset === 2
+        ) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function offsetGet($offset)
+    {
+        switch ($offset) {
+            case -3:
+                return $this->sourceColumn;
+
+            case -2:
+                return $this->sourceLine;
+
+            case -1:
+                return $this->sourceIndex;
+
+            case 0:
+                return $this->type;
+
+            case 1:
+                return $this->dimension;
+
+            case 2:
+                return $this->units;
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function offsetSet($offset, $value)
+    {
+        if ($offset === 1) {
+            $this->dimension = $value;
+        } elseif ($offset === 2) {
+            $this->units = $value;
+        } elseif ($offset == -1) {
+            $this->sourceIndex = $value;
+        } elseif ($offset == -2) {
+            $this->sourceLine = $value;
+        } elseif ($offset == -3) {
+            $this->sourceColumn = $value;
+        }
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function offsetUnset($offset)
+    {
+        if ($offset === 1) {
+            $this->dimension = null;
+        } elseif ($offset === 2) {
+            $this->units = null;
+        } elseif ($offset === -1) {
+            $this->sourceIndex = null;
+        } elseif ($offset === -2) {
+            $this->sourceLine = null;
+        } elseif ($offset === -3) {
+            $this->sourceColumn = null;
+        }
+    }
+
+    /**
+     * Returns true if the number is unitless
+     *
+     * @return boolean
+     */
+    public function unitless()
+    {
+        return ! array_sum($this->units);
+    }
+
+    /**
+     * Returns unit(s) as the product of numerator units divided by the product of denominator units
+     *
+     * @return string
+     */
+    public function unitStr()
+    {
+        $numerators   = [];
+        $denominators = [];
+
+        foreach ($this->units as $unit => $unitSize) {
+            if ($unitSize > 0) {
+                $numerators = array_pad($numerators, count($numerators) + $unitSize, $unit);
+                continue;
+            }
+
+            if ($unitSize < 0) {
+                $denominators = array_pad($denominators, count($denominators) + $unitSize, $unit);
+                continue;
+            }
+        }
+
+        return implode('*', $numerators) . (count($denominators) ? '/' . implode('*', $denominators) : '');
+    }
+
+    /**
+     * Output number
+     *
+     * @param \Leafo\ScssPhp\Compiler $compiler
+     *
+     * @return string
+     */
+    public function output(Compiler $compiler = null)
+    {
+        $dimension = round($this->dimension, static::$precision);
+
+        $units = array_filter($this->units, function ($unitSize) {
+            return $unitSize;
+        });
+
+        if (count($units) > 1 && array_sum($units) === 0) {
+            $dimension = $this->dimension;
+            $units     = [];
+
+            $this->normalizeUnits($dimension, $units, 'in');
+
+            $dimension = round($dimension, static::$precision);
+            $units     = array_filter($units, function ($unitSize) {
+                return $unitSize;
+            });
+        }
+
+        $unitSize = array_sum($units);
+
+        if ($compiler && ($unitSize > 1 || $unitSize < 0 || count($units) > 1)) {
+            $compiler->throwError((string) $dimension . $this->unitStr() . " isn't a valid CSS value.");
+        }
+
+        reset($units);
+        $unit = key($units);
+
+        return (string) $dimension . $unit;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function __toString()
+    {
+        return $this->output();
+    }
+
+    /**
+     * Normalize units
+     *
+     * @param integer|float $dimension
+     * @param array         $units
+     * @param string        $baseUnit
+     */
+    private function normalizeUnits(&$dimension, &$units, $baseUnit = 'in')
+    {
+        $dimension = $this->dimension;
+        $units     = [];
+
+        foreach ($this->units as $unit => $exp) {
+            if (isset(static::$unitTable[$baseUnit][$unit])) {
+                $factor = pow(static::$unitTable[$baseUnit][$unit], $exp);
+
+                $unit = $baseUnit;
+                $dimension /= $factor;
+            }
+
+            $units[$unit] = $exp + (isset($units[$unit]) ? $units[$unit] : 0);
+        }
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Parser.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Parser.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Parser.php	(revision 7114)
@@ -0,0 +1,2487 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+use Leafo\ScssPhp\Block;
+use Leafo\ScssPhp\Compiler;
+use Leafo\ScssPhp\Exception\ParserException;
+use Leafo\ScssPhp\Node;
+use Leafo\ScssPhp\Type;
+
+/**
+ * Parser
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Parser
+{
+    const SOURCE_INDEX  = -1;
+    const SOURCE_LINE   = -2;
+    const SOURCE_COLUMN = -3;
+
+    /**
+     * @var array
+     */
+    protected static $precedence = [
+        '='   => 0,
+        'or'  => 1,
+        'and' => 2,
+        '=='  => 3,
+        '!='  => 3,
+        '<=>' => 3,
+        '<='  => 4,
+        '>='  => 4,
+        '<'   => 4,
+        '>'   => 4,
+        '+'   => 5,
+        '-'   => 5,
+        '*'   => 6,
+        '/'   => 6,
+        '%'   => 6,
+    ];
+
+    protected static $commentPattern;
+    protected static $operatorPattern;
+    protected static $whitePattern;
+
+    private $sourceName;
+    private $sourceIndex;
+    private $sourcePositions;
+    private $charset;
+    private $count;
+    private $env;
+    private $inParens;
+    private $eatWhiteDefault;
+    private $buffer;
+    private $utf8;
+    private $encoding;
+    private $patternModifiers;
+
+    /**
+     * Constructor
+     *
+     * @api
+     *
+     * @param string  $sourceName
+     * @param integer $sourceIndex
+     * @param string  $encoding
+     */
+    public function __construct($sourceName, $sourceIndex = 0, $encoding = 'utf-8')
+    {
+        $this->sourceName       = $sourceName ?: '(stdin)';
+        $this->sourceIndex      = $sourceIndex;
+        $this->charset          = null;
+        $this->utf8             = ! $encoding || strtolower($encoding) === 'utf-8';
+        $this->patternModifiers = $this->utf8 ? 'Aisu' : 'Ais';
+
+        if (empty(static::$operatorPattern)) {
+            static::$operatorPattern = '([*\/%+-]|[!=]\=|\>\=?|\<\=\>|\<\=?|and|or)';
+
+            $commentSingle      = '\/\/';
+            $commentMultiLeft   = '\/\*';
+            $commentMultiRight  = '\*\/';
+
+            static::$commentPattern = $commentMultiLeft . '.*?' . $commentMultiRight;
+            static::$whitePattern = $this->utf8
+                ? '/' . $commentSingle . '[^\n]*\s*|(' . static::$commentPattern . ')\s*|\s+/AisuS'
+                : '/' . $commentSingle . '[^\n]*\s*|(' . static::$commentPattern . ')\s*|\s+/AisS';
+        }
+    }
+
+    /**
+     * Get source file name
+     *
+     * @api
+     *
+     * @return string
+     */
+    public function getSourceName()
+    {
+        return $this->sourceName;
+    }
+
+    /**
+     * Throw parser error
+     *
+     * @api
+     *
+     * @param string $msg
+     *
+     * @throws \Leafo\ScssPhp\Exception\ParserException
+     */
+    public function throwParseError($msg = 'parse error')
+    {
+        list($line, /* $column */) = $this->getSourcePosition($this->count);
+
+        $loc = empty($this->sourceName) ? "line: $line" : "$this->sourceName on line $line";
+
+        if ($this->peek("(.*?)(\n|$)", $m, $this->count)) {
+            throw new ParserException("$msg: failed at `$m[1]` $loc");
+        }
+
+        throw new ParserException("$msg: $loc");
+    }
+
+    /**
+     * Parser buffer
+     *
+     * @api
+     *
+     * @param string $buffer
+     *
+     * @return \Leafo\ScssPhp\Block
+     */
+    public function parse($buffer)
+    {
+        // strip BOM (byte order marker)
+        if (substr($buffer, 0, 3) === "\xef\xbb\xbf") {
+            $buffer = substr($buffer, 3);
+        }
+
+        $this->buffer          = rtrim($buffer, "\x00..\x1f");
+        $this->count           = 0;
+        $this->env             = null;
+        $this->inParens        = false;
+        $this->eatWhiteDefault = true;
+
+        $this->saveEncoding();
+        $this->extractLineNumbers($buffer);
+
+        $this->pushBlock(null); // root block
+        $this->whitespace();
+        $this->pushBlock(null);
+        $this->popBlock();
+
+        while ($this->parseChunk()) {
+            ;
+        }
+
+        if ($this->count !== strlen($this->buffer)) {
+            $this->throwParseError();
+        }
+
+        if (! empty($this->env->parent)) {
+            $this->throwParseError('unclosed block');
+        }
+
+        if ($this->charset) {
+            array_unshift($this->env->children, $this->charset);
+        }
+
+        $this->env->isRoot    = true;
+
+        $this->restoreEncoding();
+
+        return $this->env;
+    }
+
+    /**
+     * Parse a value or value list
+     *
+     * @api
+     *
+     * @param string $buffer
+     * @param string $out
+     *
+     * @return boolean
+     */
+    public function parseValue($buffer, &$out)
+    {
+        $this->count           = 0;
+        $this->env             = null;
+        $this->inParens        = false;
+        $this->eatWhiteDefault = true;
+        $this->buffer          = (string) $buffer;
+
+        $this->saveEncoding();
+
+        $list = $this->valueList($out);
+
+        $this->restoreEncoding();
+
+        return $list;
+    }
+
+    /**
+     * Parse a selector or selector list
+     *
+     * @api
+     *
+     * @param string $buffer
+     * @param string $out
+     *
+     * @return boolean
+     */
+    public function parseSelector($buffer, &$out)
+    {
+        $this->count           = 0;
+        $this->env             = null;
+        $this->inParens        = false;
+        $this->eatWhiteDefault = true;
+        $this->buffer          = (string) $buffer;
+
+        $this->saveEncoding();
+
+        $selector = $this->selectors($out);
+
+        $this->restoreEncoding();
+
+        return $selector;
+    }
+
+    /**
+     * Parse a single chunk off the head of the buffer and append it to the
+     * current parse environment.
+     *
+     * Returns false when the buffer is empty, or when there is an error.
+     *
+     * This function is called repeatedly until the entire document is
+     * parsed.
+     *
+     * This parser is most similar to a recursive descent parser. Single
+     * functions represent discrete grammatical rules for the language, and
+     * they are able to capture the text that represents those rules.
+     *
+     * Consider the function Compiler::keyword(). (All parse functions are
+     * structured the same.)
+     *
+     * The function takes a single reference argument. When calling the
+     * function it will attempt to match a keyword on the head of the buffer.
+     * If it is successful, it will place the keyword in the referenced
+     * argument, advance the position in the buffer, and return true. If it
+     * fails then it won't advance the buffer and it will return false.
+     *
+     * All of these parse functions are powered by Compiler::match(), which behaves
+     * the same way, but takes a literal regular expression. Sometimes it is
+     * more convenient to use match instead of creating a new function.
+     *
+     * Because of the format of the functions, to parse an entire string of
+     * grammatical rules, you can chain them together using &&.
+     *
+     * But, if some of the rules in the chain succeed before one fails, then
+     * the buffer position will be left at an invalid state. In order to
+     * avoid this, Compiler::seek() is used to remember and set buffer positions.
+     *
+     * Before parsing a chain, use $s = $this->seek() to remember the current
+     * position into $s. Then if a chain fails, use $this->seek($s) to
+     * go back where we started.
+     *
+     * @return boolean
+     */
+    protected function parseChunk()
+    {
+        $s = $this->seek();
+
+        // the directives
+        if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] === '@') {
+            if ($this->literal('@at-root') &&
+                ($this->selectors($selector) || true) &&
+                ($this->map($with) || true) &&
+                $this->literal('{')
+            ) {
+                $atRoot = $this->pushSpecialBlock(Type::T_AT_ROOT, $s);
+                $atRoot->selector = $selector;
+                $atRoot->with = $with;
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@media') && $this->mediaQueryList($mediaQueryList) && $this->literal('{')) {
+                $media = $this->pushSpecialBlock(Type::T_MEDIA, $s);
+                $media->queryList = $mediaQueryList[2];
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@mixin') &&
+                $this->keyword($mixinName) &&
+                ($this->argumentDef($args) || true) &&
+                $this->literal('{')
+            ) {
+                $mixin = $this->pushSpecialBlock(Type::T_MIXIN, $s);
+                $mixin->name = $mixinName;
+                $mixin->args = $args;
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@include') &&
+                $this->keyword($mixinName) &&
+                ($this->literal('(') &&
+                    ($this->argValues($argValues) || true) &&
+                    $this->literal(')') || true) &&
+                ($this->end() ||
+                    $this->literal('{') && $hasBlock = true)
+            ) {
+                $child = [Type::T_INCLUDE, $mixinName, isset($argValues) ? $argValues : null, null];
+
+                if (! empty($hasBlock)) {
+                    $include = $this->pushSpecialBlock(Type::T_INCLUDE, $s);
+                    $include->child = $child;
+                } else {
+                    $this->append($child, $s);
+                }
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@scssphp-import-once') &&
+                $this->valueList($importPath) &&
+                $this->end()
+            ) {
+                $this->append([Type::T_SCSSPHP_IMPORT_ONCE, $importPath], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@import') &&
+                $this->valueList($importPath) &&
+                $this->end()
+            ) {
+                $this->append([Type::T_IMPORT, $importPath], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@import') &&
+                $this->url($importPath) &&
+                $this->end()
+            ) {
+                $this->append([Type::T_IMPORT, $importPath], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@extend') &&
+                $this->selectors($selectors) &&
+                $this->end()
+            ) {
+                // check for '!flag'
+                $optional = $this->stripOptionalFlag($selectors);
+                $this->append([Type::T_EXTEND, $selectors, $optional], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@function') &&
+                $this->keyword($fnName) &&
+                $this->argumentDef($args) &&
+                $this->literal('{')
+            ) {
+                $func = $this->pushSpecialBlock(Type::T_FUNCTION, $s);
+                $func->name = $fnName;
+                $func->args = $args;
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@break') && $this->end()) {
+                $this->append([Type::T_BREAK], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@continue') && $this->end()) {
+                $this->append([Type::T_CONTINUE], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+
+            if ($this->literal('@return') && ($this->valueList($retVal) || true) && $this->end()) {
+                $this->append([Type::T_RETURN, isset($retVal) ? $retVal : [Type::T_NULL]], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@each') &&
+                $this->genericList($varNames, 'variable', ',', false) &&
+                $this->literal('in') &&
+                $this->valueList($list) &&
+                $this->literal('{')
+            ) {
+                $each = $this->pushSpecialBlock(Type::T_EACH, $s);
+
+                foreach ($varNames[2] as $varName) {
+                    $each->vars[] = $varName[1];
+                }
+
+                $each->list = $list;
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@while') &&
+                $this->expression($cond) &&
+                $this->literal('{')
+            ) {
+                $while = $this->pushSpecialBlock(Type::T_WHILE, $s);
+                $while->cond = $cond;
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@for') &&
+                $this->variable($varName) &&
+                $this->literal('from') &&
+                $this->expression($start) &&
+                ($this->literal('through') ||
+                    ($forUntil = true && $this->literal('to'))) &&
+                $this->expression($end) &&
+                $this->literal('{')
+            ) {
+                $for = $this->pushSpecialBlock(Type::T_FOR, $s);
+                $for->var = $varName[1];
+                $for->start = $start;
+                $for->end = $end;
+                $for->until = isset($forUntil);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@if') && $this->valueList($cond) && $this->literal('{')) {
+                $if = $this->pushSpecialBlock(Type::T_IF, $s);
+                $if->cond = $cond;
+                $if->cases = [];
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@debug') &&
+                $this->valueList($value) &&
+                $this->end()
+            ) {
+                $this->append([Type::T_DEBUG, $value], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@warn') &&
+                $this->valueList($value) &&
+                $this->end()
+            ) {
+                $this->append([Type::T_WARN, $value], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@error') &&
+                $this->valueList($value) &&
+                $this->end()
+            ) {
+                $this->append([Type::T_ERROR, $value], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->literal('@content') && $this->end()) {
+                $this->append([Type::T_MIXIN_CONTENT], $s);
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            $last = $this->last();
+
+            if (isset($last) && $last[0] === Type::T_IF) {
+                list(, $if) = $last;
+
+                if ($this->literal('@else')) {
+                    if ($this->literal('{')) {
+                        $else = $this->pushSpecialBlock(Type::T_ELSE, $s);
+                    } elseif ($this->literal('if') && $this->valueList($cond) && $this->literal('{')) {
+                        $else = $this->pushSpecialBlock(Type::T_ELSEIF, $s);
+                        $else->cond = $cond;
+                    }
+
+                    if (isset($else)) {
+                        $else->dontAppend = true;
+                        $if->cases[] = $else;
+
+                        return true;
+                    }
+                }
+
+                $this->seek($s);
+            }
+
+            // only retain the first @charset directive encountered
+            if ($this->literal('@charset') &&
+                $this->valueList($charset) &&
+                $this->end()
+            ) {
+                if (! isset($this->charset)) {
+                    $statement = [Type::T_CHARSET, $charset];
+
+                    list($line, $column) = $this->getSourcePosition($s);
+
+                    $statement[static::SOURCE_LINE]   = $line;
+                    $statement[static::SOURCE_COLUMN] = $column;
+                    $statement[static::SOURCE_INDEX]  = $this->sourceIndex;
+
+                    $this->charset = $statement;
+                }
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            // doesn't match built in directive, do generic one
+            if ($this->literal('@', false) &&
+                $this->keyword($dirName) &&
+                ($this->variable($dirValue) || $this->openString('{', $dirValue) || true) &&
+                $this->literal('{')
+            ) {
+                if ($dirName === 'media') {
+                    $directive = $this->pushSpecialBlock(Type::T_MEDIA, $s);
+                } else {
+                    $directive = $this->pushSpecialBlock(Type::T_DIRECTIVE, $s);
+                    $directive->name = $dirName;
+                }
+
+                if (isset($dirValue)) {
+                    $directive->value = $dirValue;
+                }
+
+                return true;
+            }
+
+            $this->seek($s);
+
+            return false;
+        }
+
+        // property shortcut
+        // captures most properties before having to parse a selector
+        if ($this->keyword($name, false) &&
+            $this->literal(': ') &&
+            $this->valueList($value) &&
+            $this->end()
+        ) {
+            $name = [Type::T_STRING, '', [$name]];
+            $this->append([Type::T_ASSIGN, $name, $value], $s);
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        // variable assigns
+        if ($this->variable($name) &&
+            $this->literal(':') &&
+            $this->valueList($value) &&
+            $this->end()
+        ) {
+            // check for '!flag'
+            $assignmentFlags = $this->stripAssignmentFlags($value);
+            $this->append([Type::T_ASSIGN, $name, $value, $assignmentFlags], $s);
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        // misc
+        if ($this->literal('-->')) {
+            return true;
+        }
+
+        // opening css block
+        if ($this->selectors($selectors) && $this->literal('{')) {
+            $this->pushBlock($selectors, $s);
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        // property assign, or nested assign
+        if ($this->propertyName($name) && $this->literal(':')) {
+            $foundSomething = false;
+
+            if ($this->valueList($value)) {
+                $this->append([Type::T_ASSIGN, $name, $value], $s);
+                $foundSomething = true;
+            }
+
+            if ($this->literal('{')) {
+                $propBlock = $this->pushSpecialBlock(Type::T_NESTED_PROPERTY, $s);
+                $propBlock->prefix = $name;
+                $foundSomething = true;
+            } elseif ($foundSomething) {
+                $foundSomething = $this->end();
+            }
+
+            if ($foundSomething) {
+                return true;
+            }
+        }
+
+        $this->seek($s);
+
+        // closing a block
+        if ($this->literal('}')) {
+            $block = $this->popBlock();
+
+            if (isset($block->type) && $block->type === Type::T_INCLUDE) {
+                $include = $block->child;
+                unset($block->child);
+                $include[3] = $block;
+                $this->append($include, $s);
+            } elseif (empty($block->dontAppend)) {
+                $type = isset($block->type) ? $block->type : Type::T_BLOCK;
+                $this->append([$type, $block], $s);
+            }
+
+            return true;
+        }
+
+        // extra stuff
+        if ($this->literal(';') ||
+            $this->literal('<!--')
+        ) {
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Push block onto parse tree
+     *
+     * @param array   $selectors
+     * @param integer $pos
+     *
+     * @return \Leafo\ScssPhp\Block
+     */
+    protected function pushBlock($selectors, $pos = 0)
+    {
+        list($line, $column) = $this->getSourcePosition($pos);
+
+        $b = new Block;
+        $b->sourceLine   = $line;
+        $b->sourceColumn = $column;
+        $b->sourceIndex  = $this->sourceIndex;
+        $b->selectors    = $selectors;
+        $b->comments     = [];
+        $b->parent       = $this->env;
+
+        if (! $this->env) {
+            $b->children = [];
+        } elseif (empty($this->env->children)) {
+            $this->env->children = $this->env->comments;
+            $b->children = [];
+            $this->env->comments = [];
+        } else {
+            $b->children = $this->env->comments;
+            $this->env->comments = [];
+        }
+
+        $this->env = $b;
+
+        return $b;
+    }
+
+    /**
+     * Push special (named) block onto parse tree
+     *
+     * @param string  $type
+     * @param integer $pos
+     *
+     * @return \Leafo\ScssPhp\Block
+     */
+    protected function pushSpecialBlock($type, $pos)
+    {
+        $block = $this->pushBlock(null, $pos);
+        $block->type = $type;
+
+        return $block;
+    }
+
+    /**
+     * Pop scope and return last block
+     *
+     * @return \Leafo\ScssPhp\Block
+     *
+     * @throws \Exception
+     */
+    protected function popBlock()
+    {
+        $block = $this->env;
+
+        if (empty($block->parent)) {
+            $this->throwParseError('unexpected }');
+        }
+
+        $this->env = $block->parent;
+        unset($block->parent);
+
+        $comments = $block->comments;
+        if (count($comments)) {
+            $this->env->comments = $comments;
+            unset($block->comments);
+        }
+
+        return $block;
+    }
+
+    /**
+     * Peek input stream
+     *
+     * @param string  $regex
+     * @param array   $out
+     * @param integer $from
+     *
+     * @return integer
+     */
+    protected function peek($regex, &$out, $from = null)
+    {
+        if (! isset($from)) {
+            $from = $this->count;
+        }
+
+        $r = '/' . $regex . '/' . $this->patternModifiers;
+        $result = preg_match($r, $this->buffer, $out, null, $from);
+
+        return $result;
+    }
+
+    /**
+     * Seek to position in input stream (or return current position in input stream)
+     *
+     * @param integer $where
+     *
+     * @return integer
+     */
+    protected function seek($where = null)
+    {
+        if ($where === null) {
+            return $this->count;
+        }
+
+        $this->count = $where;
+
+        return true;
+    }
+
+    /**
+     * Match string looking for either ending delim, escape, or string interpolation
+     *
+     * {@internal This is a workaround for preg_match's 250K string match limit. }}
+     *
+     * @param array  $m     Matches (passed by reference)
+     * @param string $delim Delimeter
+     *
+     * @return boolean True if match; false otherwise
+     */
+    protected function matchString(&$m, $delim)
+    {
+        $token = null;
+
+        $end = strlen($this->buffer);
+
+        // look for either ending delim, escape, or string interpolation
+        foreach (['#{', '\\', $delim] as $lookahead) {
+            $pos = strpos($this->buffer, $lookahead, $this->count);
+
+            if ($pos !== false && $pos < $end) {
+                $end = $pos;
+                $token = $lookahead;
+            }
+        }
+
+        if (! isset($token)) {
+            return false;
+        }
+
+        $match = substr($this->buffer, $this->count, $end - $this->count);
+        $m = [
+            $match . $token,
+            $match,
+            $token
+        ];
+        $this->count = $end + strlen($token);
+
+        return true;
+    }
+
+    /**
+     * Try to match something on head of buffer
+     *
+     * @param string  $regex
+     * @param array   $out
+     * @param boolean $eatWhitespace
+     *
+     * @return boolean
+     */
+    protected function match($regex, &$out, $eatWhitespace = null)
+    {
+        if (! isset($eatWhitespace)) {
+            $eatWhitespace = $this->eatWhiteDefault;
+        }
+
+        $r = '/' . $regex . '/' . $this->patternModifiers;
+
+        if (preg_match($r, $this->buffer, $out, null, $this->count)) {
+            $this->count += strlen($out[0]);
+
+            if ($eatWhitespace) {
+                $this->whitespace();
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Match literal string
+     *
+     * @param string  $what
+     * @param boolean $eatWhitespace
+     *
+     * @return boolean
+     */
+    protected function literal($what, $eatWhitespace = null)
+    {
+        if (! isset($eatWhitespace)) {
+            $eatWhitespace = $this->eatWhiteDefault;
+        }
+
+        $len = strlen($what);
+
+        if (strcasecmp(substr($this->buffer, $this->count, $len), $what) === 0) {
+            $this->count += $len;
+
+            if ($eatWhitespace) {
+                $this->whitespace();
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Match some whitespace
+     *
+     * @return boolean
+     */
+    protected function whitespace()
+    {
+        $gotWhite = false;
+
+        while (preg_match(static::$whitePattern, $this->buffer, $m, null, $this->count)) {
+            if (isset($m[1]) && empty($this->commentsSeen[$this->count])) {
+                $this->appendComment([Type::T_COMMENT, $m[1]]);
+
+                $this->commentsSeen[$this->count] = true;
+            }
+
+            $this->count += strlen($m[0]);
+            $gotWhite = true;
+        }
+
+        return $gotWhite;
+    }
+
+    /**
+     * Append comment to current block
+     *
+     * @param array $comment
+     */
+    protected function appendComment($comment)
+    {
+        $comment[1] = substr(preg_replace(['/^\s+/m', '/^(.)/m'], ['', ' \1'], $comment[1]), 1);
+
+        $this->env->comments[] = $comment;
+    }
+
+    /**
+     * Append statement to current block
+     *
+     * @param array   $statement
+     * @param integer $pos
+     */
+    protected function append($statement, $pos = null)
+    {
+        if ($pos !== null) {
+            list($line, $column) = $this->getSourcePosition($pos);
+
+            $statement[static::SOURCE_LINE]   = $line;
+            $statement[static::SOURCE_COLUMN] = $column;
+            $statement[static::SOURCE_INDEX]  = $this->sourceIndex;
+        }
+
+        $this->env->children[] = $statement;
+
+        $comments = $this->env->comments;
+
+        if (count($comments)) {
+            $this->env->children = array_merge($this->env->children, $comments);
+            $this->env->comments = [];
+        }
+    }
+
+    /**
+     * Returns last child was appended
+     *
+     * @return array|null
+     */
+    protected function last()
+    {
+        $i = count($this->env->children) - 1;
+
+        if (isset($this->env->children[$i])) {
+            return $this->env->children[$i];
+        }
+    }
+
+    /**
+     * Parse media query list
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function mediaQueryList(&$out)
+    {
+        return $this->genericList($out, 'mediaQuery', ',', false);
+    }
+
+    /**
+     * Parse media query
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function mediaQuery(&$out)
+    {
+        $expressions = null;
+        $parts = [];
+
+        if (($this->literal('only') && ($only = true) || $this->literal('not') && ($not = true) || true) &&
+            $this->mixedKeyword($mediaType)
+        ) {
+            $prop = [Type::T_MEDIA_TYPE];
+
+            if (isset($only)) {
+                $prop[] = [Type::T_KEYWORD, 'only'];
+            }
+
+            if (isset($not)) {
+                $prop[] = [Type::T_KEYWORD, 'not'];
+            }
+
+            $media = [Type::T_LIST, '', []];
+
+            foreach ((array) $mediaType as $type) {
+                if (is_array($type)) {
+                    $media[2][] = $type;
+                } else {
+                    $media[2][] = [Type::T_KEYWORD, $type];
+                }
+            }
+
+            $prop[]  = $media;
+            $parts[] = $prop;
+        }
+
+        if (empty($parts) || $this->literal('and')) {
+            $this->genericList($expressions, 'mediaExpression', 'and', false);
+
+            if (is_array($expressions)) {
+                $parts = array_merge($parts, $expressions[2]);
+            }
+        }
+
+        $out = $parts;
+
+        return true;
+    }
+
+    /**
+     * Parse media expression
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function mediaExpression(&$out)
+    {
+        $s = $this->seek();
+        $value = null;
+
+        if ($this->literal('(') &&
+            $this->expression($feature) &&
+            ($this->literal(':') && $this->expression($value) || true) &&
+            $this->literal(')')
+        ) {
+            $out = [Type::T_MEDIA_EXPRESSION, $feature];
+
+            if ($value) {
+                $out[] = $value;
+            }
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        return false;
+    }
+
+    /**
+     * Parse argument values
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function argValues(&$out)
+    {
+        if ($this->genericList($list, 'argValue', ',', false)) {
+            $out = $list[2];
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Parse argument value
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function argValue(&$out)
+    {
+        $s = $this->seek();
+
+        $keyword = null;
+
+        if (! $this->variable($keyword) || ! $this->literal(':')) {
+            $this->seek($s);
+            $keyword = null;
+        }
+
+        if ($this->genericList($value, 'expression')) {
+            $out = [$keyword, $value, false];
+            $s = $this->seek();
+
+            if ($this->literal('...')) {
+                $out[2] = true;
+            } else {
+                $this->seek($s);
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Parse comma separated value list
+     *
+     * @param string $out
+     *
+     * @return boolean
+     */
+    protected function valueList(&$out)
+    {
+        return $this->genericList($out, 'spaceList', ',');
+    }
+
+    /**
+     * Parse space separated value list
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function spaceList(&$out)
+    {
+        return $this->genericList($out, 'expression');
+    }
+
+    /**
+     * Parse generic list
+     *
+     * @param array    $out
+     * @param callable $parseItem
+     * @param string   $delim
+     * @param boolean  $flatten
+     *
+     * @return boolean
+     */
+    protected function genericList(&$out, $parseItem, $delim = '', $flatten = true)
+    {
+        $s = $this->seek();
+        $items = [];
+
+        while ($this->$parseItem($value)) {
+            $items[] = $value;
+
+            if ($delim) {
+                if (! $this->literal($delim)) {
+                    break;
+                }
+            }
+        }
+
+        if (count($items) === 0) {
+            $this->seek($s);
+
+            return false;
+        }
+
+        if ($flatten && count($items) === 1) {
+            $out = $items[0];
+        } else {
+            $out = [Type::T_LIST, $delim, $items];
+        }
+
+        return true;
+    }
+
+    /**
+     * Parse expression
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function expression(&$out)
+    {
+        $s = $this->seek();
+
+        if ($this->literal('(')) {
+            if ($this->literal(')')) {
+                $out = [Type::T_LIST, '', []];
+
+                return true;
+            }
+
+            if ($this->valueList($out) && $this->literal(')') && $out[0] === Type::T_LIST) {
+                return true;
+            }
+
+            $this->seek($s);
+
+            if ($this->map($out)) {
+                return true;
+            }
+
+            $this->seek($s);
+        }
+
+        if ($this->value($lhs)) {
+            $out = $this->expHelper($lhs, 0);
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Parse left-hand side of subexpression
+     *
+     * @param array   $lhs
+     * @param integer $minP
+     *
+     * @return array
+     */
+    protected function expHelper($lhs, $minP)
+    {
+        $operators = static::$operatorPattern;
+
+        $ss = $this->seek();
+        $whiteBefore = isset($this->buffer[$this->count - 1]) &&
+            ctype_space($this->buffer[$this->count - 1]);
+
+        while ($this->match($operators, $m, false) && static::$precedence[$m[1]] >= $minP) {
+            $whiteAfter = isset($this->buffer[$this->count]) &&
+                ctype_space($this->buffer[$this->count]);
+            $varAfter = isset($this->buffer[$this->count]) &&
+                $this->buffer[$this->count] === '$';
+
+            $this->whitespace();
+
+            $op = $m[1];
+
+            // don't turn negative numbers into expressions
+            if ($op === '-' && $whiteBefore && ! $whiteAfter && ! $varAfter) {
+                break;
+            }
+
+            if (! $this->value($rhs)) {
+                break;
+            }
+
+            // peek and see if rhs belongs to next operator
+            if ($this->peek($operators, $next) && static::$precedence[$next[1]] > static::$precedence[$op]) {
+                $rhs = $this->expHelper($rhs, static::$precedence[$next[1]]);
+            }
+
+            $lhs = [Type::T_EXPRESSION, $op, $lhs, $rhs, $this->inParens, $whiteBefore, $whiteAfter];
+            $ss = $this->seek();
+            $whiteBefore = isset($this->buffer[$this->count - 1]) &&
+                ctype_space($this->buffer[$this->count - 1]);
+        }
+
+        $this->seek($ss);
+
+        return $lhs;
+    }
+
+    /**
+     * Parse value
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function value(&$out)
+    {
+        $s = $this->seek();
+
+        if ($this->literal('not', false) && $this->whitespace() && $this->value($inner)) {
+            $out = [Type::T_UNARY, 'not', $inner, $this->inParens];
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        if ($this->literal('not', false) && $this->parenValue($inner)) {
+            $out = [Type::T_UNARY, 'not', $inner, $this->inParens];
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        if ($this->literal('+') && $this->value($inner)) {
+            $out = [Type::T_UNARY, '+', $inner, $this->inParens];
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        // negation
+        if ($this->literal('-', false) &&
+            ($this->variable($inner) ||
+            $this->unit($inner) ||
+            $this->parenValue($inner))
+        ) {
+            $out = [Type::T_UNARY, '-', $inner, $this->inParens];
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        if ($this->parenValue($out) ||
+            $this->interpolation($out) ||
+            $this->variable($out) ||
+            $this->color($out) ||
+            $this->unit($out) ||
+            $this->string($out) ||
+            $this->func($out) ||
+            $this->progid($out)
+        ) {
+            return true;
+        }
+
+        if ($this->keyword($keyword)) {
+            if ($keyword === 'null') {
+                $out = [Type::T_NULL];
+            } else {
+                $out = [Type::T_KEYWORD, $keyword];
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Parse parenthesized value
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function parenValue(&$out)
+    {
+        $s = $this->seek();
+
+        $inParens = $this->inParens;
+
+        if ($this->literal('(')) {
+            if ($this->literal(')')) {
+                $out = [Type::T_LIST, '', []];
+
+                return true;
+            }
+
+            $this->inParens = true;
+
+            if ($this->expression($exp) && $this->literal(')')) {
+                $out = $exp;
+                $this->inParens = $inParens;
+
+                return true;
+            }
+        }
+
+        $this->inParens = $inParens;
+        $this->seek($s);
+
+        return false;
+    }
+
+    /**
+     * Parse "progid:"
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function progid(&$out)
+    {
+        $s = $this->seek();
+
+        if ($this->literal('progid:', false) &&
+            $this->openString('(', $fn) &&
+            $this->literal('(')
+        ) {
+            $this->openString(')', $args, '(');
+
+            if ($this->literal(')')) {
+                $out = [Type::T_STRING, '', [
+                    'progid:', $fn, '(', $args, ')'
+                ]];
+
+                return true;
+            }
+        }
+
+        $this->seek($s);
+
+        return false;
+    }
+
+    /**
+     * Parse function call
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function func(&$func)
+    {
+        $s = $this->seek();
+
+        if ($this->keyword($name, false) &&
+            $this->literal('(')
+        ) {
+            if ($name === 'alpha' && $this->argumentList($args)) {
+                $func = [Type::T_FUNCTION, $name, [Type::T_STRING, '', $args]];
+
+                return true;
+            }
+
+            if ($name !== 'expression' && ! preg_match('/^(-[a-z]+-)?calc$/', $name)) {
+                $ss = $this->seek();
+
+                if ($this->argValues($args) && $this->literal(')')) {
+                    $func = [Type::T_FUNCTION_CALL, $name, $args];
+
+                    return true;
+                }
+
+                $this->seek($ss);
+            }
+
+            if (($this->openString(')', $str, '(') || true) &&
+                $this->literal(')')
+            ) {
+                $args = [];
+
+                if (! empty($str)) {
+                    $args[] = [null, [Type::T_STRING, '', [$str]]];
+                }
+
+                $func = [Type::T_FUNCTION_CALL, $name, $args];
+
+                return true;
+            }
+        }
+
+        $this->seek($s);
+
+        return false;
+    }
+
+    /**
+     * Parse function call argument list
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function argumentList(&$out)
+    {
+        $s = $this->seek();
+        $this->literal('(');
+
+        $args = [];
+
+        while ($this->keyword($var)) {
+            if ($this->literal('=') && $this->expression($exp)) {
+                $args[] = [Type::T_STRING, '', [$var . '=']];
+                $arg = $exp;
+            } else {
+                break;
+            }
+
+            $args[] = $arg;
+
+            if (! $this->literal(',')) {
+                break;
+            }
+
+            $args[] = [Type::T_STRING, '', [', ']];
+        }
+
+        if (! $this->literal(')') || ! count($args)) {
+            $this->seek($s);
+
+            return false;
+        }
+
+        $out = $args;
+
+        return true;
+    }
+
+    /**
+     * Parse mixin/function definition  argument list
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function argumentDef(&$out)
+    {
+        $s = $this->seek();
+        $this->literal('(');
+
+        $args = [];
+
+        while ($this->variable($var)) {
+            $arg = [$var[1], null, false];
+
+            $ss = $this->seek();
+
+            if ($this->literal(':') && $this->genericList($defaultVal, 'expression')) {
+                $arg[1] = $defaultVal;
+            } else {
+                $this->seek($ss);
+            }
+
+            $ss = $this->seek();
+
+            if ($this->literal('...')) {
+                $sss = $this->seek();
+
+                if (! $this->literal(')')) {
+                    $this->throwParseError('... has to be after the final argument');
+                }
+
+                $arg[2] = true;
+                $this->seek($sss);
+            } else {
+                $this->seek($ss);
+            }
+
+            $args[] = $arg;
+
+            if (! $this->literal(',')) {
+                break;
+            }
+        }
+
+        if (! $this->literal(')')) {
+            $this->seek($s);
+
+            return false;
+        }
+
+        $out = $args;
+
+        return true;
+    }
+
+    /**
+     * Parse map
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function map(&$out)
+    {
+        $s = $this->seek();
+
+        if (! $this->literal('(')) {
+            return false;
+        }
+
+        $keys = [];
+        $values = [];
+
+        while ($this->genericList($key, 'expression') && $this->literal(':') &&
+            $this->genericList($value, 'expression')
+        ) {
+            $keys[] = $key;
+            $values[] = $value;
+
+            if (! $this->literal(',')) {
+                break;
+            }
+        }
+
+        if (! count($keys) || ! $this->literal(')')) {
+            $this->seek($s);
+
+            return false;
+        }
+
+        $out = [Type::T_MAP, $keys, $values];
+
+        return true;
+    }
+
+    /**
+     * Parse color
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function color(&$out)
+    {
+        $color = [Type::T_COLOR];
+
+        if ($this->match('(#([0-9a-f]{6})|#([0-9a-f]{3}))', $m)) {
+            if (isset($m[3])) {
+                $num = hexdec($m[3]);
+
+                foreach ([3, 2, 1] as $i) {
+                    $t = $num & 0xf;
+                    $color[$i] = $t << 4 | $t;
+                    $num >>= 4;
+                }
+            } else {
+                $num = hexdec($m[2]);
+
+                foreach ([3, 2, 1] as $i) {
+                    $color[$i] = $num & 0xff;
+                    $num >>= 8;
+                }
+            }
+
+            $out = $color;
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Parse number with unit
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function unit(&$unit)
+    {
+        if ($this->match('([0-9]*(\.)?[0-9]+)([%a-zA-Z]+)?', $m)) {
+            $unit = new Node\Number($m[1], empty($m[3]) ? '' : $m[3]);
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Parse string
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function string(&$out)
+    {
+        $s = $this->seek();
+
+        if ($this->literal('"', false)) {
+            $delim = '"';
+        } elseif ($this->literal("'", false)) {
+            $delim = "'";
+        } else {
+            return false;
+        }
+
+        $content = [];
+        $oldWhite = $this->eatWhiteDefault;
+        $this->eatWhiteDefault = false;
+        $hasInterpolation = false;
+
+        while ($this->matchString($m, $delim)) {
+            if ($m[1] !== '') {
+                $content[] = $m[1];
+            }
+
+            if ($m[2] === '#{') {
+                $this->count -= strlen($m[2]);
+
+                if ($this->interpolation($inter, false)) {
+                    $content[] = $inter;
+                    $hasInterpolation = true;
+                } else {
+                    $this->count += strlen($m[2]);
+                    $content[] = '#{'; // ignore it
+                }
+            } elseif ($m[2] === '\\') {
+                if ($this->literal('"', false)) {
+                    $content[] = $m[2] . '"';
+                } elseif ($this->literal("'", false)) {
+                    $content[] = $m[2] . "'";
+                } else {
+                    $content[] = $m[2];
+                }
+            } else {
+                $this->count -= strlen($delim);
+                break; // delim
+            }
+        }
+
+        $this->eatWhiteDefault = $oldWhite;
+
+        if ($this->literal($delim)) {
+            if ($hasInterpolation) {
+                $delim = '"';
+
+                foreach ($content as &$string) {
+                    if ($string === "\\'") {
+                        $string = "'";
+                    } elseif ($string === '\\"') {
+                        $string = '"';
+                    }
+                }
+            }
+
+            $out = [Type::T_STRING, $delim, $content];
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        return false;
+    }
+
+    /**
+     * Parse keyword or interpolation
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function mixedKeyword(&$out)
+    {
+        $parts = [];
+
+        $oldWhite = $this->eatWhiteDefault;
+        $this->eatWhiteDefault = false;
+
+        for (;;) {
+            if ($this->keyword($key)) {
+                $parts[] = $key;
+                continue;
+            }
+
+            if ($this->interpolation($inter)) {
+                $parts[] = $inter;
+                continue;
+            }
+
+            break;
+        }
+
+        $this->eatWhiteDefault = $oldWhite;
+
+        if (count($parts) === 0) {
+            return false;
+        }
+
+        if ($this->eatWhiteDefault) {
+            $this->whitespace();
+        }
+
+        $out = $parts;
+
+        return true;
+    }
+
+    /**
+     * Parse an unbounded string stopped by $end
+     *
+     * @param string $end
+     * @param array  $out
+     * @param string $nestingOpen
+     *
+     * @return boolean
+     */
+    protected function openString($end, &$out, $nestingOpen = null)
+    {
+        $oldWhite = $this->eatWhiteDefault;
+        $this->eatWhiteDefault = false;
+
+        $patt = '(.*?)([\'"]|#\{|' . $this->pregQuote($end) . '|' . static::$commentPattern . ')';
+
+        $nestingLevel = 0;
+
+        $content = [];
+
+        while ($this->match($patt, $m, false)) {
+            if (isset($m[1]) && $m[1] !== '') {
+                $content[] = $m[1];
+
+                if ($nestingOpen) {
+                    $nestingLevel += substr_count($m[1], $nestingOpen);
+                }
+            }
+
+            $tok = $m[2];
+
+            $this->count-= strlen($tok);
+
+            if ($tok === $end && ! $nestingLevel--) {
+                break;
+            }
+
+            if (($tok === "'" || $tok === '"') && $this->string($str)) {
+                $content[] = $str;
+                continue;
+            }
+
+            if ($tok === '#{' && $this->interpolation($inter)) {
+                $content[] = $inter;
+                continue;
+            }
+
+            $content[] = $tok;
+            $this->count+= strlen($tok);
+        }
+
+        $this->eatWhiteDefault = $oldWhite;
+
+        if (count($content) === 0) {
+            return false;
+        }
+
+        // trim the end
+        if (is_string(end($content))) {
+            $content[count($content) - 1] = rtrim(end($content));
+        }
+
+        $out = [Type::T_STRING, '', $content];
+
+        return true;
+    }
+
+    /**
+     * Parser interpolation
+     *
+     * @param array   $out
+     * @param boolean $lookWhite save information about whitespace before and after
+     *
+     * @return boolean
+     */
+    protected function interpolation(&$out, $lookWhite = true)
+    {
+        $oldWhite = $this->eatWhiteDefault;
+        $this->eatWhiteDefault = true;
+
+        $s = $this->seek();
+
+        if ($this->literal('#{') && $this->valueList($value) && $this->literal('}', false)) {
+            if ($lookWhite) {
+                $left = preg_match('/\s/', $this->buffer[$s - 1]) ? ' ' : '';
+                $right = preg_match('/\s/', $this->buffer[$this->count]) ? ' ': '';
+            } else {
+                $left = $right = false;
+            }
+
+            $out = [Type::T_INTERPOLATE, $value, $left, $right];
+            $this->eatWhiteDefault = $oldWhite;
+
+            if ($this->eatWhiteDefault) {
+                $this->whitespace();
+            }
+
+            return true;
+        }
+
+        $this->seek($s);
+        $this->eatWhiteDefault = $oldWhite;
+
+        return false;
+    }
+
+    /**
+     * Parse property name (as an array of parts or a string)
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function propertyName(&$out)
+    {
+        $parts = [];
+
+        $oldWhite = $this->eatWhiteDefault;
+        $this->eatWhiteDefault = false;
+
+        for (;;) {
+            if ($this->interpolation($inter)) {
+                $parts[] = $inter;
+                continue;
+            }
+
+            if ($this->keyword($text)) {
+                $parts[] = $text;
+                continue;
+            }
+
+            if (count($parts) === 0 && $this->match('[:.#]', $m, false)) {
+                // css hacks
+                $parts[] = $m[0];
+                continue;
+            }
+
+            break;
+        }
+
+        $this->eatWhiteDefault = $oldWhite;
+
+        if (count($parts) === 0) {
+            return false;
+        }
+
+        // match comment hack
+        if (preg_match(
+            static::$whitePattern,
+            $this->buffer,
+            $m,
+            null,
+            $this->count
+        )) {
+            if (! empty($m[0])) {
+                $parts[] = $m[0];
+                $this->count += strlen($m[0]);
+            }
+        }
+
+        $this->whitespace(); // get any extra whitespace
+
+        $out = [Type::T_STRING, '', $parts];
+
+        return true;
+    }
+
+    /**
+     * Parse comma separated selector list
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function selectors(&$out)
+    {
+        $s = $this->seek();
+        $selectors = [];
+
+        while ($this->selector($sel)) {
+            $selectors[] = $sel;
+
+            if (! $this->literal(',')) {
+                break;
+            }
+
+            while ($this->literal(',')) {
+                ; // ignore extra
+            }
+        }
+
+        if (count($selectors) === 0) {
+            $this->seek($s);
+
+            return false;
+        }
+
+        $out = $selectors;
+
+        return true;
+    }
+
+    /**
+     * Parse whitespace separated selector list
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function selector(&$out)
+    {
+        $selector = [];
+
+        for (;;) {
+            if ($this->match('[>+~]+', $m)) {
+                $selector[] = [$m[0]];
+                continue;
+            }
+
+            if ($this->selectorSingle($part)) {
+                $selector[] = $part;
+                $this->match('\s+', $m);
+                continue;
+            }
+
+            if ($this->match('\/[^\/]+\/', $m)) {
+                $selector[] = [$m[0]];
+                continue;
+            }
+
+            break;
+        }
+
+        if (count($selector) === 0) {
+            return false;
+        }
+
+        $out = $selector;
+        return true;
+    }
+
+    /**
+     * Parse the parts that make up a selector
+     *
+     * {@internal
+     *     div[yes=no]#something.hello.world:nth-child(-2n+1)%placeholder
+     * }}
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function selectorSingle(&$out)
+    {
+        $oldWhite = $this->eatWhiteDefault;
+        $this->eatWhiteDefault = false;
+
+        $parts = [];
+
+        if ($this->literal('*', false)) {
+            $parts[] = '*';
+        }
+
+        for (;;) {
+            // see if we can stop early
+            if ($this->match('\s*[{,]', $m)) {
+                $this->count--;
+                break;
+            }
+
+            $s = $this->seek();
+
+            // self
+            if ($this->literal('&', false)) {
+                $parts[] = Compiler::$selfSelector;
+                continue;
+            }
+
+            if ($this->literal('.', false)) {
+                $parts[] = '.';
+                continue;
+            }
+
+            if ($this->literal('|', false)) {
+                $parts[] = '|';
+                continue;
+            }
+
+            if ($this->match('\\\\\S', $m)) {
+                $parts[] = $m[0];
+                continue;
+            }
+
+            // for keyframes
+            if ($this->unit($unit)) {
+                $parts[] = $unit;
+                continue;
+            }
+
+            if ($this->keyword($name)) {
+                $parts[] = $name;
+                continue;
+            }
+
+            if ($this->interpolation($inter)) {
+                $parts[] = $inter;
+                continue;
+            }
+
+            if ($this->literal('%', false) && $this->placeholder($placeholder)) {
+                $parts[] = '%';
+                $parts[] = $placeholder;
+                continue;
+            }
+
+            if ($this->literal('#', false)) {
+                $parts[] = '#';
+                continue;
+            }
+
+            // a pseudo selector
+            if ($this->match('::?', $m) && $this->mixedKeyword($nameParts)) {
+                $parts[] = $m[0];
+
+                foreach ($nameParts as $sub) {
+                    $parts[] = $sub;
+                }
+
+                $ss = $this->seek();
+
+                if ($this->literal('(') &&
+                    ($this->openString(')', $str, '(') || true) &&
+                    $this->literal(')')
+                ) {
+                    $parts[] = '(';
+
+                    if (! empty($str)) {
+                        $parts[] = $str;
+                    }
+
+                    $parts[] = ')';
+                } else {
+                    $this->seek($ss);
+                }
+
+                continue;
+            }
+
+            $this->seek($s);
+
+            // attribute selector
+            if ($this->literal('[') &&
+               ($this->openString(']', $str, '[') || true) &&
+               $this->literal(']')
+            ) {
+                $parts[] = '[';
+
+                if (! empty($str)) {
+                    $parts[] = $str;
+                }
+
+                $parts[] = ']';
+
+                continue;
+            }
+
+            $this->seek($s);
+
+            break;
+        }
+
+        $this->eatWhiteDefault = $oldWhite;
+
+        if (count($parts) === 0) {
+            return false;
+        }
+
+        $out = $parts;
+
+        return true;
+    }
+
+    /**
+     * Parse a variable
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function variable(&$out)
+    {
+        $s = $this->seek();
+
+        if ($this->literal('$', false) && $this->keyword($name)) {
+            $out = [Type::T_VARIABLE, $name];
+
+            return true;
+        }
+
+        $this->seek($s);
+
+        return false;
+    }
+
+    /**
+     * Parse a keyword
+     *
+     * @param string  $word
+     * @param boolean $eatWhitespace
+     *
+     * @return boolean
+     */
+    protected function keyword(&$word, $eatWhitespace = null)
+    {
+        if ($this->match(
+            $this->utf8
+                ? '(([\pL\w_\-\*!"\']|[\\\\].)([\pL\w\-_"\']|[\\\\].)*)'
+                : '(([\w_\-\*!"\']|[\\\\].)([\w\-_"\']|[\\\\].)*)',
+            $m,
+            $eatWhitespace
+        )) {
+            $word = $m[1];
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Parse a placeholder
+     *
+     * @param string $placeholder
+     *
+     * @return boolean
+     */
+    protected function placeholder(&$placeholder)
+    {
+        if ($this->match(
+            $this->utf8
+                ? '([\pL\w\-_]+|#[{][$][\pL\w\-_]+[}])'
+                : '([\w\-_]+|#[{][$][\w\-_]+[}])',
+            $m
+        )) {
+            $placeholder = $m[1];
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Parse a url
+     *
+     * @param array $out
+     *
+     * @return boolean
+     */
+    protected function url(&$out)
+    {
+        if ($this->match('(url\(\s*(["\']?)([^)]+)\2\s*\))', $m)) {
+            $out = [Type::T_STRING, '', ['url(' . $m[2] . $m[3] . $m[2] . ')']];
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Consume an end of statement delimiter
+     *
+     * @return boolean
+     */
+    protected function end()
+    {
+        if ($this->literal(';')) {
+            return true;
+        }
+
+        if ($this->count === strlen($this->buffer) || $this->buffer[$this->count] === '}') {
+            // if there is end of file or a closing block next then we don't need a ;
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Strip assignment flag from the list
+     *
+     * @param array $value
+     *
+     * @return array
+     */
+    protected function stripAssignmentFlags(&$value)
+    {
+        $flags = [];
+
+        for ($token = &$value; $token[0] === Type::T_LIST && ($s = count($token[2])); $token = &$lastNode) {
+            $lastNode = &$token[2][$s - 1];
+
+            while ($lastNode[0] === Type::T_KEYWORD && in_array($lastNode[1], ['!default', '!global'])) {
+                array_pop($token[2]);
+
+                $node = end($token[2]);
+
+                $token = $this->flattenList($token);
+
+                $flags[] = $lastNode[1];
+
+                $lastNode = $node;
+            }
+        }
+
+        return $flags;
+    }
+
+    /**
+     * Strip optional flag from selector list
+     *
+     * @param array $selectors
+     *
+     * @return string
+     */
+    protected function stripOptionalFlag(&$selectors)
+    {
+        $optional = false;
+
+        $selector = end($selectors);
+        $part = end($selector);
+
+        if ($part === ['!optional']) {
+            array_pop($selectors[count($selectors) - 1]);
+
+            $optional = true;
+        }
+
+        return $optional;
+    }
+
+    /**
+     * Turn list of length 1 into value type
+     *
+     * @param array $value
+     *
+     * @return array
+     */
+    protected function flattenList($value)
+    {
+        if ($value[0] === Type::T_LIST && count($value[2]) === 1) {
+            return $this->flattenList($value[2][0]);
+        }
+
+        return $value;
+    }
+
+    /**
+     * @deprecated
+     *
+     * {@internal
+     *     advance counter to next occurrence of $what
+     *     $until - don't include $what in advance
+     *     $allowNewline, if string, will be used as valid char set
+     * }}
+     */
+    protected function to($what, &$out, $until = false, $allowNewline = false)
+    {
+        if (is_string($allowNewline)) {
+            $validChars = $allowNewline;
+        } else {
+            $validChars = $allowNewline ? '.' : "[^\n]";
+        }
+
+        if (! $this->match('(' . $validChars . '*?)' . $this->pregQuote($what), $m, ! $until)) {
+            return false;
+        }
+
+        if ($until) {
+            $this->count -= strlen($what); // give back $what
+        }
+
+        $out = $m[1];
+
+        return true;
+    }
+
+    /**
+     * @deprecated
+     */
+    protected function show()
+    {
+        if ($this->peek("(.*?)(\n|$)", $m, $this->count)) {
+            return $m[1];
+        }
+
+        return '';
+    }
+
+    /**
+     * Quote regular expression
+     *
+     * @param string $what
+     *
+     * @return string
+     */
+    private function pregQuote($what)
+    {
+        return preg_quote($what, '/');
+    }
+
+    /**
+     * Extract line numbers from buffer
+     *
+     * @param string $buffer
+     */
+    private function extractLineNumbers($buffer)
+    {
+        $this->sourcePositions = [0 => 0];
+        $prev = 0;
+
+        while (($pos = strpos($buffer, "\n", $prev)) !== false) {
+            $this->sourcePositions[] = $pos;
+            $prev = $pos + 1;
+        }
+
+        $this->sourcePositions[] = strlen($buffer);
+
+        if (substr($buffer, -1) !== "\n") {
+            $this->sourcePositions[] = strlen($buffer) + 1;
+        }
+    }
+
+    /**
+     * Get source line number and column (given character position in the buffer)
+     *
+     * @param integer $pos
+     *
+     * @return integer
+     */
+    private function getSourcePosition($pos)
+    {
+        $low = 0;
+        $high = count($this->sourcePositions);
+
+        while ($low < $high) {
+            $mid = (int) (($high + $low) / 2);
+
+            if ($pos < $this->sourcePositions[$mid]) {
+                $high = $mid - 1;
+                continue;
+            }
+
+            if ($pos >= $this->sourcePositions[$mid + 1]) {
+                $low = $mid + 1;
+                continue;
+            }
+
+            return [$mid + 1, $pos - $this->sourcePositions[$mid]];
+        }
+
+        return [$low + 1, $pos - $this->sourcePositions[$low]];
+    }
+
+    /**
+     * Save internal encoding
+     */
+    private function saveEncoding()
+    {
+        if (ini_get('mbstring.func_overload') & 2) {
+            $this->encoding = mb_internal_encoding();
+
+            mb_internal_encoding('iso-8859-1');
+        }
+    }
+
+    /**
+     * Restore internal encoding
+     */
+    private function restoreEncoding()
+    {
+        if ($this->encoding) {
+            mb_internal_encoding($this->encoding);
+        }
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Type.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Type.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Type.php	(revision 7114)
@@ -0,0 +1,69 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+/**
+ * Block/node types
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class Type
+{
+    const T_ASSIGN = 'assign';
+    const T_AT_ROOT = 'at-root';
+    const T_BLOCK = 'block';
+    const T_BREAK = 'break';
+    const T_CHARSET = 'charset';
+    const T_COLOR = 'color';
+    const T_COMMENT = 'comment';
+    const T_CONTINUE = 'continue';
+    const T_CONTROL = 'control';
+    const T_DEBUG = 'debug';
+    const T_DIRECTIVE = 'directive';
+    const T_EACH = 'each';
+    const T_ELSE = 'else';
+    const T_ELSEIF = 'elseif';
+    const T_ERROR = 'error';
+    const T_EXPRESSION = 'exp';
+    const T_EXTEND = 'extend';
+    const T_FOR = 'for';
+    const T_FUNCTION = 'function';
+    const T_FUNCTION_CALL = 'fncall';
+    const T_HSL = 'hsl';
+    const T_IF = 'if';
+    const T_IMPORT = 'import';
+    const T_INCLUDE = 'include';
+    const T_INTERPOLATE = 'interpolate';
+    const T_INTERPOLATED = 'interpolated';
+    const T_KEYWORD = 'keyword';
+    const T_LIST = 'list';
+    const T_MAP = 'map';
+    const T_MEDIA = 'media';
+    const T_MEDIA_EXPRESSION = 'mediaExp';
+    const T_MEDIA_TYPE = 'mediaType';
+    const T_MEDIA_VALUE = 'mediaValue';
+    const T_MIXIN = 'mixin';
+    const T_MIXIN_CONTENT = 'mixin_content';
+    const T_NESTED_PROPERTY = 'nestedprop';
+    const T_NOT = 'not';
+    const T_NULL = 'null';
+    const T_NUMBER = 'number';
+    const T_RETURN = 'return';
+    const T_ROOT = 'root';
+    const T_SCSSPHP_IMPORT_ONCE = 'scssphp-import-once';
+    const T_SELF = 'self';
+    const T_STRING = 'string';
+    const T_UNARY = 'unary';
+    const T_VARIABLE = 'var';
+    const T_WARN = 'warn';
+    const T_WHILE = 'while';
+}
Index: /lib/vendor/leafo/scssphp/src/Util.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Util.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Util.php	(revision 7114)
@@ -0,0 +1,56 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+use Leafo\ScssPhp\Base\Range;
+use Leafo\ScssPhp\Exception\RangeException;
+
+/**
+ * Utilties
+ *
+ * @author Anthon Pang <anthon.pang@gmail.com>
+ */
+class Util
+{
+    /**
+     * Asserts that `value` falls within `range` (inclusive), leaving
+     * room for slight floating-point errors.
+     *
+     * @param string $name  The name of the value. Used in the error message.
+     * @param Range  $range Range of values.
+     * @param array  $value The value to check.
+     * @param string $unit  The unit of the value. Used in error reporting.
+     *
+     * @return mixed `value` adjusted to fall within range, if it was outside by a floating-point margin.
+     *
+     * @throws \Leafo\ScssPhp\Exception\RangeException
+     */
+    public static function checkRange($name, Range $range, $value, $unit = '')
+    {
+        $val = $value[1];
+        $grace = new Range(-0.00001, 0.00001);
+
+        if ($range->includes($val)) {
+            return $val;
+        }
+
+        if ($grace->includes($val - $range->first)) {
+            return $range->first;
+        }
+
+        if ($grace->includes($val - $range->last)) {
+            return $range->last;
+        }
+
+        throw new RangeException("$name {$val} must be between {$range->first} and {$range->last}$unit");
+    }
+}
Index: /lib/vendor/leafo/scssphp/src/Version.php
===================================================================
--- /lib/vendor/leafo/scssphp/src/Version.php	(revision 7114)
+++ /lib/vendor/leafo/scssphp/src/Version.php	(revision 7114)
@@ -0,0 +1,22 @@
+<?php
+/**
+ * SCSSPHP
+ *
+ * @copyright 2012-2017 Leaf Corcoran
+ *
+ * @license http://opensource.org/licenses/MIT MIT
+ *
+ * @link http://leafo.github.io/scssphp
+ */
+
+namespace Leafo\ScssPhp;
+
+/**
+ * SCSSPHP version
+ *
+ * @author Leaf Corcoran <leafot@gmail.com>
+ */
+class Version
+{
+    const VERSION = 'v0.7.0';
+}
Index: /lib/vendor/matthiasmullie/minify/CONTRIBUTING.md
===================================================================
--- /lib/vendor/matthiasmullie/minify/CONTRIBUTING.md	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/CONTRIBUTING.md	(revision 7114)
@@ -0,0 +1,59 @@
+# How to contribute
+
+
+## Issues
+
+When [filing bugs](https://github.com/matthiasmullie/minify/issues/new),
+try to be as thorough as possible:
+* What version did you use?
+* What did you try to do? ***Please post the relevant parts of your code.***
+* What went wrong? ***Please include error messages, if any.***
+* What was the expected result?
+
+
+## Pull requests
+
+Bug fixes and general improvements to the existing codebase are always welcome.
+New features are also welcome, but will be judged on an individual basis. If
+you'd rather not risk wasting your time implementing a new feature only to see
+it turned down, please start the discussion by
+[opening an issue](https://github.com/matthiasmullie/minify/issues/new).
+
+Don't forget to add your changes to the [changelog](CHANGELOG.md).
+
+
+### Testing
+
+Please include tests for every change or addition to the code.
+To run the complete test suite:
+
+```sh
+vendor/bin/phpunit
+```
+
+When submitting a new pull request, please make sure that that the test suite
+passes (Travis CI will run it & report back on your pull request.)
+
+To run the tests on Windows, run `tests/convert_symlinks_to_windows_style.sh`
+from the command line in order to convert Linux-style test symlinks to
+Windows-style.
+
+
+### Coding standards
+
+All code must follow [PSR-2](http://www.php-fig.org/psr/psr-2/). Just make sure
+to run php-cs-fixer before submitting the code, it'll take care of the
+formatting for you:
+
+```sh
+vendor/bin/php-cs-fixer fix src
+vendor/bin/php-cs-fixer fix tests
+```
+
+Document the code thoroughly!
+
+
+## License
+
+Note that minify is MIT-licensed, which basically allows anyone to do
+anything they like with it, without restriction.
Index: /lib/vendor/matthiasmullie/minify/Dockerfile
===================================================================
--- /lib/vendor/matthiasmullie/minify/Dockerfile	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/Dockerfile	(revision 7114)
@@ -0,0 +1,13 @@
+ARG version=cli
+FROM php:$version
+
+COPY . /var/www
+WORKDIR /var/www
+
+RUN apt-get update
+RUN apt-get install -y zip unzip zlib1g-dev
+RUN docker-php-ext-install zip
+RUN docker-php-ext-install pcntl
+RUN curl -sS https://getcomposer.org/installer | php
+RUN mv composer.phar /usr/local/bin/composer
+RUN composer install
Index: /lib/vendor/matthiasmullie/minify/LICENSE
===================================================================
--- /lib/vendor/matthiasmullie/minify/LICENSE	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/LICENSE	(revision 7114)
@@ -0,0 +1,18 @@
+Copyright (c) 2012 Matthias Mullie
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index: /lib/vendor/matthiasmullie/minify/bin/minifycss
===================================================================
--- /lib/vendor/matthiasmullie/minify/bin/minifycss	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/bin/minifycss	(revision 7114)
@@ -0,0 +1,45 @@
+#!/usr/bin/env php
+<?php
+use MatthiasMullie\Minify;
+
+// command line utility to minify CSS
+if (file_exists(__DIR__ . '/../../../autoload.php')) {
+    // if composer install
+    require_once __DIR__ . '/../../../autoload.php';
+} else {
+    require_once __DIR__ . '/../src/Minify.php';
+    require_once __DIR__ . '/../src/CSS.php';
+    require_once __DIR__ . '/../src/Exception.php';
+}
+
+error_reporting(E_ALL);
+// check PHP setup for cli arguments
+if (!isset($_SERVER['argv']) && !isset($argv)) {
+    fwrite(STDERR, 'Please enable the "register_argc_argv" directive in your php.ini' . PHP_EOL);
+    exit(1);
+} elseif (!isset($argv)) {
+    $argv = $_SERVER['argv'];
+}
+// check if path to file given
+if (!isset($argv[1])) {
+    fwrite(STDERR, 'Argument expected: path to file' . PHP_EOL);
+    exit(1);
+}
+// check if script run in cli environment
+if ('cli' !== php_sapi_name()) {
+    fwrite(STDERR, $argv[1] . ' must be run in the command line' . PHP_EOL);
+    exit(1);
+}
+// check if source file exists
+if (!file_exists($argv[1])) {
+    fwrite(STDERR, 'Source file "' . $argv[1] . '" not found' . PHP_EOL);
+    exit(1);
+}
+
+try {
+    $minifier = new Minify\CSS($argv[1]);
+    echo $minifier->minify();
+} catch (Exception $e) {
+    fwrite(STDERR, $e->getMessage(), PHP_EOL);
+    exit(1);
+}
Index: /lib/vendor/matthiasmullie/minify/bin/minifyjs
===================================================================
--- /lib/vendor/matthiasmullie/minify/bin/minifyjs	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/bin/minifyjs	(revision 7114)
@@ -0,0 +1,45 @@
+#!/usr/bin/env php
+<?php
+use MatthiasMullie\Minify;
+
+// command line utility to minify JS
+if (file_exists(__DIR__ . '/../../../autoload.php')) {
+    // if composer install
+    require_once __DIR__ . '/../../../autoload.php';
+} else {
+    require_once __DIR__ . '/../src/Minify.php';
+    require_once __DIR__ . '/../src/JS.php';
+    require_once __DIR__ . '/../src/Exception.php';
+}
+
+error_reporting(E_ALL);
+// check PHP setup for cli arguments
+if (!isset($_SERVER['argv']) && !isset($argv)) {
+    fwrite(STDERR, 'Please enable the "register_argc_argv" directive in your php.ini' . PHP_EOL);
+    exit(1);
+} elseif (!isset($argv)) {
+    $argv = $_SERVER['argv'];
+}
+// check if path to file given
+if (!isset($argv[1])) {
+    fwrite(STDERR, 'Argument expected: path to file' . PHP_EOL);
+    exit(1);
+}
+// check if script run in cli environment
+if ('cli' !== php_sapi_name()) {
+    fwrite(STDERR, $argv[1] . ' must be run in the command line' . PHP_EOL);
+    exit(1);
+}
+// check if source file exists
+if (!file_exists($argv[1])) {
+    fwrite(STDERR, 'Source file "' . $argv[1] . '" not found' . PHP_EOL);
+    exit(1);
+}
+
+try {
+    $minifier = new Minify\JS($argv[1]);
+    echo $minifier->minify();
+} catch (Exception $e) {
+    fwrite(STDERR, $e->getMessage(), PHP_EOL);
+    exit(1);
+}
Index: /lib/vendor/matthiasmullie/minify/composer.json
===================================================================
--- /lib/vendor/matthiasmullie/minify/composer.json	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/composer.json	(revision 7114)
@@ -0,0 +1,38 @@
+{
+    "name": "matthiasmullie/minify",
+    "type": "library",
+    "description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.",
+    "keywords": ["minify", "minifier", "css", "js", "javascript"],
+    "homepage": "http://www.minifier.org",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Matthias Mullie",
+            "homepage": "http://www.mullie.eu",
+            "email": "minify@mullie.eu",
+            "role": "Developer"
+        }
+    ],
+    "require": {
+        "php": ">=5.3.0",
+        "ext-pcre": "*",
+        "matthiasmullie/path-converter": "~1.1"
+    },
+    "require-dev": {
+        "matthiasmullie/scrapbook": "~1.0",
+        "phpunit/phpunit": "~4.8",
+        "friendsofphp/php-cs-fixer": "~2.0"
+    },
+    "suggest": {
+        "psr/cache-implementation": "Cache implementation to use with Minify::cache"
+    },
+    "autoload": {
+        "psr-4": {
+            "MatthiasMullie\\Minify\\": "src/"
+        }
+    },
+    "bin": [
+        "bin/minifycss",
+        "bin/minifyjs"
+    ]
+}
Index: /lib/vendor/matthiasmullie/minify/data/js/keywords_after.txt
===================================================================
--- /lib/vendor/matthiasmullie/minify/data/js/keywords_after.txt	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/data/js/keywords_after.txt	(revision 7114)
@@ -0,0 +1,7 @@
+in
+public
+extends
+private
+protected
+implements
+instanceof
Index: /lib/vendor/matthiasmullie/minify/data/js/keywords_before.txt
===================================================================
--- /lib/vendor/matthiasmullie/minify/data/js/keywords_before.txt	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/data/js/keywords_before.txt	(revision 7114)
@@ -0,0 +1,26 @@
+do
+in
+let
+new
+var
+case
+else
+enum
+void
+with
+class
+const
+yield
+delete
+export
+import
+public
+static
+typeof
+extends
+package
+private
+function
+protected
+implements
+instanceof
Index: /lib/vendor/matthiasmullie/minify/data/js/keywords_reserved.txt
===================================================================
--- /lib/vendor/matthiasmullie/minify/data/js/keywords_reserved.txt	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/data/js/keywords_reserved.txt	(revision 7114)
@@ -0,0 +1,63 @@
+do
+if
+in
+for
+let
+new
+try
+var
+case
+else
+enum
+eval
+null
+this
+true
+void
+with
+break
+catch
+class
+const
+false
+super
+throw
+while
+yield
+delete
+export
+import
+public
+return
+static
+switch
+typeof
+default
+extends
+finally
+package
+private
+continue
+debugger
+function
+arguments
+interface
+protected
+implements
+instanceof
+abstract
+boolean
+byte
+char
+double
+final
+float
+goto
+int
+long
+native
+short
+synchronized
+throws
+transient
+volatile
Index: /lib/vendor/matthiasmullie/minify/data/js/operators.txt
===================================================================
--- /lib/vendor/matthiasmullie/minify/data/js/operators.txt	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/data/js/operators.txt	(revision 7114)
@@ -0,0 +1,46 @@
++
+-
+*
+/
+%
+=
++=
+-=
+*=
+/=
+%=
+<<=
+>>=
+>>>=
+&=
+^=
+|=
+&
+|
+^
+~
+<<
+>>
+>>>
+==
+===
+!=
+!==
+>
+<
+>=
+<=
+&&
+||
+!
+.
+[
+]
+?
+:
+,
+;
+(
+)
+{
+}
Index: /lib/vendor/matthiasmullie/minify/data/js/operators_after.txt
===================================================================
--- /lib/vendor/matthiasmullie/minify/data/js/operators_after.txt	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/data/js/operators_after.txt	(revision 7114)
@@ -0,0 +1,43 @@
++
+-
+*
+/
+%
+=
++=
+-=
+*=
+/=
+%=
+<<=
+>>=
+>>>=
+&=
+^=
+|=
+&
+|
+^
+<<
+>>
+>>>
+==
+===
+!=
+!==
+>
+<
+>=
+<=
+&&
+||
+.
+[
+]
+?
+:
+,
+;
+(
+)
+}
Index: /lib/vendor/matthiasmullie/minify/data/js/operators_before.txt
===================================================================
--- /lib/vendor/matthiasmullie/minify/data/js/operators_before.txt	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/data/js/operators_before.txt	(revision 7114)
@@ -0,0 +1,43 @@
++
+-
+*
+/
+%
+=
++=
+-=
+*=
+/=
+%=
+<<=
+>>=
+>>>=
+&=
+^=
+|=
+&
+|
+^
+~
+<<
+>>
+>>>
+==
+===
+!=
+!==
+>
+<
+>=
+<=
+&&
+||
+!
+.
+[
+?
+:
+,
+;
+(
+{
Index: /lib/vendor/matthiasmullie/minify/docker-compose.yml
===================================================================
--- /lib/vendor/matthiasmullie/minify/docker-compose.yml	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/docker-compose.yml	(revision 7114)
@@ -0,0 +1,31 @@
+version: '2.1'
+services:
+  php:
+    build:
+      context: .
+      dockerfile: Dockerfile
+    volumes:
+      - ./src:/var/www/src
+      - ./data:/var/www/data
+      - ./tests:/var/www/tests
+      - ./phpunit.xml.dist:/var/www/phpunit.xml.dist
+  '7.2':
+    extends: php
+    build:
+      args:
+        version: 7.2-cli
+  '7.1':
+    extends: php
+    build:
+      args:
+        version: 7.1-cli
+  '7.0':
+    extends: php
+    build:
+      args:
+        version: 7.0-cli
+  '5.6':
+    extends: php
+    build:
+      args:
+        version: 5.6-cli
Index: /lib/vendor/matthiasmullie/minify/src/CSS.php
===================================================================
--- /lib/vendor/matthiasmullie/minify/src/CSS.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/src/CSS.php	(revision 7114)
@@ -0,0 +1,736 @@
+<?php
+/**
+ * CSS Minifier
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+
+namespace MatthiasMullie\Minify;
+
+use MatthiasMullie\Minify\Exceptions\FileImportException;
+use MatthiasMullie\PathConverter\ConverterInterface;
+use MatthiasMullie\PathConverter\Converter;
+
+/**
+ * CSS minifier
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @package Minify
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @author Tijs Verkoyen <minify@verkoyen.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+class CSS extends Minify
+{
+    /**
+     * @var int maximum inport size in kB
+     */
+    protected $maxImportSize = 5;
+
+    /**
+     * @var string[] valid import extensions
+     */
+    protected $importExtensions = array(
+        'gif' => 'data:image/gif',
+        'png' => 'data:image/png',
+        'jpe' => 'data:image/jpeg',
+        'jpg' => 'data:image/jpeg',
+        'jpeg' => 'data:image/jpeg',
+        'svg' => 'data:image/svg+xml',
+        'woff' => 'data:application/x-font-woff',
+        'tif' => 'image/tiff',
+        'tiff' => 'image/tiff',
+        'xbm' => 'image/x-xbitmap',
+    );
+
+    /**
+     * Set the maximum size if files to be imported.
+     *
+     * Files larger than this size (in kB) will not be imported into the CSS.
+     * Importing files into the CSS as data-uri will save you some connections,
+     * but we should only import relatively small decorative images so that our
+     * CSS file doesn't get too bulky.
+     *
+     * @param int $size Size in kB
+     */
+    public function setMaxImportSize($size)
+    {
+        $this->maxImportSize = $size;
+    }
+
+    /**
+     * Set the type of extensions to be imported into the CSS (to save network
+     * connections).
+     * Keys of the array should be the file extensions & respective values
+     * should be the data type.
+     *
+     * @param string[] $extensions Array of file extensions
+     */
+    public function setImportExtensions(array $extensions)
+    {
+        $this->importExtensions = $extensions;
+    }
+
+    /**
+     * Move any import statements to the top.
+     *
+     * @param string $content Nearly finished CSS content
+     *
+     * @return string
+     */
+    protected function moveImportsToTop($content)
+    {
+        if (preg_match_all('/(;?)(@import (?<url>url\()?(?P<quotes>["\']?).+?(?P=quotes)(?(url)\)));?/', $content, $matches)) {
+            // remove from content
+            foreach ($matches[0] as $import) {
+                $content = str_replace($import, '', $content);
+            }
+
+            // add to top
+            $content = implode(';', $matches[2]).';'.trim($content, ';');
+        }
+
+        return $content;
+    }
+
+    /**
+     * Combine CSS from import statements.
+     *
+     * @import's will be loaded and their content merged into the original file,
+     * to save HTTP requests.
+     *
+     * @param string   $source  The file to combine imports for
+     * @param string   $content The CSS content to combine imports for
+     * @param string[] $parents Parent paths, for circular reference checks
+     *
+     * @return string
+     *
+     * @throws FileImportException
+     */
+    protected function combineImports($source, $content, $parents)
+    {
+        $importRegexes = array(
+            // @import url(xxx)
+            '/
+            # import statement
+            @import
+
+            # whitespace
+            \s+
+
+                # open url()
+                url\(
+
+                    # (optional) open path enclosure
+                    (?P<quotes>["\']?)
+
+                        # fetch path
+                        (?P<path>.+?)
+
+                    # (optional) close path enclosure
+                    (?P=quotes)
+
+                # close url()
+                \)
+
+                # (optional) trailing whitespace
+                \s*
+
+                # (optional) media statement(s)
+                (?P<media>[^;]*)
+
+                # (optional) trailing whitespace
+                \s*
+
+            # (optional) closing semi-colon
+            ;?
+
+            /ix',
+
+            // @import 'xxx'
+            '/
+
+            # import statement
+            @import
+
+            # whitespace
+            \s+
+
+                # open path enclosure
+                (?P<quotes>["\'])
+
+                    # fetch path
+                    (?P<path>.+?)
+
+                # close path enclosure
+                (?P=quotes)
+
+                # (optional) trailing whitespace
+                \s*
+
+                # (optional) media statement(s)
+                (?P<media>[^;]*)
+
+                # (optional) trailing whitespace
+                \s*
+
+            # (optional) closing semi-colon
+            ;?
+
+            /ix',
+        );
+
+        // find all relative imports in css
+        $matches = array();
+        foreach ($importRegexes as $importRegex) {
+            if (preg_match_all($importRegex, $content, $regexMatches, PREG_SET_ORDER)) {
+                $matches = array_merge($matches, $regexMatches);
+            }
+        }
+
+        $search = array();
+        $replace = array();
+
+        // loop the matches
+        foreach ($matches as $match) {
+            // get the path for the file that will be imported
+            $importPath = dirname($source).'/'.$match['path'];
+
+            // only replace the import with the content if we can grab the
+            // content of the file
+            if (!$this->canImportByPath($match['path']) || !$this->canImportFile($importPath)) {
+                continue;
+            }
+
+            // check if current file was not imported previously in the same
+            // import chain.
+            if (in_array($importPath, $parents)) {
+                throw new FileImportException('Failed to import file "'.$importPath.'": circular reference detected.');
+            }
+
+            // grab referenced file & minify it (which may include importing
+            // yet other @import statements recursively)
+            $minifier = new static($importPath);
+            $importContent = $minifier->execute($source, $parents);
+
+            // check if this is only valid for certain media
+            if (!empty($match['media'])) {
+                $importContent = '@media '.$match['media'].'{'.$importContent.'}';
+            }
+
+            // add to replacement array
+            $search[] = $match[0];
+            $replace[] = $importContent;
+        }
+
+        // replace the import statements
+        return str_replace($search, $replace, $content);
+    }
+
+    /**
+     * Import files into the CSS, base64-ized.
+     *
+     * @url(image.jpg) images will be loaded and their content merged into the
+     * original file, to save HTTP requests.
+     *
+     * @param string $source  The file to import files for
+     * @param string $content The CSS content to import files for
+     *
+     * @return string
+     */
+    protected function importFiles($source, $content)
+    {
+        $regex = '/url\((["\']?)(.+?)\\1\)/i';
+        if ($this->importExtensions && preg_match_all($regex, $content, $matches, PREG_SET_ORDER)) {
+            $search = array();
+            $replace = array();
+
+            // loop the matches
+            foreach ($matches as $match) {
+                $extension = substr(strrchr($match[2], '.'), 1);
+                if ($extension && !array_key_exists($extension, $this->importExtensions)) {
+                    continue;
+                }
+
+                // get the path for the file that will be imported
+                $path = $match[2];
+                $path = dirname($source).'/'.$path;
+
+                // only replace the import with the content if we're able to get
+                // the content of the file, and it's relatively small
+                if ($this->canImportFile($path) && $this->canImportBySize($path)) {
+                    // grab content && base64-ize
+                    $importContent = $this->load($path);
+                    $importContent = base64_encode($importContent);
+
+                    // build replacement
+                    $search[] = $match[0];
+                    $replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')';
+                }
+            }
+
+            // replace the import statements
+            $content = str_replace($search, $replace, $content);
+        }
+
+        return $content;
+    }
+
+    /**
+     * Minify the data.
+     * Perform CSS optimizations.
+     *
+     * @param string[optional] $path    Path to write the data to
+     * @param string[]         $parents Parent paths, for circular reference checks
+     *
+     * @return string The minified data
+     */
+    public function execute($path = null, $parents = array())
+    {
+        $content = '';
+
+        // loop CSS data (raw data and files)
+        foreach ($this->data as $source => $css) {
+            /*
+             * Let's first take out strings & comments, since we can't just
+             * remove whitespace anywhere. If whitespace occurs inside a string,
+             * we should leave it alone. E.g.:
+             * p { content: "a   test" }
+             */
+            $this->extractStrings();
+            $this->stripComments();
+            $css = $this->replace($css);
+
+            $css = $this->stripWhitespace($css);
+            $css = $this->shortenHex($css);
+            $css = $this->shortenZeroes($css);
+            $css = $this->shortenFontWeights($css);
+            $css = $this->stripEmptyTags($css);
+
+            // restore the string we've extracted earlier
+            $css = $this->restoreExtractedData($css);
+
+            $source = is_int($source) ? '' : $source;
+            $parents = $source ? array_merge($parents, array($source)) : $parents;
+            $css = $this->combineImports($source, $css, $parents);
+            $css = $this->importFiles($source, $css);
+
+            /*
+             * If we'll save to a new path, we'll have to fix the relative paths
+             * to be relative no longer to the source file, but to the new path.
+             * If we don't write to a file, fall back to same path so no
+             * conversion happens (because we still want it to go through most
+             * of the move code, which also addresses url() & @import syntax...)
+             */
+            $converter = $this->getPathConverter($source, $path ?: $source);
+            $css = $this->move($converter, $css);
+
+            // combine css
+            $content .= $css;
+        }
+
+        $content = $this->moveImportsToTop($content);
+
+        return $content;
+    }
+
+    /**
+     * Moving a css file should update all relative urls.
+     * Relative references (e.g. ../images/image.gif) in a certain css file,
+     * will have to be updated when a file is being saved at another location
+     * (e.g. ../../images/image.gif, if the new CSS file is 1 folder deeper).
+     *
+     * @param ConverterInterface $converter Relative path converter
+     * @param string             $content   The CSS content to update relative urls for
+     *
+     * @return string
+     */
+    protected function move(ConverterInterface $converter, $content)
+    {
+        /*
+         * Relative path references will usually be enclosed by url(). @import
+         * is an exception, where url() is not necessary around the path (but is
+         * allowed).
+         * This *could* be 1 regular expression, where both regular expressions
+         * in this array are on different sides of a |. But we're using named
+         * patterns in both regexes, the same name on both regexes. This is only
+         * possible with a (?J) modifier, but that only works after a fairly
+         * recent PCRE version. That's why I'm doing 2 separate regular
+         * expressions & combining the matches after executing of both.
+         */
+        $relativeRegexes = array(
+            // url(xxx)
+            '/
+            # open url()
+            url\(
+
+                \s*
+
+                # open path enclosure
+                (?P<quotes>["\'])?
+
+                    # fetch path
+                    (?P<path>.+?)
+
+                # close path enclosure
+                (?(quotes)(?P=quotes))
+
+                \s*
+
+            # close url()
+            \)
+
+            /ix',
+
+            // @import "xxx"
+            '/
+            # import statement
+            @import
+
+            # whitespace
+            \s+
+
+                # we don\'t have to check for @import url(), because the
+                # condition above will already catch these
+
+                # open path enclosure
+                (?P<quotes>["\'])
+
+                    # fetch path
+                    (?P<path>.+?)
+
+                # close path enclosure
+                (?P=quotes)
+
+            /ix',
+        );
+
+        // find all relative urls in css
+        $matches = array();
+        foreach ($relativeRegexes as $relativeRegex) {
+            if (preg_match_all($relativeRegex, $content, $regexMatches, PREG_SET_ORDER)) {
+                $matches = array_merge($matches, $regexMatches);
+            }
+        }
+
+        $search = array();
+        $replace = array();
+
+        // loop all urls
+        foreach ($matches as $match) {
+            // determine if it's a url() or an @import match
+            $type = (strpos($match[0], '@import') === 0 ? 'import' : 'url');
+
+            $url = $match['path'];
+            if ($this->canImportByPath($url)) {
+                // attempting to interpret GET-params makes no sense, so let's discard them for awhile
+                $params = strrchr($url, '?');
+                $url = $params ? substr($url, 0, -strlen($params)) : $url;
+
+                // fix relative url
+                $url = $converter->convert($url);
+
+                // now that the path has been converted, re-apply GET-params
+                $url .= $params;
+            }
+
+            /*
+             * Urls with control characters above 0x7e should be quoted.
+             * According to Mozilla's parser, whitespace is only allowed at the
+             * end of unquoted urls.
+             * Urls with `)` (as could happen with data: uris) should also be
+             * quoted to avoid being confused for the url() closing parentheses.
+             * And urls with a # have also been reported to cause issues.
+             * Urls with quotes inside should also remain escaped.
+             *
+             * @see https://developer.mozilla.org/nl/docs/Web/CSS/url#The_url()_functional_notation
+             * @see https://hg.mozilla.org/mozilla-central/rev/14abca4e7378
+             * @see https://github.com/matthiasmullie/minify/issues/193
+             */
+            $url = trim($url);
+            if (preg_match('/[\s\)\'"#\x{7f}-\x{9f}]/u', $url)) {
+                $url = $match['quotes'] . $url . $match['quotes'];
+            }
+
+            // build replacement
+            $search[] = $match[0];
+            if ($type === 'url') {
+                $replace[] = 'url('.$url.')';
+            } elseif ($type === 'import') {
+                $replace[] = '@import "'.$url.'"';
+            }
+        }
+
+        // replace urls
+        return str_replace($search, $replace, $content);
+    }
+
+    /**
+     * Shorthand hex color codes.
+     * #FF0000 -> #F00.
+     *
+     * @param string $content The CSS content to shorten the hex color codes for
+     *
+     * @return string
+     */
+    protected function shortenHex($content)
+    {
+        $content = preg_replace('/(?<=[: ])#([0-9a-z])\\1([0-9a-z])\\2([0-9a-z])\\3(?=[; }])/i', '#$1$2$3', $content);
+
+        // we can shorten some even more by replacing them with their color name
+        $colors = array(
+            '#F0FFFF' => 'azure',
+            '#F5F5DC' => 'beige',
+            '#A52A2A' => 'brown',
+            '#FF7F50' => 'coral',
+            '#FFD700' => 'gold',
+            '#808080' => 'gray',
+            '#008000' => 'green',
+            '#4B0082' => 'indigo',
+            '#FFFFF0' => 'ivory',
+            '#F0E68C' => 'khaki',
+            '#FAF0E6' => 'linen',
+            '#800000' => 'maroon',
+            '#000080' => 'navy',
+            '#808000' => 'olive',
+            '#CD853F' => 'peru',
+            '#FFC0CB' => 'pink',
+            '#DDA0DD' => 'plum',
+            '#800080' => 'purple',
+            '#F00' => 'red',
+            '#FA8072' => 'salmon',
+            '#A0522D' => 'sienna',
+            '#C0C0C0' => 'silver',
+            '#FFFAFA' => 'snow',
+            '#D2B48C' => 'tan',
+            '#FF6347' => 'tomato',
+            '#EE82EE' => 'violet',
+            '#F5DEB3' => 'wheat',
+        );
+
+        return preg_replace_callback(
+            '/(?<=[: ])('.implode(array_keys($colors), '|').')(?=[; }])/i',
+            function ($match) use ($colors) {
+                return $colors[strtoupper($match[0])];
+            },
+            $content
+        );
+    }
+
+    /**
+     * Shorten CSS font weights.
+     *
+     * @param string $content The CSS content to shorten the font weights for
+     *
+     * @return string
+     */
+    protected function shortenFontWeights($content)
+    {
+        $weights = array(
+            'normal' => 400,
+            'bold' => 700,
+        );
+
+        $callback = function ($match) use ($weights) {
+            return $match[1].$weights[$match[2]];
+        };
+
+        return preg_replace_callback('/(font-weight\s*:\s*)('.implode('|', array_keys($weights)).')(?=[;}])/', $callback, $content);
+    }
+
+    /**
+     * Shorthand 0 values to plain 0, instead of e.g. -0em.
+     *
+     * @param string $content The CSS content to shorten the zero values for
+     *
+     * @return string
+     */
+    protected function shortenZeroes($content)
+    {
+        // we don't want to strip units in `calc()` expressions:
+        // `5px - 0px` is valid, but `5px - 0` is not
+        // `10px * 0` is valid (equates to 0), and so is `10 * 0px`, but
+        // `10 * 0` is invalid
+        // best to just leave `calc()`s alone, even if they could be optimized
+        // (which is a whole other undertaking, where units & order of
+        // operations all need to be considered...)
+        $calcs = $this->findCalcs($content);
+        $content = str_replace($calcs, array_keys($calcs), $content);
+
+        // reusable bits of code throughout these regexes:
+        // before & after are used to make sure we don't match lose unintended
+        // 0-like values (e.g. in #000, or in http://url/1.0)
+        // units can be stripped from 0 values, or used to recognize non 0
+        // values (where wa may be able to strip a .0 suffix)
+        $before = '(?<=[:(, ])';
+        $after = '(?=[ ,);}])';
+        $units = '(em|ex|%|px|cm|mm|in|pt|pc|ch|rem|vh|vw|vmin|vmax|vm)';
+
+        // strip units after zeroes (0px -> 0)
+        // NOTE: it should be safe to remove all units for a 0 value, but in
+        // practice, Webkit (especially Safari) seems to stumble over at least
+        // 0%, potentially other units as well. Only stripping 'px' for now.
+        // @see https://github.com/matthiasmullie/minify/issues/60
+        $content = preg_replace('/'.$before.'(-?0*(\.0+)?)(?<=0)px'.$after.'/', '\\1', $content);
+
+        // strip 0-digits (.0 -> 0)
+        $content = preg_replace('/'.$before.'\.0+'.$units.'?'.$after.'/', '0\\1', $content);
+        // strip trailing 0: 50.10 -> 50.1, 50.10px -> 50.1px
+        $content = preg_replace('/'.$before.'(-?[0-9]+\.[0-9]+)0+'.$units.'?'.$after.'/', '\\1\\2', $content);
+        // strip trailing 0: 50.00 -> 50, 50.00px -> 50px
+        $content = preg_replace('/'.$before.'(-?[0-9]+)\.0+'.$units.'?'.$after.'/', '\\1\\2', $content);
+        // strip leading 0: 0.1 -> .1, 01.1 -> 1.1
+        $content = preg_replace('/'.$before.'(-?)0+([0-9]*\.[0-9]+)'.$units.'?'.$after.'/', '\\1\\2\\3', $content);
+
+        // strip negative zeroes (-0 -> 0) & truncate zeroes (00 -> 0)
+        $content = preg_replace('/'.$before.'-?0+'.$units.'?'.$after.'/', '0\\1', $content);
+
+        // IE doesn't seem to understand a unitless flex-basis value (correct -
+        // it goes against the spec), so let's add it in again (make it `%`,
+        // which is only 1 char: 0%, 0px, 0 anything, it's all just the same)
+        // @see https://developer.mozilla.org/nl/docs/Web/CSS/flex
+        $content = preg_replace('/flex:([0-9]+\s[0-9]+\s)0([;\}])/', 'flex:${1}0%${2}', $content);
+        $content = preg_replace('/flex-basis:0([;\}])/', 'flex-basis:0%${1}', $content);
+
+        // restore `calc()` expressions
+        $content = str_replace(array_keys($calcs), $calcs, $content);
+
+        return $content;
+    }
+
+    /**
+     * Strip empty tags from source code.
+     *
+     * @param string $content
+     *
+     * @return string
+     */
+    protected function stripEmptyTags($content)
+    {
+        $content = preg_replace('/(?<=^)[^\{\};]+\{\s*\}/', '', $content);
+        $content = preg_replace('/(?<=(\}|;))[^\{\};]+\{\s*\}/', '', $content);
+
+        return $content;
+    }
+
+    /**
+     * Strip comments from source code.
+     */
+    protected function stripComments()
+    {
+        $this->registerPattern('/\/\*.*?\*\//s', '');
+    }
+
+    /**
+     * Strip whitespace.
+     *
+     * @param string $content The CSS content to strip the whitespace for
+     *
+     * @return string
+     */
+    protected function stripWhitespace($content)
+    {
+        // remove leading & trailing whitespace
+        $content = preg_replace('/^\s*/m', '', $content);
+        $content = preg_replace('/\s*$/m', '', $content);
+
+        // replace newlines with a single space
+        $content = preg_replace('/\s+/', ' ', $content);
+
+        // remove whitespace around meta characters
+        // inspired by stackoverflow.com/questions/15195750/minify-compress-css-with-regex
+        $content = preg_replace('/\s*([\*$~^|]?+=|[{};,>~]|!important\b)\s*/', '$1', $content);
+        $content = preg_replace('/([\[(:])\s+/', '$1', $content);
+        $content = preg_replace('/\s+([\]\)])/', '$1', $content);
+        $content = preg_replace('/\s+(:)(?![^\}]*\{)/', '$1', $content);
+
+        // whitespace around + and - can only be stripped inside some pseudo-
+        // classes, like `:nth-child(3+2n)`
+        // not in things like `calc(3px + 2px)`, shorthands like `3px -2px`, or
+        // selectors like `div.weird- p`
+        $pseudos = array('nth-child', 'nth-last-child', 'nth-last-of-type', 'nth-of-type');
+        $content = preg_replace('/:('.implode('|', $pseudos).')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content);
+
+        // remove semicolon/whitespace followed by closing bracket
+        $content = str_replace(';}', '}', $content);
+
+        return trim($content);
+    }
+
+    /**
+     * Find all `calc()` occurrences.
+     *
+     * @param string $content The CSS content to find `calc()`s in.
+     *
+     * @return string[]
+     */
+    protected function findCalcs($content)
+    {
+        $results = array();
+        preg_match_all('/calc(\(.+?)(?=$|;|calc\()/', $content, $matches, PREG_SET_ORDER);
+
+        foreach ($matches as $match) {
+            $length = strlen($match[1]);
+            $expr = '';
+            $opened = 0;
+
+            for ($i = 0; $i < $length; $i++) {
+                $char = $match[1][$i];
+                $expr .= $char;
+                if ($char === '(') {
+                    $opened++;
+                } elseif ($char === ')' && --$opened === 0) {
+                    break;
+                }
+            }
+
+            $results['calc('.count($results).')'] = 'calc'.$expr;
+        }
+
+        return $results;
+    }
+
+    /**
+     * Check if file is small enough to be imported.
+     *
+     * @param string $path The path to the file
+     *
+     * @return bool
+     */
+    protected function canImportBySize($path)
+    {
+        return ($size = @filesize($path)) && $size <= $this->maxImportSize * 1024;
+    }
+
+    /**
+     * Check if file a file can be imported, going by the path.
+     *
+     * @param string $path
+     *
+     * @return bool
+     */
+    protected function canImportByPath($path)
+    {
+        return preg_match('/^(data:|https?:|\\/)/', $path) === 0;
+    }
+
+    /**
+     * Return a converter to update relative paths to be relative to the new
+     * destination.
+     *
+     * @param string $source
+     * @param string $target
+     *
+     * @return ConverterInterface
+     */
+    protected function getPathConverter($source, $target)
+    {
+        return new Converter($source, $target);
+    }
+}
Index: /lib/vendor/matthiasmullie/minify/src/Exception.php
===================================================================
--- /lib/vendor/matthiasmullie/minify/src/Exception.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/src/Exception.php	(revision 7114)
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Base Exception
+ *
+ * @deprecated Use Exceptions\BasicException instead
+ *
+ * @author Matthias Mullie <minify@mullie.eu>
+ */
+namespace MatthiasMullie\Minify;
+
+/**
+ * Base Exception Class
+ * @deprecated Use Exceptions\BasicException instead
+ *
+ * @package Minify
+ * @author Matthias Mullie <minify@mullie.eu>
+ */
+abstract class Exception extends \Exception
+{
+}
Index: /lib/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php
===================================================================
--- /lib/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php	(revision 7114)
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Basic exception
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+namespace MatthiasMullie\Minify\Exceptions;
+
+use MatthiasMullie\Minify\Exception;
+
+/**
+ * Basic Exception Class
+ *
+ * @package Minify\Exception
+ * @author Matthias Mullie <minify@mullie.eu>
+ */
+abstract class BasicException extends Exception
+{
+}
Index: /lib/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php
===================================================================
--- /lib/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php	(revision 7114)
@@ -0,0 +1,21 @@
+<?php
+/**
+ * File Import Exception
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+namespace MatthiasMullie\Minify\Exceptions;
+
+/**
+ * File Import Exception Class
+ *
+ * @package Minify\Exception
+ * @author Matthias Mullie <minify@mullie.eu>
+ */
+class FileImportException extends BasicException
+{
+}
Index: /lib/vendor/matthiasmullie/minify/src/Exceptions/IOException.php
===================================================================
--- /lib/vendor/matthiasmullie/minify/src/Exceptions/IOException.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/src/Exceptions/IOException.php	(revision 7114)
@@ -0,0 +1,21 @@
+<?php
+/**
+ * IO Exception
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+namespace MatthiasMullie\Minify\Exceptions;
+
+/**
+ * IO Exception Class
+ *
+ * @package Minify\Exception
+ * @author Matthias Mullie <minify@mullie.eu>
+ */
+class IOException extends BasicException
+{
+}
Index: /lib/vendor/matthiasmullie/minify/src/JS.php
===================================================================
--- /lib/vendor/matthiasmullie/minify/src/JS.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/src/JS.php	(revision 7114)
@@ -0,0 +1,598 @@
+<?php
+/**
+ * JavaScript minifier
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+namespace MatthiasMullie\Minify;
+
+/**
+ * JavaScript Minifier Class
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @package Minify
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @author Tijs Verkoyen <minify@verkoyen.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+class JS extends Minify
+{
+    /**
+     * Var-matching regex based on http://stackoverflow.com/a/9337047/802993.
+     *
+     * Note that regular expressions using that bit must have the PCRE_UTF8
+     * pattern modifier (/u) set.
+     *
+     * @var string
+     */
+    const REGEX_VARIABLE = '\b[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\x{02c1}\x{02c6}-\x{02d1}\x{02e0}-\x{02e4}\x{02ec}\x{02ee}\x{0370}-\x{0374}\x{0376}\x{0377}\x{037a}-\x{037d}\x{0386}\x{0388}-\x{038a}\x{038c}\x{038e}-\x{03a1}\x{03a3}-\x{03f5}\x{03f7}-\x{0481}\x{048a}-\x{0527}\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0587}\x{05d0}-\x{05ea}\x{05f0}-\x{05f2}\x{0620}-\x{064a}\x{066e}\x{066f}\x{0671}-\x{06d3}\x{06d5}\x{06e5}\x{06e6}\x{06ee}\x{06ef}\x{06fa}-\x{06fc}\x{06ff}\x{0710}\x{0712}-\x{072f}\x{074d}-\x{07a5}\x{07b1}\x{07ca}-\x{07ea}\x{07f4}\x{07f5}\x{07fa}\x{0800}-\x{0815}\x{081a}\x{0824}\x{0828}\x{0840}-\x{0858}\x{08a0}\x{08a2}-\x{08ac}\x{0904}-\x{0939}\x{093d}\x{0950}\x{0958}-\x{0961}\x{0971}-\x{0977}\x{0979}-\x{097f}\x{0985}-\x{098c}\x{098f}\x{0990}\x{0993}-\x{09a8}\x{09aa}-\x{09b0}\x{09b2}\x{09b6}-\x{09b9}\x{09bd}\x{09ce}\x{09dc}\x{09dd}\x{09df}-\x{09e1}\x{09f0}\x{09f1}\x{0a05}-\x{0a0a}\x{0a0f}\x{0a10}\x{0a13}-\x{0a28}\x{0a2a}-\x{0a30}\x{0a32}\x{0a33}\x{0a35}\x{0a36}\x{0a38}\x{0a39}\x{0a59}-\x{0a5c}\x{0a5e}\x{0a72}-\x{0a74}\x{0a85}-\x{0a8d}\x{0a8f}-\x{0a91}\x{0a93}-\x{0aa8}\x{0aaa}-\x{0ab0}\x{0ab2}\x{0ab3}\x{0ab5}-\x{0ab9}\x{0abd}\x{0ad0}\x{0ae0}\x{0ae1}\x{0b05}-\x{0b0c}\x{0b0f}\x{0b10}\x{0b13}-\x{0b28}\x{0b2a}-\x{0b30}\x{0b32}\x{0b33}\x{0b35}-\x{0b39}\x{0b3d}\x{0b5c}\x{0b5d}\x{0b5f}-\x{0b61}\x{0b71}\x{0b83}\x{0b85}-\x{0b8a}\x{0b8e}-\x{0b90}\x{0b92}-\x{0b95}\x{0b99}\x{0b9a}\x{0b9c}\x{0b9e}\x{0b9f}\x{0ba3}\x{0ba4}\x{0ba8}-\x{0baa}\x{0bae}-\x{0bb9}\x{0bd0}\x{0c05}-\x{0c0c}\x{0c0e}-\x{0c10}\x{0c12}-\x{0c28}\x{0c2a}-\x{0c33}\x{0c35}-\x{0c39}\x{0c3d}\x{0c58}\x{0c59}\x{0c60}\x{0c61}\x{0c85}-\x{0c8c}\x{0c8e}-\x{0c90}\x{0c92}-\x{0ca8}\x{0caa}-\x{0cb3}\x{0cb5}-\x{0cb9}\x{0cbd}\x{0cde}\x{0ce0}\x{0ce1}\x{0cf1}\x{0cf2}\x{0d05}-\x{0d0c}\x{0d0e}-\x{0d10}\x{0d12}-\x{0d3a}\x{0d3d}\x{0d4e}\x{0d60}\x{0d61}\x{0d7a}-\x{0d7f}\x{0d85}-\x{0d96}\x{0d9a}-\x{0db1}\x{0db3}-\x{0dbb}\x{0dbd}\x{0dc0}-\x{0dc6}\x{0e01}-\x{0e30}\x{0e32}\x{0e33}\x{0e40}-\x{0e46}\x{0e81}\x{0e82}\x{0e84}\x{0e87}\x{0e88}\x{0e8a}\x{0e8d}\x{0e94}-\x{0e97}\x{0e99}-\x{0e9f}\x{0ea1}-\x{0ea3}\x{0ea5}\x{0ea7}\x{0eaa}\x{0eab}\x{0ead}-\x{0eb0}\x{0eb2}\x{0eb3}\x{0ebd}\x{0ec0}-\x{0ec4}\x{0ec6}\x{0edc}-\x{0edf}\x{0f00}\x{0f40}-\x{0f47}\x{0f49}-\x{0f6c}\x{0f88}-\x{0f8c}\x{1000}-\x{102a}\x{103f}\x{1050}-\x{1055}\x{105a}-\x{105d}\x{1061}\x{1065}\x{1066}\x{106e}-\x{1070}\x{1075}-\x{1081}\x{108e}\x{10a0}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{10fa}\x{10fc}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1380}-\x{138f}\x{13a0}-\x{13f4}\x{1401}-\x{166c}\x{166f}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16ea}\x{16ee}-\x{16f0}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17d7}\x{17dc}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191c}\x{1950}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19c1}-\x{19c7}\x{1a00}-\x{1a16}\x{1a20}-\x{1a54}\x{1aa7}\x{1b05}-\x{1b33}\x{1b45}-\x{1b4b}\x{1b83}-\x{1ba0}\x{1bae}\x{1baf}\x{1bba}-\x{1be5}\x{1c00}-\x{1c23}\x{1c4d}-\x{1c4f}\x{1c5a}-\x{1c7d}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf1}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{2160}-\x{2188}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{2e2f}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{31a0}-\x{31ba}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{4e00}-\x{9fcc}\x{a000}-\x{a48c}\x{a4d0}-\x{a4fd}\x{a500}-\x{a60c}\x{a610}-\x{a61f}\x{a62a}\x{a62b}\x{a640}-\x{a66e}\x{a67f}-\x{a697}\x{a6a0}-\x{a6ef}\x{a717}-\x{a71f}\x{a722}-\x{a788}\x{a78b}-\x{a78e}\x{a790}-\x{a793}\x{a7a0}-\x{a7aa}\x{a7f8}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a822}\x{a840}-\x{a873}\x{a882}-\x{a8b3}\x{a8f2}-\x{a8f7}\x{a8fb}\x{a90a}-\x{a925}\x{a930}-\x{a946}\x{a960}-\x{a97c}\x{a984}-\x{a9b2}\x{a9cf}\x{aa00}-\x{aa28}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa60}-\x{aa76}\x{aa7a}\x{aa80}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aadd}\x{aae0}-\x{aaea}\x{aaf2}-\x{aaf4}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{abc0}-\x{abe2}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{f900}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb36}\x{fb38}-\x{fb3c}\x{fb3e}\x{fb40}\x{fb41}\x{fb43}\x{fb44}\x{fb46}-\x{fbb1}\x{fbd3}-\x{fd3d}\x{fd50}-\x{fd8f}\x{fd92}-\x{fdc7}\x{fdf0}-\x{fdfb}\x{fe70}-\x{fe74}\x{fe76}-\x{fefc}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\x{02c1}\x{02c6}-\x{02d1}\x{02e0}-\x{02e4}\x{02ec}\x{02ee}\x{0370}-\x{0374}\x{0376}\x{0377}\x{037a}-\x{037d}\x{0386}\x{0388}-\x{038a}\x{038c}\x{038e}-\x{03a1}\x{03a3}-\x{03f5}\x{03f7}-\x{0481}\x{048a}-\x{0527}\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0587}\x{05d0}-\x{05ea}\x{05f0}-\x{05f2}\x{0620}-\x{064a}\x{066e}\x{066f}\x{0671}-\x{06d3}\x{06d5}\x{06e5}\x{06e6}\x{06ee}\x{06ef}\x{06fa}-\x{06fc}\x{06ff}\x{0710}\x{0712}-\x{072f}\x{074d}-\x{07a5}\x{07b1}\x{07ca}-\x{07ea}\x{07f4}\x{07f5}\x{07fa}\x{0800}-\x{0815}\x{081a}\x{0824}\x{0828}\x{0840}-\x{0858}\x{08a0}\x{08a2}-\x{08ac}\x{0904}-\x{0939}\x{093d}\x{0950}\x{0958}-\x{0961}\x{0971}-\x{0977}\x{0979}-\x{097f}\x{0985}-\x{098c}\x{098f}\x{0990}\x{0993}-\x{09a8}\x{09aa}-\x{09b0}\x{09b2}\x{09b6}-\x{09b9}\x{09bd}\x{09ce}\x{09dc}\x{09dd}\x{09df}-\x{09e1}\x{09f0}\x{09f1}\x{0a05}-\x{0a0a}\x{0a0f}\x{0a10}\x{0a13}-\x{0a28}\x{0a2a}-\x{0a30}\x{0a32}\x{0a33}\x{0a35}\x{0a36}\x{0a38}\x{0a39}\x{0a59}-\x{0a5c}\x{0a5e}\x{0a72}-\x{0a74}\x{0a85}-\x{0a8d}\x{0a8f}-\x{0a91}\x{0a93}-\x{0aa8}\x{0aaa}-\x{0ab0}\x{0ab2}\x{0ab3}\x{0ab5}-\x{0ab9}\x{0abd}\x{0ad0}\x{0ae0}\x{0ae1}\x{0b05}-\x{0b0c}\x{0b0f}\x{0b10}\x{0b13}-\x{0b28}\x{0b2a}-\x{0b30}\x{0b32}\x{0b33}\x{0b35}-\x{0b39}\x{0b3d}\x{0b5c}\x{0b5d}\x{0b5f}-\x{0b61}\x{0b71}\x{0b83}\x{0b85}-\x{0b8a}\x{0b8e}-\x{0b90}\x{0b92}-\x{0b95}\x{0b99}\x{0b9a}\x{0b9c}\x{0b9e}\x{0b9f}\x{0ba3}\x{0ba4}\x{0ba8}-\x{0baa}\x{0bae}-\x{0bb9}\x{0bd0}\x{0c05}-\x{0c0c}\x{0c0e}-\x{0c10}\x{0c12}-\x{0c28}\x{0c2a}-\x{0c33}\x{0c35}-\x{0c39}\x{0c3d}\x{0c58}\x{0c59}\x{0c60}\x{0c61}\x{0c85}-\x{0c8c}\x{0c8e}-\x{0c90}\x{0c92}-\x{0ca8}\x{0caa}-\x{0cb3}\x{0cb5}-\x{0cb9}\x{0cbd}\x{0cde}\x{0ce0}\x{0ce1}\x{0cf1}\x{0cf2}\x{0d05}-\x{0d0c}\x{0d0e}-\x{0d10}\x{0d12}-\x{0d3a}\x{0d3d}\x{0d4e}\x{0d60}\x{0d61}\x{0d7a}-\x{0d7f}\x{0d85}-\x{0d96}\x{0d9a}-\x{0db1}\x{0db3}-\x{0dbb}\x{0dbd}\x{0dc0}-\x{0dc6}\x{0e01}-\x{0e30}\x{0e32}\x{0e33}\x{0e40}-\x{0e46}\x{0e81}\x{0e82}\x{0e84}\x{0e87}\x{0e88}\x{0e8a}\x{0e8d}\x{0e94}-\x{0e97}\x{0e99}-\x{0e9f}\x{0ea1}-\x{0ea3}\x{0ea5}\x{0ea7}\x{0eaa}\x{0eab}\x{0ead}-\x{0eb0}\x{0eb2}\x{0eb3}\x{0ebd}\x{0ec0}-\x{0ec4}\x{0ec6}\x{0edc}-\x{0edf}\x{0f00}\x{0f40}-\x{0f47}\x{0f49}-\x{0f6c}\x{0f88}-\x{0f8c}\x{1000}-\x{102a}\x{103f}\x{1050}-\x{1055}\x{105a}-\x{105d}\x{1061}\x{1065}\x{1066}\x{106e}-\x{1070}\x{1075}-\x{1081}\x{108e}\x{10a0}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{10fa}\x{10fc}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1380}-\x{138f}\x{13a0}-\x{13f4}\x{1401}-\x{166c}\x{166f}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16ea}\x{16ee}-\x{16f0}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17d7}\x{17dc}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191c}\x{1950}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19c1}-\x{19c7}\x{1a00}-\x{1a16}\x{1a20}-\x{1a54}\x{1aa7}\x{1b05}-\x{1b33}\x{1b45}-\x{1b4b}\x{1b83}-\x{1ba0}\x{1bae}\x{1baf}\x{1bba}-\x{1be5}\x{1c00}-\x{1c23}\x{1c4d}-\x{1c4f}\x{1c5a}-\x{1c7d}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf1}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{2160}-\x{2188}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{2e2f}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{31a0}-\x{31ba}\x{31f0}-\x{31ff}\x{3400}-\x{4db5}\x{4e00}-\x{9fcc}\x{a000}-\x{a48c}\x{a4d0}-\x{a4fd}\x{a500}-\x{a60c}\x{a610}-\x{a61f}\x{a62a}\x{a62b}\x{a640}-\x{a66e}\x{a67f}-\x{a697}\x{a6a0}-\x{a6ef}\x{a717}-\x{a71f}\x{a722}-\x{a788}\x{a78b}-\x{a78e}\x{a790}-\x{a793}\x{a7a0}-\x{a7aa}\x{a7f8}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a822}\x{a840}-\x{a873}\x{a882}-\x{a8b3}\x{a8f2}-\x{a8f7}\x{a8fb}\x{a90a}-\x{a925}\x{a930}-\x{a946}\x{a960}-\x{a97c}\x{a984}-\x{a9b2}\x{a9cf}\x{aa00}-\x{aa28}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa60}-\x{aa76}\x{aa7a}\x{aa80}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aadd}\x{aae0}-\x{aaea}\x{aaf2}-\x{aaf4}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{abc0}-\x{abe2}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{f900}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb36}\x{fb38}-\x{fb3c}\x{fb3e}\x{fb40}\x{fb41}\x{fb43}\x{fb44}\x{fb46}-\x{fbb1}\x{fbd3}-\x{fd3d}\x{fd50}-\x{fd8f}\x{fd92}-\x{fdc7}\x{fdf0}-\x{fdfb}\x{fe70}-\x{fe74}\x{fe76}-\x{fefc}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}0-9\x{0300}-\x{036f}\x{0483}-\x{0487}\x{0591}-\x{05bd}\x{05bf}\x{05c1}\x{05c2}\x{05c4}\x{05c5}\x{05c7}\x{0610}-\x{061a}\x{064b}-\x{0669}\x{0670}\x{06d6}-\x{06dc}\x{06df}-\x{06e4}\x{06e7}\x{06e8}\x{06ea}-\x{06ed}\x{06f0}-\x{06f9}\x{0711}\x{0730}-\x{074a}\x{07a6}-\x{07b0}\x{07c0}-\x{07c9}\x{07eb}-\x{07f3}\x{0816}-\x{0819}\x{081b}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082d}\x{0859}-\x{085b}\x{08e4}-\x{08fe}\x{0900}-\x{0903}\x{093a}-\x{093c}\x{093e}-\x{094f}\x{0951}-\x{0957}\x{0962}\x{0963}\x{0966}-\x{096f}\x{0981}-\x{0983}\x{09bc}\x{09be}-\x{09c4}\x{09c7}\x{09c8}\x{09cb}-\x{09cd}\x{09d7}\x{09e2}\x{09e3}\x{09e6}-\x{09ef}\x{0a01}-\x{0a03}\x{0a3c}\x{0a3e}-\x{0a42}\x{0a47}\x{0a48}\x{0a4b}-\x{0a4d}\x{0a51}\x{0a66}-\x{0a71}\x{0a75}\x{0a81}-\x{0a83}\x{0abc}\x{0abe}-\x{0ac5}\x{0ac7}-\x{0ac9}\x{0acb}-\x{0acd}\x{0ae2}\x{0ae3}\x{0ae6}-\x{0aef}\x{0b01}-\x{0b03}\x{0b3c}\x{0b3e}-\x{0b44}\x{0b47}\x{0b48}\x{0b4b}-\x{0b4d}\x{0b56}\x{0b57}\x{0b62}\x{0b63}\x{0b66}-\x{0b6f}\x{0b82}\x{0bbe}-\x{0bc2}\x{0bc6}-\x{0bc8}\x{0bca}-\x{0bcd}\x{0bd7}\x{0be6}-\x{0bef}\x{0c01}-\x{0c03}\x{0c3e}-\x{0c44}\x{0c46}-\x{0c48}\x{0c4a}-\x{0c4d}\x{0c55}\x{0c56}\x{0c62}\x{0c63}\x{0c66}-\x{0c6f}\x{0c82}\x{0c83}\x{0cbc}\x{0cbe}-\x{0cc4}\x{0cc6}-\x{0cc8}\x{0cca}-\x{0ccd}\x{0cd5}\x{0cd6}\x{0ce2}\x{0ce3}\x{0ce6}-\x{0cef}\x{0d02}\x{0d03}\x{0d3e}-\x{0d44}\x{0d46}-\x{0d48}\x{0d4a}-\x{0d4d}\x{0d57}\x{0d62}\x{0d63}\x{0d66}-\x{0d6f}\x{0d82}\x{0d83}\x{0dca}\x{0dcf}-\x{0dd4}\x{0dd6}\x{0dd8}-\x{0ddf}\x{0df2}\x{0df3}\x{0e31}\x{0e34}-\x{0e3a}\x{0e47}-\x{0e4e}\x{0e50}-\x{0e59}\x{0eb1}\x{0eb4}-\x{0eb9}\x{0ebb}\x{0ebc}\x{0ec8}-\x{0ecd}\x{0ed0}-\x{0ed9}\x{0f18}\x{0f19}\x{0f20}-\x{0f29}\x{0f35}\x{0f37}\x{0f39}\x{0f3e}\x{0f3f}\x{0f71}-\x{0f84}\x{0f86}\x{0f87}\x{0f8d}-\x{0f97}\x{0f99}-\x{0fbc}\x{0fc6}\x{102b}-\x{103e}\x{1040}-\x{1049}\x{1056}-\x{1059}\x{105e}-\x{1060}\x{1062}-\x{1064}\x{1067}-\x{106d}\x{1071}-\x{1074}\x{1082}-\x{108d}\x{108f}-\x{109d}\x{135d}-\x{135f}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17d3}\x{17dd}\x{17e0}-\x{17e9}\x{180b}-\x{180d}\x{1810}-\x{1819}\x{18a9}\x{1920}-\x{192b}\x{1930}-\x{193b}\x{1946}-\x{194f}\x{19b0}-\x{19c0}\x{19c8}\x{19c9}\x{19d0}-\x{19d9}\x{1a17}-\x{1a1b}\x{1a55}-\x{1a5e}\x{1a60}-\x{1a7c}\x{1a7f}-\x{1a89}\x{1a90}-\x{1a99}\x{1b00}-\x{1b04}\x{1b34}-\x{1b44}\x{1b50}-\x{1b59}\x{1b6b}-\x{1b73}\x{1b80}-\x{1b82}\x{1ba1}-\x{1bad}\x{1bb0}-\x{1bb9}\x{1be6}-\x{1bf3}\x{1c24}-\x{1c37}\x{1c40}-\x{1c49}\x{1c50}-\x{1c59}\x{1cd0}-\x{1cd2}\x{1cd4}-\x{1ce8}\x{1ced}\x{1cf2}-\x{1cf4}\x{1dc0}-\x{1de6}\x{1dfc}-\x{1dff}\x{200c}\x{200d}\x{203f}\x{2040}\x{2054}\x{20d0}-\x{20dc}\x{20e1}\x{20e5}-\x{20f0}\x{2cef}-\x{2cf1}\x{2d7f}\x{2de0}-\x{2dff}\x{302a}-\x{302f}\x{3099}\x{309a}\x{a620}-\x{a629}\x{a66f}\x{a674}-\x{a67d}\x{a69f}\x{a6f0}\x{a6f1}\x{a802}\x{a806}\x{a80b}\x{a823}-\x{a827}\x{a880}\x{a881}\x{a8b4}-\x{a8c4}\x{a8d0}-\x{a8d9}\x{a8e0}-\x{a8f1}\x{a900}-\x{a909}\x{a926}-\x{a92d}\x{a947}-\x{a953}\x{a980}-\x{a983}\x{a9b3}-\x{a9c0}\x{a9d0}-\x{a9d9}\x{aa29}-\x{aa36}\x{aa43}\x{aa4c}\x{aa4d}\x{aa50}-\x{aa59}\x{aa7b}\x{aab0}\x{aab2}-\x{aab4}\x{aab7}\x{aab8}\x{aabe}\x{aabf}\x{aac1}\x{aaeb}-\x{aaef}\x{aaf5}\x{aaf6}\x{abe3}-\x{abea}\x{abec}\x{abed}\x{abf0}-\x{abf9}\x{fb1e}\x{fe00}-\x{fe0f}\x{fe20}-\x{fe26}\x{fe33}\x{fe34}\x{fe4d}-\x{fe4f}\x{ff10}-\x{ff19}\x{ff3f}]*\b';
+
+    /**
+     * Full list of JavaScript reserved words.
+     * Will be loaded from /data/js/keywords_reserved.txt.
+     *
+     * @see https://mathiasbynens.be/notes/reserved-keywords
+     *
+     * @var string[]
+     */
+    protected $keywordsReserved = array();
+
+    /**
+     * List of JavaScript reserved words that accept a <variable, value, ...>
+     * after them. Some end of lines are not the end of a statement, like with
+     * these keywords.
+     *
+     * E.g.: we shouldn't insert a ; after this else
+     * else
+     *     console.log('this is quite fine')
+     *
+     * Will be loaded from /data/js/keywords_before.txt
+     *
+     * @var string[]
+     */
+    protected $keywordsBefore = array();
+
+    /**
+     * List of JavaScript reserved words that accept a <variable, value, ...>
+     * before them. Some end of lines are not the end of a statement, like when
+     * continued by one of these keywords on the newline.
+     *
+     * E.g.: we shouldn't insert a ; before this instanceof
+     * variable
+     *     instanceof String
+     *
+     * Will be loaded from /data/js/keywords_after.txt
+     *
+     * @var string[]
+     */
+    protected $keywordsAfter = array();
+
+    /**
+     * List of all JavaScript operators.
+     *
+     * Will be loaded from /data/js/operators.txt
+     *
+     * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators
+     *
+     * @var string[]
+     */
+    protected $operators = array();
+
+    /**
+     * List of JavaScript operators that accept a <variable, value, ...> after
+     * them. Some end of lines are not the end of a statement, like with these
+     * operators.
+     *
+     * Note: Most operators are fine, we've only removed ++ and --.
+     * ++ & -- have to be joined with the value they're in-/decrementing.
+     *
+     * Will be loaded from /data/js/operators_before.txt
+     *
+     * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators
+     *
+     * @var string[]
+     */
+    protected $operatorsBefore = array();
+
+    /**
+     * List of JavaScript operators that accept a <variable, value, ...> before
+     * them. Some end of lines are not the end of a statement, like when
+     * continued by one of these operators on the newline.
+     *
+     * Note: Most operators are fine, we've only removed ), ], ++, --, ! and ~.
+     * There can't be a newline separating ! or ~ and whatever it is negating.
+     * ++ & -- have to be joined with the value they're in-/decrementing.
+     * ) & ] are "special" in that they have lots or usecases. () for example
+     * is used for function calls, for grouping, in if () and for (), ...
+     *
+     * Will be loaded from /data/js/operators_after.txt
+     *
+     * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators
+     *
+     * @var string[]
+     */
+    protected $operatorsAfter = array();
+
+    /**
+     * {@inheritdoc}
+     */
+    public function __construct()
+    {
+        call_user_func_array(array('parent', '__construct'), func_get_args());
+
+        $dataDir = __DIR__.'/../data/js/';
+        $options = FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES;
+        $this->keywordsReserved = file($dataDir.'keywords_reserved.txt', $options);
+        $this->keywordsBefore = file($dataDir.'keywords_before.txt', $options);
+        $this->keywordsAfter = file($dataDir.'keywords_after.txt', $options);
+        $this->operators = file($dataDir.'operators.txt', $options);
+        $this->operatorsBefore = file($dataDir.'operators_before.txt', $options);
+        $this->operatorsAfter = file($dataDir.'operators_after.txt', $options);
+    }
+
+    /**
+     * Minify the data.
+     * Perform JS optimizations.
+     *
+     * @param string[optional] $path Path to write the data to
+     *
+     * @return string The minified data
+     */
+    public function execute($path = null)
+    {
+        $content = '';
+
+        /*
+         * Let's first take out strings, comments and regular expressions.
+         * All of these can contain JS code-like characters, and we should make
+         * sure any further magic ignores anything inside of these.
+         *
+         * Consider this example, where we should not strip any whitespace:
+         * var str = "a   test";
+         *
+         * Comments will be removed altogether, strings and regular expressions
+         * will be replaced by placeholder text, which we'll restore later.
+         */
+        $this->extractStrings('\'"`');
+        $this->stripComments();
+        $this->extractRegex();
+
+        // loop files
+        foreach ($this->data as $source => $js) {
+            // take out strings, comments & regex (for which we've registered
+            // the regexes just a few lines earlier)
+            $js = $this->replace($js);
+
+            $js = $this->propertyNotation($js);
+            $js = $this->shortenBools($js);
+            $js = $this->stripWhitespace($js);
+
+            // combine js: separating the scripts by a ;
+            $content .= $js.";";
+        }
+
+        // clean up leftover `;`s from the combination of multiple scripts
+        $content = ltrim($content, ';');
+        $content = (string) substr($content, 0, -1);
+
+        /*
+         * Earlier, we extracted strings & regular expressions and replaced them
+         * with placeholder text. This will restore them.
+         */
+        $content = $this->restoreExtractedData($content);
+
+        return $content;
+    }
+
+    /**
+     * Strip comments from source code.
+     */
+    protected function stripComments()
+    {
+        // single-line comments
+        $this->registerPattern('/\/\/.*$/m', '');
+
+        // multi-line comments
+        $this->registerPattern('/\/\*.*?\*\//s', '');
+    }
+
+    /**
+     * JS can have /-delimited regular expressions, like: /ab+c/.match(string).
+     *
+     * The content inside the regex can contain characters that may be confused
+     * for JS code: e.g. it could contain whitespace it needs to match & we
+     * don't want to strip whitespace in there.
+     *
+     * The regex can be pretty simple: we don't have to care about comments,
+     * (which also use slashes) because stripComments() will have stripped those
+     * already.
+     *
+     * This method will replace all string content with simple REGEX#
+     * placeholder text, so we've rid all regular expressions from characters
+     * that may be misinterpreted. Original regex content will be saved in
+     * $this->extracted and after doing all other minifying, we can restore the
+     * original content via restoreRegex()
+     */
+    protected function extractRegex()
+    {
+        // PHP only supports $this inside anonymous functions since 5.4
+        $minifier = $this;
+        $callback = function ($match) use ($minifier) {
+            $count = count($minifier->extracted);
+            $placeholder = '"'.$count.'"';
+            $minifier->extracted[$placeholder] = $match[0];
+
+            return $placeholder;
+        };
+
+        // match all chars except `/` and `\`
+        // `\` is allowed though, along with whatever char follows (which is the
+        // one being escaped)
+        // this should allow all chars, except for an unescaped `/` (= the one
+        // closing the regex)
+        // then also ignore bare `/` inside `[]`, where they don't need to be
+        // escaped: anything inside `[]` can be ignored safely
+        $pattern = '\\/(?:[^\\[\\/\\\\\n\r]+|(?:\\\\.)+|(?:\\[(?:[^\\]\\\\\n\r]+|(?:\\\\.)+)+\\])+)++\\/[gimuy]*';
+
+        // a regular expression can only be followed by a few operators or some
+        // of the RegExp methods (a `\` followed by a variable or value is
+        // likely part of a division, not a regex)
+        $keywords = array('do', 'in', 'new', 'else', 'throw', 'yield', 'delete', 'return',  'typeof');
+        $before = '([=:,;\+\-\*\/\}\(\{\[&\|!]|^|'.implode('|', $keywords).')\s*';
+        $propertiesAndMethods = array(
+            // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Properties_2
+            'constructor',
+            'flags',
+            'global',
+            'ignoreCase',
+            'multiline',
+            'source',
+            'sticky',
+            'unicode',
+            // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Methods_2
+            'compile(',
+            'exec(',
+            'test(',
+            'toSource(',
+            'toString(',
+        );
+        $delimiters = array_fill(0, count($propertiesAndMethods), '/');
+        $propertiesAndMethods = array_map('preg_quote', $propertiesAndMethods, $delimiters);
+        $after = '(?=\s*([\.,;\)\}&\|+]|\/\/|$|\.('.implode('|', $propertiesAndMethods).')))';
+        $this->registerPattern('/'.$before.'\K'.$pattern.$after.'/', $callback);
+
+        // regular expressions following a `)` are rather annoying to detect...
+        // quite often, `/` after `)` is a division operator & if it happens to
+        // be followed by another one (or a comment), it is likely to be
+        // confused for a regular expression
+        // however, it's perfectly possible for a regex to follow a `)`: after
+        // a single-line `if()`, `while()`, ... statement, for example
+        // since, when they occur like that, they're always the start of a
+        // statement, there's only a limited amount of ways they can be useful:
+        // by calling the regex methods directly
+        // if a regex following `)` is not followed by `.<property or method>`,
+        // it's quite likely not a regex
+        $before = '\)\s*';
+        $after = '(?=\s*\.('.implode('|', $propertiesAndMethods).'))';
+        $this->registerPattern('/'.$before.'\K'.$pattern.$after.'/', $callback);
+
+        // 1 more edge case: a regex can be followed by a lot more operators or
+        // keywords if there's a newline (ASI) in between, where the operator
+        // actually starts a new statement
+        // (https://github.com/matthiasmullie/minify/issues/56)
+        $operators = $this->getOperatorsForRegex($this->operatorsBefore, '/');
+        $operators += $this->getOperatorsForRegex($this->keywordsReserved, '/');
+        $after = '(?=\s*\n\s*('.implode('|', $operators).'))';
+        $this->registerPattern('/'.$pattern.$after.'/', $callback);
+    }
+
+    /**
+     * Strip whitespace.
+     *
+     * We won't strip *all* whitespace, but as much as possible. The thing that
+     * we'll preserve are newlines we're unsure about.
+     * JavaScript doesn't require statements to be terminated with a semicolon.
+     * It will automatically fix missing semicolons with ASI (automatic semi-
+     * colon insertion) at the end of line causing errors (without semicolon.)
+     *
+     * Because it's sometimes hard to tell if a newline is part of a statement
+     * that should be terminated or not, we'll just leave some of them alone.
+     *
+     * @param string $content The content to strip the whitespace for
+     *
+     * @return string
+     */
+    protected function stripWhitespace($content)
+    {
+        // uniform line endings, make them all line feed
+        $content = str_replace(array("\r\n", "\r"), "\n", $content);
+
+        // collapse all non-line feed whitespace into a single space
+        $content = preg_replace('/[^\S\n]+/', ' ', $content);
+
+        // strip leading & trailing whitespace
+        $content = str_replace(array(" \n", "\n "), "\n", $content);
+
+        // collapse consecutive line feeds into just 1
+        $content = preg_replace('/\n+/', "\n", $content);
+
+        $operatorsBefore = $this->getOperatorsForRegex($this->operatorsBefore, '/');
+        $operatorsAfter = $this->getOperatorsForRegex($this->operatorsAfter, '/');
+        $operators = $this->getOperatorsForRegex($this->operators, '/');
+        $keywordsBefore = $this->getKeywordsForRegex($this->keywordsBefore, '/');
+        $keywordsAfter = $this->getKeywordsForRegex($this->keywordsAfter, '/');
+
+        // strip whitespace that ends in (or next line begin with) an operator
+        // that allows statements to be broken up over multiple lines
+        unset($operatorsBefore['+'], $operatorsBefore['-'], $operatorsAfter['+'], $operatorsAfter['-']);
+        $content = preg_replace(
+            array(
+                '/('.implode('|', $operatorsBefore).')\s+/',
+                '/\s+('.implode('|', $operatorsAfter).')/',
+            ), '\\1', $content
+        );
+
+        // make sure + and - can't be mistaken for, or joined into ++ and --
+        $content = preg_replace(
+            array(
+                '/(?<![\+\-])\s*([\+\-])(?![\+\-])/',
+                '/(?<![\+\-])([\+\-])\s*(?![\+\-])/',
+            ), '\\1', $content
+        );
+
+        // collapse whitespace around reserved words into single space
+        $content = preg_replace('/(^|[;\}\s])\K('.implode('|', $keywordsBefore).')\s+/', '\\2 ', $content);
+        $content = preg_replace('/\s+('.implode('|', $keywordsAfter).')(?=([;\{\s]|$))/', ' \\1', $content);
+
+        /*
+         * We didn't strip whitespace after a couple of operators because they
+         * could be used in different contexts and we can't be sure it's ok to
+         * strip the newlines. However, we can safely strip any non-line feed
+         * whitespace that follows them.
+         */
+        $operatorsDiffBefore = array_diff($operators, $operatorsBefore);
+        $operatorsDiffAfter = array_diff($operators, $operatorsAfter);
+        $content = preg_replace('/('.implode('|', $operatorsDiffBefore).')[^\S\n]+/', '\\1', $content);
+        $content = preg_replace('/[^\S\n]+('.implode('|', $operatorsDiffAfter).')/', '\\1', $content);
+
+        /*
+         * Whitespace after `return` can be omitted in a few occasions
+         * (such as when followed by a string or regex)
+         * Same for whitespace in between `)` and `{`, or between `{` and some
+         * keywords.
+         */
+        $content = preg_replace('/\breturn\s+(["\'\/\+\-])/', 'return$1', $content);
+        $content = preg_replace('/\)\s+\{/', '){', $content);
+        $content = preg_replace('/}\n(else|catch|finally)\b/', '}$1', $content);
+
+        /*
+         * Get rid of double semicolons, except where they can be used like:
+         * "for(v=1,_=b;;)", "for(v=1;;v++)" or "for(;;ja||(ja=true))".
+         * I'll safeguard these double semicolons inside for-loops by
+         * temporarily replacing them with an invalid condition: they won't have
+         * a double semicolon and will be easy to spot to restore afterwards.
+         */
+        $content = preg_replace('/\bfor\(([^;]*);;([^;]*)\)/', 'for(\\1;-;\\2)', $content);
+        $content = preg_replace('/;+/', ';', $content);
+        $content = preg_replace('/\bfor\(([^;]*);-;([^;]*)\)/', 'for(\\1;;\\2)', $content);
+
+        /*
+         * Next, we'll be removing all semicolons where ASI kicks in.
+         * for-loops however, can have an empty body (ending in only a
+         * semicolon), like: `for(i=1;i<3;i++);`, of `for(i in list);`
+         * Here, nothing happens during the loop; it's just used to keep
+         * increasing `i`. With that ; omitted, the next line would be expected
+         * to be the for-loop's body... Same goes for while loops.
+         * I'm going to double that semicolon (if any) so after the next line,
+         * which strips semicolons here & there, we're still left with this one.
+         */
+        $content = preg_replace('/(for\([^;\{]*;[^;\{]*;[^;\{]*\));(\}|$)/s', '\\1;;\\2', $content);
+        $content = preg_replace('/(for\([^;\{]+\s+in\s+[^;\{]+\));(\}|$)/s', '\\1;;\\2', $content);
+        /*
+         * Below will also keep `;` after a `do{}while();` along with `while();`
+         * While these could be stripped after do-while, detecting this
+         * distinction is cumbersome, so I'll play it safe and make sure `;`
+         * after any kind of `while` is kept.
+         */
+        $content = preg_replace('/(while\([^;\{]+\));(\}|$)/s', '\\1;;\\2', $content);
+
+        /*
+         * We also can't strip empty else-statements. Even though they're
+         * useless and probably shouldn't be in the code in the first place, we
+         * shouldn't be stripping the `;` that follows it as it breaks the code.
+         * We can just remove those useless else-statements completely.
+         *
+         * @see https://github.com/matthiasmullie/minify/issues/91
+         */
+        $content = preg_replace('/else;/s', '', $content);
+
+        /*
+         * We also don't really want to terminate statements followed by closing
+         * curly braces (which we've ignored completely up until now) or end-of-
+         * script: ASI will kick in here & we're all about minifying.
+         * Semicolons at beginning of the file don't make any sense either.
+         */
+        $content = preg_replace('/;(\}|$)/s', '\\1', $content);
+        $content = ltrim($content, ';');
+
+        // get rid of remaining whitespace af beginning/end
+        return trim($content);
+    }
+
+    /**
+     * We'll strip whitespace around certain operators with regular expressions.
+     * This will prepare the given array by escaping all characters.
+     *
+     * @param string[] $operators
+     * @param string   $delimiter
+     *
+     * @return string[]
+     */
+    protected function getOperatorsForRegex(array $operators, $delimiter = '/')
+    {
+        // escape operators for use in regex
+        $delimiters = array_fill(0, count($operators), $delimiter);
+        $escaped = array_map('preg_quote', $operators, $delimiters);
+
+        $operators = array_combine($operators, $escaped);
+
+        // ignore + & - for now, they'll get special treatment
+        unset($operators['+'], $operators['-']);
+
+        // dot can not just immediately follow a number; it can be confused for
+        // decimal point, or calling a method on it, e.g. 42 .toString()
+        $operators['.'] = '(?<![0-9]\s)\.';
+
+        // don't confuse = with other assignment shortcuts (e.g. +=)
+        $chars = preg_quote('+-*\=<>%&|', $delimiter);
+        $operators['='] = '(?<!['.$chars.'])\=';
+
+        return $operators;
+    }
+
+    /**
+     * We'll strip whitespace around certain keywords with regular expressions.
+     * This will prepare the given array by escaping all characters.
+     *
+     * @param string[] $keywords
+     * @param string   $delimiter
+     *
+     * @return string[]
+     */
+    protected function getKeywordsForRegex(array $keywords, $delimiter = '/')
+    {
+        // escape keywords for use in regex
+        $delimiter = array_fill(0, count($keywords), $delimiter);
+        $escaped = array_map('preg_quote', $keywords, $delimiter);
+
+        // add word boundaries
+        array_walk($keywords, function ($value) {
+            return '\b'.$value.'\b';
+        });
+
+        $keywords = array_combine($keywords, $escaped);
+
+        return $keywords;
+    }
+
+    /**
+     * Replaces all occurrences of array['key'] by array.key.
+     *
+     * @param string $content
+     *
+     * @return string
+     */
+    protected function propertyNotation($content)
+    {
+        // PHP only supports $this inside anonymous functions since 5.4
+        $minifier = $this;
+        $keywords = $this->keywordsReserved;
+        $callback = function ($match) use ($minifier, $keywords) {
+            $property = trim($minifier->extracted[$match[1]], '\'"');
+
+            /*
+             * Check if the property is a reserved keyword. In this context (as
+             * property of an object literal/array) it shouldn't matter, but IE8
+             * freaks out with "Expected identifier".
+             */
+            if (in_array($property, $keywords)) {
+                return $match[0];
+            }
+
+            /*
+             * See if the property is in a variable-like format (e.g.
+             * array['key-here'] can't be replaced by array.key-here since '-'
+             * is not a valid character there.
+             */
+            if (!preg_match('/^'.$minifier::REGEX_VARIABLE.'$/u', $property)) {
+                return $match[0];
+            }
+
+            return '.'.$property;
+        };
+
+        /*
+         * Figure out if previous character is a variable name (of the array
+         * we want to use property notation on) - this is to make sure
+         * standalone ['value'] arrays aren't confused for keys-of-an-array.
+         * We can (and only have to) check the last character, because PHP's
+         * regex implementation doesn't allow unfixed-length look-behind
+         * assertions.
+         */
+        preg_match('/(\[[^\]]+\])[^\]]*$/', static::REGEX_VARIABLE, $previousChar);
+        $previousChar = $previousChar[1];
+
+        /*
+         * Make sure word preceding the ['value'] is not a keyword, e.g.
+         * return['x']. Because -again- PHP's regex implementation doesn't allow
+         * unfixed-length look-behind assertions, I'm just going to do a lot of
+         * separate look-behind assertions, one for each keyword.
+         */
+        $keywords = $this->getKeywordsForRegex($keywords);
+        $keywords = '(?<!'.implode(')(?<!', $keywords).')';
+
+        return preg_replace_callback('/(?<='.$previousChar.'|\])'.$keywords.'\[\s*(([\'"])[0-9]+\\2)\s*\]/u', $callback, $content);
+    }
+
+    /**
+     * Replaces true & false by !0 and !1.
+     *
+     * @param string $content
+     *
+     * @return string
+     */
+    protected function shortenBools($content)
+    {
+        /*
+         * 'true' or 'false' could be used as property names (which may be
+         * followed by whitespace) - we must not replace those!
+         * Since PHP doesn't allow variable-length (to account for the
+         * whitespace) lookbehind assertions, I need to capture the leading
+         * character and check if it's a `.`
+         */
+        $callback = function ($match) {
+            if (trim($match[1]) === '.') {
+                return $match[0];
+            }
+
+            return $match[1].($match[2] === 'true' ? '!0' : '!1');
+        };
+        $content = preg_replace_callback('/(^|.\s*)\b(true|false)\b(?!:)/', $callback, $content);
+
+        // for(;;) is exactly the same as while(true), but shorter :)
+        $content = preg_replace('/\bwhile\(!0\){/', 'for(;;){', $content);
+
+        // now make sure we didn't turn any do ... while(true) into do ... for(;;)
+        preg_match_all('/\bdo\b/', $content, $dos, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
+
+        // go backward to make sure positional offsets aren't altered when $content changes
+        $dos = array_reverse($dos);
+        foreach ($dos as $do) {
+            $offsetDo = $do[0][1];
+
+            // find all `while` (now `for`) following `do`: one of those must be
+            // associated with the `do` and be turned back into `while`
+            preg_match_all('/\bfor\(;;\)/', $content, $whiles, PREG_OFFSET_CAPTURE | PREG_SET_ORDER, $offsetDo);
+            foreach ($whiles as $while) {
+                $offsetWhile = $while[0][1];
+
+                $open = substr_count($content, '{', $offsetDo, $offsetWhile - $offsetDo);
+                $close = substr_count($content, '}', $offsetDo, $offsetWhile - $offsetDo);
+                if ($open === $close) {
+                    // only restore `while` if amount of `{` and `}` are the same;
+                    // otherwise, that `for` isn't associated with this `do`
+                    $content = substr_replace($content, 'while(!0)', $offsetWhile, strlen('for(;;)'));
+                    break;
+                }
+            }
+        }
+
+        return $content;
+    }
+}
Index: /lib/vendor/matthiasmullie/minify/src/Minify.php
===================================================================
--- /lib/vendor/matthiasmullie/minify/src/Minify.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/minify/src/Minify.php	(revision 7114)
@@ -0,0 +1,459 @@
+<?php
+/**
+ * Abstract minifier class
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+namespace MatthiasMullie\Minify;
+
+use MatthiasMullie\Minify\Exceptions\IOException;
+use Psr\Cache\CacheItemInterface;
+
+/**
+ * Abstract minifier class.
+ *
+ * Please report bugs on https://github.com/matthiasmullie/minify/issues
+ *
+ * @package Minify
+ * @author Matthias Mullie <minify@mullie.eu>
+ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+abstract class Minify
+{
+    /**
+     * The data to be minified.
+     *
+     * @var string[]
+     */
+    protected $data = array();
+
+    /**
+     * Array of patterns to match.
+     *
+     * @var string[]
+     */
+    protected $patterns = array();
+
+    /**
+     * This array will hold content of strings and regular expressions that have
+     * been extracted from the JS source code, so we can reliably match "code",
+     * without having to worry about potential "code-like" characters inside.
+     *
+     * @var string[]
+     */
+    public $extracted = array();
+
+    /**
+     * Init the minify class - optionally, code may be passed along already.
+     */
+    public function __construct(/* $data = null, ... */)
+    {
+        // it's possible to add the source through the constructor as well ;)
+        if (func_num_args()) {
+            call_user_func_array(array($this, 'add'), func_get_args());
+        }
+    }
+
+    /**
+     * Add a file or straight-up code to be minified.
+     *
+     * @param string|string[] $data
+     *
+     * @return static
+     */
+    public function add($data /* $data = null, ... */)
+    {
+        // bogus "usage" of parameter $data: scrutinizer warns this variable is
+        // not used (we're using func_get_args instead to support overloading),
+        // but it still needs to be defined because it makes no sense to have
+        // this function without argument :)
+        $args = array($data) + func_get_args();
+
+        // this method can be overloaded
+        foreach ($args as $data) {
+            if (is_array($data)) {
+                call_user_func_array(array($this, 'add'), $data);
+                continue;
+            }
+
+            // redefine var
+            $data = (string) $data;
+
+            // load data
+            $value = $this->load($data);
+            $key = ($data != $value) ? $data : count($this->data);
+
+            // replace CR linefeeds etc.
+            // @see https://github.com/matthiasmullie/minify/pull/139
+            $value = str_replace(array("\r\n", "\r"), "\n", $value);
+
+            // store data
+            $this->data[$key] = $value;
+        }
+
+        return $this;
+    }
+
+    /**
+     * Minify the data & (optionally) saves it to a file.
+     *
+     * @param string[optional] $path Path to write the data to
+     *
+     * @return string The minified data
+     */
+    public function minify($path = null)
+    {
+        $content = $this->execute($path);
+
+        // save to path
+        if ($path !== null) {
+            $this->save($content, $path);
+        }
+
+        return $content;
+    }
+
+    /**
+     * Minify & gzip the data & (optionally) saves it to a file.
+     *
+     * @param string[optional] $path  Path to write the data to
+     * @param int[optional]    $level Compression level, from 0 to 9
+     *
+     * @return string The minified & gzipped data
+     */
+    public function gzip($path = null, $level = 9)
+    {
+        $content = $this->execute($path);
+        $content = gzencode($content, $level, FORCE_GZIP);
+
+        // save to path
+        if ($path !== null) {
+            $this->save($content, $path);
+        }
+
+        return $content;
+    }
+
+    /**
+     * Minify the data & write it to a CacheItemInterface object.
+     *
+     * @param CacheItemInterface $item Cache item to write the data to
+     *
+     * @return CacheItemInterface Cache item with the minifier data
+     */
+    public function cache(CacheItemInterface $item)
+    {
+        $content = $this->execute();
+        $item->set($content);
+
+        return $item;
+    }
+
+    /**
+     * Minify the data.
+     *
+     * @param string[optional] $path Path to write the data to
+     *
+     * @return string The minified data
+     */
+    abstract public function execute($path = null);
+
+    /**
+     * Load data.
+     *
+     * @param string $data Either a path to a file or the content itself
+     *
+     * @return string
+     */
+    protected function load($data)
+    {
+        // check if the data is a file
+        if ($this->canImportFile($data)) {
+            $data = file_get_contents($data);
+
+            // strip BOM, if any
+            if (substr($data, 0, 3) == "\xef\xbb\xbf") {
+                $data = substr($data, 3);
+            }
+        }
+
+        return $data;
+    }
+
+    /**
+     * Save to file.
+     *
+     * @param string $content The minified data
+     * @param string $path    The path to save the minified data to
+     *
+     * @throws IOException
+     */
+    protected function save($content, $path)
+    {
+        $handler = $this->openFileForWriting($path);
+
+        $this->writeToFile($handler, $content);
+
+        @fclose($handler);
+    }
+
+    /**
+     * Register a pattern to execute against the source content.
+     *
+     * @param string          $pattern     PCRE pattern
+     * @param string|callable $replacement Replacement value for matched pattern
+     */
+    protected function registerPattern($pattern, $replacement = '')
+    {
+        // study the pattern, we'll execute it more than once
+        $pattern .= 'S';
+
+        $this->patterns[] = array($pattern, $replacement);
+    }
+
+    /**
+     * We can't "just" run some regular expressions against JavaScript: it's a
+     * complex language. E.g. having an occurrence of // xyz would be a comment,
+     * unless it's used within a string. Of you could have something that looks
+     * like a 'string', but inside a comment.
+     * The only way to accurately replace these pieces is to traverse the JS one
+     * character at a time and try to find whatever starts first.
+     *
+     * @param string $content The content to replace patterns in
+     *
+     * @return string The (manipulated) content
+     */
+    protected function replace($content)
+    {
+        $processed = '';
+        $positions = array_fill(0, count($this->patterns), -1);
+        $matches = array();
+
+        while ($content) {
+            // find first match for all patterns
+            foreach ($this->patterns as $i => $pattern) {
+                list($pattern, $replacement) = $pattern;
+
+                // we can safely ignore patterns for positions we've unset earlier,
+                // because we know these won't show up anymore
+                if (!isset($positions[$i])) {
+                    continue;
+                }
+
+                // no need to re-run matches that are still in the part of the
+                // content that hasn't been processed
+                if ($positions[$i] >= 0) {
+                    continue;
+                }
+
+                $match = null;
+                if (preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE)) {
+                    $matches[$i] = $match;
+
+                    // we'll store the match position as well; that way, we
+                    // don't have to redo all preg_matches after changing only
+                    // the first (we'll still know where those others are)
+                    $positions[$i] = $match[0][1];
+                } else {
+                    // if the pattern couldn't be matched, there's no point in
+                    // executing it again in later runs on this same content;
+                    // ignore this one until we reach end of content
+                    unset($matches[$i], $positions[$i]);
+                }
+            }
+
+            // no more matches to find: everything's been processed, break out
+            if (!$matches) {
+                $processed .= $content;
+                break;
+            }
+
+            // see which of the patterns actually found the first thing (we'll
+            // only want to execute that one, since we're unsure if what the
+            // other found was not inside what the first found)
+            $discardLength = min($positions);
+            $firstPattern = array_search($discardLength, $positions);
+            $match = $matches[$firstPattern][0][0];
+
+            // execute the pattern that matches earliest in the content string
+            list($pattern, $replacement) = $this->patterns[$firstPattern];
+            $replacement = $this->replacePattern($pattern, $replacement, $content);
+
+            // figure out which part of the string was unmatched; that's the
+            // part we'll execute the patterns on again next
+            $content = (string) substr($content, $discardLength);
+            $unmatched = (string) substr($content, strpos($content, $match) + strlen($match));
+
+            // move the replaced part to $processed and prepare $content to
+            // again match batch of patterns against
+            $processed .= substr($replacement, 0, strlen($replacement) - strlen($unmatched));
+            $content = $unmatched;
+
+            // first match has been replaced & that content is to be left alone,
+            // the next matches will start after this replacement, so we should
+            // fix their offsets
+            foreach ($positions as $i => $position) {
+                $positions[$i] -= $discardLength + strlen($match);
+            }
+        }
+
+        return $processed;
+    }
+
+    /**
+     * This is where a pattern is matched against $content and the matches
+     * are replaced by their respective value.
+     * This function will be called plenty of times, where $content will always
+     * move up 1 character.
+     *
+     * @param string          $pattern     Pattern to match
+     * @param string|callable $replacement Replacement value
+     * @param string          $content     Content to match pattern against
+     *
+     * @return string
+     */
+    protected function replacePattern($pattern, $replacement, $content)
+    {
+        if (is_callable($replacement)) {
+            return preg_replace_callback($pattern, $replacement, $content, 1, $count);
+        } else {
+            return preg_replace($pattern, $replacement, $content, 1, $count);
+        }
+    }
+
+    /**
+     * Strings are a pattern we need to match, in order to ignore potential
+     * code-like content inside them, but we just want all of the string
+     * content to remain untouched.
+     *
+     * This method will replace all string content with simple STRING#
+     * placeholder text, so we've rid all strings from characters that may be
+     * misinterpreted. Original string content will be saved in $this->extracted
+     * and after doing all other minifying, we can restore the original content
+     * via restoreStrings().
+     *
+     * @param string[optional] $chars
+     * @param string[optional] $placeholderPrefix
+     */
+    protected function extractStrings($chars = '\'"', $placeholderPrefix = '')
+    {
+        // PHP only supports $this inside anonymous functions since 5.4
+        $minifier = $this;
+        $callback = function ($match) use ($minifier, $placeholderPrefix) {
+            // check the second index here, because the first always contains a quote
+            if ($match[2] === '') {
+                /*
+                 * Empty strings need no placeholder; they can't be confused for
+                 * anything else anyway.
+                 * But we still needed to match them, for the extraction routine
+                 * to skip over this particular string.
+                 */
+                return $match[0];
+            }
+
+            $count = count($minifier->extracted);
+            $placeholder = $match[1].$placeholderPrefix.$count.$match[1];
+            $minifier->extracted[$placeholder] = $match[1].$match[2].$match[1];
+
+            return $placeholder;
+        };
+
+        /*
+         * The \\ messiness explained:
+         * * Don't count ' or " as end-of-string if it's escaped (has backslash
+         * in front of it)
+         * * Unless... that backslash itself is escaped (another leading slash),
+         * in which case it's no longer escaping the ' or "
+         * * So there can be either no backslash, or an even number
+         * * multiply all of that times 4, to account for the escaping that has
+         * to be done to pass the backslash into the PHP string without it being
+         * considered as escape-char (times 2) and to get it in the regex,
+         * escaped (times 2)
+         */
+        $this->registerPattern('/(['.$chars.'])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
+    }
+
+    /**
+     * This method will restore all extracted data (strings, regexes) that were
+     * replaced with placeholder text in extract*(). The original content was
+     * saved in $this->extracted.
+     *
+     * @param string $content
+     *
+     * @return string
+     */
+    protected function restoreExtractedData($content)
+    {
+        if (!$this->extracted) {
+            // nothing was extracted, nothing to restore
+            return $content;
+        }
+
+        $content = strtr($content, $this->extracted);
+
+        $this->extracted = array();
+
+        return $content;
+    }
+
+    /**
+     * Check if the path is a regular file and can be read.
+     *
+     * @param string $path
+     *
+     * @return bool
+     */
+    protected function canImportFile($path)
+    {
+        $parsed = parse_url($path);
+        if (
+            // file is elsewhere
+            isset($parsed['host']) ||
+            // file responds to queries (may change, or need to bypass cache)
+            isset($parsed['query'])
+        ) {
+            return false;
+        }
+
+        return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path);
+    }
+
+    /**
+     * Attempts to open file specified by $path for writing.
+     *
+     * @param string $path The path to the file
+     *
+     * @return resource Specifier for the target file
+     *
+     * @throws IOException
+     */
+    protected function openFileForWriting($path)
+    {
+        if (($handler = @fopen($path, 'w')) === false) {
+            throw new IOException('The file "'.$path.'" could not be opened for writing. Check if PHP has enough permissions.');
+        }
+
+        return $handler;
+    }
+
+    /**
+     * Attempts to write $content to the file specified by $handler. $path is used for printing exceptions.
+     *
+     * @param resource $handler The resource to write to
+     * @param string   $content The content to write
+     * @param string   $path    The path to the file (for exception printing only)
+     *
+     * @throws IOException
+     */
+    protected function writeToFile($handler, $content, $path = '')
+    {
+        if (($result = @fwrite($handler, $content)) === false || ($result < strlen($content))) {
+            throw new IOException('The file "'.$path.'" could not be written to. Check your disk space and file permissions.');
+        }
+    }
+}
Index: /lib/vendor/matthiasmullie/path-converter/LICENSE
===================================================================
--- /lib/vendor/matthiasmullie/path-converter/LICENSE	(revision 7114)
+++ /lib/vendor/matthiasmullie/path-converter/LICENSE	(revision 7114)
@@ -0,0 +1,18 @@
+Copyright (c) 2015 Matthias Mullie
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index: /lib/vendor/matthiasmullie/path-converter/composer.json
===================================================================
--- /lib/vendor/matthiasmullie/path-converter/composer.json	(revision 7114)
+++ /lib/vendor/matthiasmullie/path-converter/composer.json	(revision 7114)
@@ -0,0 +1,28 @@
+{
+    "name": "matthiasmullie/path-converter",
+    "type": "library",
+    "description": "Relative path converter",
+    "keywords": ["relative", "path", "converter", "paths"],
+    "homepage": "http://github.com/matthiasmullie/path-converter",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Matthias Mullie",
+            "homepage": "http://www.mullie.eu",
+            "email": "pathconverter@mullie.eu",
+            "role": "Developer"
+        }
+    ],
+    "require": {
+        "php": ">=5.3.0",
+        "ext-pcre": "*"
+    },
+    "require-dev": {
+        "phpunit/phpunit": "~4.8"
+    },
+    "autoload": {
+        "psr-4": {
+            "MatthiasMullie\\PathConverter\\": "src/"
+        }
+    }
+}
Index: /lib/vendor/matthiasmullie/path-converter/src/Converter.php
===================================================================
--- /lib/vendor/matthiasmullie/path-converter/src/Converter.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/path-converter/src/Converter.php	(revision 7114)
@@ -0,0 +1,195 @@
+<?php
+
+namespace MatthiasMullie\PathConverter;
+
+/**
+ * Convert paths relative from 1 file to another.
+ *
+ * E.g.
+ *     ../../images/icon.jpg relative to /css/imports/icons.css
+ * becomes
+ *     ../images/icon.jpg relative to /css/minified.css
+ *
+ * Please report bugs on https://github.com/matthiasmullie/path-converter/issues
+ *
+ * @author Matthias Mullie <pathconverter@mullie.eu>
+ * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+class Converter implements ConverterInterface
+{
+    /**
+     * @var string
+     */
+    protected $from;
+
+    /**
+     * @var string
+     */
+    protected $to;
+
+    /**
+     * @param string $from The original base path (directory, not file!)
+     * @param string $to   The new base path (directory, not file!)
+     */
+    public function __construct($from, $to)
+    {
+        $shared = $this->shared($from, $to);
+        if ($shared === '') {
+            // when both paths have nothing in common, one of them is probably
+            // absolute while the other is relative
+            $cwd = getcwd();
+            $from = strpos($from, $cwd) === 0 ? $from : $cwd.'/'.$from;
+            $to = strpos($to, $cwd) === 0 ? $to : $cwd.'/'.$to;
+
+            // or traveling the tree via `..`
+            // attempt to resolve path, or assume it's fine if it doesn't exist
+            $from = @realpath($from) ?: $from;
+            $to = @realpath($to) ?: $to;
+        }
+
+        $from = $this->dirname($from);
+        $to = $this->dirname($to);
+
+        $from = $this->normalize($from);
+        $to = $this->normalize($to);
+
+        $this->from = $from;
+        $this->to = $to;
+    }
+
+    /**
+     * Normalize path.
+     *
+     * @param string $path
+     *
+     * @return string
+     */
+    protected function normalize($path)
+    {
+        // deal with different operating systems' directory structure
+        $path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/');
+
+        /*
+         * Example:
+         *     /home/forkcms/frontend/cache/compiled_templates/../../core/layout/css/../images/img.gif
+         * to
+         *     /home/forkcms/frontend/core/layout/images/img.gif
+         */
+        do {
+            $path = preg_replace('/[^\/]+(?<!\.\.)\/\.\.\//', '', $path, -1, $count);
+        } while ($count);
+
+        return $path;
+    }
+
+    /**
+     * Figure out the shared path of 2 locations.
+     *
+     * Example:
+     *     /home/forkcms/frontend/core/layout/images/img.gif
+     * and
+     *     /home/forkcms/frontend/cache/minified_css
+     * share
+     *     /home/forkcms/frontend
+     *
+     * @param string $path1
+     * @param string $path2
+     *
+     * @return string
+     */
+    protected function shared($path1, $path2)
+    {
+        // $path could theoretically be empty (e.g. no path is given), in which
+        // case it shouldn't expand to array(''), which would compare to one's
+        // root /
+        $path1 = $path1 ? explode('/', $path1) : array();
+        $path2 = $path2 ? explode('/', $path2) : array();
+
+        $shared = array();
+
+        // compare paths & strip identical ancestors
+        foreach ($path1 as $i => $chunk) {
+            if (isset($path2[$i]) && $path1[$i] == $path2[$i]) {
+                $shared[] = $chunk;
+            } else {
+                break;
+            }
+        }
+
+        return implode('/', $shared);
+    }
+
+    /**
+     * Convert paths relative from 1 file to another.
+     *
+     * E.g.
+     *     ../images/img.gif relative to /home/forkcms/frontend/core/layout/css
+     * should become:
+     *     ../../core/layout/images/img.gif relative to
+     *     /home/forkcms/frontend/cache/minified_css
+     *
+     * @param string $path The relative path that needs to be converted
+     *
+     * @return string The new relative path
+     */
+    public function convert($path)
+    {
+        // quit early if conversion makes no sense
+        if ($this->from === $this->to) {
+            return $path;
+        }
+
+        $path = $this->normalize($path);
+        // if we're not dealing with a relative path, just return absolute
+        if (strpos($path, '/') === 0) {
+            return $path;
+        }
+
+        // normalize paths
+        $path = $this->normalize($this->from.'/'.$path);
+
+        // strip shared ancestor paths
+        $shared = $this->shared($path, $this->to);
+        $path = mb_substr($path, mb_strlen($shared));
+        $to = mb_substr($this->to, mb_strlen($shared));
+
+        // add .. for every directory that needs to be traversed to new path
+        $to = str_repeat('../', mb_substr_count($to, '/'));
+
+        return $to.ltrim($path, '/');
+    }
+
+    /**
+     * Attempt to get the directory name from a path.
+     *
+     * @param string $path
+     *
+     * @return string
+     */
+    protected function dirname($path)
+    {
+        if (@is_file($path)) {
+            return dirname($path);
+        }
+
+        if (@is_dir($path)) {
+            return rtrim($path, '/');
+        }
+
+        // no known file/dir, start making assumptions
+
+        // ends in / = dir
+        if (mb_substr($path, -1) === '/') {
+            return rtrim($path, '/');
+        }
+
+        // has a dot in the name, likely a file
+        if (preg_match('/.*\..*$/', basename($path)) !== 0) {
+            return dirname($path);
+        }
+
+        // you're on your own here!
+        return $path;
+    }
+}
Index: /lib/vendor/matthiasmullie/path-converter/src/ConverterInterface.php
===================================================================
--- /lib/vendor/matthiasmullie/path-converter/src/ConverterInterface.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/path-converter/src/ConverterInterface.php	(revision 7114)
@@ -0,0 +1,24 @@
+<?php
+
+namespace MatthiasMullie\PathConverter;
+
+/**
+ * Convert file paths.
+ *
+ * Please report bugs on https://github.com/matthiasmullie/path-converter/issues
+ *
+ * @author Matthias Mullie <pathconverter@mullie.eu>
+ * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+interface ConverterInterface
+{
+    /**
+     * Convert file paths.
+     *
+     * @param string $path The path to be converted
+     *
+     * @return string The new path
+     */
+    public function convert($path);
+}
Index: /lib/vendor/matthiasmullie/path-converter/src/NoConverter.php
===================================================================
--- /lib/vendor/matthiasmullie/path-converter/src/NoConverter.php	(revision 7114)
+++ /lib/vendor/matthiasmullie/path-converter/src/NoConverter.php	(revision 7114)
@@ -0,0 +1,23 @@
+<?php
+
+namespace MatthiasMullie\PathConverter;
+
+/**
+ * Don't convert paths.
+ *
+ * Please report bugs on https://github.com/matthiasmullie/path-converter/issues
+ *
+ * @author Matthias Mullie <pathconverter@mullie.eu>
+ * @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
+ * @license MIT License
+ */
+class NoConverter implements ConverterInterface
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function convert($path)
+    {
+        return $path;
+    }
+}
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 7113)
+++ /mods/wpsg_mod_basic.class.php	(revision 7114)
@@ -96,5 +96,6 @@
 			5200    => 'wpsg_mod_recaptcha', 
 			5300	=> 'wpsg_mod_converter', // Konverter von wpsg3 auf wpsg4
-			5400 	=> 'wpsg_mod_surfaceproduct' // Druckerei		
+			5400 	=> 'wpsg_mod_surfaceproduct', // Druckerei	
+            5500    => 'wpsg_mod_datainformation' // Datenauskunft	
 		);
 		
@@ -629,4 +630,9 @@
 		/** Wird aufgerufen um Ausgaben zwischen <html> und </html> in ein Template einzubauen */
 		public function wp_head() { }
+
+        /**
+         * Erlaubt es CSS/SCSS Dateien zur CSS Ausgabe hinzuzufÃŒgen
+         */
+		public function wpsg_scss(&$arFiles) { }
 		
 		/**
Index: /views/css/style.scss
===================================================================
--- /views/css/style.scss	(revision 7114)
+++ /views/css/style.scss	(revision 7114)
@@ -0,0 +1,1 @@
+body 
