diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..86d3d04 Binary files /dev/null and b/.DS_Store differ diff --git a/csscomb.js b/csscomb.js index 75dfa71..8a9e3bf 100644 --- a/csscomb.js +++ b/csscomb.js @@ -11,7 +11,7 @@ process.stdin.on('end', function () { var Comb = require('./node_modules/csscomb/lib/csscomb'), comb = new Comb(), syntax = process.argv[2], - config, combed; + config, promise; try { config = JSON.parse(process.argv[3]); @@ -25,7 +25,10 @@ process.stdin.on('end', function () { config || Comb.getConfig('csscomb'); - combed = comb.configure(config).processString(str, {syntax: syntax}); - process.stdout.write(combed); + promise = comb.configure(config).processString(str, {syntax: syntax}); + + promise.then(function(string) { + process.stdout.write(string); + }) }); diff --git a/node_modules/.DS_Store b/node_modules/.DS_Store new file mode 100644 index 0000000..3ea6420 Binary files /dev/null and b/node_modules/.DS_Store differ diff --git a/node_modules/.bin/csscomb b/node_modules/.bin/csscomb deleted file mode 120000 index 1f3257e..0000000 --- a/node_modules/.bin/csscomb +++ /dev/null @@ -1 +0,0 @@ -../csscomb/bin/csscomb \ No newline at end of file diff --git a/node_modules/.bin/csscomb b/node_modules/.bin/csscomb new file mode 100755 index 0000000..4ed1172 --- /dev/null +++ b/node_modules/.bin/csscomb @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../lib/cli'); diff --git a/node_modules/csscomb/.jscs.json b/node_modules/csscomb/.jscs.json deleted file mode 100644 index 8245a9c..0000000 --- a/node_modules/csscomb/.jscs.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "excludeFiles": [ - "node_modules/**", - "lib-cov/**" - ], - "requireCurlyBraces": [ - "else", - "while", - "do" - ], - "requireSpaceAfterKeywords": [ - "if", - "else", - "for", - "while", - "do", - "switch", - "return", - "catch" - ], - "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionExpression": { "beforeOpeningRoundBrace": true }, - "disallowMultipleVarDecl": true, - "disallowLeftStickedOperators": [ - "?", - "+", - "-", - "/", - "*", - "=", - "==", - "===", - "!=", - "!==", - ">", - ">=", - "<", - "<=" - ], - "disallowRightStickedOperators": [ - "?", - "+", - "/", - "*", - ":", - ",", - "=", - "==", - "===", - "!=", - "!==", - ">", - ">=", - "<", - "<=" - ], - "requireRightStickedOperators": ["!"], - "requireLeftStickedOperators": [","], - "disallowImplicitTypeConversion": [ - "numeric", - "boolean", - "binary", - "string" - ], - "disallowKeywords": ["with"], - "disallowKeywordsOnNewLine": ["else", "catch"], - "requireLineFeedAtFileEnd": true, - "validateJSDoc": { - "checkParamNames": true, - "checkRedundantParams": true, - "requireParamTypes": true - }, - "requireSpacesInsideObjectBrackets": "all", - "disallowSpacesInsideArrayBrackets": true, - "disallowSpaceAfterObjectKeys": true, - "disallowQuotedKeysInObjects": true -} diff --git a/node_modules/csscomb/.jshint-groups.js b/node_modules/csscomb/.jshint-groups.js deleted file mode 100644 index 95aa4d7..0000000 --- a/node_modules/csscomb/.jshint-groups.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - options: { - eqeqeq: true, - evil: true, - expr: true, - forin: true, - immed: true, - indent: 4, - latedef: true, - maxdepth: 5, - maxlen: 120, - maxparams: 4, - newcap: true, - noarg: true, - noempty: true, - nonew: true, - quotmark: 'single', - trailing: true, - undef: true, - unused: true - }, - groups: { - js: { - options: { node: true }, - includes: ['lib/**/*.js'] - }, - test: { - options: { - node: true, - predef: ['describe', 'beforeEach', 'afterEach', 'it'] - }, - includes: ['test/*.js'] - } - } -}; diff --git a/node_modules/csscomb/.npmignore b/node_modules/csscomb/.npmignore deleted file mode 100644 index 4afc62a..0000000 --- a/node_modules/csscomb/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -lib-cov -node_modules -test/test-coverage.html - -.idea -*.iml - -.DS_Store diff --git a/node_modules/csscomb/.travis.yml b/node_modules/csscomb/.travis.yml deleted file mode 100644 index 4a5a560..0000000 --- a/node_modules/csscomb/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js - -node_js: - - "0.10" - - "0.11" - -matrix: - allow_failures: - - node_js: "0.11" diff --git a/node_modules/csscomb/CHANGELOG.md b/node_modules/csscomb/CHANGELOG.md index 35276a6..dda20d1 100644 --- a/node_modules/csscomb/CHANGELOG.md +++ b/node_modules/csscomb/CHANGELOG.md @@ -1,5 +1,89 @@ # Changelog +## 4.2.0 - 2017-06-12 + +- Fixed - align for flexbox properies (#507) +- Updated - replace '\n' with os.EOL for terminal output (#524) +- Updated - vow-fs dependency (#526) +- Fixed - Add empty new line in the end of cli help text (#516) +- Fixed - Endless loop with empty files (#506) +- Added - Include all flexbox properties in config files (#509) + +## 4.1.0 - 2017-05-16 + +- Added new `--tty-mode` option for cli. +- Fixed an issue with calling gpe methods on non-existing nodes. + +## 4.0.1 - 2017-02-28 + +- Added `babel-polyfill` to dependencies. + +## 4.0.0 - 2017-02-16 + +- Added note about maintenance mode +- Updated GPE to v3.4.7, which fixed a number of errors +- Added `lines-between-rulesets` option +- Added support for stdin in cli +- For `sort-order` option, divided `$include` into `$extend`, `$include name` and `$include` + +## 3.1.7 - 2015-06-09 + +- Do not remove units from values starting from zeroes, like `0.5em` (#394) + +## 3.1.6 - 2015-06-09 +- Hotfix for issue when `unitless-zero` crashed on percentages in Less (#389) + +## 3.1.5 - 2015-05-27 +- Fixed dependencies + +## 3.1.4 - 2015-05-24 +- Fixed `space-after-opening-brace` option for empty media queries (#387) + +## 3.1.3 - 2015-05-20 +- Do not add extra space before combinators which go first in selectors (#381) + +## 3.1.2 - 2015-05-20 +- Fixed processing of hashes (#379) + +## 3.1.1 - 2015-05-20 +- Fixed `space-between-declarations` vs. media queries (#378) + +## 3.1.0 - 2015-05-19 +**Thanks to +[@1000ch](https://github.com/1000ch), +[@alexeykuzmin](https://github.com/alexeykuzmin), +[@jonrohan](https://github.com/jonrohan)** +- Used new Gonzales PE API +- Fixed nested properties (#319) +- Added support for symlinked configs +- Added support for configs with any extension + +## 3.0.4 - 2014-11-15 +**Thanks to +[@gonzalocasas](https://github.com/gonzalocasas), +[@tomByrer](https://github.com/tomByrer)** +- Improved docs +- Fixed Gonzales PE version + +## 3.0.3 - 2014-09-29 +**Thanks to +[@kizu](https://github.com/kizu), +[@necolas](https://github.com/necolas)** +- Improved README +- Added non-essential files to npmignore +- Renamed `CONTRIBUTE.md` to `CONTRIBUTING.md` +- Fixed unwanted removal of empty lines between nested rulesets (#317) + +## 3.0.2 - 2014-09-21 +- Fixed Gonzales PE version + +## 3.0.1 - 2014-08-18 +**Thanks to +[@mishanga](https://github.com/mishanga), +[@cust0dian](https://github.com/cust0dian)** +- Added `khtml` to list of vendor prefixes +- Updated docs + ## 3.0.0 - 2014-07-19 **Thanks to [@cvrebert](https://github.com/cvrebert), @@ -15,7 +99,7 @@ New: - Sass support - Leftovers (#160) -- Use [CSScomb Core](https://github/csscomb/core) +- Use [CSScomb Core](https://github.com/csscomb/core) - Plugins API (with `.use()` method) - `sort-order-fallback` (alphabetical sort order) - `space-before-colon` diff --git a/node_modules/csscomb/CONTRIBUTE.md b/node_modules/csscomb/CONTRIBUTE.md deleted file mode 100644 index 93ec341..0000000 --- a/node_modules/csscomb/CONTRIBUTE.md +++ /dev/null @@ -1,65 +0,0 @@ -# Contributing to CSSComb - - -## Pull requests - -1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes: -```bash -# Clone your fork of the repo into the current directory -git clone https://github.com//csscomb.js -# Navigate to the newly cloned directory -cd csscomb.js -# Assign the original repo to a remote called `upstream` -git remote add upstream https://github.com/csscomb/csscomb.js -``` - -2. If you cloned a while ago, get the latest changes from upstream: -```bash -git checkout dev -git pull upstream dev -``` -**IMPORTANT**: We are using `dev` branch for development, not `master`. - -3. Create a topic branch for your feature, change, or fix: -```bash -git checkout -b -``` - -4. Patches and features will not be accepted without tests. - Run `npm test` to check that all tests pass after you've made changes. - -5. Update the `README.md` if there were corresponding changes or new options. - -6. Locally rebase the upstream development branch into your topic branch: -```bash -git pull --rebase upstream dev -``` - -7. Push your topic branch up to your fork: -```bash -git push origin -``` - -8. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) to a `dev` branch with a clear title and description. - - -## Maintainers - -### Submitting changes - -1. All non-trivial changes should be put up for review using GitHub Pull Requests. -2. Your change should not be merged into `dev`, without at least one "OK" comment - from another maintainer/collaborator on the project. -3. Once a feature branch has been merged into its target branch, please delete - the feature branch from the remote repository. - -### Releasing a new version - -1. Include all new functional changes in the CHANGELOG. -2. Use a dedicated commit to increment the version. The version needs to be - added to the `CHANGELOG.md` (inc. date) and the `package.json`. -3. The commit message must be of `v0.0.0` format. -4. Merge `dev` into `master`. -5. Create a tag for the version: `git tag v0.0.0`. -6. Push the changes and tags to GitHub: `git push origin dev master v0.0.0`. -7. Publish the new version to npm: `npm publish`. diff --git a/node_modules/csscomb/README.md b/node_modules/csscomb/README.md index 222c3d5..94da9d3 100644 --- a/node_modules/csscomb/README.md +++ b/node_modules/csscomb/README.md @@ -67,8 +67,11 @@ comb.processPath('assets/css'); ## 4. Contribute -Anyone and everyone is welcome to contribute. -Please take a moment to review the [guidelines for contributing](CONTRIBUTE.md). +This project is actively mantained. But anyone and everyone is welcome to contribute. +Please take a moment to review the [guidelines for contributing](CONTRIBUTING.md). + +Also you can become a mantainer. To do that please ping +[@tonyganch](https://github.com/tonyganch). ## Authors diff --git a/node_modules/csscomb/config/csscomb.json b/node_modules/csscomb/config/csscomb.json index ae0ddb7..bb27a4e 100644 --- a/node_modules/csscomb/config/csscomb.json +++ b/node_modules/csscomb/config/csscomb.json @@ -62,10 +62,55 @@ "-ms-overflow-y", "clip", "zoom", + "-webkit-align-content", + "-ms-flex-line-pack", + "align-content", + "-webkit-box-align", + "-moz-box-align", + "-webkit-align-items", + "align-items", + "-ms-flex-align", + "-webkit-align-self", + "-ms-flex-item-align", + "-ms-grid-row-align", + "align-self", + "-webkit-box-flex", + "-webkit-flex", + "-moz-box-flex", + "-ms-flex", + "flex", + "-webkit-flex-flow", + "-ms-flex-flow", + "flex-flow", + "-webkit-flex-basis", + "-ms-flex-preferred-size", + "flex-basis", + "-webkit-box-orient", + "-webkit-box-direction", + "-webkit-flex-direction", + "-moz-box-orient", + "-moz-box-direction", + "-ms-flex-direction", "flex-direction", - "flex-order", - "flex-pack", - "flex-align" + "-webkit-flex-grow", + "-ms-flex-positive", + "flex-grow", + "-webkit-flex-shrink", + "-ms-flex-negative", + "flex-shrink", + "-webkit-flex-wrap", + "-ms-flex-wrap", + "flex-wrap", + "-webkit-box-pack", + "-moz-box-pack", + "-ms-flex-pack", + "-webkit-justify-content", + "justify-content", + "-webkit-box-ordinal-group", + "-webkit-order", + "-moz-box-ordinal-group", + "-ms-flex-order", + "order" ], [ "-webkit-box-sizing", diff --git a/node_modules/csscomb/config/yandex.json b/node_modules/csscomb/config/yandex.json index c8155e4..ec6c555 100644 --- a/node_modules/csscomb/config/yandex.json +++ b/node_modules/csscomb/config/yandex.json @@ -26,10 +26,55 @@ "-webkit-overflow-scrolling", "clip", "zoom", + "-webkit-align-content", + "-ms-flex-line-pack", + "align-content", + "-webkit-box-align", + "-moz-box-align", + "-webkit-align-items", + "align-items", + "-ms-flex-align", + "-webkit-align-self", + "-ms-flex-item-align", + "-ms-grid-row-align", + "align-self", + "-webkit-box-flex", + "-webkit-flex", + "-moz-box-flex", + "-ms-flex", + "flex", + "-webkit-flex-flow", + "-ms-flex-flow", + "flex-flow", + "-webkit-flex-basis", + "-ms-flex-preferred-size", + "flex-basis", + "-webkit-box-orient", + "-webkit-box-direction", + "-webkit-flex-direction", + "-moz-box-orient", + "-moz-box-direction", + "-ms-flex-direction", "flex-direction", - "flex-order", - "flex-pack", - "flex-align" + "-webkit-flex-grow", + "-ms-flex-positive", + "flex-grow", + "-webkit-flex-shrink", + "-ms-flex-negative", + "flex-shrink", + "-webkit-flex-wrap", + "-ms-flex-wrap", + "flex-wrap", + "-webkit-box-pack", + "-moz-box-pack", + "-ms-flex-pack", + "-webkit-justify-content", + "justify-content", + "-webkit-box-ordinal-group", + "-webkit-order", + "-moz-box-ordinal-group", + "-ms-flex-order", + "order" ], [ "-webkit-box-sizing", @@ -149,11 +194,6 @@ "-ms-animation-iteration-count", "-o-animation-iteration-count", "animation-iteration-count", - "-webkit-animation-iteration-count", - "-moz-animation-iteration-count", - "-ms-animation-iteration-count", - "-o-animation-iteration-count", - "animation-iteration-count", "-webkit-animation-direction", "-moz-animation-direction", "-ms-animation-direction", @@ -291,15 +331,6 @@ "-webkit-box-shadow", "-moz-box-shadow", "box-shadow", - "-webkit-box-shadow", - "-moz-box-shadow", - "box-shadow", - "-webkit-box-shadow", - "-moz-box-shadow", - "box-shadow", - "-webkit-box-shadow", - "-moz-box-shadow", - "box-shadow", "filter:progid:DXImageTransform.Microsoft.gradient", "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient", "text-shadow" diff --git a/node_modules/csscomb/config/zen.json b/node_modules/csscomb/config/zen.json index 593c0d3..9f462b9 100644 --- a/node_modules/csscomb/config/zen.json +++ b/node_modules/csscomb/config/zen.json @@ -13,28 +13,8 @@ "z-index", "display", "visibility", - "-webkit-flex-direction", - "-moz-flex-direction", - "-ms-flex-direction", - "-o-flex-direction", - "flex-direction", - "-webkit-flex-order", - "-moz-flex-order", - "-ms-flex-order", - "-o-flex-order", - "flex-order", - "-webkit-flex-pack", - "-moz-flex-pack", - "-ms-flex-pack", - "-o-flex-pack", - "flex-pack", "float", "clear", - "-webkit-flex-align", - "-moz-flex-align", - "-ms-flex-align", - "-o-flex-align", - "flex-align", "overflow", "-ms-overflow-x", "-ms-overflow-y", @@ -42,6 +22,55 @@ "overflow-y", "-webkit-overflow-scrolling", "clip", + "-webkit-align-content", + "-ms-flex-line-pack", + "align-content", + "-webkit-box-align", + "-moz-box-align", + "-webkit-align-items", + "align-items", + "-ms-flex-align", + "-webkit-align-self", + "-ms-flex-item-align", + "-ms-grid-row-align", + "align-self", + "-webkit-box-flex", + "-webkit-flex", + "-moz-box-flex", + "-ms-flex", + "flex", + "-webkit-flex-flow", + "-ms-flex-flow", + "flex-flow", + "-webkit-flex-basis", + "-ms-flex-preferred-size", + "flex-basis", + "-webkit-box-orient", + "-webkit-box-direction", + "-webkit-flex-direction", + "-moz-box-orient", + "-moz-box-direction", + "-ms-flex-direction", + "flex-direction", + "-webkit-flex-grow", + "-ms-flex-positive", + "flex-grow", + "-webkit-flex-shrink", + "-ms-flex-negative", + "flex-shrink", + "-webkit-flex-wrap", + "-ms-flex-wrap", + "flex-wrap", + "-webkit-box-pack", + "-moz-box-pack", + "-ms-flex-pack", + "-webkit-justify-content", + "justify-content", + "-webkit-box-ordinal-group", + "-webkit-order", + "-moz-box-ordinal-group", + "-ms-flex-order", + "order", "-webkit-box-sizing", "-moz-box-sizing", "box-sizing", diff --git a/node_modules/csscomb/doc/configuration.md b/node_modules/csscomb/doc/configuration.md deleted file mode 100644 index 5c30eda..0000000 --- a/node_modules/csscomb/doc/configuration.md +++ /dev/null @@ -1,133 +0,0 @@ -# Configuration - -You must configure CSScomb before use. -There are a number of ways how you can do it. - -## Use one of predefined configs - -There are [several config -files](https://github.com/csscomb/csscomb.js/tree/master/config) -included in this project you can use right away: - -- `csscomb` -- `zen` -- `yandex` - -In CLI, `csscomb` is a default config file that is used unless you provide your -own. -In Node.js, you can pass config's name to constructor: - -```js -var Comb = require('csscomb'); -var comb = new Comb('yandex'); -``` - -Feel free to use predefined configs as examples: copy one of them and modify to -your taste. -Just remember to save the file as `.csscomb.json` in project's root. - -## Create custom config - -You can easily write your own configuration. -The only requirement is that config is valid JSON in order to work correctly. - -Here is an example: - -```json -{ - "exclude": ["node_modules/**"], - "verbose": true, - - "always-semicolon": true, - "color-case": "lower", - "color-shorthand": true, - "element-case": "lower", - "eof-newline": true, - "leading-zero": false, - "quotes": "single", - "remove-empty-rulesets": true, - "strip-spaces": true, - "unitless-zero": true, - "vendor-prefix-align": true -} -``` - -Take a look at [available options](options.md) and choose those you need. - -### Where to put config - -CSScomb will look for a file named `.csscomb.json`. -The best way is to put the file in your project's root. -However, if you want to use one config for several projects, it's fine to put -the file inside a parent folder. -CSScomb will look for a config file recursively up untill it reaches your -`HOME` directory. - -Remember that you can always set custom path. -In CLI: -```bash -csscomb -c path/to/config assets/css -``` - -In Node.js: -```js -var Comb = require('csscomb'); -var config = require('path/to/config'); -var comb = new Comb(config); -``` - -## Generate config from a template - -Instead of configuring all the options one by one, you can use a template file: -CSScomb will detect the coding style and use it as a config. -All existing properties except `sort-order` can be configured this way: - -```bash -csscomb -d example.css > .csscomb.json -``` - -This will create `.csscomb.json` based on options that can be detected in -`example.css` file. - -Let's say your template file has following content: - -```css -.foo -{ - width: #fff; -} -``` - -Generated config wiil then look this way: - -```json -{ - "remove-empty-rulesets": true, - "always-semicolon": true, - "color-case": "lower", - "color-shorthand": true, - "strip-spaces": true, - "eof-newline": true -} -``` - - -## Override template's settings - -You can use template inside existing config and then complete it or override -some of detected settings: - -```json -{ - "template": "example.css", - "leading-zero": false, - "vendor-prefix-align": true -} -``` - -This config will: - -1. detect all the options from the `example.css`, -1. then use `"leading-zero": false` instead of anything detected, -1. then use `"vendor-prefix-align": true` even if there were no prefixed -properties or values inside the `example.css`. diff --git a/node_modules/csscomb/doc/options.md b/node_modules/csscomb/doc/options.md deleted file mode 100644 index 06d7597..0000000 --- a/node_modules/csscomb/doc/options.md +++ /dev/null @@ -1,914 +0,0 @@ -# Configuration options - -There are a number of options you can use, all of them are switched off by -default. -Here is a full list in the same order they are applied while processing css: - -- [remove-empty-rulesets](#remove-empty-rulesets) -- [always-semicolon](#always-semicolon) -- [color-case](#color-case) -- [color-shorthand](#color-shorthand) -- [element-case](#element-case) -- [leading-zero](#leading-zero) -- [quotes](#quotes) -- [strip-spaces](#strip-spaces) -- [eof-newline](#eof-newline) -- [space-after-combinator](#space-after-combinator) -- [space-before-combinator](#space-before-combinator) -- [space-before-colon](#space-before-colon) -- [space-after-colon](#space-after-colon) -- [space-before-opening-brace](#space-before-opening-brace) -- [space-after-opening-brace](#space-after-opening-brace) -- [space-before-selector-delimiter](#space-before-selector-delimiter) -- [space-after-selector-delimiter](#space-after-selector-delimiter) -- [space-after-declaration](#space-after-declaration) -- [block-indent](#block-indent) -- [sort-order-fallback](#sort-order-fallback) -- [sort-order](#sort-order) -- [space-before-closing-brace](#space-before-closing-brace) -- [tab-size](#tab-size) -- [unitless-zero](#unitless-zero) -- [vendor-prefix-align](#vendor-prefix-align) - -Following options are ignored while processing `*.sass` files: - -- always-semicolon -- space-before-opening-brace -- space-after-opening-brace -- space-before-closing-brace -- space-after-declaration - - -## always-semicolon - -Whether to add a semicolon after the last value/mixin. - -Acceptable value: `true`. - -Example: `{ "always-semicolon": true }` - -```css -/* before */ -a { color: red } - -/* after */ -a { color: red; } -``` - -### always-semicolon vs. preprocessors - -In `*.scss` and `*.less` files semicolons are not added after `}` -even if it's part of a value. - -Example: `{ "always-semicolon": true }` - -```scss -// before -div { - color: tomato; - font: { - family: fantasy; - size: 16px - } - } - -// after -div { - color: tomato; - font: { - family: fantasy; - size: 16px; - } - } -``` - -## block-indent - -Set indent for code inside blocks, including media queries and nested rules. - -Acceptable values: - -* `{Number}` — number os whitespaces; -* `{String}` — string with whitespaces and tabs. Note that line breaks are not - allowed here. - -Example: `{ 'block-indent': 4 }` - -```scss -// Before: -a { -top: 0; - p { - color: tomato; -position: happy; - } -} - -// After: -a { - top: 0; - p { - color: tomato; - position: happy; - } - } -``` - -Example: `{ 'block-indent': '' }` - -```scss -// Before: -a { -top: 0; - p { - color: tomato; -position: happy; - } -} - -// After: -a { -top: 0; -p { -color: tomato; -position: happy; -} -} -``` - -## color-case - -Unify case of hexadecimal colors. - -Acceptable values: - -* `lower` — for lowercase, -* `upper` — for uppercase. - -Example: `{ "color-case": "lower" }` - -```css -/* before */ -a { color: #FFF } - -/* after */ -a { color: #fff } -``` - -## color-shorthand - -Whether to expand hexadecimal colors or use shorthands. - -Acceptable values: - -* `true` — use shorthands; -* `false` — expand hexadecimal colors to 6 symbols. - -Example: `{ "color-shorthand": true }` - -```css -/* before */ -b { color: #ffcc00 } - -/* after */ -b { color: #fc0 } -``` - -Example: `{ "color-shorthand": false }` - -```css -/* before */ -b { color: #fc0 } - -/* after */ -b { color: #ffcc00 } -``` - -## element-case - -Unify case of element selectors. - -Acceptable values: - -* `lower` — for lowercase; -* `upper` — for uppercase. - -Example: `{ "element-case": "upper" }` - -```css -/* before */ -li > a { color: red } - -/* after */ -LI > A { color: red } -``` - -## eof-newline - -Add/remove line break at EOF. - -Acceptable values: - -* `true` — add line break; -* `false` – remove line break. - -Example: `{ "eof-newline": true }` - -`a { color: red }` → `a { color: red }\n` - -Example: `{ "eof-newline": false }` - -`a { color: red }\n` → `a { color: red }` - -## exclude - -List files that should be ignored while combing. - -Acceptable value: - -* `{String[]}` — array of - [Ant path patterns](http://ant.apache.org/manual/dirtasks.html#patterns). - -Example: `{ "exclude": ["node_modules/**"] }` — exclude all files and -directories under `node_modules` dir. - -## leading-zero - -Add/remove leading zero in dimensions. - -Acceptable values: - - * `true` — add leading zero; - * `false` — remove leading zero. - -Example: `{ "leading-zero": false }` - -```css -/* before */ -p { padding: 0.5em } - -/* after */ -p { padding: .5em } -``` - -## quotes - -Unify quotes style. - -Acceptable values: - -* `single` — transform all `"` to `'`; -* `double` — transform all `'` to `"`. - -Example: `{ "quotes": "single" }` - -```css -/* before */ -p[href^="https://"]:before { content: "secure" } - -/* after */ -p[href^='https://']:before { content: 'secure' } -``` - -## remove-empty-rulesets - -Remove all rulesets that contain nothing but spaces. - -Acceptable value: `true` - -Example: `{ "remove-empty-rulesets": true }`. - -`a { color: red; } p { /* hey */ } b { }` → `a { color: red; } p { /* hey */ } ` - -## sort-order - -Set sort order. - -**Note**: Use one of [predefined -configs](https://github.com/csscomb/csscomb.js/tree/master/config) -as an example. - -Acceptable values: - -* `{Array}` of rules -* `{Array}` of arrays of rules for groups separation - -Example: `{ "sort-order": [ "margin", "padding" ] }` - -```css -/* before */ -p { - padding: 0; - margin: 0; -} - -/* after */ -p { - margin: 0; - padding: 0; -} -``` - -Example: `{ "sort-order": [ [ "margin", "padding" ], [ "border", "background" ] ] }` - -```css -/* before */ -p { - background: none; - border: 0; - margin: 0; - padding: 0; -} - -/* after */ -p { - margin: 0; - padding: 0; - - border: 0; - background: none; -} -``` - -### sort-order vs. preprocessors - -If you sort properties in `*.scss` or `*.less` files, you can use one of 3 -keywords in your config: - -* `$variable` — for variable declarations (e.g. `$var` in Sass or `@var` in LESS); -* `$include` — for included mixins (e.g. `@include ...` and `@extend ...` in Sass - or `.mixin()` in LESS); -* `$import` — for `@import` rules. - -Example: `{ "sort-order": [ [ "$variable" ], [ "$include" ], [ "top", "padding" ] ] }` - -```scss -/* before */ -p { - padding: 0; - @include mixin($color); - $color: tomato; - top: 0; -} - -/* after */ -p { - $color: tomato; - - @include mixin($color); - - top: 0; - padding: 0; -} -``` - -### sort-order vs. leftovers - -When there are properties that are not mentioned in the `sort-order` option, they are inserted after all the sorted properties in the new group in the same order they were in the source stylesheet. - -You can override this by using a “leftovers” token: `...` — just place it either in its own group, or near other properties in any other group and CSSComb would place all the properties that were not sorted where the `...` was in `sort-order`. - -So, with this value: - -``` json -{ - "sort-order": [ - ["$variable"], - ["position"], - ["...", "border"], - ["$include"], - ["font"] - ] -} -``` - -everything would go into five groups: variables, then group with `position`, then group containing all the leftovers plus the `border`, then group with all includes and then the `font`. - -## sort-order-fallback - -Apply a special sort order for properties that are not specified in `sort-order` -list. -Works great with [leftovers](#sort-order-vs-leftovers). -**Note:** This option is applied only if [sort order](#sort-order) list is -provided. - -Acceptable values: - -* `abc` - sort unknown options alphabetically. - -Example: `{ 'sort-order-fallback': 'abc', 'sort-order': ['top'] }` - -```scss -// Before: -a { - height: 100px; - color: tomato; - top: 0; -} - -// After: -a { - top:0; - - color:tomato; - height: 100px; -} -``` - -Example: `{ 'sort-order-fallback': 'abc', 'sort-order': ['...'] }` - -```scss -// Before: -a { - height: 100px; - color: tomato; - top: 0; -} - -// After: -a { - color:tomato; - height: 100px; - top:0; -} -``` - -## space-after-colon - -Set space after `:` in declarations. - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-after-colon': '' }` - -```scss -// Before: -a { - top: 0; - color: tomato; -} - -// After: -a { - top:0; - color:tomato; -} -``` - -Example: `{ 'space-after-colon': 1 }` - -```scss -// Before: -a { - top:0; - color:tomato; -} - -// After: -a { - top: 0; - color: tomato; -} -``` - -## space-after-combinator - -Set space after combinator (for example, in selectors like `p > a`). - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-after-combinator': 1 }` - -```scss -// Before: -p>a { color: panda; } - -// After: -p> a { color: panda; } -``` - -Example: `{ 'space-after-combinator': '\n ' }` - -```scss -// Before: -p > a { color: panda; } - -// After: -p > - a { color: panda; } -``` - -## space-after-declaration - -Set space after declaration (i.e. `color: tomato`). - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-after-declaration': 1 }` - -```scss -// Before: -a { - color: panda; - top: 0; - /* comment */ - right: 0; - position: absolute - } - -// After: -a { - color: panda; top: 0; /* comment */ - right: 0; position: absolute } -``` - -Example: `{ 'space-after-declaration': '\n ' }` - -```scss -// Before: -a { - color: panda; top: 0; right: 0} - -// After: -a { - color: panda; - top: 0; - right: 0; - } -``` - - -## space-after-opening-brace - -Set space after `{`. - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-after-opening-brace': 1 }` - -```scss -// Before: -a {color: panda;} - -// After: -a { color: panda;} -``` - -Example: `{ 'space-after-opening-brace': '\n' }` - -```scss -// Before: -a{color: panda;} - -// After: -a{ -color: panda;} -``` - -## space-after-selector-delimiter - -Set space after selector delimiter. - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-after-selector-delimiter': 1 }` - -```scss -// Before: -a,b{ - color: panda; - } - -// After: -a, b { - color: panda; - } -``` - -Example: `{ 'space-after-selector-delimiter': '\n' }` - -```scss -// Before: -a, b{ - color: panda; - } - -// After: -a, -b{ - color: panda; - } -``` - -## space-before-closing-brace - -Set space before `}`. - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-before-closing-brace': 1 }` - -```scss -// Before: -a { - top: 0; - color: tomato; -} - -// After: -a { - top: 0; - color: tomato; } -``` - -Example: `{ 'space-before-closing-brace': '\n' }` - -```scss -// Before: -a { - top: 0; - color: tomato;} - -// After: -a { - top: 0; - color: tomato; -} -``` - -## space-before-colon - -Set space before `:` in declarations. - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-before-colon': '' }` - -```scss -// Before: -a { - top : 0; - color : tomato; -} - -// After: -a { - top: 0; - color: tomato; -} -``` - -Example: `{ 'space-before-colon': 1 }` - -```scss -// Before: -a { - top:0; - color:tomato; -} - -// After: -a { - top :0; - color :tomato; -} -``` - -## space-before-combinator - -Set space before combinator (for example, in selectors like `p > a`). - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-before-combinator': 1 }` - -```scss -// Before: -p>a { color: panda; } - -// After: -p >a { color: panda; } -``` - -Example: `{ 'space-before-combinator': '\n' }` - -```scss -// Before: -p > a { color: panda; } - -// After: -p -> a { color: panda; } -``` - -## space-before-opening-brace - -Set space before `{`. - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-before-opening-brace': 1 }` - -```scss -// Before: -a{ - color: panda; - } - -// After: -a { - color: panda; - } -``` - -Example: `{ 'space-before-opening-brace': '\n' }` - -```scss -// Before: -a{ - color: panda; - } - -// After: -a -{ - color: panda; - } -``` - -## space-before-selector-delimiter - -Set space before selector delimiter. - -Acceptable values: - -* `{Number}` — number of whitespaces; -* `{String}` — string with whitespaces, tabs or line breaks. - -Example: `{ 'space-before-selector-delimiter': 0 }` - -```scss -// Before: -a , b{ - color: panda; - } - -// After: -a, b { - color: panda; - } -``` - -Example: `{ 'space-before-selector-delimiter': '\n' }` - -```scss -// Before: -a, b{ - color: panda; - } - -// After: -a -,b{ - color: panda; - } -``` - -## strip-spaces - -Whether to trim trailing spaces. - -Acceptable value: `true`. - -Example: `{ "strip-spaces": true }` - -`a { color: red } \n \n \n` → `a { color: red }\n` - -`a { color: red }\t` → `a { color: red }` - -## tab-size - -Set tab size (number of spaces to replace hard tabs). - -Acceptable values: - -* `{Number}` — number of whitespaces; - -Example: `{ 'tab-size': 2 }` - -```scss -// Before: -a{ - color: panda; - } - -// After: -a { - color: panda; - } -``` - -## template - -**Note:** See [configuration docs](configuration.md#override-templates-settings) -for more information. - -Acceptable value: - -* `{String}` — path to the `.css` file. - -Example: `{ "template": "example.css" }` - -## unitless-zero - -Whether to remove units in zero-valued dimensions. - -Acceptable value: `true`. - -Example: `{ "unitless-zero": true }` - -```css -/* before */ -img { border: 0px } - -/* after */ -img { border: 0 } -``` - -## vendor-prefix-align - -Whether to align prefixes in properties and values. - -Acceptable value: `true`. - -Example: `{ "vendor-prefix-align": true }` - -```css -/* before */ -a -{ - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - background: -webkit-linear-gradient(top, #fff 0, #eee 100%); - background: -moz-linear-gradient(top, #fff 0, #eee 100%); - background: linear-gradient(to bottom, #fff 0, #eee 100%); -} - -/* after */ -a -{ - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - background: -webkit-linear-gradient(top, #fff 0, #eee 100%); - background: -moz-linear-gradient(top, #fff 0, #eee 100%); - background: linear-gradient(to bottom, #fff 0, #eee 100%); -} -``` - -## verbose - -Whether to use `--verbose` option in CLI. - -Acceptable value: `true`. - -Example: `{ "verbose": true }` - -```bash -csscomb ./test - -✓ test/integral.origin.css - test/integral.expect.css - -2 files processed -1 file fixed -96 ms spent -``` diff --git a/node_modules/csscomb/doc/plugins.md b/node_modules/csscomb/doc/plugins.md deleted file mode 100644 index 87ed30c..0000000 --- a/node_modules/csscomb/doc/plugins.md +++ /dev/null @@ -1,6 +0,0 @@ -# Plugins - -## Using external plugins - -## Writing your own plugins - diff --git a/node_modules/csscomb/doc/usage-cli.md b/node_modules/csscomb/doc/usage-cli.md deleted file mode 100644 index 3435e36..0000000 --- a/node_modules/csscomb/doc/usage-cli.md +++ /dev/null @@ -1,101 +0,0 @@ -# Command Line usage - -To run `csscomb`: - -```bash -csscomb path[ path[...]] -``` - -`path` can be either a directory or a file: - -```bash -csscomb assets/css public/styles.css -``` - -If you installed the package locally, use local bin file instead: - -```bash -./node_modules/.bin/csscomb assets/css public/styles.css -``` - -## Options - -### help - -If you run `csscomb -h`, it will show some helpful information: - -```bash -csscomb -h - - Usage: csscomb [options] - - Options: - - -h, --help output usage information - -V, --version output the version number - -v, --verbose verbose mode - -c, --config [path] configuration file path - -d, --detect detect mode (would return detected options) - -l, --lint in case some fixes needed returns an error -``` - -### config - -If you want to use custom config instead of predefined `csscomb.json` just -put a file named `.csscomb.json` to project's root (see [configuration -docs](configuration.md#where-to-put-config) for more information). -However, if for some reason you would like to use custom path, do it this way: - -```bash -csscomb -c path/to/config styles.css -``` - -### detect - -If you want to generate a config file based on a template file, run: - -```bash -csscomb -d example.css > .csscomb.json -``` - -See [configuration docs](configuration.md#generate-config-from-a-template) for -more information. - -### lint - -CSScomb can be used as a linter, i.e. telling you what should be changed instead -of modifying anything. -This option should be combined with `--verbose`: - -```bash -csscomb -lv assets/css - - assets/css/main.scss -! assets/css/main.scss -! assets/css/main.scss -! assets/css/main.scss - -4 files processed -0 files fixed -spent: 30ms -``` - -Exclamation mark is a sign that something is wrong with the file. - -### verbose - -If you are curious or you just like a lot of output info, `--verbose` is your -good friend: - -```bash -csscomb -v assets/css - - assets/css/main.scss -✓ assets/css/main.scss -✓ assets/css/main.scss -✓ assets/css/main.scss - -4 files processed -3 files fixed -spent: 33ms -``` diff --git a/node_modules/csscomb/doc/usage-node.md b/node_modules/csscomb/doc/usage-node.md deleted file mode 100644 index 0d28fb3..0000000 --- a/node_modules/csscomb/doc/usage-node.md +++ /dev/null @@ -1,228 +0,0 @@ -# Node.js module usage - -CSScomb can be used in Node.js projects: inside a plugin or as a dev tool. - -Workflow can look like this: - -```js -// Require: -var Comb = require('csscomb'); -var config = require('path/to/config'); - -// Configure: -var comb = new Comb(config); - -// Use: -comb.processPath('style.css'); -``` - -## new Comb(config) - -Create instance's prototype. - -Parameters: - -* `{String|Object} config` — config that should be used after creating - instance. Should be JSON or one of predefined config's name. Optional. - -Example: Create CSScomb instance and configure it using predefined `yandex` sort -order - -```js -var comb = new Comb('yandex'); - -// This is shortcut for: -var comb = new Comb(); -var config = Comb.getConfig('yandex'); -comb.configure(config); -``` - -Example: Create CSScomb instance and configure it using config object - -```js -var config = require('path/to/config'); -var comb = new Comb(config); - -// This is shortcut for: -var comb = new Comb(); -comb.configure(config); -``` - -## Comb.getConfig(name) - -Get one of predefined configs. - -Note that this is a static method. - -Parameters: - -* `{String} name` — config's name. Should be one of the following: - `csscomb`, `zen` or `yandex`. - -Example: Configure CSScomb using predefined `zen` sort order that is slightly -modified. - -```js -var config = Comb.getConfig('zen'); -config['always-semicolon'] = true; -comb.configure(config); -``` - -## Comb.detectInFile(path, options) - -Get config options that can be detected in a file. - -Note that this is a static method. - -Parameters: - -* `{String} path` — path to stylesheet -* `{Array} options` — list of options to detect. Optional. By default tries - to detect all available options. - -Example: Configure CSScomb using template file - -```js -var config = comb.detectInFile('template.css'); -comb.configure(config); -``` - -## Comb.detectInString(string, options) - -Get config options that can be detected in a string. - -Note that this is a static method. - -Parameters: - -* `{String} string` — stylesheet -* `{Array} options` — list of options to detect. Optional. By default tries - to detect all available options. - -Example: Configure CSScomb using template stylesheet - -```js -var css = 'a {top: 0; left: 0}'; -var config = comb.detectInString(css); -comb.configure(config); -``` - -## configure(config) - -Configure CSScomb. - -Parameters: - -* `{Object} config` — valid JSON object. - -Example: Create and pass a config object to the method - -```js -var config = { 'always-semicolon': true }; -comb.configure(config); -``` - -Example: Use config stored in a file - -```js -var config = require('path/to/.csscomb.json'); -comb.configure(config); -``` - -See [configuration docs](configuration.md) for more information. - -## getValue(optionName) - -Get value of a given option. - -Parameters: - -* `{String} optionName` — name of option which value you want to get - -Example: Get configured sort order - -```js -comb.getValue('sort-order'); -``` - -## processPath(path) - -Comb a file or a directory. - -Parameters: - -* `{String} path` — path to file or directory - -**Warning:** This method rewrites the file. - -Example: Process one file - -```js -comb.processPath('main.scss'); -``` - -Example: Process whole directory - -```js -comb.processPath('assets/css'); -``` - -## processDirectory(path) - -Comb all supported files in a directory. - -Parameters: - -* `{String} path` — path to a directory - -**Warning:** This method rewrites the files. - -Example: - -```js -comb.processDirectory('public/css'); -``` - -## processFile(path) - -Comb one file. - -Parameters: - -* `{String} path` — path to a file - -If file's syntax is not supported, the file will be ignored. - -**Warning:** This method rewrites the file. - -Example: - -```js -comb.processFile('print.less'); -``` - -## processString(string, syntax, filename) - -Comb a stylesheet. - -Parameters: - -* `{String} text` — stylesheet that should be combed. -* `{String} syntax` — style's syntax. Optional. Default value is `css`. -* `{String} filename` — file's name that is used to print possible errors. - Optional. - -Example: Comb a css string - -```js -var css = 'a {top: 0; left: 0}'; -var combedCSS = comb.processString(css); -``` - -Example: Comb a less string - -```js -var less = '@color: tomato; a {color: @color}'; -var combedLESS = comb.processString(less, 'less'); -``` - diff --git a/node_modules/csscomb/lib/cli.js b/node_modules/csscomb/lib/cli.js index 0c99bd2..5feb2d8 100644 --- a/node_modules/csscomb/lib/cli.js +++ b/node_modules/csscomb/lib/cli.js @@ -1,100 +1,162 @@ +'use strict'; + /** * Command line implementation for CSSComb * * Usage example: - * ./node_modules/.bin/csscomb [options] file1 [dir1 [fileN [dirN]]] + * ./node_modules/.bin/csscomb [options] [file1 [dir1 [fileN [dirN]]]] */ + var fs = require('fs'); +var parseArgs = require('minimist'); var path = require('path'); -var program = require('commander'); -var vow = require('vow'); -var Comb = require('./csscomb'); +var os = require('os'); -program - .version(require('../package.json').version) - .usage('[options] ') - .option('-v, --verbose', 'verbose mode') - .option('-c, --config [path]', 'configuration file path') - .option('-d, --detect', 'detect mode (would return detected options)') - .option('-l, --lint', 'in case some fixes needed returns an error') - .parse(process.argv); - -if (!program.args.length) { - console.log('No input paths specified'); - program.help(); -} +var Comb = require('./csscomb'); +var Errors = require('./errors'); + +var getInputData = new Promise(function (resolve) { + var input = ''; + process.stdin.resume(); + process.stdin.setEncoding('utf8'); + process.stdin.on('data', function (data) { + input += data; + }); + process.stdin.on('end', function () { + resolve(input); + }); +}); var comb = new Comb(); +var options = getOptions(); -if (program.detect) { - console.log(JSON.stringify(Comb.detectInFile(program.args[0]), false, 4)); - process.exit(0); +if (options.help) { + displayHelp(); + process.exit(0); } -var config; -var configPath = program.config && - path.resolve(process.cwd(), program.config) || - Comb.getCustomConfigPath(); +if (options.detect) { + const config = detectConfig(); + process.stdout.write(config); + process.exit(0); +} -if (!fs.existsSync(configPath)) { - config = require('../config/csscomb.json'); -} else if (configPath.match(/\.css$/)) { - config = Comb.detectInFile(configPath); +var config = getConfig(); +comb.configure(config); + +if (options['tty-mode'] || process.stdin.isTTY) { + processFiles(options._); } else { - config = Comb.getCustomConfig(configPath); + processSTDIN(); } -if (!config) { - console.log('Configuration file ' + configPath + ' was not found.'); - process.exit(1); +function getOptions() { + var parserOptions = { + boolean: ['help', 'lint', 'verbose'], + alias: { + config: 'c', + detect: 'd', + lint: 'l', + help: 'h', + verbose: 'v', + 'tty-mode': 't' + } + }; + return parseArgs(process.argv.slice(2), parserOptions); } -if (config.template) { - if (fs.existsSync(config.template)) { - var templateConfig = Comb.detectInFile(config.template); - for (var attrname in templateConfig) { - if (!config[attrname]) { - config[attrname] = templateConfig[attrname]; - } - } - } else { - console.log('Template configuration file ' + config.template + ' was not found.'); - process.exit(1); - } +function displayHelp() { + var help = ['NAME', ' csscomb — Lint and fix style errors in css files', '', 'SYNOPSIS', ' csscomb [options] file.css', ' cat file.css | csscomb [options] -', '', 'OPTIONS', ' -c, --config [path]', ' Path to configuration file.', ' -d, --detect', ' Run the tool in detect mode, returning detected options.', ' -l, --lint', ' Run the tool in linter mode, without modifying files.', ' -h, --help', ' Display help message.', ' -v, --verbose', ' Whether to print logging info.', ' -t, --tty-mode', ' Run the tool in TTY mode using external app (e.g. IDE).', '']; + process.stdout.write(help.join(os.EOL)); } -console.time('spent'); +function detectConfig() { + const config = Comb.detectInFile(options.detect); + return JSON.stringify(config, false, 4); +} -config.verbose = program.verbose === true || config.verbose; -config.lint = program.lint; +function getConfig() { + var configPath = options.config && path.resolve(process.cwd(), options.config) || Comb.getCustomConfigPath(); -comb.configure(config); + var config; + if (!fs.existsSync(configPath)) { + config = require('../config/csscomb.json'); + } else if (configPath.match(/\.css$/)) { + config = Comb.detectInFile(configPath); + } else { + config = Comb.getCustomConfig(configPath); + } + + if (!config) { + const errorMessage = Errors.configParsingError(configPath); + process.stderr.write(errorMessage); + process.exit(1); + } + + applyTemplate(config); + if (options.verbose) config.verbose = options.verbose; + if (options.lint) config.lint = options.lint; -vow.all(program.args.map(comb.processPath.bind(comb))) -.then(function(changedFiles) { - changedFiles = [].concat.apply([], changedFiles) - .filter(function(isChanged) { - return isChanged !== undefined; - }); + return config; +} + +function applyTemplate(config) { + if (!config.template) return; - for (var i = changedFiles.length, tbchanged = 0; i--;) { - tbchanged += changedFiles[i]; + if (!fs.existsSync(config.template)) { + const errorMessage = Errors.missingTemplateFile(config.template); + process.stderr.write(errorMessage); + process.exit(1); + } + + var templateConfig = Comb.detectInFile(config.template); + for (var attrname in templateConfig) { + if (templateConfig.hasOwnProperty(attrname) && !config[attrname]) { + config[attrname] = templateConfig[attrname]; } + } +} - var changed = config.lint ? 0 : tbchanged; +function processFiles(files) { + const promises = files.map(file => { + return comb.processPath(file); + }); - if (config.verbose) { - console.log(''); - console.log(changedFiles.length + ' file' + (changedFiles.length === 1 ? '' : 's') + ' processed'); - console.log(changed + ' file' + (changed === 1 ? '' : 's') + ' fixed'); - console.timeEnd('spent'); + Promise.all(promises).catch(error => { + process.stderr.write(error.stack); + process.exit(1); + }).then(c => { + var tbchanged = c.filter(isChanged => { + return isChanged !== undefined; + }).reduce((a, b) => { + return a + b; + }, 0); + + var changed = options.lint ? 0 : tbchanged; + + if (options.verbose) { + let message = [`${c.length} file${c.length === 1 ? '' : 's'} processed`, `${changed} file${changed === 1 ? '' : 's'} fixed`, ''].join(os.EOL); + process.stdout.write(message); } - if (config.lint && tbchanged) { - process.exit(1); + if (options.lint && tbchanged) { + process.exit(1); } -}) -.fail(function(e) { - console.log('stack: ', e.stack); + + process.exit(0); + }); +} + +function processSTDIN() { + getInputData.then(processInputData); +} + +function processInputData(input) { + comb.processString(input).catch(e => { + process.stderr.write(e.message); process.exit(1); -}); + }).then(output => { + process.stdout.write(output); + process.exit(0); + }); +} \ No newline at end of file diff --git a/node_modules/csscomb/lib/core.js b/node_modules/csscomb/lib/core.js new file mode 100644 index 0000000..b1c6d18 --- /dev/null +++ b/node_modules/csscomb/lib/core.js @@ -0,0 +1,452 @@ +'use strict'; + +require('babel-polyfill'); + +let fs = require('fs'); +var os = require('os'); +let gonzales = require('gonzales-pe'); +let minimatch = require('minimatch'); +let Errors = require('./errors'); +let Plugin = require('./plugin'); + +let vow = require('vow'); +let vfs = require('vow-fs'); + +class Comb { + constructor() { + this.config = {}; + this.exclude = []; + // Whether lint mode is on. + this.lint = false; + // List of file paths that should be excluded from processing. + this.pathsToExclude = null; + // List of used plugins. + this.plugins = []; + this.pluginsDependencies = {}; + // List of supported syntaxes. + this.supportedSyntaxes = new Set(); + // Mapping file extensions to syntax + this.syntaxMap = new Map(); + // Whether verbose mode is on. + this.verbose = false; + } + + /** + * Loads configuration from JSON. + * + * @param {!Object} config + * @return {!Comb} + */ + configure(config) { + if (typeof config !== 'object') + // TODO: throw error + throw new Error(); + + this.lint = config.lint; + this.verbose = config.verbose; + if (config.exclude) this.exclude = config.exclude.map(function (pattern) { + return new minimatch.Minimatch(pattern); + }); + + if (config.syntax) { + for (let key in config.syntax) { + this.syntaxMap.set(key, config.syntax[key]); + } + } + + for (let i = 0, l = this.plugins.length; i < l; i++) { + let plugin = this.plugins[i]; + let name = plugin.name; + if (!config.hasOwnProperty(name)) continue; + + try { + plugin.value = config[name]; + this.config[name] = plugin.value; + } catch (e) { + // TODO: throw error + } + } + + // Chaining. + return this; + } + + /** + * Lints all files in a directory. + * + * @param {String} path + * @returns {Promise} + */ + lintDirectory(path) { + let files = this._getAcceptableFilesFromDirectory(path); + let promises = files.map(file => this.lintFile(file)); + return Promise.all(promises); + } + + /** + * Lints a single file. + * + * @param {String} path + * @returns {Promise} + */ + lintFile(path) { + let syntax = this._extractSyntax(path); + return this._readFile(path).then(string => { + return this.lintString(string, { syntax: syntax, filename: path }); + }); + } + + /** + * Lints a file or a directory. + * + * @param {String} path + */ + lintPath(path) { + path = path.replace(/\/$/, ''); + return fs.statSync(path).isDirectory() ? this.lintDirectory(path) : this.lintFile(path); + } + + /** + * Lints a string. + * + * @param {String} text + * @param {{context: String, filename: String, syntax: String}} options + * @returns {Promise} Resolves with list of found errors. + */ + lintString(text, options) { + return this._parseString(text, options).then(this._lintTree.bind(this)).then(errors => { + errors.forEach(error => { + error.context = this._getContext(text, error.line); + }); + + return errors; + }); + } + + _getContext(text, currentLineNumber) { + var LINES_AROUND = 2; + var result = []; + var start = currentLineNumber - 1 - LINES_AROUND; + var end = currentLineNumber + LINES_AROUND; + var lines = text.split(/\r\n|\r|\n/); + + for (var i = start; i < end; i++) { + var line = lines[i]; + if (!line) continue; + var ln = i + 1; + if (ln === currentLineNumber) { + result.push(ln + '*| ' + line); + } else { + result.push(ln + ' | ' + line); + } + } + return result.join(os.EOL); + } + + /** + * Processes directory recursively. + * + * @param {String} path + * @returns {Promise} + */ + processDirectory(path) { + let that = this; + + return vfs.listDir(path).then(function (filenames) { + return vow.all(filenames.map(function (filename) { + let fullname = path + '/' + filename; + return vfs.stat(fullname).then(function (stat) { + if (stat.isDirectory() && that._shouldProcess(fullname)) { + return that.processDirectory(fullname); + } else { + return that.processFile(fullname); + } + }); + })).then(function (results) { + return [].concat.apply([], results); + }); + }); + } + + /** + * Processes single file. + * + * @param {String} path + * @returns {Promise} + */ + processFile(path) { + let that = this; + + if (!this._shouldProcessFile(path)) return; + + return new Promise(resolve => { + vfs.read(path, 'utf8').then(function (data) { + let syntax = that._extractSyntax(path); + that.processString(data, { + syntax: syntax, + filename: path + }).then(function (processedData) { + if (data === processedData) { + if (that.verbose) console.log(' ', path); + resolve(0); + return; + } + + let tick = that.lint ? '!' : '✓'; + if (that.lint) { + if (that.verbose) console.log(tick, path); + resolve(1); + } else { + return vfs.write(path, processedData, 'utf8').then(function () { + if (that.verbose) console.log(tick, path); + resolve(1); + }); + } + }); + }); + }); + } + + /** + * Processes directory or file. + * + * @returns {Promise} + */ + processPath(path) { + let that = this; + path = path.replace(/\/$/, ''); + + return vfs.stat(path).then(function (stat) { + if (stat.isDirectory()) { + return that.processDirectory(path); + } else { + return that.processFile(path); + } + }); + } + + /** + * Processes a string. + * + * @param {String} text + * @param {{context: String, filename: String, syntax: String}} options + * @returns {Promise} Resolves in processed string + */ + processString(text, options) { + return this._parseString(text, options).then(this._processTree.bind(this)).then(ast => ast.toString()); + } + + /** + * Add a plugin. + * @param {Object} options + * @return {Comb} + */ + use(options) { + // Check whether plugin with the same is already used. + let pluginName = options.name; + if (this._pluginAlreadyUsed(pluginName)) { + if (this.verbose) console.warn(Errors.twoPluginsWithSameName(pluginName)); + return; + } + + let plugin = new Plugin(options); + + plugin.syntax.forEach(function (s) { + this.supportedSyntaxes.add(s); + }, this); + + // Sort plugins. + let pluginToRunBefore = plugin.runBefore; + + if (!pluginToRunBefore) { + this.plugins.push(plugin); + } else { + if (this._pluginAlreadyUsed(pluginToRunBefore)) { + let i = this._pluginIndex(pluginToRunBefore); + this.plugins.splice(i, 0, plugin); + } else { + this.plugins.push(plugin); + if (!this.pluginsDependencies[pluginToRunBefore]) this.pluginsDependencies[pluginToRunBefore] = []; + this.pluginsDependencies[pluginToRunBefore].push(pluginName); + } + } + + let dependents = this.pluginsDependencies[pluginName]; + if (!dependents) return this; + + for (let i = 0, l = dependents.length; i < l; i++) { + let name = dependents[i]; + let x = this._pluginIndex(name); + let plugin = this.plugins[x]; + this.plugins.splice(x, 1); + this.plugins.splice(-1, 0, plugin); + } + + // Chaining. + return this; + } + + _getAcceptableFilesFromDirectory(path) { + if (!this._shouldProcess(path)) return; + + let files = []; + let filesInThisDir = fs.readdirSync(path); + + for (let i = 0, fl = filesInThisDir.length; i < fl; i++) { + let fullname = path + '/' + filesInThisDir[i]; + let stat = fs.statSync(fullname); + if (stat.isDirectory() && this._shouldProcess(fullname)) files = files.concat(this._getAcceptableFilesFromDirectory(fullname));else if (this._shouldProcessFile(fullname)) files.push(fullname); + } + + return files; + } + + /** + * @param {Node} ast + * @param {String=} filename + * @return {Array} List of errors. + */ + _lintTree(ast, filename) { + let errors = []; + let config = this.config; + + this.plugins.filter(function (plugin) { + return typeof plugin.value !== null && typeof plugin.lint === 'function' && plugin.syntax.indexOf(ast.syntax) !== -1; + }).forEach(function (plugin) { + let e = plugin.lint(ast, config); + errors = errors.concat(e); + }); + + if (filename) { + errors.map(function (error) { + error.filename = filename; + return error; + }); + } + + return errors; + } + + _parseString(text, options) { + let syntax = options && options.syntax; + let filename = options && options.filename || ''; + let context = options && options.context; + let tree; + const lint = this.lint; + + if (!text) return new Promise(function (resolve) { + resolve(lint ? [] : text); + }); + + if (!syntax) syntax = 'css'; + this.syntax = syntax; + + return new Promise(function (resolve) { + try { + tree = gonzales.parse(text, { syntax: syntax, rule: context }); + resolve(tree, filename); + } catch (e) { + let version = require('../package.json').version; + let message = filename ? [filename] : []; + message.push(e.message); + message.push('CSScomb Core version: ' + version); + e.stack = e.message = message.join(os.EOL); + throw e; + } + }); + } + + _pluginAlreadyUsed(name) { + return this._pluginIndex(name) !== -1; + } + + _pluginIndex(name) { + let index = -1; + this.plugins.some(function (plugin, i) { + if (plugin.name === name) { + index = i; + return true; + } + }); + return index; + } + + /** + * @param {Node} ast + * @return {Node} Transformed AST + */ + _processTree(ast) { + let config = this.config; + + this.plugins.filter(function (plugin) { + return plugin.value !== null && typeof plugin.process === 'function' && plugin.syntax.indexOf(ast.syntax) !== -1; + }).forEach(function (plugin) { + plugin.process(ast, config); + }); + + return ast; + } + + _readFile(path) { + return new Promise((resolve, reject) => { + if (!this._shouldProcessFile(path)) reject(); + + fs.readFile(path, 'utf8', function (e, string) { + if (e) reject(); + resolve(string); + }); + }); + } + + /** + * Checks if path is not present in `exclude` list. + * + * @param {String} path + * @returns {Boolean} False if specified path is present in `exclude` list. + * Otherwise returns true. + */ + _shouldProcess(path) { + path = path.replace(/\/$/, ''); + if (!fs.existsSync(path)) { + console.warn('Path ' + path + ' was not found.'); + return false; + } + + path = path.replace(/^\.\//, ''); + return this.exclude.every(function (e) { + return !e.match(path); + }); + } + + /** + * Checks if specified path is not present in `exclude` list and it has one of + * acceptable syntaxes. + * + * @param {String} path + * @returns {Boolean} False if the path either has unacceptable extension or + * is present in `exclude` list. True if everything is ok. + */ + _shouldProcessFile(path) { + // Get file's extension: + var syntax = this._extractSyntax(path); + + // Check if syntax is supported. If not, ignore the file: + if (!this.supportedSyntaxes.has(syntax)) return false; + + return this._shouldProcess(path); + } + + /** + * Extract syntax by file path + * + * @param {String} path + * @returns {String} syntax + */ + _extractSyntax(path) { + var extension = path.split('.').pop(); + + return this.syntaxMap.get('.' + extension) || extension; + } +} + +module.exports = Comb; \ No newline at end of file diff --git a/node_modules/csscomb/lib/csscomb.js b/node_modules/csscomb/lib/csscomb.js index aeeac16..3973b2b 100644 --- a/node_modules/csscomb/lib/csscomb.js +++ b/node_modules/csscomb/lib/csscomb.js @@ -1,212 +1,131 @@ -var Comb = require('csscomb-core'); -var gonzales = require('gonzales-pe'); -var fs = require('fs'); -var path = require('path'); +'use strict'; -/** - * Converts CSS string to AST. - * - * @param {String} text CSS string - * @param {String} [syntax] Syntax name (e.g., `scss`) - * @param {String} [filename] - * @returns {Array} AST - */ -function cssToAST(text, syntax, filename) { - var string = JSON.stringify; - var fileInfo = filename ? ' at ' + filename : ''; - var tree; - - try { - tree = gonzales.srcToAST({ syntax: syntax, src: text }); - } catch (e) { - throw new Error('Parsing error' + fileInfo + ': ' + e.message); - } - - // TODO: When can tree be undefined? - if (typeof tree === 'undefined') { - throw new Error('Undefined tree' + fileInfo + ': ' + string(text) + ' => ' + string(tree)); - } - - return tree; -} +let gonzales = require('gonzales-pe'); +let fs = require('fs'); +let Comb = require('./core'); +let format = require('./format'); +let path = require('path'); /** - * Gets option's data needed for detection - * - * @param {String} optionName - * @returns {Object} Object with option's name, link to `detect()` method - * and default value for the case when nothing can be detected + * @param {String|Object} config + * @constructor + * @name CSScomb */ -function getHandler(optionName) { - var option = require('./options/' + optionName); - if (!option.detect) throw new Error('Option does not have `detect()` method.'); - return { - name: option.name, - detect: option.detect, - detectDefault: option.detectDefault - }; -} +let CSScomb = function (config) { + let comb = new Comb(); + + // Add plugins. + fs.readdirSync(__dirname + '/options').map(function (option) { + return require('./options/' + option); + }).forEach(function (option) { + comb.use(option); + }); + + // If config was passed, configure: + if (typeof config === 'string') { + config = CSScomb.getConfig(config); + } + if (typeof config === 'object') { + comb.configure(config); + } + + // Chaining. + return comb; +}; /** - * Processes tree node and detects options. - * - * @param {Array} node Tree node - * @param {Number} level Indent level - * @param {Object} handler Object with option's data - * @param {Object} detectedOptions + * STATIC METHODS + * Methods that can be called without creating an instance: + * - detectInFile; + * - detectInString; + * - getConfig; + * - getCustomConfig; + * - getCustomConfigPath; + * For example: `CSScomb.getConfig('zen')` */ -function detectInNode(node, level, handler, detectedOptions) { - node.forEach(function(node) { - if (!Array.isArray(node)) return; - - var nodeType = node.shift(); - var detected = handler.detect(nodeType, node, level); - var variants = detectedOptions[handler.name]; - if (typeof detected === 'object') { - variants.push.apply(variants, detected); - } else if (typeof detected !== 'undefined') { - variants.push(detected); - } - node.unshift(nodeType); - - if (nodeType === 'atrulers' || nodeType === 'block') level++; - - detectInNode(node, level, handler, detectedOptions); - }); -} /** - * Processes tree and detects options. + * Detects the options in the given file * - * @param {Array} tree - * @param {Array} handlers List of options that we should look for - * @returns {Object} Map with detected options and all variants of possible - * values + * @param {String} file Path to the stylesheet + * @param {Array} options List of options to detect + * @returns {Object} Detected options */ -function detectInTree(tree, handlers) { - var detectedOptions = {}; - // We walk across complete tree for each handler, - // because we need strictly maintain order in which handlers work, - // despite fact that handlers work on different level of the tree. - handlers.forEach(function(handler) { - detectedOptions[handler.name] = []; - // TODO: Pass all parameters as one object? - detectInNode(['tree', tree], 0, handler, detectedOptions); - }); - return detectedOptions; -} +CSScomb.detectInFile = function detectInFile(file, options) { + var stylesheet = fs.readFileSync(file, 'utf8'); + return CSScomb.detectInString(stylesheet, options); +}; /** - * Gets the detected options. + * Detects the options in the given string * - * @param {Object} detected - * @param {Array} handlers - * @returns {Object} + * @param {String} text Stylesheet + * @param {Array} options List of options to detect + * @returns {Object} Detected options */ -function getDetectedOptions(detected, handlers) { - var options = {}; - Object.keys(detected).forEach(function(option) { - // List of all the detected variants from the stylesheet for the given option: - var values = detected[option]; - var i; - if (!values.length) { - // If there are no values for the option, check if there is a default one: - for (i = handlers.length; i--;) { - if (handlers[i].name === option && - handlers[i].detectDefault !== undefined) { - options[option] = handlers[i].detectDefault; - break; - } - } - } else if (values.length === 1) { - options[option] = values[0]; - } else { - // If there are more than one value for the option, find the most popular one; - // `variants` would be populated with the popularity for different values. - var variants = {}; - var bestGuess = null; - var maximum = 0; - for (i = values.length; i--;) { - var currentValue = values[i]; - // Count the current value: - if (variants[currentValue]) { - variants[currentValue]++; - } else { - variants[currentValue] = 1; - } - // If the current variant is the most popular one, treat - // it as the best guess: - if (variants[currentValue] >= maximum) { - maximum = variants[currentValue]; - bestGuess = currentValue; - } - } - if (bestGuess !== null) { - options[option] = bestGuess; - } - } - }); +CSScomb.detectInString = function detectInString(text, options) { + var result; + var handlers = []; - return options; -} + if (!text) return text; -/** - * Starts Code Style processing process. - * - * @param {String|Object} config - * @constructor - * @name CSScomb - */ -var CSScomb = function(config) { - var options = fs.readdirSync(__dirname + '/options').map(function(option) { - return require('./options/' + option); - }); + var optionNames = fs.readdirSync(__dirname + '/options'); + optionNames.forEach(function (option) { + option = option.slice(0, -3); + if (options && options.indexOf(option) < 0) return; + try { + handlers.push(getHandler(option)); + } catch (e) { + let message = `\nFailed to load "${option}" option:\n${e.message}`; + console.warn(message); + } + }); - var comb = new Comb(options, 'css', 'less', 'scss', 'sass'); + var tree = cssToAST(text); + var detectedOptions = detectInTree(tree, handlers); + result = getDetectedOptions(detectedOptions, handlers); - // If config was passed, configure: - if (typeof config === 'string') { - config = CSScomb.getConfig(config); - } - if (typeof config === 'object') { - comb.configure(config); - } + // Handle conflicting options with spaces around braces: + var blockIndent = result['block-indent']; + var spaceAfterOpeningBrace = result['space-after-opening-brace']; - return comb; -}; + if (typeof blockIndent === 'string' && spaceAfterOpeningBrace && spaceAfterOpeningBrace.indexOf('\n') > -1) { + result['space-after-opening-brace'] = '\n'; + } -/** - * STATIC METHODS - * Methods that can be called without creating an instance: - * - getConfig; - * - getCustomConfig; - * - getCustomConfigPath; - * - detectInFile; - * - detectInString. - * For example: `CSScomb.getConfig('zen')` - */ + return result; +}; /** - * Gets one of configuration files from `config` directory. + * Gets one of configuration files from configs' directory. * - * @param {String} name Config's name: 'csscomb', 'zen' or 'yandex' + * @param {String} name Config's name, e.g. 'yandex' * @returns {Object} Configuration object */ CSScomb.getConfig = function getConfig(name) { - // Names of predefined configs: - var CONFIGS = ['csscomb', 'zen', 'yandex']; - name = name || 'csscomb'; - - if (typeof name !== 'string') { - throw new Error('Config name must be a string.'); - } - - if (CONFIGS.indexOf(name) < 0) { - throw new Error('"' + name + '" is not a valid config name. Try one of ' + - 'the following: \'csscomb\', \'zen\' or \'yandex\'.'); - } - - return require('../config/' + name + '.json'); + const DEFAULT_CONFIG_NAME = 'csscomb'; + name = name || DEFAULT_CONFIG_NAME; + + if (typeof name !== 'string') { + throw new Error('Config name must be a string.'); + } + + let CONFIG_DIR_PATH = '../config'; + let dir = `${__dirname}/${CONFIG_DIR_PATH}`; + let availableConfigsNames = fs.readdirSync(dir).map(function (configFileName) { + return configFileName.split('.')[0]; // Strip file extension(s) + }); + + if (availableConfigsNames.indexOf(name) < 0) { + let configsNamesAsString = availableConfigsNames.map(function (configName) { + return '\'' + configName + '\''; + }).join(', '); + let message = `"${name}" is not a valid config name. Try one + of the following: ${configsNamesAsString}.`; + throw new Error(format(message)); + } + + return require(CONFIG_DIR_PATH + '/' + name + '.json'); }; /** @@ -217,16 +136,16 @@ CSScomb.getConfig = function getConfig(name) { * @returns {Object|null} */ CSScomb.getCustomConfig = function getCustomConfig(configPath) { - var config; - configPath = configPath || CSScomb.getCustomConfigPath(); + var config; + configPath = configPath || CSScomb.getCustomConfigPath(); - try { - config = require(configPath); - } catch (e) { - config = null; - } + try { + config = JSON.parse(fs.readFileSync(configPath, 'utf8')); + } catch (e) { + config = null; + } - return config; + return config; }; /** @@ -238,80 +157,149 @@ CSScomb.getCustomConfig = function getCustomConfig(configPath) { * @returns {String | null} */ CSScomb.getCustomConfigPath = function getCustomConfigPath(configPath) { - var HOME = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE; - - configPath = configPath || path.join(process.cwd(), '.csscomb.json'); - - // If we've finally found a config, return its path: - if (fs.existsSync(configPath)) return configPath; - - // If we are in HOME dir already and yet no config file, return a default - // one from our package. - // If project is located not under HOME, compare to root instead. - // Since there appears to be no good way to get root path in - // Windows, assume that if current dir has no parent dir, we're in - // root. - var dirname = path.dirname(configPath); - var parentDirname = path.dirname(dirname); - if (dirname === HOME || dirname === parentDirname) return null; - - // If there is no config in this directory, go one level up and look for - // a config there: - configPath = path.join(parentDirname, '.csscomb.json'); - return CSScomb.getCustomConfigPath(configPath); + var HOME = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE; + + configPath = configPath || path.join(process.cwd(), '.csscomb.json'); + + // If we've finally found a config, return its path: + if (fs.existsSync(configPath)) return fs.realpathSync(configPath); + + // If we are in HOME dir already and yet no config file, return a default + // one from our package. + // If project is located not under HOME, compare to root instead. + // Since there appears to be no good way to get root path in + // Windows, assume that if current dir has no parent dir, we're in + // root. + var dirname = path.dirname(configPath); + var parentDirname = path.dirname(dirname); + if (dirname === HOME || dirname === parentDirname) return null; + + // If there is no config in this directory, go one level up and look for + // a config there: + configPath = path.join(parentDirname, '.csscomb.json'); + return CSScomb.getCustomConfigPath(configPath); }; /** - * Detects the options in the given file + * Converts CSS string to AST. * - * @param {String} path Path to the stylesheet - * @param {Array} options List of options to detect - * @returns {Object} Detected options + * @param {String} text CSS string + * @param {String} [syntax] Syntax name (e.g., `scss`) + * @param {String} [filename] + * @returns {Array} AST */ -CSScomb.detectInFile = function detectInFile(path, options) { - var stylesheet = fs.readFileSync(path, 'utf8'); - return CSScomb.detectInString(stylesheet, options); -}; +function cssToAST(text, syntax, filename) { + var string = JSON.stringify; + var fileInfo = filename ? ' at ' + filename : ''; + var tree; + + try { + tree = gonzales.parse(text, { syntax: syntax }); + } catch (e) { + throw new Error('Parsing error' + fileInfo + ': ' + e.message); + } + + // TODO: When can tree be undefined? + if (typeof tree === 'undefined') { + let message = `Undefined tree ${fileInfo}: ${string(text)} => + ${string(tree)}`; + throw new Error(format(message)); + } + + return tree; +} /** - * Detects the options in the given string + * Processes tree and detects options. * - * @param {String} text Stylesheet - * @param {Array} options List of options to detect - * @returns {Object} Detected options + * @param {Array} tree + * @param {Array} handlers List of options that we should look for + * @returns {Object} Map with detected options and all variants of possible + * values */ -CSScomb.detectInString = function detectInString(text, options) { - var result; - var handlers = []; - - if (!text) return text; - - var optionNames = fs.readdirSync(__dirname + '/options'); - optionNames.forEach(function(option) { - option = option.slice(0, -3); - if (options && options.indexOf(option) < 0) return; - try { - handlers.push(getHandler(option)); - } catch (e) { - console.warn('\nFailed to load "%s" option:\n%s', option, e.message); - } - }); - - var tree = cssToAST(text); - var detectedOptions = detectInTree(tree, handlers); - result = getDetectedOptions(detectedOptions, handlers); - - // Handle conflicting options with spaces around braces: - var blockIndent = result['block-indent']; - var spaceAfterOpeningBrace = result['space-after-opening-brace']; +function detectInTree(tree, handlers) { + var detectedOptions = {}; + // We walk across complete tree for each handler, + // because we need strictly maintain order in which handlers work, + // despite fact that handlers work on different level of the tree. + handlers.forEach(function (handler) { + detectedOptions[handler.name] = handler.detect(tree); + }); + return detectedOptions; +} - if (typeof blockIndent === 'string' && - spaceAfterOpeningBrace && - spaceAfterOpeningBrace.indexOf('\n') > -1) { - result['space-after-opening-brace'] = '\n'; +/** + * Gets the detected options. + * + * @param {Object} detected + * @param {Array} handlers + * @returns {Object} + */ +function getDetectedOptions(detected, handlers) { + var options = {}; + Object.keys(detected).forEach(function (option) { + // List of all the detected variants from the stylesheet + // for the given option: + var values = detected[option]; + var i; + if (!values.length) { + // If there are no values for the option, check if there is + // a default one: + for (i = handlers.length; i--;) { + if (handlers[i].name === option && handlers[i].detectDefault !== undefined) { + options[option] = handlers[i].detectDefault; + break; + } + } + } else if (values.length === 1) { + options[option] = values[0]; + } else { + // If there are more than one value for the option, find + // the most popular one; `variants` would be populated + // with the popularity for different values. + var variants = {}; + var bestGuess = null; + var maximum = 0; + for (i = values.length; i--;) { + var currentValue = values[i]; + // Count the current value: + if (variants[currentValue]) { + variants[currentValue]++; + } else { + variants[currentValue] = 1; + } + // If the current variant is the most popular one, treat + // it as the best guess: + if (variants[currentValue] >= maximum) { + maximum = variants[currentValue]; + bestGuess = currentValue; + } + } + if (bestGuess !== null) { + options[option] = bestGuess; + } } + }); - return result; -}; + return options; +} + +/** + * Gets option's data needed for detection + * + * @param {String} optionName + * @returns {Object} Object with option's name, link to `detect()` method + * and default value for the case when nothing can be detected + */ +function getHandler(optionName) { + var option = require('./options/' + optionName); + if (!option.detect) throw new Error('Option does not have `detect()` method.'); + + return { + name: option.name, + detect: option.detect, + detectDefault: option.detectDefault + }; +} -module.exports = CSScomb; +module.exports = CSScomb; \ No newline at end of file diff --git a/node_modules/csscomb/lib/errors.js b/node_modules/csscomb/lib/errors.js new file mode 100644 index 0000000..f558ae5 --- /dev/null +++ b/node_modules/csscomb/lib/errors.js @@ -0,0 +1,69 @@ +'use strict'; + +let format = require('./format'); + +module.exports = { + configParsingError(configPath) { + return `Error parsing configuration file ${configPath}.`; + }, + + implementSetValue(valueType) { + if (typeof valueType === 'undefined') throw new Error(); + + return format(`If you see this message and you are not + a developer adding a new option, please open an issue here: + https://github.com/csscomb/core/issues/new\n + For option to accept values of type "${valueType}" + you need to implement custom \`setValue()\` method.`); + }, + + missingName() { + return 'Plugin must have a valid \`name\` property.'; + }, + + missingSetValue() { + return format(`Plugin must either implemet \`setValue()\` method + or provide \`accepts\` object with acceptable values.`); + }, + + missingSyntax() { + return 'Plugin must list supported syntaxes.'; + }, + + missingTemplateFile(file) { + return format(`Template configuration file ${file} + was not found.`); + }, + + twoPluginsWithSameName(pluginName) { + if (typeof pluginName === 'undefined') throw new Error(); + + return format(`You're trying to use one plugin twice: + ${pluginName}. Please make sure there are not two different + plugins with the same name.`); + }, + + unacceptableBoolean(pattern) { + if (typeof pattern === 'undefined') throw new Error(); + + return `Value must be one of the following: ${pattern.join(', ')}.`; + }, + + unacceptableNumber() { + return 'Value must be an integer.'; + }, + + unacceptableString(pattern) { + if (typeof pattern === 'undefined') throw new Error(); + + return `Value must match pattern ${pattern}.`; + }, + + unacceptableValueType(valueType, accepts) { + if (typeof valueType === 'undefined' || typeof accepts === 'undefined') throw new Error(); + + return format(`The option does not accept values of type + ${valueType}.\nValue\'s type must be one the following: + ${Object.keys(accepts).join(', ')}.`); + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/format.js b/node_modules/csscomb/lib/format.js new file mode 100644 index 0000000..37998dc --- /dev/null +++ b/node_modules/csscomb/lib/format.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (string) { + return string.replace(/\n\s+/gm, ' '); +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/always-semicolon.js b/node_modules/csscomb/lib/options/always-semicolon.js index 4c5853c..db84a15 100644 --- a/node_modules/csscomb/lib/options/always-semicolon.js +++ b/node_modules/csscomb/lib/options/always-semicolon.js @@ -1,83 +1,143 @@ -module.exports = { - name: 'always-semicolon', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { boolean: [true] }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType === 'block') { - for (var i = node.length; i--;) { - var currentNode = node[i]; - var currentNodeType = currentNode[0]; - var nodeWithoutSemicolon; - - // Skip nodes that already have `;` at the end: - if (currentNodeType === 'declDelim') break; - - // Add semicolon only after declarations and includes. - // If current node is include, insert semicolon right into it. - // If it's declaration, look for value node: - if (currentNodeType === 'include') { - nodeWithoutSemicolon = currentNode; - } else if (currentNodeType === 'declaration') { - for (var k = currentNode.length; k--;) { - if (currentNode[k][0] === 'value') { - nodeWithoutSemicolon = currentNode[k]; - break; - } - } - } else { - continue; - } - - var space = []; - var isBlock = false; - - // Check if there are spaces and comments at the end of the node: - for (var j = nodeWithoutSemicolon.length; j--;) { - var lastNode = nodeWithoutSemicolon[j][0]; - // If the node's last child is block, do not add semicolon: - // TODO: Add syntax check and run the code only for scss - if (lastNode === 'block') { - isBlock = true; - break; - } else if (['s', 'commentML', 'commentSL'].indexOf(lastNode) === -1) break; - - space.unshift(nodeWithoutSemicolon[j]); - } - - if (isBlock) break; - - // Temporarily remove last spaces and comments and insert `;` - // before them: - nodeWithoutSemicolon.splice(nodeWithoutSemicolon.length - space.length); - node.splice.apply(node, [i + 1, 0, ['declDelim']].concat(space)); - break; - } +'use strict'; + +var gonzales = require('gonzales-pe'); + +let option = { + /** + * Option's name as it's used in config. + * @type {String} + */ + get name() { + return 'always-semicolon'; + }, + + /** + * List of syntaxes that are supported by this option. + * @type {Array} + */ + get syntax() { + return ['css', 'less', 'sass', 'scss']; + }, + + /** + * Types of values this option accepts in config. + * @type {Object} + */ + get accepts() { + return { + boolean: [true] + }; + }, + + /** + * Checks ast for code style errors. + * + * @param {Node} ast + * @return {Array?} List of found errors. + */ + lint(ast) { + var errors = []; + + ast.traverseByType('block', block => { + block.eachFor(currentNode => { + var nodeWithoutSemicolon; + // Skip nodes that already have `;` at the end: + if (currentNode.is('declarationDelimiter')) return null; + + // Add semicolon only after declarations and includes. + // If current node is include, insert semicolon right into it. + // If it's declaration, look for value node: + if (currentNode.is('include') || currentNode.is('extend')) { + nodeWithoutSemicolon = currentNode; + } else if (currentNode.is('declaration')) { + nodeWithoutSemicolon = currentNode.last('value'); + } else { + return; + } + + errors.push({ + message: 'Missing semicolon', + line: nodeWithoutSemicolon.end.line, + column: nodeWithoutSemicolon.end.column + 1 + }); + + // Stop looping through block's children: + return null; + }); + }); + + return errors; + }, + + /** + * Processes ast and fixes found code style errors. + * @param {Node} ast + */ + process(ast) { + var nodeWithoutSemicolon; + + ast.traverseByType('block', block => { + block.eachFor(currentNode => { + // Skip nodes that already have `;` at the end: + if (currentNode.is('declarationDelimiter')) return null; + + // Add semicolon only after declarations and includes. + // If current node is include, insert semicolon right into it. + // If it's declaration, look for value node: + if (currentNode.is('include') || currentNode.is('extend')) { + nodeWithoutSemicolon = currentNode; + } else if (currentNode.is('declaration')) { + nodeWithoutSemicolon = currentNode.last('value'); + } else { + return; } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType === 'block') { - for (var i = node.length; i--;) { - var nodeItem = node[i]; - var type = nodeItem[0]; - if (type === 'declDelim') return true; - - if (type === 'declaration') return false; - } + + // Check if there are spaces and comments at the end of the node + for (var j = nodeWithoutSemicolon.length; j--;) { + var lastNode = nodeWithoutSemicolon.get(j); + + // If the node's last child is block, do not add semicolon: + // TODO: Add syntax check and run the code only for scss + if (lastNode.is('block')) { + return null; + } else if (!lastNode.is('space') && !lastNode.is('multilineComment') && !lastNode.is('singlelineComment')) { + j++; + break; + } } - } + + var declDelim = gonzales.createNode({ + type: 'declarationDelimiter', + content: ';' + }); + nodeWithoutSemicolon.insert(j, declDelim); + return null; + }); + }); + }, + + /** + * Detects the value of this option in ast. + * @param {Node} ast + * @return {Array?} List of detected values + */ + detect(ast) { + var detected = []; + + ast.traverseByType('block', block => { + block.eachFor(node => { + if (node.is('declarationDelimiter')) { + detected.push(true); + return null; + } else if (node.is('declaration')) { + detected.push(false); + return null; + } + }); + }); + + return detected; + } }; + +module.exports = option; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/block-indent.js b/node_modules/csscomb/lib/options/block-indent.js index 4cc9e05..2eb8ef7 100644 --- a/node_modules/csscomb/lib/options/block-indent.js +++ b/node_modules/csscomb/lib/options/block-indent.js @@ -1,121 +1,141 @@ -module.exports = (function() { - function processStylesheet(node) { - var spaces; - var whitespaceNode; - var i; - - for (i = node.length; i--;) { - whitespaceNode = node[i]; - - if (whitespaceNode[0] !== 's') continue; - - spaces = whitespaceNode[1].replace(/\n[ \t]+/gm, '\n'); - - if (spaces === '') { - node.splice(i, 1); - } else { - whitespaceNode[1] = spaces; - } - } - } - - function processSassBlock(node, level, value) { - var spaces; - var whitespaceNode; - var i; - - for (i = node.length; i--;) { - whitespaceNode = node[i]; - - if (whitespaceNode[0] !== 's') continue; - - if (whitespaceNode[1] === '\n') continue; - - spaces = whitespaceNode[1].replace(/[ \t]/gm, ''); - spaces += new Array(level + 2).join(value); - whitespaceNode[1] = spaces; - } - } - - function processSpaceNode(node, level, value) { - var spaces; - - // Remove all whitespaces and tabs, leave only new lines: - spaces = node[0].replace(/[ \t]/gm, ''); - - if (!spaces) return; - - spaces += new Array(level + 1).join(value); - node[0] = spaces; - } - +'use strict'; + +let option = { + /** + * Option's name as it's used in config. + * @type {String} + */ + get name() { + return 'block-indent'; + }, + + /** + * Name of option that must run after this option. + * @type {String} + */ + get runBefore() { + return 'sort-order'; + }, + + /** + * List of syntaxes that are supported by this option. + * @type {Array} + */ + get syntax() { + return ['css', 'less', 'sass', 'scss']; + }, + + /** + * Types of values this option accepts in config. + * @type {Object} + */ + get accepts() { return { - name: 'block-indent', - - runBefore: 'sort-order', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { - number: true, - string: /^[ \t]*$/ - }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - * @param {Number} level - */ - process: function process(nodeType, node, level) { - var syntax = this.getSyntax(); - var value = this.getValue('block-indent'); - - if (nodeType === 'stylesheet') { - return processStylesheet(node); - } - - if (syntax === 'sass' && nodeType === 'block') { - return processSassBlock(node, level, value); - } - - // Continue only with space nodes inside {...}: - if (syntax !== 'sass' && level !== 0 && nodeType === 's') { - processSpaceNode(node, level, value); - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - * @param {Number} level - */ - detect: function(nodeType, node, level) { - var result = []; - - // Continue only with non-empty {...} blocks: - if (nodeType !== 'atrulers' && nodeType !== 'block' || !node.length) return; - - for (var i = node.length; i--;) { - var whitespaceNode = node[i]; - if (whitespaceNode[0] !== 's') continue; - - var spaces = whitespaceNode[1]; - var lastIndex = spaces.lastIndexOf('\n'); - - // Do not continue if there is no line break: - if (lastIndex < 0) continue; - - // Number of spaces from beginning of line: - var spacesLength = spaces.slice(lastIndex + 1).length; - var arrayLength = Math.floor(spacesLength / (level + 1)) + 1; - result.push(new Array(arrayLength).join(' ')); - } - - return result; - } + number: true, + string: /^[ \t]*$/ }; -})(); + }, + + /** + * Processes ast and fixes found code style errors. + * @param {Node} ast + */ + process(ast) { + ast.eachFor('space', function (whitespaceNode, i) { + var spaces = whitespaceNode.content.replace(/\n[ \t]+/gm, '\n'); + + if (spaces === '') { + ast.remove(i); + } else { + whitespaceNode.content = spaces; + } + }); + + this._processNode(ast, 0); + }, + + /** + * Detects the value of this option in ast. + * @param {Node} ast + * @return {Array} List of detected values + */ + detect(ast) { + var detected = []; + + ast.traverse(function (node) { + // Continue only with non-empty {...} blocks: + if (!node.is('atrulers') && !node.is('block') || !node.length) return; + + node.eachFor('space', function (whitespaceNode) { + var spaces = whitespaceNode.content; + var lastIndex = spaces.lastIndexOf('\n'); + + // Do not continue if there is no line break: + if (lastIndex < 0) return; + + // Number of spaces from beginning of line: + var spacesLength = spaces.slice(lastIndex + 1).length + 1; + detected.push(new Array(spacesLength).join(' ')); + }); + }); + + return detected; + }, + + /** + * @param {Node} node + * @param {Number} level + */ + _processNode(node, level) { + var that = this; + + node.forEach(function (n) { + if (node.syntax === 'sass' && n.is('block')) { + that._processSassBlock(n, level); + } + + // Continue only with space nodes inside {...}: + if (node.syntax !== 'sass' && level !== 0 && n.is('space')) { + that._processSpaceNode(n, level); + } + + if (n.is('block') || n.is('atrulers')) level++; + + that._processNode(n, level); + }); + }, + + /** + * @param {Node} node + * @param {Number} level + */ + _processSassBlock(node, level) { + var value = this.value; + + node.eachFor('space', function (whitespaceNode) { + if (whitespaceNode.content === '\n') return; + + var spaces = whitespaceNode.content.replace(/[ \t]/gm, ''); + spaces += new Array(level + 2).join(value); + whitespaceNode.content = spaces; + }); + }, + + /** + * @param {Node} node + * @param {Number} level + */ + _processSpaceNode(node, level) { + var value = this.value; + + // Remove all whitespaces and tabs, leave only new lines: + var spaces = node.content.replace(/[ \t]/gm, ''); + + if (!spaces) return; + + spaces += new Array(level + 1).join(value); + node.content = spaces; + } +}; + +module.exports = option; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/color-case.js b/node_modules/csscomb/lib/options/color-case.js index 239a178..19fa5df 100644 --- a/node_modules/csscomb/lib/options/color-case.js +++ b/node_modules/csscomb/lib/options/color-case.js @@ -1,39 +1,62 @@ -module.exports = { - name: 'color-case', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { string: /^lower|upper$/ }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - var value = this.getValue('color-case'); - if (nodeType === 'vhash') { - if (value === 'lower') { - node[0] = node[0].toLowerCase(); - } else if (value === 'upper') { - node[0] = node[0].toUpperCase(); - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType === 'vhash') { - if (node[0].match(/^[^A-F]*[a-f][^A-F]*$/)) { - return 'lower'; - } else if (node[0].match(/^[^a-f]*[A-F][^a-f]*$/)) { - return 'upper'; - } - } - } +'use strict'; + +let option = { + /** + * Option's name as it's used in config. + * @type {String} + */ + get name() { + return 'color-case'; + }, + + /** + * List of syntaxes that are supported by this option. + * @type {Array} + */ + get syntax() { + return ['css', 'less', 'sass', 'scss']; + }, + + /** + * Types of values this option accepts in config. + * @type {Object} + */ + get accepts() { + return { + string: /^lower|upper$/ + }; + }, + + /** + * Processes ast and fixes found code style errors. + * @param {Node} ast + */ + process(ast) { + var value = this.value; + + ast.traverseByType('color', function (color) { + color.content = value === 'lower' ? color.content.toLowerCase() : color.content.toUpperCase(); + }); + }, + + /** + * Detects the value of this option in ast. + * @param {Node} ast + * @return {Array} List of detected values + */ + detect(ast) { + var detected = []; + + ast.traverseByType('color', function (color) { + if (color.content.match(/^[^A-F]*[a-f][^A-F]*$/)) { + detected.push('lower'); + } else if (color.content.match(/^[^a-f]*[A-F][^a-f]*$/)) { + detected.push('upper'); + } + }); + + return detected; + } }; + +module.exports = option; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/color-shorthand.js b/node_modules/csscomb/lib/options/color-shorthand.js index 14fdcc5..761f986 100644 --- a/node_modules/csscomb/lib/options/color-shorthand.js +++ b/node_modules/csscomb/lib/options/color-shorthand.js @@ -1,38 +1,62 @@ -module.exports = { - name: 'color-shorthand', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { boolean: [true, false] }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType === 'vhash') { - if (this.getValue('color-shorthand')) { - node[0] = node[0].replace(/(\w)\1(\w)\2(\w)\3/i, '$1$2$3'); - } else { - node[0] = node[0].replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3'); - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType === 'vhash') { - if (node[0].match(/^\w{3}$/)) { - return true; - } else if (node[0].match(/^(\w)\1(\w)\2(\w)\3$/)) { - return false; - } - } - } +'use strict'; + +let option = { + /** + * Option's name as it's used in config. + * @type {String} + */ + get name() { + return 'color-shorthand'; + }, + + /** + * List of syntaxes that are supported by this option. + * @type {Array} + */ + get syntax() { + return ['css', 'less', 'sass', 'scss']; + }, + + /** + * Types of values this option accepts in config. + * @type {Object} + */ + get accepts() { + return { + boolean: [true, false] + }; + }, + + /** + * Processes ast and fixes found code style errors. + * @param {Node} ast + */ + process(ast) { + var value = this.value; + + ast.traverseByType('color', function (color) { + color.content = value ? color.content.replace(/(\w)\1(\w)\2(\w)\3/i, '$1$2$3') : color.content.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3'); + }); + }, + + /** + * Detects the value of this option in ast. + * @param {Node} ast + * @return {Array} List of detected values + */ + detect(ast) { + var detected = []; + + ast.traverseByType('color', function (color) { + if (color.content.match(/^\w{3}$/)) { + detected.push(true); + } else if (color.content.match(/^(\w)\1(\w)\2(\w)\3$/)) { + detected.push(false); + } + }); + + return detected; + } }; + +module.exports = option; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/element-case.js b/node_modules/csscomb/lib/options/element-case.js index dae90e4..280832d 100644 --- a/node_modules/csscomb/lib/options/element-case.js +++ b/node_modules/csscomb/lib/options/element-case.js @@ -1,54 +1,74 @@ -module.exports = { - name: 'element-case', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { string: /^lower|upper$/ }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 'selector' && - nodeType !== 'arguments') return; - - for (var x = node.length; x--;) { - var selector = node[x]; - if (selector[0] !== 'simpleselector') continue; - - for (var i = selector.length; i--;) { - var simpleselector = selector[i]; - if (!Array.isArray(simpleselector) || - simpleselector[0] !== 'ident') continue; - - simpleselector[1] = this.getValue('element-case') === 'lower' ? - simpleselector[1].toLowerCase() : - simpleselector[1].toUpperCase(); - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'simpleselector') return; - - var variants = []; - for (var i = node.length; i--;) { - var nodeItem = node[i]; - if (nodeItem[0] !== 'ident') continue; - if (nodeItem[1].match(/^[a-z]+$/)) { - variants.push('lower'); - } else if (nodeItem[1].match(/^[A-Z]+$/)) { - variants.push('upper'); - } - } - return variants; - } +'use strict'; + +let option = { + /** + * Option's name as it's used in config. + * @type {String} + */ + get name() { + return 'element-case'; + }, + + /** + * List of syntaxes that are supported by this option. + * @type {Array} + */ + get syntax() { + return ['css', 'less', 'sass', 'scss']; + }, + + /** + * Types of values this option accepts in config. + * @type {Object} + */ + get accepts() { + return { + string: /^lower|upper$/ + }; + }, + + /** + * Processes ast and fixes found code style errors. + * @param {Node} ast + */ + process(ast) { + let value = this.value; + + ast.traverse(node => { + if (!node.is('selector') && !node.is('arguments')) return; + + node.forEach('typeSelector', selector => { + selector.forEach('ident', ident => { + ident.content = value === 'lower' ? ident.content.toLowerCase() : ident.content.toUpperCase(); + }); + }); + }); + }, + + /** + * Detects the value of this option in ast. + * @param {Node} ast + * @return {Array} List of detected values + */ + detect(ast) { + let detected = []; + + ast.traverse(node => { + if (!node.is('selector') && !node.is('arguments')) return; + + node.forEach('typeSelector', selector => { + selector.forEach('ident', ident => { + if (ident.content.match(/^[a-z]+$/)) { + detected.push('lower'); + } else if (ident.content.match(/^[A-Z]+$/)) { + detected.push('upper'); + } + }); + }); + }); + + return detected; + } }; + +module.exports = option; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/eof-newline.js b/node_modules/csscomb/lib/options/eof-newline.js index fa8d34e..900c9d8 100644 --- a/node_modules/csscomb/lib/options/eof-newline.js +++ b/node_modules/csscomb/lib/options/eof-newline.js @@ -1,40 +1,64 @@ -module.exports = { - name: 'eof-newline', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { boolean: [true, false] }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType === 'stylesheet') { - var lastChild = node[node.length - 1]; - if (lastChild[0] !== 's') { - lastChild = ['s', '']; - node.push(lastChild); - } - lastChild[1] = lastChild[1].replace(/\n$/, ''); - if (this.getValue('eof-newline')) lastChild[1] += '\n'; - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType === 'stylesheet') { - if (node[node.length - 1][0] === 's' && node[node.length - 1][1].indexOf('\n') !== -1) { - return true; - } else { - return false; - } - } +'use strict'; + +let gonzales = require('gonzales-pe'); + +let option = { + /** + * Option's name as it's used in config. + * @type {String} + */ + get name() { + return 'eof-newline'; + }, + + /** + * List of syntaxes that are supported by this option. + * @type {Array} + */ + get syntax() { + return ['css', 'less', 'sass', 'scss']; + }, + + /** + * Types of values this option accepts in config. + * @type {Object} + */ + get accepts() { + return { + boolean: [true, false] + }; + }, + + /** + * Processes ast and fixes found code style errors. + * @param {Node} ast + */ + process(ast) { + var lastChild = ast.last(); + + if (!lastChild.is('space')) { + lastChild = gonzales.createNode({ type: 'space', content: '' }); + ast.content.push(lastChild); } + + lastChild.content = lastChild.content.replace(/\n$/, ''); + if (this.value) lastChild.content += '\n'; + }, + + /** + * Detects the value of this option in ast. + * @param {Node} ast + * @return {Array} List of detected values + */ + detect(ast) { + var lastChild = ast.last(); + + if (lastChild.is('space') && lastChild.content.indexOf('\n') !== -1) { + return [true]; + } else { + return [false]; + } + } }; + +module.exports = option; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/leading-zero.js b/node_modules/csscomb/lib/options/leading-zero.js index 07c9de8..03a0263 100644 --- a/node_modules/csscomb/lib/options/leading-zero.js +++ b/node_modules/csscomb/lib/options/leading-zero.js @@ -1,39 +1,46 @@ +'use strict'; + module.exports = { - name: 'leading-zero', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { boolean: [true, false] }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType === 'number') { - if (this.getValue('leading-zero')) { - if (node[0][0] === '.') - node[0] = '0' + node[0]; - } else { - node[0] = node[0].replace(/^0+(?=\.)/, ''); - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType === 'number') { - if (node.toString().match(/^\.[0-9]+/)) { - return false; - } else if (node.toString().match(/^0\.[0-9]+/)) { - return true; - } - } - } -}; + name: 'leading-zero', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + boolean: [true, false] + }, + + /** + * Processes tree node. + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverseByType('number', function (number) { + if (!value) { + number.content = number.content.replace(/^0+(?=\.)/, ''); + } else if (number.content[0] === '.') { + number.content = '0' + number.content; + } + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByType('number', function (number) { + if (number.content.match(/^\.[0-9]+/)) { + detected.push(false); + } else if (number.content.match(/^0\.[0-9]+/)) { + detected.push(true); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/lines-between-rulesets.js b/node_modules/csscomb/lib/options/lines-between-rulesets.js new file mode 100644 index 0000000..8f2ac3c --- /dev/null +++ b/node_modules/csscomb/lib/options/lines-between-rulesets.js @@ -0,0 +1,246 @@ +'use strict'; + +let gonzales = require('gonzales-pe'); + +let option = { + newLinesString: '', + newLinesNode: null, + + /** + * Option's name as it's used in config. + * @type {String} + */ + get name() { + return 'lines-between-rulesets'; + }, + + /** + * Name of option that must run after this option. + * @type {String} + */ + get runBefore() { + return 'block-indent'; + }, + + /** + * List of syntaxes that are supported by this option. + * @type {Array} + */ + get syntax() { + return ['css', 'less', 'sass', 'scss']; + }, + + /** + * Types of values this option accepts in config. + * @type {Object} + */ + get accepts() { + return { + number: true + }; + }, + + /** + * @param {number} value + * @returns {number} + */ + /* + ** Still need to override, as the core implementation of setValue doesn't + ** pass numbers through, but creates a string of spaces of the same length. + */ + setValue(value) { + let valueType = typeof value; + + if (valueType !== 'number') { + throw new Error('Value must be a number.'); + } + + return value; + }, + + buildSpacing(syntax) { + let spacing = ''; + let numNewLines = 0; + let newLinesOffset = 1; + + if (syntax === 'sass') { + newLinesOffset = 0; + } + + numNewLines = Math.round(this.value) + newLinesOffset; + + for (var i = 0; i < numNewLines; i++) { + spacing += '\n'; + } + + return spacing; + }, + + /** + * Processes ast and fixes found code style errors. + * @param {Node} ast + */ + process(ast) { + this.newLinesString = this.buildSpacing(ast.syntax); + this.newLinesNode = gonzales.createNode({ + type: 'space', + content: this.newLinesString + }); + this.processBlock(ast); + }, + + processBlock(x) { + if (x.is('stylesheet')) { + // Check all @rules + this.processAtRules(x); + + // Check all rulesets + this.processRuleSets(x); + } + + x.forEach(node => { + if (!node.is('block')) { + return this.processBlock(node); + } + + // Check all @rules + this.processAtRules(node); + + // Check all rulesets + this.processRuleSets(node); + + this.processBlock(node); + }); + }, + + processAtRules(node) { + node.forEach('atrule', (atRuleNode, index) => { + this.insertNewlines(node, index); + }); + }, + + processRuleSets(node) { + node.forEach('ruleset', (ruleSetNode, index) => { + this.insertNewlines(node, index); + }); + }, + + isComment(node) { + if (!node) { + return false; + } + return node.is('singlelineComment') || node.is('multilineComment'); + }, + + isNewline(node) { + if (!node) { + return false; + } + return node.content === '\n'; + }, + + prevLineIsComment(parent, index) { + let indexThreshold = 2; + let prevChild; + let prevMinusOneChild; + let prevMinusTwoChild; + let parentSyntax = parent ? parent.syntax : null; + + // Sass is troublesome because newlines are counted as separate nodes + if (parentSyntax === 'sass') { + indexThreshold = 3; + } + + if (!parent || index < indexThreshold) { + return false; + } + + prevChild = parent.get(index - 1); + prevMinusOneChild = parent.get(index - 2); + + if (parentSyntax === 'sass') { + prevMinusTwoChild = parent.get(index - 3); + return this.isComment(prevMinusTwoChild) && this.isNewline(prevMinusOneChild) && prevChild.is('space'); + } + + return this.isComment(prevMinusOneChild) && prevChild.is('space'); + }, + + /* + ** Find the latest previous child that isn't a comment, and return its index. + */ + findLatestNonCommentNode(parent, index) { + let prevChild; + let lastNonCommentIndex = -1; + let currentIndex = index; + let jumpSize = 2; + + if (parent.syntax === 'sass') { + jumpSize = 3; + } + + while (currentIndex >= 0) { + if (this.prevLineIsComment(parent, currentIndex)) { + currentIndex -= jumpSize; + continue; + } + + prevChild = parent.get(currentIndex - 1); + + if (!this.isComment(prevChild)) { + lastNonCommentIndex = currentIndex - 1; + break; + } + + currentIndex--; + } + + return lastNonCommentIndex; + }, + + insertNewlinesAsString(node) { + let content = node.content; + let lastNewline = content.lastIndexOf('\n'); + let newContent; + + if (lastNewline > -1) { + content = content.substring(lastNewline + 1); + } + + newContent = this.newLinesString + content; + node.content = newContent; + }, + + insertNewlinesAsNode(node) { + node.insert(node.length, this.newLinesNode); + }, + + insertNewlines(node, index) { + let prevChild = node.get(index - 1); + let shouldInsert = false; + + // Check for previous nodes that are not a space + // Do not insert if the ruleset is the first item + for (var i = 0; i < index; i++) { + if (!node.get(i).is('space')) { + shouldInsert = true; + break; + } + } + + if (prevChild && shouldInsert) { + if (this.prevLineIsComment(node, index) || this.isComment(prevChild)) { + let lastNonCommentIndex = this.findLatestNonCommentNode(node, index); + prevChild = node.get(lastNonCommentIndex); + } + + if (prevChild.is('space')) { + this.insertNewlinesAsString(prevChild); + } else { + this.insertNewlinesAsNode(prevChild); + } + } + } +}; + +module.exports = option; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/quotes.js b/node_modules/csscomb/lib/options/quotes.js index 1c8b979..da50990 100644 --- a/node_modules/csscomb/lib/options/quotes.js +++ b/node_modules/csscomb/lib/options/quotes.js @@ -1,46 +1,58 @@ +'use strict'; + module.exports = { - name: 'quotes', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { string: /^single|double$/ }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - var value = this.getValue('quotes'); - if (nodeType === 'string') { - if (node[0][0] === '"' && value === 'single') { - node[0] = node[0] - .replace(/\\"/g, '"') // unescape all escaped double quotes - .replace(/([^\\])'/g, '$1\\\'') // escape all the single quotes - .replace(/^"|"$/g, '\''); // replace the first and the last quote - - } else if (node[0][0] === '\'' && value === 'double') { - node[0] = node[0] - .replace(/\\'/g, '\'') // unescape all escaped single quotes - .replace(/([^\\])"/g, '$1\\\"') // escape all the double quotes - .replace(/^'|'$/g, '"'); // replace the first and the last quote - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType === 'string') { - if (node[0][0] === '"') { - return 'double'; - } else if (node[0][0] === '\'') { - return 'single'; - } - } - } -}; + name: 'quotes', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + string: /^single|double$/ + }, + + /** + * Processes tree node. + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverseByType('string', function (string) { + if (string.content[0] === '"' && value === 'single') { + string.content = string.content + // Unescape all escaped double quotes + .replace(/\\"/g, '"') + // Escape all the single quotes + .replace(/([^\\])'/g, '$1\\\'') + // Replace the first and the last quote + .replace(/^"|"$/g, '\''); + } else if (string.content[0] === '\'' && value === 'double') { + string.content = string.content + // Unescape all escaped single quotes + .replace(/\\'/g, '\'') + // Escape all the double quotes + .replace(/([^\\])"/g, '$1\\\"') + // Replace the first and the last quote + .replace(/^'|'$/g, '"'); + } + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByType('string', function (string) { + if (string.content[0] === '"') { + detected.push('double'); + } else if (string.content[0] === '\'') { + detected.push('single'); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/remove-empty-rulesets.js b/node_modules/csscomb/lib/options/remove-empty-rulesets.js index 9573283..b8fd6e4 100644 --- a/node_modules/csscomb/lib/options/remove-empty-rulesets.js +++ b/node_modules/csscomb/lib/options/remove-empty-rulesets.js @@ -1,115 +1,89 @@ -module.exports = (function() { - function processStylesheetContent(nodeContent) { - removeEmptyRulesets(nodeContent); - mergeAdjacentWhitespace(nodeContent); - } +'use strict'; - function removeEmptyRulesets(nodeContent) { - var i = nodeContent.length; - // Loop through node and try to find a ruleset: - while (i--) { - var node = nodeContent[i]; - if (!isRuleset(node)) continue; - // If a ruleset is found, try to find its nested rulesets and remove - // all empty ones: - var j = node.length; - while (j--) { - // Nested rulesets are located inside blocks, that's why look - // for blocks only: - var blockNode = node[j]; - if (blockNode[0] !== 'block') continue; - blockNode.shift(); - processStylesheetContent(blockNode); - blockNode.unshift('block'); - node[j] = blockNode; - } - // If after removing all empty nested rulesets the parent has also - // become empty, remove it too: - if (isEmptyRuleset(node)) { - nodeContent.splice(i, 1); - } - } - } +module.exports = function () { + function processNode(node) { + removeEmptyRulesets(node); + mergeAdjacentWhitespace(node); + } - /** - * Removing ruleset nodes from tree may result in two adjacent whitespace nodes which is not correct AST: - * [space, ruleset, space] => [space, space] - * To ensure correctness of further processing we should merge such nodes into one. - * [space, space] => [space] - */ - function mergeAdjacentWhitespace(nodeContent) { - var i = nodeContent.length - 1; - while (i-- > 0) { - if (isWhitespace(nodeContent[i]) && isWhitespace(nodeContent[i + 1])) { - nodeContent[i][1] += nodeContent[i + 1][1]; - nodeContent.splice(i + 1, 1); - } - } - } + function removeEmptyRulesets(stylesheet) { + stylesheet.forEach('ruleset', function (ruleset, i) { + var block = ruleset.first('block'); + processNode(block); + if (isEmptyBlock(block)) stylesheet.removeChild(i); + }); + } - function isEmptyRuleset(ruleset) { - return ruleset.filter(isBlock).every(isEmptyBlock, this); + /** + * Removing ruleset nodes from tree may result in two adjacent whitespace + * nodes which is not correct AST: + * [space, ruleset, space] => [space, space] + * To ensure correctness of further processing we should merge such nodes + * into one: + * [space, space] => [space] + */ + function mergeAdjacentWhitespace(node) { + var i = node.content.length - 1; + while (i-- > 0) { + if (node.get(i).is('space') && node.get(i + 1) && node.get(i + 1).is('space')) { + node.get(i).content += node.get(i + 1).content; + node.removeChild(i + 1); + } } + } - /** - * Block is considered empty when it has nothing but spaces. - */ - function isEmptyBlock(node) { - return node.length === 1 || !node.some(isNotWhitespace); - } + /** + * Block is considered empty when it has nothing but spaces. + */ + function isEmptyBlock(node) { + if (!node.length) return true; - function isRuleset(node) { - return node[0] === 'ruleset'; - } + return !node.content.some(function (node) { + return !node.is('space'); + }); + } - function isBlock(node) { - return node[0] === 'block'; - } + return { + name: 'remove-empty-rulesets', - function isWhitespace(node) { - return node[0] === 's'; - } + runBefore: 'block-indent', - function isNotWhitespace(node) { - return typeof node === 'object' && node[0] !== 's'; - } + syntax: ['css', 'less', 'sass', 'scss'], - return { - name: 'remove-empty-rulesets', + accepts: { + boolean: [true] + }, - runBefore: 'block-indent', - - syntax: ['css', 'less', 'sass', 'scss'], + /** + * Remove rulesets with no declarations. + * + * @param {String} ast + */ + process: function (ast) { + processNode(ast); + }, - accepts: { boolean: [true] }, + detectDefault: true, - /** - * Remove rulesets with no declarations. - * - * @param {String} nodeType - * @param {Array} nodeContent - */ - process: function(nodeType, nodeContent) { - if (nodeType === 'stylesheet') { - processStylesheetContent(nodeContent); - } - }, + /** + * Detects the value of an option at the tree node. + * This option is treated as `true` by default, but any trailing space + * would invalidate it. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; - /** - * Detects the value of an option at the tree node. - * This option is treated as `true` by default, but any trailing space would invalidate it. - * - * @param {String} nodeType - * @param {node} node - */ - detectDefault: true, + ast.traverse(function (node) { + if (!node.is('atrulers') && !node.is('block')) return; - detect: function(nodeType, node) { - if (nodeType === 'atrulers' || nodeType === 'block') { - if (node.length === 0 || (node.length === 1 && node[0][0] === 's')) { - return false; - } - } + if (node.length === 0 || node.length === 1 && node.first().is('space')) { + detected.push(false); } - }; -})(); + }); + + return detected; + } + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/sort-order-fallback.js b/node_modules/csscomb/lib/options/sort-order-fallback.js index 21d25b0..309aa10 100644 --- a/node_modules/csscomb/lib/options/sort-order-fallback.js +++ b/node_modules/csscomb/lib/options/sort-order-fallback.js @@ -1,9 +1,13 @@ +'use strict'; + module.exports = { - name: 'sort-order-fallback', + name: 'sort-order-fallback', + + syntax: ['css', 'less', 'sass', 'scss'], - syntax: ['css', 'less', 'sass', 'scss'], + accepts: { string: /^abc$/ }, - accepts: { string: /^abc$/ }, + process: function () {}, - process: function() {} -}; + detect: () => [] +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/sort-order.js b/node_modules/csscomb/lib/options/sort-order.js index fc25767..51477ae 100644 --- a/node_modules/csscomb/lib/options/sort-order.js +++ b/node_modules/csscomb/lib/options/sort-order.js @@ -1,381 +1,403 @@ +'use strict'; + +var gonzales = require('gonzales-pe'); + module.exports = { - name: 'sort-order', - - runBefore: 'space-before-closing-brace', - - syntax: ['css', 'less', 'sass', 'scss'], - - /** - * Sets handler value. - * - * @param {Array} value Option value - * @returns {Array} - */ - setValue: function(value) { - if (!Array.isArray(value)) throw new Error('The option accepts only array of properties.'); - - var order = {}; - - if (typeof value[0] === 'string') { - value.forEach(function(prop, propIndex) { - order[prop] = { group: 0, prop: propIndex }; - }); - } else { - value.forEach(function(group, groupIndex) { - group.forEach(function(prop, propIndex) { - order[prop] = { group: groupIndex, prop: propIndex }; - }); - }); - } + get name() { + return 'sort-order'; + }, + + get runBefore() { + return 'space-before-closing-brace'; + }, + + get syntax() { + return ['css', 'less', 'sass', 'scss']; + }, + + /** + * @param {Array} value Option value + * @returns {Array} + */ + setValue(value) { + if (!Array.isArray(value)) throw new Error('The option accepts only array of properties.'); + + var order = {}; + + if (typeof value[0] === 'string') { + // If there is only one group of properties. + value.forEach(function (prop, propIndex) { + order[prop] = { group: 0, prop: propIndex }; + }); + } else { + value.forEach(function (group, groupIndex) { + group.forEach(function (prop, propIndex) { + order[prop] = { group: groupIndex, prop: propIndex }; + }); + }); + } - return order; - }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - var _this = this; - // Types of nodes that can be sorted: - var NODES = ['atruleb', 'atruler', 'atrules', 'commentML', 'commentSL', - 'declaration', 's', 'include']; - // Spaces and comments: - var SC = ['commentML', 'commentSL', 's']; - - var currentNode; - // Sort order of properties: - var order = this.getValue('sort-order'); - var syntax = this.getSyntax(); - // List of declarations that should be sorted: - var sorted = []; - // list of nodes that should be removed from parent node: - var deleted = []; - // List of spaces and comments that go before declaration/@-rule: - var sc0 = []; - // Value to search in sort order: either a declaration's property name - // (e.g. `color`), or @-rule's special keyword (e.g. `$import`): - var propertyName; - - // Index to place the nodes that shouldn't be sorted - var lastGroupIndex = order['...'] ? order['...'].group : Infinity; - var lastPropertyIndex = order['...'] ? order['...'].prop : Infinity; - - // Counters for loops: - var i; - var l; - var j; - var nl; - - /** - * Check if there are any comments or spaces before - * the declaration/@-rule. - * @returns {Array} List of nodes with spaces and comments - */ - var checkSC0 = function() { - // List of nodes with spaces and comments: - var sc = []; - // List of nodes that can be later deleted from parent node: - var d = []; - - for (; i < l; i++) { - currentNode = node[i]; - // If there is no node left, - // stop and do nothing with previously found spaces/comments: - if (!currentNode) { - return false; - } - - // Remove any empty lines: - if (currentNode[0] === 's') { - currentNode[1] = currentNode[1].replace(/\n[\s\t\n\r]*\n/, '\n'); - } - - // If the node is declaration or @-rule, stop and return all - // found nodes with spaces and comments (if there are any): - if (SC.indexOf(currentNode[0]) === -1) break; - - sc.push(currentNode); - d.push(i); - } - - deleted = deleted.concat(d); - - return sc; - }; - - /** - * Check if there are any comments or spaces after - * the declaration/@-rule. - * @returns {Array} List of nodes with spaces and comments - * @private - */ - var checkSC1 = function() { - // List of nodes with spaces and comments: - var sc = []; - // List of nodes that can be later deleted from parent node: - var d = []; - // Position of `\n` symbol inside a node with spaces: - var lbIndex; - - // Check every next node: - for (; i < l; i++) { - currentNode = node[i + 1]; - // If there is no node, or it is nor spaces neither comment, stop: - if (!currentNode || SC.indexOf(currentNode[0]) === -1) break; - - // Remove any empty lines: - if (currentNode[0] === 's') { - currentNode[1] = currentNode[1].replace(/\n[\s\t\n\r]*\n/, '\n'); - } - - if (['commentML', 'commentSL'].indexOf(currentNode[0]) > -1) { - sc.push(currentNode); - d.push(i + 1); - continue; - } - - lbIndex = currentNode[1].indexOf('\n'); - - // If there are any line breaks in a node with spaces, stop and - // split the node into two: one with spaces before line break - // and one with `\n` symbol and everything that goes after. - // Combine the first one with declaration/@-rule's node: - if (lbIndex > -1) { - // TODO: Don't push an empty array - sc.push(['s', currentNode[1].substring(0, lbIndex)]); - currentNode[1] = currentNode[1].substring(lbIndex); - break; - } - - sc.push(currentNode); - d.push(i + 1); - } - - deleted = deleted.concat(d); - - return sc; - }; - - /** - * Combine declaration/@-rule's node with other relevant information: - * property index, semicolon, spaces and comments. - * @returns {Object} Extended node - */ - var extendNode = function() { - currentNode = node[i]; - var nextNode = node[i + 1]; - // Object containing current node, all corresponding spaces, - // comments and other information: - var extendedNode; - // Check if current node's property name is in sort order. - // If it is, save information about its indices: - var orderProperty = order[propertyName]; - - extendedNode = { - i: i, - node: currentNode, - sc0: sc0, - sc1: [], - sc2: [], - delim: [] - }; - - // If the declaration's property is in order's list, save its - // group and property indices. Otherwise set them to 10000, so - // declaration appears at the bottom of a sorted list: - - extendedNode.groupIndex = orderProperty && orderProperty.group > -1 ? - orderProperty.group : lastGroupIndex; - extendedNode.propertyIndex = orderProperty && orderProperty.prop > -1 ? - orderProperty.prop : lastPropertyIndex; - - // Mark current node to remove it later from parent node: - deleted.push(i); - - extendedNode.sc1 = checkSC1(); - - if (extendedNode.sc1.length) { - currentNode = node[i]; - nextNode = node[i + 1]; - } - - // If there is `;` right after the declaration, save it with the - // declaration and mark it for removing from parent node: - if (currentNode && nextNode && nextNode[0] === 'declDelim') { - extendedNode.delim.push(nextNode); - deleted.push(i + 1); - i++; - - if (syntax === 'sass') return extendedNode; - - // Save spaces and comments which follow right after the declaration - // and mark them for removing from parent node: - extendedNode.sc2 = checkSC1(); - } - - return extendedNode; - }; - - /** - * Sorts properties alphabetically. - * - * @param {Object} a First extended node - * @param {Object} b Second extended node - * @returns {Number} `-1` if properties should go in order `a, b`. `1` - * if properties should go in order `b, a`. - */ - var sortLeftovers = function(a, b) { - var prefixes = ['-webkit-', '-moz-', '-ms-', '-o-', '']; - var prefixesRegExp = /^(-webkit-|-moz-|-ms-|-o-)(.*)$/; - - // Get property name (i.e. `color`, `-o-animation`): - a = a.node[1][1][1]; - b = b.node[1][1][1]; - - // Get prefix and unprefixed part. For example: - // ['-o-animation', '-o-', 'animation'] - // ['color', '', 'color'] - a = a.match(prefixesRegExp) || [a, '', a]; - b = b.match(prefixesRegExp) || [b, '', b]; - - if (a[2] !== b[2]) { - // If unprefixed parts are different (i.e. `border` and - // `color`), compare them: - return a[2] < b[2] ? -1 : 1; - } else { - // If unprefixed parts are identical (i.e. `border` in - // `-moz-border` and `-o-border`), compare prefixes (they - // should go in the same order they are set in `prefixes` array): - return prefixes.indexOf(a[1]) < prefixes.indexOf(b[1]) ? -1 : 1; - } - }; - - // TODO: Think it through! - // Sort properties only inside blocks: - if (nodeType !== 'block') return; - - // Check every child node. - // If it is declaration (property-value pair, e.g. `color: tomato`), - // or @-rule (e.g. `@include nani`), - // combine it with spaces, semicolon and comments and move them from - // current node to a separate list for further sorting: - for (i = 0, l = node.length; i < l; i++) { - if (NODES.indexOf(node[i][0]) === -1) continue; - - // Save preceding spaces and comments, if there are any, and mark - // them for removing from parent node: - sc0 = checkSC0(); - if (!sc0) continue; - - // If spaces/comments are the last nodes, stop and go to sorting: - if (!node[i]) { - deleted.splice(deleted.length - sc0.length, deleted.length + 1); - break; - } - - // Check if the node needs to be sorted: - // it should be a special @-rule (e.g. `@include`) or a declaration - // with a valid property (e.g. `color` or `$width`). - // If not, proceed with the next node: - propertyName = null; - // Look for includes: - if (node[i][0] === 'include') { - propertyName = '$include'; - } else { - for (j = 1, nl = node[i].length; j < nl; j++) { - currentNode = node[i][j]; - if (currentNode[0] === 'property') { - propertyName = currentNode[1][0] === 'variable' ? - '$variable' : currentNode[1][1]; - break; - } else if (currentNode[0] === 'atkeyword' && - currentNode[1][1] === 'import') { // Look for imports - propertyName = '$import'; - break; - } - } - } - - // If current node is not property-value pair or import or include, - // skip it and continue with the next node: - if (!propertyName) { - deleted.splice(deleted.length - sc0.length, deleted.length + 1); - continue; - } - - // Make an extended node and move it to a separate list for further - // sorting: - sorted.push(extendNode()); - } + return order; + }, + + /** + * @param {node} ast + * @param {object} config + */ + process(ast, config) { + this._config = config; + // Sort properties only inside blocks. + ast.traverseByType('block', this._processBlock.bind(this)); + }, + + _cleanSassLinebreaks(node) { + let containsOnlyLinebreaks = true; + + node.forEach(space => { + if (!space.is('space') || space.content !== '\n') { + containsOnlyLinebreaks = false; + return null; + } + }); + + if (containsOnlyLinebreaks) node.content = []; + }, + + _extendNode(block, i, spacesBefore) { + let nodesToDelete = [i]; + let node = block.get(i); + let extendedNode = { i: i, node: node }; + + let propertyName = this._getSortableName(node); + if (!propertyName) return null; + + // Check if current node's property name is in sort order. + let propertyIndex = this.value[propertyName]; + // If the declaration's property is in order's list, save its + // group and property indices. Otherwise set them to 10000, so + // declaration appears at the bottom of a sorted list: + extendedNode.groupIndex = propertyIndex && propertyIndex.group > -1 ? propertyIndex.group : this._getLastGroupIndex(); + extendedNode.propertyIndex = propertyIndex && propertyIndex.prop > -1 ? propertyIndex.prop : this._getLastPropertyIndex(); + + // Spaces before node. + nodesToDelete = nodesToDelete.concat(spacesBefore); + extendedNode.spacesBeforeNode = this._getNodesByIndex(block, spacesBefore); + + // Spaces after node. + let spacesBeforeDelimiter = this._getSpacesAndCommentsAfterNode(block, i); + nodesToDelete = nodesToDelete.concat(spacesBeforeDelimiter); + extendedNode.spacesBeforeDelimiter = this._getNodesByIndex(block, spacesBeforeDelimiter); + + i += spacesBeforeDelimiter.length; + + // Spaces after delimiter. + // If there is `;` right after the declaration, save it with the + // declaration and mark it for removing from parent node: + if (block.get(i + 1) && block.get(i + 1).is('declarationDelimiter')) { + i += 1; + node = block.get(i); + nodesToDelete.push(i); + extendedNode.delim = node; + + if (node.syntax !== 'sass') { + // Save spaces and comments which follow right after + // the declaration and mark them for removing from parent node: + let spacesAfterDelimiter = this._getSpacesAndCommentsAfterNode(block, i); + i += spacesAfterDelimiter.length; + nodesToDelete = nodesToDelete.concat(spacesAfterDelimiter); + extendedNode.spacesAfterDelimiter = this._getNodesByIndex(block, spacesAfterDelimiter); + } + } - // Remove all nodes, that were moved to a `sorted` list, from parent node: - for (i = deleted.length - 1; i > -1; i--) { - node.splice(deleted[i], 1); - } + extendedNode.endIndex = i; + // Remove all nodes, that were moved to `sortables` list, + // from block node: + extendedNode.nodesToDelete = nodesToDelete; + + return extendedNode; + }, + + _getLastGroupIndex() { + return this.value && this.value['...'] ? this.value['...'].group : Infinity; + }, + + _getLastPropertyIndex() { + return this.value && this.value['...'] ? this.value['...'].prop : Infinity; + }, + + _getNodesByIndex(block, index) { + return index.map(i => block.get(i)); + }, + + _getSortableIncludeName(node) { + // Divide `include` into mixins with specific name + // (e. g. `$include breakpoint`), and the rest — `$include`. + let mixinName; + + if (node.syntax === 'less') { + // `node.first()` is class and `node.first().first()` is ident. + mixinName = node.first().first().content; + } else if (node.syntax === 'sass' && node.first().content === '+') { + // `node.first()` is `+` and `node.get(1)` is ident. + mixinName = node.get(1).content; + } else { + // `node.first()` is @-keyword, `node.get(1)` is space and + // `node.get(2)` is ident. + mixinName = node.get(2).content; + } - // Sort declarations saved for sorting: - sorted.sort(function(a, b) { - // If a's group index is higher than b's group index, in a sorted - // list a appears after b: - if (a.groupIndex !== b.groupIndex) return a.groupIndex - b.groupIndex; - - // If a and b belong to leftovers and `sort-order-fallback` option - // is set to `abc`, sort properties alphabetically: - if (a.groupIndex === lastGroupIndex && - _this.getValue('sort-order-fallback')) { - return sortLeftovers(a, b); - } - - // If a and b have the same group index, and a's property index is - // higher than b's property index, in a sorted list a appears after - // b: - if (a.propertyIndex !== b.propertyIndex) return a.propertyIndex - b.propertyIndex; - - // If a and b have the same group index and the same property index, - // in a sorted list they appear in the same order they were in - // original array: - return a.i - b.i; - }); + let includeMixinName = '$include ' + mixinName; + return this.value.hasOwnProperty(includeMixinName) ? includeMixinName : '$include'; + }, + + _getSortableName(node) { + if (node.is('extend')) return '$extend'; + if (node.is('include')) return this._getSortableIncludeName(node);else return this._getSortablePropertyName(node); + }, + + _getSortablePropertyName(node) { + if (node.is('declaration')) { + let property = node.first('property').first(); + return property.is('variable') ? '$variable' : property.content; + } + + let atkeyword = node.first('atkeyword'); + if (atkeyword && atkeyword.first().content === 'import') return '$import'; + }, + + _getSpacesAndCommentsAfterNode(node, i) { + // List of start positions for nodes with spaces and comments: + let positions = []; + + // Skip node itself. + i++; + + for (let l = node.length; i < l; i++) { + let currentNode = node.get(i); + + // If node is nor spaces neither comment, stop. + if (!this._isSpaceOrComment(currentNode)) break; + + if (currentNode.is('multilineComment') || currentNode.is('singlelineComment')) { + positions.push(i); + continue; + } + + // If there are any line breaks in a node with spaces, stop and + // split the node into two: one with spaces before line break + // and one with `\n` symbol and everything that goes after. + // Combine the first one with declaration/@-rule's node: + let linebreakIndex = currentNode.content.indexOf('\n'); + if (linebreakIndex !== -1) { + var s = currentNode.content.substring(0, linebreakIndex); + if (s === '') break; + var space = gonzales.createNode({ type: 'space', content: s }); + node.insert(i + 1, space); + positions.push(i + 1); + currentNode.content = currentNode.content.substring(linebreakIndex); + break; + } + + positions.push(i); + } - // Build all nodes back together. First go sorted declarations, then - // everything else: - if (sorted.length > 0) { - for (i = sorted.length - 1, l = -1; i > l; i--) { - currentNode = sorted[i]; - var prevNode = sorted[i - 1]; - sc0 = currentNode.sc0; - var sc1 = currentNode.sc1; - var sc2 = currentNode.sc2; - - sc0.reverse(); - sc1.reverse(); - sc2.reverse(); - - // Divide declarations from different groups with an empty line: - if (prevNode && currentNode.groupIndex > prevNode.groupIndex) { - if (sc0[0] && sc0[0][0] === 's' && - (this.syntax === 'sass' || - sc0[0][1].match(/\n/g) && - sc0[0][1].match(/\n/g).length < 2)) { - sc0[0][1] = '\n' + sc0[0][1]; - } - } - - for (j = 0, nl = sc2.length; j < nl; j++) { - node.unshift(sc2[j]); - } - if (currentNode.delim.length > 0) node.unshift(['declDelim']); - for (j = 0, nl = sc1.length; j < nl; j++) { - node.unshift(sc1[j]); - } - node.unshift(currentNode.node); - - for (j = 0, nl = sc0.length; j < nl; j++) { - node.unshift(sc0[j]); - } - } + return positions; + }, + + /** + * Check if there are any comments or spaces before + * the declaration/@-rule. + * @param {Node} node + * @param {Number} i + * @returns {Array} List of nodes with spaces and comments + */ + _getSpacesAndCommentsBeforeNode(node, i) { + // List of start positions for nodes with spaces and comments: + let positions = []; + let sendPositions = false; + + for (let l = node.length; i < l; i++) { + let currentNode = node.get(i); + + // If the node is declaration or @-rule, stop and return all + // found nodes with spaces and comments (if there are any): + if (!this._isSpaceOrComment(currentNode)) { + sendPositions = true; + break; + } + + positions.push(i); + } + + return sendPositions ? positions : null; + }, + + _insertSortablesToBlock(nodesToSort, node) { + if (node.syntax === 'sass') this._cleanSassLinebreaks(node); + + for (let i = nodesToSort.length - 1, l = -1; i > l; i--) { + let currentNode = nodesToSort[i]; + let prevNode = nodesToSort[i - 1]; + let spacesBeforeNode = currentNode.spacesBeforeNode || []; + let spacesBeforeDelimiter = currentNode.spacesBeforeDelimiter || []; + let spacesAfterDelimiter = currentNode.spacesAfterDelimiter || []; + + if (node.syntax === 'sass' && spacesBeforeNode.length) { + let space = spacesBeforeNode[0]; + space.content = space.content.replace(/\n/, ''); + } + + spacesBeforeNode.reverse().map(this._removeEmptyLines); + spacesBeforeDelimiter.reverse().map(this._removeEmptyLines); + spacesAfterDelimiter.reverse().map(this._removeEmptyLines); + + // Divide declarations from different groups with + // an empty line: + if (prevNode && currentNode.groupIndex > prevNode.groupIndex) { + let space = spacesBeforeNode[0]; + if (space && space.is('space') && (space.syntax === 'sass' || space.content.match(/\n/g) && space.content.match(/\n/g).length < 2)) { + space.content = '\n' + space.content; } + } + + for (let j = 0, nl = spacesAfterDelimiter.length; j < nl; j++) { + node.content.unshift(spacesAfterDelimiter[j]); + } + + if (currentNode.delim) { + node.content.unshift(currentNode.delim); + } else if (i !== nodesToSort.length - 1 && (currentNode.node.is('declaration') || currentNode.node.is('extend'))) { + let delimiter = gonzales.createNode({ + type: 'declarationDelimiter', + content: currentNode.node.syntax === 'sass' ? '\n' : ';' + }); + node.content.unshift(delimiter); + } + + for (let j = 0, nl = spacesBeforeDelimiter.length; j < nl; j++) { + node.content.unshift(spacesBeforeDelimiter[j]); + } + + node.content.unshift(currentNode.node); + + for (let j = 0, nl = spacesBeforeNode.length; j < nl; j++) { + node.content.unshift(spacesBeforeNode[j]); + } + } + }, + + // Types of nodes that can be sorted. + _isAcceptableNode(node) { + const NODES = ['atrule', 'declaration', 'extend', 'include', 'multilineComment', 'singlelineComment', 'space']; + return NODES.indexOf(node.type) !== -1; + }, + + // Spaces and comments. + _isSpaceOrComment(node) { + const SC = ['multilineComment', 'singlelineComment', 'space']; + return SC.indexOf(node.type) !== -1; + }, + + _processBlock(block) { + // Check every child node. + // If it is declaration (property-value pair, e.g. `color: tomato`), + // or @-rule (e.g. `@include nani`), + // combine it with spaces, semicolon and comments and move them from + // current node to a separate list for further sorting: + let nodesToSort = this._separateSortablesFromBlock(block); + this._sortNodes(nodesToSort); + this._insertSortablesToBlock(nodesToSort, block); + }, + + /** + * Remove empty lines in space node. + * @param {node} node Space node. + */ + _removeEmptyLines(node) { + node.content = node.content.replace(/\n[\s\t\n\r]*\n/, '\n'); + }, + + _separateSortablesFromBlock(block) { + let sortables = []; + let nodesToDelete = []; + + // Don't cache `block.length` since we may insert new nodes into it. + for (let i = 0; i < block.length; i++) { + let node = block.get(i); + if (!this._isAcceptableNode(node)) continue; + + // Save preceding spaces and comments, if there are any, + // and mark them for removing from parent node: + let spacesBeforeNode = this._getSpacesAndCommentsBeforeNode(block, i); + if (!spacesBeforeNode) break; + + i += spacesBeforeNode.length; + node = block.get(i); + + let extendedNode = this._extendNode(block, i, spacesBeforeNode); + if (!extendedNode) continue; + + nodesToDelete = nodesToDelete.concat(extendedNode.nodesToDelete); + i = extendedNode.endIndex; + sortables.push(extendedNode); + } + + nodesToDelete.sort((a, b) => a - b); + for (let x = nodesToDelete.length - 1; x > -1; x--) block.removeChild(nodesToDelete[x]); + + return sortables; + }, + + _sortLeftovers(a, b) { + let prefixes = ['-webkit-', '-moz-', '-ms-', '-o-', '']; + let prefixesRegExp = /^(-webkit-|-moz-|-ms-|-o-)(.*)$/; + + // Get property name (i.e. `color`, `-o-animation`): + a = a.node.first().first().content; + b = b.node.first().first().content; + + // Get prefix and unprefixed part. For example: + // ['-o-animation', '-o-', 'animation'] + // ['color', '', 'color'] + a = a.match(prefixesRegExp) || [a, '', a]; + b = b.match(prefixesRegExp) || [b, '', b]; + + if (a[2] !== b[2]) { + // If unprefixed parts are different (i.e. `border` and + // `color`), compare them: + return a[2] <= b[2] ? -1 : 1; + } else { + // If unprefixed parts are identical (i.e. `border` in + // `-moz-border` and `-o-border`), compare prefixes. + // They should go in the same order they are set + // in `prefixes` array. + return prefixes.indexOf(a[1]) <= prefixes.indexOf(b[1]) ? -1 : 1; } -}; + }, + + _sortNodes(nodes) { + nodes.sort((a, b) => { + // If a's group index is higher than b's group index, in + // a sorted list a appears after b: + if (a.groupIndex !== b.groupIndex) return a.groupIndex - b.groupIndex; + + // If a and b belong to leftovers and `sort-order-fallback` + // option is set to `abc`, sort properties alphabetically: + if (a.groupIndex === this._getLastGroupIndex() && this._config['sort-order-fallback']) { + return this._sortLeftovers(a, b); + } + + // If a and b have the same group index, and a's property index + // is higher than b's property index, in a sorted list + // a appears after b: + if (a.propertyIndex !== b.propertyIndex) return a.propertyIndex - b.propertyIndex; + + // If a and b have the same group index and the same property + // index, in a sorted list they appear in the same order + // they were in original array: + return a.i - b.i; + }); + }, + + detect: () => [] +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-after-colon.js b/node_modules/csscomb/lib/options/space-after-colon.js index d1466b1..e88aa04 100644 --- a/node_modules/csscomb/lib/options/space-after-colon.js +++ b/node_modules/csscomb/lib/options/space-after-colon.js @@ -1,57 +1,63 @@ +'use strict'; + +var gonzales = require('gonzales-pe'); + module.exports = { - name: 'space-after-colon', - - runBefore: 'block-indent', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 'declaration') return; - - var value = this.getValue('space-after-colon'); - - for (var i = node.length; i--;) { - if (node[i][0] !== 'propertyDelim') continue; - - if (this.getSyntax() === 'sass' && !node[i - 1]) break; - - // Remove any spaces after colon: - if (node[i + 1][0] === 's') node.splice(i + 1, 1); - // If the value set in config is not empty, add spaces: - if (value !== '') node.splice(i + 1, 0, ['s', value]); - - break; - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'declaration') return; - - for (var i = node.length; i--;) { - if (node[i][0] !== 'propertyDelim') continue; - - if (node[i + 1][0] === 's') { - return node[i + 1][1]; - } else { - return ''; - } - } - } -}; + name: 'space-after-colon', + + runBefore: 'block-indent', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, + + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverseByType('propertyDelimiter', function (delimiter, i, parent) { + if (delimiter.syntax === 'sass' && !parent.get(i - 1)) return null; + + // Remove any spaces after colon: + if (parent.get(i + 1) && parent.get(i + 1).is('space')) parent.removeChild(i + 1); + // If the value set in config is not empty, add spaces: + if (value !== '') { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + parent.insert(i + 1, space); + } + + return null; + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByType('propertyDelimiter', function (delimiter, i, parent) { + var nextNode = parent.get(i + 1); + + if (nextNode.is('space')) { + detected.push(nextNode.content); + } else { + detected.push(''); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-after-combinator.js b/node_modules/csscomb/lib/options/space-after-combinator.js index 804c5b9..8092fa4 100644 --- a/node_modules/csscomb/lib/options/space-after-combinator.js +++ b/node_modules/csscomb/lib/options/space-after-combinator.js @@ -1,65 +1,60 @@ -module.exports = { - name: 'space-after-combinator', - - runBefore: 'block-indent', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 'selector') return; - - var value = this.getValue('space-after-combinator'); - - for (var i = node.length; i--;) { - var subSelector = node[i]; - for (var j = subSelector.length; j--;) { - if (subSelector[j][0] !== 'combinator') continue; +'use strict'; - if (subSelector[j + 1][0] === 's') { - subSelector[j + 1][1] = value; - } else { - subSelector.splice(j + 1, 0, ['s', value]); - } - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'selector') return; - - var variants = []; - - for (var i = node.length; i--;) { - var subSelector = node[i]; - for (var j = subSelector.length; j--;) { - if (subSelector[j][0] !== 'combinator') continue; - - if (subSelector[j + 1][0] === 's') { - variants.push(subSelector[j + 1][1]); - } else { - variants.push(''); - } - } - } - - return variants; - } -}; +var gonzales = require('gonzales-pe'); +module.exports = { + name: 'space-after-combinator', + + runBefore: 'block-indent', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, + + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverseByType('combinator', function (combinator, i, parent) { + var nextNode = parent.get(i + 1); + + if (nextNode && nextNode.is('space')) { + nextNode.content = value; + } else { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + parent.insert(i + 1, space); + } + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByType('combinator', function (combinator, i, parent) { + var nextNode = parent.get(i + 1); + + if (nextNode.is('space')) { + detected.push(nextNode.content); + } else { + detected.push(''); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-after-opening-brace.js b/node_modules/csscomb/lib/options/space-after-opening-brace.js index 90f30df..084feda 100644 --- a/node_modules/csscomb/lib/options/space-after-opening-brace.js +++ b/node_modules/csscomb/lib/options/space-after-opening-brace.js @@ -1,47 +1,61 @@ +'use strict'; + +var gonzales = require('gonzales-pe'); + module.exports = { - name: 'space-after-opening-brace', - - runBefore: 'block-indent', - - syntax: ['css', 'less', 'scss'], - - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - // If found block node stop at the next one for space check - if (nodeType !== 'block' && nodeType !== 'atrulers') return; - - var value = this.getValue('space-after-opening-brace'); - - if (node[0][0] === 's') { - node[0][1] = value; - } else if (value !== '') { - node.unshift(['s', value]); - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'block' && nodeType !== 'atrulers') return; - - if (node[0][0] === 's') { - return node[0][1]; - } else { - return ''; - } - } -}; + name: 'space-after-opening-brace', + + runBefore: 'block-indent', + + syntax: ['css', 'less', 'scss'], + + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, + + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverse(function (node) { + // If found block node stop at the next one for space check + if (!node.is('block') && !node.is('atrulers')) return; + + if (node.first() && node.first().is('space')) { + node.first().content = value; + } else if (value !== '') { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + node.insert(0, space); + } + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverse(function (node) { + if (!node.is('block') && !node.is('atrulers')) return; + + if (node.first().is('space')) { + detected.push(node.first().content); + } else { + detected.push(''); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-after-selector-delimiter.js b/node_modules/csscomb/lib/options/space-after-selector-delimiter.js index bf9c333..1b5ad06 100644 --- a/node_modules/csscomb/lib/options/space-after-selector-delimiter.js +++ b/node_modules/csscomb/lib/options/space-after-selector-delimiter.js @@ -1,60 +1,69 @@ +'use strict'; + +var gonzales = require('gonzales-pe'); + module.exports = { - name: 'space-after-selector-delimiter', - - runBefore: 'block-indent', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 'selector') return; - - var value = this.getValue('space-after-selector-delimiter'); - - for (var i = node.length; i--;) { - if (node[i][0] !== 'delim') continue; - - if (node[i + 1][0] === 's') { - node[i + 1][1] = value; - } else if (node[i + 1][1][0] === 's') { - node[i + 1][1][1] = value; - } else { - node[i + 1].splice(1, 0, ['s', value]); - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'selector') return; - - var variants = []; - - for (var i = node.length; i--;) { - if (node[i][0] !== 'delim') continue; - - if (node[i + 1][1][0] === 's') { - variants.push(node[i + 1][1][1]); - } else { - variants.push(''); - } - } - - return variants; - } -}; + name: 'space-after-selector-delimiter', + + runBefore: 'block-indent', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, + + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverseByType('delimiter', function (delimiter, i, parent) { + if (parent.is('arguments')) return; + + var nextNode = parent.get(i + 1); + if (!nextNode) return; + + if (nextNode.is('space')) { + nextNode.content = value; + } else if (nextNode.first().is('space')) { + nextNode.first().content = value; + } else { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + nextNode.insert(0, space); + } + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByType('delimiter', function (delimiter, i, parent) { + if (parent.is('arguments')) return; + + var nextNode = parent.get(i + 1); + + if (nextNode && nextNode.is('space')) { + detected.push(nextNode.content); + } else if (nextNode.first() && nextNode.first().is('space')) { + detected.push(nextNode.first().content); + } else { + detected.push(''); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-before-closing-brace.js b/node_modules/csscomb/lib/options/space-before-closing-brace.js index 321a2dc..0ce9f23 100644 --- a/node_modules/csscomb/lib/options/space-before-closing-brace.js +++ b/node_modules/csscomb/lib/options/space-before-closing-brace.js @@ -1,82 +1,102 @@ -module.exports = (function() { - function getLastWhitespaceNode(node) { - var lastNode = node[node.length - 1]; +'use strict'; - if (typeof lastNode !== 'object' || lastNode[0] === 'block') return null; - if (lastNode[0] === 's') return lastNode; +var gonzales = require('gonzales-pe'); - return getLastWhitespaceNode(lastNode); - } +module.exports = function () { + var valueFromSettings; + var blockIndent; + + function getLastWhitespaceNode(node) { + var lastNode = node.last(); + + if (!lastNode || !lastNode.content) return null; + + if (lastNode.is('block')) return null; + if (lastNode.is('space')) return lastNode; + + return getLastWhitespaceNode(lastNode); + } - return { - name: 'space-before-closing-brace', - - runBefore: 'tab-size', - - syntax: ['css', 'less', 'scss'], - - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - * @param {Number} level - */ - process: function(nodeType, node, level) { - if (nodeType !== 'block' && nodeType !== 'atrulers') return; - - var value = this.getValue('space-before-closing-brace'); - - // If found block node stop at the next one for space check - // For the pre-block node, find its last (the deepest) child - var whitespaceNode = getLastWhitespaceNode(node); - - if (value.indexOf('\n') > -1) { - var blockIndent = this.getValue('block-indent'); - // TODO: Check that it works for '' block indent value - if (blockIndent) value += new Array(level + 1).join(blockIndent); - } - - // If it's spaces, modify this node - // If it's something different from spaces, add a space node to the end - - if (whitespaceNode) { - whitespaceNode[1] = value; - } else if (value !== '') { - node.push(['s', value]); - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - var variants = []; - - // Loop through node from the end to the beginning: - for (var i = node.length; i--;) { - // If found block node stop for space check: - if (node[i][0] !== 'block' && node[i][0] !== 'atrulers') continue; - - // For the block node, find its last (the deepest) child - var whitespaceNode = getLastWhitespaceNode(node[i]); - - if (whitespaceNode) { - variants.push(whitespaceNode[1]); - } else { - variants.push(''); - } - } - - return variants; + function processBlock(x, level) { + level = level || 0; + + x.forEach(function (node) { + if (!node.is('block') && !node.is('atrulers')) return processBlock(node, level); + + level++; + + var value = valueFromSettings; + if (value.indexOf('\n') > -1) { + // TODO: Check that it works for '' block indent value + if (blockIndent) { + value += new Array(level).join(blockIndent); } - }; -})(); + } + + // If found block node stop at the next one for space check + // For the pre-block node, find its last (the deepest) child + var whitespaceNode = getLastWhitespaceNode(node); + + // If it's spaces, modify this node + // If it's something different from spaces, add a space node + // to the end + if (whitespaceNode) { + whitespaceNode.content = value; + } else if (value !== '') { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + node.content.push(space); + } + + processBlock(node, level); + }); + } + + return { + name: 'space-before-closing-brace', + + runBefore: 'tab-size', + + syntax: ['css', 'less', 'scss'], + + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, + + /** + * Processes tree node. + * @param {node} ast + * @param {Object} config + */ + process: function (ast, config) { + valueFromSettings = this.value; + blockIndent = config['block-indent']; + + processBlock(ast); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByTypes(['block', 'atrulers'], function (node) { + // For the block node, find its last (the deepest) child + var whitespaceNode = getLastWhitespaceNode(node); + if (whitespaceNode) { + detected.push(whitespaceNode.content); + } else { + detected.push(''); + } + }); + return detected; + } + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-before-colon.js b/node_modules/csscomb/lib/options/space-before-colon.js index a960819..c0a3358 100644 --- a/node_modules/csscomb/lib/options/space-before-colon.js +++ b/node_modules/csscomb/lib/options/space-before-colon.js @@ -1,60 +1,64 @@ +'use strict'; + +var gonzales = require('gonzales-pe'); + module.exports = { - name: 'space-before-colon', - - runBefore: 'block-indent', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 'declaration') return; - - var value = this.getValue('space-before-colon'); - - for (var i = node.length; i--;) { - if (node[i][0] !== 'propertyDelim') continue; - - if (this.getSyntax() === 'sass' && !node[i - 1]) break; - - // Remove any spaces before colon: - if (node[i - 1][0] === 's') { - node.splice(i - 1, 1); - i--; - } - // If the value set in config is not empty, add spaces: - if (value !== '') node.splice(i, 0, ['s', value]); - - break; - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'declaration') return; - - for (var i = node.length; i--;) { - if (node[i][0] !== 'propertyDelim') continue; - - if (node[i - 1][0] === 's') { - return node[i - 1][1]; - } else { - return ''; - } - } - } -}; + name: 'space-before-colon', + + runBefore: 'block-indent', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, + + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverseByType('propertyDelimiter', function (delimiter, i, parent) { + if (delimiter.syntax === 'sass' && !parent.get(i - 1)) return; + + // Remove any spaces before colon: + if (parent.get(i - 1).is('space')) { + parent.removeChild(--i); + } + + // If the value set in config is not empty, add spaces: + if (value !== '') { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + parent.insert(i, space); + } + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByType('propertyDelimiter', function (delimiter, i, parent) { + var previousNode = parent.get(i - 1); + + if (previousNode && previousNode.is('space')) { + detected.push(previousNode.content); + } else { + detected.push(''); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-before-combinator.js b/node_modules/csscomb/lib/options/space-before-combinator.js index c73bb12..3d22954 100644 --- a/node_modules/csscomb/lib/options/space-before-combinator.js +++ b/node_modules/csscomb/lib/options/space-before-combinator.js @@ -1,64 +1,59 @@ -module.exports = { - name: 'space-before-combinator', - - runBefore: 'block-indent', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 'selector') return; - - var value = this.getValue('space-before-combinator'); +'use strict'; - for (var i = node.length; i--;) { - var subSelector = node[i]; - for (var j = subSelector.length; j--;) { - if (subSelector[j][0] !== 'combinator') continue; - if (subSelector[j - 1][0] === 's') { - subSelector[j - 1][1] = value; - } else { - subSelector.splice(j, 0, ['s', value]); - } - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'selector') return; - - var variants = []; - - for (var i = node.length; i--;) { - var subSelector = node[i]; - for (var j = subSelector.length; j--;) { - if (subSelector[j][0] !== 'combinator') continue; - - if (subSelector[j - 1][0] === 's') { - variants.push(subSelector[j - 1][1]); - } else { - variants.push(''); - } - } - } - - return variants; - } -}; +var gonzales = require('gonzales-pe'); +module.exports = { + name: 'space-before-combinator', + + runBefore: 'block-indent', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, + + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverseByType('combinator', function (combinator, i, parent) { + var previousNode = parent.get(i - 1); + if (previousNode && previousNode.is('space')) { + previousNode.content = value; + } else { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + parent.insert(i, space); + } + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByType('combinator', function (combinator, i, parent) { + var previousNode = parent.get(i - 1); + + if (previousNode && previousNode.is('space')) { + detected.push(previousNode.content); + } else { + detected.push(''); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-before-opening-brace.js b/node_modules/csscomb/lib/options/space-before-opening-brace.js index 3aecb14..74e7d16 100644 --- a/node_modules/csscomb/lib/options/space-before-opening-brace.js +++ b/node_modules/csscomb/lib/options/space-before-opening-brace.js @@ -1,88 +1,75 @@ -module.exports = (function() { - /** - * Gets the last (the deepest) whitespace node. - * - * @param {node} node - * @returns {node|undefined} If no whitespace node is found, returns - * `undefined` - */ - function getLastWhitespaceNode(node) { - if (typeof node !== 'object') return; - if (node[0] === 's') return node; +'use strict'; - return getLastWhitespaceNode(node[node.length - 1]); - } +var gonzales = require('gonzales-pe'); - return { - name: 'space-before-opening-brace', +module.exports = function () { + return { + name: 'space-before-opening-brace', - runBefore: 'block-indent', + runBefore: 'block-indent', - syntax: ['css', 'less', 'scss'], + syntax: ['css', 'less', 'scss'], - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - var value = this.getValue('space-before-opening-brace'); - - // Loop through node from the end to the beginning: - for (var i = node.length; i--;) { - // If found block node stop at the next one for space check: - if (node[i][0] !== 'block' && node[i][0] !== 'atrulers') continue; + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; - // For the pre-block node, find its last (the deepest) child: - // TODO: Exclude nodes with braces (for example, arguments) - var whitespaceNode = getLastWhitespaceNode(node[i - 1]); + // If found block node stop at the next one for space check. + ast.traverseByTypes(['block', 'value'], function (block, i, parent) { + if (block.is('value') && !block.first().is('block')) return; - // If it's spaces, modify this node. - // If it's something different from spaces, add a space node to - // the end: - if (whitespaceNode) { - whitespaceNode[1] = value; - } else if (value !== '') { - if (node[i - 1][0] === 'atrulerq') { - node[i - 1].push(['s', value]); - } else { - node.splice(i, 0, ['s', value]); - } - } - } - }, + var previousNode = parent.get(i - 1); + if (!previousNode) return; - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - var variants = []; + // If it's spaces, modify this node. + // If it's something different from spaces, add a space node to + // the end: + if (previousNode.is('space')) { + previousNode.content = value; + } else if (value !== '') { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + parent.insert(i, space); + } + }); + }, - // Loop through node from the end to the beginning: - for (var i = node.length; i--;) { - // If found block node stop at the next one for space check: - if (node[i][0] !== 'block' && node[i][0] !== 'atrulers') continue; + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + var detected = []; - // For the pre-block node, find its last (the deepest) child - var whitespaceNode = getLastWhitespaceNode(node[i - 1]); + ast.traverseByTypes(['block', 'value'], function (block, i, parent) { + if (block.is('value') && !block.first().is('block')) return; - if (whitespaceNode) { - variants.push(whitespaceNode[1]); - } else { - variants.push(''); - } - } + var previousNode = parent.get(i - 1); + if (!previousNode) return; - return variants; + // If it's spaces, modify this node. + // If it's something different from spaces, add a space node to + // the end: + if (previousNode.is('space')) { + detected.push(previousNode.content); + } else { + detected.push(''); } - }; -})(); + }); + + return detected; + } + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-before-selector-delimiter.js b/node_modules/csscomb/lib/options/space-before-selector-delimiter.js index 0a89a5d..c6a123c 100644 --- a/node_modules/csscomb/lib/options/space-before-selector-delimiter.js +++ b/node_modules/csscomb/lib/options/space-before-selector-delimiter.js @@ -1,60 +1,64 @@ +'use strict'; + +var gonzales = require('gonzales-pe'); + module.exports = { - name: 'space-before-selector-delimiter', - - runBefore: 'block-indent', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 'selector') return; - - var value = this.getValue('space-before-selector-delimiter'); - - for (var i = node.length; i--;) { - if (node[i][0] !== 'delim') continue; - - var previousNode = node[i - 1]; - if (previousNode[previousNode.length - 1][0] === 's') { - previousNode[previousNode.length - 1][1] = value; - } else { - previousNode.push(['s', value]); - } - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'selector') return; - - var variants = []; - - for (var i = node.length; i--;) { - if (node[i][0] !== 'delim') continue; - - var previousNode = node[i - 1]; - if (previousNode[previousNode.length - 1][0] === 's') { - variants.push(previousNode[previousNode.length - 1][1]); - } else { - variants.push(''); - } - } - - return variants; - } -}; + name: 'space-before-selector-delimiter', + + runBefore: 'block-indent', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, + + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; + + ast.traverseByType('delimiter', function (delimiter, i, parent) { + if (parent.is('arguments')) return; + + var previousNode = parent.get(i - 1); + + if (previousNode && previousNode.is('space')) { + previousNode.content = value; + } else { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + parent.insert(i, space); + } + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverseByType('delimiter', function (delimiter, i, parent) { + if (parent.is('arguments')) return; + + var previousNode = parent.get(i - 1); + + if (previousNode && previousNode.is('space')) { + detected.push(previousNode.content); + } else { + detected.push(''); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/space-between-declarations.js b/node_modules/csscomb/lib/options/space-between-declarations.js index 1b7a832..f5f8531 100644 --- a/node_modules/csscomb/lib/options/space-between-declarations.js +++ b/node_modules/csscomb/lib/options/space-between-declarations.js @@ -1,95 +1,94 @@ -module.exports = (function() { - function getDeclarationEnd(node, i) { - for (;i < node.length; i++) { - if (!node[i + 1]) { - return 0; - } else if (node[i + 1][0] === 's') { - if (node[i + 1][1].indexOf('\n') > -1) { - if (node[i + 2] && node[i + 2][0] === 'declaration') { - return i; - } else { - return 0; - } - } else if (node[i + 2] && node[i + 2][0] === 'commentML') { - if (node[i + 3] && node[i + 3][0] === 'declaration') { - return i + 2; - } else if (node[i + 3] && node[i + 3][0] === 's') { - if (node[i + 4] && node[i + 4][0] === 'declaration') { - return i + 2; - } else { - return 0; - } - } else { - return 0; - } - } else if (node[i + 2] && node[i + 2][0] === 'declaration') { - return i; - } - } else if (node[i + 1][0] === 'declaration') { - return i; - } else if (node[i + 1][0] === 'commentML') { - if (node[i + 2] && node[i + 2][0] === 'declaration') { - return i + 1; - } else if (node[i + 2] && node[i + 2][0] === 's') { - if (node[i + 3] && node[i + 3][0] === 'declaration') { - return i + 1; - } - } else { - return 0; - } +'use strict'; + +var gonzales = require('gonzales-pe'); + +module.exports = function () { + function getDeclarationEnd(node, i) { + for (; i < node.length; i++) { + if (!node.get(i + 1) || typeof node.get(i + 1) === 'string') { + return 0; + } else if (node.get(i + 1).is('space')) { + if (node.get(i + 1).content.indexOf('\n') > -1) { + if (node.get(i + 2) && node.get(i + 2).is('declaration')) { + return i; + } else { + return 0; + } + } else if (node.get(i + 2) && node.get(i + 2).is('multilineComment')) { + if (node.get(i + 3) && node.get(i + 3).is('declaration')) { + return i + 2; + } else if (node.get(i + 3) && node.get(i + 3).is('space')) { + if (node.get(i + 4) && node.get(i + 4).is('declaration')) { + return i + 2; } else { - return 0; + return 0; } + } else { + return 0; + } + } else if (node.get(i + 2) && node.get(i + 2).is('declaration')) { + return i; + } + } else if (node.get(i + 1).is('declaration')) { + return i; + } else if (node.get(i + 1).is('multilineComment')) { + if (node.get(i + 2) && node.get(i + 2).is('declaration')) { + return i + 1; + } else if (node.get(i + 2) && node.get(i + 2).is('space')) { + if (node.get(i + 3) && node.get(i + 3).is('declaration')) { + return i + 1; + } + } else { + return 0; } + } else { + return 0; + } } + } - return { - name: 'space-between-declarations', - - runBefore: 'block-indent', - - syntax: ['css', 'less', 'scss'], + return { + name: 'space-between-declarations', - accepts: { - number: true, - string: /^[ \t\n]*$/ - }, + runBefore: 'block-indent', - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - var value = this.getValue('space-between-declarations'); + syntax: ['css', 'less', 'scss'], - // TODO: Limit nodes to blocks, stylesheet, etc. + accepts: { + number: true, + string: /^[ \t\n]*$/ + }, - for (var i = 0, l = node.length; i < l; i++) { - var currentNode = node[i]; + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; - if (currentNode[0] !== 'declDelim') continue; - - // Grom user's point of view "declaration" includes semicolons - // and comments placed on the same line. - // So group those things together: - var declarationEnd = getDeclarationEnd(node, i); - if (!declarationEnd) { - continue; - } else { - i = declarationEnd; - } + ast.traverseByType('declarationDelimiter', (delimiter, i, parent) => { + // Grom user's point of view "declaration" includes semicolons + // and comments placed on the same line. + // So group those things together: + var declarationEnd = getDeclarationEnd(parent, i); + if (!declarationEnd) { + return; + } else { + i = declarationEnd; + } - var nextNode = node[i + 1]; - if (nextNode[0] === 's') { - nextNode[1] = value; - } else { - i++; - l++; - node.splice(i, 0, ['s', value]); - } - } + var nextNode = parent.get(i + 1); + if (nextNode && nextNode.is('space')) { + nextNode.content = value; + } else { + var space = gonzales.createNode({ + type: 'space', + content: value + }); + parent.insert(i + 1, space); } - }; -})(); + }); + } + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/strip-spaces.js b/node_modules/csscomb/lib/options/strip-spaces.js index 81967e9..6d4b342 100644 --- a/node_modules/csscomb/lib/options/strip-spaces.js +++ b/node_modules/csscomb/lib/options/strip-spaces.js @@ -1,61 +1,62 @@ -module.exports = (function() { +'use strict'; + +module.exports = function () { + /** + * Trim trailing spaces on each line. + * @private + * @param {String} string Spaceful string + * @returns {String} + */ + function trim(string) { + return string.replace(/[ \t]+\n/g, '\n'); + } + + return { + name: 'strip-spaces', + + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + boolean: [true] + }, + /** - * Trim trailing spaces on each line. - * @private - * @param {String} s Spaceful string - * @returns {String} + * Processes tree node. + * @param {node} ast */ - function trim(s) { - return s.replace(/[ \t]+\n/g, '\n'); - } + process: function (ast) { + var lastChild = ast.last(); + if (lastChild.is('space')) { + lastChild.content = trim(lastChild.content).replace(/[ \t]+$/, '').replace(/[\n]+/g, '\n'); + } + + ast.traverseByType('space', function (space) { + space.content = trim(space.content); + }); + }, - return { - name: 'strip-spaces', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { boolean: [true] }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType === 's') { - node[0] = trim(node[0]); - } - if (nodeType === 'stylesheet') { - var lastChild = node[node.length - 1]; - if (lastChild[0] === 's') { - lastChild[1] = trim(lastChild[1]) - .replace(/[ \t]+$/, '') - .replace(/[\n]+/g, '\n'); - } - } - }, - - /** - * Detects the value of an option at the tree node. - * This option is treated as `true` by default, but any trailing space would invalidate it. - * - * @param {String} nodeType - * @param {node} node - */ - detectDefault: true, - - detect: function(nodeType, node) { - if (nodeType === 's') { - if (node[0].match(/[ \t]\n/)) { - return false; - } - } - if (nodeType === 'stylesheet') { - var lastChild = node[node.length - 1]; - if (lastChild[0] === 's' && lastChild[1] !== '\n' && lastChild[1].match(/^[ \n\t]+$/)) { - return false; - } - } - } - }; -})(); + detectDefault: true, + + /** + * Detects the value of an option at the tree node. + * This option is treated as `true` by default, but any trailing + * space would invalidate it. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + var lastChild = ast.last(); + if (lastChild.is('space') && lastChild.content !== '\n' && lastChild.content.match(/^[ \n\t]+$/)) { + detected.push(false); + } + + ast.traverseByType('space', function (space) { + if (space.content.match(/[ \t]\n/)) detected.push(false); + }); + + return detected; + } + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/tab-size.js b/node_modules/csscomb/lib/options/tab-size.js index d8e641d..8d1259b 100644 --- a/node_modules/csscomb/lib/options/tab-size.js +++ b/node_modules/csscomb/lib/options/tab-size.js @@ -1,20 +1,26 @@ +'use strict'; + module.exports = { - name: 'tab-size', + name: 'tab-size', + + runBefore: 'vendor-prefix-align', - runBefore: 'vendor-prefix-align', + syntax: ['css', 'less', 'sass', 'scss'], - syntax: ['css', 'less', 'sass', 'scss'], + accepts: { + number: true + }, - accepts: { number: true }, + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + let value = this.value; - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 's') return; - node[0] = node[0].replace(/\t/, this.getValue('tab-size')); - } -}; + ast.traverseByType('space', function (space) { + space.content = space.content.replace(/\t/, value); + }); + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/unitless-zero.js b/node_modules/csscomb/lib/options/unitless-zero.js index a581e20..9deb6b7 100644 --- a/node_modules/csscomb/lib/options/unitless-zero.js +++ b/node_modules/csscomb/lib/options/unitless-zero.js @@ -1,60 +1,70 @@ +'use strict'; + module.exports = { - name: 'unitless-zero', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { boolean: [true] }, - - /** - * Processes tree node. - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType === 'value' || nodeType === 'braces') { - node.forEach(function(child, index) { - if ( - (child[0] === 'percentage' || - child[0] === 'dimension' && ['cm', 'em', 'ex', 'pt', 'px'].indexOf(child[2][1]) !== -1) && - child[1][1] === '0') { - node[index] = child[1]; - } - }); - } - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - var result = null; - - // If we see a zero with unit and it is not degree, then we don’t have an option - if ( - nodeType === 'percentage' && node[0][1] === '0' || - nodeType === 'dimension' && node[0][1] === '0' && node[1][1] !== 'deg' - ) { - result = false; - } + name: 'unitless-zero', - // If we see a zero and previous node is not percentage or dimension, then we have an option - if ( - nodeType === 'number' && - node[0] === '0' && - this._prev !== 'percentage' && - this._prev !== 'dimension' - ) { - result = true; - } + syntax: ['css', 'less', 'sass', 'scss'], + + accepts: { + boolean: [true] + }, + + /** + * Processes tree node. + * + * @param {node} ast + */ + process: function (ast) { + var UNITS = ['cm', 'em', 'ex', 'pt', 'px']; - // Store the previous nodeType - this._prev = nodeType; + ast.traverseByTypes(['value', 'parentheses'], function (node) { + node.forEach(function (value) { + if (typeof value === 'string') return; - if (result !== null) { - return result; + if (value.is('dimension')) { + var unit = value.first('ident').content; + if (value.first('number').content === '0' && UNITS.indexOf(unit) !== -1) { + value.removeChild(1); + } + } else if (value.is('percentage')) { + var number = value.first('number').content; + if (number === '0') { + value.type = 'number'; + value.content = number; + } } - } -}; + }); + }); + }, + + /** + * Detects the value of an option at the tree node. + * + * @param {node} ast + */ + detect: function (ast) { + let detected = []; + + ast.traverse(function (node, index, parent) { + // If we see a zero with unit and it is not degree, + // then we don’t have an option + if (node.is('percentage') && node.first('number').content[1] === '0') { + detected.push(false); + return; + } + + if (node.is('dimension') && node.first('number').content === '0' && node.first('ident').content !== 'deg') { + detected.push(false); + return; + } + + // If we see a zero and previous node is not percentage + // or dimension, then we have an option + if (node.is('number') && node.content === '0' && !parent.is('percentage') && !parent.is('dimension')) { + detected.push(true); + } + }); + + return detected; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/lib/options/vendor-prefix-align.js b/node_modules/csscomb/lib/options/vendor-prefix-align.js index 84eeced..e3a1138 100644 --- a/node_modules/csscomb/lib/options/vendor-prefix-align.js +++ b/node_modules/csscomb/lib/options/vendor-prefix-align.js @@ -1,445 +1,460 @@ -module.exports = (function() { - // Vendor prefixes list: - var PREFIXES = [ - 'webkit', - 'moz', - 'ms', - 'o' - ]; +'use strict'; + +var gonzales = require('gonzales-pe'); + +module.exports = function () { + // Vendor prefixes list: + var PREFIXES = ['webkit', 'khtml', 'moz', 'ms', 'o']; + + var oneline; + + /** + * Makes namespace from property name. + * + * @param {String} propertyName + * @returns {String|undefined} + */ + function makeNamespace(propertyName) { + var info = getPrefixInfo(propertyName); + return info && info.baseName; + } + + /** + * Creates object which contains info about vendor prefix used + * in propertyName. + * + * @param {String} propertyName property name + * @param {String} [namespace=''] namespace name + * @param {Number} [extraSymbols=0] extra symbols count + * @returns {Object|undefined} + */ + function getPrefixInfo(propertyName, namespace, extraSymbols) { + var baseName = propertyName; + var prefixLength = 0; + + namespace = namespace || ''; + extraSymbols = extraSymbols || 0; + + if (!propertyName) return; + + PREFIXES.some(function (prefix) { + prefix = '-' + prefix + '-'; + if (propertyName.indexOf(prefix) !== 0) return; + + baseName = baseName.substr(prefix.length); + prefixLength = prefix.length; + + return true; + }); - var oneline; + return { + id: namespace + baseName, + baseName: baseName, + prefixLength: prefixLength, + extra: extraSymbols + }; + } + + /** + * Returns extra indent for item in arguments + * + * @param {Array} nodes nodes to process + * @returns {Number|undefined} + */ + function extraIndent(nodes) { + if (!nodes || !nodes.length) return; + + var node; + var crPos; + var tabPos; + var result = 0; + + for (var i = nodes.length; i--;) { + node = nodes[i]; + + if (!node.content) { + crPos = -1; + } else { + crPos = node.content.lastIndexOf('\n'); + tabPos = node.content.lastIndexOf('\t'); + if (tabPos > crPos) crPos = tabPos; + } + + if (crPos !== -1) oneline = false; + + if (node.is('space')) { + result += node.content.length - crPos - 1; + if (crPos !== -1) break; + } + if (node.is('multilineComment')) { + if (crPos === -1) { + // Comment symbols length + let offset = 4; + result += node.content.length + offset; + } else { + // Only last comment symbols length - 1 (not count \n) + let offset = crPos - 1; + result += node.content.length - offset; + break; + } + } + } - /** - * Makes namespace from property name. - * - * @param {String} propertyName - * @returns {String|undefined} - */ - function makeNamespace(propertyName) { - var info = getPrefixInfo(propertyName); - return info && info.baseName; + return result; + } + + /** + * Wrapper for extra indent function for `property` node. + * + * @param {Array} nodes all nodes + * @param {Number} i position in nodes array + */ + function extraIndentProperty(nodes, i) { + var subset = []; + while (i--) { + if (!nodes.get(i) || nodes.get(i).is('declarationDelimiter')) break; + subset.unshift(nodes.get(i)); + } + return extraIndent(subset); + } + + /** + * Wrapper for extra indent function for val-node. + * + * @param {Array} nodes all nodes + * @param {Number} i position in nodes array + */ + function extraIndentVal(nodes, i) { + var subset = []; + var declaration = nodes.get(i); + if (!declaration.is('declaration')) return; + + for (var x = declaration.length; x--;) { + if (!declaration.get(x).is('value')) continue; + + x--; + + while (!declaration.get(x).is('propertyDelimiter')) { + subset.push(declaration.get(x)); + x--; + } + + break; } + return extraIndent(subset); + } + + /** + * Walks across nodes, and call payload for every node that pass + * selector check. + * + * @param {Object} args arguments in form of: + * { + * node: {object} current node, + * selector: {function} propertyName selector + * payload: {function} work to do with gathered info + * namespaceSelector: {function} selector for namespace + * getExtraSymbols: {Number} extra symbols count + * } + */ + function walk(args) { + args.node.forEach(function (item, i) { + var name = args.selector(item); + var namespace = args.namespaceSelector && makeNamespace(args.namespaceSelector(item)); + var extraSymbols = args.getExtraSymbols(args.node, i); + + var info = name && getPrefixInfo(name, namespace, extraSymbols); + if (!info) return; + args.payload(info, i); + }); + } + + /** + * Returns property name. + * e.g. + * for: 'color: #fff' + * returns string: 'color' + * + * @param {node} node + * @returns {String|undefined} + */ + function getPropertyName(node) { + if (!node.is('declaration')) return; + // TODO: Check that it's not a variable + return node.get(0).get(0).content; + } + + /** + * Returns property value name. + * e.g. + * for: '-webkit-transition: -webkit-transform 150ms linear' + * returns string: '-webkit-transform', and + * for: 'background: -webkit-linear-gradient(...)' + * returns string: '-webkit-linear-gradient' + * + * @param {node} node + * @returns {String|undefined} + */ + function getValName(node) { + if (!node.is('declaration')) return; + + var value = node.first('value'); + if (value.get(0).is('ident')) return value.get(0).content; + if (value.get(0).is('function')) return value.get(0).get(0).content; + } + + /** + * Updates dict which contains info about items align. + * + * @param {Object} info + * @param {Object} dict + */ + function updateDict(info, dict) { + if (info.prefixLength === 0 && info.extra === 0) return; + + var indent = dict[info.id] || { prefixLength: 0, extra: 0 }; + + let indentLength = indent.prefixLength + indent.extra; + let infoLength = info.prefixLength + info.extra; + if (indentLength > infoLength) { + dict[info.id] = indent; + } else { + dict[info.id] = { + prefixLength: info.prefixLength, + extra: info.extra + }; + } + } - /** - * Creates object which contains info about vendor prefix used in propertyName. - * - * @param {String} propertyName property name - * @param {String} [namespace=''] namespace name - * @param {Number} [extraSymbols=0] extra symbols count - * @returns {Object|undefined} - */ - function getPrefixInfo(propertyName, namespace, extraSymbols) { - var baseName = propertyName; - var prefixLength = 0; + /** + * Returns string with correct number of spaces for info.baseName property. + * + * @param {Object} info + * @param {Object} dict + * @param {String} whitespaceNode + * @returns {String} + */ + function updateIndent(info, dict, whitespaceNode) { + var item = dict[info.id]; + if (!item) return whitespaceNode; - namespace = namespace || ''; - extraSymbols = extraSymbols || 0; + var crPos = whitespaceNode.lastIndexOf('\n'); + var tabPos = whitespaceNode.lastIndexOf('\t'); + if (tabPos > crPos) crPos = tabPos; - if (!propertyName) return; + var firstPart = whitespaceNode.substr(0, crPos + 1); + var extraIndent = new Array(item.prefixLength - info.prefixLength + (item.extra - info.extra) + whitespaceNode.length - firstPart.length + 1).join(' '); - PREFIXES.some(function(prefix) { - prefix = '-' + prefix + '-'; - if (propertyName.indexOf(prefix) !== 0) return; + return firstPart.concat(extraIndent); + } - baseName = baseName.substr(prefix.length); - prefixLength = prefix.length; + return { + name: 'vendor-prefix-align', - return true; - }); + syntax: ['css', 'less', 'sass', 'scss'], - return { - id: namespace + baseName, - baseName: baseName, - prefixLength: prefixLength, - extra: extraSymbols - }; - } + accepts: { + boolean: [true] + }, /** - * Returns extra indent for item in arguments + * Processes tree node. * - * @param {Array} nodes nodes to process - * @returns {Number|undefined} + * @param {node} ast */ - function extraIndent(nodes) { - if (!nodes || !nodes.length) return; - - var node; - var crPos; - var tabPos; - var result = 0; - - for (var i = nodes.length; i--;) { - node = nodes[i]; + process: function (ast) { + ast.traverseByType('block', function (node) { + oneline = true; + + var dict = {}; + + // Gathering Info + walk({ + node: node, + selector: getPropertyName, + getExtraSymbols: extraIndentProperty, + payload: function (info) { + updateDict(info, dict); + } + }); - if (!Array.isArray(node)) - continue; + walk({ + node: node, + selector: getValName, + namespaceSelector: getPropertyName, + getExtraSymbols: extraIndentVal, + payload: function (info) { + updateDict(info, dict); + } + }); - if (!node[1]) { - crPos = -1; - } else { - crPos = node[1].lastIndexOf('\n'); - tabPos = node[1].lastIndexOf('\t'); - if (tabPos > crPos) crPos = tabPos; + if (oneline && ast.syntax !== 'sass') return; + + // Update nodes + walk({ + node: node, + selector: getValName, + namespaceSelector: getPropertyName, + getExtraSymbols: extraIndentVal, + payload: function (info, i) { + for (var x = node.get(i).length; x--;) { + if (node.get(i).get(x).is('value')) break; } - if (crPos !== -1) - oneline = false; - - if (node[0] === 's') { - result += node[1].length - crPos - 1; - if (crPos !== -1) - break; - } - if (node[0] === 'commentML') { - if (crPos === -1) { - result += node[1].length + 4 /* comment symbols length */ ; - } else { - result += node[1].length - crPos + 1 /* only last comment symbols length - 1(not count \n)*/; - break; - } + let prevNode = node.get(i).get(x - 1); + if (!prevNode.is('space')) { + var space = gonzales.createNode({ + type: 'space', + content: '' + }); + node.get(i).insert(x, space); + ++x; } - } - return result; - } + let content = node.get(i).get(x - 1).content; + let updatedIndent = updateIndent(info, dict, content); + node.get(i).get(x - 1).content = updatedIndent; + } + }); - /** - * Wrapper for extra indent function for `property` node. - * - * @param {Array} nodes all nodes - * @param {Number} i position in nodes array - */ - function extraIndentProperty(nodes, i) { - var subset = []; - while (i--) { - if (!nodes[i] || nodes[i][0] === 'declDelim') - break; - subset.unshift(nodes[i]); - } - return extraIndent(subset); - } + if (ast.syntax === 'sass') return; + + walk({ + node: node, + selector: getPropertyName, + getExtraSymbols: extraIndentProperty, + payload: function (info, i) { + // `node.get(i - 1)` can be either space or comment: + var whitespaceNode = node.get(i - 1); + if (!whitespaceNode) return; + // If it's a comment, insert an empty space node: + if (!whitespaceNode.is('space')) { + whitespaceNode = gonzales.createNode({ + type: 'space', + content: '' + }); + node.insert(i - 1, whitespaceNode); + } + let content = whitespaceNode.content; + let updatedContent = updateIndent(info, dict, content); + whitespaceNode.content = updatedContent; + } + }); + }); + }, /** - * Wrapper for extra indent function for val-node. + * Detects the value of an option at the tree node. * - * @param {Array} nodes all nodes - * @param {Number} i position in nodes array + * @param {node} ast */ - function extraIndentVal(nodes, i) { - var subset = []; - var declaration = nodes[i]; + detect: function (ast) { + let detected = []; - for (var x = declaration.length; x--;) { - if (declaration[x][0] !== 'value') continue; + ast.traverseByType('block', function (node) { + var result = { + true: 0, + false: 0 + }; - x--; + var maybePrefix = false; + var prevPrefixLength = false; + var prevProp; + var prevSum; + var partialResult = null; + + var getResult = function (options) { + let node = options.node, + sum = options.sum, + info = options.info, + i = options.i; + + var prop = info.baseName; + + // If this is the last item in a row and we have a result, + // then catch it + if (prop !== prevProp && partialResult !== null) { + if (partialResult) { + result.true++; + } else { + result.false++; + } + partialResult = null; + } + + if (prop === prevProp && info.prefixLength !== prevPrefixLength) { + maybePrefix = true; + } else { + maybePrefix = false; + } + + if (maybePrefix && partialResult !== false) { + // If there is prefixed prop, check if the prefixes are + // aligned, but only if we hadn't already catched + // that it is false + if (sum === prevSum) { + partialResult = true; + } else { + partialResult = false; + } + } - while (declaration[x][0] !== 'propertyDelim') { - subset.push(declaration[x]); - x--; + if (node.length === i + 3 && partialResult !== null) { + // If we're at the last property and have a result, + // catch it + if (partialResult) { + result.true++; + } else { + result.false++; } + } - break; - } - return extraIndent(subset); - } + prevPrefixLength = info.prefixLength; + prevProp = prop; + prevSum = sum; + }; - /** - * Walks across nodes, and call payload for every node that pass selector check. - * - * @param {Object} args arguments in form of: - * { - * node: {object} current node, - * selector: {function} propertyName selector - * payload: {function} work to do with gathered info - * namespaceSelector: {function} selector for namespace - * getExtraSymbols: {Number} extra symbols count - * } - */ - function walk(args) { - args.node.forEach(function(item, i) { - var name = args.selector(item); - var info = name && getPrefixInfo( - name, - args.namespaceSelector && makeNamespace(args.namespaceSelector(item)), - args.getExtraSymbols(args.node, i) - ); - if (!info) return; - args.payload(info, i); + // Gathering Info + walk({ + node: node, + selector: getPropertyName, + getExtraSymbols: extraIndentProperty, + payload: function (info, i) { + if (node.get(i - 1) && node.get(i - 1).content) { + let nodeLength = node.get(i - 1).content.replace(/^[ \t]*\n+/, '').length; + var sum = nodeLength + info.prefixLength; + getResult({ node: node, sum: sum, info: info, i: i }); + } + } }); - } - - /** - * Returns property name. - * e.g. - * for: 'color: #fff' - * returns string: 'color' - * - * @param {node} node - * @returns {String|undefined} - */ - function getPropertyName(node) { - if (node[0] !== 'declaration') return; - // TODO: Check that it's not a variable - return node[1][1][1]; - } - - /** - * Returns property value name. - * e.g. - * for: '-webkit-transition: -webkit-transform 150ms linear' - * returns string: '-webkit-transform', and - * for: 'background: -webkit-linear-gradient(...)' - * returns string: '-webkit-linear-gradient' - * - * @param {node} node - * @returns {String|undefined} - */ - function getValName(node) { - if (node[0] !== 'declaration') return; - var valueNode; - var value; - - for (var i = node.length; i--;) { - valueNode = node[i]; - - if (valueNode[0] !== 'value') continue; + walk({ + node: node, + selector: getValName, + getExtraSymbols: extraIndentVal, + payload: function (info, i) { + for (var x = node.get(i).length; x--;) { + if (node.get(i).get(x).is('value')) break; + } - value = valueNode[1]; + if (node.get(i).get(x - 1)) { + let nodeLength = node.get(i).get(x - 1).content.replace(/^[ \t]*\n+/, '').length; + var sum = nodeLength + info.prefixLength; + getResult({ node: node, sum: sum, info: info, i: i }); + } + } + }); - if (value[0] === 'ident') return value[1]; - if (value[0] === 'function') return value[1][1]; + if (result.true > 0 || result.false > 0) { + if (result.true >= result.false) { + detected.push(true); + } else { + detected.push(false); + } } - } - - /** - * Updates dict which contains info about items align. - * - * @param {Object} info, - * @param {Object} dict, - */ - function updateDict(info, dict) { - if (info.prefixLength === 0 && info.extra === 0) return; - - var indent = dict[info.id] || { prefixLength: 0, extra: 0 }; - - dict[info.id] = indent.prefixLength + indent.extra > info.prefixLength + info.extra ? - indent : - { - prefixLength: info.prefixLength, - extra: info.extra, - }; - } - - /** - * Returns string with correct number of spaces for info.baseName property. - * - * @param {Object} info, - * @param {Object} dict, - * @param {String} whitespaceNode - * @returns {String} - */ - function updateIndent(info, dict, whitespaceNode) { - var item = dict[info.id]; - if (!item) - return whitespaceNode; - - var crPos = whitespaceNode.lastIndexOf('\n'); - var tabPos = whitespaceNode.lastIndexOf('\t'); - if (tabPos > crPos) crPos = tabPos; - - var firstPart = whitespaceNode.substr(0, crPos + 1 ); - var extraIndent = new Array( - (item.prefixLength - info.prefixLength) + - (item.extra - info.extra) + - whitespaceNode.length - firstPart.length + - 1).join(' '); + }); - return firstPart.concat(extraIndent); + return detected; } - - return { - name: 'vendor-prefix-align', - - syntax: ['css', 'less', 'sass', 'scss'], - - accepts: { boolean: [true] }, - - /** - * Processes tree node. - * - * @param {String} nodeType - * @param {node} node - */ - process: function(nodeType, node) { - if (nodeType !== 'block') return; - oneline = true; - - var dict = {}; - - // Gathering Info - walk({ - node: node, - selector: getPropertyName, - getExtraSymbols: extraIndentProperty, - payload: function(info) { - updateDict(info, dict); - } - }); - - walk({ - node: node, - selector: getValName, - namespaceSelector: getPropertyName, - getExtraSymbols: extraIndentVal, - payload: function(info) { - updateDict(info, dict); - } - }); - - if (oneline && this.getSyntax() !== 'sass') return; - - // Update nodes - walk({ - node: node, - selector: getValName, - namespaceSelector: getPropertyName, - getExtraSymbols: extraIndentVal, - payload: function(info, i) { - for (var x = node[i].length; x--;) { - if (node[i][x][0] === 'value') break; - } - - if (node[i][x - 1][0] !== 's') { - node[i].splice(x, 0, ['s', '']); - ++x; - } - - node[i][x - 1][1] = updateIndent(info, dict, node[i][x - 1][1]); - } - }); - - if (this.getSyntax() === 'sass') return; - - walk({ - node: node, - selector: getPropertyName, - getExtraSymbols: extraIndentProperty, - payload: function(info, i) { - // `node[i - 1]` can be either space or comment: - var whitespaceNode = node[i - 1]; - if (!whitespaceNode) return; - // If it's a comment, insert an empty space node: - if (whitespaceNode[0] !== 's') { - whitespaceNode = ['s', '']; - node.splice(i - 1, 0, whitespaceNode); - } - whitespaceNode[1] = updateIndent(info, dict, whitespaceNode[1]); - } - }); - }, - - /** - * Detects the value of an option at the tree node. - * - * @param {String} nodeType - * @param {node} node - */ - detect: function(nodeType, node) { - if (nodeType !== 'block') return; - - var result = { - true: 0, - false: 0 - }; - - var maybePrefix = false; - var prevPrefixLength = false; - var prevProp; - var prevSum; - var partialResult = null; - - var getResult = function(node, sum, info, i) { - var prop = info.baseName; - - // If this is the last item in a row and we have a result, then catch it - if (prop !== prevProp && partialResult !== null) { - if (partialResult) { - result.true++; - } else { - result.false++; - } - partialResult = null; - } - - if (prop === prevProp && info.prefixLength !== prevPrefixLength) { - maybePrefix = true; - } else { - maybePrefix = false; - } - - if (maybePrefix && partialResult !== false) { - // If there is prefixed prop, check if the prefixes are aligned, - // but only if we hadn't already catched that it is false - if (sum === prevSum) { - partialResult = true; - } else { - partialResult = false; - } - } - - if (node.length === i + 3 && partialResult !== null) { - // If we're at the last property and have a result, catch it - if (partialResult) { - result.true++; - } else { - result.false++; - } - } - - prevPrefixLength = info.prefixLength; - prevProp = prop; - prevSum = sum; - }; - - // Gathering Info - walk({ - node: node, - selector: getPropertyName, - getExtraSymbols: extraIndentProperty, - payload: function(info, i) { - if (node[i - 1] && node[i - 1][1]) { - var sum = node[i - 1][1].replace(/^[ \t]*\n+/, '').length + info.prefixLength; - getResult(node, sum, info, i); - } - } - }); - - walk({ - node: node, - selector: getValName, - getExtraSymbols: extraIndentVal, - payload: function(info, i) { - for (var x = node[i].length; x--;) { - if (node[i][x][0] === 'value') break; - } - - if (node[i][x - 1][1]) { - var sum = node[i][x - 1][1].replace(/^[ \t]*\n+/, '').length + info.prefixLength; - getResult(node, sum, info, i); - } - } - }); - - if (result.true > 0 || result.false > 0) { - if (result.true >= result.false) { - return true; - } else { - return false; - } - } - } - }; -})(); + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/lib/plugin.js b/node_modules/csscomb/lib/plugin.js new file mode 100644 index 0000000..0e0de06 --- /dev/null +++ b/node_modules/csscomb/lib/plugin.js @@ -0,0 +1,86 @@ +'use strict'; + +let Errors = require('./errors'); + +let Plugin = function (methods) { + for (let method in methods) { + this[method] = typeof method === 'function' ? methods[method].bind(this) : methods[method]; + } + + this.validate(); +}; + +Plugin.prototype = { + /** + * Plugin's name. + * @type {String} + */ + name: null, + + /** + * List of supported syntaxes. + * @type {Array} + */ + syntax: null, + + /** + * @type {Object} + */ + accepts: null, + + /** + * @type {Function} + */ + process: null, + + /** + * @type {Function} + */ + lint: null, + + value_: null, + get value() { + return this.value_; + }, + set value(value) { + let valueType = typeof value; + let pattern = this.accepts && this.accepts[valueType]; + + if (this.setValue) { + this.value_ = this.setValue(value); + return this.value_; + } + + if (!pattern) throw new Error(Errors.unacceptableValueType(valueType, this.accepts)); + + if (valueType === 'boolean') { + if (pattern.indexOf(value) < 0) throw new Error(Errors.unacceptableBoolean(pattern)); + this.value_ = value; + return this.value_; + } + + if (valueType === 'number') { + if (value !== parseInt(value)) throw new Error(Errors.unacceptableNumber()); + this.value_ = new Array(value + 1).join(' '); + return this.value_; + } + + if (valueType = 'string') { + if (!value.match(pattern)) throw new Error(Errors.unacceptableString(pattern)); + this.value_ = value; + return this.value_; + } + + throw new Error(Errors.implementSetValue(valueType)); + }, + + validate() { + if (typeof this.name !== 'string' || !this.name) throw new Error(Errors.missingName()); + + if (!Array.isArray(this.syntax) || this.syntax.length === 0) throw new Error(Errors.missingSyntax()); + + if (typeof this.accepts !== 'object' && typeof this.setValue !== 'function') throw new Error(Errors.missingSetValue()); + } +}; + +module.exports = Plugin; \ No newline at end of file diff --git a/node_modules/csscomb/logo.png b/node_modules/csscomb/logo.png deleted file mode 100644 index 04fa74d..0000000 Binary files a/node_modules/csscomb/logo.png and /dev/null differ diff --git a/node_modules/csscomb/node_modules/.bin/gonzales b/node_modules/csscomb/node_modules/.bin/gonzales deleted file mode 120000 index 02426f4..0000000 --- a/node_modules/csscomb/node_modules/.bin/gonzales +++ /dev/null @@ -1 +0,0 @@ -../gonzales-pe/bin/gonzales.js \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/.bin/gonzales b/node_modules/csscomb/node_modules/.bin/gonzales new file mode 100755 index 0000000..22968a2 --- /dev/null +++ b/node_modules/csscomb/node_modules/.bin/gonzales @@ -0,0 +1,116 @@ +#!/usr/bin/env node + +'use strict'; + +var parseArgs = require('minimist'); +var gonzales = require('..'); +var fs = require('fs'); +var path = require('path'); + +var options = getOptions(); + +if (options.help) { + displayHelp(); + process.exit(0); +} + +if (isSTDIN()) { + processSTDIN(); +} else { + processFile(options._[0]); +} + +function getOptions() { + var parserOptions = { + boolean: ['silent', 'simple'], + alias: { + help: 'h', + syntax: 's', + context: 'c' + } + }; + return parseArgs(process.argv.slice(2), parserOptions); +} + +function isSTDIN() { + return options._.indexOf('-') !== -1; +} + +function processSTDIN() { + var input = ''; + process.stdin.resume(); + process.stdin.setEncoding('utf8'); + process.stdin.on('data', data => { + input += data; + }); + process.stdin.on('end', () => { + processInputData(input); + }); +} + +function processFile(file) { + if (!file) process.exit(0); + if (!options.syntax) options.syntax = path.extname(file).substring(1); + var css = fs.readFileSync(file, 'utf-8').trim(); + processInputData(css); +} + +function processInputData(input) { + try { + var ast = gonzales.parse(input, { + syntax: options.syntax, + context: options.context + }); + printTree(ast); + process.exit(0); + } catch (e) { + if (!options.silent) process.stderr.write(e.toString()); + process.exit(1); + } +} + +function printTree(ast) { + if (!options.simple) { + var tree = ast.toJson(); + process.stdout.write(tree); + } else { + var lastLevel; + + ast.traverse(function(node, i, parent, lastLevel) { + var type = node.type; + var spaces = new Array(lastLevel).join(' |'); + if (typeof node.content === 'string') { + var content = JSON.stringify(node.content); + console.log(spaces, '->', type); + console.log(spaces, ' ', content); + } else { + console.log(spaces, '->', type); + } + }); + + var spaces = new Array(lastLevel).join(' -'); + console.log(spaces); + } +} + +function displayHelp() { + var help = [ + 'NAME', + ' gonzlaes-pe — Parse a css file and print its parse tree in JSON', + '', + 'SYNOPSIS', + ' gonzales-pe [options] file.js', + ' cat file.js | gonzales-pe [options] -', + '', + 'OPTIONS', + ' -s, --syntax', + ' Syntax name: css, less, sass or scss.', + ' -c, --context', + ' Context of code part. See docs on node types for more info.', + ' --simple', + ' Print a simplified parse tree structure instead of JSON.', + ' --silent', + ' Don\'t print any error messages.' + ]; + console.log(help.join('\n')); +} diff --git a/node_modules/csscomb/node_modules/babel-polyfill/.npmignore b/node_modules/csscomb/node_modules/babel-polyfill/.npmignore new file mode 100644 index 0000000..47cdd2c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/.npmignore @@ -0,0 +1,3 @@ +src +test +node_modules diff --git a/node_modules/csscomb/node_modules/babel-polyfill/README.md b/node_modules/csscomb/node_modules/babel-polyfill/README.md new file mode 100644 index 0000000..dfbfeb9 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/README.md @@ -0,0 +1,2 @@ +# babel-polyfill + diff --git a/node_modules/csscomb/node_modules/babel-polyfill/browser.js b/node_modules/csscomb/node_modules/babel-polyfill/browser.js new file mode 100644 index 0000000..df0250b --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/browser.js @@ -0,0 +1,4 @@ +!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!u&&c)return c(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var a=n[o]={exports:{}};t[o][0].call(a.exports,function(n){var r=t[o][1][n];return s(r?r:n)},a,a.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o2?arguments[2]:void 0,s=Math.min((void 0===a?u:i(a,u))-f,u-c),l=1;for(f0;)f in r?r[c]=r[f]:delete r[c],c+=l,f+=l;return r}},{105:105,108:108,109:109}],9:[function(t,n,r){"use strict";var e=t(109),i=t(105),o=t(108);n.exports=function fill(t){for(var n=e(this),r=o(n.length),u=arguments.length,c=i(u>1?arguments[1]:void 0,r),f=u>2?arguments[2]:void 0,a=void 0===f?r:i(f,r);a>c;)n[c++]=t;return n}},{105:105,108:108,109:109}],10:[function(t,n,r){var e=t(37);n.exports=function(t,n){var r=[];return e(t,!1,r.push,r,n),r}},{37:37}],11:[function(t,n,r){var e=t(107),i=t(108),o=t(105);n.exports=function(t){return function(n,r,u){var c,f=e(n),a=i(f.length),s=o(u,a);if(t&&r!=r){for(;a>s;)if(c=f[s++],c!=c)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===r)return t||s||0;return!t&&-1}}},{105:105,107:107,108:108}],12:[function(t,n,r){var e=t(25),i=t(45),o=t(109),u=t(108),c=t(15);n.exports=function(t,n){var r=1==t,f=2==t,a=3==t,s=4==t,l=6==t,h=5==t||l,v=n||c;return function(n,c,p){for(var d,y,g=o(n),b=i(g),x=e(c,p,3),m=u(b.length),w=0,S=r?v(n,m):f?v(n,0):void 0;m>w;w++)if((h||w in b)&&(d=b[w],y=x(d,w,g),t))if(r)S[w]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return w;case 2:S.push(d)}else if(s)return!1;return l?-1:a||s?s:S}}},{108:108,109:109,15:15,25:25,45:45}],13:[function(t,n,r){var e=t(3),i=t(109),o=t(45),u=t(108);n.exports=function(t,n,r,c,f){e(n);var a=i(t),s=o(a),l=u(a.length),h=f?l-1:0,v=f?-1:1;if(r<2)for(;;){if(h in s){c=s[h],h+=v;break}if(h+=v,f?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;f?h>=0:l>h;h+=v)h in s&&(c=n(c,s[h],h,a));return c}},{108:108,109:109,3:3,45:45}],14:[function(t,n,r){var e=t(49),i=t(47),o=t(117)("species");n.exports=function(t){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&(n=n[o],null===n&&(n=void 0))),void 0===n?Array:n}},{117:117,47:47,49:49}],15:[function(t,n,r){var e=t(14);n.exports=function(t,n){return new(e(t))(n)}},{14:14}],16:[function(t,n,r){"use strict";var e=t(3),i=t(49),o=t(44),u=[].slice,c={},f=function(t,n,r){if(!(n in c)){for(var e=[],i=0;i1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function has(t){return!!y(this,t)}}),v&&e(l.prototype,"size",{get:function(){return f(this[d])}}),l},def:function(t,n,r){var e,i,o=y(t,n);return o?o.v=r:(t._l=o={i:i=p(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[d]++,"F"!==i&&(t._i[i]=o)),t},getEntry:y,setStrong:function(t,n,r){s(t,n,function(t,n){this._t=t,this._k=n,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==n?l(0,r.k):"values"==n?l(0,r.v):l(0,[r.k,r.v]):(t._t=void 0,l(1))},r?"entries":"values",!r,!0),h(n)}}},{25:25,27:27,28:28,37:37,53:53,55:55,6:6,62:62,66:66,67:67,86:86,91:91}],20:[function(t,n,r){var e=t(17),i=t(10);n.exports=function(t){return function toJSON(){if(e(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},{10:10,17:17}],21:[function(t,n,r){"use strict";var e=t(86),i=t(62).getWeak,o=t(7),u=t(49),c=t(6),f=t(37),a=t(12),s=t(39),l=a(5),h=a(6),v=0,p=function(t){return t._l||(t._l=new d)},d=function(){this.a=[]},y=function(t,n){return l(t.a,function(t){return t[0]===n})};d.prototype={get:function(t){var n=y(this,t);if(n)return n[1]},has:function(t){return!!y(this,t)},set:function(t,n){var r=y(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(t){var n=h(this.a,function(n){return n[0]===t});return~n&&this.a.splice(n,1),!!~n}},n.exports={getConstructor:function(t,n,r,o){var a=t(function(t,e){c(t,a,n,"_i"),t._i=v++,t._l=void 0,void 0!=e&&f(e,r,t[o],t)});return e(a.prototype,{delete:function(t){if(!u(t))return!1;var n=i(t);return n===!0?p(this).delete(t):n&&s(n,this._i)&&delete n[this._i]},has:function has(t){if(!u(t))return!1;var n=i(t);return n===!0?p(this).has(t):n&&s(n,this._i)}}),a},def:function(t,n,r){var e=i(o(n),!0);return e===!0?p(t).set(n,r):e[t._i]=r,t},ufstore:p}},{12:12,37:37,39:39,49:49,6:6,62:62,7:7,86:86}],22:[function(t,n,r){"use strict";var e=t(38),i=t(32),o=t(87),u=t(86),c=t(62),f=t(37),a=t(6),s=t(49),l=t(34),h=t(54),v=t(92),p=t(43);n.exports=function(t,n,r,d,y,g){var b=e[t],x=b,m=y?"set":"add",w=x&&x.prototype,S={},_=function(t){var n=w[t];o(w,t,"delete"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"has"==t?function has(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function get(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function add(t){return n.call(this,0===t?0:t),this}:function set(t,r){return n.call(this,0===t?0:t,r),this})};if("function"==typeof x&&(g||w.forEach&&!l(function(){(new x).entries().next()}))){var E=new x,O=E[m](g?{}:-0,1)!=E,F=l(function(){E.has(1)}),P=h(function(t){new x(t)}),M=!g&&l(function(){for(var t=new x,n=5;n--;)t[m](n,n);return!t.has(-0)});P||(x=n(function(n,r){a(n,x,t);var e=p(new b,n,x);return void 0!=r&&f(r,y,e[m],e),e}),x.prototype=w,w.constructor=x),(F||M)&&(_("delete"),_("has"),y&&_("get")),(M||O)&&_(m),g&&w.clear&&delete w.clear}else x=d.getConstructor(n,t,y,m),u(x.prototype,r),c.NEED=!0;return v(x,t),S[t]=x,i(i.G+i.W+i.F*(x!=b),S),g||d.setStrong(x,t,y),x}},{32:32,34:34,37:37,38:38,43:43,49:49,54:54,6:6,62:62,86:86,87:87,92:92}],23:[function(t,n,r){var e=n.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)},{}],24:[function(t,n,r){"use strict";var e=t(67),i=t(85);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{67:67,85:85}],25:[function(t,n,r){var e=t(3);n.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},{3:3}],26:[function(t,n,r){"use strict";var e=t(7),i=t(110),o="number";n.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),t!=o)}},{110:110,7:7}],27:[function(t,n,r){n.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],28:[function(t,n,r){n.exports=!t(34)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{34:34}],29:[function(t,n,r){var e=t(49),i=t(38).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{38:38,49:49}],30:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],31:[function(t,n,r){var e=t(76),i=t(73),o=t(77);n.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),f=o.f,a=0;c.length>a;)f.call(t,u=c[a++])&&n.push(u);return n}},{73:73,76:76,77:77}],32:[function(t,n,r){var e=t(38),i=t(23),o=t(40),u=t(87),c=t(25),f="prototype",a=function(t,n,r){var s,l,h,v,p=t&a.F,d=t&a.G,y=t&a.S,g=t&a.P,b=t&a.B,x=d?e:y?e[n]||(e[n]={}):(e[n]||{})[f],m=d?i:i[n]||(i[n]={}),w=m[f]||(m[f]={});d&&(r=n);for(s in r)l=!p&&x&&void 0!==x[s],h=(l?x:r)[s],v=b&&l?c(h,e):g&&"function"==typeof h?c(Function.call,h):h,x&&u(x,s,h,t&a.U),m[s]!=h&&o(m,s,v),g&&w[s]!=h&&(w[s]=h)};e.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,n.exports=a},{23:23,25:25,38:38,40:40,87:87}],33:[function(t,n,r){var e=t(117)("match");n.exports=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,!"/./"[t](n)}catch(t){}}return!0}},{117:117}],34:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],35:[function(t,n,r){"use strict";var e=t(40),i=t(87),o=t(34),u=t(27),c=t(117);n.exports=function(t,n,r){var f=c(t),a=r(u,f,""[t]),s=a[0],l=a[1];o(function(){var n={};return n[f]=function(){return 7},7!=""[t](n)})&&(i(String.prototype,t,s),e(RegExp.prototype,f,2==n?function(t,n){return l.call(t,this,n)}:function(t){return l.call(t,this)}))}},{117:117,27:27,34:34,40:40,87:87}],36:[function(t,n,r){"use strict";var e=t(7);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{7:7}],37:[function(t,n,r){var e=t(25),i=t(51),o=t(46),u=t(7),c=t(108),f=t(118),a={},s={},r=n.exports=function(t,n,r,l,h){var v,p,d,y,g=h?function(){return t}:f(t),b=e(r,l,n?2:1),x=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(v=c(t.length);v>x;x++)if(y=n?b(u(p=t[x])[0],p[1]):b(t[x]),y===a||y===s)return y}else for(d=g.call(t);!(p=d.next()).done;)if(y=i(d,b,p.value,n),y===a||y===s)return y};r.BREAK=a,r.RETURN=s},{108:108,118:118,25:25,46:46,51:51,7:7}],38:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],39:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],40:[function(t,n,r){var e=t(67),i=t(85);n.exports=t(28)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{28:28,67:67,85:85}],41:[function(t,n,r){n.exports=t(38).document&&document.documentElement},{38:38}],42:[function(t,n,r){n.exports=!t(28)&&!t(34)(function(){return 7!=Object.defineProperty(t(29)("div"),"a",{get:function(){return 7}}).a})},{28:28,29:29,34:34}],43:[function(t,n,r){var e=t(49),i=t(90).set;n.exports=function(t,n,r){var o,u=n.constructor;return u!==r&&"function"==typeof u&&(o=u.prototype)!==r.prototype&&e(o)&&i&&i(t,o),t}},{49:49,90:90}],44:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],45:[function(t,n,r){var e=t(18);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{18:18}],46:[function(t,n,r){var e=t(56),i=t(117)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{117:117,56:56}],47:[function(t,n,r){var e=t(18);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{18:18}],48:[function(t,n,r){var e=t(49),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{49:49}],49:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],50:[function(t,n,r){var e=t(49),i=t(18),o=t(117)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{117:117,18:18,49:49}],51:[function(t,n,r){var e=t(7);n.exports=function(t,n,r,i){try{return i?n(e(r)[0],r[1]):n(r)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}}},{7:7}],52:[function(t,n,r){"use strict";var e=t(66),i=t(85),o=t(92),u={};t(40)(u,t(117)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{117:117,40:40,66:66,85:85,92:92}],53:[function(t,n,r){"use strict";var e=t(58),i=t(32),o=t(87),u=t(40),c=t(39),f=t(56),a=t(52),s=t(92),l=t(74),h=t(117)("iterator"),v=!([].keys&&"next"in[].keys()),p="@@iterator",d="keys",y="values",g=function(){return this};n.exports=function(t,n,r,b,x,m,w){a(r,n,b);var S,_,E,O=function(t){if(!v&&t in A)return A[t];switch(t){case d:return function keys(){return new r(this,t)};case y:return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}},F=n+" Iterator",P=x==y,M=!1,A=t.prototype,I=A[h]||A[p]||x&&A[x],j=I||O(x),N=x?P?O("entries"):j:void 0,k="Array"==n?A.entries||I:I;if(k&&(E=l(k.call(new t)),E!==Object.prototype&&(s(E,F,!0),e||c(E,h)||u(E,h,g))),P&&I&&I.name!==y&&(M=!0,j=function values(){return I.call(this)}),e&&!w||!v&&!M&&A[h]||u(A,h,j),f[n]=j,f[F]=g,x)if(S={values:P?j:O(y),keys:m?j:O(d),entries:N},w)for(_ in S)_ in A||o(A,_,S[_]);else i(i.P+i.F*(v||M),n,S);return S}},{117:117,32:32,39:39,40:40,52:52,56:56,58:58,74:74,87:87,92:92}],54:[function(t,n,r){var e=t(117)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var o=[7],u=o[e]();u.next=function(){return{done:r=!0}},o[e]=function(){return u},t(o)}catch(t){}return r}},{117:117}],55:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],56:[function(t,n,r){n.exports={}},{}],57:[function(t,n,r){var e=t(76),i=t(107);n.exports=function(t,n){for(var r,o=i(t),u=e(o),c=u.length,f=0;c>f;)if(o[r=u[f++]]===n)return r}},{107:107,76:76}],58:[function(t,n,r){n.exports=!1},{}],59:[function(t,n,r){var e=Math.expm1;n.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||e(-2e-17)!=-2e-17?function expm1(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],60:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],61:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],62:[function(t,n,r){var e=t(114)("meta"),i=t(49),o=t(39),u=t(67).f,c=0,f=Object.isExtensible||function(){return!0},a=!t(34)(function(){return f(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!f(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!f(t))return!0;if(!n)return!1;s(t)}return t[e].w},v=function(t){return a&&p.NEED&&f(t)&&!o(t,e)&&s(t),t},p=n.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:v}},{114:114,34:34,39:39,49:49,67:67}],63:[function(t,n,r){var e=t(149),i=t(32),o=t(94)("metadata"),u=o.store||(o.store=new(t(255))),c=function(t,n,r){var i=u.get(t);if(!i){if(!r)return;u.set(t,i=new e)}var o=i.get(n);if(!o){if(!r)return;i.set(n,o=new e)}return o},f=function(t,n,r){var e=c(n,r,!1);return void 0!==e&&e.has(t)},a=function(t,n,r){var e=c(n,r,!1);return void 0===e?void 0:e.get(t)},s=function(t,n,r,e){c(r,e,!0).set(t,n)},l=function(t,n){var r=c(t,n,!1),e=[];return r&&r.forEach(function(t,n){e.push(n)}),e},h=function(t){return void 0===t||"symbol"==typeof t?t:String(t)},v=function(t){i(i.S,"Reflect",t)};n.exports={store:u,map:c,has:f,get:a,set:s,keys:l,key:h,exp:v}},{149:149,255:255,32:32,94:94}],64:[function(t,n,r){var e=t(38),i=t(104).set,o=e.MutationObserver||e.WebKitMutationObserver,u=e.process,c=e.Promise,f="process"==t(18)(u);n.exports=function(){var t,n,r,a=function(){var e,i;for(f&&(e=u.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(f)r=function(){u.nextTick(a)};else if(o){var s=!0,l=document.createTextNode("");new o(a).observe(l,{characterData:!0}),r=function(){l.data=s=!s}}else if(c&&c.resolve){var h=c.resolve();r=function(){h.then(a)}}else r=function(){i.call(e,a)};return function(e){var i={fn:e,next:void 0};n&&(n.next=i),t||(t=i,r()),n=i}}},{104:104,18:18,38:38}],65:[function(t,n,r){"use strict";var e=t(76),i=t(73),o=t(77),u=t(109),c=t(45),f=Object.assign;n.exports=!f||t(34)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=f({},t)[r]||Object.keys(f({},n)).join("")!=e})?function assign(t,n){for(var r=u(t),f=arguments.length,a=1,s=i.f,l=o.f;f>a;)for(var h,v=c(arguments[a++]),p=s?e(v).concat(s(v)):e(v),d=p.length,y=0;d>y;)l.call(v,h=p[y++])&&(r[h]=v[h]);return r}:f},{109:109,34:34,45:45,73:73,76:76,77:77}],66:[function(t,n,r){var e=t(7),i=t(68),o=t(30),u=t(93)("IE_PROTO"),c=function(){},f="prototype",a=function(){var n,r=t(29)("iframe"),e=o.length,i="<",u=">";for(r.style.display="none",t(41).appendChild(r),r.src="javascript:",n=r.contentWindow.document,n.open(),n.write(i+"script"+u+"document.F=Object"+i+"/script"+u),n.close(),a=n.F;e--;)delete a[f][o[e]];return a()};n.exports=Object.create||function create(t,n){var r;return null!==t?(c[f]=e(t),r=new c,c[f]=null,r[u]=t):r=a(),void 0===n?r:i(r,n)}},{29:29,30:30,41:41,68:68,7:7,93:93}],67:[function(t,n,r){var e=t(7),i=t(42),o=t(110),u=Object.defineProperty;r.f=t(28)?Object.defineProperty:function defineProperty(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},{110:110,28:28,42:42,7:7}],68:[function(t,n,r){var e=t(67),i=t(7),o=t(76);n.exports=t(28)?Object.defineProperties:function defineProperties(t,n){i(t);for(var r,u=o(n),c=u.length,f=0;c>f;)e.f(t,r=u[f++],n[r]);return t}},{28:28,67:67,7:7,76:76}],69:[function(t,n,r){n.exports=t(58)||!t(34)(function(){var n=Math.random();__defineSetter__.call(null,n,function(){}),delete t(38)[n]})},{34:34,38:38,58:58}],70:[function(t,n,r){var e=t(77),i=t(85),o=t(107),u=t(110),c=t(39),f=t(42),a=Object.getOwnPropertyDescriptor;r.f=t(28)?a:function getOwnPropertyDescriptor(t,n){if(t=o(t),n=u(n,!0),f)try{return a(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},{107:107,110:110,28:28,39:39,42:42,77:77,85:85}],71:[function(t,n,r){var e=t(107),i=t(72).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return i(t)}catch(t){return u.slice()}};n.exports.f=function getOwnPropertyNames(t){return u&&"[object Window]"==o.call(t)?c(t):i(e(t))}},{107:107,72:72}],72:[function(t,n,r){var e=t(75),i=t(30).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)}},{30:30,75:75}],73:[function(t,n,r){r.f=Object.getOwnPropertySymbols},{}],74:[function(t,n,r){var e=t(39),i=t(109),o=t(93)("IE_PROTO"),u=Object.prototype;n.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},{109:109,39:39,93:93}],75:[function(t,n,r){var e=t(39),i=t(107),o=t(11)(!1),u=t(93)("IE_PROTO");n.exports=function(t,n){var r,c=i(t),f=0,a=[];for(r in c)r!=u&&e(c,r)&&a.push(r);for(;n.length>f;)e(c,r=n[f++])&&(~o(a,r)||a.push(r));return a}},{107:107,11:11,39:39,93:93}],76:[function(t,n,r){var e=t(75),i=t(30);n.exports=Object.keys||function keys(t){return e(t,i)}},{30:30,75:75}],77:[function(t,n,r){r.f={}.propertyIsEnumerable},{}],78:[function(t,n,r){var e=t(32),i=t(23),o=t(34);n.exports=function(t,n){var r=(i.Object||{})[t]||Object[t],u={};u[t]=n(r),e(e.S+e.F*o(function(){r(1)}),"Object",u)}},{23:23,32:32,34:34}],79:[function(t,n,r){var e=t(76),i=t(107),o=t(77).f;n.exports=function(t){return function(n){for(var r,u=i(n),c=e(u),f=c.length,a=0,s=[];f>a;)o.call(u,r=c[a++])&&s.push(t?[r,u[r]]:u[r]);return s}}},{107:107,76:76,77:77}],80:[function(t,n,r){var e=t(72),i=t(73),o=t(7),u=t(38).Reflect;n.exports=u&&u.ownKeys||function ownKeys(t){var n=e.f(o(t)),r=i.f;return r?n.concat(r(t)):n}},{38:38,7:7,72:72,73:73}],81:[function(t,n,r){var e=t(38).parseFloat,i=t(102).trim;n.exports=1/e(t(103)+"-0")!==-(1/0)?function parseFloat(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},{102:102,103:103,38:38}],82:[function(t,n,r){var e=t(38).parseInt,i=t(102).trim,o=t(103),u=/^[\-+]?0[xX]/;n.exports=8!==e(o+"08")||22!==e(o+"0x16")?function parseInt(t,n){var r=i(String(t),3);return e(r,n>>>0||(u.test(r)?16:10))}:e},{102:102,103:103,38:38}],83:[function(t,n,r){"use strict";var e=t(84),i=t(44),o=t(3);n.exports=function(){for(var t=o(this),n=arguments.length,r=Array(n),u=0,c=e._,f=!1;n>u;)(r[u]=arguments[u++])===c&&(f=!0);return function(){var e,o=this,u=arguments.length,a=0,s=0;if(!f&&!u)return i(t,r,o);if(e=r.slice(),f)for(;n>a;a++)e[a]===c&&(e[a]=arguments[s++]);for(;u>s;)e.push(arguments[s++]);return i(t,e,o)}}},{3:3,44:44,84:84}],84:[function(t,n,r){n.exports=t(38)},{38:38}],85:[function(t,n,r){n.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},{}],86:[function(t,n,r){var e=t(87);n.exports=function(t,n,r){for(var i in n)e(t,i,n[i],r);return t}},{87:87}],87:[function(t,n,r){var e=t(38),i=t(40),o=t(39),u=t(114)("src"),c="toString",f=Function[c],a=(""+f).split(c);t(23).inspectSource=function(t){return f.call(t)},(n.exports=function(t,n,r,c){var f="function"==typeof r;f&&(o(r,"name")||i(r,"name",n)),t[n]!==r&&(f&&(o(r,u)||i(r,u,t[n]?""+t[n]:a.join(String(n)))),t===e?t[n]=r:c?t[n]?t[n]=r:i(t,n,r):(delete t[n],i(t,n,r)))})(Function.prototype,c,function toString(){return"function"==typeof this&&this[u]||f.call(this)})},{114:114,23:23,38:38,39:39,40:40}],88:[function(t,n,r){n.exports=function(t,n){var r=n===Object(n)?function(t){return n[t]}:n;return function(n){return String(n).replace(t,r)}}},{}],89:[function(t,n,r){n.exports=Object.is||function is(t,n){return t===n?0!==t||1/t===1/n:t!=t&&n!=n}},{}],90:[function(t,n,r){var e=t(49),i=t(7),o=function(t,n){if(i(t),!e(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};n.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(n,r,e){try{e=t(25)(Function.call,t(70).f(Object.prototype,"__proto__").set,2),e(n,[]),r=!(n instanceof Array)}catch(t){r=!0}return function setPrototypeOf(t,n){return o(t,n),r?t.__proto__=n:e(t,n),t}}({},!1):void 0),check:o}},{25:25,49:49,7:7,70:70}],91:[function(t,n,r){"use strict";var e=t(38),i=t(67),o=t(28),u=t(117)("species");n.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},{117:117,28:28,38:38,67:67}],92:[function(t,n,r){var e=t(67).f,i=t(39),o=t(117)("toStringTag");n.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},{117:117,39:39,67:67}],93:[function(t,n,r){var e=t(94)("keys"),i=t(114);n.exports=function(t){return e[t]||(e[t]=i(t))}},{114:114,94:94}],94:[function(t,n,r){var e=t(38),i="__core-js_shared__",o=e[i]||(e[i]={});n.exports=function(t){return o[t]||(o[t]={})}},{38:38}],95:[function(t,n,r){var e=t(7),i=t(3),o=t(117)("species");n.exports=function(t,n){var r,u=e(t).constructor;return void 0===u||void 0==(r=e(u)[o])?n:i(r)}},{117:117,3:3,7:7}],96:[function(t,n,r){var e=t(34);n.exports=function(t,n){return!!t&&e(function(){n?t.call(null,function(){},1):t.call(null)})}},{34:34}],97:[function(t,n,r){var e=t(106),i=t(27);n.exports=function(t){return function(n,r){var o,u,c=String(i(n)),f=e(r),a=c.length;return f<0||f>=a?t?"":void 0:(o=c.charCodeAt(f),o<55296||o>56319||f+1===a||(u=c.charCodeAt(f+1))<56320||u>57343?t?c.charAt(f):o:t?c.slice(f,f+2):(o-55296<<10)+(u-56320)+65536)}}},{106:106,27:27}],98:[function(t,n,r){var e=t(50),i=t(27);n.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(t))}},{27:27,50:50}],99:[function(t,n,r){var e=t(32),i=t(34),o=t(27),u=/"/g,c=function(t,n,r,e){var i=String(o(t)),c="<"+n;return""!==r&&(c+=" "+r+'="'+String(e).replace(u,""")+'"'),c+">"+i+""};n.exports=function(t,n){var r={};r[t]=n(c),e(e.P+e.F*i(function(){var n=""[t]('"');return n!==n.toLowerCase()||n.split('"').length>3}),"String",r)}},{27:27,32:32,34:34}],100:[function(t,n,r){var e=t(108),i=t(101),o=t(27);n.exports=function(t,n,r,u){var c=String(o(t)),f=c.length,a=void 0===r?" ":String(r),s=e(n);if(s<=f||""==a)return c;var l=s-f,h=i.call(a,Math.ceil(l/a.length));return h.length>l&&(h=h.slice(0,l)),u?h+c:c+h}},{101:101,108:108,27:27}],101:[function(t,n,r){"use strict";var e=t(106),i=t(27);n.exports=function repeat(t){var n=String(i(this)),r="",o=e(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(n+=n))1&o&&(r+=n);return r}},{106:106,27:27}],102:[function(t,n,r){var e=t(32),i=t(27),o=t(34),u=t(103),c="["+u+"]",f="​…",a=RegExp("^"+c+c+"*"),s=RegExp(c+c+"*$"),l=function(t,n,r){var i={},c=o(function(){return!!u[t]()||f[t]()!=f}),a=i[t]=c?n(h):u[t];r&&(i[r]=a),e(e.P+e.F*c,"String",i)},h=l.trim=function(t,n){return t=String(i(t)),1&n&&(t=t.replace(a,"")),2&n&&(t=t.replace(s,"")),t};n.exports=l},{103:103,27:27,32:32,34:34}],103:[function(t,n,r){n.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},{}],104:[function(t,n,r){var e,i,o,u=t(25),c=t(44),f=t(41),a=t(29),s=t(38),l=s.process,h=s.setImmediate,v=s.clearImmediate,p=s.MessageChannel,d=0,y={},g="onreadystatechange",b=function(){var t=+this;if(y.hasOwnProperty(t)){var n=y[t];delete y[t],n()}},x=function(t){b.call(t.data)};h&&v||(h=function setImmediate(t){for(var n=[],r=1;arguments.length>r;)n.push(arguments[r++]);return y[++d]=function(){c("function"==typeof t?t:Function(t),n)},e(d),d},v=function clearImmediate(t){delete y[t]},"process"==t(18)(l)?e=function(t){l.nextTick(u(b,t,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=x,e=u(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(e=function(t){s.postMessage(t+"","*")},s.addEventListener("message",x,!1)):e=g in a("script")?function(t){f.appendChild(a("script"))[g]=function(){f.removeChild(this),b.call(t)}}:function(t){setTimeout(u(b,t,1),0)}),n.exports={set:h,clear:v}},{18:18,25:25,29:29,38:38,41:41,44:44}],105:[function(t,n,r){var e=t(106),i=Math.max,o=Math.min;n.exports=function(t,n){return t=e(t),t<0?i(t+n,0):o(t,n)}},{106:106}],106:[function(t,n,r){var e=Math.ceil,i=Math.floor;n.exports=function(t){return isNaN(t=+t)?0:(t>0?i:e)(t)}},{}],107:[function(t,n,r){var e=t(45),i=t(27);n.exports=function(t){return e(i(t))}},{27:27,45:45}],108:[function(t,n,r){var e=t(106),i=Math.min;n.exports=function(t){return t>0?i(e(t),9007199254740991):0}},{106:106}],109:[function(t,n,r){var e=t(27);n.exports=function(t){return Object(e(t))}},{27:27}],110:[function(t,n,r){var e=t(49);n.exports=function(t,n){if(!e(t))return t;var r,i;if(n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!e(i=r.call(t)))return i;if(!n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},{49:49}],111:[function(t,n,r){"use strict";if(t(28)){var e=t(58),i=t(38),o=t(34),u=t(32),c=t(113),f=t(112),a=t(25),s=t(6),l=t(85),h=t(40),v=t(86),p=t(106),d=t(108),y=t(105),g=t(110),b=t(39),x=t(89),m=t(17),w=t(49),S=t(109),_=t(46),E=t(66),O=t(74),F=t(72).f,P=t(118),M=t(114),A=t(117),I=t(12),j=t(11),N=t(95),k=t(130),R=t(56),T=t(54),L=t(91),C=t(9),U=t(8),G=t(67),D=t(70),W=G.f,B=D.f,V=i.RangeError,z=i.TypeError,K=i.Uint8Array,J="ArrayBuffer",Y="Shared"+J,q="BYTES_PER_ELEMENT",X="prototype",$=Array[X],H=f.ArrayBuffer,Z=f.DataView,Q=I(0),tt=I(2),nt=I(3),rt=I(4),et=I(5),it=I(6),ot=j(!0),ut=j(!1),ct=k.values,ft=k.keys,at=k.entries,st=$.lastIndexOf,lt=$.reduce,ht=$.reduceRight,vt=$.join,pt=$.sort,dt=$.slice,yt=$.toString,gt=$.toLocaleString,bt=A("iterator"),xt=A("toStringTag"),mt=M("typed_constructor"),wt=M("def_constructor"),St=c.CONSTR,_t=c.TYPED,Et=c.VIEW,Ot="Wrong length!",Ft=I(1,function(t,n){return Nt(N(t,t[wt]),n)}),Pt=o(function(){return 1===new K(new Uint16Array([1]).buffer)[0]}),Mt=!!K&&!!K[X].set&&o(function(){new K(1).set({})}),At=function(t,n){if(void 0===t)throw z(Ot);var r=+t,e=d(t);if(n&&!x(r,e))throw V(Ot);return e},It=function(t,n){var r=p(t);if(r<0||r%n)throw V("Wrong offset!");return r},jt=function(t){if(w(t)&&_t in t)return t;throw z(t+" is not a typed array!")},Nt=function(t,n){if(!(w(t)&&mt in t))throw z("It is not a typed array constructor!");return new t(n)},kt=function(t,n){return Rt(N(t,t[wt]),n)},Rt=function(t,n){for(var r=0,e=n.length,i=Nt(t,e);e>r;)i[r]=n[r++];return i},Tt=function(t,n,r){W(t,n,{get:function(){return this._d[r]}})},Lt=function from(t){var n,r,e,i,o,u,c=S(t),f=arguments.length,s=f>1?arguments[1]:void 0,l=void 0!==s,h=P(c);if(void 0!=h&&!_(h)){for(u=h.call(c),e=[],n=0;!(o=u.next()).done;n++)e.push(o.value);c=e}for(l&&f>2&&(s=a(s,arguments[2],2)),n=0,r=d(c.length),i=Nt(this,r);r>n;n++)i[n]=l?s(c[n],n):c[n];return i},Ct=function of(){for(var t=0,n=arguments.length,r=Nt(this,n);n>t;)r[t]=arguments[t++];return r},Ut=!!K&&o(function(){gt.call(new K(1))}),Gt=function toLocaleString(){return gt.apply(Ut?dt.call(jt(this)):jt(this),arguments)},Dt={copyWithin:function copyWithin(t,n){return U.call(jt(this),t,n,arguments.length>2?arguments[2]:void 0)},every:function every(t){return rt(jt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function fill(t){return C.apply(jt(this),arguments)},filter:function filter(t){return kt(this,tt(jt(this),t,arguments.length>1?arguments[1]:void 0))},find:function find(t){return et(jt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function findIndex(t){ +return it(jt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function forEach(t){Q(jt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function indexOf(t){return ut(jt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function includes(t){return ot(jt(this),t,arguments.length>1?arguments[1]:void 0)},join:function join(t){return vt.apply(jt(this),arguments)},lastIndexOf:function lastIndexOf(t){return st.apply(jt(this),arguments)},map:function map(t){return Ft(jt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function reduce(t){return lt.apply(jt(this),arguments)},reduceRight:function reduceRight(t){return ht.apply(jt(this),arguments)},reverse:function reverse(){for(var t,n=this,r=jt(n).length,e=Math.floor(r/2),i=0;i1?arguments[1]:void 0)},sort:function sort(t){return pt.call(jt(this),t)},subarray:function subarray(t,n){var r=jt(this),e=r.length,i=y(t,e);return new(N(r,r[wt]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,d((void 0===n?e:y(n,e))-i))}},Wt=function slice(t,n){return kt(this,dt.call(jt(this),t,n))},Bt=function set(t){jt(this);var n=It(arguments[1],1),r=this.length,e=S(t),i=d(e.length),o=0;if(i+n>r)throw V(Ot);for(;o255?255:255&e),i.v[p](r*n+i.o,e,Pt)},A=function(t,n){W(t,n,{get:function(){return P(this,n)},set:function(t){return M(this,n,t)},enumerable:!0})};x?(y=r(function(t,r,e,i){s(t,y,a,"_d");var o,u,c,f,l=0,v=0;if(w(r)){if(!(r instanceof H||(f=m(r))==J||f==Y))return _t in r?Rt(y,r):Lt.call(y,r);o=r,v=It(e,n);var p=r.byteLength;if(void 0===i){if(p%n)throw V(Ot);if(u=p-v,u<0)throw V(Ot)}else if(u=d(i)*n,u+v>p)throw V(Ot);c=u/n}else c=At(r,!0),u=c*n,o=new H(u);for(h(t,"_d",{b:o,o:v,l:u,e:c,v:new Z(o)});l>1,s=23===n?A(2,-24)-A(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for(t=M(t),t!=t||t===F?(i=t!=t?1:0,e=f):(e=I(j(t)/N),t*(o=A(2,-e))<1&&(e--,o*=2),t+=e+a>=1?s/o:s*A(2,1-a),t*o>=2&&(e++,o/=2),e+a>=f?(i=0,e=f):e+a>=1?(i=(t*o-1)*A(2,n),e+=a):(i=t*A(2,a-1)*A(2,n),e=0));n>=8;u[l++]=255&i,i/=256,n-=8);for(e=e<0;u[l++]=255&e,e/=256,c-=8);return u[--l]|=128*h,u},D=function(t,n,r){var e,i=8*r-n-1,o=(1<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;c>0;s=256*s+t[f],f--,c-=8);for(e=s&(1<<-c)-1,s>>=-c,c+=n;c>0;e=256*e+t[f],f--,c-=8);if(0===s)s=1-u;else{if(s===o)return e?NaN:a?-F:F;e+=A(2,n),s-=u}return(a?-1:1)*e*A(2,s-n)},W=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},B=function(t){return[255&t]},V=function(t){return[255&t,t>>8&255]},z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},K=function(t){return G(t,52,8)},J=function(t){return G(t,23,4)},Y=function(t,n,r){p(t[x],n,{get:function(){return this[r]}})},q=function(t,n,r,e){var i=+r,o=l(i);if(i!=o||o<0||o+n>t[C])throw O(w);var u=t[L]._b,c=o+t[U],f=u.slice(c,c+n);return e?f:f.reverse()},X=function(t,n,r,e,i,o){var u=+r,c=l(u);if(u!=c||c<0||c+n>t[C])throw O(w);for(var f=t[L]._b,a=c+t[U],s=e(+i),h=0;htt;)(H=Q[tt++])in S||c(S,H,P[H]);o||(Z.constructor=S)}var nt=new _(new S(2)),rt=_[x].setInt8;nt.setInt8(0,2147483648),nt.setInt8(1,2147483649),!nt.getInt8(0)&&nt.getInt8(1)||f(_[x],{setInt8:function setInt8(t,n){rt.call(this,t,n<<24>>24)},setUint8:function setUint8(t,n){rt.call(this,t,n<<24>>24)}},!0)}else S=function ArrayBuffer(t){var n=$(this,t);this._b=d.call(Array(n),0),this[C]=n},_=function DataView(t,n,r){s(this,_,b),s(t,S,b);var e=t[C],i=l(n);if(i<0||i>e)throw O("Wrong offset!");if(r=void 0===r?e-i:h(r),i+r>e)throw O(m);this[L]=t,this[U]=i,this[C]=r},i&&(Y(S,R,"_l"),Y(_,k,"_b"),Y(_,R,"_l"),Y(_,T,"_o")),f(_[x],{getInt8:function getInt8(t){return q(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return q(this,1,t)[0]},getInt16:function getInt16(t){var n=q(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=q(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return W(q(this,4,t,arguments[1]))},getUint32:function getUint32(t){return W(q(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return D(q(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return D(q(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){X(this,1,t,B,n)},setUint8:function setUint8(t,n){X(this,1,t,B,n)},setInt16:function setInt16(t,n){X(this,2,t,V,n,arguments[2])},setUint16:function setUint16(t,n){X(this,2,t,V,n,arguments[2])},setInt32:function setInt32(t,n){X(this,4,t,z,n,arguments[2])},setUint32:function setUint32(t,n){X(this,4,t,z,n,arguments[2])},setFloat32:function setFloat32(t,n){X(this,4,t,J,n,arguments[2])},setFloat64:function setFloat64(t,n){X(this,8,t,K,n,arguments[2])}});y(S,g),y(_,b),c(_[x],u.VIEW,!0),r[g]=S,r[b]=_},{106:106,108:108,113:113,28:28,34:34,38:38,40:40,58:58,6:6,67:67,72:72,86:86,9:9,92:92}],113:[function(t,n,r){for(var e,i=t(38),o=t(40),u=t(114),c=u("typed_array"),f=u("view"),a=!(!i.ArrayBuffer||!i.DataView),s=a,l=0,h=9,v="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l1?arguments[1]:void 0)}}),t(5)(o)},{12:12,32:32,5:5}],125:[function(t,n,r){"use strict";var e=t(32),i=t(12)(5),o="find",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{find:function find(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t(5)(o)},{12:12,32:32,5:5}],126:[function(t,n,r){"use strict";var e=t(32),i=t(12)(0),o=t(96)([].forEach,!0);e(e.P+e.F*!o,"Array",{forEach:function forEach(t){return i(this,t,arguments[1])}})},{12:12,32:32,96:96}],127:[function(t,n,r){"use strict";var e=t(25),i=t(32),o=t(109),u=t(51),c=t(46),f=t(108),a=t(24),s=t(118);i(i.S+i.F*!t(54)(function(t){Array.from(t)}),"Array",{from:function from(t){var n,r,i,l,h=o(t),v="function"==typeof this?this:Array,p=arguments.length,d=p>1?arguments[1]:void 0,y=void 0!==d,g=0,b=s(h);if(y&&(d=e(d,p>2?arguments[2]:void 0,2)),void 0==b||v==Array&&c(b))for(n=f(h.length),r=new v(n);n>g;g++)a(r,g,y?d(h[g],g):h[g]);else for(l=b.call(h),r=new v;!(i=l.next()).done;g++)a(r,g,y?u(l,d,[i.value,g],!0):i.value);return r.length=g,r}})},{108:108,109:109,118:118,24:24,25:25,32:32,46:46,51:51,54:54}],128:[function(t,n,r){"use strict";var e=t(32),i=t(11)(!1),o=[].indexOf,u=!!o&&1/[1].indexOf(1,-0)<0;e(e.P+e.F*(u||!t(96)(o)),"Array",{indexOf:function indexOf(t){return u?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},{11:11,32:32,96:96}],129:[function(t,n,r){var e=t(32);e(e.S,"Array",{isArray:t(47)})},{32:32,47:47}],130:[function(t,n,r){"use strict";var e=t(5),i=t(55),o=t(56),u=t(107);n.exports=t(53)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):"keys"==n?i(0,r):"values"==n?i(0,t[r]):i(0,[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},{107:107,5:5,53:53,55:55,56:56}],131:[function(t,n,r){"use strict";var e=t(32),i=t(107),o=[].join;e(e.P+e.F*(t(45)!=Object||!t(96)(o)),"Array",{join:function join(t){return o.call(i(this),void 0===t?",":t)}})},{107:107,32:32,45:45,96:96}],132:[function(t,n,r){"use strict";var e=t(32),i=t(107),o=t(106),u=t(108),c=[].lastIndexOf,f=!!c&&1/[1].lastIndexOf(1,-0)<0;e(e.P+e.F*(f||!t(96)(c)),"Array",{lastIndexOf:function lastIndexOf(t){if(f)return c.apply(this,arguments)||0;var n=i(this),r=u(n.length),e=r-1;for(arguments.length>1&&(e=Math.min(e,o(arguments[1]))),e<0&&(e=r+e);e>=0;e--)if(e in n&&n[e]===t)return e||0;return-1}})},{106:106,107:107,108:108,32:32,96:96}],133:[function(t,n,r){"use strict";var e=t(32),i=t(12)(1);e(e.P+e.F*!t(96)([].map,!0),"Array",{map:function map(t){return i(this,t,arguments[1])}})},{12:12,32:32,96:96}],134:[function(t,n,r){"use strict";var e=t(32),i=t(24);e(e.S+e.F*t(34)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var t=0,n=arguments.length,r=new("function"==typeof this?this:Array)(n);n>t;)i(r,t,arguments[t++]);return r.length=n,r}})},{24:24,32:32,34:34}],135:[function(t,n,r){"use strict";var e=t(32),i=t(13);e(e.P+e.F*!t(96)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(t){return i(this,t,arguments.length,arguments[1],!0)}})},{13:13,32:32,96:96}],136:[function(t,n,r){"use strict";var e=t(32),i=t(13);e(e.P+e.F*!t(96)([].reduce,!0),"Array",{reduce:function reduce(t){return i(this,t,arguments.length,arguments[1],!1)}})},{13:13,32:32,96:96}],137:[function(t,n,r){"use strict";var e=t(32),i=t(41),o=t(18),u=t(105),c=t(108),f=[].slice;e(e.P+e.F*t(34)(function(){i&&f.call(i)}),"Array",{slice:function slice(t,n){var r=c(this.length),e=o(this);if(n=void 0===n?r:n,"Array"==e)return f.call(this,t,n);for(var i=u(t,r),a=u(n,r),s=c(a-i),l=Array(s),h=0;h9?t:"0"+t};e(e.P+e.F*(i(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!i(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function toISOString(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":n>9999?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(r>99?r:"0"+u(r))+"Z"}})},{32:32,34:34}],143:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(110);e(e.P+e.F*t(34)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(t){var n=i(this),r=o(n);return"number"!=typeof r||isFinite(r)?n.toISOString():null}})},{109:109,110:110,32:32,34:34}],144:[function(t,n,r){var e=t(117)("toPrimitive"),i=Date.prototype;e in i||t(40)(i,e,t(26))},{117:117,26:26,40:40}],145:[function(t,n,r){var e=Date.prototype,i="Invalid Date",o="toString",u=e[o],c=e.getTime;new Date(NaN)+""!=i&&t(87)(e,o,function toString(){var t=c.call(this);return t===t?u.call(this):i})},{87:87}],146:[function(t,n,r){var e=t(32);e(e.P,"Function",{bind:t(16)})},{16:16,32:32}],147:[function(t,n,r){"use strict";var e=t(49),i=t(74),o=t(117)("hasInstance"),u=Function.prototype;o in u||t(67).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},{117:117,49:49,67:67,74:74}],148:[function(t,n,r){var e=t(67).f,i=t(85),o=t(39),u=Function.prototype,c=/^\s*function ([^ (]*)/,f="name",a=Object.isExtensible||function(){return!0};f in u||t(28)&&e(u,f,{configurable:!0,get:function(){try{var t=this,n=(""+t).match(c)[1];return o(t,f)||!a(t)||e(t,f,i(5,n)),n}catch(t){return""}}})},{28:28,39:39,67:67,85:85}],149:[function(t,n,r){"use strict";var e=t(19);n.exports=t(22)("Map",function(t){return function Map(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function get(t){var n=e.getEntry(this,t);return n&&n.v},set:function set(t,n){return e.def(this,0===t?0:t,n)}},e,!0)},{19:19,22:22}],150:[function(t,n,r){var e=t(32),i=t(60),o=Math.sqrt,u=Math.acosh;e(e.S+e.F*!(u&&710==Math.floor(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function acosh(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},{32:32,60:60}],151:[function(t,n,r){function asinh(t){return isFinite(t=+t)&&0!=t?t<0?-asinh(-t):Math.log(t+Math.sqrt(t*t+1)):t}var e=t(32),i=Math.asinh;e(e.S+e.F*!(i&&1/i(0)>0),"Math",{asinh:asinh})},{32:32}],152:[function(t,n,r){var e=t(32),i=Math.atanh;e(e.S+e.F*!(i&&1/i(-0)<0),"Math",{atanh:function atanh(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},{32:32}],153:[function(t,n,r){var e=t(32),i=t(61);e(e.S,"Math",{cbrt:function cbrt(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},{32:32,61:61}],154:[function(t,n,r){var e=t(32);e(e.S,"Math",{clz32:function clz32(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},{32:32}],155:[function(t,n,r){var e=t(32),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},{32:32}],156:[function(t,n,r){var e=t(32),i=t(59);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},{32:32,59:59}],157:[function(t,n,r){var e=t(32),i=t(61),o=Math.pow,u=o(2,-52),c=o(2,-23),f=o(2,127)*(2-c),a=o(2,-126),s=function(t){return t+1/u-1/u};e(e.S,"Math",{fround:function fround(t){var n,r,e=Math.abs(t),o=i(t);return ef||r!=r?o*(1/0):o*r)}})},{32:32,61:61}],158:[function(t,n,r){var e=t(32),i=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,o=0,u=0,c=arguments.length,f=0;u0?(e=r/f,o+=e*e):o+=r;return f===1/0?1/0:f*Math.sqrt(o)}})},{32:32}],159:[function(t,n,r){var e=t(32),i=Math.imul;e(e.S+e.F*t(34)(function(){return i(4294967295,5)!=-5||2!=i.length}),"Math",{imul:function imul(t,n){var r=65535,e=+t,i=+n,o=r&e,u=r&i;return 0|o*u+((r&e>>>16)*u+o*(r&i>>>16)<<16>>>0)}})},{32:32,34:34}],160:[function(t,n,r){var e=t(32);e(e.S,"Math",{log10:function log10(t){return Math.log(t)/Math.LN10}})},{32:32}],161:[function(t,n,r){var e=t(32);e(e.S,"Math",{log1p:t(60)})},{32:32,60:60}],162:[function(t,n,r){var e=t(32);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},{32:32}],163:[function(t,n,r){var e=t(32);e(e.S,"Math",{sign:t(61)})},{32:32,61:61}],164:[function(t,n,r){var e=t(32),i=t(59),o=Math.exp;e(e.S+e.F*t(34)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},{32:32,34:34,59:59}],165:[function(t,n,r){var e=t(32),i=t(59),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==1/0?1:r==1/0?-1:(n-r)/(o(t)+o(-t))}})},{32:32,59:59}],166:[function(t,n,r){var e=t(32);e(e.S,"Math",{trunc:function trunc(t){return(t>0?Math.floor:Math.ceil)(t)}})},{32:32}],167:[function(t,n,r){"use strict";var e=t(38),i=t(39),o=t(18),u=t(43),c=t(110),f=t(34),a=t(72).f,s=t(70).f,l=t(67).f,h=t(102).trim,v="Number",p=e[v],d=p,y=p.prototype,g=o(t(66)(y))==v,b="trim"in String.prototype,x=function(t){var n=c(t,!1);if("string"==typeof n&&n.length>2){n=b?n.trim():h(n,3);var r,e,i,o=n.charCodeAt(0);if(43===o||45===o){if(r=n.charCodeAt(2),88===r||120===r)return NaN}else if(48===o){switch(n.charCodeAt(1)){case 66:case 98:e=2,i=49;break;case 79:case 111:e=8,i=55;break;default:return+n}for(var u,f=n.slice(2),a=0,s=f.length;ai)return NaN;return parseInt(f,e)}}return+n};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function Number(t){var n=arguments.length<1?0:t,r=this;return r instanceof p&&(g?f(function(){y.valueOf.call(r)}):o(r)!=v)?u(new d(x(n)),r,p):x(n)};for(var m,w=t(28)?a(d):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;w.length>S;S++)i(d,m=w[S])&&!i(p,m)&&l(p,m,s(d,m));p.prototype=y,y.constructor=p,t(87)(e,v,p)}},{102:102,110:110,18:18,28:28,34:34,38:38,39:39,43:43,66:66,67:67,70:70,72:72,87:87}],168:[function(t,n,r){var e=t(32);e(e.S,"Number",{EPSILON:Math.pow(2,-52)})},{32:32}],169:[function(t,n,r){var e=t(32),i=t(38).isFinite;e(e.S,"Number",{isFinite:function isFinite(t){return"number"==typeof t&&i(t)}})},{32:32,38:38}],170:[function(t,n,r){var e=t(32);e(e.S,"Number",{isInteger:t(48)})},{32:32,48:48}],171:[function(t,n,r){var e=t(32);e(e.S,"Number",{isNaN:function isNaN(t){return t!=t}})},{32:32}],172:[function(t,n,r){var e=t(32),i=t(48),o=Math.abs;e(e.S,"Number",{isSafeInteger:function isSafeInteger(t){return i(t)&&o(t)<=9007199254740991}})},{32:32,48:48}],173:[function(t,n,r){var e=t(32);e(e.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{32:32}],174:[function(t,n,r){var e=t(32);e(e.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{32:32}],175:[function(t,n,r){var e=t(32),i=t(81);e(e.S+e.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},{32:32,81:81}],176:[function(t,n,r){var e=t(32),i=t(82);e(e.S+e.F*(Number.parseInt!=i),"Number",{parseInt:i})},{32:32,82:82}],177:[function(t,n,r){"use strict";var e=t(32),i=t(106),o=t(4),u=t(101),c=1..toFixed,f=Math.floor,a=[0,0,0,0,0,0],s="Number.toFixed: incorrect invocation!",l="0",h=function(t,n){for(var r=-1,e=n;++r<6;)e+=t*a[r],a[r]=e%1e7,e=f(e/1e7)},v=function(t){for(var n=6,r=0;--n>=0;)r+=a[n],a[n]=f(r/t),r=r%t*1e7},p=function(){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==a[t]){var r=String(a[t]);n=""===n?r:n+u.call(l,7-r.length)+r}return n},d=function(t,n,r){return 0===n?r:n%2===1?d(t,n-1,r*t):d(t*t,n/2,r)},y=function(t){for(var n=0,r=t;r>=4096;)n+=12,r/=4096;for(;r>=2;)n+=1,r/=2;return n};e(e.P+e.F*(!!c&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!t(34)(function(){c.call({})})),"Number",{toFixed:function toFixed(t){var n,r,e,c,f=o(this,s),a=i(t),g="",b=l;if(a<0||a>20)throw RangeError(s);if(f!=f)return"NaN";if(f<=-1e21||f>=1e21)return String(f);if(f<0&&(g="-",f=-f),f>1e-21)if(n=y(f*d(2,69,1))-69,r=n<0?f*d(2,-n,1):f/d(2,n,1),r*=4503599627370496,n=52-n,n>0){for(h(0,r),e=a;e>=7;)h(1e7,0),e-=7;for(h(d(10,e,1),0),e=n-1;e>=23;)v(1<<23),e-=23;v(1<0?(c=b.length,b=g+(c<=a?"0."+u.call(l,a-c)+b:b.slice(0,c-a)+"."+b.slice(c-a))):b=g+b,b}})},{101:101,106:106,32:32,34:34,4:4}],178:[function(t,n,r){"use strict";var e=t(32),i=t(34),o=t(4),u=1..toPrecision;e(e.P+e.F*(i(function(){return"1"!==u.call(1,void 0)})||!i(function(){u.call({})})),"Number",{toPrecision:function toPrecision(t){var n=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?u.call(n):u.call(n,t)}})},{32:32,34:34,4:4}],179:[function(t,n,r){var e=t(32);e(e.S+e.F,"Object",{assign:t(65)})},{32:32,65:65}],180:[function(t,n,r){var e=t(32);e(e.S,"Object",{create:t(66)})},{32:32,66:66}],181:[function(t,n,r){var e=t(32);e(e.S+e.F*!t(28),"Object",{defineProperties:t(68)})},{28:28,32:32,68:68}],182:[function(t,n,r){var e=t(32);e(e.S+e.F*!t(28),"Object",{defineProperty:t(67).f})},{28:28,32:32,67:67}],183:[function(t,n,r){var e=t(49),i=t(62).onFreeze;t(78)("freeze",function(t){return function freeze(n){return t&&e(n)?t(i(n)):n}})},{49:49,62:62,78:78}],184:[function(t,n,r){var e=t(107),i=t(70).f;t(78)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(t,n){return i(e(t),n)}})},{107:107,70:70,78:78}],185:[function(t,n,r){t(78)("getOwnPropertyNames",function(){return t(71).f})},{71:71,78:78}],186:[function(t,n,r){var e=t(109),i=t(74);t(78)("getPrototypeOf",function(){return function getPrototypeOf(t){return i(e(t))}})},{109:109,74:74,78:78}],187:[function(t,n,r){var e=t(49);t(78)("isExtensible",function(t){return function isExtensible(n){return!!e(n)&&(!t||t(n))}})},{49:49,78:78}],188:[function(t,n,r){var e=t(49);t(78)("isFrozen",function(t){return function isFrozen(n){return!e(n)||!!t&&t(n)}})},{49:49,78:78}],189:[function(t,n,r){var e=t(49);t(78)("isSealed",function(t){return function isSealed(n){return!e(n)||!!t&&t(n)}})},{49:49,78:78}],190:[function(t,n,r){var e=t(32);e(e.S,"Object",{is:t(89)})},{32:32,89:89}],191:[function(t,n,r){var e=t(109),i=t(76);t(78)("keys",function(){return function keys(t){return i(e(t))}})},{109:109,76:76,78:78}],192:[function(t,n,r){var e=t(49),i=t(62).onFreeze;t(78)("preventExtensions",function(t){return function preventExtensions(n){return t&&e(n)?t(i(n)):n}})},{49:49,62:62,78:78}],193:[function(t,n,r){var e=t(49),i=t(62).onFreeze;t(78)("seal",function(t){return function seal(n){return t&&e(n)?t(i(n)):n}})},{49:49,62:62,78:78}],194:[function(t,n,r){var e=t(32);e(e.S,"Object",{setPrototypeOf:t(90).set})},{32:32,90:90}],195:[function(t,n,r){"use strict";var e=t(17),i={};i[t(117)("toStringTag")]="z",i+""!="[object z]"&&t(87)(Object.prototype,"toString",function toString(){return"[object "+e(this)+"]"},!0)},{117:117,17:17,87:87}],196:[function(t,n,r){var e=t(32),i=t(81);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},{32:32,81:81}],197:[function(t,n,r){var e=t(32),i=t(82);e(e.G+e.F*(parseInt!=i),{parseInt:i})},{32:32,82:82}],198:[function(t,n,r){"use strict";var e,i,o,u=t(58),c=t(38),f=t(25),a=t(17),s=t(32),l=t(49),h=t(3),v=t(6),p=t(37),d=t(95),y=t(104).set,g=t(64)(),b="Promise",x=c.TypeError,m=c.process,w=c[b],m=c.process,S="process"==a(m),_=function(){},E=!!function(){try{var n=w.resolve(1),r=(n.constructor={})[t(117)("species")]=function(t){t(_,_)};return(S||"function"==typeof PromiseRejectionEvent)&&n.then(_)instanceof r}catch(t){}}(),O=function(t,n){return t===n||t===w&&n===o},F=function(t){var n;return!(!l(t)||"function"!=typeof(n=t.then))&&n},P=function(t){return O(w,t)?new M(t):new i(t)},M=i=function(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw x("Bad Promise constructor");n=t,r=e}),this.resolve=h(n),this.reject=h(r)},A=function(t){try{t()}catch(t){return{error:t}}},I=function(t,n){if(!t._n){t._n=!0;var r=t._c;g(function(){for(var e=t._v,i=1==t._s,o=0,u=function(n){var r,o,u=i?n.ok:n.fail,c=n.resolve,f=n.reject,a=n.domain;try{u?(i||(2==t._h&&k(t),t._h=1),u===!0?r=e:(a&&a.enter(),r=u(e),a&&a.exit()),r===n.promise?f(x("Promise-chain cycle")):(o=F(r))?o.call(r,c,f):c(r)):f(e)}catch(t){f(t)}};r.length>o;)u(r[o++]);t._c=[],t._n=!1,n&&!t._h&&j(t)})}},j=function(t){y.call(c,function(){var n,r,e,i=t._v;if(N(t)&&(n=A(function(){S?m.emit("unhandledRejection",i,t):(r=c.onunhandledrejection)?r({promise:t,reason:i}):(e=c.console)&&e.error&&e.error("Unhandled promise rejection",i)}),t._h=S||N(t)?2:1),t._a=void 0,n)throw n.error})},N=function(t){if(1==t._h)return!1;for(var n,r=t._a||t._c,e=0;r.length>e;)if(n=r[e++],n.fail||!N(n.promise))return!1;return!0},k=function(t){y.call(c,function(){var n;S?m.emit("rejectionHandled",t):(n=c.onrejectionhandled)&&n({promise:t,reason:t._v})})},R=function(t){var n=this;n._d||(n._d=!0,n=n._w||n,n._v=t,n._s=2,n._a||(n._a=n._c.slice()),I(n,!0))},T=function(t){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw x("Promise can't be resolved itself");(n=F(t))?g(function(){var e={_w:r,_d:!1};try{n.call(t,f(T,e,1),f(R,e,1))}catch(t){R.call(e,t)}}):(r._v=t,r._s=1,I(r,!1))}catch(t){R.call({_w:r,_d:!1},t)}}};E||(w=function Promise(t){v(this,w,b,"_h"),h(t),e.call(this);try{t(f(T,this,1),f(R,this,1))}catch(t){R.call(this,t)}},e=function Promise(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=t(86)(w.prototype,{then:function then(t,n){var r=P(d(this,w));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=S?m.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&I(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),M=function(){var t=new e;this.promise=t,this.resolve=f(T,t,1),this.reject=f(R,t,1)}),s(s.G+s.W+s.F*!E,{Promise:w}),t(92)(w,b),t(91)(b),o=t(23)[b],s(s.S+s.F*!E,b,{reject:function reject(t){var n=P(this),r=n.reject;return r(t),n.promise}}),s(s.S+s.F*(u||!E),b,{resolve:function resolve(t){if(t instanceof w&&O(t.constructor,this))return t;var n=P(this),r=n.resolve;return r(t),n.promise}}),s(s.S+s.F*!(E&&t(54)(function(t){w.all(t).catch(_)})),b,{all:function all(t){var n=this,r=P(n),e=r.resolve,i=r.reject,o=A(function(){var r=[],o=0,u=1;p(t,!1,function(t){var c=o++,f=!1;r.push(void 0),u++,n.resolve(t).then(function(t){f||(f=!0,r[c]=t,--u||e(r))},i)}),--u||e(r)});return o&&i(o.error),r.promise},race:function race(t){var n=this,r=P(n),e=r.reject,i=A(function(){p(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i&&e(i.error),r.promise}})},{104:104,117:117,17:17,23:23,25:25,3:3,32:32,37:37,38:38,49:49,54:54,58:58,6:6,64:64,86:86,91:91,92:92,95:95}],199:[function(t,n,r){var e=t(32),i=t(3),o=t(7),u=(t(38).Reflect||{}).apply,c=Function.apply;e(e.S+e.F*!t(34)(function(){u(function(){})}),"Reflect",{apply:function apply(t,n,r){var e=i(t),f=o(r);return u?u(e,n,f):c.call(e,n,f)}})},{3:3,32:32,34:34,38:38,7:7}],200:[function(t,n,r){var e=t(32),i=t(66),o=t(3),u=t(7),c=t(49),f=t(34),a=t(16),s=(t(38).Reflect||{}).construct,l=f(function(){function F(){}return!(s(function(){},[],F)instanceof F)}),h=!f(function(){s(function(){})});e(e.S+e.F*(l||h),"Reflect",{construct:function construct(t,n){o(t),u(n);var r=arguments.length<3?t:o(arguments[2]);if(h&&!l)return s(t,n,r);if(t==r){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var e=[null];return e.push.apply(e,n),new(a.apply(t,e))}var f=r.prototype,v=i(c(f)?f:Object.prototype),p=Function.apply.call(t,v,n);return c(p)?p:v}})},{16:16,3:3,32:32,34:34,38:38,49:49,66:66,7:7}],201:[function(t,n,r){var e=t(67),i=t(32),o=t(7),u=t(110);i(i.S+i.F*t(34)(function(){Reflect.defineProperty(e.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(t,n,r){o(t),n=u(n,!0),o(r);try{return e.f(t,n,r),!0}catch(t){return!1}}})},{110:110,32:32,34:34,67:67,7:7}],202:[function(t,n,r){var e=t(32),i=t(70).f,o=t(7);e(e.S,"Reflect",{deleteProperty:function deleteProperty(t,n){var r=i(o(t),n);return!(r&&!r.configurable)&&delete t[n]}})},{32:32,7:7,70:70}],203:[function(t,n,r){"use strict";var e=t(32),i=t(7),o=function(t){this._t=i(t),this._i=0;var n,r=this._k=[];for(n in t)r.push(n)};t(52)(o,"Object",function(){var t,n=this,r=n._k;do if(n._i>=r.length)return{value:void 0,done:!0};while(!((t=r[n._i++])in n._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(t){return new o(t)}})},{32:32,52:52,7:7}],204:[function(t,n,r){var e=t(70),i=t(32),o=t(7);i(i.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,n){return e.f(o(t),n)}})},{32:32,7:7,70:70}],205:[function(t,n,r){var e=t(32),i=t(74),o=t(7);e(e.S,"Reflect",{getPrototypeOf:function getPrototypeOf(t){return i(o(t))}})},{32:32,7:7,74:74}],206:[function(t,n,r){function get(t,n){var r,u,a=arguments.length<3?t:arguments[2];return f(t)===a?t[n]:(r=e.f(t,n))?o(r,"value")?r.value:void 0!==r.get?r.get.call(a):void 0:c(u=i(t))?get(u,n,a):void 0}var e=t(70),i=t(74),o=t(39),u=t(32),c=t(49),f=t(7);u(u.S,"Reflect",{get:get})},{32:32,39:39,49:49,7:7,70:70,74:74}],207:[function(t,n,r){var e=t(32);e(e.S,"Reflect",{has:function has(t,n){return n in t; +}})},{32:32}],208:[function(t,n,r){var e=t(32),i=t(7),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function isExtensible(t){return i(t),!o||o(t)}})},{32:32,7:7}],209:[function(t,n,r){var e=t(32);e(e.S,"Reflect",{ownKeys:t(80)})},{32:32,80:80}],210:[function(t,n,r){var e=t(32),i=t(7),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function preventExtensions(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},{32:32,7:7}],211:[function(t,n,r){var e=t(32),i=t(90);i&&e(e.S,"Reflect",{setPrototypeOf:function setPrototypeOf(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(t){return!1}}})},{32:32,90:90}],212:[function(t,n,r){function set(t,n,r){var c,l,h=arguments.length<4?t:arguments[3],v=i.f(a(t),n);if(!v){if(s(l=o(t)))return set(l,n,r,h);v=f(0)}return u(v,"value")?!(v.writable===!1||!s(h))&&(c=i.f(h,n)||f(0),c.value=r,e.f(h,n,c),!0):void 0!==v.set&&(v.set.call(h,r),!0)}var e=t(67),i=t(70),o=t(74),u=t(39),c=t(32),f=t(85),a=t(7),s=t(49);c(c.S,"Reflect",{set:set})},{32:32,39:39,49:49,67:67,7:7,70:70,74:74,85:85}],213:[function(t,n,r){var e=t(38),i=t(43),o=t(67).f,u=t(72).f,c=t(50),f=t(36),a=e.RegExp,s=a,l=a.prototype,h=/a/g,v=/a/g,p=new a(h)!==h;if(t(28)&&(!p||t(34)(function(){return v[t(117)("match")]=!1,a(h)!=h||a(v)==v||"/a/i"!=a(h,"i")}))){a=function RegExp(t,n){var r=this instanceof a,e=c(t),o=void 0===n;return!r&&e&&t.constructor===a&&o?t:i(p?new s(e&&!o?t.source:t,n):s((e=t instanceof a)?t.source:t,e&&o?f.call(t):n),r?this:l,a)};for(var d=(function(t){t in a||o(a,t,{configurable:!0,get:function(){return s[t]},set:function(n){s[t]=n}})}),y=u(s),g=0;y.length>g;)d(y[g++]);l.constructor=a,a.prototype=l,t(87)(e,"RegExp",a)}t(91)("RegExp")},{117:117,28:28,34:34,36:36,38:38,43:43,50:50,67:67,72:72,87:87,91:91}],214:[function(t,n,r){t(28)&&"g"!=/./g.flags&&t(67).f(RegExp.prototype,"flags",{configurable:!0,get:t(36)})},{28:28,36:36,67:67}],215:[function(t,n,r){t(35)("match",1,function(t,n,r){return[function match(r){"use strict";var e=t(this),i=void 0==r?void 0:r[n];return void 0!==i?i.call(r,e):new RegExp(r)[n](String(e))},r]})},{35:35}],216:[function(t,n,r){t(35)("replace",2,function(t,n,r){return[function replace(e,i){"use strict";var o=t(this),u=void 0==e?void 0:e[n];return void 0!==u?u.call(e,o,i):r.call(String(o),e,i)},r]})},{35:35}],217:[function(t,n,r){t(35)("search",1,function(t,n,r){return[function search(r){"use strict";var e=t(this),i=void 0==r?void 0:r[n];return void 0!==i?i.call(r,e):new RegExp(r)[n](String(e))},r]})},{35:35}],218:[function(t,n,r){t(35)("split",2,function(n,r,e){"use strict";var i=t(50),o=e,u=[].push,c="split",f="length",a="lastIndex";if("c"=="abbc"[c](/(b)*/)[1]||4!="test"[c](/(?:)/,-1)[f]||2!="ab"[c](/(?:ab)*/)[f]||4!="."[c](/(.?)(.?)/)[f]||"."[c](/()()/)[f]>1||""[c](/.?/)[f]){var s=void 0===/()??/.exec("")[1];e=function(t,n){var r=String(this);if(void 0===t&&0===n)return[];if(!i(t))return o.call(r,t,n);var e,c,l,h,v,p=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),y=0,g=void 0===n?4294967295:n>>>0,b=new RegExp(t.source,d+"g");for(s||(e=new RegExp("^"+b.source+"$(?!\\s)",d));(c=b.exec(r))&&(l=c.index+c[0][f],!(l>y&&(p.push(r.slice(y,c.index)),!s&&c[f]>1&&c[0].replace(e,function(){for(v=1;v1&&c.index=g)));)b[a]===c.index&&b[a]++;return y===r[f]?!h&&b.test("")||p.push(""):p.push(r.slice(y)),p[f]>g?p.slice(0,g):p}}else"0"[c](void 0,0)[f]&&(e=function(t,n){return void 0===t&&0===n?[]:o.call(this,t,n)});return[function split(t,i){var o=n(this),u=void 0==t?void 0:t[r];return void 0!==u?u.call(t,o,i):e.call(String(o),t,i)},e]})},{35:35,50:50}],219:[function(t,n,r){"use strict";t(214);var e=t(7),i=t(36),o=t(28),u="toString",c=/./[u],f=function(n){t(87)(RegExp.prototype,u,n,!0)};t(34)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?f(function toString(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):c.name!=u&&f(function toString(){return c.call(this)})},{214:214,28:28,34:34,36:36,7:7,87:87}],220:[function(t,n,r){"use strict";var e=t(19);n.exports=t(22)("Set",function(t){return function Set(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function add(t){return e.def(this,t=0===t?0:t,t)}},e)},{19:19,22:22}],221:[function(t,n,r){"use strict";t(99)("anchor",function(t){return function anchor(n){return t(this,"a","name",n)}})},{99:99}],222:[function(t,n,r){"use strict";t(99)("big",function(t){return function big(){return t(this,"big","","")}})},{99:99}],223:[function(t,n,r){"use strict";t(99)("blink",function(t){return function blink(){return t(this,"blink","","")}})},{99:99}],224:[function(t,n,r){"use strict";t(99)("bold",function(t){return function bold(){return t(this,"b","","")}})},{99:99}],225:[function(t,n,r){"use strict";var e=t(32),i=t(97)(!1);e(e.P,"String",{codePointAt:function codePointAt(t){return i(this,t)}})},{32:32,97:97}],226:[function(t,n,r){"use strict";var e=t(32),i=t(108),o=t(98),u="endsWith",c=""[u];e(e.P+e.F*t(33)(u),"String",{endsWith:function endsWith(t){var n=o(this,t,u),r=arguments.length>1?arguments[1]:void 0,e=i(n.length),f=void 0===r?e:Math.min(i(r),e),a=String(t);return c?c.call(n,a,f):n.slice(f-a.length,f)===a}})},{108:108,32:32,33:33,98:98}],227:[function(t,n,r){"use strict";t(99)("fixed",function(t){return function fixed(){return t(this,"tt","","")}})},{99:99}],228:[function(t,n,r){"use strict";t(99)("fontcolor",function(t){return function fontcolor(n){return t(this,"font","color",n)}})},{99:99}],229:[function(t,n,r){"use strict";t(99)("fontsize",function(t){return function fontsize(n){return t(this,"font","size",n)}})},{99:99}],230:[function(t,n,r){var e=t(32),i=t(105),o=String.fromCharCode,u=String.fromCodePoint;e(e.S+e.F*(!!u&&1!=u.length),"String",{fromCodePoint:function fromCodePoint(t){for(var n,r=[],e=arguments.length,u=0;e>u;){if(n=+arguments[u++],i(n,1114111)!==n)throw RangeError(n+" is not a valid code point");r.push(n<65536?o(n):o(((n-=65536)>>10)+55296,n%1024+56320))}return r.join("")}})},{105:105,32:32}],231:[function(t,n,r){"use strict";var e=t(32),i=t(98),o="includes";e(e.P+e.F*t(33)(o),"String",{includes:function includes(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},{32:32,33:33,98:98}],232:[function(t,n,r){"use strict";t(99)("italics",function(t){return function italics(){return t(this,"i","","")}})},{99:99}],233:[function(t,n,r){"use strict";var e=t(97)(!0);t(53)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},{53:53,97:97}],234:[function(t,n,r){"use strict";t(99)("link",function(t){return function link(n){return t(this,"a","href",n)}})},{99:99}],235:[function(t,n,r){var e=t(32),i=t(107),o=t(108);e(e.S,"String",{raw:function raw(t){for(var n=i(t.raw),r=o(n.length),e=arguments.length,u=[],c=0;r>c;)u.push(String(n[c++])),c1?arguments[1]:void 0,n.length)),e=String(t);return c?c.call(n,e,r):n.slice(r,r+e.length)===e}})},{108:108,32:32,33:33,98:98}],239:[function(t,n,r){"use strict";t(99)("strike",function(t){return function strike(){return t(this,"strike","","")}})},{99:99}],240:[function(t,n,r){"use strict";t(99)("sub",function(t){return function sub(){return t(this,"sub","","")}})},{99:99}],241:[function(t,n,r){"use strict";t(99)("sup",function(t){return function sup(){return t(this,"sup","","")}})},{99:99}],242:[function(t,n,r){"use strict";t(102)("trim",function(t){return function trim(){return t(this,3)}})},{102:102}],243:[function(t,n,r){"use strict";var e=t(38),i=t(39),o=t(28),u=t(32),c=t(87),f=t(62).KEY,a=t(34),s=t(94),l=t(92),h=t(114),v=t(117),p=t(116),d=t(115),y=t(57),g=t(31),b=t(47),x=t(7),m=t(107),w=t(110),S=t(85),_=t(66),E=t(71),O=t(70),F=t(67),P=t(76),M=O.f,A=F.f,I=E.f,j=e.Symbol,N=e.JSON,k=N&&N.stringify,R="prototype",T=v("_hidden"),L=v("toPrimitive"),C={}.propertyIsEnumerable,U=s("symbol-registry"),G=s("symbols"),D=s("op-symbols"),W=Object[R],B="function"==typeof j,V=e.QObject,z=!V||!V[R]||!V[R].findChild,K=o&&a(function(){return 7!=_(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=M(W,n);e&&delete W[n],A(t,n,r),e&&t!==W&&A(W,n,e)}:A,J=function(t){var n=G[t]=_(j[R]);return n._k=t,n},Y=B&&"symbol"==typeof j.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof j},q=function defineProperty(t,n,r){return t===W&&q(D,n,r),x(t),n=w(n,!0),x(r),i(G,n)?(r.enumerable?(i(t,T)&&t[T][n]&&(t[T][n]=!1),r=_(r,{enumerable:S(0,!1)})):(i(t,T)||A(t,T,S(1,{})),t[T][n]=!0),K(t,n,r)):A(t,n,r)},X=function defineProperties(t,n){x(t);for(var r,e=g(n=m(n)),i=0,o=e.length;o>i;)q(t,r=e[i++],n[r]);return t},$=function create(t,n){return void 0===n?_(t):X(_(t),n)},H=function propertyIsEnumerable(t){var n=C.call(this,t=w(t,!0));return!(this===W&&i(G,t)&&!i(D,t))&&(!(n||!i(this,t)||!i(G,t)||i(this,T)&&this[T][t])||n)},Z=function getOwnPropertyDescriptor(t,n){if(t=m(t),n=w(n,!0),t!==W||!i(G,n)||i(D,n)){var r=M(t,n);return!r||!i(G,n)||i(t,T)&&t[T][n]||(r.enumerable=!0),r}},Q=function getOwnPropertyNames(t){for(var n,r=I(m(t)),e=[],o=0;r.length>o;)i(G,n=r[o++])||n==T||n==f||e.push(n);return e},tt=function getOwnPropertySymbols(t){for(var n,r=t===W,e=I(r?D:m(t)),o=[],u=0;e.length>u;)!i(G,n=e[u++])||r&&!i(W,n)||o.push(G[n]);return o};B||(j=function Symbol(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),n=function(r){this===W&&n.call(D,r),i(this,T)&&i(this[T],t)&&(this[T][t]=!1),K(this,t,S(1,r))};return o&&z&&K(W,t,{configurable:!0,set:n}),J(t)},c(j[R],"toString",function toString(){return this._k}),O.f=Z,F.f=q,t(72).f=E.f=Q,t(77).f=H,t(73).f=tt,o&&!t(58)&&c(W,"propertyIsEnumerable",H,!0),p.f=function(t){return J(v(t))}),u(u.G+u.W+u.F*!B,{Symbol:j});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)v(nt[rt++]);for(var nt=P(v.store),rt=0;nt.length>rt;)d(nt[rt++]);u(u.S+u.F*!B,"Symbol",{for:function(t){return i(U,t+="")?U[t]:U[t]=j(t)},keyFor:function keyFor(t){if(Y(t))return y(U,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){z=!0},useSimple:function(){z=!1}}),u(u.S+u.F*!B,"Object",{create:$,defineProperty:q,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:tt}),N&&u(u.S+u.F*(!B||a(function(){var t=j();return"[null]"!=k([t])||"{}"!=k({a:t})||"{}"!=k(Object(t))})),"JSON",{stringify:function stringify(t){if(void 0!==t&&!Y(t)){for(var n,r,e=[t],i=1;arguments.length>i;)e.push(arguments[i++]);return n=e[1],"function"==typeof n&&(r=n),!r&&b(n)||(n=function(t,n){if(r&&(n=r.call(this,t,n)),!Y(n))return n}),e[1]=n,k.apply(N,e)}}}),j[R][L]||t(40)(j[R],L,j[R].valueOf),l(j,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},{107:107,110:110,114:114,115:115,116:116,117:117,28:28,31:31,32:32,34:34,38:38,39:39,40:40,47:47,57:57,58:58,62:62,66:66,67:67,7:7,70:70,71:71,72:72,73:73,76:76,77:77,85:85,87:87,92:92,94:94}],244:[function(t,n,r){"use strict";var e=t(32),i=t(113),o=t(112),u=t(7),c=t(105),f=t(108),a=t(49),s=t(38).ArrayBuffer,l=t(95),h=o.ArrayBuffer,v=o.DataView,p=i.ABV&&s.isView,d=h.prototype.slice,y=i.VIEW,g="ArrayBuffer";e(e.G+e.W+e.F*(s!==h),{ArrayBuffer:h}),e(e.S+e.F*!i.CONSTR,g,{isView:function isView(t){return p&&p(t)||a(t)&&y in t}}),e(e.P+e.U+e.F*t(34)(function(){return!new h(2).slice(1,void 0).byteLength}),g,{slice:function slice(t,n){if(void 0!==d&&void 0===n)return d.call(u(this),t);for(var r=u(this).byteLength,e=c(t,r),i=c(void 0===n?r:n,r),o=new(l(this,h))(f(i-e)),a=new v(this),s=new v(o),p=0;e0?arguments[0]:void 0)}},d={get:function get(t){if(a(t)){var n=s(t);return n===!0?h(this).get(t):n?n[this._i]:void 0}},set:function set(t,n){return f.def(this,t,n)}},y=n.exports=t(22)("WeakMap",p,d,f,!0,!0);7!=(new y).set((Object.freeze||Object)(v),7).get(v)&&(e=f.getConstructor(p),c(e.prototype,d),u.NEED=!0,i(["delete","has","get","set"],function(t){var n=y.prototype,r=n[t];o(n,t,function(n,i){if(a(n)&&!l(n)){this._f||(this._f=new e);var o=this._f[t](n,i);return"set"==t?this:o}return r.call(this,n,i)})}))},{12:12,21:21,22:22,49:49,62:62,65:65,87:87}],256:[function(t,n,r){"use strict";var e=t(21);t(22)("WeakSet",function(t){return function WeakSet(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function add(t){return e.def(this,t,!0)}},e,!1,!0)},{21:21,22:22}],257:[function(t,n,r){"use strict";var e=t(32),i=t(11)(!0);e(e.P,"Array",{includes:function includes(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t(5)("includes")},{11:11,32:32,5:5}],258:[function(t,n,r){var e=t(32),i=t(64)(),o=t(38).process,u="process"==t(18)(o);e(e.G,{asap:function asap(t){var n=u&&o.domain;i(n?n.bind(t):t)}})},{18:18,32:32,38:38,64:64}],259:[function(t,n,r){var e=t(32),i=t(18);e(e.S,"Error",{isError:function isError(t){return"Error"===i(t)}})},{18:18,32:32}],260:[function(t,n,r){var e=t(32);e(e.P+e.R,"Map",{toJSON:t(20)("Map")})},{20:20,32:32}],261:[function(t,n,r){var e=t(32);e(e.S,"Math",{iaddh:function iaddh(t,n,r,e){var i=t>>>0,o=n>>>0,u=r>>>0;return o+(e>>>0)+((i&u|(i|u)&~(i+u>>>0))>>>31)|0}})},{32:32}],262:[function(t,n,r){var e=t(32);e(e.S,"Math",{imulh:function imulh(t,n){var r=65535,e=+t,i=+n,o=e&r,u=i&r,c=e>>16,f=i>>16,a=(c*u>>>0)+(o*u>>>16);return c*f+(a>>16)+((o*f>>>0)+(a&r)>>16)}})},{32:32}],263:[function(t,n,r){var e=t(32);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=n>>>0,u=r>>>0;return o-(e>>>0)-((~i&u|~(i^u)&i-u>>>0)>>>31)|0}})},{32:32}],264:[function(t,n,r){var e=t(32);e(e.S,"Math",{umulh:function umulh(t,n){var r=65535,e=+t,i=+n,o=e&r,u=i&r,c=e>>>16,f=i>>>16,a=(c*u>>>0)+(o*u>>>16);return c*f+(a>>>16)+((o*f>>>0)+(a&r)>>>16)}})},{32:32}],265:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(3),u=t(67);t(28)&&e(e.P+t(69),"Object",{__defineGetter__:function __defineGetter__(t,n){u.f(i(this),t,{get:o(n),enumerable:!0,configurable:!0})}})},{109:109,28:28,3:3,32:32,67:67,69:69}],266:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(3),u=t(67);t(28)&&e(e.P+t(69),"Object",{__defineSetter__:function __defineSetter__(t,n){u.f(i(this),t,{set:o(n),enumerable:!0,configurable:!0})}})},{109:109,28:28,3:3,32:32,67:67,69:69}],267:[function(t,n,r){var e=t(32),i=t(79)(!0);e(e.S,"Object",{entries:function entries(t){return i(t)}})},{32:32,79:79}],268:[function(t,n,r){var e=t(32),i=t(80),o=t(107),u=t(70),c=t(24);e(e.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(t){for(var n,r=o(t),e=u.f,f=i(r),a={},s=0;f.length>s;)c(a,n=f[s++],e(r,n));return a}})},{107:107,24:24,32:32,70:70,80:80}],269:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(110),u=t(74),c=t(70).f;t(28)&&e(e.P+t(69),"Object",{__lookupGetter__:function __lookupGetter__(t){var n,r=i(this),e=o(t,!0);do if(n=c(r,e))return n.get;while(r=u(r))}})},{109:109,110:110,28:28,32:32,69:69,70:70,74:74}],270:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(110),u=t(74),c=t(70).f;t(28)&&e(e.P+t(69),"Object",{__lookupSetter__:function __lookupSetter__(t){var n,r=i(this),e=o(t,!0);do if(n=c(r,e))return n.set;while(r=u(r))}})},{109:109,110:110,28:28,32:32,69:69,70:70,74:74}],271:[function(t,n,r){var e=t(32),i=t(79)(!1);e(e.S,"Object",{values:function values(t){return i(t)}})},{32:32,79:79}],272:[function(t,n,r){"use strict";var e=t(32),i=t(38),o=t(23),u=t(64)(),c=t(117)("observable"),f=t(3),a=t(7),s=t(6),l=t(86),h=t(40),v=t(37),p=v.RETURN,d=function(t){return null==t?void 0:f(t)},y=function(t){var n=t._c;n&&(t._c=void 0,n())},g=function(t){return void 0===t._o},b=function(t){g(t)||(t._o=void 0,y(t))},x=function(t,n){a(t),this._c=void 0,this._o=t,t=new m(this);try{var r=n(t),e=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){e.unsubscribe()}:f(r),this._c=r)}catch(n){return void t.error(n)}g(this)&&y(this)};x.prototype=l({},{unsubscribe:function unsubscribe(){b(this)}});var m=function(t){this._s=t};m.prototype=l({},{next:function next(t){var n=this._s;if(!g(n)){var r=n._o;try{var e=d(r.next);if(e)return e.call(r,t)}catch(t){try{b(n)}finally{throw t}}}},error:function error(t){var n=this._s;if(g(n))throw t;var r=n._o;n._o=void 0;try{var e=d(r.error);if(!e)throw t;t=e.call(r,t)}catch(t){try{y(n)}finally{throw t}}return y(n),t},complete:function complete(t){var n=this._s;if(!g(n)){var r=n._o;n._o=void 0;try{var e=d(r.complete);t=e?e.call(r,t):void 0}catch(t){try{y(n)}finally{throw t}}return y(n),t}}});var w=function Observable(t){s(this,w,"Observable","_f")._f=f(t)};l(w.prototype,{subscribe:function subscribe(t){return new x(t,this._f)},forEach:function forEach(t){var n=this;return new(o.Promise||i.Promise)(function(r,e){f(t);var i=n.subscribe({next:function(n){try{return t(n)}catch(t){e(t),i.unsubscribe()}},error:e,complete:r})})}}),l(w,{from:function from(t){var n="function"==typeof this?this:w,r=d(a(t)[c]);if(r){var e=a(r.call(t));return e.constructor===n?e:new n(function(t){return e.subscribe(t)})}return new n(function(n){var r=!1;return u(function(){if(!r){try{if(v(t,!1,function(t){if(n.next(t),r)return p})===p)return}catch(t){if(r)throw t;return void n.error(t)}n.complete()}}),function(){r=!0}})},of:function of(){for(var t=0,n=arguments.length,r=Array(n);t1?arguments[1]:void 0,!1)}})},{100:100,32:32}],286:[function(t,n,r){"use strict";var e=t(32),i=t(100);e(e.P,"String",{padStart:function padStart(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},{100:100,32:32}],287:[function(t,n,r){"use strict";t(102)("trimLeft",function(t){return function trimLeft(){return t(this,1)}},"trimStart")},{102:102}],288:[function(t,n,r){"use strict";t(102)("trimRight",function(t){return function trimRight(){return t(this,2)}},"trimEnd")},{102:102}],289:[function(t,n,r){t(115)("asyncIterator")},{115:115}],290:[function(t,n,r){t(115)("observable")},{115:115}],291:[function(t,n,r){var e=t(32);e(e.S,"System",{global:t(38)})},{32:32,38:38}],292:[function(t,n,r){for(var e=t(130),i=t(87),o=t(38),u=t(40),c=t(56),f=t(117),a=f("iterator"),s=f("toStringTag"),l=c.Array,h=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],v=0;v<5;v++){var p,d=h[v],y=o[d],g=y&&y.prototype;if(g){g[a]||u(g,a,l),g[s]||u(g,s,d),c[d]=l;for(p in e)g[p]||i(g,p,e[p],!0)}}},{117:117,130:130,38:38,40:40,56:56,87:87}],293:[function(t,n,r){var e=t(32),i=t(104);e(e.G+e.B,{setImmediate:i.set,clearImmediate:i.clear})},{104:104,32:32}],294:[function(t,n,r){var e=t(38),i=t(32),o=t(44),u=t(83),c=e.navigator,f=!!c&&/MSIE .\./.test(c.userAgent),a=function(t){return f?function(n,r){return t(o(u,[].slice.call(arguments,2),"function"==typeof n?n:Function(n)),r)}:t};i(i.G+i.B+i.F*f,{setTimeout:a(e.setTimeout),setInterval:a(e.setInterval)})},{32:32,38:38,44:44,83:83}],295:[function(t,n,r){t(243),t(180),t(182),t(181),t(184),t(186),t(191),t(185),t(183),t(193),t(192),t(188),t(189),t(187),t(179),t(190),t(194),t(195),t(146),t(148),t(147),t(197),t(196),t(167),t(177),t(178),t(168),t(169),t(170),t(171),t(172),t(173),t(174),t(175),t(176),t(150),t(151),t(152),t(153),t(154),t(155),t(156),t(157),t(158),t(159),t(160),t(161),t(162),t(163),t(164),t(165),t(166),t(230),t(235),t(242),t(233),t(225),t(226),t(231),t(236),t(238),t(221),t(222),t(223),t(224),t(227),t(228),t(229),t(232),t(234),t(237),t(239),t(240),t(241),t(141),t(143),t(142),t(145),t(144),t(129),t(127),t(134),t(131),t(137),t(139),t(126),t(133),t(123),t(138),t(121),t(136),t(135),t(128),t(132),t(120),t(122),t(125),t(124),t(140),t(130),t(213),t(219),t(214),t(215),t(216),t(217),t(218),t(198),t(149),t(220),t(255),t(256),t(244),t(245),t(250),t(253),t(254),t(248),t(251),t(249),t(252),t(246),t(247),t(199),t(200),t(201),t(202),t(203),t(206),t(204),t(205),t(207),t(208),t(209),t(210),t(212),t(211),t(257),t(283),t(286),t(285),t(287),t(288),t(284),t(289),t(290),t(268),t(271),t(267),t(265),t(266),t(269),t(270),t(260),t(282),t(291),t(259),t(261),t(263),t(262),t(264),t(273),t(274),t(276),t(275),t(278),t(277),t(279),t(280),t(281),t(258),t(272),t(294),t(293),t(292),n.exports=t(23)},{120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,128:128,129:129,130:130,131:131,132:132,133:133,134:134,135:135,136:136,137:137,138:138,139:139,140:140,141:141,142:142,143:143,144:144,145:145,146:146,147:147,148:148,149:149,150:150,151:151,152:152,153:153,154:154,155:155,156:156,157:157,158:158,159:159,160:160,161:161,162:162,163:163,164:164,165:165,166:166,167:167,168:168,169:169,170:170,171:171,172:172,173:173,174:174,175:175,176:176,177:177,178:178,179:179,180:180,181:181,182:182,183:183,184:184,185:185,186:186,187:187,188:188,189:189,190:190,191:191,192:192,193:193,194:194,195:195,196:196,197:197,198:198,199:199,200:200,201:201,202:202,203:203,204:204,205:205,206:206,207:207,208:208,209:209,210:210,211:211,212:212,213:213,214:214,215:215,216:216,217:217,218:218,219:219,220:220,221:221,222:222,223:223,224:224,225:225,226:226,227:227,228:228,229:229,23:23,230:230,231:231,232:232,233:233,234:234,235:235,236:236,237:237,238:238,239:239,240:240,241:241,242:242,243:243,244:244,245:245,246:246,247:247,248:248,249:249,250:250,251:251,252:252,253:253,254:254,255:255,256:256,257:257,258:258,259:259,260:260,261:261,262:262,263:263,264:264,265:265,266:266,267:267,268:268,269:269,270:270,271:271,272:272,273:273,274:274,275:275,276:276,277:277,278:278,279:279,280:280,281:281,282:282,283:283,284:284,285:285,286:286,287:287,288:288,289:289,290:290,291:291,292:292,293:293,294:294}],296:[function(t,n,r){(function(t){!function(t){"use strict";function wrap(t,n,r,e){var i=n&&n.prototype instanceof Generator?n:Generator,o=Object.create(i.prototype),u=new Context(e||[]);return o._invoke=makeInvokeMethod(t,r,u),o}function tryCatch(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function AsyncIterator(t){function invoke(n,r,e,o){var u=tryCatch(t[n],t,r);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&i.call(f,"__await")?Promise.resolve(f.__await).then(function(t){invoke("next",t,e,o)},function(t){invoke("throw",t,e,o)}):Promise.resolve(f).then(function(t){c.value=t,e(c)},o)}o(u.arg)}function enqueue(t,r){function callInvokeWithMethodAndArg(){return new Promise(function(n,e){invoke(t,r,n,e)})}return n=n?n.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}"object"==typeof process&&process.domain&&(invoke=process.domain.bind(invoke));var n;this._invoke=enqueue}function makeInvokeMethod(t,n,e){var i=s;return function invoke(o,u){if(i===h)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw u;return doneResult()}for(;;){var c=e.delegate;if(c){if("return"===o||"throw"===o&&c.iterator[o]===r){e.delegate=null;var f=c.iterator.return;if(f){var a=tryCatch(f,c.iterator,u);if("throw"===a.type){o="throw",u=a.arg;continue}}if("return"===o)continue}var a=tryCatch(c.iterator[o],c.iterator,u);if("throw"===a.type){e.delegate=null,o="throw",u=a.arg;continue}o="next",u=r;var d=a.arg;if(!d.done)return i=l,d;e[c.resultName]=d.value,e.next=c.nextLoc,e.delegate=null}if("next"===o)e.sent=e._sent=u;else if("throw"===o){if(i===s)throw i=v,u;e.dispatchException(u)&&(o="next",u=r)}else"return"===o&&e.abrupt("return",u);i=h;var a=tryCatch(t,n,e);if("normal"===a.type){i=e.done?v:l;var d={value:a.arg,done:e.done};if(a.arg!==p)return d;e.delegate&&"next"===o&&(u=r)}else"throw"===a.type&&(i=v,o="throw",u=a.arg)}}}function pushTryEntry(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function resetTryEntry(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,o=function next(){for(;++e=0;--r){var e=this.tryEntries[r],o=e.completion; +if("root"===e.tryLoc)return handle("end");if(e.tryLoc<=this.prev){var u=i.call(e,"catchLoc"),c=i.call(e,"finallyLoc");if(u&&c){if(this.prev=0;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&i.call(e,"finallyLoc")&&this.prev=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),p}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var i=e.arg;resetTryEntry(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:values(t),resultName:n,nextLoc:r},p}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); diff --git a/node_modules/csscomb/node_modules/babel-polyfill/dist/polyfill.js b/node_modules/csscomb/node_modules/babel-polyfill/dist/polyfill.js new file mode 100644 index 0000000..47b643c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/dist/polyfill.js @@ -0,0 +1,6773 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 2 ? arguments[2] : undefined + , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) + , inc = 1; + if(from < to && to < from + count){ + inc = -1; + from += count - 1; + to += count - 1; + } + while(count-- > 0){ + if(from in O)O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; +},{"105":105,"108":108,"109":109}],9:[function(_dereq_,module,exports){ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +'use strict'; +var toObject = _dereq_(109) + , toIndex = _dereq_(105) + , toLength = _dereq_(108); +module.exports = function fill(value /*, start = 0, end = @length */){ + var O = toObject(this) + , length = toLength(O.length) + , aLen = arguments.length + , index = toIndex(aLen > 1 ? arguments[1] : undefined, length) + , end = aLen > 2 ? arguments[2] : undefined + , endPos = end === undefined ? length : toIndex(end, length); + while(endPos > index)O[index++] = value; + return O; +}; +},{"105":105,"108":108,"109":109}],10:[function(_dereq_,module,exports){ +var forOf = _dereq_(37); + +module.exports = function(iter, ITERATOR){ + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; + +},{"37":37}],11:[function(_dereq_,module,exports){ +// false -> Array#indexOf +// true -> Array#includes +var toIObject = _dereq_(107) + , toLength = _dereq_(108) + , toIndex = _dereq_(105); +module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; +},{"105":105,"107":107,"108":108}],12:[function(_dereq_,module,exports){ +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = _dereq_(25) + , IObject = _dereq_(45) + , toObject = _dereq_(109) + , toLength = _dereq_(108) + , asc = _dereq_(15); +module.exports = function(TYPE, $create){ + var IS_MAP = TYPE == 1 + , IS_FILTER = TYPE == 2 + , IS_SOME = TYPE == 3 + , IS_EVERY = TYPE == 4 + , IS_FIND_INDEX = TYPE == 6 + , NO_HOLES = TYPE == 5 || IS_FIND_INDEX + , create = $create || asc; + return function($this, callbackfn, that){ + var O = toObject($this) + , self = IObject(O) + , f = ctx(callbackfn, that, 3) + , length = toLength(self.length) + , index = 0 + , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined + , val, res; + for(;length > index; index++)if(NO_HOLES || index in self){ + val = self[index]; + res = f(val, index, O); + if(TYPE){ + if(IS_MAP)result[index] = res; // map + else if(res)switch(TYPE){ + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if(IS_EVERY)return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; +}; +},{"108":108,"109":109,"15":15,"25":25,"45":45}],13:[function(_dereq_,module,exports){ +var aFunction = _dereq_(3) + , toObject = _dereq_(109) + , IObject = _dereq_(45) + , toLength = _dereq_(108); + +module.exports = function(that, callbackfn, aLen, memo, isRight){ + aFunction(callbackfn); + var O = toObject(that) + , self = IObject(O) + , length = toLength(O.length) + , index = isRight ? length - 1 : 0 + , i = isRight ? -1 : 1; + if(aLen < 2)for(;;){ + if(index in self){ + memo = self[index]; + index += i; + break; + } + index += i; + if(isRight ? index < 0 : length <= index){ + throw TypeError('Reduce of empty array with no initial value'); + } + } + for(;isRight ? index >= 0 : length > index; index += i)if(index in self){ + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; +},{"108":108,"109":109,"3":3,"45":45}],14:[function(_dereq_,module,exports){ +var isObject = _dereq_(49) + , isArray = _dereq_(47) + , SPECIES = _dereq_(117)('species'); + +module.exports = function(original){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return C === undefined ? Array : C; +}; +},{"117":117,"47":47,"49":49}],15:[function(_dereq_,module,exports){ +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = _dereq_(14); + +module.exports = function(original, length){ + return new (speciesConstructor(original))(length); +}; +},{"14":14}],16:[function(_dereq_,module,exports){ +'use strict'; +var aFunction = _dereq_(3) + , isObject = _dereq_(49) + , invoke = _dereq_(44) + , arraySlice = [].slice + , factories = {}; + +var construct = function(F, len, args){ + if(!(len in factories)){ + for(var n = [], i = 0; i < len; i++)n[i] = 'a[' + i + ']'; + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /*, args... */){ + var fn = aFunction(this) + , partArgs = arraySlice.call(arguments, 1); + var bound = function(/* args... */){ + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if(isObject(fn.prototype))bound.prototype = fn.prototype; + return bound; +}; +},{"3":3,"44":44,"49":49}],17:[function(_dereq_,module,exports){ +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = _dereq_(18) + , TAG = _dereq_(117)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } +}; + +module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; +},{"117":117,"18":18}],18:[function(_dereq_,module,exports){ +var toString = {}.toString; + +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; +},{}],19:[function(_dereq_,module,exports){ +'use strict'; +var dP = _dereq_(67).f + , create = _dereq_(66) + , redefineAll = _dereq_(86) + , ctx = _dereq_(25) + , anInstance = _dereq_(6) + , defined = _dereq_(27) + , forOf = _dereq_(37) + , $iterDefine = _dereq_(53) + , step = _dereq_(55) + , setSpecies = _dereq_(91) + , DESCRIPTORS = _dereq_(28) + , fastKey = _dereq_(62).fastKey + , SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + anInstance(this, C, 'forEach'); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)dP(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; +},{"25":25,"27":27,"28":28,"37":37,"53":53,"55":55,"6":6,"62":62,"66":66,"67":67,"86":86,"91":91}],20:[function(_dereq_,module,exports){ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = _dereq_(17) + , from = _dereq_(10); +module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; +},{"10":10,"17":17}],21:[function(_dereq_,module,exports){ +'use strict'; +var redefineAll = _dereq_(86) + , getWeak = _dereq_(62).getWeak + , anObject = _dereq_(7) + , isObject = _dereq_(49) + , anInstance = _dereq_(6) + , forOf = _dereq_(37) + , createArrayMethod = _dereq_(12) + , $has = _dereq_(39) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , id = 0; + +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function(that){ + return that._l || (that._l = new UncaughtFrozenStore); +}; +var UncaughtFrozenStore = function(){ + this.a = []; +}; +var findUncaughtFrozen = function(store, key){ + return arrayFind(store.a, function(it){ + return it[0] === key; + }); +}; +UncaughtFrozenStore.prototype = { + get: function(key){ + var entry = findUncaughtFrozen(this, key); + if(entry)return entry[1]; + }, + has: function(key){ + return !!findUncaughtFrozen(this, key); + }, + set: function(key, value){ + var entry = findUncaughtFrozen(this, key); + if(entry)entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function(key){ + var index = arrayFindIndex(this.a, function(it){ + return it[0] === key; + }); + if(~index)this.a.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this)['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key){ + if(!isObject(key))return false; + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function(that, key, value){ + var data = getWeak(anObject(key), true); + if(data === true)uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore +}; +},{"12":12,"37":37,"39":39,"49":49,"6":6,"62":62,"7":7,"86":86}],22:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(38) + , $export = _dereq_(32) + , redefine = _dereq_(87) + , redefineAll = _dereq_(86) + , meta = _dereq_(62) + , forOf = _dereq_(37) + , anInstance = _dereq_(6) + , isObject = _dereq_(49) + , fails = _dereq_(34) + , $iterDetect = _dereq_(54) + , setToStringTag = _dereq_(92) + , inheritIfRequired = _dereq_(43); + +module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + var fixMethod = function(KEY){ + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a){ + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C + // early implementations not supports chaining + , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) + // most early implementations doesn't supports iterables, most modern - not close it correctly + , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + , BUGGY_ZERO = !IS_WEAK && fails(function(){ + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C() + , index = 5; + while(index--)$instance[ADDER](index, index); + return !$instance.has(-0); + }); + if(!ACCEPT_ITERABLES){ + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base, target, C); + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); + // weak collections should not contains .clear method + if(IS_WEAK && proto.clear)delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; +}; +},{"32":32,"34":34,"37":37,"38":38,"43":43,"49":49,"54":54,"6":6,"62":62,"86":86,"87":87,"92":92}],23:[function(_dereq_,module,exports){ +var core = module.exports = {version: '2.4.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef +},{}],24:[function(_dereq_,module,exports){ +'use strict'; +var $defineProperty = _dereq_(67) + , createDesc = _dereq_(85); + +module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; +},{"67":67,"85":85}],25:[function(_dereq_,module,exports){ +// optional / simple context binding +var aFunction = _dereq_(3); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; +},{"3":3}],26:[function(_dereq_,module,exports){ +'use strict'; +var anObject = _dereq_(7) + , toPrimitive = _dereq_(110) + , NUMBER = 'number'; + +module.exports = function(hint){ + if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; +},{"110":110,"7":7}],27:[function(_dereq_,module,exports){ +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; +},{}],28:[function(_dereq_,module,exports){ +// Thank's IE8 for his funny defineProperty +module.exports = !_dereq_(34)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"34":34}],29:[function(_dereq_,module,exports){ +var isObject = _dereq_(49) + , document = _dereq_(38).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; +},{"38":38,"49":49}],30:[function(_dereq_,module,exports){ +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); +},{}],31:[function(_dereq_,module,exports){ +// all enumerable object keys, includes symbols +var getKeys = _dereq_(76) + , gOPS = _dereq_(73) + , pIE = _dereq_(77); +module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; +}; +},{"73":73,"76":76,"77":77}],32:[function(_dereq_,module,exports){ +var global = _dereq_(38) + , core = _dereq_(23) + , hide = _dereq_(40) + , redefine = _dereq_(87) + , ctx = _dereq_(25) + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) + , key, own, out, exp; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if(target)redefine(target, key, out, type & $export.U); + // export + if(exports[key] != out)hide(exports, key, exp); + if(IS_PROTO && expProto[key] != out)expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; +},{"23":23,"25":25,"38":38,"40":40,"87":87}],33:[function(_dereq_,module,exports){ +var MATCH = _dereq_(117)('match'); +module.exports = function(KEY){ + var re = /./; + try { + '/./'[KEY](re); + } catch(e){ + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch(f){ /* empty */ } + } return true; +}; +},{"117":117}],34:[function(_dereq_,module,exports){ +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; +},{}],35:[function(_dereq_,module,exports){ +'use strict'; +var hide = _dereq_(40) + , redefine = _dereq_(87) + , fails = _dereq_(34) + , defined = _dereq_(27) + , wks = _dereq_(117); + +module.exports = function(KEY, length, exec){ + var SYMBOL = wks(KEY) + , fns = exec(defined, SYMBOL, ''[KEY]) + , strfn = fns[0] + , rxfn = fns[1]; + if(fails(function(){ + var O = {}; + O[SYMBOL] = function(){ return 7; }; + return ''[KEY](O) != 7; + })){ + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function(string, arg){ return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function(string){ return rxfn.call(string, this); } + ); + } +}; +},{"117":117,"27":27,"34":34,"40":40,"87":87}],36:[function(_dereq_,module,exports){ +'use strict'; +// 21.2.5.3 get RegExp.prototype.flags +var anObject = _dereq_(7); +module.exports = function(){ + var that = anObject(this) + , result = ''; + if(that.global) result += 'g'; + if(that.ignoreCase) result += 'i'; + if(that.multiline) result += 'm'; + if(that.unicode) result += 'u'; + if(that.sticky) result += 'y'; + return result; +}; +},{"7":7}],37:[function(_dereq_,module,exports){ +var ctx = _dereq_(25) + , call = _dereq_(51) + , isArrayIter = _dereq_(46) + , anObject = _dereq_(7) + , toLength = _dereq_(108) + , getIterFn = _dereq_(118) + , BREAK = {} + , RETURN = {}; +var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; +},{"108":108,"118":118,"25":25,"46":46,"51":51,"7":7}],38:[function(_dereq_,module,exports){ +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef +},{}],39:[function(_dereq_,module,exports){ +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; +},{}],40:[function(_dereq_,module,exports){ +var dP = _dereq_(67) + , createDesc = _dereq_(85); +module.exports = _dereq_(28) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; +},{"28":28,"67":67,"85":85}],41:[function(_dereq_,module,exports){ +module.exports = _dereq_(38).document && document.documentElement; +},{"38":38}],42:[function(_dereq_,module,exports){ +module.exports = !_dereq_(28) && !_dereq_(34)(function(){ + return Object.defineProperty(_dereq_(29)('div'), 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"28":28,"29":29,"34":34}],43:[function(_dereq_,module,exports){ +var isObject = _dereq_(49) + , setPrototypeOf = _dereq_(90).set; +module.exports = function(that, target, C){ + var P, S = target.constructor; + if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){ + setPrototypeOf(that, P); + } return that; +}; +},{"49":49,"90":90}],44:[function(_dereq_,module,exports){ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; +},{}],45:[function(_dereq_,module,exports){ +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = _dereq_(18); +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); +}; +},{"18":18}],46:[function(_dereq_,module,exports){ +// check on default Array iterator +var Iterators = _dereq_(56) + , ITERATOR = _dereq_(117)('iterator') + , ArrayProto = Array.prototype; + +module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; +},{"117":117,"56":56}],47:[function(_dereq_,module,exports){ +// 7.2.2 IsArray(argument) +var cof = _dereq_(18); +module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; +}; +},{"18":18}],48:[function(_dereq_,module,exports){ +// 20.1.2.3 Number.isInteger(number) +var isObject = _dereq_(49) + , floor = Math.floor; +module.exports = function isInteger(it){ + return !isObject(it) && isFinite(it) && floor(it) === it; +}; +},{"49":49}],49:[function(_dereq_,module,exports){ +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; +},{}],50:[function(_dereq_,module,exports){ +// 7.2.8 IsRegExp(argument) +var isObject = _dereq_(49) + , cof = _dereq_(18) + , MATCH = _dereq_(117)('match'); +module.exports = function(it){ + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; +},{"117":117,"18":18,"49":49}],51:[function(_dereq_,module,exports){ +// call something on iterator step with safe closing on error +var anObject = _dereq_(7); +module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } +}; +},{"7":7}],52:[function(_dereq_,module,exports){ +'use strict'; +var create = _dereq_(66) + , descriptor = _dereq_(85) + , setToStringTag = _dereq_(92) + , IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +_dereq_(40)(IteratorPrototype, _dereq_(117)('iterator'), function(){ return this; }); + +module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); +}; +},{"117":117,"40":40,"66":66,"85":85,"92":92}],53:[function(_dereq_,module,exports){ +'use strict'; +var LIBRARY = _dereq_(58) + , $export = _dereq_(32) + , redefine = _dereq_(87) + , hide = _dereq_(40) + , has = _dereq_(39) + , Iterators = _dereq_(56) + , $iterCreate = _dereq_(52) + , setToStringTag = _dereq_(92) + , getPrototypeOf = _dereq_(74) + , ITERATOR = _dereq_(117)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + +var returnThis = function(){ return this; }; + +module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; +},{"117":117,"32":32,"39":39,"40":40,"52":52,"56":56,"58":58,"74":74,"87":87,"92":92}],54:[function(_dereq_,module,exports){ +var ITERATOR = _dereq_(117)('iterator') + , SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); +} catch(e){ /* empty */ } + +module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; +}; +},{"117":117}],55:[function(_dereq_,module,exports){ +module.exports = function(done, value){ + return {value: value, done: !!done}; +}; +},{}],56:[function(_dereq_,module,exports){ +module.exports = {}; +},{}],57:[function(_dereq_,module,exports){ +var getKeys = _dereq_(76) + , toIObject = _dereq_(107); +module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; +}; +},{"107":107,"76":76}],58:[function(_dereq_,module,exports){ +module.exports = false; +},{}],59:[function(_dereq_,module,exports){ +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x){ + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; +},{}],60:[function(_dereq_,module,exports){ +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x){ + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; +},{}],61:[function(_dereq_,module,exports){ +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; +},{}],62:[function(_dereq_,module,exports){ +var META = _dereq_(114)('meta') + , isObject = _dereq_(49) + , has = _dereq_(39) + , setDesc = _dereq_(67).f + , id = 0; +var isExtensible = Object.isExtensible || function(){ + return true; +}; +var FREEZE = !_dereq_(34)(function(){ + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); +}; +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; +},{"114":114,"34":34,"39":39,"49":49,"67":67}],63:[function(_dereq_,module,exports){ +var Map = _dereq_(149) + , $export = _dereq_(32) + , shared = _dereq_(94)('metadata') + , store = shared.store || (shared.store = new (_dereq_(255))); + +var getOrCreateMetadataMap = function(target, targetKey, create){ + var targetMetadata = store.get(target); + if(!targetMetadata){ + if(!create)return undefined; + store.set(target, targetMetadata = new Map); + } + var keyMetadata = targetMetadata.get(targetKey); + if(!keyMetadata){ + if(!create)return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function(MetadataKey, O, P){ + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function(MetadataKey, MetadataValue, O, P){ + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function(target, targetKey){ + var metadataMap = getOrCreateMetadataMap(target, targetKey, false) + , keys = []; + if(metadataMap)metadataMap.forEach(function(_, key){ keys.push(key); }); + return keys; +}; +var toMetaKey = function(it){ + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function(O){ + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; +},{"149":149,"255":255,"32":32,"94":94}],64:[function(_dereq_,module,exports){ +var global = _dereq_(38) + , macrotask = _dereq_(104).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = _dereq_(18)(process) == 'process'; + +module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; +}; +},{"104":104,"18":18,"38":38}],65:[function(_dereq_,module,exports){ +'use strict'; +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = _dereq_(76) + , gOPS = _dereq_(73) + , pIE = _dereq_(77) + , toObject = _dereq_(109) + , IObject = _dereq_(45) + , $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || _dereq_(34)(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; +} : $assign; +},{"109":109,"34":34,"45":45,"73":73,"76":76,"77":77}],66:[function(_dereq_,module,exports){ +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = _dereq_(7) + , dPs = _dereq_(68) + , enumBugKeys = _dereq_(30) + , IE_PROTO = _dereq_(93)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = _dereq_(29)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + _dereq_(41).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + +},{"29":29,"30":30,"41":41,"68":68,"7":7,"93":93}],67:[function(_dereq_,module,exports){ +var anObject = _dereq_(7) + , IE8_DOM_DEFINE = _dereq_(42) + , toPrimitive = _dereq_(110) + , dP = Object.defineProperty; + +exports.f = _dereq_(28) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; +},{"110":110,"28":28,"42":42,"7":7}],68:[function(_dereq_,module,exports){ +var dP = _dereq_(67) + , anObject = _dereq_(7) + , getKeys = _dereq_(76); + +module.exports = _dereq_(28) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; +}; +},{"28":28,"67":67,"7":7,"76":76}],69:[function(_dereq_,module,exports){ +// Forced replacement prototype accessors methods +module.exports = _dereq_(58)|| !_dereq_(34)(function(){ + var K = Math.random(); + // In FF throws only define methods + __defineSetter__.call(null, K, function(){ /* empty */}); + delete _dereq_(38)[K]; +}); +},{"34":34,"38":38,"58":58}],70:[function(_dereq_,module,exports){ +var pIE = _dereq_(77) + , createDesc = _dereq_(85) + , toIObject = _dereq_(107) + , toPrimitive = _dereq_(110) + , has = _dereq_(39) + , IE8_DOM_DEFINE = _dereq_(42) + , gOPD = Object.getOwnPropertyDescriptor; + +exports.f = _dereq_(28) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); +}; +},{"107":107,"110":110,"28":28,"39":39,"42":42,"77":77,"85":85}],71:[function(_dereq_,module,exports){ +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = _dereq_(107) + , gOPN = _dereq_(72).f + , toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + +},{"107":107,"72":72}],72:[function(_dereq_,module,exports){ +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = _dereq_(75) + , hiddenKeys = _dereq_(30).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); +}; +},{"30":30,"75":75}],73:[function(_dereq_,module,exports){ +exports.f = Object.getOwnPropertySymbols; +},{}],74:[function(_dereq_,module,exports){ +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = _dereq_(39) + , toObject = _dereq_(109) + , IE_PROTO = _dereq_(93)('IE_PROTO') + , ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; +},{"109":109,"39":39,"93":93}],75:[function(_dereq_,module,exports){ +var has = _dereq_(39) + , toIObject = _dereq_(107) + , arrayIndexOf = _dereq_(11)(false) + , IE_PROTO = _dereq_(93)('IE_PROTO'); + +module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; +},{"107":107,"11":11,"39":39,"93":93}],76:[function(_dereq_,module,exports){ +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = _dereq_(75) + , enumBugKeys = _dereq_(30); + +module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); +}; +},{"30":30,"75":75}],77:[function(_dereq_,module,exports){ +exports.f = {}.propertyIsEnumerable; +},{}],78:[function(_dereq_,module,exports){ +// most Object methods by ES6 should accept primitives +var $export = _dereq_(32) + , core = _dereq_(23) + , fails = _dereq_(34); +module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); +}; +},{"23":23,"32":32,"34":34}],79:[function(_dereq_,module,exports){ +var getKeys = _dereq_(76) + , toIObject = _dereq_(107) + , isEnum = _dereq_(77).f; +module.exports = function(isEntries){ + return function(it){ + var O = toIObject(it) + , keys = getKeys(O) + , length = keys.length + , i = 0 + , result = [] + , key; + while(length > i)if(isEnum.call(O, key = keys[i++])){ + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; +},{"107":107,"76":76,"77":77}],80:[function(_dereq_,module,exports){ +// all object keys, includes non-enumerable and symbols +var gOPN = _dereq_(72) + , gOPS = _dereq_(73) + , anObject = _dereq_(7) + , Reflect = _dereq_(38).Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ + var keys = gOPN.f(anObject(it)) + , getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; +},{"38":38,"7":7,"72":72,"73":73}],81:[function(_dereq_,module,exports){ +var $parseFloat = _dereq_(38).parseFloat + , $trim = _dereq_(102).trim; + +module.exports = 1 / $parseFloat(_dereq_(103) + '-0') !== -Infinity ? function parseFloat(str){ + var string = $trim(String(str), 3) + , result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; +},{"102":102,"103":103,"38":38}],82:[function(_dereq_,module,exports){ +var $parseInt = _dereq_(38).parseInt + , $trim = _dereq_(102).trim + , ws = _dereq_(103) + , hex = /^[\-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){ + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; +},{"102":102,"103":103,"38":38}],83:[function(_dereq_,module,exports){ +'use strict'; +var path = _dereq_(84) + , invoke = _dereq_(44) + , aFunction = _dereq_(3); +module.exports = function(/* ...pargs */){ + var fn = aFunction(this) + , length = arguments.length + , pargs = Array(length) + , i = 0 + , _ = path._ + , holder = false; + while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; + return function(/* ...args */){ + var that = this + , aLen = arguments.length + , j = 0, k = 0, args; + if(!holder && !aLen)return invoke(fn, pargs, that); + args = pargs.slice(); + if(holder)for(;length > j; j++)if(args[j] === _)args[j] = arguments[k++]; + while(aLen > k)args.push(arguments[k++]); + return invoke(fn, args, that); + }; +}; +},{"3":3,"44":44,"84":84}],84:[function(_dereq_,module,exports){ +module.exports = _dereq_(38); +},{"38":38}],85:[function(_dereq_,module,exports){ +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; +},{}],86:[function(_dereq_,module,exports){ +var redefine = _dereq_(87); +module.exports = function(target, src, safe){ + for(var key in src)redefine(target, key, src[key], safe); + return target; +}; +},{"87":87}],87:[function(_dereq_,module,exports){ +var global = _dereq_(38) + , hide = _dereq_(40) + , has = _dereq_(39) + , SRC = _dereq_(114)('src') + , TO_STRING = 'toString' + , $toString = Function[TO_STRING] + , TPL = ('' + $toString).split(TO_STRING); + +_dereq_(23).inspectSource = function(it){ + return $toString.call(it); +}; + +(module.exports = function(O, key, val, safe){ + var isFunction = typeof val == 'function'; + if(isFunction)has(val, 'name') || hide(val, 'name', key); + if(O[key] === val)return; + if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if(O === global){ + O[key] = val; + } else { + if(!safe){ + delete O[key]; + hide(O, key, val); + } else { + if(O[key])O[key] = val; + else hide(O, key, val); + } + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString(){ + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); +},{"114":114,"23":23,"38":38,"39":39,"40":40}],88:[function(_dereq_,module,exports){ +module.exports = function(regExp, replace){ + var replacer = replace === Object(replace) ? function(part){ + return replace[part]; + } : replace; + return function(it){ + return String(it).replace(regExp, replacer); + }; +}; +},{}],89:[function(_dereq_,module,exports){ +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; +},{}],90:[function(_dereq_,module,exports){ +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = _dereq_(49) + , anObject = _dereq_(7); +var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = _dereq_(25)(Function.call, _dereq_(70).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; +},{"25":25,"49":49,"7":7,"70":70}],91:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(38) + , dP = _dereq_(67) + , DESCRIPTORS = _dereq_(28) + , SPECIES = _dereq_(117)('species'); + +module.exports = function(KEY){ + var C = global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); +}; +},{"117":117,"28":28,"38":38,"67":67}],92:[function(_dereq_,module,exports){ +var def = _dereq_(67).f + , has = _dereq_(39) + , TAG = _dereq_(117)('toStringTag'); + +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); +}; +},{"117":117,"39":39,"67":67}],93:[function(_dereq_,module,exports){ +var shared = _dereq_(94)('keys') + , uid = _dereq_(114); +module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); +}; +},{"114":114,"94":94}],94:[function(_dereq_,module,exports){ +var global = _dereq_(38) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; +},{"38":38}],95:[function(_dereq_,module,exports){ +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = _dereq_(7) + , aFunction = _dereq_(3) + , SPECIES = _dereq_(117)('species'); +module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; +},{"117":117,"3":3,"7":7}],96:[function(_dereq_,module,exports){ +var fails = _dereq_(34); + +module.exports = function(method, arg){ + return !!method && fails(function(){ + arg ? method.call(null, function(){}, 1) : method.call(null); + }); +}; +},{"34":34}],97:[function(_dereq_,module,exports){ +var toInteger = _dereq_(106) + , defined = _dereq_(27); +// true -> String#at +// false -> String#codePointAt +module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; +},{"106":106,"27":27}],98:[function(_dereq_,module,exports){ +// helper for String#{startsWith, endsWith, includes} +var isRegExp = _dereq_(50) + , defined = _dereq_(27); + +module.exports = function(that, searchString, NAME){ + if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; +},{"27":27,"50":50}],99:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , fails = _dereq_(34) + , defined = _dereq_(27) + , quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function(string, tag, attribute, value) { + var S = String(defined(string)) + , p1 = '<' + tag; + if(attribute !== '')p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function(NAME, exec){ + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function(){ + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; +},{"27":27,"32":32,"34":34}],100:[function(_dereq_,module,exports){ +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = _dereq_(108) + , repeat = _dereq_(101) + , defined = _dereq_(27); + +module.exports = function(that, maxLength, fillString, left){ + var S = String(defined(that)) + , stringLength = S.length + , fillStr = fillString === undefined ? ' ' : String(fillString) + , intMaxLength = toLength(maxLength); + if(intMaxLength <= stringLength || fillStr == '')return S; + var fillLen = intMaxLength - stringLength + , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; + +},{"101":101,"108":108,"27":27}],101:[function(_dereq_,module,exports){ +'use strict'; +var toInteger = _dereq_(106) + , defined = _dereq_(27); + +module.exports = function repeat(count){ + var str = String(defined(this)) + , res = '' + , n = toInteger(count); + if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); + for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; + return res; +}; +},{"106":106,"27":27}],102:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , defined = _dereq_(27) + , fails = _dereq_(34) + , spaces = _dereq_(103) + , space = '[' + spaces + ']' + , non = '\u200b\u0085' + , ltrim = RegExp('^' + space + space + '*') + , rtrim = RegExp(space + space + '*$'); + +var exporter = function(KEY, exec, ALIAS){ + var exp = {}; + var FORCE = fails(function(){ + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if(ALIAS)exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function(string, TYPE){ + string = String(defined(string)); + if(TYPE & 1)string = string.replace(ltrim, ''); + if(TYPE & 2)string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; +},{"103":103,"27":27,"32":32,"34":34}],103:[function(_dereq_,module,exports){ +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; +},{}],104:[function(_dereq_,module,exports){ +var ctx = _dereq_(25) + , invoke = _dereq_(44) + , html = _dereq_(41) + , cel = _dereq_(29) + , global = _dereq_(38) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; +var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function(event){ + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(_dereq_(18)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; +},{"18":18,"25":25,"29":29,"38":38,"41":41,"44":44}],105:[function(_dereq_,module,exports){ +var toInteger = _dereq_(106) + , max = Math.max + , min = Math.min; +module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; +},{"106":106}],106:[function(_dereq_,module,exports){ +// 7.1.4 ToInteger +var ceil = Math.ceil + , floor = Math.floor; +module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; +},{}],107:[function(_dereq_,module,exports){ +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = _dereq_(45) + , defined = _dereq_(27); +module.exports = function(it){ + return IObject(defined(it)); +}; +},{"27":27,"45":45}],108:[function(_dereq_,module,exports){ +// 7.1.15 ToLength +var toInteger = _dereq_(106) + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; +},{"106":106}],109:[function(_dereq_,module,exports){ +// 7.1.13 ToObject(argument) +var defined = _dereq_(27); +module.exports = function(it){ + return Object(defined(it)); +}; +},{"27":27}],110:[function(_dereq_,module,exports){ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = _dereq_(49); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; +},{"49":49}],111:[function(_dereq_,module,exports){ +'use strict'; +if(_dereq_(28)){ + var LIBRARY = _dereq_(58) + , global = _dereq_(38) + , fails = _dereq_(34) + , $export = _dereq_(32) + , $typed = _dereq_(113) + , $buffer = _dereq_(112) + , ctx = _dereq_(25) + , anInstance = _dereq_(6) + , propertyDesc = _dereq_(85) + , hide = _dereq_(40) + , redefineAll = _dereq_(86) + , toInteger = _dereq_(106) + , toLength = _dereq_(108) + , toIndex = _dereq_(105) + , toPrimitive = _dereq_(110) + , has = _dereq_(39) + , same = _dereq_(89) + , classof = _dereq_(17) + , isObject = _dereq_(49) + , toObject = _dereq_(109) + , isArrayIter = _dereq_(46) + , create = _dereq_(66) + , getPrototypeOf = _dereq_(74) + , gOPN = _dereq_(72).f + , getIterFn = _dereq_(118) + , uid = _dereq_(114) + , wks = _dereq_(117) + , createArrayMethod = _dereq_(12) + , createArrayIncludes = _dereq_(11) + , speciesConstructor = _dereq_(95) + , ArrayIterators = _dereq_(130) + , Iterators = _dereq_(56) + , $iterDetect = _dereq_(54) + , setSpecies = _dereq_(91) + , arrayFill = _dereq_(9) + , arrayCopyWithin = _dereq_(8) + , $DP = _dereq_(67) + , $GOPD = _dereq_(70) + , dP = $DP.f + , gOPD = $GOPD.f + , RangeError = global.RangeError + , TypeError = global.TypeError + , Uint8Array = global.Uint8Array + , ARRAY_BUFFER = 'ArrayBuffer' + , SHARED_BUFFER = 'Shared' + ARRAY_BUFFER + , BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT' + , PROTOTYPE = 'prototype' + , ArrayProto = Array[PROTOTYPE] + , $ArrayBuffer = $buffer.ArrayBuffer + , $DataView = $buffer.DataView + , arrayForEach = createArrayMethod(0) + , arrayFilter = createArrayMethod(2) + , arraySome = createArrayMethod(3) + , arrayEvery = createArrayMethod(4) + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , arrayIncludes = createArrayIncludes(true) + , arrayIndexOf = createArrayIncludes(false) + , arrayValues = ArrayIterators.values + , arrayKeys = ArrayIterators.keys + , arrayEntries = ArrayIterators.entries + , arrayLastIndexOf = ArrayProto.lastIndexOf + , arrayReduce = ArrayProto.reduce + , arrayReduceRight = ArrayProto.reduceRight + , arrayJoin = ArrayProto.join + , arraySort = ArrayProto.sort + , arraySlice = ArrayProto.slice + , arrayToString = ArrayProto.toString + , arrayToLocaleString = ArrayProto.toLocaleString + , ITERATOR = wks('iterator') + , TAG = wks('toStringTag') + , TYPED_CONSTRUCTOR = uid('typed_constructor') + , DEF_CONSTRUCTOR = uid('def_constructor') + , ALL_CONSTRUCTORS = $typed.CONSTR + , TYPED_ARRAY = $typed.TYPED + , VIEW = $typed.VIEW + , WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function(O, length){ + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function(){ + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function(){ + new Uint8Array(1).set({}); + }); + + var strictToLength = function(it, SAME){ + if(it === undefined)throw TypeError(WRONG_LENGTH); + var number = +it + , length = toLength(it); + if(SAME && !same(number, length))throw RangeError(WRONG_LENGTH); + return length; + }; + + var toOffset = function(it, BYTES){ + var offset = toInteger(it); + if(offset < 0 || offset % BYTES)throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function(it){ + if(isObject(it) && TYPED_ARRAY in it)return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function(C, length){ + if(!(isObject(C) && TYPED_CONSTRUCTOR in C)){ + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function(O, list){ + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function(C, list){ + var index = 0 + , length = list.length + , result = allocate(C, length); + while(length > index)result[index] = list[index++]; + return result; + }; + + var addGetter = function(it, key, internal){ + dP(it, key, {get: function(){ return this._d[internal]; }}); + }; + + var $from = function from(source /*, mapfn, thisArg */){ + var O = toObject(source) + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , iterFn = getIterFn(O) + , i, length, values, result, step, iterator; + if(iterFn != undefined && !isArrayIter(iterFn)){ + for(iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++){ + values.push(step.value); + } O = values; + } + if(mapping && aLen > 2)mapfn = ctx(mapfn, arguments[2], 2); + for(i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++){ + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/*...items*/){ + var index = 0 + , length = arguments.length + , result = allocate(this, length); + while(length > index)result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function(){ arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString(){ + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /*, end */){ + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /*, thisArg */){ + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /*, start, end */){ // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /*, thisArg */){ + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /*, thisArg */){ + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /*, thisArg */){ + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /*, thisArg */){ + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /*, fromIndex */){ + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /*, fromIndex */){ + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator){ // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex */){ // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /*, thisArg */){ + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /*, initialValue */){ // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse(){ + var that = this + , length = validate(that).length + , middle = Math.floor(length / 2) + , index = 0 + , value; + while(index < middle){ + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /*, thisArg */){ + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn){ + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end){ + var O = validate(this) + , length = O.length + , $begin = toIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end){ + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /*, offset */){ + validate(this); + var offset = toOffset(arguments[1], 1) + , length = this.length + , src = toObject(arrayLike) + , len = toLength(src.length) + , index = 0; + if(len + offset > length)throw RangeError(WRONG_LENGTH); + while(index < len)this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries(){ + return arrayEntries.call(validate(this)); + }, + keys: function keys(){ + return arrayKeys.call(validate(this)); + }, + values: function values(){ + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function(target, key){ + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key){ + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc){ + if(isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ){ + target[key] = desc.value; + return target; + } else return dP(target, key, desc); + }; + + if(!ALL_CONSTRUCTORS){ + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if(fails(function(){ arrayToString.call({}); })){ + arrayToString = arrayToLocaleString = function toString(){ + return arrayJoin.call(this); + } + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function(){ /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function(){ return this[TYPED_ARRAY]; } + }); + + module.exports = function(KEY, BYTES, wrapper, CLAMPED){ + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array' + , ISNT_UINT8 = NAME != 'Uint8Array' + , GETTER = 'get' + KEY + , SETTER = 'set' + KEY + , TypedArray = global[NAME] + , Base = TypedArray || {} + , TAC = TypedArray && getPrototypeOf(TypedArray) + , FORCED = !TypedArray || !$typed.ABV + , O = {} + , TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function(that, index){ + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function(that, index, value){ + var data = that._d; + if(CLAMPED)value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function(that, index){ + dP(that, index, { + get: function(){ + return getter(this, index); + }, + set: function(value){ + return setter(this, index, value); + }, + enumerable: true + }); + }; + if(FORCED){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME, '_d'); + var index = 0 + , offset = 0 + , buffer, byteLength, length, klass; + if(!isObject(data)){ + length = strictToLength(data, true) + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if($length === undefined){ + if($len % BYTES)throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if(byteLength < 0)throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if(byteLength + offset > $len)throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if(TYPED_ARRAY in data){ + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while(index < length)addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if(!$iterDetect(function(iter){ + // V8 works with iterators, but fails in many other cases + // https://code.google.com/p/v8/issues/detail?id=4552 + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)){ + TypedArray = wrapper(function(that, data, $offset, $length){ + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if(!isObject(data))return new Base(strictToLength(data, ISNT_UINT8)); + if(data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER){ + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if(TYPED_ARRAY in data)return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key){ + if(!(key in TypedArray))hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if(!LIBRARY)TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR] + , CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined) + , $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if(CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)){ + dP(TypedArrayPrototype, TAG, { + get: function(){ return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES, + from: $from, + of: $of + }); + + if(!(BYTES_PER_ELEMENT in TypedArrayPrototype))hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, {set: $set}); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + $export($export.P + $export.F * (TypedArrayPrototype.toString != arrayToString), NAME, {toString: arrayToString}); + + $export($export.P + $export.F * fails(function(){ + new TypedArray(1).slice(); + }), NAME, {slice: $slice}); + + $export($export.P + $export.F * (fails(function(){ + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString() + }) || !fails(function(){ + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, {toLocaleString: $toLocaleString}); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function(){ /* empty */ }; +},{"105":105,"106":106,"108":108,"109":109,"11":11,"110":110,"112":112,"113":113,"114":114,"117":117,"118":118,"12":12,"130":130,"17":17,"25":25,"28":28,"32":32,"34":34,"38":38,"39":39,"40":40,"46":46,"49":49,"54":54,"56":56,"58":58,"6":6,"66":66,"67":67,"70":70,"72":72,"74":74,"8":8,"85":85,"86":86,"89":89,"9":9,"91":91,"95":95}],112:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(38) + , DESCRIPTORS = _dereq_(28) + , LIBRARY = _dereq_(58) + , $typed = _dereq_(113) + , hide = _dereq_(40) + , redefineAll = _dereq_(86) + , fails = _dereq_(34) + , anInstance = _dereq_(6) + , toInteger = _dereq_(106) + , toLength = _dereq_(108) + , gOPN = _dereq_(72).f + , dP = _dereq_(67).f + , arrayFill = _dereq_(9) + , setToStringTag = _dereq_(92) + , ARRAY_BUFFER = 'ArrayBuffer' + , DATA_VIEW = 'DataView' + , PROTOTYPE = 'prototype' + , WRONG_LENGTH = 'Wrong length!' + , WRONG_INDEX = 'Wrong index!' + , $ArrayBuffer = global[ARRAY_BUFFER] + , $DataView = global[DATA_VIEW] + , Math = global.Math + , RangeError = global.RangeError + , Infinity = global.Infinity + , BaseBuffer = $ArrayBuffer + , abs = Math.abs + , pow = Math.pow + , floor = Math.floor + , log = Math.log + , LN2 = Math.LN2 + , BUFFER = 'buffer' + , BYTE_LENGTH = 'byteLength' + , BYTE_OFFSET = 'byteOffset' + , $BUFFER = DESCRIPTORS ? '_b' : BUFFER + , $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH + , $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +var packIEEE754 = function(value, mLen, nBytes){ + var buffer = Array(nBytes) + , eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0 + , i = 0 + , s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0 + , e, m, c; + value = abs(value) + if(value != value || value === Infinity){ + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if(value * (c = pow(2, -e)) < 1){ + e--; + c *= 2; + } + if(e + eBias >= 1){ + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if(value * c >= 2){ + e++; + c /= 2; + } + if(e + eBias >= eMax){ + m = 0; + e = eMax; + } else if(e + eBias >= 1){ + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for(; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for(; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +}; +var unpackIEEE754 = function(buffer, mLen, nBytes){ + var eLen = nBytes * 8 - mLen - 1 + , eMax = (1 << eLen) - 1 + , eBias = eMax >> 1 + , nBits = eLen - 7 + , i = nBytes - 1 + , s = buffer[i--] + , e = s & 127 + , m; + s >>= 7; + for(; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for(; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if(e === 0){ + e = 1 - eBias; + } else if(e === eMax){ + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +}; + +var unpackI32 = function(bytes){ + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +}; +var packI8 = function(it){ + return [it & 0xff]; +}; +var packI16 = function(it){ + return [it & 0xff, it >> 8 & 0xff]; +}; +var packI32 = function(it){ + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +}; +var packF64 = function(it){ + return packIEEE754(it, 52, 8); +}; +var packF32 = function(it){ + return packIEEE754(it, 23, 4); +}; + +var addGetter = function(C, key, internal){ + dP(C[PROTOTYPE], key, {get: function(){ return this[internal]; }}); +}; + +var get = function(view, bytes, index, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +}; +var set = function(view, bytes, index, conversion, value, isLittleEndian){ + var numIndex = +index + , intIndex = toInteger(numIndex); + if(numIndex != intIndex || intIndex < 0 || intIndex + bytes > view[$LENGTH])throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b + , start = intIndex + view[$OFFSET] + , pack = conversion(+value); + for(var i = 0; i < bytes; i++)store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +}; + +var validateArrayBufferArguments = function(that, length){ + anInstance(that, $ArrayBuffer, ARRAY_BUFFER); + var numberLength = +length + , byteLength = toLength(numberLength); + if(numberLength != byteLength)throw RangeError(WRONG_LENGTH); + return byteLength; +}; + +if(!$typed.ABV){ + $ArrayBuffer = function ArrayBuffer(length){ + var byteLength = validateArrayBufferArguments(this, length); + this._b = arrayFill.call(Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength){ + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH] + , offset = toInteger(byteOffset); + if(offset < 0 || offset > bufferLength)throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if(offset + byteLength > bufferLength)throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if(DESCRIPTORS){ + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset){ + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset){ + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /*, littleEndian */){ + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /*, littleEndian */){ + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /*, littleEndian */){ + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value){ + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /*, littleEndian */){ + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /*, littleEndian */){ + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /*, littleEndian */){ + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if(!fails(function(){ + new $ArrayBuffer; // eslint-disable-line no-new + }) || !fails(function(){ + new $ArrayBuffer(.5); // eslint-disable-line no-new + })){ + $ArrayBuffer = function ArrayBuffer(length){ + return new BaseBuffer(validateArrayBufferArguments(this, length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for(var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j; ){ + if(!((key = keys[j++]) in $ArrayBuffer))hide($ArrayBuffer, key, BaseBuffer[key]); + }; + if(!LIBRARY)ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)) + , $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if(view.getInt8(0) || !view.getInt8(1))redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value){ + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; +},{"106":106,"108":108,"113":113,"28":28,"34":34,"38":38,"40":40,"58":58,"6":6,"67":67,"72":72,"86":86,"9":9,"92":92}],113:[function(_dereq_,module,exports){ +var global = _dereq_(38) + , hide = _dereq_(40) + , uid = _dereq_(114) + , TYPED = uid('typed_array') + , VIEW = uid('view') + , ABV = !!(global.ArrayBuffer && global.DataView) + , CONSTR = ABV + , i = 0, l = 9, Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while(i < l){ + if(Typed = global[TypedArrayConstructors[i++]]){ + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; +},{"114":114,"38":38,"40":40}],114:[function(_dereq_,module,exports){ +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; +},{}],115:[function(_dereq_,module,exports){ +var global = _dereq_(38) + , core = _dereq_(23) + , LIBRARY = _dereq_(58) + , wksExt = _dereq_(116) + , defineProperty = _dereq_(67).f; +module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); +}; +},{"116":116,"23":23,"38":38,"58":58,"67":67}],116:[function(_dereq_,module,exports){ +exports.f = _dereq_(117); +},{"117":117}],117:[function(_dereq_,module,exports){ +var store = _dereq_(94)('wks') + , uid = _dereq_(114) + , Symbol = _dereq_(38).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; +},{"114":114,"38":38,"94":94}],118:[function(_dereq_,module,exports){ +var classof = _dereq_(17) + , ITERATOR = _dereq_(117)('iterator') + , Iterators = _dereq_(56); +module.exports = _dereq_(23).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; +},{"117":117,"17":17,"23":23,"56":56}],119:[function(_dereq_,module,exports){ +// https://github.com/benjamingr/RexExp.escape +var $export = _dereq_(32) + , $re = _dereq_(88)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); + +},{"32":32,"88":88}],120:[function(_dereq_,module,exports){ +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = _dereq_(32); + +$export($export.P, 'Array', {copyWithin: _dereq_(8)}); + +_dereq_(5)('copyWithin'); +},{"32":32,"5":5,"8":8}],121:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $every = _dereq_(12)(4); + +$export($export.P + $export.F * !_dereq_(96)([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */){ + return $every(this, callbackfn, arguments[1]); + } +}); +},{"12":12,"32":32,"96":96}],122:[function(_dereq_,module,exports){ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = _dereq_(32); + +$export($export.P, 'Array', {fill: _dereq_(9)}); + +_dereq_(5)('fill'); +},{"32":32,"5":5,"9":9}],123:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $filter = _dereq_(12)(2); + +$export($export.P + $export.F * !_dereq_(96)([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */){ + return $filter(this, callbackfn, arguments[1]); + } +}); +},{"12":12,"32":32,"96":96}],124:[function(_dereq_,module,exports){ +'use strict'; +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = _dereq_(32) + , $find = _dereq_(12)(6) + , KEY = 'findIndex' + , forced = true; +// Shouldn't skip holes +if(KEY in [])Array(1)[KEY](function(){ forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +_dereq_(5)(KEY); +},{"12":12,"32":32,"5":5}],125:[function(_dereq_,module,exports){ +'use strict'; +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = _dereq_(32) + , $find = _dereq_(12)(5) + , KEY = 'find' + , forced = true; +// Shouldn't skip holes +if(KEY in [])Array(1)[KEY](function(){ forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn/*, that = undefined */){ + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +_dereq_(5)(KEY); +},{"12":12,"32":32,"5":5}],126:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $forEach = _dereq_(12)(0) + , STRICT = _dereq_(96)([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */){ + return $forEach(this, callbackfn, arguments[1]); + } +}); +},{"12":12,"32":32,"96":96}],127:[function(_dereq_,module,exports){ +'use strict'; +var ctx = _dereq_(25) + , $export = _dereq_(32) + , toObject = _dereq_(109) + , call = _dereq_(51) + , isArrayIter = _dereq_(46) + , toLength = _dereq_(108) + , createProperty = _dereq_(24) + , getIterFn = _dereq_(118); + +$export($export.S + $export.F * !_dereq_(54)(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } +}); + +},{"108":108,"109":109,"118":118,"24":24,"25":25,"32":32,"46":46,"51":51,"54":54}],128:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $indexOf = _dereq_(11)(false) + , $native = [].indexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(96)($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /*, fromIndex = 0 */){ + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); +},{"11":11,"32":32,"96":96}],129:[function(_dereq_,module,exports){ +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = _dereq_(32); + +$export($export.S, 'Array', {isArray: _dereq_(47)}); +},{"32":32,"47":47}],130:[function(_dereq_,module,exports){ +'use strict'; +var addToUnscopables = _dereq_(5) + , step = _dereq_(55) + , Iterators = _dereq_(56) + , toIObject = _dereq_(107); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = _dereq_(53)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); +},{"107":107,"5":5,"53":53,"55":55,"56":56}],131:[function(_dereq_,module,exports){ +'use strict'; +// 22.1.3.13 Array.prototype.join(separator) +var $export = _dereq_(32) + , toIObject = _dereq_(107) + , arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (_dereq_(45) != Object || !_dereq_(96)(arrayJoin)), 'Array', { + join: function join(separator){ + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); +},{"107":107,"32":32,"45":45,"96":96}],132:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , toIObject = _dereq_(107) + , toInteger = _dereq_(106) + , toLength = _dereq_(108) + , $native = [].lastIndexOf + , NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(96)($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /*, fromIndex = @[*-1] */){ + // convert -0 to +0 + if(NEGATIVE_ZERO)return $native.apply(this, arguments) || 0; + var O = toIObject(this) + , length = toLength(O.length) + , index = length - 1; + if(arguments.length > 1)index = Math.min(index, toInteger(arguments[1])); + if(index < 0)index = length + index; + for(;index >= 0; index--)if(index in O)if(O[index] === searchElement)return index || 0; + return -1; + } +}); +},{"106":106,"107":107,"108":108,"32":32,"96":96}],133:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $map = _dereq_(12)(1); + +$export($export.P + $export.F * !_dereq_(96)([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */){ + return $map(this, callbackfn, arguments[1]); + } +}); +},{"12":12,"32":32,"96":96}],134:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , createProperty = _dereq_(24); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * _dereq_(34)(function(){ + function F(){} + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */){ + var index = 0 + , aLen = arguments.length + , result = new (typeof this == 'function' ? this : Array)(aLen); + while(aLen > index)createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); +},{"24":24,"32":32,"34":34}],135:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $reduce = _dereq_(13); + +$export($export.P + $export.F * !_dereq_(96)([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); +},{"13":13,"32":32,"96":96}],136:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $reduce = _dereq_(13); + +$export($export.P + $export.F * !_dereq_(96)([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */){ + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); +},{"13":13,"32":32,"96":96}],137:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , html = _dereq_(41) + , cof = _dereq_(18) + , toIndex = _dereq_(105) + , toLength = _dereq_(108) + , arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * _dereq_(34)(function(){ + if(html)arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end){ + var len = toLength(this.length) + , klass = cof(this); + end = end === undefined ? len : end; + if(klass == 'Array')return arraySlice.call(this, begin, end); + var start = toIndex(begin, len) + , upTo = toIndex(end, len) + , size = toLength(upTo - start) + , cloned = Array(size) + , i = 0; + for(; i < size; i++)cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); +},{"105":105,"108":108,"18":18,"32":32,"34":34,"41":41}],138:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $some = _dereq_(12)(3); + +$export($export.P + $export.F * !_dereq_(96)([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */){ + return $some(this, callbackfn, arguments[1]); + } +}); +},{"12":12,"32":32,"96":96}],139:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , aFunction = _dereq_(3) + , toObject = _dereq_(109) + , fails = _dereq_(34) + , $sort = [].sort + , test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function(){ + // IE8- + test.sort(undefined); +}) || !fails(function(){ + // V8 bug + test.sort(null); + // Old WebKit +}) || !_dereq_(96)($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn){ + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); +},{"109":109,"3":3,"32":32,"34":34,"96":96}],140:[function(_dereq_,module,exports){ +_dereq_(91)('Array'); +},{"91":91}],141:[function(_dereq_,module,exports){ +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = _dereq_(32); + +$export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); +},{"32":32}],142:[function(_dereq_,module,exports){ +'use strict'; +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = _dereq_(32) + , fails = _dereq_(34) + , getTime = Date.prototype.getTime; + +var lz = function(num){ + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (fails(function(){ + return new Date(-5e13 - 1).toISOString() != '0385-07-25T07:06:39.999Z'; +}) || !fails(function(){ + new Date(NaN).toISOString(); +})), 'Date', { + toISOString: function toISOString(){ + if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value'); + var d = this + , y = d.getUTCFullYear() + , m = d.getUTCMilliseconds() + , s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; + } +}); +},{"32":32,"34":34}],143:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , toObject = _dereq_(109) + , toPrimitive = _dereq_(110); + +$export($export.P + $export.F * _dereq_(34)(function(){ + return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1; +}), 'Date', { + toJSON: function toJSON(key){ + var O = toObject(this) + , pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); +},{"109":109,"110":110,"32":32,"34":34}],144:[function(_dereq_,module,exports){ +var TO_PRIMITIVE = _dereq_(117)('toPrimitive') + , proto = Date.prototype; + +if(!(TO_PRIMITIVE in proto))_dereq_(40)(proto, TO_PRIMITIVE, _dereq_(26)); +},{"117":117,"26":26,"40":40}],145:[function(_dereq_,module,exports){ +var DateProto = Date.prototype + , INVALID_DATE = 'Invalid Date' + , TO_STRING = 'toString' + , $toString = DateProto[TO_STRING] + , getTime = DateProto.getTime; +if(new Date(NaN) + '' != INVALID_DATE){ + _dereq_(87)(DateProto, TO_STRING, function toString(){ + var value = getTime.call(this); + return value === value ? $toString.call(this) : INVALID_DATE; + }); +} +},{"87":87}],146:[function(_dereq_,module,exports){ +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = _dereq_(32); + +$export($export.P, 'Function', {bind: _dereq_(16)}); +},{"16":16,"32":32}],147:[function(_dereq_,module,exports){ +'use strict'; +var isObject = _dereq_(49) + , getPrototypeOf = _dereq_(74) + , HAS_INSTANCE = _dereq_(117)('hasInstance') + , FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if(!(HAS_INSTANCE in FunctionProto))_dereq_(67).f(FunctionProto, HAS_INSTANCE, {value: function(O){ + if(typeof this != 'function' || !isObject(O))return false; + if(!isObject(this.prototype))return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while(O = getPrototypeOf(O))if(this.prototype === O)return true; + return false; +}}); +},{"117":117,"49":49,"67":67,"74":74}],148:[function(_dereq_,module,exports){ +var dP = _dereq_(67).f + , createDesc = _dereq_(85) + , has = _dereq_(39) + , FProto = Function.prototype + , nameRE = /^\s*function ([^ (]*)/ + , NAME = 'name'; + +var isExtensible = Object.isExtensible || function(){ + return true; +}; + +// 19.2.4.2 name +NAME in FProto || _dereq_(28) && dP(FProto, NAME, { + configurable: true, + get: function(){ + try { + var that = this + , name = ('' + that).match(nameRE)[1]; + has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name)); + return name; + } catch(e){ + return ''; + } + } +}); +},{"28":28,"39":39,"67":67,"85":85}],149:[function(_dereq_,module,exports){ +'use strict'; +var strong = _dereq_(19); + +// 23.1 Map Objects +module.exports = _dereq_(22)('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } +}, strong, true); +},{"19":19,"22":22}],150:[function(_dereq_,module,exports){ +// 20.2.2.3 Math.acosh(x) +var $export = _dereq_(32) + , log1p = _dereq_(60) + , sqrt = Math.sqrt + , $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x){ + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); +},{"32":32,"60":60}],151:[function(_dereq_,module,exports){ +// 20.2.2.5 Math.asinh(x) +var $export = _dereq_(32) + , $asinh = Math.asinh; + +function asinh(x){ + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); +},{"32":32}],152:[function(_dereq_,module,exports){ +// 20.2.2.7 Math.atanh(x) +var $export = _dereq_(32) + , $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x){ + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); +},{"32":32}],153:[function(_dereq_,module,exports){ +// 20.2.2.9 Math.cbrt(x) +var $export = _dereq_(32) + , sign = _dereq_(61); + +$export($export.S, 'Math', { + cbrt: function cbrt(x){ + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); +},{"32":32,"61":61}],154:[function(_dereq_,module,exports){ +// 20.2.2.11 Math.clz32(x) +var $export = _dereq_(32); + +$export($export.S, 'Math', { + clz32: function clz32(x){ + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); +},{"32":32}],155:[function(_dereq_,module,exports){ +// 20.2.2.12 Math.cosh(x) +var $export = _dereq_(32) + , exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x){ + return (exp(x = +x) + exp(-x)) / 2; + } +}); +},{"32":32}],156:[function(_dereq_,module,exports){ +// 20.2.2.14 Math.expm1(x) +var $export = _dereq_(32) + , $expm1 = _dereq_(59); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); +},{"32":32,"59":59}],157:[function(_dereq_,module,exports){ +// 20.2.2.16 Math.fround(x) +var $export = _dereq_(32) + , sign = _dereq_(61) + , pow = Math.pow + , EPSILON = pow(2, -52) + , EPSILON32 = pow(2, -23) + , MAX32 = pow(2, 127) * (2 - EPSILON32) + , MIN32 = pow(2, -126); + +var roundTiesToEven = function(n){ + return n + 1 / EPSILON - 1 / EPSILON; +}; + + +$export($export.S, 'Math', { + fround: function fround(x){ + var $abs = Math.abs(x) + , $sign = sign(x) + , a, result; + if($abs < MIN32)return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + if(result > MAX32 || result != result)return $sign * Infinity; + return $sign * result; + } +}); +},{"32":32,"61":61}],158:[function(_dereq_,module,exports){ +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = _dereq_(32) + , abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2){ // eslint-disable-line no-unused-vars + var sum = 0 + , i = 0 + , aLen = arguments.length + , larg = 0 + , arg, div; + while(i < aLen){ + arg = abs(arguments[i++]); + if(larg < arg){ + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if(arg > 0){ + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); +},{"32":32}],159:[function(_dereq_,module,exports){ +// 20.2.2.18 Math.imul(x, y) +var $export = _dereq_(32) + , $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * _dereq_(34)(function(){ + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y){ + var UINT16 = 0xffff + , xn = +x + , yn = +y + , xl = UINT16 & xn + , yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); +},{"32":32,"34":34}],160:[function(_dereq_,module,exports){ +// 20.2.2.21 Math.log10(x) +var $export = _dereq_(32); + +$export($export.S, 'Math', { + log10: function log10(x){ + return Math.log(x) / Math.LN10; + } +}); +},{"32":32}],161:[function(_dereq_,module,exports){ +// 20.2.2.20 Math.log1p(x) +var $export = _dereq_(32); + +$export($export.S, 'Math', {log1p: _dereq_(60)}); +},{"32":32,"60":60}],162:[function(_dereq_,module,exports){ +// 20.2.2.22 Math.log2(x) +var $export = _dereq_(32); + +$export($export.S, 'Math', { + log2: function log2(x){ + return Math.log(x) / Math.LN2; + } +}); +},{"32":32}],163:[function(_dereq_,module,exports){ +// 20.2.2.28 Math.sign(x) +var $export = _dereq_(32); + +$export($export.S, 'Math', {sign: _dereq_(61)}); +},{"32":32,"61":61}],164:[function(_dereq_,module,exports){ +// 20.2.2.30 Math.sinh(x) +var $export = _dereq_(32) + , expm1 = _dereq_(59) + , exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * _dereq_(34)(function(){ + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x){ + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); +},{"32":32,"34":34,"59":59}],165:[function(_dereq_,module,exports){ +// 20.2.2.33 Math.tanh(x) +var $export = _dereq_(32) + , expm1 = _dereq_(59) + , exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x){ + var a = expm1(x = +x) + , b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); +},{"32":32,"59":59}],166:[function(_dereq_,module,exports){ +// 20.2.2.34 Math.trunc(x) +var $export = _dereq_(32); + +$export($export.S, 'Math', { + trunc: function trunc(it){ + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); +},{"32":32}],167:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(38) + , has = _dereq_(39) + , cof = _dereq_(18) + , inheritIfRequired = _dereq_(43) + , toPrimitive = _dereq_(110) + , fails = _dereq_(34) + , gOPN = _dereq_(72).f + , gOPD = _dereq_(70).f + , dP = _dereq_(67).f + , $trim = _dereq_(102).trim + , NUMBER = 'Number' + , $Number = global[NUMBER] + , Base = $Number + , proto = $Number.prototype + // Opera ~12 has broken Object#toString + , BROKEN_COF = cof(_dereq_(66)(proto)) == NUMBER + , TRIM = 'trim' in String.prototype; + +// 7.1.3 ToNumber(argument) +var toNumber = function(argument){ + var it = toPrimitive(argument, false); + if(typeof it == 'string' && it.length > 2){ + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0) + , third, radix, maxCode; + if(first === 43 || first === 45){ + third = it.charCodeAt(2); + if(third === 88 || third === 120)return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if(first === 48){ + switch(it.charCodeAt(1)){ + case 66 : case 98 : radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79 : case 111 : radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default : return +it; + } + for(var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++){ + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if(code < 48 || code > maxCode)return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ + $Number = function Number(value){ + var it = arguments.length < 1 ? 0 : value + , that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function(){ proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for(var keys = _dereq_(28) ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++){ + if(has(Base, key = keys[j]) && !has($Number, key)){ + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + _dereq_(87)(global, NUMBER, $Number); +} +},{"102":102,"110":110,"18":18,"28":28,"34":34,"38":38,"39":39,"43":43,"66":66,"67":67,"70":70,"72":72,"87":87}],168:[function(_dereq_,module,exports){ +// 20.1.2.1 Number.EPSILON +var $export = _dereq_(32); + +$export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); +},{"32":32}],169:[function(_dereq_,module,exports){ +// 20.1.2.2 Number.isFinite(number) +var $export = _dereq_(32) + , _isFinite = _dereq_(38).isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it){ + return typeof it == 'number' && _isFinite(it); + } +}); +},{"32":32,"38":38}],170:[function(_dereq_,module,exports){ +// 20.1.2.3 Number.isInteger(number) +var $export = _dereq_(32); + +$export($export.S, 'Number', {isInteger: _dereq_(48)}); +},{"32":32,"48":48}],171:[function(_dereq_,module,exports){ +// 20.1.2.4 Number.isNaN(number) +var $export = _dereq_(32); + +$export($export.S, 'Number', { + isNaN: function isNaN(number){ + return number != number; + } +}); +},{"32":32}],172:[function(_dereq_,module,exports){ +// 20.1.2.5 Number.isSafeInteger(number) +var $export = _dereq_(32) + , isInteger = _dereq_(48) + , abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number){ + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); +},{"32":32,"48":48}],173:[function(_dereq_,module,exports){ +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = _dereq_(32); + +$export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); +},{"32":32}],174:[function(_dereq_,module,exports){ +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = _dereq_(32); + +$export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); +},{"32":32}],175:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , $parseFloat = _dereq_(81); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); +},{"32":32,"81":81}],176:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , $parseInt = _dereq_(82); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); +},{"32":32,"82":82}],177:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , toInteger = _dereq_(106) + , aNumberValue = _dereq_(4) + , repeat = _dereq_(101) + , $toFixed = 1..toFixed + , floor = Math.floor + , data = [0, 0, 0, 0, 0, 0] + , ERROR = 'Number.toFixed: incorrect invocation!' + , ZERO = '0'; + +var multiply = function(n, c){ + var i = -1 + , c2 = c; + while(++i < 6){ + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function(n){ + var i = 6 + , c = 0; + while(--i >= 0){ + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function(){ + var i = 6 + , s = ''; + while(--i >= 0){ + if(s !== '' || i === 0 || data[i] !== 0){ + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function(x, n, acc){ + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function(x){ + var n = 0 + , x2 = x; + while(x2 >= 4096){ + n += 12; + x2 /= 4096; + } + while(x2 >= 2){ + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128..toFixed(0) !== '1000000000000000128' +) || !_dereq_(34)(function(){ + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits){ + var x = aNumberValue(this, ERROR) + , f = toInteger(fractionDigits) + , s = '' + , m = ZERO + , e, z, j, k; + if(f < 0 || f > 20)throw RangeError(ERROR); + if(x != x)return 'NaN'; + if(x <= -1e21 || x >= 1e21)return String(x); + if(x < 0){ + s = '-'; + x = -x; + } + if(x > 1e-21){ + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if(e > 0){ + multiply(0, z); + j = f; + while(j >= 7){ + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while(j >= 23){ + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if(f > 0){ + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); +},{"101":101,"106":106,"32":32,"34":34,"4":4}],178:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $fails = _dereq_(34) + , aNumberValue = _dereq_(4) + , $toPrecision = 1..toPrecision; + +$export($export.P + $export.F * ($fails(function(){ + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function(){ + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision){ + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); +},{"32":32,"34":34,"4":4}],179:[function(_dereq_,module,exports){ +// 19.1.3.1 Object.assign(target, source) +var $export = _dereq_(32); + +$export($export.S + $export.F, 'Object', {assign: _dereq_(65)}); +},{"32":32,"65":65}],180:[function(_dereq_,module,exports){ +var $export = _dereq_(32) +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', {create: _dereq_(66)}); +},{"32":32,"66":66}],181:[function(_dereq_,module,exports){ +var $export = _dereq_(32); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !_dereq_(28), 'Object', {defineProperties: _dereq_(68)}); +},{"28":28,"32":32,"68":68}],182:[function(_dereq_,module,exports){ +var $export = _dereq_(32); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !_dereq_(28), 'Object', {defineProperty: _dereq_(67).f}); +},{"28":28,"32":32,"67":67}],183:[function(_dereq_,module,exports){ +// 19.1.2.5 Object.freeze(O) +var isObject = _dereq_(49) + , meta = _dereq_(62).onFreeze; + +_dereq_(78)('freeze', function($freeze){ + return function freeze(it){ + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); +},{"49":49,"62":62,"78":78}],184:[function(_dereq_,module,exports){ +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = _dereq_(107) + , $getOwnPropertyDescriptor = _dereq_(70).f; + +_dereq_(78)('getOwnPropertyDescriptor', function(){ + return function getOwnPropertyDescriptor(it, key){ + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); +},{"107":107,"70":70,"78":78}],185:[function(_dereq_,module,exports){ +// 19.1.2.7 Object.getOwnPropertyNames(O) +_dereq_(78)('getOwnPropertyNames', function(){ + return _dereq_(71).f; +}); +},{"71":71,"78":78}],186:[function(_dereq_,module,exports){ +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = _dereq_(109) + , $getPrototypeOf = _dereq_(74); + +_dereq_(78)('getPrototypeOf', function(){ + return function getPrototypeOf(it){ + return $getPrototypeOf(toObject(it)); + }; +}); +},{"109":109,"74":74,"78":78}],187:[function(_dereq_,module,exports){ +// 19.1.2.11 Object.isExtensible(O) +var isObject = _dereq_(49); + +_dereq_(78)('isExtensible', function($isExtensible){ + return function isExtensible(it){ + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); +},{"49":49,"78":78}],188:[function(_dereq_,module,exports){ +// 19.1.2.12 Object.isFrozen(O) +var isObject = _dereq_(49); + +_dereq_(78)('isFrozen', function($isFrozen){ + return function isFrozen(it){ + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); +},{"49":49,"78":78}],189:[function(_dereq_,module,exports){ +// 19.1.2.13 Object.isSealed(O) +var isObject = _dereq_(49); + +_dereq_(78)('isSealed', function($isSealed){ + return function isSealed(it){ + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); +},{"49":49,"78":78}],190:[function(_dereq_,module,exports){ +// 19.1.3.10 Object.is(value1, value2) +var $export = _dereq_(32); +$export($export.S, 'Object', {is: _dereq_(89)}); +},{"32":32,"89":89}],191:[function(_dereq_,module,exports){ +// 19.1.2.14 Object.keys(O) +var toObject = _dereq_(109) + , $keys = _dereq_(76); + +_dereq_(78)('keys', function(){ + return function keys(it){ + return $keys(toObject(it)); + }; +}); +},{"109":109,"76":76,"78":78}],192:[function(_dereq_,module,exports){ +// 19.1.2.15 Object.preventExtensions(O) +var isObject = _dereq_(49) + , meta = _dereq_(62).onFreeze; + +_dereq_(78)('preventExtensions', function($preventExtensions){ + return function preventExtensions(it){ + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); +},{"49":49,"62":62,"78":78}],193:[function(_dereq_,module,exports){ +// 19.1.2.17 Object.seal(O) +var isObject = _dereq_(49) + , meta = _dereq_(62).onFreeze; + +_dereq_(78)('seal', function($seal){ + return function seal(it){ + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); +},{"49":49,"62":62,"78":78}],194:[function(_dereq_,module,exports){ +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = _dereq_(32); +$export($export.S, 'Object', {setPrototypeOf: _dereq_(90).set}); +},{"32":32,"90":90}],195:[function(_dereq_,module,exports){ +'use strict'; +// 19.1.3.6 Object.prototype.toString() +var classof = _dereq_(17) + , test = {}; +test[_dereq_(117)('toStringTag')] = 'z'; +if(test + '' != '[object z]'){ + _dereq_(87)(Object.prototype, 'toString', function toString(){ + return '[object ' + classof(this) + ']'; + }, true); +} +},{"117":117,"17":17,"87":87}],196:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , $parseFloat = _dereq_(81); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); +},{"32":32,"81":81}],197:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , $parseInt = _dereq_(82); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); +},{"32":32,"82":82}],198:[function(_dereq_,module,exports){ +'use strict'; +var LIBRARY = _dereq_(58) + , global = _dereq_(38) + , ctx = _dereq_(25) + , classof = _dereq_(17) + , $export = _dereq_(32) + , isObject = _dereq_(49) + , aFunction = _dereq_(3) + , anInstance = _dereq_(6) + , forOf = _dereq_(37) + , speciesConstructor = _dereq_(95) + , task = _dereq_(104).set + , microtask = _dereq_(64)() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + +var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[_dereq_(117)('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } +}(); + +// helpers +var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; +}; +var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); +}; +var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +}; +var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } +}; +var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); +}; +var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); +}; +var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; +}; +var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); +}; +var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } +}; + +// constructor polyfill +if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = _dereq_(86)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); +_dereq_(92)($Promise, PROMISE); +_dereq_(91)(PROMISE); +Wrapper = _dereq_(23)[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } +}); +$export($export.S + $export.F * !(USE_NATIVE && _dereq_(54)(function(iter){ + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } +}); +},{"104":104,"117":117,"17":17,"23":23,"25":25,"3":3,"32":32,"37":37,"38":38,"49":49,"54":54,"58":58,"6":6,"64":64,"86":86,"91":91,"92":92,"95":95}],199:[function(_dereq_,module,exports){ +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = _dereq_(32) + , aFunction = _dereq_(3) + , anObject = _dereq_(7) + , rApply = (_dereq_(38).Reflect || {}).apply + , fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !_dereq_(34)(function(){ + rApply(function(){}); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList){ + var T = aFunction(target) + , L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); +},{"3":3,"32":32,"34":34,"38":38,"7":7}],200:[function(_dereq_,module,exports){ +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = _dereq_(32) + , create = _dereq_(66) + , aFunction = _dereq_(3) + , anObject = _dereq_(7) + , isObject = _dereq_(49) + , fails = _dereq_(34) + , bind = _dereq_(16) + , rConstruct = (_dereq_(38).Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function(){ + function F(){} + return !(rConstruct(function(){}, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function(){ + rConstruct(function(){}); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /*, newTarget*/){ + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget); + if(Target == newTarget){ + // w/o altered newTarget, optimization for 0-4 arguments + switch(args.length){ + case 0: return new Target; + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args)); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype + , instance = create(isObject(proto) ? proto : Object.prototype) + , result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); +},{"16":16,"3":3,"32":32,"34":34,"38":38,"49":49,"66":66,"7":7}],201:[function(_dereq_,module,exports){ +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = _dereq_(67) + , $export = _dereq_(32) + , anObject = _dereq_(7) + , toPrimitive = _dereq_(110); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * _dereq_(34)(function(){ + Reflect.defineProperty(dP.f({}, 1, {value: 1}), 1, {value: 2}); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes){ + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch(e){ + return false; + } + } +}); +},{"110":110,"32":32,"34":34,"67":67,"7":7}],202:[function(_dereq_,module,exports){ +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = _dereq_(32) + , gOPD = _dereq_(70).f + , anObject = _dereq_(7); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey){ + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); +},{"32":32,"7":7,"70":70}],203:[function(_dereq_,module,exports){ +'use strict'; +// 26.1.5 Reflect.enumerate(target) +var $export = _dereq_(32) + , anObject = _dereq_(7); +var Enumerate = function(iterated){ + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = [] // keys + , key; + for(key in iterated)keys.push(key); +}; +_dereq_(52)(Enumerate, 'Object', function(){ + var that = this + , keys = that._k + , key; + do { + if(that._i >= keys.length)return {value: undefined, done: true}; + } while(!((key = keys[that._i++]) in that._t)); + return {value: key, done: false}; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target){ + return new Enumerate(target); + } +}); +},{"32":32,"52":52,"7":7}],204:[function(_dereq_,module,exports){ +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = _dereq_(70) + , $export = _dereq_(32) + , anObject = _dereq_(7); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey){ + return gOPD.f(anObject(target), propertyKey); + } +}); +},{"32":32,"7":7,"70":70}],205:[function(_dereq_,module,exports){ +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = _dereq_(32) + , getProto = _dereq_(74) + , anObject = _dereq_(7); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target){ + return getProto(anObject(target)); + } +}); +},{"32":32,"7":7,"74":74}],206:[function(_dereq_,module,exports){ +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = _dereq_(70) + , getPrototypeOf = _dereq_(74) + , has = _dereq_(39) + , $export = _dereq_(32) + , isObject = _dereq_(49) + , anObject = _dereq_(7); + +function get(target, propertyKey/*, receiver*/){ + var receiver = arguments.length < 3 ? target : arguments[2] + , desc, proto; + if(anObject(target) === receiver)return target[propertyKey]; + if(desc = gOPD.f(target, propertyKey))return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', {get: get}); +},{"32":32,"39":39,"49":49,"7":7,"70":70,"74":74}],207:[function(_dereq_,module,exports){ +// 26.1.9 Reflect.has(target, propertyKey) +var $export = _dereq_(32); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey){ + return propertyKey in target; + } +}); +},{"32":32}],208:[function(_dereq_,module,exports){ +// 26.1.10 Reflect.isExtensible(target) +var $export = _dereq_(32) + , anObject = _dereq_(7) + , $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target){ + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); +},{"32":32,"7":7}],209:[function(_dereq_,module,exports){ +// 26.1.11 Reflect.ownKeys(target) +var $export = _dereq_(32); + +$export($export.S, 'Reflect', {ownKeys: _dereq_(80)}); +},{"32":32,"80":80}],210:[function(_dereq_,module,exports){ +// 26.1.12 Reflect.preventExtensions(target) +var $export = _dereq_(32) + , anObject = _dereq_(7) + , $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target){ + anObject(target); + try { + if($preventExtensions)$preventExtensions(target); + return true; + } catch(e){ + return false; + } + } +}); +},{"32":32,"7":7}],211:[function(_dereq_,module,exports){ +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = _dereq_(32) + , setProto = _dereq_(90); + +if(setProto)$export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto){ + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch(e){ + return false; + } + } +}); +},{"32":32,"90":90}],212:[function(_dereq_,module,exports){ +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = _dereq_(67) + , gOPD = _dereq_(70) + , getPrototypeOf = _dereq_(74) + , has = _dereq_(39) + , $export = _dereq_(32) + , createDesc = _dereq_(85) + , anObject = _dereq_(7) + , isObject = _dereq_(49); + +function set(target, propertyKey, V/*, receiver*/){ + var receiver = arguments.length < 4 ? target : arguments[3] + , ownDesc = gOPD.f(anObject(target), propertyKey) + , existingDescriptor, proto; + if(!ownDesc){ + if(isObject(proto = getPrototypeOf(target))){ + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if(has(ownDesc, 'value')){ + if(ownDesc.writable === false || !isObject(receiver))return false; + existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0); + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', {set: set}); +},{"32":32,"39":39,"49":49,"67":67,"7":7,"70":70,"74":74,"85":85}],213:[function(_dereq_,module,exports){ +var global = _dereq_(38) + , inheritIfRequired = _dereq_(43) + , dP = _dereq_(67).f + , gOPN = _dereq_(72).f + , isRegExp = _dereq_(50) + , $flags = _dereq_(36) + , $RegExp = global.RegExp + , Base = $RegExp + , proto = $RegExp.prototype + , re1 = /a/g + , re2 = /a/g + // "new" creates a new object, old webkit buggy here + , CORRECT_NEW = new $RegExp(re1) !== re1; + +if(_dereq_(28) && (!CORRECT_NEW || _dereq_(34)(function(){ + re2[_dereq_(117)('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; +}))){ + $RegExp = function RegExp(p, f){ + var tiRE = this instanceof $RegExp + , piRE = isRegExp(p) + , fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function(key){ + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function(){ return Base[key]; }, + set: function(it){ Base[key] = it; } + }); + }; + for(var keys = gOPN(Base), i = 0; keys.length > i; )proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + _dereq_(87)(global, 'RegExp', $RegExp); +} + +_dereq_(91)('RegExp'); +},{"117":117,"28":28,"34":34,"36":36,"38":38,"43":43,"50":50,"67":67,"72":72,"87":87,"91":91}],214:[function(_dereq_,module,exports){ +// 21.2.5.3 get RegExp.prototype.flags() +if(_dereq_(28) && /./g.flags != 'g')_dereq_(67).f(RegExp.prototype, 'flags', { + configurable: true, + get: _dereq_(36) +}); +},{"28":28,"36":36,"67":67}],215:[function(_dereq_,module,exports){ +// @@match logic +_dereq_(35)('match', 1, function(defined, MATCH, $match){ + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; +}); +},{"35":35}],216:[function(_dereq_,module,exports){ +// @@replace logic +_dereq_(35)('replace', 2, function(defined, REPLACE, $replace){ + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue){ + 'use strict'; + var O = defined(this) + , fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; +}); +},{"35":35}],217:[function(_dereq_,module,exports){ +// @@search logic +_dereq_(35)('search', 1, function(defined, SEARCH, $search){ + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp){ + 'use strict'; + var O = defined(this) + , fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; +}); +},{"35":35}],218:[function(_dereq_,module,exports){ +// @@split logic +_dereq_(35)('split', 2, function(defined, SPLIT, $split){ + 'use strict'; + var isRegExp = _dereq_(50) + , _split = $split + , $push = [].push + , $SPLIT = 'split' + , LENGTH = 'length' + , LAST_INDEX = 'lastIndex'; + if( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ){ + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function(separator, limit){ + var string = String(this); + if(separator === undefined && limit === 0)return []; + // If `separator` is not a regex, use native split + if(!isRegExp(separator))return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if(!NPCG)separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while(match = separatorCopy.exec(string)){ + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if(lastIndex > lastLastIndex){ + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + if(!NPCG && match[LENGTH] > 1)match[0].replace(separator2, function(){ + for(i = 1; i < arguments[LENGTH] - 2; i++)if(arguments[i] === undefined)match[i] = undefined; + }); + if(match[LENGTH] > 1 && match.index < string[LENGTH])$push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if(output[LENGTH] >= splitLimit)break; + } + if(separatorCopy[LAST_INDEX] === match.index)separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if(lastLastIndex === string[LENGTH]){ + if(lastLength || !separatorCopy.test(''))output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if('0'[$SPLIT](undefined, 0)[LENGTH]){ + $split = function(separator, limit){ + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit){ + var O = defined(this) + , fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; +}); +},{"35":35,"50":50}],219:[function(_dereq_,module,exports){ +'use strict'; +_dereq_(214); +var anObject = _dereq_(7) + , $flags = _dereq_(36) + , DESCRIPTORS = _dereq_(28) + , TO_STRING = 'toString' + , $toString = /./[TO_STRING]; + +var define = function(fn){ + _dereq_(87)(RegExp.prototype, TO_STRING, fn, true); +}; + +// 21.2.5.14 RegExp.prototype.toString() +if(_dereq_(34)(function(){ return $toString.call({source: 'a', flags: 'b'}) != '/a/b'; })){ + define(function toString(){ + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if($toString.name != TO_STRING){ + define(function toString(){ + return $toString.call(this); + }); +} +},{"214":214,"28":28,"34":34,"36":36,"7":7,"87":87}],220:[function(_dereq_,module,exports){ +'use strict'; +var strong = _dereq_(19); + +// 23.2 Set Objects +module.exports = _dereq_(22)('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } +}, strong); +},{"19":19,"22":22}],221:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.2 String.prototype.anchor(name) +_dereq_(99)('anchor', function(createHTML){ + return function anchor(name){ + return createHTML(this, 'a', 'name', name); + } +}); +},{"99":99}],222:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.3 String.prototype.big() +_dereq_(99)('big', function(createHTML){ + return function big(){ + return createHTML(this, 'big', '', ''); + } +}); +},{"99":99}],223:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.4 String.prototype.blink() +_dereq_(99)('blink', function(createHTML){ + return function blink(){ + return createHTML(this, 'blink', '', ''); + } +}); +},{"99":99}],224:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.5 String.prototype.bold() +_dereq_(99)('bold', function(createHTML){ + return function bold(){ + return createHTML(this, 'b', '', ''); + } +}); +},{"99":99}],225:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $at = _dereq_(97)(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos){ + return $at(this, pos); + } +}); +},{"32":32,"97":97}],226:[function(_dereq_,module,exports){ +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) +'use strict'; +var $export = _dereq_(32) + , toLength = _dereq_(108) + , context = _dereq_(98) + , ENDS_WITH = 'endsWith' + , $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * _dereq_(33)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /*, endPosition = @length */){ + var that = context(this, searchString, ENDS_WITH) + , endPosition = arguments.length > 1 ? arguments[1] : undefined + , len = toLength(that.length) + , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len) + , search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); +},{"108":108,"32":32,"33":33,"98":98}],227:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.6 String.prototype.fixed() +_dereq_(99)('fixed', function(createHTML){ + return function fixed(){ + return createHTML(this, 'tt', '', ''); + } +}); +},{"99":99}],228:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.7 String.prototype.fontcolor(color) +_dereq_(99)('fontcolor', function(createHTML){ + return function fontcolor(color){ + return createHTML(this, 'font', 'color', color); + } +}); +},{"99":99}],229:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.8 String.prototype.fontsize(size) +_dereq_(99)('fontsize', function(createHTML){ + return function fontsize(size){ + return createHTML(this, 'font', 'size', size); + } +}); +},{"99":99}],230:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , toIndex = _dereq_(105) + , fromCharCode = String.fromCharCode + , $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x){ // eslint-disable-line no-unused-vars + var res = [] + , aLen = arguments.length + , i = 0 + , code; + while(aLen > i){ + code = +arguments[i++]; + if(toIndex(code, 0x10ffff) !== code)throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); +},{"105":105,"32":32}],231:[function(_dereq_,module,exports){ +// 21.1.3.7 String.prototype.includes(searchString, position = 0) +'use strict'; +var $export = _dereq_(32) + , context = _dereq_(98) + , INCLUDES = 'includes'; + +$export($export.P + $export.F * _dereq_(33)(INCLUDES), 'String', { + includes: function includes(searchString /*, position = 0 */){ + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); +},{"32":32,"33":33,"98":98}],232:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.9 String.prototype.italics() +_dereq_(99)('italics', function(createHTML){ + return function italics(){ + return createHTML(this, 'i', '', ''); + } +}); +},{"99":99}],233:[function(_dereq_,module,exports){ +'use strict'; +var $at = _dereq_(97)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +_dereq_(53)(String, 'String', function(iterated){ + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function(){ + var O = this._t + , index = this._i + , point; + if(index >= O.length)return {value: undefined, done: true}; + point = $at(O, index); + this._i += point.length; + return {value: point, done: false}; +}); +},{"53":53,"97":97}],234:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.10 String.prototype.link(url) +_dereq_(99)('link', function(createHTML){ + return function link(url){ + return createHTML(this, 'a', 'href', url); + } +}); +},{"99":99}],235:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , toIObject = _dereq_(107) + , toLength = _dereq_(108); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite){ + var tpl = toIObject(callSite.raw) + , len = toLength(tpl.length) + , aLen = arguments.length + , res = [] + , i = 0; + while(len > i){ + res.push(String(tpl[i++])); + if(i < aLen)res.push(String(arguments[i])); + } return res.join(''); + } +}); +},{"107":107,"108":108,"32":32}],236:[function(_dereq_,module,exports){ +var $export = _dereq_(32); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: _dereq_(101) +}); +},{"101":101,"32":32}],237:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.11 String.prototype.small() +_dereq_(99)('small', function(createHTML){ + return function small(){ + return createHTML(this, 'small', '', ''); + } +}); +},{"99":99}],238:[function(_dereq_,module,exports){ +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) +'use strict'; +var $export = _dereq_(32) + , toLength = _dereq_(108) + , context = _dereq_(98) + , STARTS_WITH = 'startsWith' + , $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * _dereq_(33)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /*, position = 0 */){ + var that = context(this, searchString, STARTS_WITH) + , index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)) + , search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); +},{"108":108,"32":32,"33":33,"98":98}],239:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.12 String.prototype.strike() +_dereq_(99)('strike', function(createHTML){ + return function strike(){ + return createHTML(this, 'strike', '', ''); + } +}); +},{"99":99}],240:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.13 String.prototype.sub() +_dereq_(99)('sub', function(createHTML){ + return function sub(){ + return createHTML(this, 'sub', '', ''); + } +}); +},{"99":99}],241:[function(_dereq_,module,exports){ +'use strict'; +// B.2.3.14 String.prototype.sup() +_dereq_(99)('sup', function(createHTML){ + return function sup(){ + return createHTML(this, 'sup', '', ''); + } +}); +},{"99":99}],242:[function(_dereq_,module,exports){ +'use strict'; +// 21.1.3.25 String.prototype.trim() +_dereq_(102)('trim', function($trim){ + return function trim(){ + return $trim(this, 3); + }; +}); +},{"102":102}],243:[function(_dereq_,module,exports){ +'use strict'; +// ECMAScript 6 symbols shim +var global = _dereq_(38) + , has = _dereq_(39) + , DESCRIPTORS = _dereq_(28) + , $export = _dereq_(32) + , redefine = _dereq_(87) + , META = _dereq_(62).KEY + , $fails = _dereq_(34) + , shared = _dereq_(94) + , setToStringTag = _dereq_(92) + , uid = _dereq_(114) + , wks = _dereq_(117) + , wksExt = _dereq_(116) + , wksDefine = _dereq_(115) + , keyOf = _dereq_(57) + , enumKeys = _dereq_(31) + , isArray = _dereq_(47) + , anObject = _dereq_(7) + , toIObject = _dereq_(107) + , toPrimitive = _dereq_(110) + , createDesc = _dereq_(85) + , _create = _dereq_(66) + , gOPNExt = _dereq_(71) + , $GOPD = _dereq_(70) + , $DP = _dereq_(67) + , $keys = _dereq_(76) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; +}) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; +} : function(it){ + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + _dereq_(72).f = gOPNExt.f = $getOwnPropertyNames; + _dereq_(77).f = $propertyIsEnumerable; + _dereq_(73).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !_dereq_(58)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + +for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + +for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || _dereq_(40)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); +},{"107":107,"110":110,"114":114,"115":115,"116":116,"117":117,"28":28,"31":31,"32":32,"34":34,"38":38,"39":39,"40":40,"47":47,"57":57,"58":58,"62":62,"66":66,"67":67,"7":7,"70":70,"71":71,"72":72,"73":73,"76":76,"77":77,"85":85,"87":87,"92":92,"94":94}],244:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , $typed = _dereq_(113) + , buffer = _dereq_(112) + , anObject = _dereq_(7) + , toIndex = _dereq_(105) + , toLength = _dereq_(108) + , isObject = _dereq_(49) + , ArrayBuffer = _dereq_(38).ArrayBuffer + , speciesConstructor = _dereq_(95) + , $ArrayBuffer = buffer.ArrayBuffer + , $DataView = buffer.DataView + , $isView = $typed.ABV && ArrayBuffer.isView + , $slice = $ArrayBuffer.prototype.slice + , VIEW = $typed.VIEW + , ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), {ArrayBuffer: $ArrayBuffer}); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it){ + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * _dereq_(34)(function(){ + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end){ + if($slice !== undefined && end === undefined)return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength + , first = toIndex(start, len) + , final = toIndex(end === undefined ? len : end, len) + , result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first)) + , viewS = new $DataView(this) + , viewT = new $DataView(result) + , index = 0; + while(first < final){ + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +_dereq_(91)(ARRAY_BUFFER); +},{"105":105,"108":108,"112":112,"113":113,"32":32,"34":34,"38":38,"49":49,"7":7,"91":91,"95":95}],245:[function(_dereq_,module,exports){ +var $export = _dereq_(32); +$export($export.G + $export.W + $export.F * !_dereq_(113).ABV, { + DataView: _dereq_(112).DataView +}); +},{"112":112,"113":113,"32":32}],246:[function(_dereq_,module,exports){ +_dereq_(111)('Float32', 4, function(init){ + return function Float32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); +},{"111":111}],247:[function(_dereq_,module,exports){ +_dereq_(111)('Float64', 8, function(init){ + return function Float64Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); +},{"111":111}],248:[function(_dereq_,module,exports){ +_dereq_(111)('Int16', 2, function(init){ + return function Int16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); +},{"111":111}],249:[function(_dereq_,module,exports){ +_dereq_(111)('Int32', 4, function(init){ + return function Int32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); +},{"111":111}],250:[function(_dereq_,module,exports){ +_dereq_(111)('Int8', 1, function(init){ + return function Int8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); +},{"111":111}],251:[function(_dereq_,module,exports){ +_dereq_(111)('Uint16', 2, function(init){ + return function Uint16Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); +},{"111":111}],252:[function(_dereq_,module,exports){ +_dereq_(111)('Uint32', 4, function(init){ + return function Uint32Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); +},{"111":111}],253:[function(_dereq_,module,exports){ +_dereq_(111)('Uint8', 1, function(init){ + return function Uint8Array(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}); +},{"111":111}],254:[function(_dereq_,module,exports){ +_dereq_(111)('Uint8', 1, function(init){ + return function Uint8ClampedArray(data, byteOffset, length){ + return init(this, data, byteOffset, length); + }; +}, true); +},{"111":111}],255:[function(_dereq_,module,exports){ +'use strict'; +var each = _dereq_(12)(0) + , redefine = _dereq_(87) + , meta = _dereq_(62) + , assign = _dereq_(65) + , weak = _dereq_(21) + , isObject = _dereq_(49) + , getWeak = meta.getWeak + , isExtensible = Object.isExtensible + , uncaughtFrozenStore = weak.ufstore + , tmp = {} + , InternalMap; + +var wrapper = function(get){ + return function WeakMap(){ + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}; + +var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key){ + if(isObject(key)){ + var data = getWeak(key); + if(data === true)return uncaughtFrozenStore(this).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value){ + return weak.def(this, key, value); + } +}; + +// 23.3 WeakMap Objects +var $WeakMap = module.exports = _dereq_(22)('WeakMap', wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ + InternalMap = weak.getConstructor(wrapper); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function(key){ + var proto = $WeakMap.prototype + , method = proto[key]; + redefine(proto, key, function(a, b){ + // store frozen objects on internal weakmap shim + if(isObject(a) && !isExtensible(a)){ + if(!this._f)this._f = new InternalMap; + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); +} +},{"12":12,"21":21,"22":22,"49":49,"62":62,"65":65,"87":87}],256:[function(_dereq_,module,exports){ +'use strict'; +var weak = _dereq_(21); + +// 23.4 WeakSet Objects +_dereq_(22)('WeakSet', function(get){ + return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value){ + return weak.def(this, value, true); + } +}, weak, false, true); +},{"21":21,"22":22}],257:[function(_dereq_,module,exports){ +'use strict'; +// https://github.com/tc39/Array.prototype.includes +var $export = _dereq_(32) + , $includes = _dereq_(11)(true); + +$export($export.P, 'Array', { + includes: function includes(el /*, fromIndex = 0 */){ + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +_dereq_(5)('includes'); +},{"11":11,"32":32,"5":5}],258:[function(_dereq_,module,exports){ +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = _dereq_(32) + , microtask = _dereq_(64)() + , process = _dereq_(38).process + , isNode = _dereq_(18)(process) == 'process'; + +$export($export.G, { + asap: function asap(fn){ + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); +},{"18":18,"32":32,"38":38,"64":64}],259:[function(_dereq_,module,exports){ +// https://github.com/ljharb/proposal-is-error +var $export = _dereq_(32) + , cof = _dereq_(18); + +$export($export.S, 'Error', { + isError: function isError(it){ + return cof(it) === 'Error'; + } +}); +},{"18":18,"32":32}],260:[function(_dereq_,module,exports){ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = _dereq_(32); + +$export($export.P + $export.R, 'Map', {toJSON: _dereq_(20)('Map')}); +},{"20":20,"32":32}],261:[function(_dereq_,module,exports){ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = _dereq_(32); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); +},{"32":32}],262:[function(_dereq_,module,exports){ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = _dereq_(32); + +$export($export.S, 'Math', { + imulh: function imulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >> 16 + , v1 = $v >> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); +},{"32":32}],263:[function(_dereq_,module,exports){ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = _dereq_(32); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1){ + var $x0 = x0 >>> 0 + , $x1 = x1 >>> 0 + , $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); +},{"32":32}],264:[function(_dereq_,module,exports){ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = _dereq_(32); + +$export($export.S, 'Math', { + umulh: function umulh(u, v){ + var UINT16 = 0xffff + , $u = +u + , $v = +v + , u0 = $u & UINT16 + , v0 = $v & UINT16 + , u1 = $u >>> 16 + , v1 = $v >>> 16 + , t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); +},{"32":32}],265:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , toObject = _dereq_(109) + , aFunction = _dereq_(3) + , $defineProperty = _dereq_(67); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +_dereq_(28) && $export($export.P + _dereq_(69), 'Object', { + __defineGetter__: function __defineGetter__(P, getter){ + $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); + } +}); +},{"109":109,"28":28,"3":3,"32":32,"67":67,"69":69}],266:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , toObject = _dereq_(109) + , aFunction = _dereq_(3) + , $defineProperty = _dereq_(67); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +_dereq_(28) && $export($export.P + _dereq_(69), 'Object', { + __defineSetter__: function __defineSetter__(P, setter){ + $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); + } +}); +},{"109":109,"28":28,"3":3,"32":32,"67":67,"69":69}],267:[function(_dereq_,module,exports){ +// https://github.com/tc39/proposal-object-values-entries +var $export = _dereq_(32) + , $entries = _dereq_(79)(true); + +$export($export.S, 'Object', { + entries: function entries(it){ + return $entries(it); + } +}); +},{"32":32,"79":79}],268:[function(_dereq_,module,exports){ +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = _dereq_(32) + , ownKeys = _dereq_(80) + , toIObject = _dereq_(107) + , gOPD = _dereq_(70) + , createProperty = _dereq_(24); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object){ + var O = toIObject(object) + , getDesc = gOPD.f + , keys = ownKeys(O) + , result = {} + , i = 0 + , key; + while(keys.length > i)createProperty(result, key = keys[i++], getDesc(O, key)); + return result; + } +}); +},{"107":107,"24":24,"32":32,"70":70,"80":80}],269:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , toObject = _dereq_(109) + , toPrimitive = _dereq_(110) + , getPrototypeOf = _dereq_(74) + , getOwnPropertyDescriptor = _dereq_(70).f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +_dereq_(28) && $export($export.P + _dereq_(69), 'Object', { + __lookupGetter__: function __lookupGetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.get; + } while(O = getPrototypeOf(O)); + } +}); +},{"109":109,"110":110,"28":28,"32":32,"69":69,"70":70,"74":74}],270:[function(_dereq_,module,exports){ +'use strict'; +var $export = _dereq_(32) + , toObject = _dereq_(109) + , toPrimitive = _dereq_(110) + , getPrototypeOf = _dereq_(74) + , getOwnPropertyDescriptor = _dereq_(70).f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +_dereq_(28) && $export($export.P + _dereq_(69), 'Object', { + __lookupSetter__: function __lookupSetter__(P){ + var O = toObject(this) + , K = toPrimitive(P, true) + , D; + do { + if(D = getOwnPropertyDescriptor(O, K))return D.set; + } while(O = getPrototypeOf(O)); + } +}); +},{"109":109,"110":110,"28":28,"32":32,"69":69,"70":70,"74":74}],271:[function(_dereq_,module,exports){ +// https://github.com/tc39/proposal-object-values-entries +var $export = _dereq_(32) + , $values = _dereq_(79)(false); + +$export($export.S, 'Object', { + values: function values(it){ + return $values(it); + } +}); +},{"32":32,"79":79}],272:[function(_dereq_,module,exports){ +'use strict'; +// https://github.com/zenparsing/es-observable +var $export = _dereq_(32) + , global = _dereq_(38) + , core = _dereq_(23) + , microtask = _dereq_(64)() + , OBSERVABLE = _dereq_(117)('observable') + , aFunction = _dereq_(3) + , anObject = _dereq_(7) + , anInstance = _dereq_(6) + , redefineAll = _dereq_(86) + , hide = _dereq_(40) + , forOf = _dereq_(37) + , RETURN = forOf.RETURN; + +var getMethod = function(fn){ + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function(subscription){ + var cleanup = subscription._c; + if(cleanup){ + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function(subscription){ + return subscription._o === undefined; +}; + +var closeSubscription = function(subscription){ + if(!subscriptionClosed(subscription)){ + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function(observer, subscriber){ + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer) + , subscription = cleanup; + if(cleanup != null){ + if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch(e){ + observer.error(e); + return; + } if(subscriptionClosed(this))cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe(){ closeSubscription(this); } +}); + +var SubscriptionObserver = function(subscription){ + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if(m)return m.call(observer, value); + } catch(e){ + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value){ + var subscription = this._s; + if(subscriptionClosed(subscription))throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if(!m)throw value; + value = m.call(observer, value); + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber){ + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer){ + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn){ + var that = this; + return new (core.Promise || global.Promise)(function(resolve, reject){ + aFunction(fn); + var subscription = that.subscribe({ + next : function(value){ + try { + return fn(value); + } catch(e){ + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x){ + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if(method){ + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function(observer){ + return observable.subscribe(observer); + }); + } + return new C(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + try { + if(forOf(x, false, function(it){ + observer.next(it); + if(done)return RETURN; + }) === RETURN)return; + } catch(e){ + if(done)throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + }, + of: function of(){ + for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + for(var i = 0; i < items.length; ++i){ + observer.next(items[i]); + if(done)return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function(){ return this; }); + +$export($export.G, {Observable: $Observable}); + +_dereq_(91)('Observable'); +},{"117":117,"23":23,"3":3,"32":32,"37":37,"38":38,"40":40,"6":6,"64":64,"7":7,"86":86,"91":91}],273:[function(_dereq_,module,exports){ +var metadata = _dereq_(63) + , anObject = _dereq_(7) + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +}}); +},{"63":63,"7":7}],274:[function(_dereq_,module,exports){ +var metadata = _dereq_(63) + , anObject = _dereq_(7) + , toMetaKey = metadata.key + , getOrCreateMetadataMap = metadata.map + , store = metadata.store; + +metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, targetKey */){ + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]) + , metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if(metadataMap === undefined || !metadataMap['delete'](metadataKey))return false; + if(metadataMap.size)return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +}}); +},{"63":63,"7":7}],275:[function(_dereq_,module,exports){ +var Set = _dereq_(220) + , from = _dereq_(10) + , metadata = _dereq_(63) + , anObject = _dereq_(7) + , getPrototypeOf = _dereq_(74) + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function(O, P){ + var oKeys = ordinaryOwnMetadataKeys(O, P) + , parent = getPrototypeOf(O); + if(parent === null)return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +}}); +},{"10":10,"220":220,"63":63,"7":7,"74":74}],276:[function(_dereq_,module,exports){ +var metadata = _dereq_(63) + , anObject = _dereq_(7) + , getPrototypeOf = _dereq_(74) + , ordinaryHasOwnMetadata = metadata.has + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + +var ordinaryGetMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); +},{"63":63,"7":7,"74":74}],277:[function(_dereq_,module,exports){ +var metadata = _dereq_(63) + , anObject = _dereq_(7) + , ordinaryOwnMetadataKeys = metadata.keys + , toMetaKey = metadata.key; + +metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +}}); +},{"63":63,"7":7}],278:[function(_dereq_,module,exports){ +var metadata = _dereq_(63) + , anObject = _dereq_(7) + , ordinaryGetOwnMetadata = metadata.get + , toMetaKey = metadata.key; + +metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); +},{"63":63,"7":7}],279:[function(_dereq_,module,exports){ +var metadata = _dereq_(63) + , anObject = _dereq_(7) + , getPrototypeOf = _dereq_(74) + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + +var ordinaryHasMetadata = function(MetadataKey, O, P){ + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if(hasOwn)return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); +},{"63":63,"7":7,"74":74}],280:[function(_dereq_,module,exports){ +var metadata = _dereq_(63) + , anObject = _dereq_(7) + , ordinaryHasOwnMetadata = metadata.has + , toMetaKey = metadata.key; + +metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, targetKey */){ + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +}}); +},{"63":63,"7":7}],281:[function(_dereq_,module,exports){ +var metadata = _dereq_(63) + , anObject = _dereq_(7) + , aFunction = _dereq_(3) + , toMetaKey = metadata.key + , ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({metadata: function metadata(metadataKey, metadataValue){ + return function decorator(target, targetKey){ + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +}}); +},{"3":3,"63":63,"7":7}],282:[function(_dereq_,module,exports){ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = _dereq_(32); + +$export($export.P + $export.R, 'Set', {toJSON: _dereq_(20)('Set')}); +},{"20":20,"32":32}],283:[function(_dereq_,module,exports){ +'use strict'; +// https://github.com/mathiasbynens/String.prototype.at +var $export = _dereq_(32) + , $at = _dereq_(97)(true); + +$export($export.P, 'String', { + at: function at(pos){ + return $at(this, pos); + } +}); +},{"32":32,"97":97}],284:[function(_dereq_,module,exports){ +'use strict'; +// https://tc39.github.io/String.prototype.matchAll/ +var $export = _dereq_(32) + , defined = _dereq_(27) + , toLength = _dereq_(108) + , isRegExp = _dereq_(50) + , getFlags = _dereq_(36) + , RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function(regexp, string){ + this._r = regexp; + this._s = string; +}; + +_dereq_(52)($RegExpStringIterator, 'RegExp String', function next(){ + var match = this._r.exec(this._s); + return {value: match, done: match === null}; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp){ + defined(this); + if(!isRegExp(regexp))throw TypeError(regexp + ' is not a regexp!'); + var S = String(this) + , flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp) + , rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); +},{"108":108,"27":27,"32":32,"36":36,"50":50,"52":52}],285:[function(_dereq_,module,exports){ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = _dereq_(32) + , $pad = _dereq_(100); + +$export($export.P, 'String', { + padEnd: function padEnd(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); +},{"100":100,"32":32}],286:[function(_dereq_,module,exports){ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = _dereq_(32) + , $pad = _dereq_(100); + +$export($export.P, 'String', { + padStart: function padStart(maxLength /*, fillString = ' ' */){ + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); +},{"100":100,"32":32}],287:[function(_dereq_,module,exports){ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +_dereq_(102)('trimLeft', function($trim){ + return function trimLeft(){ + return $trim(this, 1); + }; +}, 'trimStart'); +},{"102":102}],288:[function(_dereq_,module,exports){ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +_dereq_(102)('trimRight', function($trim){ + return function trimRight(){ + return $trim(this, 2); + }; +}, 'trimEnd'); +},{"102":102}],289:[function(_dereq_,module,exports){ +_dereq_(115)('asyncIterator'); +},{"115":115}],290:[function(_dereq_,module,exports){ +_dereq_(115)('observable'); +},{"115":115}],291:[function(_dereq_,module,exports){ +// https://github.com/ljharb/proposal-global +var $export = _dereq_(32); + +$export($export.S, 'System', {global: _dereq_(38)}); +},{"32":32,"38":38}],292:[function(_dereq_,module,exports){ +var $iterators = _dereq_(130) + , redefine = _dereq_(87) + , global = _dereq_(38) + , hide = _dereq_(40) + , Iterators = _dereq_(56) + , wks = _dereq_(117) + , ITERATOR = wks('iterator') + , TO_STRING_TAG = wks('toStringTag') + , ArrayValues = Iterators.Array; + +for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ + var NAME = collections[i] + , Collection = global[NAME] + , proto = Collection && Collection.prototype + , key; + if(proto){ + if(!proto[ITERATOR])hide(proto, ITERATOR, ArrayValues); + if(!proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true); + } +} +},{"117":117,"130":130,"38":38,"40":40,"56":56,"87":87}],293:[function(_dereq_,module,exports){ +var $export = _dereq_(32) + , $task = _dereq_(104); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); +},{"104":104,"32":32}],294:[function(_dereq_,module,exports){ +// ie9- setTimeout & setInterval additional parameters fix +var global = _dereq_(38) + , $export = _dereq_(32) + , invoke = _dereq_(44) + , partial = _dereq_(83) + , navigator = global.navigator + , MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check +var wrap = function(set){ + return MSIE ? function(fn, time /*, ...args */){ + return set(invoke( + partial, + [].slice.call(arguments, 2), + typeof fn == 'function' ? fn : Function(fn) + ), time); + } : set; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); +},{"32":32,"38":38,"44":44,"83":83}],295:[function(_dereq_,module,exports){ +_dereq_(243); +_dereq_(180); +_dereq_(182); +_dereq_(181); +_dereq_(184); +_dereq_(186); +_dereq_(191); +_dereq_(185); +_dereq_(183); +_dereq_(193); +_dereq_(192); +_dereq_(188); +_dereq_(189); +_dereq_(187); +_dereq_(179); +_dereq_(190); +_dereq_(194); +_dereq_(195); +_dereq_(146); +_dereq_(148); +_dereq_(147); +_dereq_(197); +_dereq_(196); +_dereq_(167); +_dereq_(177); +_dereq_(178); +_dereq_(168); +_dereq_(169); +_dereq_(170); +_dereq_(171); +_dereq_(172); +_dereq_(173); +_dereq_(174); +_dereq_(175); +_dereq_(176); +_dereq_(150); +_dereq_(151); +_dereq_(152); +_dereq_(153); +_dereq_(154); +_dereq_(155); +_dereq_(156); +_dereq_(157); +_dereq_(158); +_dereq_(159); +_dereq_(160); +_dereq_(161); +_dereq_(162); +_dereq_(163); +_dereq_(164); +_dereq_(165); +_dereq_(166); +_dereq_(230); +_dereq_(235); +_dereq_(242); +_dereq_(233); +_dereq_(225); +_dereq_(226); +_dereq_(231); +_dereq_(236); +_dereq_(238); +_dereq_(221); +_dereq_(222); +_dereq_(223); +_dereq_(224); +_dereq_(227); +_dereq_(228); +_dereq_(229); +_dereq_(232); +_dereq_(234); +_dereq_(237); +_dereq_(239); +_dereq_(240); +_dereq_(241); +_dereq_(141); +_dereq_(143); +_dereq_(142); +_dereq_(145); +_dereq_(144); +_dereq_(129); +_dereq_(127); +_dereq_(134); +_dereq_(131); +_dereq_(137); +_dereq_(139); +_dereq_(126); +_dereq_(133); +_dereq_(123); +_dereq_(138); +_dereq_(121); +_dereq_(136); +_dereq_(135); +_dereq_(128); +_dereq_(132); +_dereq_(120); +_dereq_(122); +_dereq_(125); +_dereq_(124); +_dereq_(140); +_dereq_(130); +_dereq_(213); +_dereq_(219); +_dereq_(214); +_dereq_(215); +_dereq_(216); +_dereq_(217); +_dereq_(218); +_dereq_(198); +_dereq_(149); +_dereq_(220); +_dereq_(255); +_dereq_(256); +_dereq_(244); +_dereq_(245); +_dereq_(250); +_dereq_(253); +_dereq_(254); +_dereq_(248); +_dereq_(251); +_dereq_(249); +_dereq_(252); +_dereq_(246); +_dereq_(247); +_dereq_(199); +_dereq_(200); +_dereq_(201); +_dereq_(202); +_dereq_(203); +_dereq_(206); +_dereq_(204); +_dereq_(205); +_dereq_(207); +_dereq_(208); +_dereq_(209); +_dereq_(210); +_dereq_(212); +_dereq_(211); +_dereq_(257); +_dereq_(283); +_dereq_(286); +_dereq_(285); +_dereq_(287); +_dereq_(288); +_dereq_(284); +_dereq_(289); +_dereq_(290); +_dereq_(268); +_dereq_(271); +_dereq_(267); +_dereq_(265); +_dereq_(266); +_dereq_(269); +_dereq_(270); +_dereq_(260); +_dereq_(282); +_dereq_(291); +_dereq_(259); +_dereq_(261); +_dereq_(263); +_dereq_(262); +_dereq_(264); +_dereq_(273); +_dereq_(274); +_dereq_(276); +_dereq_(275); +_dereq_(278); +_dereq_(277); +_dereq_(279); +_dereq_(280); +_dereq_(281); +_dereq_(258); +_dereq_(272); +_dereq_(294); +_dereq_(293); +_dereq_(292); +module.exports = _dereq_(23); +},{"120":120,"121":121,"122":122,"123":123,"124":124,"125":125,"126":126,"127":127,"128":128,"129":129,"130":130,"131":131,"132":132,"133":133,"134":134,"135":135,"136":136,"137":137,"138":138,"139":139,"140":140,"141":141,"142":142,"143":143,"144":144,"145":145,"146":146,"147":147,"148":148,"149":149,"150":150,"151":151,"152":152,"153":153,"154":154,"155":155,"156":156,"157":157,"158":158,"159":159,"160":160,"161":161,"162":162,"163":163,"164":164,"165":165,"166":166,"167":167,"168":168,"169":169,"170":170,"171":171,"172":172,"173":173,"174":174,"175":175,"176":176,"177":177,"178":178,"179":179,"180":180,"181":181,"182":182,"183":183,"184":184,"185":185,"186":186,"187":187,"188":188,"189":189,"190":190,"191":191,"192":192,"193":193,"194":194,"195":195,"196":196,"197":197,"198":198,"199":199,"200":200,"201":201,"202":202,"203":203,"204":204,"205":205,"206":206,"207":207,"208":208,"209":209,"210":210,"211":211,"212":212,"213":213,"214":214,"215":215,"216":216,"217":217,"218":218,"219":219,"220":220,"221":221,"222":222,"223":223,"224":224,"225":225,"226":226,"227":227,"228":228,"229":229,"23":23,"230":230,"231":231,"232":232,"233":233,"234":234,"235":235,"236":236,"237":237,"238":238,"239":239,"240":240,"241":241,"242":242,"243":243,"244":244,"245":245,"246":246,"247":247,"248":248,"249":249,"250":250,"251":251,"252":252,"253":253,"254":254,"255":255,"256":256,"257":257,"258":258,"259":259,"260":260,"261":261,"262":262,"263":263,"264":264,"265":265,"266":266,"267":267,"268":268,"269":269,"270":270,"271":271,"272":272,"273":273,"274":274,"275":275,"276":276,"277":277,"278":278,"279":279,"280":280,"281":281,"282":282,"283":283,"284":284,"285":285,"286":286,"287":287,"288":288,"289":289,"290":290,"291":291,"292":292,"293":293,"294":294}],296:[function(_dereq_,module,exports){ +(function (global){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + if (typeof process === "object" && process.domain) { + invoke = process.domain.bind(invoke); + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + runtime.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + while (true) { + var delegate = context.delegate; + if (delegate) { + if (method === "return" || + (method === "throw" && delegate.iterator[method] === undefined)) { + // A return or throw (when the delegate iterator has no throw + // method) always terminates the yield* loop. + context.delegate = null; + + // If the delegate iterator has a return method, give it a + // chance to clean up. + var returnMethod = delegate.iterator["return"]; + if (returnMethod) { + var record = tryCatch(returnMethod, delegate.iterator, arg); + if (record.type === "throw") { + // If the return method threw an exception, let that + // exception prevail over the original return or throw. + method = "throw"; + arg = record.arg; + continue; + } + } + + if (method === "return") { + // Continue with the outer return, now that the delegate + // iterator has been terminated. + continue; + } + } + + var record = tryCatch( + delegate.iterator[method], + delegate.iterator, + arg + ); + + if (record.type === "throw") { + context.delegate = null; + + // Like returning generator.throw(uncaught), but without the + // overhead of an extra function call. + method = "throw"; + arg = record.arg; + continue; + } + + // Delegate generator ran and handled its own exceptions so + // regardless of what the method was, we continue as if it is + // "next" with an undefined arg. + method = "next"; + arg = undefined; + + var info = record.arg; + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + } else { + state = GenStateSuspendedYield; + return info; + } + + context.delegate = null; + } + + if (method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = arg; + + } else if (method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw arg; + } + + if (context.dispatchException(arg)) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + method = "next"; + arg = undefined; + } + + } else if (method === "return") { + context.abrupt("return", arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + var info = { + value: record.arg, + done: context.done + }; + + if (record.arg === ContinueSentinel) { + if (context.delegate && method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + arg = undefined; + } + } else { + return info; + } + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(arg) call above. + method = "throw"; + arg = record.arg; + } + } + }; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.next = finallyEntry.finallyLoc; + } else { + this.complete(record); + } + + return ContinueSentinel; + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = record.arg; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + return ContinueSentinel; + } + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}]},{},[1]); diff --git a/node_modules/csscomb/node_modules/babel-polyfill/dist/polyfill.min.js b/node_modules/csscomb/node_modules/babel-polyfill/dist/polyfill.min.js new file mode 100644 index 0000000..df0250b --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/dist/polyfill.min.js @@ -0,0 +1,4 @@ +!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!u&&c)return c(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var a=n[o]={exports:{}};t[o][0].call(a.exports,function(n){var r=t[o][1][n];return s(r?r:n)},a,a.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o2?arguments[2]:void 0,s=Math.min((void 0===a?u:i(a,u))-f,u-c),l=1;for(f0;)f in r?r[c]=r[f]:delete r[c],c+=l,f+=l;return r}},{105:105,108:108,109:109}],9:[function(t,n,r){"use strict";var e=t(109),i=t(105),o=t(108);n.exports=function fill(t){for(var n=e(this),r=o(n.length),u=arguments.length,c=i(u>1?arguments[1]:void 0,r),f=u>2?arguments[2]:void 0,a=void 0===f?r:i(f,r);a>c;)n[c++]=t;return n}},{105:105,108:108,109:109}],10:[function(t,n,r){var e=t(37);n.exports=function(t,n){var r=[];return e(t,!1,r.push,r,n),r}},{37:37}],11:[function(t,n,r){var e=t(107),i=t(108),o=t(105);n.exports=function(t){return function(n,r,u){var c,f=e(n),a=i(f.length),s=o(u,a);if(t&&r!=r){for(;a>s;)if(c=f[s++],c!=c)return!0}else for(;a>s;s++)if((t||s in f)&&f[s]===r)return t||s||0;return!t&&-1}}},{105:105,107:107,108:108}],12:[function(t,n,r){var e=t(25),i=t(45),o=t(109),u=t(108),c=t(15);n.exports=function(t,n){var r=1==t,f=2==t,a=3==t,s=4==t,l=6==t,h=5==t||l,v=n||c;return function(n,c,p){for(var d,y,g=o(n),b=i(g),x=e(c,p,3),m=u(b.length),w=0,S=r?v(n,m):f?v(n,0):void 0;m>w;w++)if((h||w in b)&&(d=b[w],y=x(d,w,g),t))if(r)S[w]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return w;case 2:S.push(d)}else if(s)return!1;return l?-1:a||s?s:S}}},{108:108,109:109,15:15,25:25,45:45}],13:[function(t,n,r){var e=t(3),i=t(109),o=t(45),u=t(108);n.exports=function(t,n,r,c,f){e(n);var a=i(t),s=o(a),l=u(a.length),h=f?l-1:0,v=f?-1:1;if(r<2)for(;;){if(h in s){c=s[h],h+=v;break}if(h+=v,f?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;f?h>=0:l>h;h+=v)h in s&&(c=n(c,s[h],h,a));return c}},{108:108,109:109,3:3,45:45}],14:[function(t,n,r){var e=t(49),i=t(47),o=t(117)("species");n.exports=function(t){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&(n=n[o],null===n&&(n=void 0))),void 0===n?Array:n}},{117:117,47:47,49:49}],15:[function(t,n,r){var e=t(14);n.exports=function(t,n){return new(e(t))(n)}},{14:14}],16:[function(t,n,r){"use strict";var e=t(3),i=t(49),o=t(44),u=[].slice,c={},f=function(t,n,r){if(!(n in c)){for(var e=[],i=0;i1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function has(t){return!!y(this,t)}}),v&&e(l.prototype,"size",{get:function(){return f(this[d])}}),l},def:function(t,n,r){var e,i,o=y(t,n);return o?o.v=r:(t._l=o={i:i=p(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[d]++,"F"!==i&&(t._i[i]=o)),t},getEntry:y,setStrong:function(t,n,r){s(t,n,function(t,n){this._t=t,this._k=n,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==n?l(0,r.k):"values"==n?l(0,r.v):l(0,[r.k,r.v]):(t._t=void 0,l(1))},r?"entries":"values",!r,!0),h(n)}}},{25:25,27:27,28:28,37:37,53:53,55:55,6:6,62:62,66:66,67:67,86:86,91:91}],20:[function(t,n,r){var e=t(17),i=t(10);n.exports=function(t){return function toJSON(){if(e(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},{10:10,17:17}],21:[function(t,n,r){"use strict";var e=t(86),i=t(62).getWeak,o=t(7),u=t(49),c=t(6),f=t(37),a=t(12),s=t(39),l=a(5),h=a(6),v=0,p=function(t){return t._l||(t._l=new d)},d=function(){this.a=[]},y=function(t,n){return l(t.a,function(t){return t[0]===n})};d.prototype={get:function(t){var n=y(this,t);if(n)return n[1]},has:function(t){return!!y(this,t)},set:function(t,n){var r=y(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(t){var n=h(this.a,function(n){return n[0]===t});return~n&&this.a.splice(n,1),!!~n}},n.exports={getConstructor:function(t,n,r,o){var a=t(function(t,e){c(t,a,n,"_i"),t._i=v++,t._l=void 0,void 0!=e&&f(e,r,t[o],t)});return e(a.prototype,{delete:function(t){if(!u(t))return!1;var n=i(t);return n===!0?p(this).delete(t):n&&s(n,this._i)&&delete n[this._i]},has:function has(t){if(!u(t))return!1;var n=i(t);return n===!0?p(this).has(t):n&&s(n,this._i)}}),a},def:function(t,n,r){var e=i(o(n),!0);return e===!0?p(t).set(n,r):e[t._i]=r,t},ufstore:p}},{12:12,37:37,39:39,49:49,6:6,62:62,7:7,86:86}],22:[function(t,n,r){"use strict";var e=t(38),i=t(32),o=t(87),u=t(86),c=t(62),f=t(37),a=t(6),s=t(49),l=t(34),h=t(54),v=t(92),p=t(43);n.exports=function(t,n,r,d,y,g){var b=e[t],x=b,m=y?"set":"add",w=x&&x.prototype,S={},_=function(t){var n=w[t];o(w,t,"delete"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"has"==t?function has(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function get(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function add(t){return n.call(this,0===t?0:t),this}:function set(t,r){return n.call(this,0===t?0:t,r),this})};if("function"==typeof x&&(g||w.forEach&&!l(function(){(new x).entries().next()}))){var E=new x,O=E[m](g?{}:-0,1)!=E,F=l(function(){E.has(1)}),P=h(function(t){new x(t)}),M=!g&&l(function(){for(var t=new x,n=5;n--;)t[m](n,n);return!t.has(-0)});P||(x=n(function(n,r){a(n,x,t);var e=p(new b,n,x);return void 0!=r&&f(r,y,e[m],e),e}),x.prototype=w,w.constructor=x),(F||M)&&(_("delete"),_("has"),y&&_("get")),(M||O)&&_(m),g&&w.clear&&delete w.clear}else x=d.getConstructor(n,t,y,m),u(x.prototype,r),c.NEED=!0;return v(x,t),S[t]=x,i(i.G+i.W+i.F*(x!=b),S),g||d.setStrong(x,t,y),x}},{32:32,34:34,37:37,38:38,43:43,49:49,54:54,6:6,62:62,86:86,87:87,92:92}],23:[function(t,n,r){var e=n.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)},{}],24:[function(t,n,r){"use strict";var e=t(67),i=t(85);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{67:67,85:85}],25:[function(t,n,r){var e=t(3);n.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},{3:3}],26:[function(t,n,r){"use strict";var e=t(7),i=t(110),o="number";n.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),t!=o)}},{110:110,7:7}],27:[function(t,n,r){n.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],28:[function(t,n,r){n.exports=!t(34)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{34:34}],29:[function(t,n,r){var e=t(49),i=t(38).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{38:38,49:49}],30:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],31:[function(t,n,r){var e=t(76),i=t(73),o=t(77);n.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),f=o.f,a=0;c.length>a;)f.call(t,u=c[a++])&&n.push(u);return n}},{73:73,76:76,77:77}],32:[function(t,n,r){var e=t(38),i=t(23),o=t(40),u=t(87),c=t(25),f="prototype",a=function(t,n,r){var s,l,h,v,p=t&a.F,d=t&a.G,y=t&a.S,g=t&a.P,b=t&a.B,x=d?e:y?e[n]||(e[n]={}):(e[n]||{})[f],m=d?i:i[n]||(i[n]={}),w=m[f]||(m[f]={});d&&(r=n);for(s in r)l=!p&&x&&void 0!==x[s],h=(l?x:r)[s],v=b&&l?c(h,e):g&&"function"==typeof h?c(Function.call,h):h,x&&u(x,s,h,t&a.U),m[s]!=h&&o(m,s,v),g&&w[s]!=h&&(w[s]=h)};e.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,n.exports=a},{23:23,25:25,38:38,40:40,87:87}],33:[function(t,n,r){var e=t(117)("match");n.exports=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,!"/./"[t](n)}catch(t){}}return!0}},{117:117}],34:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],35:[function(t,n,r){"use strict";var e=t(40),i=t(87),o=t(34),u=t(27),c=t(117);n.exports=function(t,n,r){var f=c(t),a=r(u,f,""[t]),s=a[0],l=a[1];o(function(){var n={};return n[f]=function(){return 7},7!=""[t](n)})&&(i(String.prototype,t,s),e(RegExp.prototype,f,2==n?function(t,n){return l.call(t,this,n)}:function(t){return l.call(t,this)}))}},{117:117,27:27,34:34,40:40,87:87}],36:[function(t,n,r){"use strict";var e=t(7);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{7:7}],37:[function(t,n,r){var e=t(25),i=t(51),o=t(46),u=t(7),c=t(108),f=t(118),a={},s={},r=n.exports=function(t,n,r,l,h){var v,p,d,y,g=h?function(){return t}:f(t),b=e(r,l,n?2:1),x=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(v=c(t.length);v>x;x++)if(y=n?b(u(p=t[x])[0],p[1]):b(t[x]),y===a||y===s)return y}else for(d=g.call(t);!(p=d.next()).done;)if(y=i(d,b,p.value,n),y===a||y===s)return y};r.BREAK=a,r.RETURN=s},{108:108,118:118,25:25,46:46,51:51,7:7}],38:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],39:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],40:[function(t,n,r){var e=t(67),i=t(85);n.exports=t(28)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{28:28,67:67,85:85}],41:[function(t,n,r){n.exports=t(38).document&&document.documentElement},{38:38}],42:[function(t,n,r){n.exports=!t(28)&&!t(34)(function(){return 7!=Object.defineProperty(t(29)("div"),"a",{get:function(){return 7}}).a})},{28:28,29:29,34:34}],43:[function(t,n,r){var e=t(49),i=t(90).set;n.exports=function(t,n,r){var o,u=n.constructor;return u!==r&&"function"==typeof u&&(o=u.prototype)!==r.prototype&&e(o)&&i&&i(t,o),t}},{49:49,90:90}],44:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],45:[function(t,n,r){var e=t(18);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{18:18}],46:[function(t,n,r){var e=t(56),i=t(117)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{117:117,56:56}],47:[function(t,n,r){var e=t(18);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{18:18}],48:[function(t,n,r){var e=t(49),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{49:49}],49:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],50:[function(t,n,r){var e=t(49),i=t(18),o=t(117)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{117:117,18:18,49:49}],51:[function(t,n,r){var e=t(7);n.exports=function(t,n,r,i){try{return i?n(e(r)[0],r[1]):n(r)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}}},{7:7}],52:[function(t,n,r){"use strict";var e=t(66),i=t(85),o=t(92),u={};t(40)(u,t(117)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{117:117,40:40,66:66,85:85,92:92}],53:[function(t,n,r){"use strict";var e=t(58),i=t(32),o=t(87),u=t(40),c=t(39),f=t(56),a=t(52),s=t(92),l=t(74),h=t(117)("iterator"),v=!([].keys&&"next"in[].keys()),p="@@iterator",d="keys",y="values",g=function(){return this};n.exports=function(t,n,r,b,x,m,w){a(r,n,b);var S,_,E,O=function(t){if(!v&&t in A)return A[t];switch(t){case d:return function keys(){return new r(this,t)};case y:return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}},F=n+" Iterator",P=x==y,M=!1,A=t.prototype,I=A[h]||A[p]||x&&A[x],j=I||O(x),N=x?P?O("entries"):j:void 0,k="Array"==n?A.entries||I:I;if(k&&(E=l(k.call(new t)),E!==Object.prototype&&(s(E,F,!0),e||c(E,h)||u(E,h,g))),P&&I&&I.name!==y&&(M=!0,j=function values(){return I.call(this)}),e&&!w||!v&&!M&&A[h]||u(A,h,j),f[n]=j,f[F]=g,x)if(S={values:P?j:O(y),keys:m?j:O(d),entries:N},w)for(_ in S)_ in A||o(A,_,S[_]);else i(i.P+i.F*(v||M),n,S);return S}},{117:117,32:32,39:39,40:40,52:52,56:56,58:58,74:74,87:87,92:92}],54:[function(t,n,r){var e=t(117)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var o=[7],u=o[e]();u.next=function(){return{done:r=!0}},o[e]=function(){return u},t(o)}catch(t){}return r}},{117:117}],55:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],56:[function(t,n,r){n.exports={}},{}],57:[function(t,n,r){var e=t(76),i=t(107);n.exports=function(t,n){for(var r,o=i(t),u=e(o),c=u.length,f=0;c>f;)if(o[r=u[f++]]===n)return r}},{107:107,76:76}],58:[function(t,n,r){n.exports=!1},{}],59:[function(t,n,r){var e=Math.expm1;n.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||e(-2e-17)!=-2e-17?function expm1(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],60:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],61:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],62:[function(t,n,r){var e=t(114)("meta"),i=t(49),o=t(39),u=t(67).f,c=0,f=Object.isExtensible||function(){return!0},a=!t(34)(function(){return f(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!f(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!f(t))return!0;if(!n)return!1;s(t)}return t[e].w},v=function(t){return a&&p.NEED&&f(t)&&!o(t,e)&&s(t),t},p=n.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:v}},{114:114,34:34,39:39,49:49,67:67}],63:[function(t,n,r){var e=t(149),i=t(32),o=t(94)("metadata"),u=o.store||(o.store=new(t(255))),c=function(t,n,r){var i=u.get(t);if(!i){if(!r)return;u.set(t,i=new e)}var o=i.get(n);if(!o){if(!r)return;i.set(n,o=new e)}return o},f=function(t,n,r){var e=c(n,r,!1);return void 0!==e&&e.has(t)},a=function(t,n,r){var e=c(n,r,!1);return void 0===e?void 0:e.get(t)},s=function(t,n,r,e){c(r,e,!0).set(t,n)},l=function(t,n){var r=c(t,n,!1),e=[];return r&&r.forEach(function(t,n){e.push(n)}),e},h=function(t){return void 0===t||"symbol"==typeof t?t:String(t)},v=function(t){i(i.S,"Reflect",t)};n.exports={store:u,map:c,has:f,get:a,set:s,keys:l,key:h,exp:v}},{149:149,255:255,32:32,94:94}],64:[function(t,n,r){var e=t(38),i=t(104).set,o=e.MutationObserver||e.WebKitMutationObserver,u=e.process,c=e.Promise,f="process"==t(18)(u);n.exports=function(){var t,n,r,a=function(){var e,i;for(f&&(e=u.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(f)r=function(){u.nextTick(a)};else if(o){var s=!0,l=document.createTextNode("");new o(a).observe(l,{characterData:!0}),r=function(){l.data=s=!s}}else if(c&&c.resolve){var h=c.resolve();r=function(){h.then(a)}}else r=function(){i.call(e,a)};return function(e){var i={fn:e,next:void 0};n&&(n.next=i),t||(t=i,r()),n=i}}},{104:104,18:18,38:38}],65:[function(t,n,r){"use strict";var e=t(76),i=t(73),o=t(77),u=t(109),c=t(45),f=Object.assign;n.exports=!f||t(34)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=f({},t)[r]||Object.keys(f({},n)).join("")!=e})?function assign(t,n){for(var r=u(t),f=arguments.length,a=1,s=i.f,l=o.f;f>a;)for(var h,v=c(arguments[a++]),p=s?e(v).concat(s(v)):e(v),d=p.length,y=0;d>y;)l.call(v,h=p[y++])&&(r[h]=v[h]);return r}:f},{109:109,34:34,45:45,73:73,76:76,77:77}],66:[function(t,n,r){var e=t(7),i=t(68),o=t(30),u=t(93)("IE_PROTO"),c=function(){},f="prototype",a=function(){var n,r=t(29)("iframe"),e=o.length,i="<",u=">";for(r.style.display="none",t(41).appendChild(r),r.src="javascript:",n=r.contentWindow.document,n.open(),n.write(i+"script"+u+"document.F=Object"+i+"/script"+u),n.close(),a=n.F;e--;)delete a[f][o[e]];return a()};n.exports=Object.create||function create(t,n){var r;return null!==t?(c[f]=e(t),r=new c,c[f]=null,r[u]=t):r=a(),void 0===n?r:i(r,n)}},{29:29,30:30,41:41,68:68,7:7,93:93}],67:[function(t,n,r){var e=t(7),i=t(42),o=t(110),u=Object.defineProperty;r.f=t(28)?Object.defineProperty:function defineProperty(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},{110:110,28:28,42:42,7:7}],68:[function(t,n,r){var e=t(67),i=t(7),o=t(76);n.exports=t(28)?Object.defineProperties:function defineProperties(t,n){i(t);for(var r,u=o(n),c=u.length,f=0;c>f;)e.f(t,r=u[f++],n[r]);return t}},{28:28,67:67,7:7,76:76}],69:[function(t,n,r){n.exports=t(58)||!t(34)(function(){var n=Math.random();__defineSetter__.call(null,n,function(){}),delete t(38)[n]})},{34:34,38:38,58:58}],70:[function(t,n,r){var e=t(77),i=t(85),o=t(107),u=t(110),c=t(39),f=t(42),a=Object.getOwnPropertyDescriptor;r.f=t(28)?a:function getOwnPropertyDescriptor(t,n){if(t=o(t),n=u(n,!0),f)try{return a(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},{107:107,110:110,28:28,39:39,42:42,77:77,85:85}],71:[function(t,n,r){var e=t(107),i=t(72).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return i(t)}catch(t){return u.slice()}};n.exports.f=function getOwnPropertyNames(t){return u&&"[object Window]"==o.call(t)?c(t):i(e(t))}},{107:107,72:72}],72:[function(t,n,r){var e=t(75),i=t(30).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)}},{30:30,75:75}],73:[function(t,n,r){r.f=Object.getOwnPropertySymbols},{}],74:[function(t,n,r){var e=t(39),i=t(109),o=t(93)("IE_PROTO"),u=Object.prototype;n.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},{109:109,39:39,93:93}],75:[function(t,n,r){var e=t(39),i=t(107),o=t(11)(!1),u=t(93)("IE_PROTO");n.exports=function(t,n){var r,c=i(t),f=0,a=[];for(r in c)r!=u&&e(c,r)&&a.push(r);for(;n.length>f;)e(c,r=n[f++])&&(~o(a,r)||a.push(r));return a}},{107:107,11:11,39:39,93:93}],76:[function(t,n,r){var e=t(75),i=t(30);n.exports=Object.keys||function keys(t){return e(t,i)}},{30:30,75:75}],77:[function(t,n,r){r.f={}.propertyIsEnumerable},{}],78:[function(t,n,r){var e=t(32),i=t(23),o=t(34);n.exports=function(t,n){var r=(i.Object||{})[t]||Object[t],u={};u[t]=n(r),e(e.S+e.F*o(function(){r(1)}),"Object",u)}},{23:23,32:32,34:34}],79:[function(t,n,r){var e=t(76),i=t(107),o=t(77).f;n.exports=function(t){return function(n){for(var r,u=i(n),c=e(u),f=c.length,a=0,s=[];f>a;)o.call(u,r=c[a++])&&s.push(t?[r,u[r]]:u[r]);return s}}},{107:107,76:76,77:77}],80:[function(t,n,r){var e=t(72),i=t(73),o=t(7),u=t(38).Reflect;n.exports=u&&u.ownKeys||function ownKeys(t){var n=e.f(o(t)),r=i.f;return r?n.concat(r(t)):n}},{38:38,7:7,72:72,73:73}],81:[function(t,n,r){var e=t(38).parseFloat,i=t(102).trim;n.exports=1/e(t(103)+"-0")!==-(1/0)?function parseFloat(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},{102:102,103:103,38:38}],82:[function(t,n,r){var e=t(38).parseInt,i=t(102).trim,o=t(103),u=/^[\-+]?0[xX]/;n.exports=8!==e(o+"08")||22!==e(o+"0x16")?function parseInt(t,n){var r=i(String(t),3);return e(r,n>>>0||(u.test(r)?16:10))}:e},{102:102,103:103,38:38}],83:[function(t,n,r){"use strict";var e=t(84),i=t(44),o=t(3);n.exports=function(){for(var t=o(this),n=arguments.length,r=Array(n),u=0,c=e._,f=!1;n>u;)(r[u]=arguments[u++])===c&&(f=!0);return function(){var e,o=this,u=arguments.length,a=0,s=0;if(!f&&!u)return i(t,r,o);if(e=r.slice(),f)for(;n>a;a++)e[a]===c&&(e[a]=arguments[s++]);for(;u>s;)e.push(arguments[s++]);return i(t,e,o)}}},{3:3,44:44,84:84}],84:[function(t,n,r){n.exports=t(38)},{38:38}],85:[function(t,n,r){n.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},{}],86:[function(t,n,r){var e=t(87);n.exports=function(t,n,r){for(var i in n)e(t,i,n[i],r);return t}},{87:87}],87:[function(t,n,r){var e=t(38),i=t(40),o=t(39),u=t(114)("src"),c="toString",f=Function[c],a=(""+f).split(c);t(23).inspectSource=function(t){return f.call(t)},(n.exports=function(t,n,r,c){var f="function"==typeof r;f&&(o(r,"name")||i(r,"name",n)),t[n]!==r&&(f&&(o(r,u)||i(r,u,t[n]?""+t[n]:a.join(String(n)))),t===e?t[n]=r:c?t[n]?t[n]=r:i(t,n,r):(delete t[n],i(t,n,r)))})(Function.prototype,c,function toString(){return"function"==typeof this&&this[u]||f.call(this)})},{114:114,23:23,38:38,39:39,40:40}],88:[function(t,n,r){n.exports=function(t,n){var r=n===Object(n)?function(t){return n[t]}:n;return function(n){return String(n).replace(t,r)}}},{}],89:[function(t,n,r){n.exports=Object.is||function is(t,n){return t===n?0!==t||1/t===1/n:t!=t&&n!=n}},{}],90:[function(t,n,r){var e=t(49),i=t(7),o=function(t,n){if(i(t),!e(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};n.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(n,r,e){try{e=t(25)(Function.call,t(70).f(Object.prototype,"__proto__").set,2),e(n,[]),r=!(n instanceof Array)}catch(t){r=!0}return function setPrototypeOf(t,n){return o(t,n),r?t.__proto__=n:e(t,n),t}}({},!1):void 0),check:o}},{25:25,49:49,7:7,70:70}],91:[function(t,n,r){"use strict";var e=t(38),i=t(67),o=t(28),u=t(117)("species");n.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},{117:117,28:28,38:38,67:67}],92:[function(t,n,r){var e=t(67).f,i=t(39),o=t(117)("toStringTag");n.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},{117:117,39:39,67:67}],93:[function(t,n,r){var e=t(94)("keys"),i=t(114);n.exports=function(t){return e[t]||(e[t]=i(t))}},{114:114,94:94}],94:[function(t,n,r){var e=t(38),i="__core-js_shared__",o=e[i]||(e[i]={});n.exports=function(t){return o[t]||(o[t]={})}},{38:38}],95:[function(t,n,r){var e=t(7),i=t(3),o=t(117)("species");n.exports=function(t,n){var r,u=e(t).constructor;return void 0===u||void 0==(r=e(u)[o])?n:i(r)}},{117:117,3:3,7:7}],96:[function(t,n,r){var e=t(34);n.exports=function(t,n){return!!t&&e(function(){n?t.call(null,function(){},1):t.call(null)})}},{34:34}],97:[function(t,n,r){var e=t(106),i=t(27);n.exports=function(t){return function(n,r){var o,u,c=String(i(n)),f=e(r),a=c.length;return f<0||f>=a?t?"":void 0:(o=c.charCodeAt(f),o<55296||o>56319||f+1===a||(u=c.charCodeAt(f+1))<56320||u>57343?t?c.charAt(f):o:t?c.slice(f,f+2):(o-55296<<10)+(u-56320)+65536)}}},{106:106,27:27}],98:[function(t,n,r){var e=t(50),i=t(27);n.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(t))}},{27:27,50:50}],99:[function(t,n,r){var e=t(32),i=t(34),o=t(27),u=/"/g,c=function(t,n,r,e){var i=String(o(t)),c="<"+n;return""!==r&&(c+=" "+r+'="'+String(e).replace(u,""")+'"'),c+">"+i+""};n.exports=function(t,n){var r={};r[t]=n(c),e(e.P+e.F*i(function(){var n=""[t]('"');return n!==n.toLowerCase()||n.split('"').length>3}),"String",r)}},{27:27,32:32,34:34}],100:[function(t,n,r){var e=t(108),i=t(101),o=t(27);n.exports=function(t,n,r,u){var c=String(o(t)),f=c.length,a=void 0===r?" ":String(r),s=e(n);if(s<=f||""==a)return c;var l=s-f,h=i.call(a,Math.ceil(l/a.length));return h.length>l&&(h=h.slice(0,l)),u?h+c:c+h}},{101:101,108:108,27:27}],101:[function(t,n,r){"use strict";var e=t(106),i=t(27);n.exports=function repeat(t){var n=String(i(this)),r="",o=e(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(n+=n))1&o&&(r+=n);return r}},{106:106,27:27}],102:[function(t,n,r){var e=t(32),i=t(27),o=t(34),u=t(103),c="["+u+"]",f="​…",a=RegExp("^"+c+c+"*"),s=RegExp(c+c+"*$"),l=function(t,n,r){var i={},c=o(function(){return!!u[t]()||f[t]()!=f}),a=i[t]=c?n(h):u[t];r&&(i[r]=a),e(e.P+e.F*c,"String",i)},h=l.trim=function(t,n){return t=String(i(t)),1&n&&(t=t.replace(a,"")),2&n&&(t=t.replace(s,"")),t};n.exports=l},{103:103,27:27,32:32,34:34}],103:[function(t,n,r){n.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},{}],104:[function(t,n,r){var e,i,o,u=t(25),c=t(44),f=t(41),a=t(29),s=t(38),l=s.process,h=s.setImmediate,v=s.clearImmediate,p=s.MessageChannel,d=0,y={},g="onreadystatechange",b=function(){var t=+this;if(y.hasOwnProperty(t)){var n=y[t];delete y[t],n()}},x=function(t){b.call(t.data)};h&&v||(h=function setImmediate(t){for(var n=[],r=1;arguments.length>r;)n.push(arguments[r++]);return y[++d]=function(){c("function"==typeof t?t:Function(t),n)},e(d),d},v=function clearImmediate(t){delete y[t]},"process"==t(18)(l)?e=function(t){l.nextTick(u(b,t,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=x,e=u(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(e=function(t){s.postMessage(t+"","*")},s.addEventListener("message",x,!1)):e=g in a("script")?function(t){f.appendChild(a("script"))[g]=function(){f.removeChild(this),b.call(t)}}:function(t){setTimeout(u(b,t,1),0)}),n.exports={set:h,clear:v}},{18:18,25:25,29:29,38:38,41:41,44:44}],105:[function(t,n,r){var e=t(106),i=Math.max,o=Math.min;n.exports=function(t,n){return t=e(t),t<0?i(t+n,0):o(t,n)}},{106:106}],106:[function(t,n,r){var e=Math.ceil,i=Math.floor;n.exports=function(t){return isNaN(t=+t)?0:(t>0?i:e)(t)}},{}],107:[function(t,n,r){var e=t(45),i=t(27);n.exports=function(t){return e(i(t))}},{27:27,45:45}],108:[function(t,n,r){var e=t(106),i=Math.min;n.exports=function(t){return t>0?i(e(t),9007199254740991):0}},{106:106}],109:[function(t,n,r){var e=t(27);n.exports=function(t){return Object(e(t))}},{27:27}],110:[function(t,n,r){var e=t(49);n.exports=function(t,n){if(!e(t))return t;var r,i;if(n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!e(i=r.call(t)))return i;if(!n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},{49:49}],111:[function(t,n,r){"use strict";if(t(28)){var e=t(58),i=t(38),o=t(34),u=t(32),c=t(113),f=t(112),a=t(25),s=t(6),l=t(85),h=t(40),v=t(86),p=t(106),d=t(108),y=t(105),g=t(110),b=t(39),x=t(89),m=t(17),w=t(49),S=t(109),_=t(46),E=t(66),O=t(74),F=t(72).f,P=t(118),M=t(114),A=t(117),I=t(12),j=t(11),N=t(95),k=t(130),R=t(56),T=t(54),L=t(91),C=t(9),U=t(8),G=t(67),D=t(70),W=G.f,B=D.f,V=i.RangeError,z=i.TypeError,K=i.Uint8Array,J="ArrayBuffer",Y="Shared"+J,q="BYTES_PER_ELEMENT",X="prototype",$=Array[X],H=f.ArrayBuffer,Z=f.DataView,Q=I(0),tt=I(2),nt=I(3),rt=I(4),et=I(5),it=I(6),ot=j(!0),ut=j(!1),ct=k.values,ft=k.keys,at=k.entries,st=$.lastIndexOf,lt=$.reduce,ht=$.reduceRight,vt=$.join,pt=$.sort,dt=$.slice,yt=$.toString,gt=$.toLocaleString,bt=A("iterator"),xt=A("toStringTag"),mt=M("typed_constructor"),wt=M("def_constructor"),St=c.CONSTR,_t=c.TYPED,Et=c.VIEW,Ot="Wrong length!",Ft=I(1,function(t,n){return Nt(N(t,t[wt]),n)}),Pt=o(function(){return 1===new K(new Uint16Array([1]).buffer)[0]}),Mt=!!K&&!!K[X].set&&o(function(){new K(1).set({})}),At=function(t,n){if(void 0===t)throw z(Ot);var r=+t,e=d(t);if(n&&!x(r,e))throw V(Ot);return e},It=function(t,n){var r=p(t);if(r<0||r%n)throw V("Wrong offset!");return r},jt=function(t){if(w(t)&&_t in t)return t;throw z(t+" is not a typed array!")},Nt=function(t,n){if(!(w(t)&&mt in t))throw z("It is not a typed array constructor!");return new t(n)},kt=function(t,n){return Rt(N(t,t[wt]),n)},Rt=function(t,n){for(var r=0,e=n.length,i=Nt(t,e);e>r;)i[r]=n[r++];return i},Tt=function(t,n,r){W(t,n,{get:function(){return this._d[r]}})},Lt=function from(t){var n,r,e,i,o,u,c=S(t),f=arguments.length,s=f>1?arguments[1]:void 0,l=void 0!==s,h=P(c);if(void 0!=h&&!_(h)){for(u=h.call(c),e=[],n=0;!(o=u.next()).done;n++)e.push(o.value);c=e}for(l&&f>2&&(s=a(s,arguments[2],2)),n=0,r=d(c.length),i=Nt(this,r);r>n;n++)i[n]=l?s(c[n],n):c[n];return i},Ct=function of(){for(var t=0,n=arguments.length,r=Nt(this,n);n>t;)r[t]=arguments[t++];return r},Ut=!!K&&o(function(){gt.call(new K(1))}),Gt=function toLocaleString(){return gt.apply(Ut?dt.call(jt(this)):jt(this),arguments)},Dt={copyWithin:function copyWithin(t,n){return U.call(jt(this),t,n,arguments.length>2?arguments[2]:void 0)},every:function every(t){return rt(jt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function fill(t){return C.apply(jt(this),arguments)},filter:function filter(t){return kt(this,tt(jt(this),t,arguments.length>1?arguments[1]:void 0))},find:function find(t){return et(jt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function findIndex(t){ +return it(jt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function forEach(t){Q(jt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function indexOf(t){return ut(jt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function includes(t){return ot(jt(this),t,arguments.length>1?arguments[1]:void 0)},join:function join(t){return vt.apply(jt(this),arguments)},lastIndexOf:function lastIndexOf(t){return st.apply(jt(this),arguments)},map:function map(t){return Ft(jt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function reduce(t){return lt.apply(jt(this),arguments)},reduceRight:function reduceRight(t){return ht.apply(jt(this),arguments)},reverse:function reverse(){for(var t,n=this,r=jt(n).length,e=Math.floor(r/2),i=0;i1?arguments[1]:void 0)},sort:function sort(t){return pt.call(jt(this),t)},subarray:function subarray(t,n){var r=jt(this),e=r.length,i=y(t,e);return new(N(r,r[wt]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,d((void 0===n?e:y(n,e))-i))}},Wt=function slice(t,n){return kt(this,dt.call(jt(this),t,n))},Bt=function set(t){jt(this);var n=It(arguments[1],1),r=this.length,e=S(t),i=d(e.length),o=0;if(i+n>r)throw V(Ot);for(;o255?255:255&e),i.v[p](r*n+i.o,e,Pt)},A=function(t,n){W(t,n,{get:function(){return P(this,n)},set:function(t){return M(this,n,t)},enumerable:!0})};x?(y=r(function(t,r,e,i){s(t,y,a,"_d");var o,u,c,f,l=0,v=0;if(w(r)){if(!(r instanceof H||(f=m(r))==J||f==Y))return _t in r?Rt(y,r):Lt.call(y,r);o=r,v=It(e,n);var p=r.byteLength;if(void 0===i){if(p%n)throw V(Ot);if(u=p-v,u<0)throw V(Ot)}else if(u=d(i)*n,u+v>p)throw V(Ot);c=u/n}else c=At(r,!0),u=c*n,o=new H(u);for(h(t,"_d",{b:o,o:v,l:u,e:c,v:new Z(o)});l>1,s=23===n?A(2,-24)-A(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for(t=M(t),t!=t||t===F?(i=t!=t?1:0,e=f):(e=I(j(t)/N),t*(o=A(2,-e))<1&&(e--,o*=2),t+=e+a>=1?s/o:s*A(2,1-a),t*o>=2&&(e++,o/=2),e+a>=f?(i=0,e=f):e+a>=1?(i=(t*o-1)*A(2,n),e+=a):(i=t*A(2,a-1)*A(2,n),e=0));n>=8;u[l++]=255&i,i/=256,n-=8);for(e=e<0;u[l++]=255&e,e/=256,c-=8);return u[--l]|=128*h,u},D=function(t,n,r){var e,i=8*r-n-1,o=(1<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;c>0;s=256*s+t[f],f--,c-=8);for(e=s&(1<<-c)-1,s>>=-c,c+=n;c>0;e=256*e+t[f],f--,c-=8);if(0===s)s=1-u;else{if(s===o)return e?NaN:a?-F:F;e+=A(2,n),s-=u}return(a?-1:1)*e*A(2,s-n)},W=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},B=function(t){return[255&t]},V=function(t){return[255&t,t>>8&255]},z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},K=function(t){return G(t,52,8)},J=function(t){return G(t,23,4)},Y=function(t,n,r){p(t[x],n,{get:function(){return this[r]}})},q=function(t,n,r,e){var i=+r,o=l(i);if(i!=o||o<0||o+n>t[C])throw O(w);var u=t[L]._b,c=o+t[U],f=u.slice(c,c+n);return e?f:f.reverse()},X=function(t,n,r,e,i,o){var u=+r,c=l(u);if(u!=c||c<0||c+n>t[C])throw O(w);for(var f=t[L]._b,a=c+t[U],s=e(+i),h=0;htt;)(H=Q[tt++])in S||c(S,H,P[H]);o||(Z.constructor=S)}var nt=new _(new S(2)),rt=_[x].setInt8;nt.setInt8(0,2147483648),nt.setInt8(1,2147483649),!nt.getInt8(0)&&nt.getInt8(1)||f(_[x],{setInt8:function setInt8(t,n){rt.call(this,t,n<<24>>24)},setUint8:function setUint8(t,n){rt.call(this,t,n<<24>>24)}},!0)}else S=function ArrayBuffer(t){var n=$(this,t);this._b=d.call(Array(n),0),this[C]=n},_=function DataView(t,n,r){s(this,_,b),s(t,S,b);var e=t[C],i=l(n);if(i<0||i>e)throw O("Wrong offset!");if(r=void 0===r?e-i:h(r),i+r>e)throw O(m);this[L]=t,this[U]=i,this[C]=r},i&&(Y(S,R,"_l"),Y(_,k,"_b"),Y(_,R,"_l"),Y(_,T,"_o")),f(_[x],{getInt8:function getInt8(t){return q(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return q(this,1,t)[0]},getInt16:function getInt16(t){var n=q(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=q(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return W(q(this,4,t,arguments[1]))},getUint32:function getUint32(t){return W(q(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return D(q(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return D(q(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){X(this,1,t,B,n)},setUint8:function setUint8(t,n){X(this,1,t,B,n)},setInt16:function setInt16(t,n){X(this,2,t,V,n,arguments[2])},setUint16:function setUint16(t,n){X(this,2,t,V,n,arguments[2])},setInt32:function setInt32(t,n){X(this,4,t,z,n,arguments[2])},setUint32:function setUint32(t,n){X(this,4,t,z,n,arguments[2])},setFloat32:function setFloat32(t,n){X(this,4,t,J,n,arguments[2])},setFloat64:function setFloat64(t,n){X(this,8,t,K,n,arguments[2])}});y(S,g),y(_,b),c(_[x],u.VIEW,!0),r[g]=S,r[b]=_},{106:106,108:108,113:113,28:28,34:34,38:38,40:40,58:58,6:6,67:67,72:72,86:86,9:9,92:92}],113:[function(t,n,r){for(var e,i=t(38),o=t(40),u=t(114),c=u("typed_array"),f=u("view"),a=!(!i.ArrayBuffer||!i.DataView),s=a,l=0,h=9,v="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l1?arguments[1]:void 0)}}),t(5)(o)},{12:12,32:32,5:5}],125:[function(t,n,r){"use strict";var e=t(32),i=t(12)(5),o="find",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{find:function find(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t(5)(o)},{12:12,32:32,5:5}],126:[function(t,n,r){"use strict";var e=t(32),i=t(12)(0),o=t(96)([].forEach,!0);e(e.P+e.F*!o,"Array",{forEach:function forEach(t){return i(this,t,arguments[1])}})},{12:12,32:32,96:96}],127:[function(t,n,r){"use strict";var e=t(25),i=t(32),o=t(109),u=t(51),c=t(46),f=t(108),a=t(24),s=t(118);i(i.S+i.F*!t(54)(function(t){Array.from(t)}),"Array",{from:function from(t){var n,r,i,l,h=o(t),v="function"==typeof this?this:Array,p=arguments.length,d=p>1?arguments[1]:void 0,y=void 0!==d,g=0,b=s(h);if(y&&(d=e(d,p>2?arguments[2]:void 0,2)),void 0==b||v==Array&&c(b))for(n=f(h.length),r=new v(n);n>g;g++)a(r,g,y?d(h[g],g):h[g]);else for(l=b.call(h),r=new v;!(i=l.next()).done;g++)a(r,g,y?u(l,d,[i.value,g],!0):i.value);return r.length=g,r}})},{108:108,109:109,118:118,24:24,25:25,32:32,46:46,51:51,54:54}],128:[function(t,n,r){"use strict";var e=t(32),i=t(11)(!1),o=[].indexOf,u=!!o&&1/[1].indexOf(1,-0)<0;e(e.P+e.F*(u||!t(96)(o)),"Array",{indexOf:function indexOf(t){return u?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},{11:11,32:32,96:96}],129:[function(t,n,r){var e=t(32);e(e.S,"Array",{isArray:t(47)})},{32:32,47:47}],130:[function(t,n,r){"use strict";var e=t(5),i=t(55),o=t(56),u=t(107);n.exports=t(53)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):"keys"==n?i(0,r):"values"==n?i(0,t[r]):i(0,[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},{107:107,5:5,53:53,55:55,56:56}],131:[function(t,n,r){"use strict";var e=t(32),i=t(107),o=[].join;e(e.P+e.F*(t(45)!=Object||!t(96)(o)),"Array",{join:function join(t){return o.call(i(this),void 0===t?",":t)}})},{107:107,32:32,45:45,96:96}],132:[function(t,n,r){"use strict";var e=t(32),i=t(107),o=t(106),u=t(108),c=[].lastIndexOf,f=!!c&&1/[1].lastIndexOf(1,-0)<0;e(e.P+e.F*(f||!t(96)(c)),"Array",{lastIndexOf:function lastIndexOf(t){if(f)return c.apply(this,arguments)||0;var n=i(this),r=u(n.length),e=r-1;for(arguments.length>1&&(e=Math.min(e,o(arguments[1]))),e<0&&(e=r+e);e>=0;e--)if(e in n&&n[e]===t)return e||0;return-1}})},{106:106,107:107,108:108,32:32,96:96}],133:[function(t,n,r){"use strict";var e=t(32),i=t(12)(1);e(e.P+e.F*!t(96)([].map,!0),"Array",{map:function map(t){return i(this,t,arguments[1])}})},{12:12,32:32,96:96}],134:[function(t,n,r){"use strict";var e=t(32),i=t(24);e(e.S+e.F*t(34)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var t=0,n=arguments.length,r=new("function"==typeof this?this:Array)(n);n>t;)i(r,t,arguments[t++]);return r.length=n,r}})},{24:24,32:32,34:34}],135:[function(t,n,r){"use strict";var e=t(32),i=t(13);e(e.P+e.F*!t(96)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(t){return i(this,t,arguments.length,arguments[1],!0)}})},{13:13,32:32,96:96}],136:[function(t,n,r){"use strict";var e=t(32),i=t(13);e(e.P+e.F*!t(96)([].reduce,!0),"Array",{reduce:function reduce(t){return i(this,t,arguments.length,arguments[1],!1)}})},{13:13,32:32,96:96}],137:[function(t,n,r){"use strict";var e=t(32),i=t(41),o=t(18),u=t(105),c=t(108),f=[].slice;e(e.P+e.F*t(34)(function(){i&&f.call(i)}),"Array",{slice:function slice(t,n){var r=c(this.length),e=o(this);if(n=void 0===n?r:n,"Array"==e)return f.call(this,t,n);for(var i=u(t,r),a=u(n,r),s=c(a-i),l=Array(s),h=0;h9?t:"0"+t};e(e.P+e.F*(i(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!i(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function toISOString(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":n>9999?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(r>99?r:"0"+u(r))+"Z"}})},{32:32,34:34}],143:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(110);e(e.P+e.F*t(34)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(t){var n=i(this),r=o(n);return"number"!=typeof r||isFinite(r)?n.toISOString():null}})},{109:109,110:110,32:32,34:34}],144:[function(t,n,r){var e=t(117)("toPrimitive"),i=Date.prototype;e in i||t(40)(i,e,t(26))},{117:117,26:26,40:40}],145:[function(t,n,r){var e=Date.prototype,i="Invalid Date",o="toString",u=e[o],c=e.getTime;new Date(NaN)+""!=i&&t(87)(e,o,function toString(){var t=c.call(this);return t===t?u.call(this):i})},{87:87}],146:[function(t,n,r){var e=t(32);e(e.P,"Function",{bind:t(16)})},{16:16,32:32}],147:[function(t,n,r){"use strict";var e=t(49),i=t(74),o=t(117)("hasInstance"),u=Function.prototype;o in u||t(67).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},{117:117,49:49,67:67,74:74}],148:[function(t,n,r){var e=t(67).f,i=t(85),o=t(39),u=Function.prototype,c=/^\s*function ([^ (]*)/,f="name",a=Object.isExtensible||function(){return!0};f in u||t(28)&&e(u,f,{configurable:!0,get:function(){try{var t=this,n=(""+t).match(c)[1];return o(t,f)||!a(t)||e(t,f,i(5,n)),n}catch(t){return""}}})},{28:28,39:39,67:67,85:85}],149:[function(t,n,r){"use strict";var e=t(19);n.exports=t(22)("Map",function(t){return function Map(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function get(t){var n=e.getEntry(this,t);return n&&n.v},set:function set(t,n){return e.def(this,0===t?0:t,n)}},e,!0)},{19:19,22:22}],150:[function(t,n,r){var e=t(32),i=t(60),o=Math.sqrt,u=Math.acosh;e(e.S+e.F*!(u&&710==Math.floor(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function acosh(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},{32:32,60:60}],151:[function(t,n,r){function asinh(t){return isFinite(t=+t)&&0!=t?t<0?-asinh(-t):Math.log(t+Math.sqrt(t*t+1)):t}var e=t(32),i=Math.asinh;e(e.S+e.F*!(i&&1/i(0)>0),"Math",{asinh:asinh})},{32:32}],152:[function(t,n,r){var e=t(32),i=Math.atanh;e(e.S+e.F*!(i&&1/i(-0)<0),"Math",{atanh:function atanh(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},{32:32}],153:[function(t,n,r){var e=t(32),i=t(61);e(e.S,"Math",{cbrt:function cbrt(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},{32:32,61:61}],154:[function(t,n,r){var e=t(32);e(e.S,"Math",{clz32:function clz32(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},{32:32}],155:[function(t,n,r){var e=t(32),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},{32:32}],156:[function(t,n,r){var e=t(32),i=t(59);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},{32:32,59:59}],157:[function(t,n,r){var e=t(32),i=t(61),o=Math.pow,u=o(2,-52),c=o(2,-23),f=o(2,127)*(2-c),a=o(2,-126),s=function(t){return t+1/u-1/u};e(e.S,"Math",{fround:function fround(t){var n,r,e=Math.abs(t),o=i(t);return ef||r!=r?o*(1/0):o*r)}})},{32:32,61:61}],158:[function(t,n,r){var e=t(32),i=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,o=0,u=0,c=arguments.length,f=0;u0?(e=r/f,o+=e*e):o+=r;return f===1/0?1/0:f*Math.sqrt(o)}})},{32:32}],159:[function(t,n,r){var e=t(32),i=Math.imul;e(e.S+e.F*t(34)(function(){return i(4294967295,5)!=-5||2!=i.length}),"Math",{imul:function imul(t,n){var r=65535,e=+t,i=+n,o=r&e,u=r&i;return 0|o*u+((r&e>>>16)*u+o*(r&i>>>16)<<16>>>0)}})},{32:32,34:34}],160:[function(t,n,r){var e=t(32);e(e.S,"Math",{log10:function log10(t){return Math.log(t)/Math.LN10}})},{32:32}],161:[function(t,n,r){var e=t(32);e(e.S,"Math",{log1p:t(60)})},{32:32,60:60}],162:[function(t,n,r){var e=t(32);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},{32:32}],163:[function(t,n,r){var e=t(32);e(e.S,"Math",{sign:t(61)})},{32:32,61:61}],164:[function(t,n,r){var e=t(32),i=t(59),o=Math.exp;e(e.S+e.F*t(34)(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},{32:32,34:34,59:59}],165:[function(t,n,r){var e=t(32),i=t(59),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==1/0?1:r==1/0?-1:(n-r)/(o(t)+o(-t))}})},{32:32,59:59}],166:[function(t,n,r){var e=t(32);e(e.S,"Math",{trunc:function trunc(t){return(t>0?Math.floor:Math.ceil)(t)}})},{32:32}],167:[function(t,n,r){"use strict";var e=t(38),i=t(39),o=t(18),u=t(43),c=t(110),f=t(34),a=t(72).f,s=t(70).f,l=t(67).f,h=t(102).trim,v="Number",p=e[v],d=p,y=p.prototype,g=o(t(66)(y))==v,b="trim"in String.prototype,x=function(t){var n=c(t,!1);if("string"==typeof n&&n.length>2){n=b?n.trim():h(n,3);var r,e,i,o=n.charCodeAt(0);if(43===o||45===o){if(r=n.charCodeAt(2),88===r||120===r)return NaN}else if(48===o){switch(n.charCodeAt(1)){case 66:case 98:e=2,i=49;break;case 79:case 111:e=8,i=55;break;default:return+n}for(var u,f=n.slice(2),a=0,s=f.length;ai)return NaN;return parseInt(f,e)}}return+n};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function Number(t){var n=arguments.length<1?0:t,r=this;return r instanceof p&&(g?f(function(){y.valueOf.call(r)}):o(r)!=v)?u(new d(x(n)),r,p):x(n)};for(var m,w=t(28)?a(d):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;w.length>S;S++)i(d,m=w[S])&&!i(p,m)&&l(p,m,s(d,m));p.prototype=y,y.constructor=p,t(87)(e,v,p)}},{102:102,110:110,18:18,28:28,34:34,38:38,39:39,43:43,66:66,67:67,70:70,72:72,87:87}],168:[function(t,n,r){var e=t(32);e(e.S,"Number",{EPSILON:Math.pow(2,-52)})},{32:32}],169:[function(t,n,r){var e=t(32),i=t(38).isFinite;e(e.S,"Number",{isFinite:function isFinite(t){return"number"==typeof t&&i(t)}})},{32:32,38:38}],170:[function(t,n,r){var e=t(32);e(e.S,"Number",{isInteger:t(48)})},{32:32,48:48}],171:[function(t,n,r){var e=t(32);e(e.S,"Number",{isNaN:function isNaN(t){return t!=t}})},{32:32}],172:[function(t,n,r){var e=t(32),i=t(48),o=Math.abs;e(e.S,"Number",{isSafeInteger:function isSafeInteger(t){return i(t)&&o(t)<=9007199254740991}})},{32:32,48:48}],173:[function(t,n,r){var e=t(32);e(e.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{32:32}],174:[function(t,n,r){var e=t(32);e(e.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{32:32}],175:[function(t,n,r){var e=t(32),i=t(81);e(e.S+e.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},{32:32,81:81}],176:[function(t,n,r){var e=t(32),i=t(82);e(e.S+e.F*(Number.parseInt!=i),"Number",{parseInt:i})},{32:32,82:82}],177:[function(t,n,r){"use strict";var e=t(32),i=t(106),o=t(4),u=t(101),c=1..toFixed,f=Math.floor,a=[0,0,0,0,0,0],s="Number.toFixed: incorrect invocation!",l="0",h=function(t,n){for(var r=-1,e=n;++r<6;)e+=t*a[r],a[r]=e%1e7,e=f(e/1e7)},v=function(t){for(var n=6,r=0;--n>=0;)r+=a[n],a[n]=f(r/t),r=r%t*1e7},p=function(){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==a[t]){var r=String(a[t]);n=""===n?r:n+u.call(l,7-r.length)+r}return n},d=function(t,n,r){return 0===n?r:n%2===1?d(t,n-1,r*t):d(t*t,n/2,r)},y=function(t){for(var n=0,r=t;r>=4096;)n+=12,r/=4096;for(;r>=2;)n+=1,r/=2;return n};e(e.P+e.F*(!!c&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!t(34)(function(){c.call({})})),"Number",{toFixed:function toFixed(t){var n,r,e,c,f=o(this,s),a=i(t),g="",b=l;if(a<0||a>20)throw RangeError(s);if(f!=f)return"NaN";if(f<=-1e21||f>=1e21)return String(f);if(f<0&&(g="-",f=-f),f>1e-21)if(n=y(f*d(2,69,1))-69,r=n<0?f*d(2,-n,1):f/d(2,n,1),r*=4503599627370496,n=52-n,n>0){for(h(0,r),e=a;e>=7;)h(1e7,0),e-=7;for(h(d(10,e,1),0),e=n-1;e>=23;)v(1<<23),e-=23;v(1<0?(c=b.length,b=g+(c<=a?"0."+u.call(l,a-c)+b:b.slice(0,c-a)+"."+b.slice(c-a))):b=g+b,b}})},{101:101,106:106,32:32,34:34,4:4}],178:[function(t,n,r){"use strict";var e=t(32),i=t(34),o=t(4),u=1..toPrecision;e(e.P+e.F*(i(function(){return"1"!==u.call(1,void 0)})||!i(function(){u.call({})})),"Number",{toPrecision:function toPrecision(t){var n=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?u.call(n):u.call(n,t)}})},{32:32,34:34,4:4}],179:[function(t,n,r){var e=t(32);e(e.S+e.F,"Object",{assign:t(65)})},{32:32,65:65}],180:[function(t,n,r){var e=t(32);e(e.S,"Object",{create:t(66)})},{32:32,66:66}],181:[function(t,n,r){var e=t(32);e(e.S+e.F*!t(28),"Object",{defineProperties:t(68)})},{28:28,32:32,68:68}],182:[function(t,n,r){var e=t(32);e(e.S+e.F*!t(28),"Object",{defineProperty:t(67).f})},{28:28,32:32,67:67}],183:[function(t,n,r){var e=t(49),i=t(62).onFreeze;t(78)("freeze",function(t){return function freeze(n){return t&&e(n)?t(i(n)):n}})},{49:49,62:62,78:78}],184:[function(t,n,r){var e=t(107),i=t(70).f;t(78)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(t,n){return i(e(t),n)}})},{107:107,70:70,78:78}],185:[function(t,n,r){t(78)("getOwnPropertyNames",function(){return t(71).f})},{71:71,78:78}],186:[function(t,n,r){var e=t(109),i=t(74);t(78)("getPrototypeOf",function(){return function getPrototypeOf(t){return i(e(t))}})},{109:109,74:74,78:78}],187:[function(t,n,r){var e=t(49);t(78)("isExtensible",function(t){return function isExtensible(n){return!!e(n)&&(!t||t(n))}})},{49:49,78:78}],188:[function(t,n,r){var e=t(49);t(78)("isFrozen",function(t){return function isFrozen(n){return!e(n)||!!t&&t(n)}})},{49:49,78:78}],189:[function(t,n,r){var e=t(49);t(78)("isSealed",function(t){return function isSealed(n){return!e(n)||!!t&&t(n)}})},{49:49,78:78}],190:[function(t,n,r){var e=t(32);e(e.S,"Object",{is:t(89)})},{32:32,89:89}],191:[function(t,n,r){var e=t(109),i=t(76);t(78)("keys",function(){return function keys(t){return i(e(t))}})},{109:109,76:76,78:78}],192:[function(t,n,r){var e=t(49),i=t(62).onFreeze;t(78)("preventExtensions",function(t){return function preventExtensions(n){return t&&e(n)?t(i(n)):n}})},{49:49,62:62,78:78}],193:[function(t,n,r){var e=t(49),i=t(62).onFreeze;t(78)("seal",function(t){return function seal(n){return t&&e(n)?t(i(n)):n}})},{49:49,62:62,78:78}],194:[function(t,n,r){var e=t(32);e(e.S,"Object",{setPrototypeOf:t(90).set})},{32:32,90:90}],195:[function(t,n,r){"use strict";var e=t(17),i={};i[t(117)("toStringTag")]="z",i+""!="[object z]"&&t(87)(Object.prototype,"toString",function toString(){return"[object "+e(this)+"]"},!0)},{117:117,17:17,87:87}],196:[function(t,n,r){var e=t(32),i=t(81);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},{32:32,81:81}],197:[function(t,n,r){var e=t(32),i=t(82);e(e.G+e.F*(parseInt!=i),{parseInt:i})},{32:32,82:82}],198:[function(t,n,r){"use strict";var e,i,o,u=t(58),c=t(38),f=t(25),a=t(17),s=t(32),l=t(49),h=t(3),v=t(6),p=t(37),d=t(95),y=t(104).set,g=t(64)(),b="Promise",x=c.TypeError,m=c.process,w=c[b],m=c.process,S="process"==a(m),_=function(){},E=!!function(){try{var n=w.resolve(1),r=(n.constructor={})[t(117)("species")]=function(t){t(_,_)};return(S||"function"==typeof PromiseRejectionEvent)&&n.then(_)instanceof r}catch(t){}}(),O=function(t,n){return t===n||t===w&&n===o},F=function(t){var n;return!(!l(t)||"function"!=typeof(n=t.then))&&n},P=function(t){return O(w,t)?new M(t):new i(t)},M=i=function(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw x("Bad Promise constructor");n=t,r=e}),this.resolve=h(n),this.reject=h(r)},A=function(t){try{t()}catch(t){return{error:t}}},I=function(t,n){if(!t._n){t._n=!0;var r=t._c;g(function(){for(var e=t._v,i=1==t._s,o=0,u=function(n){var r,o,u=i?n.ok:n.fail,c=n.resolve,f=n.reject,a=n.domain;try{u?(i||(2==t._h&&k(t),t._h=1),u===!0?r=e:(a&&a.enter(),r=u(e),a&&a.exit()),r===n.promise?f(x("Promise-chain cycle")):(o=F(r))?o.call(r,c,f):c(r)):f(e)}catch(t){f(t)}};r.length>o;)u(r[o++]);t._c=[],t._n=!1,n&&!t._h&&j(t)})}},j=function(t){y.call(c,function(){var n,r,e,i=t._v;if(N(t)&&(n=A(function(){S?m.emit("unhandledRejection",i,t):(r=c.onunhandledrejection)?r({promise:t,reason:i}):(e=c.console)&&e.error&&e.error("Unhandled promise rejection",i)}),t._h=S||N(t)?2:1),t._a=void 0,n)throw n.error})},N=function(t){if(1==t._h)return!1;for(var n,r=t._a||t._c,e=0;r.length>e;)if(n=r[e++],n.fail||!N(n.promise))return!1;return!0},k=function(t){y.call(c,function(){var n;S?m.emit("rejectionHandled",t):(n=c.onrejectionhandled)&&n({promise:t,reason:t._v})})},R=function(t){var n=this;n._d||(n._d=!0,n=n._w||n,n._v=t,n._s=2,n._a||(n._a=n._c.slice()),I(n,!0))},T=function(t){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw x("Promise can't be resolved itself");(n=F(t))?g(function(){var e={_w:r,_d:!1};try{n.call(t,f(T,e,1),f(R,e,1))}catch(t){R.call(e,t)}}):(r._v=t,r._s=1,I(r,!1))}catch(t){R.call({_w:r,_d:!1},t)}}};E||(w=function Promise(t){v(this,w,b,"_h"),h(t),e.call(this);try{t(f(T,this,1),f(R,this,1))}catch(t){R.call(this,t)}},e=function Promise(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=t(86)(w.prototype,{then:function then(t,n){var r=P(d(this,w));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=S?m.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&I(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),M=function(){var t=new e;this.promise=t,this.resolve=f(T,t,1),this.reject=f(R,t,1)}),s(s.G+s.W+s.F*!E,{Promise:w}),t(92)(w,b),t(91)(b),o=t(23)[b],s(s.S+s.F*!E,b,{reject:function reject(t){var n=P(this),r=n.reject;return r(t),n.promise}}),s(s.S+s.F*(u||!E),b,{resolve:function resolve(t){if(t instanceof w&&O(t.constructor,this))return t;var n=P(this),r=n.resolve;return r(t),n.promise}}),s(s.S+s.F*!(E&&t(54)(function(t){w.all(t).catch(_)})),b,{all:function all(t){var n=this,r=P(n),e=r.resolve,i=r.reject,o=A(function(){var r=[],o=0,u=1;p(t,!1,function(t){var c=o++,f=!1;r.push(void 0),u++,n.resolve(t).then(function(t){f||(f=!0,r[c]=t,--u||e(r))},i)}),--u||e(r)});return o&&i(o.error),r.promise},race:function race(t){var n=this,r=P(n),e=r.reject,i=A(function(){p(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i&&e(i.error),r.promise}})},{104:104,117:117,17:17,23:23,25:25,3:3,32:32,37:37,38:38,49:49,54:54,58:58,6:6,64:64,86:86,91:91,92:92,95:95}],199:[function(t,n,r){var e=t(32),i=t(3),o=t(7),u=(t(38).Reflect||{}).apply,c=Function.apply;e(e.S+e.F*!t(34)(function(){u(function(){})}),"Reflect",{apply:function apply(t,n,r){var e=i(t),f=o(r);return u?u(e,n,f):c.call(e,n,f)}})},{3:3,32:32,34:34,38:38,7:7}],200:[function(t,n,r){var e=t(32),i=t(66),o=t(3),u=t(7),c=t(49),f=t(34),a=t(16),s=(t(38).Reflect||{}).construct,l=f(function(){function F(){}return!(s(function(){},[],F)instanceof F)}),h=!f(function(){s(function(){})});e(e.S+e.F*(l||h),"Reflect",{construct:function construct(t,n){o(t),u(n);var r=arguments.length<3?t:o(arguments[2]);if(h&&!l)return s(t,n,r);if(t==r){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var e=[null];return e.push.apply(e,n),new(a.apply(t,e))}var f=r.prototype,v=i(c(f)?f:Object.prototype),p=Function.apply.call(t,v,n);return c(p)?p:v}})},{16:16,3:3,32:32,34:34,38:38,49:49,66:66,7:7}],201:[function(t,n,r){var e=t(67),i=t(32),o=t(7),u=t(110);i(i.S+i.F*t(34)(function(){Reflect.defineProperty(e.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(t,n,r){o(t),n=u(n,!0),o(r);try{return e.f(t,n,r),!0}catch(t){return!1}}})},{110:110,32:32,34:34,67:67,7:7}],202:[function(t,n,r){var e=t(32),i=t(70).f,o=t(7);e(e.S,"Reflect",{deleteProperty:function deleteProperty(t,n){var r=i(o(t),n);return!(r&&!r.configurable)&&delete t[n]}})},{32:32,7:7,70:70}],203:[function(t,n,r){"use strict";var e=t(32),i=t(7),o=function(t){this._t=i(t),this._i=0;var n,r=this._k=[];for(n in t)r.push(n)};t(52)(o,"Object",function(){var t,n=this,r=n._k;do if(n._i>=r.length)return{value:void 0,done:!0};while(!((t=r[n._i++])in n._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(t){return new o(t)}})},{32:32,52:52,7:7}],204:[function(t,n,r){var e=t(70),i=t(32),o=t(7);i(i.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,n){return e.f(o(t),n)}})},{32:32,7:7,70:70}],205:[function(t,n,r){var e=t(32),i=t(74),o=t(7);e(e.S,"Reflect",{getPrototypeOf:function getPrototypeOf(t){return i(o(t))}})},{32:32,7:7,74:74}],206:[function(t,n,r){function get(t,n){var r,u,a=arguments.length<3?t:arguments[2];return f(t)===a?t[n]:(r=e.f(t,n))?o(r,"value")?r.value:void 0!==r.get?r.get.call(a):void 0:c(u=i(t))?get(u,n,a):void 0}var e=t(70),i=t(74),o=t(39),u=t(32),c=t(49),f=t(7);u(u.S,"Reflect",{get:get})},{32:32,39:39,49:49,7:7,70:70,74:74}],207:[function(t,n,r){var e=t(32);e(e.S,"Reflect",{has:function has(t,n){return n in t; +}})},{32:32}],208:[function(t,n,r){var e=t(32),i=t(7),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function isExtensible(t){return i(t),!o||o(t)}})},{32:32,7:7}],209:[function(t,n,r){var e=t(32);e(e.S,"Reflect",{ownKeys:t(80)})},{32:32,80:80}],210:[function(t,n,r){var e=t(32),i=t(7),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function preventExtensions(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},{32:32,7:7}],211:[function(t,n,r){var e=t(32),i=t(90);i&&e(e.S,"Reflect",{setPrototypeOf:function setPrototypeOf(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(t){return!1}}})},{32:32,90:90}],212:[function(t,n,r){function set(t,n,r){var c,l,h=arguments.length<4?t:arguments[3],v=i.f(a(t),n);if(!v){if(s(l=o(t)))return set(l,n,r,h);v=f(0)}return u(v,"value")?!(v.writable===!1||!s(h))&&(c=i.f(h,n)||f(0),c.value=r,e.f(h,n,c),!0):void 0!==v.set&&(v.set.call(h,r),!0)}var e=t(67),i=t(70),o=t(74),u=t(39),c=t(32),f=t(85),a=t(7),s=t(49);c(c.S,"Reflect",{set:set})},{32:32,39:39,49:49,67:67,7:7,70:70,74:74,85:85}],213:[function(t,n,r){var e=t(38),i=t(43),o=t(67).f,u=t(72).f,c=t(50),f=t(36),a=e.RegExp,s=a,l=a.prototype,h=/a/g,v=/a/g,p=new a(h)!==h;if(t(28)&&(!p||t(34)(function(){return v[t(117)("match")]=!1,a(h)!=h||a(v)==v||"/a/i"!=a(h,"i")}))){a=function RegExp(t,n){var r=this instanceof a,e=c(t),o=void 0===n;return!r&&e&&t.constructor===a&&o?t:i(p?new s(e&&!o?t.source:t,n):s((e=t instanceof a)?t.source:t,e&&o?f.call(t):n),r?this:l,a)};for(var d=(function(t){t in a||o(a,t,{configurable:!0,get:function(){return s[t]},set:function(n){s[t]=n}})}),y=u(s),g=0;y.length>g;)d(y[g++]);l.constructor=a,a.prototype=l,t(87)(e,"RegExp",a)}t(91)("RegExp")},{117:117,28:28,34:34,36:36,38:38,43:43,50:50,67:67,72:72,87:87,91:91}],214:[function(t,n,r){t(28)&&"g"!=/./g.flags&&t(67).f(RegExp.prototype,"flags",{configurable:!0,get:t(36)})},{28:28,36:36,67:67}],215:[function(t,n,r){t(35)("match",1,function(t,n,r){return[function match(r){"use strict";var e=t(this),i=void 0==r?void 0:r[n];return void 0!==i?i.call(r,e):new RegExp(r)[n](String(e))},r]})},{35:35}],216:[function(t,n,r){t(35)("replace",2,function(t,n,r){return[function replace(e,i){"use strict";var o=t(this),u=void 0==e?void 0:e[n];return void 0!==u?u.call(e,o,i):r.call(String(o),e,i)},r]})},{35:35}],217:[function(t,n,r){t(35)("search",1,function(t,n,r){return[function search(r){"use strict";var e=t(this),i=void 0==r?void 0:r[n];return void 0!==i?i.call(r,e):new RegExp(r)[n](String(e))},r]})},{35:35}],218:[function(t,n,r){t(35)("split",2,function(n,r,e){"use strict";var i=t(50),o=e,u=[].push,c="split",f="length",a="lastIndex";if("c"=="abbc"[c](/(b)*/)[1]||4!="test"[c](/(?:)/,-1)[f]||2!="ab"[c](/(?:ab)*/)[f]||4!="."[c](/(.?)(.?)/)[f]||"."[c](/()()/)[f]>1||""[c](/.?/)[f]){var s=void 0===/()??/.exec("")[1];e=function(t,n){var r=String(this);if(void 0===t&&0===n)return[];if(!i(t))return o.call(r,t,n);var e,c,l,h,v,p=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),y=0,g=void 0===n?4294967295:n>>>0,b=new RegExp(t.source,d+"g");for(s||(e=new RegExp("^"+b.source+"$(?!\\s)",d));(c=b.exec(r))&&(l=c.index+c[0][f],!(l>y&&(p.push(r.slice(y,c.index)),!s&&c[f]>1&&c[0].replace(e,function(){for(v=1;v1&&c.index=g)));)b[a]===c.index&&b[a]++;return y===r[f]?!h&&b.test("")||p.push(""):p.push(r.slice(y)),p[f]>g?p.slice(0,g):p}}else"0"[c](void 0,0)[f]&&(e=function(t,n){return void 0===t&&0===n?[]:o.call(this,t,n)});return[function split(t,i){var o=n(this),u=void 0==t?void 0:t[r];return void 0!==u?u.call(t,o,i):e.call(String(o),t,i)},e]})},{35:35,50:50}],219:[function(t,n,r){"use strict";t(214);var e=t(7),i=t(36),o=t(28),u="toString",c=/./[u],f=function(n){t(87)(RegExp.prototype,u,n,!0)};t(34)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?f(function toString(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):c.name!=u&&f(function toString(){return c.call(this)})},{214:214,28:28,34:34,36:36,7:7,87:87}],220:[function(t,n,r){"use strict";var e=t(19);n.exports=t(22)("Set",function(t){return function Set(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function add(t){return e.def(this,t=0===t?0:t,t)}},e)},{19:19,22:22}],221:[function(t,n,r){"use strict";t(99)("anchor",function(t){return function anchor(n){return t(this,"a","name",n)}})},{99:99}],222:[function(t,n,r){"use strict";t(99)("big",function(t){return function big(){return t(this,"big","","")}})},{99:99}],223:[function(t,n,r){"use strict";t(99)("blink",function(t){return function blink(){return t(this,"blink","","")}})},{99:99}],224:[function(t,n,r){"use strict";t(99)("bold",function(t){return function bold(){return t(this,"b","","")}})},{99:99}],225:[function(t,n,r){"use strict";var e=t(32),i=t(97)(!1);e(e.P,"String",{codePointAt:function codePointAt(t){return i(this,t)}})},{32:32,97:97}],226:[function(t,n,r){"use strict";var e=t(32),i=t(108),o=t(98),u="endsWith",c=""[u];e(e.P+e.F*t(33)(u),"String",{endsWith:function endsWith(t){var n=o(this,t,u),r=arguments.length>1?arguments[1]:void 0,e=i(n.length),f=void 0===r?e:Math.min(i(r),e),a=String(t);return c?c.call(n,a,f):n.slice(f-a.length,f)===a}})},{108:108,32:32,33:33,98:98}],227:[function(t,n,r){"use strict";t(99)("fixed",function(t){return function fixed(){return t(this,"tt","","")}})},{99:99}],228:[function(t,n,r){"use strict";t(99)("fontcolor",function(t){return function fontcolor(n){return t(this,"font","color",n)}})},{99:99}],229:[function(t,n,r){"use strict";t(99)("fontsize",function(t){return function fontsize(n){return t(this,"font","size",n)}})},{99:99}],230:[function(t,n,r){var e=t(32),i=t(105),o=String.fromCharCode,u=String.fromCodePoint;e(e.S+e.F*(!!u&&1!=u.length),"String",{fromCodePoint:function fromCodePoint(t){for(var n,r=[],e=arguments.length,u=0;e>u;){if(n=+arguments[u++],i(n,1114111)!==n)throw RangeError(n+" is not a valid code point");r.push(n<65536?o(n):o(((n-=65536)>>10)+55296,n%1024+56320))}return r.join("")}})},{105:105,32:32}],231:[function(t,n,r){"use strict";var e=t(32),i=t(98),o="includes";e(e.P+e.F*t(33)(o),"String",{includes:function includes(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},{32:32,33:33,98:98}],232:[function(t,n,r){"use strict";t(99)("italics",function(t){return function italics(){return t(this,"i","","")}})},{99:99}],233:[function(t,n,r){"use strict";var e=t(97)(!0);t(53)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},{53:53,97:97}],234:[function(t,n,r){"use strict";t(99)("link",function(t){return function link(n){return t(this,"a","href",n)}})},{99:99}],235:[function(t,n,r){var e=t(32),i=t(107),o=t(108);e(e.S,"String",{raw:function raw(t){for(var n=i(t.raw),r=o(n.length),e=arguments.length,u=[],c=0;r>c;)u.push(String(n[c++])),c1?arguments[1]:void 0,n.length)),e=String(t);return c?c.call(n,e,r):n.slice(r,r+e.length)===e}})},{108:108,32:32,33:33,98:98}],239:[function(t,n,r){"use strict";t(99)("strike",function(t){return function strike(){return t(this,"strike","","")}})},{99:99}],240:[function(t,n,r){"use strict";t(99)("sub",function(t){return function sub(){return t(this,"sub","","")}})},{99:99}],241:[function(t,n,r){"use strict";t(99)("sup",function(t){return function sup(){return t(this,"sup","","")}})},{99:99}],242:[function(t,n,r){"use strict";t(102)("trim",function(t){return function trim(){return t(this,3)}})},{102:102}],243:[function(t,n,r){"use strict";var e=t(38),i=t(39),o=t(28),u=t(32),c=t(87),f=t(62).KEY,a=t(34),s=t(94),l=t(92),h=t(114),v=t(117),p=t(116),d=t(115),y=t(57),g=t(31),b=t(47),x=t(7),m=t(107),w=t(110),S=t(85),_=t(66),E=t(71),O=t(70),F=t(67),P=t(76),M=O.f,A=F.f,I=E.f,j=e.Symbol,N=e.JSON,k=N&&N.stringify,R="prototype",T=v("_hidden"),L=v("toPrimitive"),C={}.propertyIsEnumerable,U=s("symbol-registry"),G=s("symbols"),D=s("op-symbols"),W=Object[R],B="function"==typeof j,V=e.QObject,z=!V||!V[R]||!V[R].findChild,K=o&&a(function(){return 7!=_(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=M(W,n);e&&delete W[n],A(t,n,r),e&&t!==W&&A(W,n,e)}:A,J=function(t){var n=G[t]=_(j[R]);return n._k=t,n},Y=B&&"symbol"==typeof j.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof j},q=function defineProperty(t,n,r){return t===W&&q(D,n,r),x(t),n=w(n,!0),x(r),i(G,n)?(r.enumerable?(i(t,T)&&t[T][n]&&(t[T][n]=!1),r=_(r,{enumerable:S(0,!1)})):(i(t,T)||A(t,T,S(1,{})),t[T][n]=!0),K(t,n,r)):A(t,n,r)},X=function defineProperties(t,n){x(t);for(var r,e=g(n=m(n)),i=0,o=e.length;o>i;)q(t,r=e[i++],n[r]);return t},$=function create(t,n){return void 0===n?_(t):X(_(t),n)},H=function propertyIsEnumerable(t){var n=C.call(this,t=w(t,!0));return!(this===W&&i(G,t)&&!i(D,t))&&(!(n||!i(this,t)||!i(G,t)||i(this,T)&&this[T][t])||n)},Z=function getOwnPropertyDescriptor(t,n){if(t=m(t),n=w(n,!0),t!==W||!i(G,n)||i(D,n)){var r=M(t,n);return!r||!i(G,n)||i(t,T)&&t[T][n]||(r.enumerable=!0),r}},Q=function getOwnPropertyNames(t){for(var n,r=I(m(t)),e=[],o=0;r.length>o;)i(G,n=r[o++])||n==T||n==f||e.push(n);return e},tt=function getOwnPropertySymbols(t){for(var n,r=t===W,e=I(r?D:m(t)),o=[],u=0;e.length>u;)!i(G,n=e[u++])||r&&!i(W,n)||o.push(G[n]);return o};B||(j=function Symbol(){if(this instanceof j)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),n=function(r){this===W&&n.call(D,r),i(this,T)&&i(this[T],t)&&(this[T][t]=!1),K(this,t,S(1,r))};return o&&z&&K(W,t,{configurable:!0,set:n}),J(t)},c(j[R],"toString",function toString(){return this._k}),O.f=Z,F.f=q,t(72).f=E.f=Q,t(77).f=H,t(73).f=tt,o&&!t(58)&&c(W,"propertyIsEnumerable",H,!0),p.f=function(t){return J(v(t))}),u(u.G+u.W+u.F*!B,{Symbol:j});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)v(nt[rt++]);for(var nt=P(v.store),rt=0;nt.length>rt;)d(nt[rt++]);u(u.S+u.F*!B,"Symbol",{for:function(t){return i(U,t+="")?U[t]:U[t]=j(t)},keyFor:function keyFor(t){if(Y(t))return y(U,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){z=!0},useSimple:function(){z=!1}}),u(u.S+u.F*!B,"Object",{create:$,defineProperty:q,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:tt}),N&&u(u.S+u.F*(!B||a(function(){var t=j();return"[null]"!=k([t])||"{}"!=k({a:t})||"{}"!=k(Object(t))})),"JSON",{stringify:function stringify(t){if(void 0!==t&&!Y(t)){for(var n,r,e=[t],i=1;arguments.length>i;)e.push(arguments[i++]);return n=e[1],"function"==typeof n&&(r=n),!r&&b(n)||(n=function(t,n){if(r&&(n=r.call(this,t,n)),!Y(n))return n}),e[1]=n,k.apply(N,e)}}}),j[R][L]||t(40)(j[R],L,j[R].valueOf),l(j,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},{107:107,110:110,114:114,115:115,116:116,117:117,28:28,31:31,32:32,34:34,38:38,39:39,40:40,47:47,57:57,58:58,62:62,66:66,67:67,7:7,70:70,71:71,72:72,73:73,76:76,77:77,85:85,87:87,92:92,94:94}],244:[function(t,n,r){"use strict";var e=t(32),i=t(113),o=t(112),u=t(7),c=t(105),f=t(108),a=t(49),s=t(38).ArrayBuffer,l=t(95),h=o.ArrayBuffer,v=o.DataView,p=i.ABV&&s.isView,d=h.prototype.slice,y=i.VIEW,g="ArrayBuffer";e(e.G+e.W+e.F*(s!==h),{ArrayBuffer:h}),e(e.S+e.F*!i.CONSTR,g,{isView:function isView(t){return p&&p(t)||a(t)&&y in t}}),e(e.P+e.U+e.F*t(34)(function(){return!new h(2).slice(1,void 0).byteLength}),g,{slice:function slice(t,n){if(void 0!==d&&void 0===n)return d.call(u(this),t);for(var r=u(this).byteLength,e=c(t,r),i=c(void 0===n?r:n,r),o=new(l(this,h))(f(i-e)),a=new v(this),s=new v(o),p=0;e0?arguments[0]:void 0)}},d={get:function get(t){if(a(t)){var n=s(t);return n===!0?h(this).get(t):n?n[this._i]:void 0}},set:function set(t,n){return f.def(this,t,n)}},y=n.exports=t(22)("WeakMap",p,d,f,!0,!0);7!=(new y).set((Object.freeze||Object)(v),7).get(v)&&(e=f.getConstructor(p),c(e.prototype,d),u.NEED=!0,i(["delete","has","get","set"],function(t){var n=y.prototype,r=n[t];o(n,t,function(n,i){if(a(n)&&!l(n)){this._f||(this._f=new e);var o=this._f[t](n,i);return"set"==t?this:o}return r.call(this,n,i)})}))},{12:12,21:21,22:22,49:49,62:62,65:65,87:87}],256:[function(t,n,r){"use strict";var e=t(21);t(22)("WeakSet",function(t){return function WeakSet(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function add(t){return e.def(this,t,!0)}},e,!1,!0)},{21:21,22:22}],257:[function(t,n,r){"use strict";var e=t(32),i=t(11)(!0);e(e.P,"Array",{includes:function includes(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t(5)("includes")},{11:11,32:32,5:5}],258:[function(t,n,r){var e=t(32),i=t(64)(),o=t(38).process,u="process"==t(18)(o);e(e.G,{asap:function asap(t){var n=u&&o.domain;i(n?n.bind(t):t)}})},{18:18,32:32,38:38,64:64}],259:[function(t,n,r){var e=t(32),i=t(18);e(e.S,"Error",{isError:function isError(t){return"Error"===i(t)}})},{18:18,32:32}],260:[function(t,n,r){var e=t(32);e(e.P+e.R,"Map",{toJSON:t(20)("Map")})},{20:20,32:32}],261:[function(t,n,r){var e=t(32);e(e.S,"Math",{iaddh:function iaddh(t,n,r,e){var i=t>>>0,o=n>>>0,u=r>>>0;return o+(e>>>0)+((i&u|(i|u)&~(i+u>>>0))>>>31)|0}})},{32:32}],262:[function(t,n,r){var e=t(32);e(e.S,"Math",{imulh:function imulh(t,n){var r=65535,e=+t,i=+n,o=e&r,u=i&r,c=e>>16,f=i>>16,a=(c*u>>>0)+(o*u>>>16);return c*f+(a>>16)+((o*f>>>0)+(a&r)>>16)}})},{32:32}],263:[function(t,n,r){var e=t(32);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=n>>>0,u=r>>>0;return o-(e>>>0)-((~i&u|~(i^u)&i-u>>>0)>>>31)|0}})},{32:32}],264:[function(t,n,r){var e=t(32);e(e.S,"Math",{umulh:function umulh(t,n){var r=65535,e=+t,i=+n,o=e&r,u=i&r,c=e>>>16,f=i>>>16,a=(c*u>>>0)+(o*u>>>16);return c*f+(a>>>16)+((o*f>>>0)+(a&r)>>>16)}})},{32:32}],265:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(3),u=t(67);t(28)&&e(e.P+t(69),"Object",{__defineGetter__:function __defineGetter__(t,n){u.f(i(this),t,{get:o(n),enumerable:!0,configurable:!0})}})},{109:109,28:28,3:3,32:32,67:67,69:69}],266:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(3),u=t(67);t(28)&&e(e.P+t(69),"Object",{__defineSetter__:function __defineSetter__(t,n){u.f(i(this),t,{set:o(n),enumerable:!0,configurable:!0})}})},{109:109,28:28,3:3,32:32,67:67,69:69}],267:[function(t,n,r){var e=t(32),i=t(79)(!0);e(e.S,"Object",{entries:function entries(t){return i(t)}})},{32:32,79:79}],268:[function(t,n,r){var e=t(32),i=t(80),o=t(107),u=t(70),c=t(24);e(e.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(t){for(var n,r=o(t),e=u.f,f=i(r),a={},s=0;f.length>s;)c(a,n=f[s++],e(r,n));return a}})},{107:107,24:24,32:32,70:70,80:80}],269:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(110),u=t(74),c=t(70).f;t(28)&&e(e.P+t(69),"Object",{__lookupGetter__:function __lookupGetter__(t){var n,r=i(this),e=o(t,!0);do if(n=c(r,e))return n.get;while(r=u(r))}})},{109:109,110:110,28:28,32:32,69:69,70:70,74:74}],270:[function(t,n,r){"use strict";var e=t(32),i=t(109),o=t(110),u=t(74),c=t(70).f;t(28)&&e(e.P+t(69),"Object",{__lookupSetter__:function __lookupSetter__(t){var n,r=i(this),e=o(t,!0);do if(n=c(r,e))return n.set;while(r=u(r))}})},{109:109,110:110,28:28,32:32,69:69,70:70,74:74}],271:[function(t,n,r){var e=t(32),i=t(79)(!1);e(e.S,"Object",{values:function values(t){return i(t)}})},{32:32,79:79}],272:[function(t,n,r){"use strict";var e=t(32),i=t(38),o=t(23),u=t(64)(),c=t(117)("observable"),f=t(3),a=t(7),s=t(6),l=t(86),h=t(40),v=t(37),p=v.RETURN,d=function(t){return null==t?void 0:f(t)},y=function(t){var n=t._c;n&&(t._c=void 0,n())},g=function(t){return void 0===t._o},b=function(t){g(t)||(t._o=void 0,y(t))},x=function(t,n){a(t),this._c=void 0,this._o=t,t=new m(this);try{var r=n(t),e=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){e.unsubscribe()}:f(r),this._c=r)}catch(n){return void t.error(n)}g(this)&&y(this)};x.prototype=l({},{unsubscribe:function unsubscribe(){b(this)}});var m=function(t){this._s=t};m.prototype=l({},{next:function next(t){var n=this._s;if(!g(n)){var r=n._o;try{var e=d(r.next);if(e)return e.call(r,t)}catch(t){try{b(n)}finally{throw t}}}},error:function error(t){var n=this._s;if(g(n))throw t;var r=n._o;n._o=void 0;try{var e=d(r.error);if(!e)throw t;t=e.call(r,t)}catch(t){try{y(n)}finally{throw t}}return y(n),t},complete:function complete(t){var n=this._s;if(!g(n)){var r=n._o;n._o=void 0;try{var e=d(r.complete);t=e?e.call(r,t):void 0}catch(t){try{y(n)}finally{throw t}}return y(n),t}}});var w=function Observable(t){s(this,w,"Observable","_f")._f=f(t)};l(w.prototype,{subscribe:function subscribe(t){return new x(t,this._f)},forEach:function forEach(t){var n=this;return new(o.Promise||i.Promise)(function(r,e){f(t);var i=n.subscribe({next:function(n){try{return t(n)}catch(t){e(t),i.unsubscribe()}},error:e,complete:r})})}}),l(w,{from:function from(t){var n="function"==typeof this?this:w,r=d(a(t)[c]);if(r){var e=a(r.call(t));return e.constructor===n?e:new n(function(t){return e.subscribe(t)})}return new n(function(n){var r=!1;return u(function(){if(!r){try{if(v(t,!1,function(t){if(n.next(t),r)return p})===p)return}catch(t){if(r)throw t;return void n.error(t)}n.complete()}}),function(){r=!0}})},of:function of(){for(var t=0,n=arguments.length,r=Array(n);t1?arguments[1]:void 0,!1)}})},{100:100,32:32}],286:[function(t,n,r){"use strict";var e=t(32),i=t(100);e(e.P,"String",{padStart:function padStart(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},{100:100,32:32}],287:[function(t,n,r){"use strict";t(102)("trimLeft",function(t){return function trimLeft(){return t(this,1)}},"trimStart")},{102:102}],288:[function(t,n,r){"use strict";t(102)("trimRight",function(t){return function trimRight(){return t(this,2)}},"trimEnd")},{102:102}],289:[function(t,n,r){t(115)("asyncIterator")},{115:115}],290:[function(t,n,r){t(115)("observable")},{115:115}],291:[function(t,n,r){var e=t(32);e(e.S,"System",{global:t(38)})},{32:32,38:38}],292:[function(t,n,r){for(var e=t(130),i=t(87),o=t(38),u=t(40),c=t(56),f=t(117),a=f("iterator"),s=f("toStringTag"),l=c.Array,h=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],v=0;v<5;v++){var p,d=h[v],y=o[d],g=y&&y.prototype;if(g){g[a]||u(g,a,l),g[s]||u(g,s,d),c[d]=l;for(p in e)g[p]||i(g,p,e[p],!0)}}},{117:117,130:130,38:38,40:40,56:56,87:87}],293:[function(t,n,r){var e=t(32),i=t(104);e(e.G+e.B,{setImmediate:i.set,clearImmediate:i.clear})},{104:104,32:32}],294:[function(t,n,r){var e=t(38),i=t(32),o=t(44),u=t(83),c=e.navigator,f=!!c&&/MSIE .\./.test(c.userAgent),a=function(t){return f?function(n,r){return t(o(u,[].slice.call(arguments,2),"function"==typeof n?n:Function(n)),r)}:t};i(i.G+i.B+i.F*f,{setTimeout:a(e.setTimeout),setInterval:a(e.setInterval)})},{32:32,38:38,44:44,83:83}],295:[function(t,n,r){t(243),t(180),t(182),t(181),t(184),t(186),t(191),t(185),t(183),t(193),t(192),t(188),t(189),t(187),t(179),t(190),t(194),t(195),t(146),t(148),t(147),t(197),t(196),t(167),t(177),t(178),t(168),t(169),t(170),t(171),t(172),t(173),t(174),t(175),t(176),t(150),t(151),t(152),t(153),t(154),t(155),t(156),t(157),t(158),t(159),t(160),t(161),t(162),t(163),t(164),t(165),t(166),t(230),t(235),t(242),t(233),t(225),t(226),t(231),t(236),t(238),t(221),t(222),t(223),t(224),t(227),t(228),t(229),t(232),t(234),t(237),t(239),t(240),t(241),t(141),t(143),t(142),t(145),t(144),t(129),t(127),t(134),t(131),t(137),t(139),t(126),t(133),t(123),t(138),t(121),t(136),t(135),t(128),t(132),t(120),t(122),t(125),t(124),t(140),t(130),t(213),t(219),t(214),t(215),t(216),t(217),t(218),t(198),t(149),t(220),t(255),t(256),t(244),t(245),t(250),t(253),t(254),t(248),t(251),t(249),t(252),t(246),t(247),t(199),t(200),t(201),t(202),t(203),t(206),t(204),t(205),t(207),t(208),t(209),t(210),t(212),t(211),t(257),t(283),t(286),t(285),t(287),t(288),t(284),t(289),t(290),t(268),t(271),t(267),t(265),t(266),t(269),t(270),t(260),t(282),t(291),t(259),t(261),t(263),t(262),t(264),t(273),t(274),t(276),t(275),t(278),t(277),t(279),t(280),t(281),t(258),t(272),t(294),t(293),t(292),n.exports=t(23)},{120:120,121:121,122:122,123:123,124:124,125:125,126:126,127:127,128:128,129:129,130:130,131:131,132:132,133:133,134:134,135:135,136:136,137:137,138:138,139:139,140:140,141:141,142:142,143:143,144:144,145:145,146:146,147:147,148:148,149:149,150:150,151:151,152:152,153:153,154:154,155:155,156:156,157:157,158:158,159:159,160:160,161:161,162:162,163:163,164:164,165:165,166:166,167:167,168:168,169:169,170:170,171:171,172:172,173:173,174:174,175:175,176:176,177:177,178:178,179:179,180:180,181:181,182:182,183:183,184:184,185:185,186:186,187:187,188:188,189:189,190:190,191:191,192:192,193:193,194:194,195:195,196:196,197:197,198:198,199:199,200:200,201:201,202:202,203:203,204:204,205:205,206:206,207:207,208:208,209:209,210:210,211:211,212:212,213:213,214:214,215:215,216:216,217:217,218:218,219:219,220:220,221:221,222:222,223:223,224:224,225:225,226:226,227:227,228:228,229:229,23:23,230:230,231:231,232:232,233:233,234:234,235:235,236:236,237:237,238:238,239:239,240:240,241:241,242:242,243:243,244:244,245:245,246:246,247:247,248:248,249:249,250:250,251:251,252:252,253:253,254:254,255:255,256:256,257:257,258:258,259:259,260:260,261:261,262:262,263:263,264:264,265:265,266:266,267:267,268:268,269:269,270:270,271:271,272:272,273:273,274:274,275:275,276:276,277:277,278:278,279:279,280:280,281:281,282:282,283:283,284:284,285:285,286:286,287:287,288:288,289:289,290:290,291:291,292:292,293:293,294:294}],296:[function(t,n,r){(function(t){!function(t){"use strict";function wrap(t,n,r,e){var i=n&&n.prototype instanceof Generator?n:Generator,o=Object.create(i.prototype),u=new Context(e||[]);return o._invoke=makeInvokeMethod(t,r,u),o}function tryCatch(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function AsyncIterator(t){function invoke(n,r,e,o){var u=tryCatch(t[n],t,r);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&i.call(f,"__await")?Promise.resolve(f.__await).then(function(t){invoke("next",t,e,o)},function(t){invoke("throw",t,e,o)}):Promise.resolve(f).then(function(t){c.value=t,e(c)},o)}o(u.arg)}function enqueue(t,r){function callInvokeWithMethodAndArg(){return new Promise(function(n,e){invoke(t,r,n,e)})}return n=n?n.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}"object"==typeof process&&process.domain&&(invoke=process.domain.bind(invoke));var n;this._invoke=enqueue}function makeInvokeMethod(t,n,e){var i=s;return function invoke(o,u){if(i===h)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw u;return doneResult()}for(;;){var c=e.delegate;if(c){if("return"===o||"throw"===o&&c.iterator[o]===r){e.delegate=null;var f=c.iterator.return;if(f){var a=tryCatch(f,c.iterator,u);if("throw"===a.type){o="throw",u=a.arg;continue}}if("return"===o)continue}var a=tryCatch(c.iterator[o],c.iterator,u);if("throw"===a.type){e.delegate=null,o="throw",u=a.arg;continue}o="next",u=r;var d=a.arg;if(!d.done)return i=l,d;e[c.resultName]=d.value,e.next=c.nextLoc,e.delegate=null}if("next"===o)e.sent=e._sent=u;else if("throw"===o){if(i===s)throw i=v,u;e.dispatchException(u)&&(o="next",u=r)}else"return"===o&&e.abrupt("return",u);i=h;var a=tryCatch(t,n,e);if("normal"===a.type){i=e.done?v:l;var d={value:a.arg,done:e.done};if(a.arg!==p)return d;e.delegate&&"next"===o&&(u=r)}else"throw"===a.type&&(i=v,o="throw",u=a.arg)}}}function pushTryEntry(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function resetTryEntry(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,o=function next(){for(;++e=0;--r){var e=this.tryEntries[r],o=e.completion; +if("root"===e.tryLoc)return handle("end");if(e.tryLoc<=this.prev){var u=i.call(e,"catchLoc"),c=i.call(e,"finallyLoc");if(u&&c){if(this.prev=0;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&i.call(e,"finallyLoc")&&this.prev=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),p}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var i=e.arg;resetTryEntry(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:values(t),resultName:n,nextLoc:r},p}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]); diff --git a/node_modules/csscomb/node_modules/babel-polyfill/lib/index.js b/node_modules/csscomb/node_modules/babel-polyfill/lib/index.js new file mode 100644 index 0000000..a8ec931 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/lib/index.js @@ -0,0 +1,28 @@ +"use strict"; + +require("core-js/shim"); + +require("regenerator-runtime/runtime"); + +require("core-js/fn/regexp/escape"); + +if (global._babelPolyfill) { + throw new Error("only one instance of babel-polyfill is allowed"); +} +global._babelPolyfill = true; + +var DEFINE_PROPERTY = "defineProperty"; +function define(O, key, value) { + O[key] || Object[DEFINE_PROPERTY](O, key, { + writable: true, + configurable: true, + value: value + }); +} + +define(String.prototype, "padLeft", "".padStart); +define(String.prototype, "padRight", "".padEnd); + +"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) { + [][key] && define(Array, key, Function.call.bind([][key])); +}); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-polyfill/package.json b/node_modules/csscomb/node_modules/babel-polyfill/package.json new file mode 100644 index 0000000..ec25a82 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "babel-polyfill@6.23.0", + "scope": null, + "escapedName": "babel-polyfill", + "name": "babel-polyfill", + "rawSpec": "6.23.0", + "spec": "6.23.0", + "type": "version" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb" + ] + ], + "_from": "babel-polyfill@6.23.0", + "_id": "babel-polyfill@6.23.0", + "_inCache": true, + "_installable": true, + "_location": "/babel-polyfill", + "_nodeVersion": "6.9.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/babel-polyfill-6.23.0.tgz_1487027067648_0.6487839892506599" + }, + "_npmUser": { + "name": "loganfsmyth", + "email": "loganfsmyth@gmail.com" + }, + "_npmVersion": "3.10.8", + "_phantomChildren": {}, + "_requested": { + "raw": "babel-polyfill@6.23.0", + "scope": null, + "escapedName": "babel-polyfill", + "name": "babel-polyfill", + "rawSpec": "6.23.0", + "spec": "6.23.0", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", + "_shasum": "8364ca62df8eafb830499f699177466c3b03499d", + "_shrinkwrap": null, + "_spec": "babel-polyfill@6.23.0", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb", + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "dependencies": { + "babel-runtime": "^6.22.0", + "core-js": "^2.4.0", + "regenerator-runtime": "^0.10.0" + }, + "description": "Provides polyfills necessary for a full ES2015+ environment", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "8364ca62df8eafb830499f699177466c3b03499d", + "tarball": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz" + }, + "homepage": "https://babeljs.io/", + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "amasad", + "email": "amjad.masad@gmail.com" + }, + { + "name": "hzoo", + "email": "hi@henryzoo.com" + }, + { + "name": "jmm", + "email": "npm-public@jessemccarthy.net" + }, + { + "name": "loganfsmyth", + "email": "loganfsmyth@gmail.com" + }, + { + "name": "sebmck", + "email": "sebmck@gmail.com" + }, + { + "name": "thejameskyle", + "email": "me@thejameskyle.com" + } + ], + "name": "babel-polyfill", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/babel-polyfill" + }, + "scripts": {}, + "version": "6.23.0" +} diff --git a/node_modules/csscomb/node_modules/babel-polyfill/scripts/build-dist.sh b/node_modules/csscomb/node_modules/babel-polyfill/scripts/build-dist.sh new file mode 100755 index 0000000..db5b2bd --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/scripts/build-dist.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -ex + +BROWSERIFY_CMD="../../node_modules/browserify/bin/cmd.js" +UGLIFY_CMD="../../node_modules/uglify-js/bin/uglifyjs" + +mkdir -p dist + +node $BROWSERIFY_CMD lib/index.js \ + --insert-global-vars 'global' \ + --plugin bundle-collapser/plugin \ + --plugin derequire/plugin \ + >dist/polyfill.js +node $UGLIFY_CMD dist/polyfill.js \ + --compress keep_fnames,keep_fargs,warnings=false \ + --mangle keep_fnames \ + >dist/polyfill.min.js diff --git a/node_modules/csscomb/node_modules/babel-polyfill/scripts/postpublish.js b/node_modules/csscomb/node_modules/babel-polyfill/scripts/postpublish.js new file mode 100644 index 0000000..19d7608 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/scripts/postpublish.js @@ -0,0 +1,7 @@ +var fs = require("fs"); +var path = require("path"); + +try { + fs.unlinkSync(path.join(__dirname, "../browser.js")); +} catch (err) {} + diff --git a/node_modules/csscomb/node_modules/babel-polyfill/scripts/prepublish.js b/node_modules/csscomb/node_modules/babel-polyfill/scripts/prepublish.js new file mode 100644 index 0000000..9b03e6d --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-polyfill/scripts/prepublish.js @@ -0,0 +1,8 @@ +var fs = require("fs"); +var path = require("path"); + +function relative(loc) { + return path.join(__dirname, "..", loc); +} + +fs.writeFileSync(relative("browser.js"), fs.readFileSync(relative("dist/polyfill.min.js"))); diff --git a/node_modules/csscomb/node_modules/babel-runtime/.npmignore b/node_modules/csscomb/node_modules/babel-runtime/.npmignore new file mode 100644 index 0000000..3efd5b9 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/.npmignore @@ -0,0 +1,2 @@ +scripts +node_modules diff --git a/node_modules/csscomb/node_modules/babel-runtime/README.md b/node_modules/csscomb/node_modules/babel-runtime/README.md new file mode 100644 index 0000000..8aa8593 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/README.md @@ -0,0 +1,2 @@ +# babel-runtime + diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js.js b/node_modules/csscomb/node_modules/babel-runtime/core-js.js new file mode 100644 index 0000000..7d56643 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js.js @@ -0,0 +1,4 @@ +module.exports = { + "default": require("core-js/library"), + __esModule: true +}; diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/concat.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/concat.js new file mode 100644 index 0000000..f0a5ec7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/concat.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/concat"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/copy-within.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/copy-within.js new file mode 100644 index 0000000..e9352ed --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/copy-within.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/copy-within"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/entries.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/entries.js new file mode 100644 index 0000000..ee8b9e9 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/entries.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/entries"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/every.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/every.js new file mode 100644 index 0000000..adc9319 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/every.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/every"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/fill.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/fill.js new file mode 100644 index 0000000..3cc2fe1 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/fill.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/fill"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/filter.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/filter.js new file mode 100644 index 0000000..f73a5db --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/filter.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/filter"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/find-index.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/find-index.js new file mode 100644 index 0000000..560caa8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/find-index.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/find-index"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/find.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/find.js new file mode 100644 index 0000000..7763993 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/find.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/find"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/for-each.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/for-each.js new file mode 100644 index 0000000..4808c96 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/for-each.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/for-each"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/from.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/from.js new file mode 100644 index 0000000..8c92e81 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/from.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/from"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/includes.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/includes.js new file mode 100644 index 0000000..602d0d8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/includes.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/includes"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/index-of.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/index-of.js new file mode 100644 index 0000000..eb4a6ac --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/index-of.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/index-of"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/join.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/join.js new file mode 100644 index 0000000..7dc300b --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/join.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/join"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/keys.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/keys.js new file mode 100644 index 0000000..5008ccb --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/keys.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/keys"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/last-index-of.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/last-index-of.js new file mode 100644 index 0000000..ed92a55 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/last-index-of.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/last-index-of"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/map.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/map.js new file mode 100644 index 0000000..0f58810 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/map.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/map"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/of.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/of.js new file mode 100644 index 0000000..d03ab62 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/of.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/of"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/pop.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/pop.js new file mode 100644 index 0000000..9114d2f --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/pop.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/pop"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/push.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/push.js new file mode 100644 index 0000000..0cd42be --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/push.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/push"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reduce-right.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reduce-right.js new file mode 100644 index 0000000..f56176c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reduce-right.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/reduce-right"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reduce.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reduce.js new file mode 100644 index 0000000..c0a2006 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reduce.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/reduce"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reverse.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reverse.js new file mode 100644 index 0000000..8892c26 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/reverse.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/reverse"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/shift.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/shift.js new file mode 100644 index 0000000..49e66cd --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/shift.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/shift"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/slice.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/slice.js new file mode 100644 index 0000000..5f5fe16 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/slice.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/slice"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/some.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/some.js new file mode 100644 index 0000000..72ca911 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/some.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/some"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/sort.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/sort.js new file mode 100644 index 0000000..32dece8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/sort.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/sort"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/splice.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/splice.js new file mode 100644 index 0000000..6fdebb0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/splice.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/splice"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/unshift.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/unshift.js new file mode 100644 index 0000000..3c237a4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/unshift.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/unshift"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/array/values.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/values.js new file mode 100644 index 0000000..6cc67aa --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/array/values.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/array/values"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/asap.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/asap.js new file mode 100644 index 0000000..a59e4d0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/asap.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/asap"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/clear-immediate.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/clear-immediate.js new file mode 100644 index 0000000..f2090b7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/clear-immediate.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/clear-immediate"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/error/is-error.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/error/is-error.js new file mode 100644 index 0000000..2637546 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/error/is-error.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/error/is-error"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/get-iterator.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/get-iterator.js new file mode 100644 index 0000000..8f9943a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/get-iterator.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/get-iterator"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/is-iterable.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/is-iterable.js new file mode 100644 index 0000000..d690ac8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/is-iterable.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/is-iterable"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/json/stringify.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/json/stringify.js new file mode 100644 index 0000000..f09e2f9 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/json/stringify.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/json/stringify"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/map.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/map.js new file mode 100644 index 0000000..ed02186 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/map.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/map"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/acosh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/acosh.js new file mode 100644 index 0000000..37e2202 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/acosh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/acosh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/asinh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/asinh.js new file mode 100644 index 0000000..b5147b3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/asinh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/asinh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/atanh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/atanh.js new file mode 100644 index 0000000..ad09bb7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/atanh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/atanh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/cbrt.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/cbrt.js new file mode 100644 index 0000000..24a6974 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/cbrt.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/cbrt"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/clz32.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/clz32.js new file mode 100644 index 0000000..d2218b4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/clz32.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/clz32"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/cosh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/cosh.js new file mode 100644 index 0000000..fa9d079 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/cosh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/cosh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/expm1.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/expm1.js new file mode 100644 index 0000000..860921e --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/expm1.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/expm1"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/fround.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/fround.js new file mode 100644 index 0000000..b62e43a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/fround.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/fround"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/hypot.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/hypot.js new file mode 100644 index 0000000..b07335b --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/hypot.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/hypot"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/iaddh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/iaddh.js new file mode 100644 index 0000000..016eb07 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/iaddh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/iaddh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/imul.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/imul.js new file mode 100644 index 0000000..3bf89e8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/imul.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/imul"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/imulh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/imulh.js new file mode 100644 index 0000000..3fc7d74 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/imulh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/imulh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/isubh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/isubh.js new file mode 100644 index 0000000..6b6ea4f --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/isubh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/isubh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log10.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log10.js new file mode 100644 index 0000000..f384512 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log10.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/log10"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log1p.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log1p.js new file mode 100644 index 0000000..358fc45 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log1p.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/log1p"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log2.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log2.js new file mode 100644 index 0000000..1cbca00 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/log2.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/log2"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/sign.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/sign.js new file mode 100644 index 0000000..8d0cfa3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/sign.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/sign"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/sinh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/sinh.js new file mode 100644 index 0000000..81afadd --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/sinh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/sinh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/tanh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/tanh.js new file mode 100644 index 0000000..76fad88 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/tanh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/tanh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/trunc.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/trunc.js new file mode 100644 index 0000000..443a958 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/trunc.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/trunc"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/math/umulh.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/umulh.js new file mode 100644 index 0000000..357f389 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/math/umulh.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/math/umulh"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/epsilon.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/epsilon.js new file mode 100644 index 0000000..b5c7862 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/epsilon.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/epsilon"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-finite.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-finite.js new file mode 100644 index 0000000..7366242 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-finite.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/is-finite"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-integer.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-integer.js new file mode 100644 index 0000000..69b9bb7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-integer.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/is-integer"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-nan.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-nan.js new file mode 100644 index 0000000..5402a71 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-nan.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/is-nan"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-safe-integer.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-safe-integer.js new file mode 100644 index 0000000..2d72dd4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/is-safe-integer.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/is-safe-integer"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/max-safe-integer.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/max-safe-integer.js new file mode 100644 index 0000000..9b55c84 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/max-safe-integer.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/max-safe-integer"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/min-safe-integer.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/min-safe-integer.js new file mode 100644 index 0000000..b5e9785 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/min-safe-integer.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/min-safe-integer"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/parse-float.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/parse-float.js new file mode 100644 index 0000000..0e0f0bc --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/parse-float.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/parse-float"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/number/parse-int.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/parse-int.js new file mode 100644 index 0000000..6d454ea --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/number/parse-int.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/number/parse-int"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/assign.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/assign.js new file mode 100644 index 0000000..ca48f0c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/assign.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/assign"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/create.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/create.js new file mode 100644 index 0000000..130165c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/create.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/create"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/define-properties.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/define-properties.js new file mode 100644 index 0000000..d39e153 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/define-properties.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/define-properties"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/define-property.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/define-property.js new file mode 100644 index 0000000..f41735b --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/define-property.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/define-property"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/entries.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/entries.js new file mode 100644 index 0000000..32ed7a5 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/entries.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/entries"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/freeze.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/freeze.js new file mode 100644 index 0000000..8cc278b --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/freeze.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/freeze"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js new file mode 100644 index 0000000..8e9296e --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/get-own-property-descriptor"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-descriptors.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-descriptors.js new file mode 100644 index 0000000..23200d2 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-descriptors.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/get-own-property-descriptors"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-names.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-names.js new file mode 100644 index 0000000..7b95445 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-names.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/get-own-property-names"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js new file mode 100644 index 0000000..c2fc78f --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/get-own-property-symbols"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-prototype-of.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-prototype-of.js new file mode 100644 index 0000000..47d3f72 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/get-prototype-of.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/get-prototype-of"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-extensible.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-extensible.js new file mode 100644 index 0000000..51175ad --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-extensible.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/is-extensible"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-frozen.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-frozen.js new file mode 100644 index 0000000..e8ab5f1 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-frozen.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/is-frozen"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-sealed.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-sealed.js new file mode 100644 index 0000000..77beda4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is-sealed.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/is-sealed"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is.js new file mode 100644 index 0000000..6524704 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/is.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/is"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/keys.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/keys.js new file mode 100644 index 0000000..04a3f01 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/keys.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/keys"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/prevent-extensions.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/prevent-extensions.js new file mode 100644 index 0000000..3d4305f --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/prevent-extensions.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/prevent-extensions"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/seal.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/seal.js new file mode 100644 index 0000000..c969cab --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/seal.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/seal"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/set-prototype-of.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/set-prototype-of.js new file mode 100644 index 0000000..63b1435 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/set-prototype-of.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/set-prototype-of"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/object/values.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/values.js new file mode 100644 index 0000000..c587097 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/object/values.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/object/values"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/observable.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/observable.js new file mode 100644 index 0000000..04ca51e --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/observable.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/observable"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/promise.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/promise.js new file mode 100644 index 0000000..0cb9a23 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/promise.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/promise"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/apply.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/apply.js new file mode 100644 index 0000000..cc578d4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/apply.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/apply"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/construct.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/construct.js new file mode 100644 index 0000000..a2d991a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/construct.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/construct"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/define-metadata.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/define-metadata.js new file mode 100644 index 0000000..1ba7d4a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/define-metadata.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/define-metadata"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/define-property.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/define-property.js new file mode 100644 index 0000000..aee1c3a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/define-property.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/define-property"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/delete-metadata.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/delete-metadata.js new file mode 100644 index 0000000..3396c42 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/delete-metadata.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/delete-metadata"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/delete-property.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/delete-property.js new file mode 100644 index 0000000..efa76ab --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/delete-property.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/delete-property"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/enumerate.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/enumerate.js new file mode 100644 index 0000000..041484b --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/enumerate.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/enumerate"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-metadata-keys.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-metadata-keys.js new file mode 100644 index 0000000..722e099 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-metadata-keys.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/get-metadata-keys"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-metadata.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-metadata.js new file mode 100644 index 0000000..d725525 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-metadata.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/get-metadata"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-metadata-keys.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-metadata-keys.js new file mode 100644 index 0000000..feff3a6 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-metadata-keys.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/get-own-metadata-keys"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-metadata.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-metadata.js new file mode 100644 index 0000000..1f8bd56 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-metadata.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/get-own-metadata"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-property-descriptor.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-property-descriptor.js new file mode 100644 index 0000000..67a50f5 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-own-property-descriptor.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/get-own-property-descriptor"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-prototype-of.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-prototype-of.js new file mode 100644 index 0000000..d3c8d4e --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get-prototype-of.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/get-prototype-of"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get.js new file mode 100644 index 0000000..a42e4fb --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/get.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/get"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has-metadata.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has-metadata.js new file mode 100644 index 0000000..c1051a3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has-metadata.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/has-metadata"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has-own-metadata.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has-own-metadata.js new file mode 100644 index 0000000..1cefbf7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has-own-metadata.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/has-own-metadata"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has.js new file mode 100644 index 0000000..e2a9665 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/has.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/has"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/is-extensible.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/is-extensible.js new file mode 100644 index 0000000..b0de7bf --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/is-extensible.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/is-extensible"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/metadata.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/metadata.js new file mode 100644 index 0000000..cb85fde --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/metadata.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/metadata"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/own-keys.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/own-keys.js new file mode 100644 index 0000000..d98fed2 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/own-keys.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/own-keys"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/prevent-extensions.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/prevent-extensions.js new file mode 100644 index 0000000..5408d89 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/prevent-extensions.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/prevent-extensions"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/set-prototype-of.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/set-prototype-of.js new file mode 100644 index 0000000..5433e2e --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/set-prototype-of.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/set-prototype-of"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/set.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/set.js new file mode 100644 index 0000000..657bddc --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/reflect/set.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/reflect/set"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/regexp/escape.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/regexp/escape.js new file mode 100644 index 0000000..12a25c3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/regexp/escape.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/regexp/escape"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/set-immediate.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/set-immediate.js new file mode 100644 index 0000000..fc42eb4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/set-immediate.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/set-immediate"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/set.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/set.js new file mode 100644 index 0000000..22c14d4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/set.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/set"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/at.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/at.js new file mode 100644 index 0000000..1c4b595 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/at.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/at"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/code-point-at.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/code-point-at.js new file mode 100644 index 0000000..4332bdb --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/code-point-at.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/code-point-at"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/ends-with.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/ends-with.js new file mode 100644 index 0000000..ad3b55a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/ends-with.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/ends-with"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/from-code-point.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/from-code-point.js new file mode 100644 index 0000000..8c10782 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/from-code-point.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/from-code-point"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/includes.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/includes.js new file mode 100644 index 0000000..f7de270 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/includes.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/includes"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/match-all.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/match-all.js new file mode 100644 index 0000000..813855c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/match-all.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/match-all"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-end.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-end.js new file mode 100644 index 0000000..5ff9814 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-end.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/pad-end"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-left.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-left.js new file mode 100644 index 0000000..ee67e70 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-left.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/pad-start"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-right.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-right.js new file mode 100644 index 0000000..5ff9814 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-right.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/pad-end"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-start.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-start.js new file mode 100644 index 0000000..ee67e70 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/pad-start.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/pad-start"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/raw.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/raw.js new file mode 100644 index 0000000..05c92dc --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/raw.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/raw"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/repeat.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/repeat.js new file mode 100644 index 0000000..816ef2e --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/repeat.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/repeat"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/starts-with.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/starts-with.js new file mode 100644 index 0000000..5d74716 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/starts-with.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/starts-with"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-end.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-end.js new file mode 100644 index 0000000..7c426f5 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-end.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/trim-end"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-left.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-left.js new file mode 100644 index 0000000..b8a7e1e --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-left.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/trim-left"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-right.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-right.js new file mode 100644 index 0000000..ba3ca74 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-right.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/trim-right"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-start.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-start.js new file mode 100644 index 0000000..f1f035a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim-start.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/trim-start"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim.js new file mode 100644 index 0000000..7d51cf0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/string/trim.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/string/trim"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol.js new file mode 100644 index 0000000..9aa95a0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/async-iterator.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/async-iterator.js new file mode 100644 index 0000000..9dd3a57 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/async-iterator.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/async-iterator"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/for.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/for.js new file mode 100644 index 0000000..de7424f --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/for.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/for"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/has-instance.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/has-instance.js new file mode 100644 index 0000000..f771180 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/has-instance.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/has-instance"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/is-concat-spreadable.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/is-concat-spreadable.js new file mode 100644 index 0000000..0bc7f03 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/is-concat-spreadable.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/is-concat-spreadable"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/iterator.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/iterator.js new file mode 100644 index 0000000..3f9a0fb --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/iterator.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/iterator"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/key-for.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/key-for.js new file mode 100644 index 0000000..15a6cfb --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/key-for.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/key-for"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/match.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/match.js new file mode 100644 index 0000000..ed64810 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/match.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/match"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/observable.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/observable.js new file mode 100644 index 0000000..876f9c0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/observable.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/observable"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/replace.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/replace.js new file mode 100644 index 0000000..35f900b --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/replace.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/replace"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/search.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/search.js new file mode 100644 index 0000000..4b81d31 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/search.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/search"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/species.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/species.js new file mode 100644 index 0000000..4481321 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/species.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/species"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/split.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/split.js new file mode 100644 index 0000000..1f5795c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/split.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/split"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/to-primitive.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/to-primitive.js new file mode 100644 index 0000000..b7f9e04 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/to-primitive.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/to-primitive"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/to-string-tag.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/to-string-tag.js new file mode 100644 index 0000000..d9e4e4d --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/to-string-tag.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/to-string-tag"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/unscopables.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/unscopables.js new file mode 100644 index 0000000..cd3dac0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/symbol/unscopables.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/symbol/unscopables"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/system/global.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/system/global.js new file mode 100644 index 0000000..c442f17 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/system/global.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/system/global"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/weak-map.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/weak-map.js new file mode 100644 index 0000000..de130d4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/weak-map.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/weak-map"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/core-js/weak-set.js b/node_modules/csscomb/node_modules/babel-runtime/core-js/weak-set.js new file mode 100644 index 0000000..b96cb97 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/core-js/weak-set.js @@ -0,0 +1 @@ +module.exports = { "default": require("core-js/library/fn/weak-set"), __esModule: true }; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-generator-delegate.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-generator-delegate.js new file mode 100644 index 0000000..c1debb4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-generator-delegate.js @@ -0,0 +1 @@ +module.exports = require("./asyncGeneratorDelegate.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-generator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-generator.js new file mode 100644 index 0000000..ee87351 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-generator.js @@ -0,0 +1 @@ +module.exports = require("./asyncGenerator.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-iterator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-iterator.js new file mode 100644 index 0000000..c014bbb --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-iterator.js @@ -0,0 +1 @@ +module.exports = require("./asyncIterator.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-to-generator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-to-generator.js new file mode 100644 index 0000000..5f81e90 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_async-to-generator.js @@ -0,0 +1 @@ +module.exports = require("./asyncToGenerator.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_class-call-check.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_class-call-check.js new file mode 100644 index 0000000..d4514f0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_class-call-check.js @@ -0,0 +1 @@ +module.exports = require("./classCallCheck.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_create-class.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_create-class.js new file mode 100644 index 0000000..2699d23 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_create-class.js @@ -0,0 +1 @@ +module.exports = require("./createClass.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_defaults.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_defaults.js new file mode 100644 index 0000000..a4274f5 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_defaults.js @@ -0,0 +1 @@ +module.exports = require("./defaults.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_define-enumerable-properties.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_define-enumerable-properties.js new file mode 100644 index 0000000..c60bbfc --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_define-enumerable-properties.js @@ -0,0 +1 @@ +module.exports = require("./defineEnumerableProperties.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_define-property.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_define-property.js new file mode 100644 index 0000000..a265eab --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_define-property.js @@ -0,0 +1 @@ +module.exports = require("./defineProperty.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_extends.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_extends.js new file mode 100644 index 0000000..2ecdb0e --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_extends.js @@ -0,0 +1 @@ +module.exports = require("./extends.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_get.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_get.js new file mode 100644 index 0000000..39aa387 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_get.js @@ -0,0 +1 @@ +module.exports = require("./get.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_inherits.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_inherits.js new file mode 100644 index 0000000..29deff3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_inherits.js @@ -0,0 +1 @@ +module.exports = require("./inherits.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_instanceof.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_instanceof.js new file mode 100644 index 0000000..4c61213 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_instanceof.js @@ -0,0 +1 @@ +module.exports = require("./instanceof.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_interop-require-default.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_interop-require-default.js new file mode 100644 index 0000000..10edad2 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_interop-require-default.js @@ -0,0 +1 @@ +module.exports = require("./interopRequireDefault.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_interop-require-wildcard.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_interop-require-wildcard.js new file mode 100644 index 0000000..ae19e01 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_interop-require-wildcard.js @@ -0,0 +1 @@ +module.exports = require("./interopRequireWildcard.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_jsx.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_jsx.js new file mode 100644 index 0000000..f21ab91 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_jsx.js @@ -0,0 +1 @@ +module.exports = require("./jsx.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_new-arrow-check.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_new-arrow-check.js new file mode 100644 index 0000000..6325419 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_new-arrow-check.js @@ -0,0 +1 @@ +module.exports = require("./newArrowCheck.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_object-destructuring-empty.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_object-destructuring-empty.js new file mode 100644 index 0000000..9c6ffef --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_object-destructuring-empty.js @@ -0,0 +1 @@ +module.exports = require("./objectDestructuringEmpty.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_object-without-properties.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_object-without-properties.js new file mode 100644 index 0000000..052b207 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_object-without-properties.js @@ -0,0 +1 @@ +module.exports = require("./objectWithoutProperties.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_possible-constructor-return.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_possible-constructor-return.js new file mode 100644 index 0000000..09018d7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_possible-constructor-return.js @@ -0,0 +1 @@ +module.exports = require("./possibleConstructorReturn.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_self-global.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_self-global.js new file mode 100644 index 0000000..c3d45f3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_self-global.js @@ -0,0 +1 @@ +module.exports = require("./selfGlobal.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_set.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_set.js new file mode 100644 index 0000000..e4dd5ea --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_set.js @@ -0,0 +1 @@ +module.exports = require("./set.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_sliced-to-array-loose.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_sliced-to-array-loose.js new file mode 100644 index 0000000..8bb56d3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_sliced-to-array-loose.js @@ -0,0 +1 @@ +module.exports = require("./slicedToArrayLoose.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_sliced-to-array.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_sliced-to-array.js new file mode 100644 index 0000000..28d7fd8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_sliced-to-array.js @@ -0,0 +1 @@ +module.exports = require("./slicedToArray.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_tagged-template-literal-loose.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_tagged-template-literal-loose.js new file mode 100644 index 0000000..8ffa3f7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_tagged-template-literal-loose.js @@ -0,0 +1 @@ +module.exports = require("./taggedTemplateLiteralLoose.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_tagged-template-literal.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_tagged-template-literal.js new file mode 100644 index 0000000..160a917 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_tagged-template-literal.js @@ -0,0 +1 @@ +module.exports = require("./taggedTemplateLiteral.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_temporal-ref.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_temporal-ref.js new file mode 100644 index 0000000..cf2e4e4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_temporal-ref.js @@ -0,0 +1 @@ +module.exports = require("./temporalRef.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_temporal-undefined.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_temporal-undefined.js new file mode 100644 index 0000000..234fc33 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_temporal-undefined.js @@ -0,0 +1 @@ +module.exports = require("./temporalUndefined.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_to-array.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_to-array.js new file mode 100644 index 0000000..d89ee39 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_to-array.js @@ -0,0 +1 @@ +module.exports = require("./toArray.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_to-consumable-array.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_to-consumable-array.js new file mode 100644 index 0000000..0aad718 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_to-consumable-array.js @@ -0,0 +1 @@ +module.exports = require("./toConsumableArray.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/_typeof.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/_typeof.js new file mode 100644 index 0000000..14fd11c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/_typeof.js @@ -0,0 +1 @@ +module.exports = require("./typeof.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/async-generator-delegate.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/async-generator-delegate.js new file mode 100644 index 0000000..c1debb4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/async-generator-delegate.js @@ -0,0 +1 @@ +module.exports = require("./asyncGeneratorDelegate.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/async-generator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/async-generator.js new file mode 100644 index 0000000..ee87351 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/async-generator.js @@ -0,0 +1 @@ +module.exports = require("./asyncGenerator.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/async-iterator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/async-iterator.js new file mode 100644 index 0000000..c014bbb --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/async-iterator.js @@ -0,0 +1 @@ +module.exports = require("./asyncIterator.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/async-to-generator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/async-to-generator.js new file mode 100644 index 0000000..5f81e90 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/async-to-generator.js @@ -0,0 +1 @@ +module.exports = require("./asyncToGenerator.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncGenerator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncGenerator.js new file mode 100644 index 0000000..d3032e7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncGenerator.js @@ -0,0 +1,126 @@ +"use strict"; + +exports.__esModule = true; + +var _symbol = require("../core-js/symbol"); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _promise = require("../core-js/promise"); + +var _promise2 = _interopRequireDefault(_promise); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + function AwaitValue(value) { + this.value = value; + } + + function AsyncGenerator(gen) { + var front, back; + + function send(key, arg) { + return new _promise2.default(function (resolve, reject) { + var request = { + key: key, + arg: arg, + resolve: resolve, + reject: reject, + next: null + }; + + if (back) { + back = back.next = request; + } else { + front = back = request; + resume(key, arg); + } + }); + } + + function resume(key, arg) { + try { + var result = gen[key](arg); + var value = result.value; + + if (value instanceof AwaitValue) { + _promise2.default.resolve(value.value).then(function (arg) { + resume("next", arg); + }, function (arg) { + resume("throw", arg); + }); + } else { + settle(result.done ? "return" : "normal", result.value); + } + } catch (err) { + settle("throw", err); + } + } + + function settle(type, value) { + switch (type) { + case "return": + front.resolve({ + value: value, + done: true + }); + break; + + case "throw": + front.reject(value); + break; + + default: + front.resolve({ + value: value, + done: false + }); + break; + } + + front = front.next; + + if (front) { + resume(front.key, front.arg); + } else { + back = null; + } + } + + this._invoke = send; + + if (typeof gen.return !== "function") { + this.return = undefined; + } + } + + if (typeof _symbol2.default === "function" && _symbol2.default.asyncIterator) { + AsyncGenerator.prototype[_symbol2.default.asyncIterator] = function () { + return this; + }; + } + + AsyncGenerator.prototype.next = function (arg) { + return this._invoke("next", arg); + }; + + AsyncGenerator.prototype.throw = function (arg) { + return this._invoke("throw", arg); + }; + + AsyncGenerator.prototype.return = function (arg) { + return this._invoke("return", arg); + }; + + return { + wrap: function wrap(fn) { + return function () { + return new AsyncGenerator(fn.apply(this, arguments)); + }; + }, + await: function _await(value) { + return new AwaitValue(value); + } + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncGeneratorDelegate.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncGeneratorDelegate.js new file mode 100644 index 0000000..5fcc123 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncGeneratorDelegate.js @@ -0,0 +1,69 @@ +"use strict"; + +exports.__esModule = true; + +var _iterator = require("../core-js/symbol/iterator"); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _symbol = require("../core-js/symbol"); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _promise = require("../core-js/promise"); + +var _promise2 = _interopRequireDefault(_promise); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (inner, awaitWrap) { + var iter = {}, + waiting = false; + + function pump(key, value) { + waiting = true; + value = new _promise2.default(function (resolve) { + resolve(inner[key](value)); + }); + return { + done: false, + value: awaitWrap(value) + }; + } + + ; + + if (typeof _symbol2.default === "function" && _iterator2.default) { + iter[_iterator2.default] = function () { + return this; + }; + } + + iter.next = function (value) { + if (waiting) { + waiting = false; + return value; + } + + return pump("next", value); + }; + + if (typeof inner.throw === "function") { + iter.throw = function (value) { + if (waiting) { + waiting = false; + throw value; + } + + return pump("throw", value); + }; + } + + if (typeof inner.return === "function") { + iter.return = function (value) { + return pump("return", value); + }; + } + + return iter; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncIterator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncIterator.js new file mode 100644 index 0000000..b542b6c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncIterator.js @@ -0,0 +1,32 @@ +"use strict"; + +exports.__esModule = true; + +var _getIterator2 = require("../core-js/get-iterator"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _iterator = require("../core-js/symbol/iterator"); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _symbol = require("../core-js/symbol"); + +var _symbol2 = _interopRequireDefault(_symbol); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (iterable) { + if (typeof _symbol2.default === "function") { + if (_symbol2.default.asyncIterator) { + var method = iterable[_symbol2.default.asyncIterator]; + if (method != null) return method.call(iterable); + } + + if (_iterator2.default) { + return (0, _getIterator3.default)(iterable); + } + } + + throw new TypeError("Object is not async iterable"); +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncToGenerator.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncToGenerator.js new file mode 100644 index 0000000..50be669 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/asyncToGenerator.js @@ -0,0 +1,38 @@ +"use strict"; + +exports.__esModule = true; + +var _promise = require("../core-js/promise"); + +var _promise2 = _interopRequireDefault(_promise); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (fn) { + return function () { + var gen = fn.apply(this, arguments); + return new _promise2.default(function (resolve, reject) { + function step(key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + return _promise2.default.resolve(value).then(function (value) { + step("next", value); + }, function (err) { + step("throw", err); + }); + } + } + + return step("next"); + }); + }; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/class-call-check.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/class-call-check.js new file mode 100644 index 0000000..d4514f0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/class-call-check.js @@ -0,0 +1 @@ +module.exports = require("./classCallCheck.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/classCallCheck.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/classCallCheck.js new file mode 100644 index 0000000..63d6d8f --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/classCallCheck.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/create-class.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/create-class.js new file mode 100644 index 0000000..2699d23 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/create-class.js @@ -0,0 +1 @@ +module.exports = require("./createClass.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/createClass.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/createClass.js new file mode 100644 index 0000000..bee484d --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/createClass.js @@ -0,0 +1,27 @@ +"use strict"; + +exports.__esModule = true; + +var _defineProperty = require("../core-js/object/define-property"); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/defaults.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/defaults.js new file mode 100644 index 0000000..9a721ce --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/defaults.js @@ -0,0 +1,32 @@ +"use strict"; + +exports.__esModule = true; + +var _defineProperty = require("../core-js/object/define-property"); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +var _getOwnPropertyDescriptor = require("../core-js/object/get-own-property-descriptor"); + +var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); + +var _getOwnPropertyNames = require("../core-js/object/get-own-property-names"); + +var _getOwnPropertyNames2 = _interopRequireDefault(_getOwnPropertyNames); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (obj, defaults) { + var keys = (0, _getOwnPropertyNames2.default)(defaults); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = (0, _getOwnPropertyDescriptor2.default)(defaults, key); + + if (value && value.configurable && obj[key] === undefined) { + (0, _defineProperty2.default)(obj, key, value); + } + } + + return obj; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/define-enumerable-properties.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/define-enumerable-properties.js new file mode 100644 index 0000000..c60bbfc --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/define-enumerable-properties.js @@ -0,0 +1 @@ +module.exports = require("./defineEnumerableProperties.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/define-property.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/define-property.js new file mode 100644 index 0000000..a265eab --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/define-property.js @@ -0,0 +1 @@ +module.exports = require("./defineProperty.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/defineEnumerableProperties.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/defineEnumerableProperties.js new file mode 100644 index 0000000..503a1ab --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/defineEnumerableProperties.js @@ -0,0 +1,20 @@ +"use strict"; + +exports.__esModule = true; + +var _defineProperty = require("../core-js/object/define-property"); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (obj, descs) { + for (var key in descs) { + var desc = descs[key]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + (0, _defineProperty2.default)(obj, key, desc); + } + + return obj; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/defineProperty.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/defineProperty.js new file mode 100644 index 0000000..b0f46d8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/defineProperty.js @@ -0,0 +1,24 @@ +"use strict"; + +exports.__esModule = true; + +var _defineProperty = require("../core-js/object/define-property"); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (obj, key, value) { + if (key in obj) { + (0, _defineProperty2.default)(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/extends.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/extends.js new file mode 100644 index 0000000..976aef1 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/extends.js @@ -0,0 +1,23 @@ +"use strict"; + +exports.__esModule = true; + +var _assign = require("../core-js/object/assign"); + +var _assign2 = _interopRequireDefault(_assign); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/get.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/get.js new file mode 100644 index 0000000..38b79b7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/get.js @@ -0,0 +1,38 @@ +"use strict"; + +exports.__esModule = true; + +var _getPrototypeOf = require("../core-js/object/get-prototype-of"); + +var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); + +var _getOwnPropertyDescriptor = require("../core-js/object/get-own-property-descriptor"); + +var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = (0, _getOwnPropertyDescriptor2.default)(object, property); + + if (desc === undefined) { + var parent = (0, _getPrototypeOf2.default)(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/inherits.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/inherits.js new file mode 100644 index 0000000..ae8a92d --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/inherits.js @@ -0,0 +1,33 @@ +"use strict"; + +exports.__esModule = true; + +var _setPrototypeOf = require("../core-js/object/set-prototype-of"); + +var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); + +var _create = require("../core-js/object/create"); + +var _create2 = _interopRequireDefault(_create); + +var _typeof2 = require("../helpers/typeof"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); + } + + subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/instanceof.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/instanceof.js new file mode 100644 index 0000000..f2d90ec --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/instanceof.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; + +var _hasInstance = require("../core-js/symbol/has-instance"); + +var _hasInstance2 = _interopRequireDefault(_hasInstance); + +var _symbol = require("../core-js/symbol"); + +var _symbol2 = _interopRequireDefault(_symbol); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (left, right) { + if (right != null && typeof _symbol2.default !== "undefined" && right[_hasInstance2.default]) { + return right[_hasInstance2.default](left); + } else { + return left instanceof right; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/interop-require-default.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/interop-require-default.js new file mode 100644 index 0000000..10edad2 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/interop-require-default.js @@ -0,0 +1 @@ +module.exports = require("./interopRequireDefault.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/interop-require-wildcard.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/interop-require-wildcard.js new file mode 100644 index 0000000..ae19e01 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/interop-require-wildcard.js @@ -0,0 +1 @@ +module.exports = require("./interopRequireWildcard.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/interopRequireDefault.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/interopRequireDefault.js new file mode 100644 index 0000000..df808f6 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/interopRequireDefault.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/interopRequireWildcard.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/interopRequireWildcard.js new file mode 100644 index 0000000..d95b6ac --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/interopRequireWildcard.js @@ -0,0 +1,20 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/jsx.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/jsx.js new file mode 100644 index 0000000..b2164d0 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/jsx.js @@ -0,0 +1,56 @@ +"use strict"; + +exports.__esModule = true; + +var _for = require("../core-js/symbol/for"); + +var _for2 = _interopRequireDefault(_for); + +var _symbol = require("../core-js/symbol"); + +var _symbol2 = _interopRequireDefault(_symbol); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + var REACT_ELEMENT_TYPE = typeof _symbol2.default === "function" && _for2.default && (0, _for2.default)("react.element") || 0xeac7; + return function createRawReactElement(type, props, key, children) { + var defaultProps = type && type.defaultProps; + var childrenLength = arguments.length - 3; + + if (!props && childrenLength !== 0) { + props = {}; + } + + if (props && defaultProps) { + for (var propName in defaultProps) { + if (props[propName] === void 0) { + props[propName] = defaultProps[propName]; + } + } + } else if (!props) { + props = defaultProps || {}; + } + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 3]; + } + + props.children = childArray; + } + + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key === undefined ? null : '' + key, + ref: null, + props: props, + _owner: null + }; + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/new-arrow-check.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/new-arrow-check.js new file mode 100644 index 0000000..6325419 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/new-arrow-check.js @@ -0,0 +1 @@ +module.exports = require("./newArrowCheck.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/newArrowCheck.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/newArrowCheck.js new file mode 100644 index 0000000..c15ee5c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/newArrowCheck.js @@ -0,0 +1,9 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/object-destructuring-empty.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/object-destructuring-empty.js new file mode 100644 index 0000000..9c6ffef --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/object-destructuring-empty.js @@ -0,0 +1 @@ +module.exports = require("./objectDestructuringEmpty.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/object-without-properties.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/object-without-properties.js new file mode 100644 index 0000000..052b207 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/object-without-properties.js @@ -0,0 +1 @@ +module.exports = require("./objectWithoutProperties.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/objectDestructuringEmpty.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/objectDestructuringEmpty.js new file mode 100644 index 0000000..e2651c1 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/objectDestructuringEmpty.js @@ -0,0 +1,7 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (obj) { + if (obj == null) throw new TypeError("Cannot destructure undefined"); +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/objectWithoutProperties.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/objectWithoutProperties.js new file mode 100644 index 0000000..e9f07e6 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/objectWithoutProperties.js @@ -0,0 +1,15 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (obj, keys) { + var target = {}; + + for (var i in obj) { + if (keys.indexOf(i) >= 0) continue; + if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; + target[i] = obj[i]; + } + + return target; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/possible-constructor-return.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/possible-constructor-return.js new file mode 100644 index 0000000..09018d7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/possible-constructor-return.js @@ -0,0 +1 @@ +module.exports = require("./possibleConstructorReturn.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/possibleConstructorReturn.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/possibleConstructorReturn.js new file mode 100644 index 0000000..957f425 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/possibleConstructorReturn.js @@ -0,0 +1,17 @@ +"use strict"; + +exports.__esModule = true; + +var _typeof2 = require("../helpers/typeof"); + +var _typeof3 = _interopRequireDefault(_typeof2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/self-global.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/self-global.js new file mode 100644 index 0000000..c3d45f3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/self-global.js @@ -0,0 +1 @@ +module.exports = require("./selfGlobal.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/selfGlobal.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/selfGlobal.js new file mode 100644 index 0000000..378beb8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/selfGlobal.js @@ -0,0 +1,4 @@ +"use strict"; + +exports.__esModule = true; +exports.default = typeof global === "undefined" ? self : global; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/set.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/set.js new file mode 100644 index 0000000..8780efb --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/set.js @@ -0,0 +1,35 @@ +"use strict"; + +exports.__esModule = true; + +var _getPrototypeOf = require("../core-js/object/get-prototype-of"); + +var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); + +var _getOwnPropertyDescriptor = require("../core-js/object/get-own-property-descriptor"); + +var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function set(object, property, value, receiver) { + var desc = (0, _getOwnPropertyDescriptor2.default)(object, property); + + if (desc === undefined) { + var parent = (0, _getPrototypeOf2.default)(object); + + if (parent !== null) { + set(parent, property, value, receiver); + } + } else if ("value" in desc && desc.writable) { + desc.value = value; + } else { + var setter = desc.set; + + if (setter !== undefined) { + setter.call(receiver, value); + } + } + + return value; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/sliced-to-array-loose.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/sliced-to-array-loose.js new file mode 100644 index 0000000..8bb56d3 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/sliced-to-array-loose.js @@ -0,0 +1 @@ +module.exports = require("./slicedToArrayLoose.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/sliced-to-array.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/sliced-to-array.js new file mode 100644 index 0000000..28d7fd8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/sliced-to-array.js @@ -0,0 +1 @@ +module.exports = require("./slicedToArray.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/slicedToArray.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/slicedToArray.js new file mode 100644 index 0000000..de11512 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/slicedToArray.js @@ -0,0 +1,51 @@ +"use strict"; + +exports.__esModule = true; + +var _isIterable2 = require("../core-js/is-iterable"); + +var _isIterable3 = _interopRequireDefault(_isIterable2); + +var _getIterator2 = require("../core-js/get-iterator"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if ((0, _isIterable3.default)(Object(arr))) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/slicedToArrayLoose.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/slicedToArrayLoose.js new file mode 100644 index 0000000..012bbd8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/slicedToArrayLoose.js @@ -0,0 +1,31 @@ +"use strict"; + +exports.__esModule = true; + +var _getIterator2 = require("../core-js/get-iterator"); + +var _getIterator3 = _interopRequireDefault(_getIterator2); + +var _isIterable2 = require("../core-js/is-iterable"); + +var _isIterable3 = _interopRequireDefault(_isIterable2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if ((0, _isIterable3.default)(Object(arr))) { + var _arr = []; + + for (var _iterator = (0, _getIterator3.default)(arr), _step; !(_step = _iterator.next()).done;) { + _arr.push(_step.value); + + if (i && _arr.length === i) break; + } + + return _arr; + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/tagged-template-literal-loose.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/tagged-template-literal-loose.js new file mode 100644 index 0000000..8ffa3f7 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/tagged-template-literal-loose.js @@ -0,0 +1 @@ +module.exports = require("./taggedTemplateLiteralLoose.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/tagged-template-literal.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/tagged-template-literal.js new file mode 100644 index 0000000..160a917 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/tagged-template-literal.js @@ -0,0 +1 @@ +module.exports = require("./taggedTemplateLiteral.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/taggedTemplateLiteral.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/taggedTemplateLiteral.js new file mode 100644 index 0000000..060dcf9 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/taggedTemplateLiteral.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; + +var _defineProperties = require("../core-js/object/define-properties"); + +var _defineProperties2 = _interopRequireDefault(_defineProperties); + +var _freeze = require("../core-js/object/freeze"); + +var _freeze2 = _interopRequireDefault(_freeze); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (strings, raw) { + return (0, _freeze2.default)((0, _defineProperties2.default)(strings, { + raw: { + value: (0, _freeze2.default)(raw) + } + })); +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/taggedTemplateLiteralLoose.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/taggedTemplateLiteralLoose.js new file mode 100644 index 0000000..76c4930 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/taggedTemplateLiteralLoose.js @@ -0,0 +1,8 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (strings, raw) { + strings.raw = raw; + return strings; +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/temporal-ref.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/temporal-ref.js new file mode 100644 index 0000000..cf2e4e4 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/temporal-ref.js @@ -0,0 +1 @@ +module.exports = require("./temporalRef.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/temporal-undefined.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/temporal-undefined.js new file mode 100644 index 0000000..234fc33 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/temporal-undefined.js @@ -0,0 +1 @@ +module.exports = require("./temporalUndefined.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/temporalRef.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/temporalRef.js new file mode 100644 index 0000000..49b8b24 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/temporalRef.js @@ -0,0 +1,11 @@ +"use strict"; + +exports.__esModule = true; + +exports.default = function (val, name, undef) { + if (val === undef) { + throw new ReferenceError(name + " is not defined - temporal dead zone"); + } else { + return val; + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/temporalUndefined.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/temporalUndefined.js new file mode 100644 index 0000000..4066de1 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/temporalUndefined.js @@ -0,0 +1,4 @@ +"use strict"; + +exports.__esModule = true; +exports.default = {}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/to-array.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/to-array.js new file mode 100644 index 0000000..d89ee39 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/to-array.js @@ -0,0 +1 @@ +module.exports = require("./toArray.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/to-consumable-array.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/to-consumable-array.js new file mode 100644 index 0000000..0aad718 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/to-consumable-array.js @@ -0,0 +1 @@ +module.exports = require("./toConsumableArray.js"); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/toArray.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/toArray.js new file mode 100644 index 0000000..8601a44 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/toArray.js @@ -0,0 +1,13 @@ +"use strict"; + +exports.__esModule = true; + +var _from = require("../core-js/array/from"); + +var _from2 = _interopRequireDefault(_from); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (arr) { + return Array.isArray(arr) ? arr : (0, _from2.default)(arr); +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/toConsumableArray.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/toConsumableArray.js new file mode 100644 index 0000000..c4e34f5 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/toConsumableArray.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; + +var _from = require("../core-js/array/from"); + +var _from2 = _interopRequireDefault(_from); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } else { + return (0, _from2.default)(arr); + } +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/helpers/typeof.js b/node_modules/csscomb/node_modules/babel-runtime/helpers/typeof.js new file mode 100644 index 0000000..d22add8 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/helpers/typeof.js @@ -0,0 +1,21 @@ +"use strict"; + +exports.__esModule = true; + +var _iterator = require("../core-js/symbol/iterator"); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _symbol = require("../core-js/symbol"); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); +} : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); +}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/.npmignore b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/.npmignore new file mode 100644 index 0000000..e216ae5 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/test diff --git a/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/README.md b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/README.md new file mode 100644 index 0000000..d93386a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/README.md @@ -0,0 +1,31 @@ +# regenerator-runtime + +Standalone runtime for +[Regenerator](https://github.com/facebook/regenerator)-compiled generator +and `async` functions. + +To import the runtime as a module (recommended), either of the following +import styles will work: +```js +// CommonJS +const regeneratorRuntime = require("regenerator-runtime"); + +// ECMAScript 2015 +import regeneratorRuntime from "regenerator-runtime"; +``` + +To ensure that `regeneratorRuntime` is defined globally, either of the +following styles will work: +```js +// CommonJS +require("regenerator-runtime/runtime"); + +// ECMAScript 2015 +import "regenerator-runtime/runtime"; +``` + +To get the absolute file system path of `runtime.js`, evaluate the +following expression: +```js +require("regenerator-runtime/path").path +``` diff --git a/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/package.json b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/package.json new file mode 100644 index 0000000..f537b4a --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + { + "raw": "regenerator-runtime@^0.11.0", + "scope": null, + "escapedName": "regenerator-runtime", + "name": "regenerator-runtime", + "rawSpec": "^0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/babel-runtime" + ] + ], + "_from": "regenerator-runtime@>=0.11.0 <0.12.0", + "_id": "regenerator-runtime@0.11.0", + "_inCache": true, + "_installable": true, + "_location": "/babel-runtime/regenerator-runtime", + "_nodeVersion": "8.2.1", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/regenerator-runtime-0.11.0.tgz_1502824917902_0.7827742118388414" + }, + "_npmUser": { + "name": "benjamn", + "email": "ben@benjamn.com" + }, + "_npmVersion": "5.3.0", + "_phantomChildren": {}, + "_requested": { + "raw": "regenerator-runtime@^0.11.0", + "scope": null, + "escapedName": "regenerator-runtime", + "name": "regenerator-runtime", + "rawSpec": "^0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-runtime" + ], + "_resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", + "_shasum": "7e54fe5b5ccd5d6624ea6255c3473be090b802e1", + "_shrinkwrap": null, + "_spec": "regenerator-runtime@^0.11.0", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/babel-runtime", + "author": { + "name": "Ben Newman", + "email": "bn@cs.stanford.edu" + }, + "dependencies": {}, + "description": "Runtime for Regenerator-compiled generator and async functions.", + "devDependencies": {}, + "directories": {}, + "dist": { + "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", + "shasum": "7e54fe5b5ccd5d6624ea6255c3473be090b802e1", + "tarball": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz" + }, + "keywords": [ + "regenerator", + "runtime", + "generator", + "async" + ], + "license": "MIT", + "main": "runtime-module.js", + "maintainers": [ + { + "name": "benjamn", + "email": "bn@cs.stanford.edu" + } + ], + "name": "regenerator-runtime", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime" + }, + "version": "0.11.0" +} diff --git a/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/path.js b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/path.js new file mode 100644 index 0000000..a450a75 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/path.js @@ -0,0 +1,4 @@ +exports.path = require("path").join( + __dirname, + "runtime.js" +); diff --git a/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime-module.js b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime-module.js new file mode 100644 index 0000000..57b6557 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime-module.js @@ -0,0 +1,28 @@ +// This method of obtaining a reference to the global object needs to be +// kept identical to the way it is obtained in runtime.js +var g = (function() { return this })() || Function("return this")(); + +// Use `getOwnPropertyNames` because not all browsers support calling +// `hasOwnProperty` on the global `self` object in a worker. See #183. +var hadRuntime = g.regeneratorRuntime && + Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; + +// Save the old regeneratorRuntime in case it needs to be restored later. +var oldRuntime = hadRuntime && g.regeneratorRuntime; + +// Force reevalutation of runtime.js. +g.regeneratorRuntime = undefined; + +module.exports = require("./runtime"); + +if (hadRuntime) { + // Restore the original runtime. + g.regeneratorRuntime = oldRuntime; +} else { + // Remove the global property added by runtime.js. + try { + delete g.regeneratorRuntime; + } catch(e) { + g.regeneratorRuntime = undefined; + } +} diff --git a/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js new file mode 100644 index 0000000..fb2ab55 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js @@ -0,0 +1,730 @@ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + runtime.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; +})( + // In sloppy mode, unbound `this` refers to the global object, fallback to + // Function constructor if we're in global strict mode. That is sadly a form + // of indirect eval which violates Content Security Policy. + (function() { return this })() || Function("return this")() +); diff --git a/node_modules/csscomb/node_modules/babel-runtime/package-lock.json b/node_modules/csscomb/node_modules/babel-runtime/package-lock.json new file mode 100644 index 0000000..78600f9 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/package-lock.json @@ -0,0 +1,232 @@ +{ + "name": "babel-runtime", + "version": "6.23.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "babel-code-frame": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", + "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-template": "6.25.0" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-plugin-transform-runtime": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz", + "integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0" + } + }, + "babel-runtime": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.25.0.tgz", + "integrity": "sha1-M7mOql1IK7AajRqmtDetKwGuxBw=", + "dev": true, + "requires": { + "core-js": "2.5.0" + } + }, + "babel-template": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.25.0.tgz", + "integrity": "sha1-ZlJBFmt8KqTGGdceGSlpVSsQwHE=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "babel-traverse": "6.25.0", + "babel-types": "6.25.0", + "babylon": "6.18.0", + "lodash": "4.17.4" + } + }, + "babel-traverse": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.25.0.tgz", + "integrity": "sha1-IldJfi/NGbie3BPEyROB+VEklvE=", + "dev": true, + "requires": { + "babel-code-frame": "6.22.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.25.0", + "babel-types": "6.25.0", + "babylon": "6.18.0", + "debug": "2.6.8", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + } + }, + "babel-types": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.25.0.tgz", + "integrity": "sha1-cK+ySNVmDl0Y+BHZHIMDtUE0oY4=", + "dev": true, + "requires": { + "babel-runtime": "6.25.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "core-js": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz", + "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=" + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "invariant": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", + "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + } + } +} diff --git a/node_modules/csscomb/node_modules/babel-runtime/package.json b/node_modules/csscomb/node_modules/babel-runtime/package.json new file mode 100644 index 0000000..326421c --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + { + "raw": "babel-runtime@^6.22.0", + "scope": null, + "escapedName": "babel-runtime", + "name": "babel-runtime", + "rawSpec": "^6.22.0", + "spec": ">=6.22.0 <7.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/babel-polyfill" + ] + ], + "_from": "babel-runtime@>=6.22.0 <7.0.0", + "_id": "babel-runtime@6.26.0", + "_inCache": true, + "_installable": true, + "_location": "/babel-runtime", + "_nodeVersion": "6.9.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/babel-runtime-6.26.0.tgz_1502898849886_0.663184720557183" + }, + "_npmUser": { + "name": "hzoo", + "email": "hi@henryzoo.com" + }, + "_npmVersion": "4.6.1", + "_phantomChildren": {}, + "_requested": { + "raw": "babel-runtime@^6.22.0", + "scope": null, + "escapedName": "babel-runtime", + "name": "babel-runtime", + "rawSpec": "^6.22.0", + "spec": ">=6.22.0 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-polyfill" + ], + "_resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "_shasum": "965c7058668e82b55d7bfe04ff2337bc8b5647fe", + "_shrinkwrap": null, + "_spec": "babel-runtime@^6.22.0", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/babel-polyfill", + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "description": "babel selfContained runtime", + "devDependencies": { + "babel-helpers": "^6.22.0", + "babel-plugin-transform-runtime": "^6.23.0" + }, + "directories": {}, + "dist": { + "shasum": "965c7058668e82b55d7bfe04ff2337bc8b5647fe", + "tarball": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz" + }, + "license": "MIT", + "maintainers": [ + { + "name": "thejameskyle", + "email": "me@thejameskyle.com" + }, + { + "name": "sebmck", + "email": "sebmck@gmail.com" + }, + { + "name": "danez", + "email": "daniel@tschinder.de" + }, + { + "name": "hzoo", + "email": "hi@henryzoo.com" + }, + { + "name": "loganfsmyth", + "email": "loganfsmyth@gmail.com" + } + ], + "name": "babel-runtime", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/babel-runtime" + }, + "scripts": {}, + "version": "6.26.0" +} diff --git a/node_modules/csscomb/node_modules/babel-runtime/regenerator/index.js b/node_modules/csscomb/node_modules/babel-runtime/regenerator/index.js new file mode 100644 index 0000000..9fd4158 --- /dev/null +++ b/node_modules/csscomb/node_modules/babel-runtime/regenerator/index.js @@ -0,0 +1 @@ +module.exports = require("regenerator-runtime"); diff --git a/node_modules/csscomb/node_modules/balanced-match/.npmignore b/node_modules/csscomb/node_modules/balanced-match/.npmignore new file mode 100644 index 0000000..ae5d8c3 --- /dev/null +++ b/node_modules/csscomb/node_modules/balanced-match/.npmignore @@ -0,0 +1,5 @@ +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/node_modules/csscomb/node_modules/balanced-match/LICENSE.md b/node_modules/csscomb/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000..2cdc8e4 --- /dev/null +++ b/node_modules/csscomb/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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. diff --git a/node_modules/csscomb/node_modules/balanced-match/README.md b/node_modules/csscomb/node_modules/balanced-match/README.md new file mode 100644 index 0000000..08e918c --- /dev/null +++ b/node_modules/csscomb/node_modules/balanced-match/README.md @@ -0,0 +1,91 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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. diff --git a/node_modules/csscomb/node_modules/balanced-match/index.js b/node_modules/csscomb/node_modules/balanced-match/index.js new file mode 100644 index 0000000..1685a76 --- /dev/null +++ b/node_modules/csscomb/node_modules/balanced-match/index.js @@ -0,0 +1,59 @@ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/node_modules/csscomb/node_modules/balanced-match/package.json b/node_modules/csscomb/node_modules/balanced-match/package.json new file mode 100644 index 0000000..da65b7c --- /dev/null +++ b/node_modules/csscomb/node_modules/balanced-match/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "balanced-match@^1.0.0", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=1.0.0 <2.0.0", + "_id": "balanced-match@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/balanced-match", + "_nodeVersion": "7.8.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/balanced-match-1.0.0.tgz_1497251909645_0.8755026108119637" + }, + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "4.2.0", + "_phantomChildren": {}, + "_requested": { + "raw": "balanced-match@^1.0.0", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", + "_shrinkwrap": null, + "_spec": "balanced-match@^1.0.0", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/brace-expansion", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "directories": {}, + "dist": { + "shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz" + }, + "gitHead": "d701a549a7653a874eebce7eca25d3577dc868ac", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "bench": "make bench", + "test": "make test" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.0.0" +} diff --git a/node_modules/csscomb/node_modules/brace-expansion/README.md b/node_modules/csscomb/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..ed2ec1f --- /dev/null +++ b/node_modules/csscomb/node_modules/brace-expansion/README.md @@ -0,0 +1,123 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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. diff --git a/node_modules/csscomb/node_modules/brace-expansion/index.js b/node_modules/csscomb/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..0478be8 --- /dev/null +++ b/node_modules/csscomb/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/node_modules/csscomb/node_modules/brace-expansion/package.json b/node_modules/csscomb/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..d6485d4 --- /dev/null +++ b/node_modules/csscomb/node_modules/brace-expansion/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "brace-expansion@^1.1.7", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.1.7", + "spec": ">=1.1.7 <2.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.1.7 <2.0.0", + "_id": "brace-expansion@1.1.8", + "_inCache": true, + "_installable": true, + "_location": "/brace-expansion", + "_nodeVersion": "7.8.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/brace-expansion-1.1.8.tgz_1497251980593_0.6575565172825009" + }, + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "4.2.0", + "_phantomChildren": {}, + "_requested": { + "raw": "brace-expansion@^1.1.7", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.1.7", + "spec": ">=1.1.7 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob/minimatch", + "/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "_shasum": "c07b211c7c952ec1f8efd51a77ef0d1d3990a292", + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.1.7", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob/node_modules/minimatch", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "directories": {}, + "dist": { + "shasum": "c07b211c7c952ec1f8efd51a77ef0d1d3990a292", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz" + }, + "gitHead": "8f59e68bd5c915a0d624e8e39354e1ccf672edf6", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "bench": "matcha test/perf/bench.js", + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.8" +} diff --git a/node_modules/csscomb/node_modules/commander/History.md b/node_modules/csscomb/node_modules/commander/History.md deleted file mode 100644 index 2e66582..0000000 --- a/node_modules/csscomb/node_modules/commander/History.md +++ /dev/null @@ -1,179 +0,0 @@ - -2.0.0 / 2013-07-18 -================== - - * remove input methods (.prompt, .confirm, etc) - -1.3.2 / 2013-07-18 -================== - - * add support for sub-commands to co-exist with the original command - -1.3.1 / 2013-07-18 -================== - - * add quick .runningCommand hack so you can opt-out of other logic when running a sub command - -1.3.0 / 2013-07-09 -================== - - * add EACCES error handling - * fix sub-command --help - -1.2.0 / 2013-06-13 -================== - - * allow "-" hyphen as an option argument - * support for RegExp coercion - -1.1.1 / 2012-11-20 -================== - - * add more sub-command padding - * fix .usage() when args are present. Closes #106 - -1.1.0 / 2012-11-16 -================== - - * add git-style executable subcommand support. Closes #94 - -1.0.5 / 2012-10-09 -================== - - * fix `--name` clobbering. Closes #92 - * fix examples/help. Closes #89 - -1.0.4 / 2012-09-03 -================== - - * add `outputHelp()` method. - -1.0.3 / 2012-08-30 -================== - - * remove invalid .version() defaulting - -1.0.2 / 2012-08-24 -================== - - * add `--foo=bar` support [arv] - * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus] - -1.0.1 / 2012-08-03 -================== - - * fix issue #56 - * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) - -1.0.0 / 2012-07-05 -================== - - * add support for optional option descriptions - * add defaulting of `.version()` to package.json's version - -0.6.1 / 2012-06-01 -================== - - * Added: append (yes or no) on confirmation - * Added: allow node.js v0.7.x - -0.6.0 / 2012-04-10 -================== - - * Added `.prompt(obj, callback)` support. Closes #49 - * Added default support to .choose(). Closes #41 - * Fixed the choice example - -0.5.1 / 2011-12-20 -================== - - * Fixed `password()` for recent nodes. Closes #36 - -0.5.0 / 2011-12-04 -================== - - * Added sub-command option support [itay] - -0.4.3 / 2011-12-04 -================== - - * Fixed custom help ordering. Closes #32 - -0.4.2 / 2011-11-24 -================== - - * Added travis support - * Fixed: line-buffered input automatically trimmed. Closes #31 - -0.4.1 / 2011-11-18 -================== - - * Removed listening for "close" on --help - -0.4.0 / 2011-11-15 -================== - - * Added support for `--`. Closes #24 - -0.3.3 / 2011-11-14 -================== - - * Fixed: wait for close event when writing help info [Jerry Hamlet] - -0.3.2 / 2011-11-01 -================== - - * Fixed long flag definitions with values [felixge] - -0.3.1 / 2011-10-31 -================== - - * Changed `--version` short flag to `-V` from `-v` - * Changed `.version()` so it's configurable [felixge] - -0.3.0 / 2011-10-31 -================== - - * Added support for long flags only. Closes #18 - -0.2.1 / 2011-10-24 -================== - - * "node": ">= 0.4.x < 0.7.0". Closes #20 - -0.2.0 / 2011-09-26 -================== - - * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] - -0.1.0 / 2011-08-24 -================== - - * Added support for custom `--help` output - -0.0.5 / 2011-08-18 -================== - - * Changed: when the user enters nothing prompt for password again - * Fixed issue with passwords beginning with numbers [NuckChorris] - -0.0.4 / 2011-08-15 -================== - - * Fixed `Commander#args` - -0.0.3 / 2011-08-15 -================== - - * Added default option value support - -0.0.2 / 2011-08-15 -================== - - * Added mask support to `Command#password(str[, mask], fn)` - * Added `Command#password(str, fn)` - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/csscomb/node_modules/commander/Readme.md b/node_modules/csscomb/node_modules/commander/Readme.md deleted file mode 100644 index d164401..0000000 --- a/node_modules/csscomb/node_modules/commander/Readme.md +++ /dev/null @@ -1,195 +0,0 @@ -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineapple'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -V, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineapple - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -V, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .outputHelp() - - Output help information without exiting. - -## .help() - - Output help information and exit immediately. - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> - -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. diff --git a/node_modules/csscomb/node_modules/commander/index.js b/node_modules/csscomb/node_modules/commander/index.js deleted file mode 100644 index d5778a7..0000000 --- a/node_modules/csscomb/node_modules/commander/index.js +++ /dev/null @@ -1,847 +0,0 @@ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter; -var spawn = require('child_process').spawn; -var fs = require('fs'); -var exists = fs.existsSync; -var path = require('path'); -var dirname = path.dirname; -var basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description || ''; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this._execs = []; - this._args = []; - this._name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @param {String} [desc] - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name, desc){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - if (desc) cmd.description(desc); - if (desc) this.executables = true; - if (desc) this._execs[cmd._name] = true; - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - if (desc) return this; - return cmd; -}; - -/** - * Add an implicit `help [cmd]` subcommand - * which invokes `--help` for the given command. - * - * @api private - */ - -Command.prototype.addImplicitHelpCommand = function() { - this.command('help [cmd]', 'display help for [cmd]'); -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self._args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self._args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this._name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - // Leftover arguments need to be pushed back. Fixes issue #56 - if (parsed.args.length) args = parsed.args.concat(args); - - self._args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self._args.length) { - args[self._args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // implicit help - if (this.executables) this.addImplicitHelpCommand(); - - // store raw args - this.rawArgs = argv; - - // guess name - this._name = this._name || basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - var args = this.args = parsed.args; - - var result = this.parseArgs(this.args, parsed.unknown); - - // executable sub-commands - var name = result.args[0]; - if (this._execs[name]) return this.executeSubCommand(argv, args, parsed.unknown); - - return result; -}; - -/** - * Execute a sub-command executable. - * - * @param {Array} argv - * @param {Array} args - * @param {Array} unknown - * @api private - */ - -Command.prototype.executeSubCommand = function(argv, args, unknown) { - args = args.concat(unknown); - - if (!args.length) this.help(); - if ('help' == args[0] && 1 == args.length) this.help(); - - // --help - if ('help' == args[0]) { - args[0] = args[1]; - args[1] = '--help'; - } - - // executable - var dir = dirname(argv[1]); - var bin = basename(argv[1]) + '-' + args[0]; - - // check for ./ first - var local = path.join(dir, bin); - - // run it - args = args.slice(1); - var proc = spawn(local, args, { stdio: 'inherit', customFds: [0, 1, 2] }); - proc.on('error', function(err){ - if (err.code == "ENOENT") { - console.error('\n %s(1) does not exist, try --help\n', bin); - } else if (err.code == "EACCES") { - console.error('\n %s(1) not executable. try chmod or run with root\n', bin); - } - }); - - this.runningCommand = proc; -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * This also normalizes equal sign and splits "--abc=def" into "--abc def". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg - , index; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { - ret.push(arg.slice(0, index), arg.slice(index + 1)); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - if ('-' == arg[0] && '-' != arg) return this.optionMissingArgument(option, arg); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || ('-' == arg[0] && '-' != arg)) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this._args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this._args.length ? ' ' + args : ''); - - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd._args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return pad(cmd._name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args, 22) - + (cmd.description() - ? ' ' + cmd.description() - : ''); - }).join('\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this._name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Output help information for this command - * - * @api public - */ - -Command.prototype.outputHelp = function(){ - process.stdout.write(this.helpInformation()); - this.emit('--help'); -}; - -/** - * Output help information and exit. - * - * @api public - */ - -Command.prototype.help = function(){ - this.outputHelp(); - process.exit(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - cmd.outputHelp(); - process.exit(0); - } - } -} diff --git a/node_modules/csscomb/node_modules/commander/package.json b/node_modules/csscomb/node_modules/commander/package.json deleted file mode 100644 index 583b5b3..0000000 --- a/node_modules/csscomb/node_modules/commander/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "commander", - "version": "2.0.0", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt", - "stdin" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/commander.js.git" - }, - "devDependencies": { - "should": ">= 0.0.1" - }, - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.6.x" - }, - "bugs": { - "url": "https://github.com/visionmedia/commander.js/issues" - }, - "_id": "commander@2.0.0", - "dist": { - "shasum": "d1b86f901f8b64bd941bdeadaf924530393be928", - "tarball": "http://registry.npmjs.org/commander/-/commander-2.0.0.tgz" - }, - "_from": "commander@2.0.0", - "_npmVersion": "1.2.25", - "_npmUser": { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - }, - "maintainers": [ - { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - } - ], - "directories": {}, - "_shasum": "d1b86f901f8b64bd941bdeadaf924530393be928", - "_resolved": "https://registry.npmjs.org/commander/-/commander-2.0.0.tgz", - "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineapple');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineapple\n -b, --bbq Add bbq sauce\n -c, --cheese Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] ')\n .option('-i, --integer ', 'An integer argument', parseInt)\n .option('-f, --float ', 'A float argument', parseFloat)\n .option('-r, --range ..', 'A range', range)\n .option('-l, --list ', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .outputHelp()\n\n Output help information without exiting.\n\n## .help()\n\n Output help information and exit immediately.\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "Readme.md", - "homepage": "https://github.com/visionmedia/commander.js" -} diff --git a/node_modules/csscomb/node_modules/concat-map/.travis.yml b/node_modules/csscomb/node_modules/concat-map/.travis.yml new file mode 100644 index 0000000..f1d0f13 --- /dev/null +++ b/node_modules/csscomb/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/node_modules/csscomb/node_modules/concat-map/LICENSE b/node_modules/csscomb/node_modules/concat-map/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/node_modules/csscomb/node_modules/concat-map/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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. diff --git a/node_modules/csscomb/node_modules/concat-map/README.markdown b/node_modules/csscomb/node_modules/concat-map/README.markdown new file mode 100644 index 0000000..408f70a --- /dev/null +++ b/node_modules/csscomb/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/node_modules/csscomb/node_modules/concat-map/example/map.js b/node_modules/csscomb/node_modules/concat-map/example/map.js new file mode 100644 index 0000000..3365621 --- /dev/null +++ b/node_modules/csscomb/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/node_modules/csscomb/node_modules/concat-map/index.js b/node_modules/csscomb/node_modules/concat-map/index.js new file mode 100644 index 0000000..b29a781 --- /dev/null +++ b/node_modules/csscomb/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/node_modules/csscomb/node_modules/concat-map/package.json b/node_modules/csscomb/node_modules/concat-map/package.json new file mode 100644 index 0000000..866119b --- /dev/null +++ b/node_modules/csscomb/node_modules/concat-map/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "concat-map@0.0.1", + "scope": null, + "escapedName": "concat-map", + "name": "concat-map", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/brace-expansion" + ] + ], + "_from": "concat-map@0.0.1", + "_id": "concat-map@0.0.1", + "_inCache": true, + "_installable": true, + "_location": "/concat-map", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_npmVersion": "1.3.21", + "_phantomChildren": {}, + "_requested": { + "raw": "concat-map@0.0.1", + "scope": null, + "escapedName": "concat-map", + "name": "concat-map", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "_shrinkwrap": null, + "_spec": "concat-map@0.0.1", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/brace-expansion", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "dependencies": {}, + "description": "concatenative mapdashery", + "devDependencies": { + "tape": "~2.4.0" + }, + "directories": { + "example": "example", + "test": "test" + }, + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "homepage": "https://github.com/substack/node-concat-map", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "concat-map", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.0.1" +} diff --git a/node_modules/csscomb/node_modules/concat-map/test/map.js b/node_modules/csscomb/node_modules/concat-map/test/map.js new file mode 100644 index 0000000..fdbd702 --- /dev/null +++ b/node_modules/csscomb/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/core-js/CHANGELOG.md b/node_modules/csscomb/node_modules/core-js/CHANGELOG.md new file mode 100644 index 0000000..31c2ff2 --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/CHANGELOG.md @@ -0,0 +1,633 @@ +## Changelog +##### 2.5.0 - 2016.08.05 +- Added `Promise#finally` [stage 3 proposal](https://github.com/tc39/proposal-promise-finally), [#225](https://github.com/zloirock/core-js/issues/225) +- Added `Promise.try` [stage 1 proposal](https://github.com/tc39/proposal-promise-try) +- Added `Array#flatten` and `Array#flatMap` [stage 1 proposal](https://tc39.github.io/proposal-flatMap) +- Added `.of` and `.from` methods on collection constructors [stage 1 proposal](https://github.com/tc39/proposal-setmap-offrom): + - `Map.of` + - `Set.of` + - `WeakSet.of` + - `WeakMap.of` + - `Map.from` + - `Set.from` + - `WeakSet.from` + - `WeakMap.from` +- Added `Math` extensions [stage 1 proposal](https://github.com/rwaldron/proposal-math-extensions), [#226](https://github.com/zloirock/core-js/issues/226): + - `Math.clamp` + - `Math.DEG_PER_RAD` + - `Math.degrees` + - `Math.fscale` + - `Math.RAD_PER_DEG` + - `Math.radians` + - `Math.scale` +- Added `Math.signbit` [stage 1 proposal](http://jfbastien.github.io/papers/Math.signbit.html) +- Updated `global` [stage 3 proposal](https://github.com/tc39/proposal-global) - added `global` global object, `System.global` deprecated +- Updated `Object.getOwnPropertyDescriptors` to the [final version](https://tc39.github.io/ecma262/2017/#sec-object.getownpropertydescriptors) - it should not create properties if descriptors are `undefined` +- Updated the list of iterable DOM collections, [#249](https://github.com/zloirock/core-js/issues/249), added: + - `CSSStyleDeclaration#@@iterator` + - `CSSValueList#@@iterator` + - `ClientRectList#@@iterator` + - `DOMRectList#@@iterator` + - `DOMStringList#@@iterator` + - `DataTransferItemList#@@iterator` + - `FileList#@@iterator` + - `HTMLAllCollection#@@iterator` + - `HTMLCollection#@@iterator` + - `HTMLFormElement#@@iterator` + - `HTMLSelectElement#@@iterator` + - `MimeTypeArray#@@iterator` + - `NamedNodeMap#@@iterator` + - `PaintRequestList#@@iterator` + - `Plugin#@@iterator` + - `PluginArray#@@iterator` + - `SVGLengthList#@@iterator` + - `SVGNumberList#@@iterator` + - `SVGPathSegList#@@iterator` + - `SVGPointList#@@iterator` + - `SVGStringList#@@iterator` + - `SVGTransformList#@@iterator` + - `SourceBufferList#@@iterator` + - `TextTrackCueList#@@iterator` + - `TextTrackList#@@iterator` + - `TouchList#@@iterator` +- Updated stages of proposals: + - [`Object.getOwnPropertyDescriptors`](https://github.com/tc39/proposal-object-getownpropertydescriptors) to [stage 4 (ES2017)](https://tc39.github.io/ecma262/2017/#sec-object.getownpropertydescriptors) + - [String padding](https://github.com/tc39/proposal-string-pad-start-end) to [stage 4 (ES2017)](https://tc39.github.io/ecma262/2017/#sec-string.prototype.padend) + - [`global`](https://github.com/tc39/proposal-global) to [stage 3](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#revisit-systemglobal--global) + - [String trimming](https://github.com/tc39/proposal-string-left-right-trim) to [stage 2](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-07/jul-27.md#10iic-trimstarttrimend) +- Updated typed arrays to the modern (ES2016+) arguments validation, +[#293](https://github.com/zloirock/core-js/pull/293) +- Fixed `%TypedArray%.from` Safari bug, [#285](https://github.com/zloirock/core-js/issues/285) +- Fixed compatibility with old version of Prototype.js, [#278](https://github.com/zloirock/core-js/issues/278), [#289](https://github.com/zloirock/core-js/issues/289) +- `Function#name` no longer cache the result for correct behaviour with inherited constructors, [#296](https://github.com/zloirock/core-js/issues/296) +- Added errors on incorrect context of collection methods, [#272](https://github.com/zloirock/core-js/issues/272) +- Fixed conversion typed array constructors to string, fix [#300](https://github.com/zloirock/core-js/issues/300) +- Fixed `Set#size` with debugger ReactNative for Android, [#297](https://github.com/zloirock/core-js/issues/297) +- Fixed an issue with Electron-based debugger, [#230](https://github.com/zloirock/core-js/issues/230) +- Fixed compatibility with incomplete third-party `WeakMap` polyfills, [#252](https://github.com/zloirock/core-js/pull/252) +- Added a fallback for `Date#toJSON` in engines without native `Date#toISOString`, [#220](https://github.com/zloirock/core-js/issues/220) +- Added support for Sphere Dispatch API, [#286](https://github.com/zloirock/core-js/pull/286) +- Seriously changed the coding style and the [ESLint config](https://github.com/zloirock/core-js/blob/master/.eslintrc.js) +- Updated many dev dependencies (`webpack`, `uglify`, etc) +- Some other minor fixes and optimizations + +##### 2.4.1 - 2016.07.18 +- Fixed `script` tag for some parsers, [#204](https://github.com/zloirock/core-js/issues/204), [#216](https://github.com/zloirock/core-js/issues/216) +- Removed some unused variables, [#217](https://github.com/zloirock/core-js/issues/217), [#218](https://github.com/zloirock/core-js/issues/218) +- Fixed MS Edge `Reflect.construct` and `Reflect.apply` - they should not allow primitive as `argumentsList` argument + +##### 1.2.7 [LEGACY] - 2016.07.18 +- Some fixes for issues like [#159](https://github.com/zloirock/core-js/issues/159), [#186](https://github.com/zloirock/core-js/issues/186), [#194](https://github.com/zloirock/core-js/issues/194), [#207](https://github.com/zloirock/core-js/issues/207) + +##### 2.4.0 - 2016.05.08 +- Added `Observable`, [stage 1 proposal](https://github.com/zenparsing/es-observable) +- Fixed behavior `Object.{getOwnPropertySymbols, getOwnPropertyDescriptor}` and `Object#propertyIsEnumerable` on `Object.prototype` +- `Reflect.construct` and `Reflect.apply` should throw an error if `argumentsList` argument is not an object, [#194](https://github.com/zloirock/core-js/issues/194) + +##### 2.3.0 - 2016.04.24 +- Added `asap` for enqueuing microtasks, [stage 0 proposal](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask) +- Added well-known symbol `Symbol.asyncIterator` for [stage 2 async iteration proposal](https://github.com/tc39/proposal-async-iteration) +- Added well-known symbol `Symbol.observable` for [stage 1 observables proposal](https://github.com/zenparsing/es-observable) +- `String#{padStart, padEnd}` returns original string if filler is empty string, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#stringprototypepadstartpadend) +- `Object.values` and `Object.entries` moved to stage 4 from 3, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#objectvalues--objectentries) +- `System.global` moved to stage 2 from 1, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#systemglobal) +- `Map#toJSON` and `Set#toJSON` rejected and will be removed from the next major release, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-31.md#mapprototypetojsonsetprototypetojson) +- `Error.isError` withdrawn and will be removed from the next major release, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#erroriserror) +- Added fallback for `Function#name` on non-extensible functions and functions with broken `toString` conversion, [#193](https://github.com/zloirock/core-js/issues/193) + +##### 2.2.2 - 2016.04.06 +- Added conversion `-0` to `+0` to `Array#{indexOf, lastIndexOf}`, [ES2016 fix](https://github.com/tc39/ecma262/pull/316) +- Added fixes for some `Math` methods in Tor Browser +- `Array.{from, of}` no longer calls prototype setters +- Added workaround over Chrome DevTools strange behavior, [#186](https://github.com/zloirock/core-js/issues/186) + +##### 2.2.1 - 2016.03.19 +- Fixed `Object.getOwnPropertyNames(window)` `2.1+` versions bug, [#181](https://github.com/zloirock/core-js/issues/181) + +##### 2.2.0 - 2016.03.15 +- Added `String#matchAll`, [proposal](https://github.com/tc39/String.prototype.matchAll) +- Added `Object#__(define|lookup)[GS]etter__`, [annex B ES2017](https://github.com/tc39/ecma262/pull/381) +- Added `@@toPrimitive` methods to `Date` and `Symbol` +- Fixed `%TypedArray%#slice` in Edge ~ 13 (throws with `@@species` and wrapped / inherited constructor) +- Some other minor fixes + +##### 2.1.5 - 2016.03.12 +- Improved support NodeJS domains in `Promise#then`, [#180](https://github.com/zloirock/core-js/issues/180) +- Added fallback for `Date#toJSON` bug in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173#issuecomment-193972502) + +##### 2.1.4 - 2016.03.08 +- Added fallback for `Symbol` polyfill in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173) +- Added one more fallback for IE11 `Script Access Denied` error with iframes, [#165](https://github.com/zloirock/core-js/issues/165) + +##### 2.1.3 - 2016.02.29 +- Added fallback for [`es6-promise` package bug](https://github.com/stefanpenner/es6-promise/issues/169), [#176](https://github.com/zloirock/core-js/issues/176) + +##### 2.1.2 - 2016.02.29 +- Some minor `Promise` fixes: + - Browsers `rejectionhandled` event better HTML spec complaint + - Errors in unhandled rejection handlers should not cause any problems + - Fixed typo in feature detection + +##### 2.1.1 - 2016.02.22 +- Some `Promise` improvements: + - Feature detection: + - **Added detection unhandled rejection tracking support - now it's available everywhere**, [#140](https://github.com/zloirock/core-js/issues/140) + - Added detection `@@species` pattern support for completely correct subclassing + - Removed usage `Object.setPrototypeOf` from feature detection and noisy console message about it in FF + - `Promise.all` fixed for some very specific cases + +##### 2.1.0 - 2016.02.09 +- **API**: + - ES5 polyfills are split and logic, used in other polyfills, moved to internal modules + - **All entry point works in ES3 environment like IE8- without `core-js/(library/)es5`** + - **Added all missed single entry points for ES5 polyfills** + - Separated ES5 polyfills moved to the ES6 namespace. Why? + - Mainly, for prevent duplication features in different namespaces - logic of most required ES5 polyfills changed in ES6+: + - Already added changes for: `Object` statics - should accept primitives, new whitespaces lists in `String#trim`, `parse(Int|float)`, `RegExp#toString` logic, `String#split`, etc + - Should be changed in the future: `@@species` and `ToLength` logic in `Array` methods, `Date` parsing, `Function#bind`, etc + - Should not be changed only several features like `Array.isArray` and `Date.now` + - Some ES5 polyfills required for modern engines + - All old entry points should work fine, but in the next major release API can be changed + - `Object.getOwnPropertyDescriptors` moved to the stage 3, [January TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-01/2016-01-28.md#objectgetownpropertydescriptors-to-stage-3-jordan-harband-low-priority-but-super-quick) + - Added `umd` option for [custom build process](https://github.com/zloirock/core-js#custom-build-from-external-scripts), [#169](https://github.com/zloirock/core-js/issues/169) + - Returned entry points for `Array` statics, removed in `2.0`, for compatibility with `babel` `6` and for future fixes +- **Deprecated**: + - `Reflect.enumerate` deprecated and will be removed from the next major release, [January TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-01/2016-01-28.md#5xix-revisit-proxy-enumerate---revisit-decision-to-exhaust-iterator) +- **New Features**: + - Added [`Reflect` metadata API](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) as a pre-strawman feature, [#152](https://github.com/zloirock/core-js/issues/152): + - `Reflect.defineMetadata` + - `Reflect.deleteMetadata` + - `Reflect.getMetadata` + - `Reflect.getMetadataKeys` + - `Reflect.getOwnMetadata` + - `Reflect.getOwnMetadataKeys` + - `Reflect.hasMetadata` + - `Reflect.hasOwnMetadata` + - `Reflect.metadata` + - Implementation / fixes `Date#toJSON` + - Fixes for `parseInt` and `Number.parseInt` + - Fixes for `parseFloat` and `Number.parseFloat` + - Fixes for `RegExp#toString` + - Fixes for `Array#sort` + - Fixes for `Number#toFixed` + - Fixes for `Number#toPrecision` + - Additional fixes for `String#split` (`RegExp#@@split`) +- **Improvements**: + - Correct subclassing wrapped collections, `Number` and `RegExp` constructors with native class syntax + - Correct support `SharedArrayBuffer` and buffers from other realms in typed arrays wrappers + - Additional validations for `Object.{defineProperty, getOwnPropertyDescriptor}` and `Reflect.defineProperty` +- **Bug Fixes**: + - Fixed some cases `Array#lastIndexOf` with negative second argument + +##### 2.0.3 - 2016.01.11 +- Added fallback for V8 ~ Chrome 49 `Promise` subclassing bug causes unhandled rejection on feature detection, [#159](https://github.com/zloirock/core-js/issues/159) +- Added fix for very specific environments with global `window === null` + +##### 2.0.2 - 2016.01.04 +- Temporarily removed `length` validation from `Uint8Array` constructor wrapper. Reason - [bug in `ws` module](https://github.com/websockets/ws/pull/645) (-> `socket.io`) which passes to `Buffer` constructor -> `Uint8Array` float and uses [the `V8` bug](https://code.google.com/p/v8/issues/detail?id=4552) for conversion to int (by the spec should be thrown an error). [It creates problems for many people.](https://github.com/karma-runner/karma/issues/1768) I hope, it will be returned after fixing this bug in `V8`. + +##### 2.0.1 - 2015.12.31 +- Forced usage `Promise.resolve` polyfill in the `library` version for correct work with wrapper +- `Object.assign` should be defined in the strict mode -> throw an error on extension non-extensible objects, [#154](https://github.com/zloirock/core-js/issues/154) + +##### 2.0.0 - 2015.12.24 +- Added implementations and fixes [Typed Arrays](https://github.com/zloirock/core-js#ecmascript-6-typed-arrays)-related features + - `ArrayBuffer`, `ArrayBuffer.isView`, `ArrayBuffer#slice` + - `DataView` with all getter / setter methods + - `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array` and `Float64Array` constructors + - `%TypedArray%.{for, of}`, `%TypedArray%#{copyWithin, every, fill, filter, find, findIndex, forEach, indexOf, includes, join, lastIndexOf, map, reduce, reduceRight, reverse, set, slice, some, sort, subarray, values, keys, entries, @@iterator, ...}` +- Added [`System.global`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/tc39/proposal-global), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-19.md#systemglobal-jhd) +- Added [`Error.isError`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/ljharb/proposal-is-error), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-19.md#jhd-erroriserror) +- Added [`Math.{iaddh, isubh, imulh, umulh}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703) +- `RegExp.escape` moved from the `es7` to the non-standard `core` namespace, [July TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-28.md#62-regexpescape) - too slow, but it's condition of stability, [#116](https://github.com/zloirock/core-js/issues/116) +- [`Promise`](https://github.com/zloirock/core-js#ecmascript-6-promise) + - Some performance optimisations + - Added basic support [`rejectionHandled` event / `onrejectionhandled` handler](https://github.com/zloirock/core-js#unhandled-rejection-tracking) to the polyfill + - Removed usage `@@species` from `Promise.{all, race}`, [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-18.md#conclusionresolution-2) +- Some improvements [collections polyfills](https://github.com/zloirock/core-js#ecmascript-6-collections) + - `O(1)` and preventing possible leaks with frozen keys, [#134](https://github.com/zloirock/core-js/issues/134) + - Correct observable state object keys +- Renamed `String#{padLeft, padRight}` -> [`String#{padStart, padEnd}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/tc39/proposal-string-pad-start-end), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-17.md#conclusionresolution-2) (they want to rename it on each meeting?O_o), [#132](https://github.com/zloirock/core-js/issues/132) +- Added [`String#{trimStart, trimEnd}` as aliases for `String#{trimLeft, trimRight}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-17.md#conclusionresolution-2) +- Added [annex B HTML methods](https://github.com/zloirock/core-js#ecmascript-6-string) - ugly, but also [the part of the spec](http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.anchor) +- Added little fix for [`Date#toString`](https://github.com/zloirock/core-js#ecmascript-6-date) - `new Date(NaN).toString()` [should be `'Invalid Date'`](http://www.ecma-international.org/ecma-262/6.0/#sec-todatestring) +- Added [`{keys, values, entries, @@iterator}` methods to DOM collections](https://github.com/zloirock/core-js#iterable-dom-collections) which should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass) - `NodeList`, `DOMTokenList`, `MediaList`, `StyleSheetList`, `CSSRuleList`. +- Removed Mozilla `Array` generics - [deprecated and will be removed from FF](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Array_generic_methods), [looks like strawman is dead](http://wiki.ecmascript.org/doku.php?id=strawman:array_statics), available [alternative shim](https://github.com/plusdude/array-generics) +- Removed `core.log` module +- CommonJS API + - Added entry points for [virtual methods](https://github.com/zloirock/core-js#commonjs-and-prototype-methods-without-global-namespace-pollution) + - Added entry points for [stages proposals](https://github.com/zloirock/core-js#ecmascript-7-proposals) + - Some other minor changes +- [Custom build from external scripts](https://github.com/zloirock/core-js#custom-build-from-external-scripts) moved to the separate package for preventing problems with dependencies +- Changed `$` prefix for internal modules file names because Team Foundation Server does not support it, [#129](https://github.com/zloirock/core-js/issues/129) +- Additional fix for `SameValueZero` in V8 ~ Chromium 39-42 collections +- Additional fix for FF27 `Array` iterator +- Removed usage shortcuts for `arguments` object - old WebKit bug, [#150](https://github.com/zloirock/core-js/issues/150) +- `{Map, Set}#forEach` non-generic, [#144](https://github.com/zloirock/core-js/issues/144) +- Many other improvements + +##### 1.2.6 - 2015.11.09 +* Reject with `TypeError` on attempt resolve promise itself +* Correct behavior with broken `Promise` subclass constructors / methods +* Added `Promise`-based fallback for microtask +* Fixed V8 and FF `Array#{values, @@iterator}.name` +* Fixed IE7- `[1, 2].join(undefined) -> '1,2'` +* Some other fixes / improvements / optimizations + +##### 1.2.5 - 2015.11.02 +* Some more `Number` constructor fixes: + * Fixed V8 ~ Node 0.8 bug: `Number('+0x1')` should be `NaN` + * Fixed `Number(' 0b1\n')` case, should be `1` + * Fixed `Number()` case, should be `0` + +##### 1.2.4 - 2015.11.01 +* Fixed `Number('0b12') -> NaN` case in the shim +* Fixed V8 ~ Chromium 40- bug - `Weak(Map|Set)#{delete, get, has}` should not throw errors [#124](https://github.com/zloirock/core-js/issues/124) +* Some other fixes and optimizations + +##### 1.2.3 - 2015.10.23 +* Fixed some problems related old V8 bug `Object('a').propertyIsEnumerable(0) // => false`, for example, `Object.assign({}, 'qwe')` from the last release +* Fixed `.name` property and `Function#toString` conversion some polyfilled methods +* Fixed `Math.imul` arity in Safari 8- + +##### 1.2.2 - 2015.10.18 +* Improved optimisations for V8 +* Fixed build process from external packages, [#120](https://github.com/zloirock/core-js/pull/120) +* One more `Object.{assign, values, entries}` fix for [**very** specific case](https://github.com/ljharb/proposal-object-values-entries/issues/5) + +##### 1.2.1 - 2015.10.02 +* Replaced fix `JSON.stringify` + `Symbol` behavior from `.toJSON` method to wrapping `JSON.stringify` - little more correct, [compat-table/642](https://github.com/kangax/compat-table/pull/642) +* Fixed typo which broke tasks scheduler in WebWorkers in old FF, [#114](https://github.com/zloirock/core-js/pull/114) + +##### 1.2.0 - 2015.09.27 +* Added browser [`Promise` rejection hook](#unhandled-rejection-tracking), [#106](https://github.com/zloirock/core-js/issues/106) +* Added correct [`IsRegExp`](http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp) logic to [`String#{includes, startsWith, endsWith}`](https://github.com/zloirock/core-js/#ecmascript-6-string) and [`RegExp` constructor](https://github.com/zloirock/core-js/#ecmascript-6-regexp), `@@match` case, [example](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match#Disabling_the_isRegExp_check) +* Updated [`String#leftPad`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) [with proposal](https://github.com/ljharb/proposal-string-pad-left-right/issues/6): string filler truncated from the right side +* Replaced V8 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) - its properties order not only [incorrect](https://github.com/sindresorhus/object-assign/issues/22), it is non-deterministic and it causes some problems +* Fixed behavior with deleted in getters properties for `Object.{`[`assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)`, `[`entries, values`](https://github.com/zloirock/core-js/#ecmascript-7-proposals)`}`, [example](http://goo.gl/iQE01c) +* Fixed [`Math.sinh`](https://github.com/zloirock/core-js/#ecmascript-6-math) with very small numbers in V8 near Chromium 38 +* Some other fixes and optimizations + +##### 1.1.4 - 2015.09.05 +* Fixed support symbols in FF34-35 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) +* Fixed [collections iterators](https://github.com/zloirock/core-js/#ecmascript-6-iterators) in FF25-26 +* Fixed non-generic WebKit [`Array.of`](https://github.com/zloirock/core-js/#ecmascript-6-array) +* Some other fixes and optimizations + +##### 1.1.3 - 2015.08.29 +* Fixed support Node.js domains in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise), [#103](https://github.com/zloirock/core-js/issues/103) + +##### 1.1.2 - 2015.08.28 +* Added `toJSON` method to [`Symbol`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill and to MS Edge implementation for expected `JSON.stringify` result w/o patching this method +* Replaced [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) implementations w/o correct support third argument +* Fixed `global` detection with changed `document.domain` in ~IE8, [#100](https://github.com/zloirock/core-js/issues/100) + +##### 1.1.1 - 2015.08.20 +* Added more correct microtask implementation for [`Promise`](#ecmascript-6-promise) + +##### 1.1.0 - 2015.08.17 +* Updated [string padding](https://github.com/zloirock/core-js/#ecmascript-7-proposals) to [actual proposal](https://github.com/ljharb/proposal-string-pad-left-right) - renamed, minor internal changes: + * `String#lpad` -> `String#padLeft` + * `String#rpad` -> `String#padRight` +* Added [string trim functions](#ecmascript-7-proposals) - [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), defacto standard - required only for IE11- and fixed for some old engines: + * `String#trimLeft` + * `String#trimRight` +* [`String#trim`](https://github.com/zloirock/core-js/#ecmascript-6-string) fixed for some engines by es6 spec and moved from `es5` to single `es6` module +* Splitted [`es6.object.statics-accept-primitives`](https://github.com/zloirock/core-js/#ecmascript-6-object) +* Caps for `freeze`-family `Object` methods moved from `es5` to `es6` namespace and joined with [es6 wrappers](https://github.com/zloirock/core-js/#ecmascript-6-object) +* `es5` [namespace](https://github.com/zloirock/core-js/#commonjs) also includes modules, moved to `es6` namespace - you can use it as before +* Increased `MessageChannel` priority in `$.task`, [#95](https://github.com/zloirock/core-js/issues/95) +* Does not get `global.Symbol` on each getting iterator, if you wanna use alternative `Symbol` shim - add it before `core-js` +* [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) optimized and fixed for some cases +* Simplified [`Reflect.enumerate`](https://github.com/zloirock/core-js/#ecmascript-6-reflect), see [this question](https://esdiscuss.org/topic/question-about-enumerate-and-property-decision-timing) +* Some corrections in [`Math.acosh`](https://github.com/zloirock/core-js/#ecmascript-6-math) +* Fixed [`Math.imul`](https://github.com/zloirock/core-js/#ecmascript-6-math) for old WebKit +* Some fixes in string / RegExp [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp) logic +* Some other fixes and optimizations + +##### 1.0.1 - 2015.07.31 +* Some fixes for final MS Edge, replaced broken native `Reflect.defineProperty` +* Some minor fixes and optimizations +* Changed compression `client/*.min.js` options for safe `Function#name` and `Function#length`, should be fixed [#92](https://github.com/zloirock/core-js/issues/92) + +##### 1.0.0 - 2015.07.22 +* Added logic for [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp): + * `Symbol.match` + * `Symbol.replace` + * `Symbol.split` + * `Symbol.search` +* Actualized and optimized work with iterables: + * Optimized [`Map`, `Set`, `WeakMap`, `WeakSet` constructors](https://github.com/zloirock/core-js/#ecmascript-6-collections), [`Promise.all`, `Promise.race`](https://github.com/zloirock/core-js/#ecmascript-6-promise) for default `Array Iterator` + * Optimized [`Array.from`](https://github.com/zloirock/core-js/#ecmascript-6-array) for default `Array Iterator` + * Added [`core.getIteratorMethod`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) helper +* Uses enumerable properties in shimmed instances - collections, iterators, etc for optimize performance +* Added support native constructors to [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) with 2 arguments +* Added support native constructors to [`Function#bind`](https://github.com/zloirock/core-js/#ecmascript-5) shim with `new` +* Removed obsolete `.clear` methods native [`Weak`-collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) +* Maximum modularity, reduced minimal custom build size, separated into submodules: + * [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) + * [`es6.regexp`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) + * [`es6.math`](https://github.com/zloirock/core-js/#ecmascript-6-math) + * [`es6.number`](https://github.com/zloirock/core-js/#ecmascript-6-number) + * [`es7.object.to-array`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + * [`core.object`](https://github.com/zloirock/core-js/#object) + * [`core.string`](https://github.com/zloirock/core-js/#escaping-strings) + * [`core.iter-helpers`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) + * Internal modules (`$`, `$.iter`, etc) +* Many other optimizations +* Final cleaning non-standard features + * Moved `$for` to [separate library](https://github.com/zloirock/forof). This work for syntax - `for-of` loop and comprehensions + * Moved `Date#{format, formatUTC}` to [separate library](https://github.com/zloirock/dtf). Standard way for this - `ECMA-402` + * Removed `Math` methods from `Number.prototype`. Slight sugar for simple `Math` methods calling + * Removed `{Array#, Array, Dict}.turn` + * Removed `core.global` +* Uses `ToNumber` instead of `ToLength` in [`Number Iterator`](https://github.com/zloirock/core-js/#number-iterator), `Array.from(2.5)` will be `[0, 1, 2]` instead of `[0, 1]` +* Fixed [#85](https://github.com/zloirock/core-js/issues/85) - invalid `Promise` unhandled rejection message in nested `setTimeout` +* Fixed [#86](https://github.com/zloirock/core-js/issues/86) - support FF extensions +* Fixed [#89](https://github.com/zloirock/core-js/issues/89) - behavior `Number` constructor in strange case + +##### 0.9.18 - 2015.06.17 +* Removed `/` from [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) escaped characters + +##### 0.9.17 - 2015.06.14 +* Updated [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) to the [latest proposal](https://github.com/benjamingr/RexExp.escape) +* Fixed conflict with webpack dev server + IE buggy behavior + +##### 0.9.16 - 2015.06.11 +* More correct order resolving thenable in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) polyfill +* Uses polyfill instead of [buggy V8 `Promise`](https://github.com/zloirock/core-js/issues/78) + +##### 0.9.15 - 2015.06.09 +* [Collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) from `library` version return wrapped native instances +* Fixed collections prototype methods in `library` version +* Optimized [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) + +##### 0.9.14 - 2015.06.04 +* Updated [`Promise.resolve` behavior](https://esdiscuss.org/topic/fixing-promise-resolve) +* Added fallback for IE11 buggy `Object.getOwnPropertyNames` + iframe +* Some other fixes + +##### 0.9.13 - 2015.05.25 +* Added fallback for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) for old Android +* Some other fixes + +##### 0.9.12 - 2015.05.24 +* Different instances `core-js` should use / recognize the same symbols +* Some fixes + +##### 0.9.11 - 2015.05.18 +* Simplified [custom build](https://github.com/zloirock/core-js/#custom-build) + * Added custom build js api + * Added `grunt-cli` to `devDependencies` for `npm run grunt` +* Some fixes + +##### 0.9.10 - 2015.05.16 +* Wrapped `Function#toString` for correct work wrapped methods / constructors with methods similar to the [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) +* Added proto versions of methods to export object in `default` version for consistency with `library` version + +##### 0.9.9 - 2015.05.14 +* Wrapped `Object#propertyIsEnumerable` for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) +* [Added proto versions of methods to `library` for ES7 bind syntax](https://github.com/zloirock/core-js/issues/65) +* Some other fixes + +##### 0.9.8 - 2015.05.12 +* Fixed [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) with negative arguments +* Added `Object#toString.toString` as fallback for [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) + +##### 0.9.7 - 2015.05.07 +* Added [support DOM collections](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior) to IE8- `Array#slice` + +##### 0.9.6 - 2015.05.01 +* Added [`String#lpad`, `String#rpad`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + +##### 0.9.5 - 2015.04.30 +* Added cap for `Function#@@hasInstance` +* Some fixes and optimizations + +##### 0.9.4 - 2015.04.27 +* Fixed `RegExp` constructor + +##### 0.9.3 - 2015.04.26 +* Some fixes and optimizations + +##### 0.9.2 - 2015.04.25 +* More correct [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking and resolving / rejection priority + +##### 0.9.1 - 2015.04.25 +* Fixed `__proto__`-based [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) subclassing in some environments + +##### 0.9.0 - 2015.04.24 +* Added correct [symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol) descriptors + * Fixed behavior `Object.{assign, create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptors}` with symbols + * Added [single entry points](https://github.com/zloirock/core-js/#commonjs) for `Object.{create, defineProperty, defineProperties}` +* Added [`Map#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* Removed non-standard methods `Object#[_]` and `Function#only` - they solves syntax problems, but now in compilers available arrows and ~~in near future will be available~~ [available](http://babeljs.io/blog/2015/05/14/function-bind/) [bind syntax](https://github.com/zenparsing/es-function-bind) +* Removed non-standard undocumented methods `Symbol.{pure, set}` +* Some fixes and internal changes + +##### 0.8.4 - 2015.04.18 +* Uses `webpack` instead of `browserify` for browser builds - more compression-friendly result + +##### 0.8.3 - 2015.04.14 +* Fixed `Array` statics with single entry points + +##### 0.8.2 - 2015.04.13 +* [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) now also works in IE9- +* Added [`Set#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* Some optimizations and fixes + +##### 0.8.1 - 2015.04.03 +* Fixed `Symbol.keyFor` + +##### 0.8.0 - 2015.04.02 +* Changed [CommonJS API](https://github.com/zloirock/core-js/#commonjs) +* Splitted and renamed some modules +* Added support ES3 environment (ES5 polyfill) to **all** default versions - size increases slightly (+ ~4kb w/o gzip), many issues disappear, if you don't need it - [simply include only required namespaces / features / modules](https://github.com/zloirock/core-js/#commonjs) +* Removed [abstract references](https://github.com/zenparsing/es-abstract-refs) support - proposal has been superseded =\ +* [`$for.isIterable` -> `core.isIterable`, `$for.getIterator` -> `core.getIterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), temporary available in old namespace +* Fixed iterators support in v8 `Promise.all` and `Promise.race` +* Many other fixes + +##### 0.7.2 - 2015.03.09 +* Some fixes + +##### 0.7.1 - 2015.03.07 +* Some fixes + +##### 0.7.0 - 2015.03.06 +* Rewritten and splitted into [CommonJS modules](https://github.com/zloirock/core-js/#commonjs) + +##### 0.6.1 - 2015.02.24 +* Fixed support [`Object.defineProperty`](https://github.com/zloirock/core-js/#ecmascript-5) with accessors on DOM elements on IE8 + +##### 0.6.0 - 2015.02.23 +* Added support safe closing iteration - calling `iterator.return` on abort iteration, if it exists +* Added basic support [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking in shim +* Added [`Object.getOwnPropertyDescriptors`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* Removed `console` cap - creates too many problems +* Restructuring [namespaces](https://github.com/zloirock/core-js/#custom-build) +* Some fixes + +##### 0.5.4 - 2015.02.15 +* Some fixes + +##### 0.5.3 - 2015.02.14 +* Added [support binary and octal literals](https://github.com/zloirock/core-js/#ecmascript-6-number) to `Number` constructor +* Added [`Date#toISOString`](https://github.com/zloirock/core-js/#ecmascript-5) + +##### 0.5.2 - 2015.02.10 +* Some fixes + +##### 0.5.1 - 2015.02.09 +* Some fixes + +##### 0.5.0 - 2015.02.08 +* Systematization of modules +* Splitted [`es6` module](https://github.com/zloirock/core-js/#ecmascript-6) +* Splitted `console` module: `web.console` - only cap for missing methods, `core.log` - bound methods & additional features +* Added [`delay` method](https://github.com/zloirock/core-js/#delay) +* Some fixes + +##### 0.4.10 - 2015.01.28 +* [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill returns array of wrapped keys + +##### 0.4.9 - 2015.01.27 +* FF20-24 fix + +##### 0.4.8 - 2015.01.25 +* Some [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) fixes + +##### 0.4.7 - 2015.01.25 +* Added support frozen objects as [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) keys + +##### 0.4.6 - 2015.01.21 +* Added [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) +* Added [`NodeList.prototype[@@iterator]`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) +* Added basic `@@species` logic - getter in native constructors +* Removed `Function#by` +* Some fixes + +##### 0.4.5 - 2015.01.16 +* Some fixes + +##### 0.4.4 - 2015.01.11 +* Enabled CSP support + +##### 0.4.3 - 2015.01.10 +* Added `Function` instances `name` property for IE9+ + +##### 0.4.2 - 2015.01.10 +* `Object` static methods accept primitives +* `RegExp` constructor can alter flags (IE9+) +* Added `Array.prototype[Symbol.unscopables]` + +##### 0.4.1 - 2015.01.05 +* Some fixes + +##### 0.4.0 - 2015.01.03 +* Added [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) module: + * Added `Reflect.apply` + * Added `Reflect.construct` + * Added `Reflect.defineProperty` + * Added `Reflect.deleteProperty` + * Added `Reflect.enumerate` + * Added `Reflect.get` + * Added `Reflect.getOwnPropertyDescriptor` + * Added `Reflect.getPrototypeOf` + * Added `Reflect.has` + * Added `Reflect.isExtensible` + * Added `Reflect.preventExtensions` + * Added `Reflect.set` + * Added `Reflect.setPrototypeOf` +* `core-js` methods now can use external `Symbol.iterator` polyfill +* Some fixes + +##### 0.3.3 - 2014.12.28 +* [Console cap](https://github.com/zloirock/core-js/#console) excluded from node.js default builds + +##### 0.3.2 - 2014.12.25 +* Added cap for [ES5](https://github.com/zloirock/core-js/#ecmascript-5) freeze-family methods +* Fixed `console` bug + +##### 0.3.1 - 2014.12.23 +* Some fixes + +##### 0.3.0 - 2014.12.23 +* Optimize [`Map` & `Set`](https://github.com/zloirock/core-js/#ecmascript-6-collections): + * Use entries chain on hash table + * Fast & correct iteration + * Iterators moved to [`es6`](https://github.com/zloirock/core-js/#ecmascript-6) and [`es6.collections`](https://github.com/zloirock/core-js/#ecmascript-6-collections) modules + +##### 0.2.5 - 2014.12.20 +* `console` no longer shortcut for `console.log` (compatibility problems) +* Some fixes + +##### 0.2.4 - 2014.12.17 +* Better compliance of ES6 +* Added [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) (IE10+) +* Some fixes + +##### 0.2.3 - 2014.12.15 +* [Symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol): + * Added option to disable addition setter to `Object.prototype` for Symbol polyfill: + * Added `Symbol.useSimple` + * Added `Symbol.useSetter` + * Added cap for well-known Symbols: + * Added `Symbol.hasInstance` + * Added `Symbol.isConcatSpreadable` + * Added `Symbol.match` + * Added `Symbol.replace` + * Added `Symbol.search` + * Added `Symbol.species` + * Added `Symbol.split` + * Added `Symbol.toPrimitive` + * Added `Symbol.unscopables` + +##### 0.2.2 - 2014.12.13 +* Added [`RegExp#flags`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) ([December 2014 Draft Rev 29](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#december_6_2014_draft_rev_29)) +* Added [`String.raw`](https://github.com/zloirock/core-js/#ecmascript-6-string) + +##### 0.2.1 - 2014.12.12 +* Repair converting -0 to +0 in [native collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) + +##### 0.2.0 - 2014.12.06 +* Added [`es7.proposals`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) and [`es7.abstract-refs`](https://github.com/zenparsing/es-abstract-refs) modules +* Added [`String#at`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* Added real [`String Iterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), older versions used Array Iterator +* Added abstract references support: + * Added `Symbol.referenceGet` + * Added `Symbol.referenceSet` + * Added `Symbol.referenceDelete` + * Added `Function#@@referenceGet` + * Added `Map#@@referenceGet` + * Added `Map#@@referenceSet` + * Added `Map#@@referenceDelete` + * Added `WeakMap#@@referenceGet` + * Added `WeakMap#@@referenceSet` + * Added `WeakMap#@@referenceDelete` + * Added `Dict.{...methods}[@@referenceGet]` +* Removed deprecated `.contains` methods +* Some fixes + +##### 0.1.5 - 2014.12.01 +* Added [`Array#copyWithin`](https://github.com/zloirock/core-js/#ecmascript-6-array) +* Added [`String#codePointAt`](https://github.com/zloirock/core-js/#ecmascript-6-string) +* Added [`String.fromCodePoint`](https://github.com/zloirock/core-js/#ecmascript-6-string) + +##### 0.1.4 - 2014.11.27 +* Added [`Dict.mapPairs`](https://github.com/zloirock/core-js/#dict) + +##### 0.1.3 - 2014.11.20 +* [TC39 November meeting](https://github.com/rwaldron/tc39-notes/tree/master/es6/2014-11): + * [`.contains` -> `.includes`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-18.md#51--44-arrayprototypecontains-and-stringprototypecontains) + * `String#contains` -> [`String#includes`](https://github.com/zloirock/core-js/#ecmascript-6-string) + * `Array#contains` -> [`Array#includes`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + * `Dict.contains` -> [`Dict.includes`](https://github.com/zloirock/core-js/#dict) + * [Removed `WeakMap#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) + * [Removed `WeakSet#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) + +##### 0.1.2 - 2014.11.19 +* `Map` & `Set` bug fix + +##### 0.1.1 - 2014.11.18 +* Public release \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/core-js/Gruntfile.js b/node_modules/csscomb/node_modules/core-js/Gruntfile.js new file mode 100644 index 0000000..02b832c --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/Gruntfile.js @@ -0,0 +1,3 @@ +require('LiveScript'); +// eslint-disable-next-line import/no-unresolved +module.exports = require('./build/Gruntfile'); diff --git a/node_modules/csscomb/node_modules/core-js/LICENSE b/node_modules/csscomb/node_modules/core-js/LICENSE new file mode 100644 index 0000000..c99b842 --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-2016 Denis Pushkarev + +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. diff --git a/node_modules/csscomb/node_modules/core-js/README.md b/node_modules/csscomb/node_modules/core-js/README.md new file mode 100644 index 0000000..572d8cd --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/README.md @@ -0,0 +1,2289 @@ +# core-js + +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zloirock/core-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![npm downloads](https://img.shields.io/npm/dm/core-js.svg)](http://npm-stat.com/charts.html?package=core-js&author=&from=2014-11-18) [![Build Status](https://travis-ci.org/zloirock/core-js.svg)](https://travis-ci.org/zloirock/core-js) [![devDependency status](https://david-dm.org/zloirock/core-js/dev-status.svg)](https://david-dm.org/zloirock/core-js?type=dev) +#### As advertising: the author is looking for a good job :) + +Modular standard library for JavaScript. Includes polyfills for [ECMAScript 5](#ecmascript-5), [ECMAScript 6](#ecmascript-6): [promises](#ecmascript-6-promise), [symbols](#ecmascript-6-symbol), [collections](#ecmascript-6-collections), iterators, [typed arrays](#ecmascript-6-typed-arrays), [ECMAScript 7+ proposals](#ecmascript-7-proposals), [setImmediate](#setimmediate), etc. Some additional features such as [dictionaries](#dict) or [extended partial application](#partial-application). You can require only needed features or use it without global namespace pollution. + +[*Example*](http://goo.gl/a2xexl): +```js +Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +'*'.repeat(10); // => '**********' +Promise.resolve(32).then(x => console.log(x)); // => 32 +setImmediate(x => console.log(x), 42); // => 42 +``` + +[*Without global namespace pollution*](http://goo.gl/paOHb0): +```js +var core = require('core-js/library'); // With a modular system, otherwise use global `core` +core.Array.from(new core.Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +core.String.repeat('*', 10); // => '**********' +core.Promise.resolve(32).then(x => console.log(x)); // => 32 +core.setImmediate(x => console.log(x), 42); // => 42 +``` + +### Index +- [Usage](#usage) + - [Basic](#basic) + - [CommonJS](#commonjs) + - [Custom build](#custom-build-from-the-command-line) +- [Supported engines](#supported-engines) +- [Features](#features) + - [ECMAScript 5](#ecmascript-5) + - [ECMAScript 6](#ecmascript-6) + - [ECMAScript 6: Object](#ecmascript-6-object) + - [ECMAScript 6: Function](#ecmascript-6-function) + - [ECMAScript 6: Array](#ecmascript-6-array) + - [ECMAScript 6: String](#ecmascript-6-string) + - [ECMAScript 6: RegExp](#ecmascript-6-regexp) + - [ECMAScript 6: Number](#ecmascript-6-number) + - [ECMAScript 6: Math](#ecmascript-6-math) + - [ECMAScript 6: Date](#ecmascript-6-date) + - [ECMAScript 6: Promise](#ecmascript-6-promise) + - [ECMAScript 6: Symbol](#ecmascript-6-symbol) + - [ECMAScript 6: Collections](#ecmascript-6-collections) + - [ECMAScript 6: Typed Arrays](#ecmascript-6-typed-arrays) + - [ECMAScript 6: Reflect](#ecmascript-6-reflect) + - [ECMAScript 7+ proposals](#ecmascript-7-proposals) + - [stage 4 proposals](#stage-4-proposals) + - [stage 3 proposals](#stage-3-proposals) + - [stage 2 proposals](#stage-2-proposals) + - [stage 1 proposals](#stage-1-proposals) + - [stage 0 proposals](#stage-0-proposals) + - [pre-stage 0 proposals](#pre-stage-0-proposals) + - [Web standards](#web-standards) + - [setTimeout / setInterval](#settimeout--setinterval) + - [setImmediate](#setimmediate) + - [iterable DOM collections](#iterable-dom-collections) + - [Non-standard](#non-standard) + - [Object](#object) + - [Dict](#dict) + - [partial application](#partial-application) + - [Number Iterator](#number-iterator) + - [escaping strings](#escaping-strings) + - [delay](#delay) + - [helpers for iterators](#helpers-for-iterators) +- [Missing polyfills](#missing-polyfills) +- [Changelog](./CHANGELOG.md) + +## Usage +### Basic +``` +npm i core-js +bower install core.js +``` + +```js +// Default +require('core-js'); +// Without global namespace pollution +var core = require('core-js/library'); +// Shim only +require('core-js/shim'); +``` +If you need complete build for browser, use builds from `core-js/client` path: + +* [default](https://raw.githack.com/zloirock/core-js/v2.5.0/client/core.min.js): Includes all features, standard and non-standard. +* [as a library](https://raw.githack.com/zloirock/core-js/v2.5.0/client/library.min.js): Like "default", but does not pollute the global namespace (see [2nd example at the top](#core-js)). +* [shim only](https://raw.githack.com/zloirock/core-js/v2.5.0/client/shim.min.js): Only includes the standard methods. + +Warning: if you use `core-js` with the extension of native objects, require all needed `core-js` modules at the beginning of entry point of your application, otherwise, conflicts may occur. + +### CommonJS +You can require only needed modules. + +```js +require('core-js/fn/set'); +require('core-js/fn/array/from'); +require('core-js/fn/array/find-index'); +Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +[1, 2, NaN, 3, 4].findIndex(isNaN); // => 2 + +// or, w/o global namespace pollution: + +var Set = require('core-js/library/fn/set'); +var from = require('core-js/library/fn/array/from'); +var findIndex = require('core-js/library/fn/array/find-index'); +from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +findIndex([1, 2, NaN, 3, 4], isNaN); // => 2 +``` +Available entry points for methods / constructors, as above examples, and namespaces: for example, `core-js/es6/array` (`core-js/library/es6/array`) contains all [ES6 `Array` features](#ecmascript-6-array), `core-js/es6` (`core-js/library/es6`) contains all ES6 features. + +##### Caveats when using CommonJS API: + +* `modules` path is internal API, does not inject all required dependencies and can be changed in minor or patch releases. Use it only for a custom build and / or if you know what are you doing. +* `core-js` is extremely modular and uses a lot of very tiny modules, because of that for usage in browsers bundle up `core-js` instead of usage loader for each file, otherwise, you will have hundreds of requests. + +#### CommonJS and prototype methods without global namespace pollution +In the `library` version, we can't pollute prototypes of native constructors. Because of that, prototype methods transformed to static methods like in examples above. `babel` `runtime` transformer also can't transform them. But with transpilers we can use one more trick - [bind operator and virtual methods](https://github.com/zenparsing/es-function-bind). Special for that, available `/virtual/` entry points. Example: +```js +import fill from 'core-js/library/fn/array/virtual/fill'; +import findIndex from 'core-js/library/fn/array/virtual/find-index'; + +Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4 + +// or + +import {fill, findIndex} from 'core-js/library/fn/array/virtual'; + +Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4 + +``` + +### Custom build (from the command-line) +``` +npm i core-js && cd node_modules/core-js && npm i +npm run grunt build:core.dict,es6 -- --blacklist=es6.promise,es6.math --library=on --path=custom uglify +``` +Where `core.dict` and `es6` are modules (namespaces) names, which will be added to the build, `es6.promise` and `es6.math` are modules (namespaces) names, which will be excluded from the build, `--library=on` is flag for build without global namespace pollution and `custom` is target file name. + +Available namespaces: for example, `es6.array` contains [ES6 `Array` features](#ecmascript-6-array), `es6` contains all modules whose names start with `es6`. + +### Custom build (from external scripts) + +[`core-js-builder`](https://www.npmjs.com/package/core-js-builder) package exports a function that takes the same parameters as the `build` target from the previous section. This will conditionally include or exclude certain parts of `core-js`: + +```js +require('core-js-builder')({ + modules: ['es6', 'core.dict'], // modules / namespaces + blacklist: ['es6.reflect'], // blacklist of modules / namespaces, by default - empty list + library: false, // flag for build without global namespace pollution, by default - false + umd: true // use UMD wrapper for export `core` object, by default - true +}).then(code => { + // ... +}).catch(error => { + // ... +}); +``` +## Supported engines +**Tested in:** +- Chrome 26+ +- Firefox 4+ +- Safari 5+ +- Opera 12+ +- Internet Explorer 6+ (sure, IE8- with ES3 limitations) +- Edge +- Android Browser 2.3+ +- iOS Safari 5.1+ +- PhantomJS 1.9 / 2.1 +- NodeJS 0.8+ + +...and it doesn't mean `core-js` will not work in other engines, they just have not been tested. + +## Features: +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library) <- all features +core-js(/library)/shim <- only polyfills +``` +### ECMAScript 5 +All features moved to the [`es6` namespace](#ecmascript-6), here just a list of features: +```js +Object + .create(proto | null, descriptors?) -> object + .getPrototypeOf(object) -> proto | null + .defineProperty(target, key, desc) -> target, cap for ie8- + .defineProperties(target, descriptors) -> target, cap for ie8- + .getOwnPropertyDescriptor(object, key) -> desc + .getOwnPropertyNames(object) -> array + .keys(object) -> array + .seal(object) -> object, cap for ie8- + .freeze(object) -> object, cap for ie8- + .preventExtensions(object) -> object, cap for ie8- + .isSealed(object) -> bool, cap for ie8- + .isFrozen(object) -> bool, cap for ie8- + .isExtensible(object) -> bool, cap for ie8- +Array + .isArray(var) -> bool + #slice(start?, end?) -> array, fix for ie7- + #join(string = ',') -> string, fix for ie7- + #indexOf(var, from?) -> int + #lastIndexOf(var, from?) -> int + #every(fn(val, index, @), that) -> bool + #some(fn(val, index, @), that) -> bool + #forEach(fn(val, index, @), that) -> void + #map(fn(val, index, @), that) -> array + #filter(fn(val, index, @), that) -> array + #reduce(fn(memo, val, index, @), memo?) -> var + #reduceRight(fn(memo, val, index, @), memo?) -> var + #sort(fn?) -> @, fixes for some engines +Function + #bind(object, ...args) -> boundFn(...args) +String + #split(separator, limit) -> array + #trim() -> str +RegExp + #toString() -> str +Number + #toFixed(digits) -> string + #toPrecision(precision) -> string +parseInt(str, radix) -> int +parseFloat(str) -> num +Date + .now() -> int + #toISOString() -> string + #toJSON() -> string +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es5 +``` + +### ECMAScript 6 +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6 +``` +#### ECMAScript 6: Object +Modules [`es6.object.assign`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.assign.js), [`es6.object.is`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.is.js), [`es6.object.set-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.set-prototype-of.js) and [`es6.object.to-string`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.to-string.js). + +In ES6 most `Object` static methods should work with primitives. Modules [`es6.object.freeze`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.freeze.js), [`es6.object.seal`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.seal.js), [`es6.object.prevent-extensions`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.prevent-extensions.js), [`es6.object.is-frozen`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.is-frozen.js), [`es6.object.is-sealed`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.is-sealed.js), [`es6.object.is-extensible`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.is-extensible.js), [`es6.object.get-own-property-descriptor`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.get-own-property-descriptor.js), [`es6.object.get-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.get-prototype-of.js), [`es6.object.keys`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.keys.js) and [`es6.object.get-own-property-names`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.get-own-property-names.js). + +Just ES5 features: [`es6.object.create`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.create.js), [`es6.object.define-property`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.define-property.js) and [`es6.object.define-properties`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.object.es6.object.define-properties.js). +```js +Object + .assign(target, ...src) -> target + .is(a, b) -> bool + .setPrototypeOf(target, proto | null) -> target (required __proto__ - IE11+) + .create(object | null, descriptors?) -> object + .getPrototypeOf(var) -> object | null + .defineProperty(object, key, desc) -> target + .defineProperties(object, descriptors) -> target + .getOwnPropertyDescriptor(var, key) -> desc | undefined + .keys(var) -> array + .getOwnPropertyNames(var) -> array + .freeze(var) -> var + .seal(var) -> var + .preventExtensions(var) -> var + .isFrozen(var) -> bool + .isSealed(var) -> bool + .isExtensible(var) -> bool + #toString() -> string, ES6 fix: @@toStringTag support +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/object +core-js(/library)/fn/object/assign +core-js(/library)/fn/object/is +core-js(/library)/fn/object/set-prototype-of +core-js(/library)/fn/object/get-prototype-of +core-js(/library)/fn/object/create +core-js(/library)/fn/object/define-property +core-js(/library)/fn/object/define-properties +core-js(/library)/fn/object/get-own-property-descriptor +core-js(/library)/fn/object/keys +core-js(/library)/fn/object/get-own-property-names +core-js(/library)/fn/object/freeze +core-js(/library)/fn/object/seal +core-js(/library)/fn/object/prevent-extensions +core-js(/library)/fn/object/is-frozen +core-js(/library)/fn/object/is-sealed +core-js(/library)/fn/object/is-extensible +core-js/fn/object/to-string +``` +[*Examples*](http://goo.gl/ywdwPz): +```js +var foo = {q: 1, w: 2} + , bar = {e: 3, r: 4} + , baz = {t: 5, y: 6}; +Object.assign(foo, bar, baz); // => foo = {q: 1, w: 2, e: 3, r: 4, t: 5, y: 6} + +Object.is(NaN, NaN); // => true +Object.is(0, -0); // => false +Object.is(42, 42); // => true +Object.is(42, '42'); // => false + +function Parent(){} +function Child(){} +Object.setPrototypeOf(Child.prototype, Parent.prototype); +new Child instanceof Child; // => true +new Child instanceof Parent; // => true + +var O = {}; +O[Symbol.toStringTag] = 'Foo'; +'' + O; // => '[object Foo]' + +Object.keys('qwe'); // => ['0', '1', '2'] +Object.getPrototypeOf('qwe') === String.prototype; // => true +``` +#### ECMAScript 6: Function +Modules [`es6.function.name`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.function.name.js), [`es6.function.has-instance`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.function.has-instance.js). Just ES5: [`es6.function.bind`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.function.bind.js). +```js +Function + #bind(object, ...args) -> boundFn(...args) + #name -> string (IE9+) + #@@hasInstance(var) -> bool +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js/es6/function +core-js/fn/function/name +core-js/fn/function/has-instance +core-js/fn/function/bind +core-js/fn/function/virtual/bind +``` +[*Example*](http://goo.gl/zqu3Wp): +```js +(function foo(){}).name // => 'foo' + +console.log.bind(console, 42)(43); // => 42 43 +``` +#### ECMAScript 6: Array +Modules [`es6.array.from`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.from.js), [`es6.array.of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.of.js), [`es6.array.copy-within`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.copy-within.js), [`es6.array.fill`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.fill.js), [`es6.array.find`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.find.js), [`es6.array.find-index`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.find-index.js), [`es6.array.iterator`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.iterator.js). ES5 features with fixes: [`es6.array.is-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.is-array.js), [`es6.array.slice`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.slice.js), [`es6.array.join`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.join.js), [`es6.array.index-of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.index-of.js), [`es6.array.last-index-of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.last-index-of.js), [`es6.array.every`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.every.js), [`es6.array.some`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.some.js), [`es6.array.for-each`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.for-each.js), [`es6.array.map`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.map.js), [`es6.array.filter`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.filter.js), [`es6.array.reduce`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.reduce.js), [`es6.array.reduce-right`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.reduce-right.js), [`es6.array.sort`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.array.sort.js). +```js +Array + .from(iterable | array-like, mapFn(val, index)?, that) -> array + .of(...args) -> array + .isArray(var) -> bool + #copyWithin(target = 0, start = 0, end = @length) -> @ + #fill(val, start = 0, end = @length) -> @ + #find(fn(val, index, @), that) -> val + #findIndex(fn(val, index, @), that) -> index | -1 + #values() -> iterator + #keys() -> iterator + #entries() -> iterator + #join(string = ',') -> string, fix for ie7- + #slice(start?, end?) -> array, fix for ie7- + #indexOf(var, from?) -> index | -1 + #lastIndexOf(var, from?) -> index | -1 + #every(fn(val, index, @), that) -> bool + #some(fn(val, index, @), that) -> bool + #forEach(fn(val, index, @), that) -> void + #map(fn(val, index, @), that) -> array + #filter(fn(val, index, @), that) -> array + #reduce(fn(memo, val, index, @), memo?) -> var + #reduceRight(fn(memo, val, index, @), memo?) -> var + #sort(fn?) -> @, invalid arguments fix + #@@iterator() -> iterator (values) + #@@unscopables -> object (cap) +Arguments + #@@iterator() -> iterator (values, available only in core-js methods) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/array +core-js(/library)/fn/array/from +core-js(/library)/fn/array/of +core-js(/library)/fn/array/is-array +core-js(/library)/fn/array/iterator +core-js(/library)/fn/array/copy-within +core-js(/library)/fn/array/fill +core-js(/library)/fn/array/find +core-js(/library)/fn/array/find-index +core-js(/library)/fn/array/values +core-js(/library)/fn/array/keys +core-js(/library)/fn/array/entries +core-js(/library)/fn/array/slice +core-js(/library)/fn/array/join +core-js(/library)/fn/array/index-of +core-js(/library)/fn/array/last-index-of +core-js(/library)/fn/array/every +core-js(/library)/fn/array/some +core-js(/library)/fn/array/for-each +core-js(/library)/fn/array/map +core-js(/library)/fn/array/filter +core-js(/library)/fn/array/reduce +core-js(/library)/fn/array/reduce-right +core-js(/library)/fn/array/sort +core-js(/library)/fn/array/virtual/iterator +core-js(/library)/fn/array/virtual/copy-within +core-js(/library)/fn/array/virtual/fill +core-js(/library)/fn/array/virtual/find +core-js(/library)/fn/array/virtual/find-index +core-js(/library)/fn/array/virtual/values +core-js(/library)/fn/array/virtual/keys +core-js(/library)/fn/array/virtual/entries +core-js(/library)/fn/array/virtual/slice +core-js(/library)/fn/array/virtual/join +core-js(/library)/fn/array/virtual/index-of +core-js(/library)/fn/array/virtual/last-index-of +core-js(/library)/fn/array/virtual/every +core-js(/library)/fn/array/virtual/some +core-js(/library)/fn/array/virtual/for-each +core-js(/library)/fn/array/virtual/map +core-js(/library)/fn/array/virtual/filter +core-js(/library)/fn/array/virtual/reduce +core-js(/library)/fn/array/virtual/reduce-right +core-js(/library)/fn/array/virtual/sort +``` +[*Examples*](http://goo.gl/oaUFUf): +```js +Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +Array.from({0: 1, 1: 2, 2: 3, length: 3}); // => [1, 2, 3] +Array.from('123', Number); // => [1, 2, 3] +Array.from('123', function(it){ + return it * it; +}); // => [1, 4, 9] + +Array.of(1); // => [1] +Array.of(1, 2, 3); // => [1, 2, 3] + +var array = ['a', 'b', 'c']; + +for(var val of array)console.log(val); // => 'a', 'b', 'c' +for(var val of array.values())console.log(val); // => 'a', 'b', 'c' +for(var key of array.keys())console.log(key); // => 0, 1, 2 +for(var [key, val] of array.entries()){ + console.log(key); // => 0, 1, 2 + console.log(val); // => 'a', 'b', 'c' +} + +function isOdd(val){ + return val % 2; +} +[4, 8, 15, 16, 23, 42].find(isOdd); // => 15 +[4, 8, 15, 16, 23, 42].findIndex(isOdd); // => 2 +[4, 8, 15, 16, 23, 42].find(isNaN); // => undefined +[4, 8, 15, 16, 23, 42].findIndex(isNaN); // => -1 + +Array(5).fill(42); // => [42, 42, 42, 42, 42] + +[1, 2, 3, 4, 5].copyWithin(0, 3); // => [4, 5, 3, 4, 5] +``` +#### ECMAScript 6: String +Modules [`es6.string.from-code-point`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.from-code-point.js), [`es6.string.raw`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.raw.js), [`es6.string.iterator`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.iterator.js), [`es6.string.code-point-at`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.code-point-at.js), [`es6.string.ends-with`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.ends-with.js), [`es6.string.includes`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.includes.js), [`es6.string.repeat`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.repeat.js), [`es6.string.starts-with`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.starts-with.js) and [`es6.string.trim`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.trim.js). + +Annex B HTML methods. Ugly, but it's also the part of the spec. Modules [`es6.string.anchor`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.anchor.js), [`es6.string.big`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.big.js), [`es6.string.blink`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.blink.js), [`es6.string.bold`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.bold.js), [`es6.string.fixed`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.fixed.js), [`es6.string.fontcolor`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.fontcolor.js), [`es6.string.fontsize`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.fontsize.js), [`es6.string.italics`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.italics.js), [`es6.string.link`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.link.js), [`es6.string.small`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.small.js), [`es6.string.strike`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.strike.js), [`es6.string.sub`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.sub.js) and [`es6.string.sup`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.string.sup.js). +```js +String + .fromCodePoint(...codePoints) -> str + .raw({raw}, ...substitutions) -> str + #includes(str, from?) -> bool + #startsWith(str, from?) -> bool + #endsWith(str, from?) -> bool + #repeat(num) -> str + #codePointAt(pos) -> uint + #trim() -> str, ES6 fix + #anchor(name) -> str + #big() -> str + #blink() -> str + #bold() -> str + #fixed() -> str + #fontcolor(color) -> str + #fontsize(size) -> str + #italics() -> str + #link(url) -> str + #small() -> str + #strike() -> str + #sub() -> str + #sup() -> str + #@@iterator() -> iterator (code points) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/string +core-js(/library)/fn/string/from-code-point +core-js(/library)/fn/string/raw +core-js(/library)/fn/string/includes +core-js(/library)/fn/string/starts-with +core-js(/library)/fn/string/ends-with +core-js(/library)/fn/string/repeat +core-js(/library)/fn/string/code-point-at +core-js(/library)/fn/string/trim +core-js(/library)/fn/string/anchor +core-js(/library)/fn/string/big +core-js(/library)/fn/string/blink +core-js(/library)/fn/string/bold +core-js(/library)/fn/string/fixed +core-js(/library)/fn/string/fontcolor +core-js(/library)/fn/string/fontsize +core-js(/library)/fn/string/italics +core-js(/library)/fn/string/link +core-js(/library)/fn/string/small +core-js(/library)/fn/string/strike +core-js(/library)/fn/string/sub +core-js(/library)/fn/string/sup +core-js(/library)/fn/string/iterator +core-js(/library)/fn/string/virtual/includes +core-js(/library)/fn/string/virtual/starts-with +core-js(/library)/fn/string/virtual/ends-with +core-js(/library)/fn/string/virtual/repeat +core-js(/library)/fn/string/virtual/code-point-at +core-js(/library)/fn/string/virtual/trim +core-js(/library)/fn/string/virtual/anchor +core-js(/library)/fn/string/virtual/big +core-js(/library)/fn/string/virtual/blink +core-js(/library)/fn/string/virtual/bold +core-js(/library)/fn/string/virtual/fixed +core-js(/library)/fn/string/virtual/fontcolor +core-js(/library)/fn/string/virtual/fontsize +core-js(/library)/fn/string/virtual/italics +core-js(/library)/fn/string/virtual/link +core-js(/library)/fn/string/virtual/small +core-js(/library)/fn/string/virtual/strike +core-js(/library)/fn/string/virtual/sub +core-js(/library)/fn/string/virtual/sup +core-js(/library)/fn/string/virtual/iterator +``` +[*Examples*](http://goo.gl/3UaQ93): +```js +for(var val of 'a𠮷b'){ + console.log(val); // => 'a', '𠮷', 'b' +} + +'foobarbaz'.includes('bar'); // => true +'foobarbaz'.includes('bar', 4); // => false +'foobarbaz'.startsWith('foo'); // => true +'foobarbaz'.startsWith('bar', 3); // => true +'foobarbaz'.endsWith('baz'); // => true +'foobarbaz'.endsWith('bar', 6); // => true + +'string'.repeat(3); // => 'stringstringstring' + +'𠮷'.codePointAt(0); // => 134071 +String.fromCodePoint(97, 134071, 98); // => 'a𠮷b' + +var name = 'Bob'; +String.raw`Hi\n${name}!`; // => 'Hi\\nBob!' (ES6 template string syntax) +String.raw({raw: 'test'}, 0, 1, 2); // => 't0e1s2t' + +'foo'.bold(); // => 'foo' +'bar'.anchor('a"b'); // => 'bar' +'baz'.link('http://example.com'); // => 'baz' +``` +#### ECMAScript 6: RegExp +Modules [`es6.regexp.constructor`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.regexp.constructor.js) and [`es6.regexp.flags`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.regexp.flags.js). + +Support well-known [symbols](#ecmascript-6-symbol) `@@match`, `@@replace`, `@@search` and `@@split`, modules [`es6.regexp.match`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.regexp.match.js), [`es6.regexp.replace`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.regexp.replace.js), [`es6.regexp.search`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.regexp.search.js) and [`es6.regexp.split`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.regexp.split.js). +``` +[new] RegExp(pattern, flags?) -> regexp, ES6 fix: can alter flags (IE9+) + #flags -> str (IE9+) + #toString() -> str, ES6 fixes + #@@match(str) -> array | null + #@@replace(str, replacer) -> string + #@@search(str) -> index + #@@split(str, limit) -> array +String + #match(tpl) -> var, ES6 fix for support @@match + #replace(tpl, replacer) -> var, ES6 fix for support @@replace + #search(tpl) -> var, ES6 fix for support @@search + #split(tpl, limit) -> var, ES6 fix for support @@split, some fixes for old engines +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js/es6/regexp +core-js/fn/regexp/constructor +core-js(/library)/fn/regexp/flags +core-js/fn/regexp/to-string +core-js/fn/regexp/match +core-js/fn/regexp/replace +core-js/fn/regexp/search +core-js/fn/regexp/split +``` +[*Examples*](http://goo.gl/PiJxBD): +```js +RegExp(/./g, 'm'); // => /./m + +/foo/.flags; // => '' +/foo/gim.flags; // => 'gim' + +'foo'.match({[Symbol.match]: _ => 1}); // => 1 +'foo'.replace({[Symbol.replace]: _ => 2}); // => 2 +'foo'.search({[Symbol.search]: _ => 3}); // => 3 +'foo'.split({[Symbol.split]: _ => 4}); // => 4 + +RegExp.prototype.toString.call({source: 'foo', flags: 'bar'}); // => '/foo/bar' +``` +#### ECMAScript 6: Number +Module [`es6.number.constructor`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.constructor.js). `Number` constructor support binary and octal literals, [*example*](http://goo.gl/jRd6b3): +```js +Number('0b1010101'); // => 85 +Number('0o7654321'); // => 2054353 +``` +Modules [`es6.number.epsilon`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.epsilon.js), [`es6.number.is-finite`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.is-finite.js), [`es6.number.is-integer`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.is-integer.js), [`es6.number.is-nan`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.is-nan.js), [`es6.number.is-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.is-safe-integer.js), [`es6.number.max-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.max-safe-integer.js), [`es6.number.min-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.min-safe-integer.js), [`es6.number.parse-float`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.parse-float.js), [`es6.number.parse-int`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.parse-int.js), [`es6.number.to-fixed`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.to-fixed.js), [`es6.number.to-precision`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.number.to-precision.js), [`es6.parse-int`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.parse-int.js), [`es6.parse-float`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.parse-float.js). +```js +[new] Number(var) -> number | number object + .isFinite(num) -> bool + .isNaN(num) -> bool + .isInteger(num) -> bool + .isSafeInteger(num) -> bool + .parseFloat(str) -> num + .parseInt(str) -> int + .EPSILON -> num + .MAX_SAFE_INTEGER -> int + .MIN_SAFE_INTEGER -> int + #toFixed(digits) -> string, fixes + #toPrecision(precision) -> string, fixes +parseFloat(str) -> num, fixes +parseInt(str) -> int, fixes +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/number +core-js/es6/number/constructor +core-js(/library)/fn/number/is-finite +core-js(/library)/fn/number/is-nan +core-js(/library)/fn/number/is-integer +core-js(/library)/fn/number/is-safe-integer +core-js(/library)/fn/number/parse-float +core-js(/library)/fn/number/parse-int +core-js(/library)/fn/number/epsilon +core-js(/library)/fn/number/max-safe-integer +core-js(/library)/fn/number/min-safe-integer +core-js(/library)/fn/number/to-fixed +core-js(/library)/fn/number/to-precision +core-js(/library)/fn/parse-float +core-js(/library)/fn/parse-int +``` +#### ECMAScript 6: Math +Modules [`es6.math.acosh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.acosh.js), [`es6.math.asinh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.asinh.js), [`es6.math.atanh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.atanh.js), [`es6.math.cbrt`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.cbrt.js), [`es6.math.clz32`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.clz32.js), [`es6.math.cosh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.cosh.js), [`es6.math.expm1`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.expm1.js), [`es6.math.fround`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.fround.js), [`es6.math.hypot`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.hypot.js), [`es6.math.imul`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.imul.js), [`es6.math.log10`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.log10.js), [`es6.math.log1p`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.log1p.js), [`es6.math.log2`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.log2.js), [`es6.math.sign`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.sign.js), [`es6.math.sinh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.sinh.js), [`es6.math.tanh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.tanh.js), [`es6.math.trunc`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.math.trunc.js). +```js +Math + .acosh(num) -> num + .asinh(num) -> num + .atanh(num) -> num + .cbrt(num) -> num + .clz32(num) -> uint + .cosh(num) -> num + .expm1(num) -> num + .fround(num) -> num + .hypot(...args) -> num + .imul(num, num) -> int + .log1p(num) -> num + .log10(num) -> num + .log2(num) -> num + .sign(num) -> 1 | -1 | 0 | -0 | NaN + .sinh(num) -> num + .tanh(num) -> num + .trunc(num) -> num +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/math +core-js(/library)/fn/math/acosh +core-js(/library)/fn/math/asinh +core-js(/library)/fn/math/atanh +core-js(/library)/fn/math/cbrt +core-js(/library)/fn/math/clz32 +core-js(/library)/fn/math/cosh +core-js(/library)/fn/math/expm1 +core-js(/library)/fn/math/fround +core-js(/library)/fn/math/hypot +core-js(/library)/fn/math/imul +core-js(/library)/fn/math/log1p +core-js(/library)/fn/math/log10 +core-js(/library)/fn/math/log2 +core-js(/library)/fn/math/sign +core-js(/library)/fn/math/sinh +core-js(/library)/fn/math/tanh +core-js(/library)/fn/math/trunc +``` +#### ECMAScript 6: Date +Modules [`es6.date.to-string`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.date.to-string.js), ES5 features with fixes: [`es6.date.now`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.date.now.js), [`es6.date.to-iso-string`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.date.to-iso-string.js), [`es6.date.to-json`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.date.to-json.js) and [`es6.date.to-primitive`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.date.to-primitive.js). +```js +Date + .now() -> int + #toISOString() -> string + #toJSON() -> string + #toString() -> string + #@@toPrimitive(hint) -> primitive +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js/es6/date +core-js/fn/date/to-string +core-js(/library)/fn/date/now +core-js(/library)/fn/date/to-iso-string +core-js(/library)/fn/date/to-json +core-js(/library)/fn/date/to-primitive +``` +[*Example*](http://goo.gl/haeHLR): +```js +new Date(NaN).toString(); // => 'Invalid Date' +``` + +#### ECMAScript 6: Promise +Module [`es6.promise`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.promise.js). +```js +new Promise(executor(resolve(var), reject(var))) -> promise + #then(resolved(var), rejected(var)) -> promise + #catch(rejected(var)) -> promise + .resolve(promise | var) -> promise + .reject(var) -> promise + .all(iterable) -> promise + .race(iterable) -> promise +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/promise +core-js(/library)/fn/promise +``` +Basic [*example*](http://goo.gl/vGrtUC): +```js +function sleepRandom(time){ + return new Promise(function(resolve, reject){ + setTimeout(resolve, time * 1e3, 0 | Math.random() * 1e3); + }); +} + +console.log('Run'); // => Run +sleepRandom(5).then(function(result){ + console.log(result); // => 869, after 5 sec. + return sleepRandom(10); +}).then(function(result){ + console.log(result); // => 202, after 10 sec. +}).then(function(){ + console.log('immediately after'); // => immediately after + throw Error('Irror!'); +}).then(function(){ + console.log('will not be displayed'); +}).catch(x => console.log(x)); // => => Error: Irror! +``` +`Promise.resolve` and `Promise.reject` [*example*](http://goo.gl/vr8TN3): +```js +Promise.resolve(42).then(x => console.log(x)); // => 42 +Promise.reject(42).catch(x => console.log(x)); // => 42 + +Promise.resolve($.getJSON('/data.json')); // => ES6 promise +``` +`Promise.all` [*example*](http://goo.gl/RdoDBZ): +```js +Promise.all([ + 'foo', + sleepRandom(5), + sleepRandom(15), + sleepRandom(10) // after 15 sec: +]).then(x => console.log(x)); // => ['foo', 956, 85, 382] +``` +`Promise.race` [*example*](http://goo.gl/L8ovkJ): +```js +function timeLimit(promise, time){ + return Promise.race([promise, new Promise(function(resolve, reject){ + setTimeout(reject, time * 1e3, Error('Await > ' + time + ' sec')); + })]); +} + +timeLimit(sleepRandom(5), 10).then(x => console.log(x)); // => 853, after 5 sec. +timeLimit(sleepRandom(15), 10).catch(x => console.log(x)); // Error: Await > 10 sec +``` +ECMAScript 7 [async functions](https://tc39.github.io/ecmascript-asyncawait) [example](http://goo.gl/wnQS4j): +```js +var delay = time => new Promise(resolve => setTimeout(resolve, time)) + +async function sleepRandom(time){ + await delay(time * 1e3); + return 0 | Math.random() * 1e3; +}; +async function sleepError(time, msg){ + await delay(time * 1e3); + throw Error(msg); +}; + +(async () => { + try { + console.log('Run'); // => Run + console.log(await sleepRandom(5)); // => 936, after 5 sec. + var [a, b, c] = await Promise.all([ + sleepRandom(5), + sleepRandom(15), + sleepRandom(10) + ]); + console.log(a, b, c); // => 210 445 71, after 15 sec. + await sleepError(5, 'Irror!'); + console.log('Will not be displayed'); + } catch(e){ + console.log(e); // => Error: 'Irror!', after 5 sec. + } +})(); +``` + +##### Unhandled rejection tracking + +In Node.js, like in native implementation, available events [`unhandledRejection`](https://nodejs.org/api/process.html#process_event_unhandledrejection) and [`rejectionHandled`](https://nodejs.org/api/process.html#process_event_rejectionhandled): +```js +process.on('unhandledRejection', (reason, promise) => console.log('unhandled', reason, promise)); +process.on('rejectionHandled', (promise) => console.log('handled', promise)); + +var p = Promise.reject(42); +// unhandled 42 [object Promise] + +setTimeout(() => p.catch(_ => _), 1e3); +// handled [object Promise] +``` +In a browser on rejection, by default, you will see notify in the console, or you can add a custom handler and a handler on handling unhandled, [*example*](http://goo.gl/Wozskl): +```js +window.onunhandledrejection = e => console.log('unhandled', e.reason, e.promise); +window.onrejectionhandled = e => console.log('handled', e.reason, e.promise); + +var p = Promise.reject(42); +// unhandled 42 [object Promise] + +setTimeout(() => p.catch(_ => _), 1e3); +// handled 42 [object Promise] +``` + +#### ECMAScript 6: Symbol +Module [`es6.symbol`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.symbol.js). +```js +Symbol(description?) -> symbol + .hasInstance -> @@hasInstance + .isConcatSpreadable -> @@isConcatSpreadable + .iterator -> @@iterator + .match -> @@match + .replace -> @@replace + .search -> @@search + .species -> @@species + .split -> @@split + .toPrimitive -> @@toPrimitive + .toStringTag -> @@toStringTag + .unscopables -> @@unscopables + .for(key) -> symbol + .keyFor(symbol) -> key + .useSimple() -> void + .useSetter() -> void +Object + .getOwnPropertySymbols(object) -> array +``` +Also wrapped some methods for correct work with `Symbol` polyfill. +```js +Object + .create(proto | null, descriptors?) -> object + .defineProperty(target, key, desc) -> target + .defineProperties(target, descriptors) -> target + .getOwnPropertyDescriptor(var, key) -> desc | undefined + .getOwnPropertyNames(var) -> array + #propertyIsEnumerable(key) -> bool +JSON + .stringify(target, replacer?, space?) -> string | undefined +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/symbol +core-js(/library)/fn/symbol +core-js(/library)/fn/symbol/has-instance +core-js(/library)/fn/symbol/is-concat-spreadable +core-js(/library)/fn/symbol/iterator +core-js(/library)/fn/symbol/match +core-js(/library)/fn/symbol/replace +core-js(/library)/fn/symbol/search +core-js(/library)/fn/symbol/species +core-js(/library)/fn/symbol/split +core-js(/library)/fn/symbol/to-primitive +core-js(/library)/fn/symbol/to-string-tag +core-js(/library)/fn/symbol/unscopables +core-js(/library)/fn/symbol/for +core-js(/library)/fn/symbol/key-for +``` +[*Basic example*](http://goo.gl/BbvWFc): +```js +var Person = (function(){ + var NAME = Symbol('name'); + function Person(name){ + this[NAME] = name; + } + Person.prototype.getName = function(){ + return this[NAME]; + }; + return Person; +})(); + +var person = new Person('Vasya'); +console.log(person.getName()); // => 'Vasya' +console.log(person['name']); // => undefined +console.log(person[Symbol('name')]); // => undefined, symbols are uniq +for(var key in person)console.log(key); // => only 'getName', symbols are not enumerable +``` +`Symbol.for` & `Symbol.keyFor` [*example*](http://goo.gl/0pdJjX): +```js +var symbol = Symbol.for('key'); +symbol === Symbol.for('key'); // true +Symbol.keyFor(symbol); // 'key' +``` +[*Example*](http://goo.gl/mKVOQJ) with methods for getting own object keys: +```js +var O = {a: 1}; +Object.defineProperty(O, 'b', {value: 2}); +O[Symbol('c')] = 3; +Object.keys(O); // => ['a'] +Object.getOwnPropertyNames(O); // => ['a', 'b'] +Object.getOwnPropertySymbols(O); // => [Symbol(c)] +Reflect.ownKeys(O); // => ['a', 'b', Symbol(c)] +``` +##### Caveats when using `Symbol` polyfill: + +* We can't add new primitive type, `Symbol` returns object. +* `Symbol.for` and `Symbol.keyFor` can't be shimmed cross-realm. +* By default, to hide the keys, `Symbol` polyfill defines setter in `Object.prototype`. For this reason, uncontrolled creation of symbols can cause memory leak and the `in` operator is not working correctly with `Symbol` polyfill: `Symbol() in {} // => true`. + +You can disable defining setters in `Object.prototype`. [Example](http://goo.gl/N5UD7J): +```js +Symbol.useSimple(); +var s1 = Symbol('s1') + , o1 = {}; +o1[s1] = true; +for(var key in o1)console.log(key); // => 'Symbol(s1)_t.qamkg9f3q', w/o native Symbol + +Symbol.useSetter(); +var s2 = Symbol('s2') + , o2 = {}; +o2[s2] = true; +for(var key in o2)console.log(key); // nothing +``` +* Currently, `core-js` not adds setters to `Object.prototype` for well-known symbols for correct work something like `Symbol.iterator in foo`. It can cause problems with their enumerability. +* Some problems possible with environment exotic objects (for example, IE `localStorage`). + +#### ECMAScript 6: Collections +`core-js` uses native collections in most case, just fixes methods / constructor, if it's required, and in old environment uses fast polyfill (O(1) lookup). +#### Map +Module [`es6.map`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.map.js). +```js +new Map(iterable (entries) ?) -> map + #clear() -> void + #delete(key) -> bool + #forEach(fn(val, key, @), that) -> void + #get(key) -> val + #has(key) -> bool + #set(key, val) -> @ + #size -> uint + #values() -> iterator + #keys() -> iterator + #entries() -> iterator + #@@iterator() -> iterator (entries) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/map +core-js(/library)/fn/map +``` +[*Examples*](http://goo.gl/GWR7NI): +```js +var a = [1]; + +var map = new Map([['a', 1], [42, 2]]); +map.set(a, 3).set(true, 4); + +console.log(map.size); // => 4 +console.log(map.has(a)); // => true +console.log(map.has([1])); // => false +console.log(map.get(a)); // => 3 +map.forEach(function(val, key){ + console.log(val); // => 1, 2, 3, 4 + console.log(key); // => 'a', 42, [1], true +}); +map.delete(a); +console.log(map.size); // => 3 +console.log(map.get(a)); // => undefined +console.log(Array.from(map)); // => [['a', 1], [42, 2], [true, 4]] + +var map = new Map([['a', 1], ['b', 2], ['c', 3]]); + +for(var [key, val] of map){ + console.log(key); // => 'a', 'b', 'c' + console.log(val); // => 1, 2, 3 +} +for(var val of map.values())console.log(val); // => 1, 2, 3 +for(var key of map.keys())console.log(key); // => 'a', 'b', 'c' +for(var [key, val] of map.entries()){ + console.log(key); // => 'a', 'b', 'c' + console.log(val); // => 1, 2, 3 +} +``` +#### Set +Module [`es6.set`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.set.js). +```js +new Set(iterable?) -> set + #add(key) -> @ + #clear() -> void + #delete(key) -> bool + #forEach(fn(el, el, @), that) -> void + #has(key) -> bool + #size -> uint + #values() -> iterator + #keys() -> iterator + #entries() -> iterator + #@@iterator() -> iterator (values) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/set +core-js(/library)/fn/set +``` +[*Examples*](http://goo.gl/bmhLwg): +```js +var set = new Set(['a', 'b', 'a', 'c']); +set.add('d').add('b').add('e'); +console.log(set.size); // => 5 +console.log(set.has('b')); // => true +set.forEach(function(it){ + console.log(it); // => 'a', 'b', 'c', 'd', 'e' +}); +set.delete('b'); +console.log(set.size); // => 4 +console.log(set.has('b')); // => false +console.log(Array.from(set)); // => ['a', 'c', 'd', 'e'] + +var set = new Set([1, 2, 3, 2, 1]); + +for(var val of set)console.log(val); // => 1, 2, 3 +for(var val of set.values())console.log(val); // => 1, 2, 3 +for(var key of set.keys())console.log(key); // => 1, 2, 3 +for(var [key, val] of set.entries()){ + console.log(key); // => 1, 2, 3 + console.log(val); // => 1, 2, 3 +} +``` +#### WeakMap +Module [`es6.weak-map`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.weak-map.js). +```js +new WeakMap(iterable (entries) ?) -> weakmap + #delete(key) -> bool + #get(key) -> val + #has(key) -> bool + #set(key, val) -> @ +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/weak-map +core-js(/library)/fn/weak-map +``` +[*Examples*](http://goo.gl/SILXyw): +```js +var a = [1] + , b = [2] + , c = [3]; + +var wmap = new WeakMap([[a, 1], [b, 2]]); +wmap.set(c, 3).set(b, 4); +console.log(wmap.has(a)); // => true +console.log(wmap.has([1])); // => false +console.log(wmap.get(a)); // => 1 +wmap.delete(a); +console.log(wmap.get(a)); // => undefined + +// Private properties store: +var Person = (function(){ + var names = new WeakMap; + function Person(name){ + names.set(this, name); + } + Person.prototype.getName = function(){ + return names.get(this); + }; + return Person; +})(); + +var person = new Person('Vasya'); +console.log(person.getName()); // => 'Vasya' +for(var key in person)console.log(key); // => only 'getName' +``` +#### WeakSet +Module [`es6.weak-set`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.weak-set.js). +```js +new WeakSet(iterable?) -> weakset + #add(key) -> @ + #delete(key) -> bool + #has(key) -> bool +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/weak-set +core-js(/library)/fn/weak-set +``` +[*Examples*](http://goo.gl/TdFbEx): +```js +var a = [1] + , b = [2] + , c = [3]; + +var wset = new WeakSet([a, b, a]); +wset.add(c).add(b).add(c); +console.log(wset.has(b)); // => true +console.log(wset.has([2])); // => false +wset.delete(b); +console.log(wset.has(b)); // => false +``` +##### Caveats when using collections polyfill: + +* Weak-collections polyfill stores values as hidden properties of keys. It works correct and not leak in most cases. However, it is desirable to store a collection longer than its keys. + +#### ECMAScript 6: Typed Arrays +Implementations and fixes `ArrayBuffer`, `DataView`, typed arrays constructors, static and prototype methods. Typed Arrays work only in environments with support descriptors (IE9+), `ArrayBuffer` and `DataView` should work anywhere. + +Modules [`es6.typed.array-buffer`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.array-buffer.js), [`es6.typed.data-view`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.data-view.js), [`es6.typed.int8-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.int8-array.js), [`es6.typed.uint8-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.uint8-array.js), [`es6.typed.uint8-clamped-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.uint8-clamped-array.js), [`es6.typed.int16-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.int16-array.js), [`es6.typed.uint16-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.uint16-array.js), [`es6.typed.int32-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.int32-array.js), [`es6.typed.uint32-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.uint32-array.js), [`es6.typed.float32-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.float32-array.js) and [`es6.typed.float64-array`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.typed.float64-array.js). +```js +new ArrayBuffer(length) -> buffer + .isView(var) -> bool + #slice(start = 0, end = @length) -> buffer + #byteLength -> uint + +new DataView(buffer, byteOffset = 0, byteLength = buffer.byteLength - byteOffset) -> view + #getInt8(offset) -> int8 + #getUint8(offset) -> uint8 + #getInt16(offset, littleEndian = false) -> int16 + #getUint16(offset, littleEndian = false) -> uint16 + #getInt32(offset, littleEndian = false) -> int32 + #getUint32(offset, littleEndian = false) -> uint32 + #getFloat32(offset, littleEndian = false) -> float32 + #getFloat64(offset, littleEndian = false) -> float64 + #setInt8(offset, value) -> void + #setUint8(offset, value) -> void + #setInt16(offset, value, littleEndian = false) -> void + #setUint16(offset, value, littleEndian = false) -> void + #setInt32(offset, value, littleEndian = false) -> void + #setUint32(offset, value, littleEndian = false) -> void + #setFloat32(offset, value, littleEndian = false) -> void + #setFloat64(offset, value, littleEndian = false) -> void + #buffer -> buffer + #byteLength -> uint + #byteOffset -> uint + +{ + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array +} + new %TypedArray%(length) -> typed + new %TypedArray%(typed) -> typed + new %TypedArray%(arrayLike) -> typed + new %TypedArray%(iterable) -> typed + new %TypedArray%(buffer, byteOffset = 0, length = (buffer.byteLength - byteOffset) / @BYTES_PER_ELEMENT) -> typed + .BYTES_PER_ELEMENT -> uint + .from(arrayLike | iterable, mapFn(val, index)?, that) -> typed + .of(...args) -> typed + #BYTES_PER_ELEMENT -> uint + #copyWithin(target = 0, start = 0, end = @length) -> @ + #every(fn(val, index, @), that) -> bool + #fill(val, start = 0, end = @length) -> @ + #filter(fn(val, index, @), that) -> typed + #find(fn(val, index, @), that) -> val + #findIndex(fn(val, index, @), that) -> index + #forEach(fn(val, index, @), that) -> void + #indexOf(var, from?) -> int + #join(string = ',') -> string + #lastIndexOf(var, from?) -> int + #map(fn(val, index, @), that) -> typed + #reduce(fn(memo, val, index, @), memo?) -> var + #reduceRight(fn(memo, val, index, @), memo?) -> var + #reverse() -> @ + #set(arrayLike, offset = 0) -> void + #slice(start = 0, end = @length) -> typed + #some(fn(val, index, @), that) -> bool + #sort(fn(a, b)?) -> @ + #subarray(start = 0, end = @length) -> typed + #toString() -> string + #toLocaleString() -> string + #values() -> iterator + #keys() -> iterator + #entries() -> iterator + #@@iterator() -> iterator (values) + #buffer -> buffer + #byteLength -> uint + #byteOffset -> uint + #length -> uint +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/typed +core-js(/library)/fn/typed +core-js(/library)/fn/typed/array-buffer +core-js(/library)/fn/typed/data-view +core-js(/library)/fn/typed/int8-array +core-js(/library)/fn/typed/uint8-array +core-js(/library)/fn/typed/uint8-clamped-array +core-js(/library)/fn/typed/int16-array +core-js(/library)/fn/typed/uint16-array +core-js(/library)/fn/typed/int32-array +core-js(/library)/fn/typed/uint32-array +core-js(/library)/fn/typed/float32-array +core-js(/library)/fn/typed/float64-array +``` +[*Examples*](http://goo.gl/yla75z): +```js +new Int32Array(4); // => [0, 0, 0, 0] +new Uint8ClampedArray([1, 2, 3, 666]); // => [1, 2, 3, 255] +new Float32Array(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] + +var buffer = new ArrayBuffer(8); +var view = new DataView(buffer); +view.setFloat64(0, 123.456, true); +new Uint8Array(buffer.slice(4)); // => [47, 221, 94, 64] + +Int8Array.of(1, 1.5, 5.7, 745); // => [1, 1, 5, -23] +Uint8Array.from([1, 1.5, 5.7, 745]); // => [1, 1, 5, 233] + +var typed = new Uint8Array([1, 2, 3]); + +var a = typed.slice(1); // => [2, 3] +typed.buffer === a.buffer; // => false +var b = typed.subarray(1); // => [2, 3] +typed.buffer === b.buffer; // => true + +typed.filter(it => it % 2); // => [1, 3] +typed.map(it => it * 1.5); // => [1, 3, 4] + +for(var val of typed)console.log(val); // => 1, 2, 3 +for(var val of typed.values())console.log(val); // => 1, 2, 3 +for(var key of typed.keys())console.log(key); // => 0, 1, 2 +for(var [key, val] of typed.entries()){ + console.log(key); // => 0, 1, 2 + console.log(val); // => 1, 2, 3 +} +``` +##### Caveats when using typed arrays: + +* Typed Arrays polyfills works completely how should work by the spec, but because of internal use getter / setters on each instance, is slow and consumes significant memory. However, typed arrays polyfills required mainly for IE9 (and for `Uint8ClampedArray` in IE10 and early IE11), all modern engines have native typed arrays and requires only constructors fixes and methods. +* The current version hasn't special entry points for methods, they can be added only with constructors. It can be added in the future. +* In the `library` version we can't pollute native prototypes, so prototype methods available as constructors static. + +#### ECMAScript 6: Reflect +Modules [`es6.reflect.apply`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.apply.js), [`es6.reflect.construct`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.construct.js), [`es6.reflect.define-property`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.define-property.js), [`es6.reflect.delete-property`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.delete-property.js), [`es6.reflect.enumerate`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.enumerate.js), [`es6.reflect.get`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.get.js), [`es6.reflect.get-own-property-descriptor`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.get-own-property-descriptor.js), [`es6.reflect.get-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.get-prototype-of.js), [`es6.reflect.has`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.has.js), [`es6.reflect.is-extensible`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.is-extensible.js), [`es6.reflect.own-keys`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.own-keys.js), [`es6.reflect.prevent-extensions`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.prevent-extensions.js), [`es6.reflect.set`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.set.js), [`es6.reflect.set-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es6.reflect.set-prototype-of.js). +```js +Reflect + .apply(target, thisArgument, argumentsList) -> var + .construct(target, argumentsList, newTarget?) -> object + .defineProperty(target, propertyKey, attributes) -> bool + .deleteProperty(target, propertyKey) -> bool + .enumerate(target) -> iterator (removed from the spec and will be removed from core-js@3) + .get(target, propertyKey, receiver?) -> var + .getOwnPropertyDescriptor(target, propertyKey) -> desc + .getPrototypeOf(target) -> object | null + .has(target, propertyKey) -> bool + .isExtensible(target) -> bool + .ownKeys(target) -> array + .preventExtensions(target) -> bool + .set(target, propertyKey, V, receiver?) -> bool + .setPrototypeOf(target, proto) -> bool (required __proto__ - IE11+) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/reflect +core-js(/library)/fn/reflect +core-js(/library)/fn/reflect/apply +core-js(/library)/fn/reflect/construct +core-js(/library)/fn/reflect/define-property +core-js(/library)/fn/reflect/delete-property +core-js(/library)/fn/reflect/enumerate (deprecated and will be removed from the next major release) +core-js(/library)/fn/reflect/get +core-js(/library)/fn/reflect/get-own-property-descriptor +core-js(/library)/fn/reflect/get-prototype-of +core-js(/library)/fn/reflect/has +core-js(/library)/fn/reflect/is-extensible +core-js(/library)/fn/reflect/own-keys +core-js(/library)/fn/reflect/prevent-extensions +core-js(/library)/fn/reflect/set +core-js(/library)/fn/reflect/set-prototype-of +``` +[*Examples*](http://goo.gl/gVT0cH): +```js +var O = {a: 1}; +Object.defineProperty(O, 'b', {value: 2}); +O[Symbol('c')] = 3; +Reflect.ownKeys(O); // => ['a', 'b', Symbol(c)] + +function C(a, b){ + this.c = a + b; +} + +var instance = Reflect.construct(C, [20, 22]); +instance.c; // => 42 +``` + +### ECMAScript 7+ proposals +[The TC39 process.](https://tc39.github.io/process-document/) + +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es7 +core-js(/library)/es7/array +core-js(/library)/es7/global +core-js(/library)/es7/string +core-js(/library)/es7/map +core-js(/library)/es7/set +core-js(/library)/es7/error +core-js(/library)/es7/math +core-js(/library)/es7/system +core-js(/library)/es7/symbol +core-js(/library)/es7/reflect +core-js(/library)/es7/observable +``` +`core-js/stage/4` entry point contains only stage 4 proposals, `core-js/stage/3` - stage 3 and stage 4, etc. +#### Stage 4 proposals + +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/4 +``` +* `{Array, %TypedArray%}#includes` [proposal](https://github.com/tc39/Array.prototype.includes) - module [`es7.array.includes`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.array.includes.js), `%TypedArray%` version in modules from [this section](#ecmascript-6-typed-arrays). +```js +Array + #includes(var, from?) -> bool +{ + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array +} + #includes(var, from?) -> bool +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/array/includes +``` +[*Examples*](http://goo.gl/2Gq4ma): +```js +[1, 2, 3].includes(2); // => true +[1, 2, 3].includes(4); // => false +[1, 2, 3].includes(2, 2); // => false + +[NaN].indexOf(NaN); // => -1 +[NaN].includes(NaN); // => true +Array(1).indexOf(undefined); // => -1 +Array(1).includes(undefined); // => true +``` +* `Object.values`, `Object.entries` [proposal](https://github.com/tc39/proposal-object-values-entries) - modules [`es7.object.values`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.object.values.js), [`es7.object.entries`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.object.entries.js) +```js +Object + .values(object) -> array + .entries(object) -> array +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/object/values +core-js(/library)/fn/object/entries +``` +[*Examples*](http://goo.gl/6kuGOn): +```js +Object.values({a: 1, b: 2, c: 3}); // => [1, 2, 3] +Object.entries({a: 1, b: 2, c: 3}); // => [['a', 1], ['b', 2], ['c', 3]] + +for(let [key, value] of Object.entries({a: 1, b: 2, c: 3})){ + console.log(key); // => 'a', 'b', 'c' + console.log(value); // => 1, 2, 3 +} +``` +* `Object.getOwnPropertyDescriptors` [proposal](https://github.com/tc39/proposal-object-getownpropertydescriptors) - module [`es7.object.get-own-property-descriptors`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.object.get-own-property-descriptors.js) +```js +Object + .getOwnPropertyDescriptors(object) -> object +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/object/get-own-property-descriptors +``` +*Examples*: +```js +// Shallow object cloning with prototype and descriptors: +var copy = Object.create(Object.getPrototypeOf(O), Object.getOwnPropertyDescriptors(O)); +// Mixin: +Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); +``` +* `String#padStart`, `String#padEnd` [proposal](https://github.com/tc39/proposal-string-pad-start-end) - modules [`es7.string.pad-start`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.string.pad-start.js), [`es7.string.pad-end`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.string.pad-end.js) +```js +String + #padStart(length, fillStr = ' ') -> string + #padEnd(length, fillStr = ' ') -> string +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/string/pad-start +core-js(/library)/fn/string/pad-end +core-js(/library)/fn/string/virtual/pad-start +core-js(/library)/fn/string/virtual/pad-end +``` +[*Examples*](http://goo.gl/hK5ccv): +```js +'hello'.padStart(10); // => ' hello' +'hello'.padStart(10, '1234'); // => '12341hello' +'hello'.padEnd(10); // => 'hello ' +'hello'.padEnd(10, '1234'); // => 'hello12341' +``` +* `Object#__(define|lookup)[GS]etter__`, [annex B ES2017](https://github.com/tc39/ecma262/pull/381), but we haven't special namespace for that - modules [`es7.object.define-setter`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.object.define-setter.js), [`es7.object.define-getter`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.object.define-getter.js), [`es7.object.lookup-setter`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.object.lookup-setter.js) and [`es7.object.lookup-getter`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.object.lookup-getter.js). +```js +Object + #__defineSetter__(key, fn) -> void + #__defineGetter__(key, fn) -> void + #__lookupSetter__(key) -> fn | void + #__lookupGetter__(key) -> fn | void +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/object/define-getter +core-js(/library)/fn/object/define-setter +core-js(/library)/fn/object/lookup-getter +core-js(/library)/fn/object/lookup-setter +``` + +#### Stage 3 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/3 +``` +* `global` [proposal](https://github.com/tc39/proposal-global) - modules [`es7.global`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.global.js) and [`es7.system.global`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.system.global.js) (obsolete) +```js +global -> object +System + .global -> object (obsolete) +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/global +core-js(/library)/fn/system/global (obsolete) +``` +[*Examples*](http://goo.gl/gEqMl7): +```js +global.Array === Array; // => true +``` +* `Promise#finally` [proposal](https://github.com/tc39/proposal-promise-finally) - module [`es7.promise.finally`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.promise.finally.js) +```js +Promise + #finally(onFinally()) -> promise +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/promise/finally +``` +[*Examples*](https://goo.gl/AhyBbJ): +```js +Promise.resolve(42).finally(() => console.log('You will see it anyway')); + +Promise.reject(42).finally(() => console.log('You will see it anyway')); +``` + +#### Stage 2 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/2 +``` +* `Symbol.asyncIterator` for [async iteration proposal](https://github.com/tc39/proposal-async-iteration) - module [`es7.symbol.async-iterator`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.symbol.async-iterator.js) +```js +Symbol + .asyncIterator -> @@asyncIterator +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/symbol/async-iterator +``` +* `String#trimLeft`, `String#trimRight` / `String#trimStart`, `String#trimEnd` [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim) - modules [`es7.string.trim-left`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.string.trim-right.js), [`es7.string.trim-right`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.string.trim-right.js) +```js +String + #trimLeft() -> string + #trimRight() -> string + #trimStart() -> string + #trimEnd() -> string +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/string/trim-start +core-js(/library)/fn/string/trim-end +core-js(/library)/fn/string/trim-left +core-js(/library)/fn/string/trim-right +core-js(/library)/fn/string/virtual/trim-start +core-js(/library)/fn/string/virtual/trim-end +core-js(/library)/fn/string/virtual/trim-left +core-js(/library)/fn/string/virtual/trim-right +``` +[*Examples*](http://goo.gl/Er5lMJ): +```js +' hello '.trimLeft(); // => 'hello ' +' hello '.trimRight(); // => ' hello' +``` + +#### Stage 1 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/1 +``` +* `Promise.try` [proposal](https://github.com/tc39/proposal-promise-try) - module [`es7.promise.try`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.promise.try.js) +```js +Promise + .try(function()) -> promise +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/promise/try +``` +[*Examples*](https://goo.gl/k5GGRo): +```js +Promise.try(() => 42).then(it => console.log(`Promise, resolved as ${it}`)); + +Promise.try(() => { throw 42; }).catch(it => console.log(`Promise, rejected as ${it}`)); +``` +* `Array#flatten` and `Array#flatMap` [proposal](https://tc39.github.io/proposal-flatMap) - modules [`es7.array.flatten`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.array.flatten.js) and [`es7.array.flat-map`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.array.flat-map.js) +```js +Array + #flatten(depthArg = 1) -> array + #flatMap(fn(val, key, @), that) -> array +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/array/flatten +core-js(/library)/fn/array/flatMap +core-js(/library)/fn/array/virtual/flatten +core-js(/library)/fn/array/virtual/flatMap +``` +[*Examples*](https://goo.gl/jTXsZi): +```js +[1, [2, 3], [4, 5]].flatten(); // => [1, 2, 3, 4, 5] +[1, [2, [3, [4]]], 5].flatten(); // => [1, 2, [3, [4]], 5] +[1, [2, [3, [4]]], 5].flatten(3); // => [1, 2, 3, 4, 5] + +[{a: 1, b: 2}, {a: 3, b: 4}, {a: 5, b: 6}].flatMap(it => [it.a, it.b]); // => [1, 2, 3, 4, 5, 6] +``` +* `.of` and `.from` methods on collection constructors [proposal](https://github.com/tc39/proposal-setmap-offrom) - modules [`es7.set.of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.set.of.js), [`es7.set.from`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.set.from.js), [`es7.map.of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.map.of.js), [`es7.map.from`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.map.from.js), [`es7.weak-set.of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.weak-set.of.js), [`es7.weak-set.from`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.weak-set.from.js), [`es7.weak-map.of`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.weak-map.of.js), [`es7.weak-map.from`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.weak-map.from.js) +```js +Set + .of(...args) -> set + .from(iterable, mapFn(val, index)?, that?) -> set +Map + .of(...args) -> map + .from(iterable, mapFn(val, index)?, that?) -> map +WeakSet + .of(...args) -> weakset + .from(iterable, mapFn(val, index)?, that?) -> weakset +WeakMap + .of(...args) -> weakmap + .from(iterable, mapFn(val, index)?, that?) -> weakmap +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/set/of +core-js(/library)/fn/set/from +core-js(/library)/fn/map/of +core-js(/library)/fn/map/from +core-js(/library)/fn/weak-set/of +core-js(/library)/fn/weak-set/from +core-js(/library)/fn/weak-map/of +core-js(/library)/fn/weak-map/from +``` +[*Examples*](https://goo.gl/mSC7eU): +```js +Set.of(1, 2, 3, 2, 1); // => Set {1, 2, 3} + +Map.from([[1, 2], [3, 4]], ([key, val]) => [key ** 2, val ** 2]); // => Map {1: 4, 9: 16} +``` +* `String#matchAll` [proposal](https://github.com/tc39/String.prototype.matchAll) - module [`es7.string.match-all`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.string.match-all.js) +```js +String + #matchAll(regexp) -> iterator +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/string/match-all +core-js(/library)/fn/string/virtual/match-all +``` +[*Examples*](http://goo.gl/6kp9EB): +```js +for(let [_, d, D] of '1111a2b3cccc'.matchAll(/(\d)(\D)/)){ + console.log(d, D); // => 1 a, 2 b, 3 c +} +``` +* `Observable` [proposal](https://github.com/zenparsing/es-observable) - modules [`es7.observable`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.observable.js) and [`es7.symbol.observable`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.symbol.observable.js) +```js +new Observable(fn) -> observable + #subscribe(observer) -> subscription + #forEach(fn) -> promise + #@@observable() -> @ + .of(...items) -> observable + .from(observable | iterable) -> observable + .@@species -> @ +Symbol + .observable -> @@observable +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/observable +core-js(/library)/fn/symbol/observable +``` +[*Examples*](http://goo.gl/1LDywi): +```js +new Observable(observer => { + observer.next('hello'); + observer.next('world'); + observer.complete(); +}).forEach(it => console.log(it)) + .then(_ => console.log('!')); +``` +* `Math.{clamp, DEG_PER_RAD, degrees, fscale, rad-per-deg, radians, scale}` + [proposal](https://github.com/rwaldron/proposal-math-extensions) - modules + [`es7.math.clamp`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.clamp.js), + [`es7.math.DEG_PER_RAD`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.DEG_PER_RAD.js), + [`es7.math.degrees`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.degrees.js), + [`es7.math.fscale`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.fscale.js), + [`es7.math.RAD_PER_DEG`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.RAD_PER_DEG.js), + [`es7.math.radians`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.radians.js) and + [`es7.math.scale`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.scale.js) +```js +Math + .DEG_PER_RAD -> number + .RAD_PER_DEG -> number + .clamp(x, lower, upper) -> number + .degrees(radians) -> number + .fscale(x, inLow, inHigh, outLow, outHigh) -> number + .radians(degrees) -> number + .scale(x, inLow, inHigh, outLow, outHigh) -> number +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/math/clamp +core-js(/library)/fn/math/deg-per-rad +core-js(/library)/fn/math/degrees +core-js(/library)/fn/math/fscale +core-js(/library)/fn/math/rad-per-deg +core-js(/library)/fn/math/radians +core-js(/library)/fn/math/scale +``` +* `Math.signbit` [proposal](http://jfbastien.github.io/papers/Math.signbit.html) - module [`es7.math.signbit`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.signbit.js) +```js +Math + .signbit(x) -> bool +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/math/signbit +``` +[*Examples*](http://es6.zloirock.ru/): +```js +Math.signbit(NaN); // => NaN +Math.signbit(1); // => true +Math.signbit(-1); // => false +Math.signbit(0); // => true +Math.signbit(-0); // => false +``` + +#### Stage 0 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/0 +``` +* `String#at` [proposal](https://github.com/mathiasbynens/String.prototype.at) - module [`es7.string.at`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.string.at.js) +```js +String + #at(index) -> string +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/string/at +core-js(/library)/fn/string/virtual/at +``` +[*Examples*](http://goo.gl/XluXI8): +```js +'a𠮷b'.at(1); // => '𠮷' +'a𠮷b'.at(1).length; // => 2 +``` +* `Map#toJSON`, `Set#toJSON` [proposal](https://github.com/DavidBruant/Map-Set.prototype.toJSON) - modules [`es7.map.to-json`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.map.to-json.js), [`es7.set.to-json`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.set.to-json.js) (rejected and will be removed from `core-js@3`) +```js +Map + #toJSON() -> array (rejected and will be removed from core-js@3) +Set + #toJSON() -> array (rejected and will be removed from core-js@3) +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/map +core-js(/library)/fn/set +``` +* `Error.isError` [proposal](https://github.com/ljharb/proposal-is-error) - module [`es7.error.is-error`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.error.is-error.js) (withdrawn and will be removed from `core-js@3`) +```js +Error + .isError(it) -> bool (withdrawn and will be removed from core-js@3) +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/error/is-error +``` +* `Math.{iaddh, isubh, imulh, umulh}` [proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703) - modules [`es7.math.iaddh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.iaddh.js), [`es7.math.isubh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.isubh.js), [`es7.math.imulh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.imulh.js) and [`es7.math.umulh`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.math.umulh.js) +```js +Math + .iaddh(lo0, hi0, lo1, hi1) -> int32 + .isubh(lo0, hi0, lo1, hi1) -> int32 + .imulh(a, b) -> int32 + .umulh(a, b) -> uint32 +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/math/iaddh +core-js(/library)/fn/math/isubh +core-js(/library)/fn/math/imulh +core-js(/library)/fn/math/umulh +``` +* `glogal.asap`, [TC39 discussion](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask), module [`es7.asap`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.asap.js) +```js +asap(fn) -> void +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/asap +``` +[*Examples*](http://goo.gl/tx3SRK): +```js +asap(() => console.log('called as microtask')); +``` + +#### Pre-stage 0 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/pre +``` +* `Reflect` metadata [proposal](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) - modules [`es7.reflect.define-metadata`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.define-metadata.js), [`es7.reflect.delete-metadata`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.delete-metadata.js), [`es7.reflect.get-metadata`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.get-metadata.js), [`es7.reflect.get-metadata-keys`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.get-metadata-keys.js), [`es7.reflect.get-own-metadata`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.get-own-metadata.js), [`es7.reflect.get-own-metadata-keys`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.get-own-metadata-keys.js), [`es7.reflect.has-metadata`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.has-metadata.js), [`es7.reflect.has-own-metadata`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.has-own-metadata.js) and [`es7.reflect.metadata`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/es7.reflect.metadata.js). +```js +Reflect + .defineMetadata(metadataKey, metadataValue, target, propertyKey?) -> void + .getMetadata(metadataKey, target, propertyKey?) -> var + .getOwnMetadata(metadataKey, target, propertyKey?) -> var + .hasMetadata(metadataKey, target, propertyKey?) -> bool + .hasOwnMetadata(metadataKey, target, propertyKey?) -> bool + .deleteMetadata(metadataKey, target, propertyKey?) -> bool + .getMetadataKeys(target, propertyKey?) -> array + .getOwnMetadataKeys(target, propertyKey?) -> array + .metadata(metadataKey, metadataValue) -> decorator(target, targetKey?) -> void +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/reflect/define-metadata +core-js(/library)/fn/reflect/delete-metadata +core-js(/library)/fn/reflect/get-metadata +core-js(/library)/fn/reflect/get-metadata-keys +core-js(/library)/fn/reflect/get-own-metadata +core-js(/library)/fn/reflect/get-own-metadata-keys +core-js(/library)/fn/reflect/has-metadata +core-js(/library)/fn/reflect/has-own-metadata +core-js(/library)/fn/reflect/metadata +``` +[*Examples*](http://goo.gl/KCo3PS): +```js +var O = {}; +Reflect.defineMetadata('foo', 'bar', O); +Reflect.ownKeys(O); // => [] +Reflect.getOwnMetadataKeys(O); // => ['foo'] +Reflect.getOwnMetadata('foo', O); // => 'bar' +``` + +### Web standards +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/web +``` +#### setTimeout / setInterval +Module [`web.timers`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/web.timers.js). Additional arguments fix for IE9-. +```js +setTimeout(fn(...args), time, ...args) -> id +setInterval(fn(...args), time, ...args) -> id +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/web/timers +core-js(/library)/fn/set-timeout +core-js(/library)/fn/set-interval +``` +```js +// Before: +setTimeout(log.bind(null, 42), 1000); +// After: +setTimeout(log, 1000, 42); +``` +#### setImmediate +Module [`web.immediate`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/web.immediate.js). [`setImmediate` proposal](https://developer.mozilla.org/en-US/docs/Web/API/Window.setImmediate) polyfill. +```js +setImmediate(fn(...args), ...args) -> id +clearImmediate(id) -> void +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/web/immediate +core-js(/library)/fn/set-immediate +core-js(/library)/fn/clear-immediate +``` +[*Examples*](http://goo.gl/6nXGrx): +```js +setImmediate(function(arg1, arg2){ + console.log(arg1, arg2); // => Message will be displayed with minimum delay +}, 'Message will be displayed', 'with minimum delay'); + +clearImmediate(setImmediate(function(){ + console.log('Message will not be displayed'); +})); +``` +#### Iterable DOM collections +Some DOM collections should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass). That mean they should have `keys`, `values`, `entries` and `@@iterator` methods for iteration. So add them. Module [`web.dom.iterable`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/web.dom.iterable.js): +```js +{ + CSSRuleList, + CSSStyleDeclaration, + CSSValueList, + ClientRectList, + DOMRectList, + DOMStringList, + DOMTokenList, + DataTransferItemList, + FileList, + HTMLAllCollection, + HTMLCollection, + HTMLFormElement, + HTMLSelectElement, + MediaList, + MimeTypeArray, + NamedNodeMap, + NodeList, + PaintRequestList, + Plugin, + PluginArray, + SVGLengthList, + SVGNumberList, + SVGPathSegList, + SVGPointList, + SVGStringList, + SVGTransformList, + SourceBufferList, + StyleSheetList, + TextTrackCueList, + TextTrackList, + TouchList +} + #@@iterator() -> iterator (values) + +{ + DOMTokenList, + NodeList +} + #values() -> iterator + #keys() -> iterator + #entries() -> iterator +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/web/dom-collections +core-js(/library)/fn/dom-collections/iterator +``` +[*Examples*](http://goo.gl/lfXVFl): +```js +for(var {id} of document.querySelectorAll('*')){ + if(id)console.log(id); +} + +for(var [index, {id}] of document.querySelectorAll('*').entries()){ + if(id)console.log(index, id); +} +``` +### Non-standard +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core +``` +#### Object +Modules [`core.object.is-object`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.object.is-object.js), [`core.object.classof`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.object.classof.js), [`core.object.define`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.object.define.js), [`core.object.make`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.object.make.js). +```js +Object + .isObject(var) -> bool + .classof(var) -> string + .define(target, mixin) -> target + .make(proto | null, mixin?) -> object +``` + +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/object +core-js(/library)/fn/object/is-object +core-js(/library)/fn/object/define +core-js(/library)/fn/object/make +``` +Object classify [*examples*](http://goo.gl/YZQmGo): +```js +Object.isObject({}); // => true +Object.isObject(isNaN); // => true +Object.isObject(null); // => false + +var classof = Object.classof; + +classof(null); // => 'Null' +classof(undefined); // => 'Undefined' +classof(1); // => 'Number' +classof(true); // => 'Boolean' +classof('string'); // => 'String' +classof(Symbol()); // => 'Symbol' + +classof(new Number(1)); // => 'Number' +classof(new Boolean(true)); // => 'Boolean' +classof(new String('string')); // => 'String' + +var fn = function(){} + , list = (function(){return arguments})(1, 2, 3); + +classof({}); // => 'Object' +classof(fn); // => 'Function' +classof([]); // => 'Array' +classof(list); // => 'Arguments' +classof(/./); // => 'RegExp' +classof(new TypeError); // => 'Error' + +classof(new Set); // => 'Set' +classof(new Map); // => 'Map' +classof(new WeakSet); // => 'WeakSet' +classof(new WeakMap); // => 'WeakMap' +classof(new Promise(fn)); // => 'Promise' + +classof([].values()); // => 'Array Iterator' +classof(new Set().values()); // => 'Set Iterator' +classof(new Map().values()); // => 'Map Iterator' + +classof(Math); // => 'Math' +classof(JSON); // => 'JSON' + +function Example(){} +Example.prototype[Symbol.toStringTag] = 'Example'; + +classof(new Example); // => 'Example' +``` +`Object.define` and `Object.make` [*examples*](http://goo.gl/rtpD5Z): +```js +// Before: +Object.defineProperty(target, 'c', { + enumerable: true, + configurable: true, + get: function(){ + return this.a + this.b; + } +}); + +// After: +Object.define(target, { + get c(){ + return this.a + this.b; + } +}); + +// Shallow object cloning with prototype and descriptors: +var copy = Object.make(Object.getPrototypeOf(src), src); + +// Simple inheritance: +function Vector2D(x, y){ + this.x = x; + this.y = y; +} +Object.define(Vector2D.prototype, { + get xy(){ + return Math.hypot(this.x, this.y); + } +}); +function Vector3D(x, y, z){ + Vector2D.apply(this, arguments); + this.z = z; +} +Vector3D.prototype = Object.make(Vector2D.prototype, { + constructor: Vector3D, + get xyz(){ + return Math.hypot(this.x, this.y, this.z); + } +}); + +var vector = new Vector3D(9, 12, 20); +console.log(vector.xy); // => 15 +console.log(vector.xyz); // => 25 +vector.y++; +console.log(vector.xy); // => 15.811388300841896 +console.log(vector.xyz); // => 25.495097567963924 +``` +#### Dict +Module [`core.dict`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.dict.js). Based on [TC39 discuss](https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-11/nov-29.md#collection-apis-review) / [strawman](http://wiki.ecmascript.org/doku.php?id=harmony:modules_standard#dictionaries). +```js +[new] Dict(iterable (entries) | object ?) -> dict + .isDict(var) -> bool + .values(object) -> iterator + .keys(object) -> iterator + .entries(object) -> iterator (entries) + .has(object, key) -> bool + .get(object, key) -> val + .set(object, key, value) -> object + .forEach(object, fn(val, key, @), that) -> void + .map(object, fn(val, key, @), that) -> new @ + .mapPairs(object, fn(val, key, @), that) -> new @ + .filter(object, fn(val, key, @), that) -> new @ + .some(object, fn(val, key, @), that) -> bool + .every(object, fn(val, key, @), that) -> bool + .find(object, fn(val, key, @), that) -> val + .findKey(object, fn(val, key, @), that) -> key + .keyOf(object, var) -> key + .includes(object, var) -> bool + .reduce(object, fn(memo, val, key, @), memo?) -> var +``` + +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/dict +core-js(/library)/fn/dict +``` +`Dict` create object without prototype from iterable or simple object. + +[*Examples*](http://goo.gl/pnp8Vr): +```js +var map = new Map([['a', 1], ['b', 2], ['c', 3]]); + +Dict(); // => {__proto__: null} +Dict({a: 1, b: 2, c: 3}); // => {__proto__: null, a: 1, b: 2, c: 3} +Dict(map); // => {__proto__: null, a: 1, b: 2, c: 3} +Dict([1, 2, 3].entries()); // => {__proto__: null, 0: 1, 1: 2, 2: 3} + +var dict = Dict({a: 42}); +dict instanceof Object; // => false +dict.a; // => 42 +dict.toString; // => undefined +'a' in dict; // => true +'hasOwnProperty' in dict; // => false + +Dict.isDict({}); // => false +Dict.isDict(Dict()); // => true +``` +`Dict.keys`, `Dict.values` and `Dict.entries` returns iterators for objects. + +[*Examples*](http://goo.gl/xAvECH): +```js +var dict = {a: 1, b: 2, c: 3}; + +for(var key of Dict.keys(dict))console.log(key); // => 'a', 'b', 'c' + +for(var val of Dict.values(dict))console.log(val); // => 1, 2, 3 + +for(var [key, val] of Dict.entries(dict)){ + console.log(key); // => 'a', 'b', 'c' + console.log(val); // => 1, 2, 3 +} + +new Map(Dict.entries(dict)); // => Map {a: 1, b: 2, c: 3} +``` +Basic dict operations for objects with prototype [*examples*](http://goo.gl/B28UnG): +```js +'q' in {q: 1}; // => true +'toString' in {}; // => true + +Dict.has({q: 1}, 'q'); // => true +Dict.has({}, 'toString'); // => false + +({q: 1})['q']; // => 1 +({}).toString; // => function toString(){ [native code] } + +Dict.get({q: 1}, 'q'); // => 1 +Dict.get({}, 'toString'); // => undefined + +var O = {}; +O['q'] = 1; +O['q']; // => 1 +O['__proto__'] = {w: 2}; +O['__proto__']; // => {w: 2} +O['w']; // => 2 + +var O = {}; +Dict.set(O, 'q', 1); +O['q']; // => 1 +Dict.set(O, '__proto__', {w: 2}); +O['__proto__']; // => {w: 2} +O['w']; // => undefined +``` +Other methods of `Dict` module are static equialents of `Array.prototype` methods for dictionaries. + +[*Examples*](http://goo.gl/xFi1RH): +```js +var dict = {a: 1, b: 2, c: 3}; + +Dict.forEach(dict, console.log, console); +// => 1, 'a', {a: 1, b: 2, c: 3} +// => 2, 'b', {a: 1, b: 2, c: 3} +// => 3, 'c', {a: 1, b: 2, c: 3} + +Dict.map(dict, function(it){ + return it * it; +}); // => {a: 1, b: 4, c: 9} + +Dict.mapPairs(dict, function(val, key){ + if(key != 'b')return [key + key, val * val]; +}); // => {aa: 1, cc: 9} + +Dict.filter(dict, function(it){ + return it % 2; +}); // => {a: 1, c: 3} + +Dict.some(dict, function(it){ + return it === 2; +}); // => true + +Dict.every(dict, function(it){ + return it === 2; +}); // => false + +Dict.find(dict, function(it){ + return it > 2; +}); // => 3 +Dict.find(dict, function(it){ + return it > 4; +}); // => undefined + +Dict.findKey(dict, function(it){ + return it > 2; +}); // => 'c' +Dict.findKey(dict, function(it){ + return it > 4; +}); // => undefined + +Dict.keyOf(dict, 2); // => 'b' +Dict.keyOf(dict, 4); // => undefined + +Dict.includes(dict, 2); // => true +Dict.includes(dict, 4); // => false + +Dict.reduce(dict, function(memo, it){ + return memo + it; +}); // => 6 +Dict.reduce(dict, function(memo, it){ + return memo + it; +}, ''); // => '123' +``` +#### Partial application +Module [`core.function.part`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.function.part.js). +```js +Function + #part(...args | _) -> fn(...args) +``` + +[*CommonJS entry points:*](#commonjs) +```js +core-js/core/function +core-js(/library)/fn/function/part +core-js(/library)/fn/function/virtual/part +core-js(/library)/fn/_ +``` +`Function#part` partial apply function without `this` binding. Uses global variable `_` (`core._` for builds without global namespace pollution) as placeholder and not conflict with `Underscore` / `LoDash`. + +[*Examples*](http://goo.gl/p9ZJ8K): +```js +var fn1 = log.part(1, 2); +fn1(3, 4); // => 1, 2, 3, 4 + +var fn2 = log.part(_, 2, _, 4); +fn2(1, 3); // => 1, 2, 3, 4 + +var fn3 = log.part(1, _, _, 4); +fn3(2, 3); // => 1, 2, 3, 4 + +fn2(1, 3, 5); // => 1, 2, 3, 4, 5 +fn2(1); // => 1, 2, undefined, 4 +``` +#### Number Iterator +Module [`core.number.iterator`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.number.iterator.js). +```js +Number + #@@iterator() -> iterator +``` + +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/number +core-js(/library)/fn/number/iterator +core-js(/library)/fn/number/virtual/iterator +``` +[*Examples*](http://goo.gl/o45pCN): +```js +for(var i of 3)console.log(i); // => 0, 1, 2 + +[...10]; // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + +Array.from(10, Math.random); // => [0.9817775336559862, 0.02720663254149258, ...] + +Array.from(10, function(it){ + return this + it * it; +}, .42); // => [0.42, 1.42, 4.42, 9.42, 16.42, 25.42, 36.42, 49.42, 64.42, 81.42] +``` +#### Escaping strings +Modules [`core.regexp.escape`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.regexp.escape.js), [`core.string.escape-html`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.string.escape-html.js) and [`core.string.unescape-html`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.string.unescape-html.js). +```js +RegExp + .escape(str) -> str +String + #escapeHTML() -> str + #unescapeHTML() -> str +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/regexp +core-js(/library)/core/string +core-js(/library)/fn/regexp/escape +core-js(/library)/fn/string/escape-html +core-js(/library)/fn/string/unescape-html +core-js(/library)/fn/string/virtual/escape-html +core-js(/library)/fn/string/virtual/unescape-html +``` +[*Examples*](http://goo.gl/6bOvsQ): +```js +RegExp.escape('Hello, []{}()*+?.\\^$|!'); // => 'Hello, \[\]\{\}\(\)\*\+\?\.\\\^\$\|!' + +''.escapeHTML(); // => '<script>doSomething();</script>' +'<script>doSomething();</script>'.unescapeHTML(); // => '' +``` +#### delay +Module [`core.delay`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.delay.js). [Promise](#ecmascript-6-promise)-returning delay function, [esdiscuss](https://esdiscuss.org/topic/promise-returning-delay-function). +```js +delay(ms) -> promise +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/delay +core-js(/library)/fn/delay +``` +[*Examples*](http://goo.gl/lbucba): +```js +delay(1e3).then(() => console.log('after 1 sec')); + +(async () => { + await delay(3e3); + console.log('after 3 sec'); + + while(await delay(3e3))console.log('each 3 sec'); +})(); +``` +#### Helpers for iterators +Modules [`core.is-iterable`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.is-iterable.js), [`core.get-iterator`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.get-iterator.js), [`core.get-iterator-method`](https://github.com/zloirock/core-js/blob/v2.5.0/modules/core.get-iterator-method.js) - helpers for check iterability / get iterator in the `library` version or, for example, for `arguments` object: +```js +core + .isIterable(var) -> bool + .getIterator(iterable) -> iterator + .getIteratorMethod(var) -> function | undefined +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/is-iterable +core-js(/library)/fn/get-iterator +core-js(/library)/fn/get-iterator-method +``` +[*Examples*](http://goo.gl/SXsM6D): +```js +var list = (function(){ + return arguments; +})(1, 2, 3); + +console.log(core.isIterable(list)); // true; + +var iter = core.getIterator(list); +console.log(iter.next().value); // 1 +console.log(iter.next().value); // 2 +console.log(iter.next().value); // 3 +console.log(iter.next().value); // undefined + +core.getIterator({}); // TypeError: [object Object] is not iterable! + +var iterFn = core.getIteratorMethod(list); +console.log(typeof iterFn); // 'function' +var iter = iterFn.call(list); +console.log(iter.next().value); // 1 +console.log(iter.next().value); // 2 +console.log(iter.next().value); // 3 +console.log(iter.next().value); // undefined + +console.log(core.getIteratorMethod({})); // undefined +``` + +## Missing polyfills +- ES5 `JSON` is missing now only in IE7- and never will it be added to `core-js`, if you need it in these old browsers, many implementations are available, for example, [json3](https://github.com/bestiejs/json3). +- ES6 `String#normalize` is not a very useful feature, but this polyfill will be very large. If you need it, you can use [unorm](https://github.com/walling/unorm/). +- ES6 `Proxy` can't be polyfilled, but for Node.js / Chromium with additional flags you can try [harmony-reflect](https://github.com/tvcutsem/harmony-reflect) for adapt old style `Proxy` API to final ES6 version. +- ES6 logic for `@@isConcatSpreadable` and `@@species` (in most places) can be polyfilled without problems, but it will cause a serious slowdown in popular cases in some engines. It will be polyfilled when it will be implemented in modern engines. +- ES7 `SIMD`. `core-js` doesn't add polyfill of this feature because of large size and some other reasons. You can use [this polyfill](https://github.com/tc39/ecmascript_simd/blob/master/src/ecmascript_simd.js). +- `window.fetch` is not a cross-platform feature, in some environments it makes no sense. For this reason, I don't think it should be in `core-js`. Looking at a large number of requests it *may be* added in the future. Now you can use, for example, [this polyfill](https://github.com/github/fetch). +- ECMA-402 `Intl` is missed because of size. You can use [this polyfill](https://github.com/andyearnshaw/Intl.js/). diff --git a/node_modules/csscomb/node_modules/core-js/bower.json b/node_modules/csscomb/node_modules/core-js/bower.json new file mode 100644 index 0000000..f6eb784 --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/bower.json @@ -0,0 +1,47 @@ +{ + "name": "core.js", + "main": "client/core.js", + "version": "2.4.1", + "description": "Standard Library", + "keywords": [ + "ES3", + "ECMAScript 3", + "ES5", + "ECMAScript 5", + "ES6", + "ES2015", + "ECMAScript 6", + "ECMAScript 2015", + "ES7", + "ES2016", + "ECMAScript 7", + "ECMAScript 2016", + "Harmony", + "Strawman", + "Map", + "Set", + "WeakMap", + "WeakSet", + "Promise", + "Symbol", + "TypedArray", + "setImmediate", + "Dict", + "polyfill", + "shim" + ], + "authors": [ + "Denis Pushkarev (http://zloirock.ru/)" + ], + "license": "MIT", + "homepage": "https://github.com/zloirock/core-js", + "repository": { + "type": "git", + "url": "https://github.com/zloirock/core-js.git" + }, + "ignore": [ + "build", + "node_modules", + "tests" + ] +} diff --git a/node_modules/csscomb/node_modules/core-js/build/Gruntfile.ls b/node_modules/csscomb/node_modules/core-js/build/Gruntfile.ls new file mode 100644 index 0000000..7b8e465 --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/build/Gruntfile.ls @@ -0,0 +1,86 @@ +require! <[./build fs ./config]> +module.exports = (grunt)-> + grunt.loadNpmTasks \grunt-contrib-clean + grunt.loadNpmTasks \grunt-contrib-copy + grunt.loadNpmTasks \grunt-contrib-uglify + grunt.loadNpmTasks \grunt-contrib-watch + grunt.loadNpmTasks \grunt-livescript + grunt.loadNpmTasks \grunt-karma + grunt.initConfig do + pkg: grunt.file.readJSON './package.json' + uglify: build: + files: '<%=grunt.option("path")%>.min.js': '<%=grunt.option("path")%>.js' + options: + mangle: {+keep_fnames} + compress: {+keep_fnames, +pure_getters} + output: {max_line_len: 32000} + ie8: on + sourceMap: on + banner: config.banner + livescript: src: files: + './tests/helpers.js': './tests/helpers/*' + './tests/tests.js': './tests/tests/*' + './tests/library.js': './tests/library/*' + './tests/es.js': './tests/tests/es*' + './tests/experimental.js': './tests/experimental/*' + './build/index.js': './build/build.ls*' + clean: <[./library]> + copy: lib: files: + * expand: on + cwd: './' + src: <[es5/** es6/** es7/** stage/** web/** core/** fn/** index.js shim.js]> + dest: './library/' + * expand: on + cwd: './' + src: <[modules/*]> + dest: './library/' + filter: \isFile + * expand: on + cwd: './modules/library/' + src: '*' + dest: './library/modules/' + watch: + core: + files: './modules/*' + tasks: \default + tests: + files: './tests/tests/*' + tasks: \livescript + karma: + 'options': + configFile: './tests/karma.conf.js' + browsers: <[PhantomJS]> + singleRun: on + 'default': {} + 'library': files: <[client/library.js tests/helpers.js tests/library.js]>map -> src: it + grunt.registerTask \build (options)-> + done = @async! + build { + modules: (options || 'es5,es6,es7,js,web,core')split \, + blacklist: (grunt.option(\blacklist) || '')split \, + library: grunt.option(\library) in <[yes on true]> + umd: grunt.option(\umd) not in <[no off false]> + } + .then !-> + grunt.option(\path) || grunt.option(\path, './custom') + fs.writeFile grunt.option(\path) + '.js', it, done + .catch !-> + console.error it + process.exit 1 + grunt.registerTask \client -> + grunt.option \library '' + grunt.option \path './client/core' + grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> + grunt.registerTask \library -> + grunt.option \library 'true' + grunt.option \path './client/library' + grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> + grunt.registerTask \shim -> + grunt.option \library '' + grunt.option \path './client/shim' + grunt.task.run <[build:es5,es6,es7,js,web uglify]> + grunt.registerTask \e -> + grunt.option \library ''> + grunt.option \path './client/core' + grunt.task.run <[build:es5,es6,es7,js,web,core,exp uglify]> + grunt.registerTask \default <[clean copy client library shim]> \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/core-js/build/build.ls b/node_modules/csscomb/node_modules/core-js/build/build.ls new file mode 100644 index 0000000..8cbe56e --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/build/build.ls @@ -0,0 +1,62 @@ +require! { + '../library/fn/promise': Promise + './config': {list, experimental, libraryBlacklist, es5SpecialCase, banner} + fs: {readFile, writeFile, unlink} + path: {basename, dirname, join} + webpack, temp +} + +module.exports = ({modules = [], blacklist = [], library = no, umd = on})-> + resolve, reject <~! new Promise _ + let @ = modules.reduce ((memo, it)-> memo[it] = on; memo), {} + if @exp => for experimental => @[..] = on + if @es5 => for es5SpecialCase => @[..] = on + for ns of @ + if @[ns] + for name in list + if name.indexOf("#ns.") is 0 and name not in experimental + @[name] = on + + if library => blacklist ++= libraryBlacklist + for ns in blacklist + for name in list + if name is ns or name.indexOf("#ns.") is 0 + @[name] = no + + TARGET = temp.path {suffix: '.js'} + + err, info <~! webpack do + entry: list.filter(~> @[it]).map ~> + if library => join __dirname, '..', 'library', 'modules', it + else join __dirname, '..', 'modules', it + output: + path: dirname TARGET + filename: basename "./#TARGET" + if err => return reject err + + err, script <~! readFile TARGET + if err => return reject err + + err <~! unlink TARGET + if err => return reject err + + if umd + exportScript = """ + // CommonJS export + if(typeof module != 'undefined' && module.exports)module.exports = __e; + // RequireJS export + else if(typeof define == 'function' && define.amd)define(function(){return __e}); + // Export to global object + else __g.core = __e; + """ + else + exportScript = "" + + resolve """ + #banner + !function(__e, __g, undefined){ + 'use strict'; + #script + #exportScript + }(1, 1); + """ \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/core-js/build/config.js b/node_modules/csscomb/node_modules/core-js/build/config.js new file mode 100644 index 0000000..062d810 --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/build/config.js @@ -0,0 +1,274 @@ +module.exports = { + list: [ + 'es6.symbol', + 'es6.object.define-property', + 'es6.object.define-properties', + 'es6.object.get-own-property-descriptor', + 'es6.object.create', + 'es6.object.get-prototype-of', + 'es6.object.keys', + 'es6.object.get-own-property-names', + 'es6.object.freeze', + 'es6.object.seal', + 'es6.object.prevent-extensions', + 'es6.object.is-frozen', + 'es6.object.is-sealed', + 'es6.object.is-extensible', + 'es6.object.assign', + 'es6.object.is', + 'es6.object.set-prototype-of', + 'es6.object.to-string', + 'es6.function.bind', + 'es6.function.name', + 'es6.function.has-instance', + 'es6.number.constructor', + 'es6.number.to-fixed', + 'es6.number.to-precision', + 'es6.number.epsilon', + 'es6.number.is-finite', + 'es6.number.is-integer', + 'es6.number.is-nan', + 'es6.number.is-safe-integer', + 'es6.number.max-safe-integer', + 'es6.number.min-safe-integer', + 'es6.number.parse-float', + 'es6.number.parse-int', + 'es6.parse-int', + 'es6.parse-float', + 'es6.math.acosh', + 'es6.math.asinh', + 'es6.math.atanh', + 'es6.math.cbrt', + 'es6.math.clz32', + 'es6.math.cosh', + 'es6.math.expm1', + 'es6.math.fround', + 'es6.math.hypot', + 'es6.math.imul', + 'es6.math.log10', + 'es6.math.log1p', + 'es6.math.log2', + 'es6.math.sign', + 'es6.math.sinh', + 'es6.math.tanh', + 'es6.math.trunc', + 'es6.string.from-code-point', + 'es6.string.raw', + 'es6.string.trim', + 'es6.string.code-point-at', + 'es6.string.ends-with', + 'es6.string.includes', + 'es6.string.repeat', + 'es6.string.starts-with', + 'es6.string.iterator', + 'es6.string.anchor', + 'es6.string.big', + 'es6.string.blink', + 'es6.string.bold', + 'es6.string.fixed', + 'es6.string.fontcolor', + 'es6.string.fontsize', + 'es6.string.italics', + 'es6.string.link', + 'es6.string.small', + 'es6.string.strike', + 'es6.string.sub', + 'es6.string.sup', + 'es6.array.is-array', + 'es6.array.from', + 'es6.array.of', + 'es6.array.join', + 'es6.array.slice', + 'es6.array.sort', + 'es6.array.for-each', + 'es6.array.map', + 'es6.array.filter', + 'es6.array.some', + 'es6.array.every', + 'es6.array.reduce', + 'es6.array.reduce-right', + 'es6.array.index-of', + 'es6.array.last-index-of', + 'es6.array.copy-within', + 'es6.array.fill', + 'es6.array.find', + 'es6.array.find-index', + 'es6.array.iterator', + 'es6.array.species', + 'es6.regexp.constructor', + 'es6.regexp.to-string', + 'es6.regexp.flags', + 'es6.regexp.match', + 'es6.regexp.replace', + 'es6.regexp.search', + 'es6.regexp.split', + 'es6.promise', + 'es6.map', + 'es6.set', + 'es6.weak-map', + 'es6.weak-set', + 'es6.reflect.apply', + 'es6.reflect.construct', + 'es6.reflect.define-property', + 'es6.reflect.delete-property', + 'es6.reflect.enumerate', + 'es6.reflect.get', + 'es6.reflect.get-own-property-descriptor', + 'es6.reflect.get-prototype-of', + 'es6.reflect.has', + 'es6.reflect.is-extensible', + 'es6.reflect.own-keys', + 'es6.reflect.prevent-extensions', + 'es6.reflect.set', + 'es6.reflect.set-prototype-of', + 'es6.date.now', + 'es6.date.to-json', + 'es6.date.to-iso-string', + 'es6.date.to-string', + 'es6.date.to-primitive', + 'es6.typed.array-buffer', + 'es6.typed.data-view', + 'es6.typed.int8-array', + 'es6.typed.uint8-array', + 'es6.typed.uint8-clamped-array', + 'es6.typed.int16-array', + 'es6.typed.uint16-array', + 'es6.typed.int32-array', + 'es6.typed.uint32-array', + 'es6.typed.float32-array', + 'es6.typed.float64-array', + 'es7.array.includes', + 'es7.array.flat-map', + 'es7.array.flatten', + 'es7.string.at', + 'es7.string.pad-start', + 'es7.string.pad-end', + 'es7.string.trim-left', + 'es7.string.trim-right', + 'es7.string.match-all', + 'es7.symbol.async-iterator', + 'es7.symbol.observable', + 'es7.object.get-own-property-descriptors', + 'es7.object.values', + 'es7.object.entries', + 'es7.object.define-getter', + 'es7.object.define-setter', + 'es7.object.lookup-getter', + 'es7.object.lookup-setter', + 'es7.map.to-json', + 'es7.set.to-json', + 'es7.map.of', + 'es7.set.of', + 'es7.weak-map.of', + 'es7.weak-set.of', + 'es7.map.from', + 'es7.set.from', + 'es7.weak-map.from', + 'es7.weak-set.from', + 'es7.global', + 'es7.system.global', + 'es7.error.is-error', + 'es7.math.clamp', + 'es7.math.deg-per-rad', + 'es7.math.degrees', + 'es7.math.fscale', + 'es7.math.iaddh', + 'es7.math.isubh', + 'es7.math.imulh', + 'es7.math.rad-per-deg', + 'es7.math.radians', + 'es7.math.scale', + 'es7.math.umulh', + 'es7.math.signbit', + 'es7.promise.finally', + 'es7.promise.try', + 'es7.reflect.define-metadata', + 'es7.reflect.delete-metadata', + 'es7.reflect.get-metadata', + 'es7.reflect.get-metadata-keys', + 'es7.reflect.get-own-metadata', + 'es7.reflect.get-own-metadata-keys', + 'es7.reflect.has-metadata', + 'es7.reflect.has-own-metadata', + 'es7.reflect.metadata', + 'es7.asap', + 'es7.observable', + 'web.immediate', + 'web.dom.iterable', + 'web.timers', + 'core.dict', + 'core.get-iterator-method', + 'core.get-iterator', + 'core.is-iterable', + 'core.delay', + 'core.function.part', + 'core.object.is-object', + 'core.object.classof', + 'core.object.define', + 'core.object.make', + 'core.number.iterator', + 'core.regexp.escape', + 'core.string.escape-html', + 'core.string.unescape-html', + ], + experimental: [ + ], + libraryBlacklist: [ + 'es6.object.to-string', + 'es6.function.name', + 'es6.regexp.constructor', + 'es6.regexp.to-string', + 'es6.regexp.flags', + 'es6.regexp.match', + 'es6.regexp.replace', + 'es6.regexp.search', + 'es6.regexp.split', + 'es6.number.constructor', + 'es6.date.to-string', + 'es6.date.to-primitive', + ], + es5SpecialCase: [ + 'es6.object.create', + 'es6.object.define-property', + 'es6.object.define-properties', + 'es6.object.get-own-property-descriptor', + 'es6.object.get-prototype-of', + 'es6.object.keys', + 'es6.object.get-own-property-names', + 'es6.object.freeze', + 'es6.object.seal', + 'es6.object.prevent-extensions', + 'es6.object.is-frozen', + 'es6.object.is-sealed', + 'es6.object.is-extensible', + 'es6.function.bind', + 'es6.array.is-array', + 'es6.array.join', + 'es6.array.slice', + 'es6.array.sort', + 'es6.array.for-each', + 'es6.array.map', + 'es6.array.filter', + 'es6.array.some', + 'es6.array.every', + 'es6.array.reduce', + 'es6.array.reduce-right', + 'es6.array.index-of', + 'es6.array.last-index-of', + 'es6.number.to-fixed', + 'es6.number.to-precision', + 'es6.date.now', + 'es6.date.to-iso-string', + 'es6.date.to-json', + 'es6.string.trim', + 'es6.regexp.to-string', + 'es6.parse-int', + 'es6.parse-float', + ], + banner: '/**\n' + + ' * core-js ' + require('../package').version + '\n' + + ' * https://github.com/zloirock/core-js\n' + + ' * License: http://rock.mit-license.org\n' + + ' * © ' + new Date().getFullYear() + ' Denis Pushkarev\n' + + ' */', +}; diff --git a/node_modules/csscomb/node_modules/core-js/build/index.js b/node_modules/csscomb/node_modules/core-js/build/index.js new file mode 100644 index 0000000..526f181 --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/build/index.js @@ -0,0 +1,104 @@ +// Generated by LiveScript 1.4.0 +(function(){ + var Promise, ref$, list, experimental, libraryBlacklist, es5SpecialCase, banner, readFile, writeFile, unlink, basename, dirname, join, webpack, temp; + Promise = require('../library/fn/promise'); + ref$ = require('./config'), list = ref$.list, experimental = ref$.experimental, libraryBlacklist = ref$.libraryBlacklist, es5SpecialCase = ref$.es5SpecialCase, banner = ref$.banner; + ref$ = require('fs'), readFile = ref$.readFile, writeFile = ref$.writeFile, unlink = ref$.unlink; + ref$ = require('path'), basename = ref$.basename, dirname = ref$.dirname, join = ref$.join; + webpack = require('webpack'); + temp = require('temp'); + module.exports = function(arg$){ + var modules, ref$, blacklist, library, umd, this$ = this; + modules = (ref$ = arg$.modules) != null + ? ref$ + : [], blacklist = (ref$ = arg$.blacklist) != null + ? ref$ + : [], library = (ref$ = arg$.library) != null ? ref$ : false, umd = (ref$ = arg$.umd) != null ? ref$ : true; + return new Promise(function(resolve, reject){ + (function(){ + var i$, x$, ref$, len$, y$, ns, name, j$, len1$, TARGET, this$ = this; + if (this.exp) { + for (i$ = 0, len$ = (ref$ = experimental).length; i$ < len$; ++i$) { + x$ = ref$[i$]; + this[x$] = true; + } + } + if (this.es5) { + for (i$ = 0, len$ = (ref$ = es5SpecialCase).length; i$ < len$; ++i$) { + y$ = ref$[i$]; + this[y$] = true; + } + } + for (ns in this) { + if (this[ns]) { + for (i$ = 0, len$ = (ref$ = list).length; i$ < len$; ++i$) { + name = ref$[i$]; + if (name.indexOf(ns + ".") === 0 && !in$(name, experimental)) { + this[name] = true; + } + } + } + } + if (library) { + blacklist = blacklist.concat(libraryBlacklist); + } + for (i$ = 0, len$ = blacklist.length; i$ < len$; ++i$) { + ns = blacklist[i$]; + for (j$ = 0, len1$ = (ref$ = list).length; j$ < len1$; ++j$) { + name = ref$[j$]; + if (name === ns || name.indexOf(ns + ".") === 0) { + this[name] = false; + } + } + } + TARGET = temp.path({ + suffix: '.js' + }); + webpack({ + entry: list.filter(function(it){ + return this$[it]; + }).map(function(it){ + if (library) { + return join(__dirname, '..', 'library', 'modules', it); + } else { + return join(__dirname, '..', 'modules', it); + } + }), + output: { + path: dirname(TARGET), + filename: basename("./" + TARGET) + } + }, function(err, info){ + if (err) { + return reject(err); + } + readFile(TARGET, function(err, script){ + if (err) { + return reject(err); + } + unlink(TARGET, function(err){ + var exportScript; + if (err) { + return reject(err); + } + if (umd) { + exportScript = "// CommonJS export\nif(typeof module != 'undefined' && module.exports)module.exports = __e;\n// RequireJS export\nelse if(typeof define == 'function' && define.amd)define(function(){return __e});\n// Export to global object\nelse __g.core = __e;"; + } else { + exportScript = ""; + } + resolve("" + banner + "\n!function(__e, __g, undefined){\n'use strict';\n" + script + "\n" + exportScript + "\n}(1, 1);"); + }); + }); + }); + }.call(modules.reduce(function(memo, it){ + memo[it] = true; + return memo; + }, {}))); + }); + }; + function in$(x, xs){ + var i = -1, l = xs.length >>> 0; + while (++i < l) if (x === xs[i]) return true; + return false; + } +}).call(this); diff --git a/node_modules/csscomb/node_modules/core-js/client/core.js b/node_modules/csscomb/node_modules/core-js/client/core.js new file mode 100644 index 0000000..f9a2dee --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/client/core.js @@ -0,0 +1,8623 @@ +/** + * core-js 2.5.0 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2017 Denis Pushkarev + */ +!function(__e, __g, undefined){ +'use strict'; +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 129); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(18); +var hide = __webpack_require__(13); +var redefine = __webpack_require__(14); +var ctx = __webpack_require__(19); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if (target) redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(50)('wks'); +var uid = __webpack_require__(35); +var Symbol = __webpack_require__(2).Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var IE8_DOM_DEFINE = __webpack_require__(95); +var toPrimitive = __webpack_require__(22); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(3)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(24); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(23); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(47); +var defined = __webpack_require__(23); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6); +var createDesc = __webpack_require__(31); +module.exports = __webpack_require__(7) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var hide = __webpack_require__(13); +var has = __webpack_require__(12); +var SRC = __webpack_require__(35)('src'); +var TO_STRING = 'toString'; +var $toString = Function[TO_STRING]; +var TPL = ('' + $toString).split(TO_STRING); + +__webpack_require__(18).inspectSource = function (it) { + return $toString.call(it); +}; + +(module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) has(val, 'name') || hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + hide(O, key, val); + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(48); +var createDesc = __webpack_require__(31); +var toIObject = __webpack_require__(11); +var toPrimitive = __webpack_require__(22); +var has = __webpack_require__(12); +var IE8_DOM_DEFINE = __webpack_require__(95); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(7) ? gOPD : function getOwnPropertyDescriptor(O, P) { + O = toIObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return gOPD(O, P); + } catch (e) { /* empty */ } + if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); +}; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(12); +var toObject = __webpack_require__(9); +var IE_PROTO = __webpack_require__(69)('IE_PROTO'); +var ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var fails = __webpack_require__(3); +var defined = __webpack_require__(23); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.0' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(10); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fails = __webpack_require__(3); + +module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(4); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(0); +var core = __webpack_require__(18); +var fails = __webpack_require__(3); +module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); +}; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = __webpack_require__(19); +var IObject = __webpack_require__(47); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var asc = __webpack_require__(84); +module.exports = function (TYPE, $create) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + var create = $create || asc; + return function ($this, callbackfn, that) { + var O = toObject($this); + var self = IObject(O); + var f = ctx(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var val, res; + for (;length > index; index++) if (NO_HOLES || index in self) { + val = self[index]; + res = f(val, index, O); + if (TYPE) { + if (IS_MAP) result[index] = res; // map + else if (res) switch (TYPE) { + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; +}; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(98); +var enumBugKeys = __webpack_require__(70); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(1); +var dPs = __webpack_require__(99); +var enumBugKeys = __webpack_require__(70); +var IE_PROTO = __webpack_require__(69)('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(67)('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(71).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +if (__webpack_require__(7)) { + var LIBRARY = __webpack_require__(36); + var global = __webpack_require__(2); + var fails = __webpack_require__(3); + var $export = __webpack_require__(0); + var $typed = __webpack_require__(63); + var $buffer = __webpack_require__(92); + var ctx = __webpack_require__(19); + var anInstance = __webpack_require__(42); + var propertyDesc = __webpack_require__(31); + var hide = __webpack_require__(13); + var redefineAll = __webpack_require__(43); + var toInteger = __webpack_require__(24); + var toLength = __webpack_require__(8); + var toIndex = __webpack_require__(119); + var toAbsoluteIndex = __webpack_require__(37); + var toPrimitive = __webpack_require__(22); + var has = __webpack_require__(12); + var classof = __webpack_require__(39); + var isObject = __webpack_require__(4); + var toObject = __webpack_require__(9); + var isArrayIter = __webpack_require__(82); + var create = __webpack_require__(28); + var getPrototypeOf = __webpack_require__(16); + var gOPN = __webpack_require__(38).f; + var getIterFn = __webpack_require__(49); + var uid = __webpack_require__(35); + var wks = __webpack_require__(5); + var createArrayMethod = __webpack_require__(26); + var createArrayIncludes = __webpack_require__(51); + var speciesConstructor = __webpack_require__(61); + var ArrayIterators = __webpack_require__(86); + var Iterators = __webpack_require__(40); + var $iterDetect = __webpack_require__(58); + var setSpecies = __webpack_require__(41); + var arrayFill = __webpack_require__(85); + var arrayCopyWithin = __webpack_require__(110); + var $DP = __webpack_require__(6); + var $GOPD = __webpack_require__(15); + var dP = $DP.f; + var gOPD = $GOPD.f; + var RangeError = global.RangeError; + var TypeError = global.TypeError; + var Uint8Array = global.Uint8Array; + var ARRAY_BUFFER = 'ArrayBuffer'; + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var PROTOTYPE = 'prototype'; + var ArrayProto = Array[PROTOTYPE]; + var $ArrayBuffer = $buffer.ArrayBuffer; + var $DataView = $buffer.DataView; + var arrayForEach = createArrayMethod(0); + var arrayFilter = createArrayMethod(2); + var arraySome = createArrayMethod(3); + var arrayEvery = createArrayMethod(4); + var arrayFind = createArrayMethod(5); + var arrayFindIndex = createArrayMethod(6); + var arrayIncludes = createArrayIncludes(true); + var arrayIndexOf = createArrayIncludes(false); + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var arrayLastIndexOf = ArrayProto.lastIndexOf; + var arrayReduce = ArrayProto.reduce; + var arrayReduceRight = ArrayProto.reduceRight; + var arrayJoin = ArrayProto.join; + var arraySort = ArrayProto.sort; + var arraySlice = ArrayProto.slice; + var arrayToString = ArrayProto.toString; + var arrayToLocaleString = ArrayProto.toLocaleString; + var ITERATOR = wks('iterator'); + var TAG = wks('toStringTag'); + var TYPED_CONSTRUCTOR = uid('typed_constructor'); + var DEF_CONSTRUCTOR = uid('def_constructor'); + var ALL_CONSTRUCTORS = $typed.CONSTR; + var TYPED_ARRAY = $typed.TYPED; + var VIEW = $typed.VIEW; + var WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}); + }); + + var toOffset = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = allocate(C, length); + while (length > index) result[index] = list[index++]; + return result; + }; + + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal]; } }); + }; + + var $from = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iterFn = getIterFn(O); + var i, length, values, result, step, iterator; + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value); + } O = values; + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = allocate(this, length); + while (length > index) result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString() { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse() { + var that = this; + var length = validate(that).length; + var middle = Math.floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn) { + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end) { + var O = validate(this); + var length = O.length; + var $begin = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /* , offset */) { + validate(this); + var offset = toOffset(arguments[1], 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError(WRONG_LENGTH); + while (index < len) this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries() { + return arrayEntries.call(validate(this)); + }, + keys: function keys() { + return arrayKeys.call(validate(this)); + }, + values: function values() { + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function (target, key) { + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value; + return target; + } return dP(target, key, desc); + }; + + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if (fails(function () { arrayToString.call({}); })) { + arrayToString = arrayToLocaleString = function toString() { + return arrayJoin.call(this); + }; + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY]; } + }); + + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + KEY; + var SETTER = 'set' + KEY; + var TypedArray = global[NAME]; + var Base = TypedArray || {}; + var TAC = TypedArray && getPrototypeOf(TypedArray); + var FORCED = !TypedArray || !$typed.ABV; + var O = {}; + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function (that, index) { + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function (that, index, value) { + var data = that._d; + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d'); + var index = 0; + var offset = 0; + var buffer, byteLength, length, klass; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if (!fails(function () { + TypedArray(1); + }) || !fails(function () { + new TypedArray(-1); // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray(); // eslint-disable-line no-new + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(1.5); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)); + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR]; + var CORRECT_ITER_NAME = !!$nativeIterator + && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); + var $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }); + + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { + from: $from, + of: $of + }); + + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; + + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice(); + }), NAME, { slice: $slice }); + + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, { toLocaleString: $toLocaleString }); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function () { /* empty */ }; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +var Map = __webpack_require__(114); +var $export = __webpack_require__(0); +var shared = __webpack_require__(50)('metadata'); +var store = shared.store || (shared.store = new (__webpack_require__(117))()); + +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return undefined; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; +var toMetaKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function (O) { + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(35)('meta'); +var isObject = __webpack_require__(4); +var has = __webpack_require__(12); +var setDesc = __webpack_require__(6).f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__webpack_require__(3)(function () { + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); +}; +var fastKey = function (it, create) { + // return primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function (it, create) { + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = __webpack_require__(5)('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(13)(ArrayProto, UNSCOPABLES, {}); +module.exports = function (key) { + ArrayProto[UNSCOPABLES][key] = true; +}; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(19); +var call = __webpack_require__(108); +var isArrayIter = __webpack_require__(82); +var anObject = __webpack_require__(1); +var toLength = __webpack_require__(8); +var getIterFn = __webpack_require__(49); +var BREAK = {}; +var RETURN = {}; +var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); + var f = ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = call(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + +module.exports = false; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(24); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(98); +var hiddenKeys = __webpack_require__(70).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(20); +var TAG = __webpack_require__(5)('toStringTag'); +// ES3 wrong here +var ARG = cof(function () { return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } +}; + +module.exports = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var dP = __webpack_require__(6); +var DESCRIPTORS = __webpack_require__(7); +var SPECIES = __webpack_require__(5)('species'); + +module.exports = function (KEY) { + var C = global[KEY]; + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { + configurable: true, + get: function () { return this; } + }); +}; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports) { + +module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__(14); +module.exports = function (target, src, safe) { + for (var key in src) redefine(target, key, src[key], safe); + return target; +}; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(6).f; +var has = __webpack_require__(12); +var TAG = __webpack_require__(5)('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var defined = __webpack_require__(23); +var fails = __webpack_require__(3); +var spaces = __webpack_require__(75); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); + +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(20); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(39); +var ITERATOR = __webpack_require__(5)('iterator'); +var Iterators = __webpack_require__(40); +module.exports = __webpack_require__(18).getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); +module.exports = function (key) { + return store[key] || (store[key] = {}); +}; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(11); +var toLength = __webpack_require__(8); +var toAbsoluteIndex = __webpack_require__(37); +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(20); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.8 IsRegExp(argument) +var isObject = __webpack_require__(4); +var cof = __webpack_require__(20); +var MATCH = __webpack_require__(5)('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(36); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(14); +var hide = __webpack_require__(13); +var has = __webpack_require__(12); +var Iterators = __webpack_require__(40); +var $iterCreate = __webpack_require__(57); +var setToStringTag = __webpack_require__(44); +var getPrototypeOf = __webpack_require__(16); +var ITERATOR = __webpack_require__(5)('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var create = __webpack_require__(28); +var descriptor = __webpack_require__(31); +var setToStringTag = __webpack_require__(44); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(13)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +var ITERATOR = __webpack_require__(5)('iterator'); +var SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function () { SAFE_CLOSING = true; }; + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2; }); +} catch (e) { /* empty */ } + +module.exports = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + try { + var arr = [7]; + var iter = arr[ITERATOR](); + iter.next = function () { return { done: safe = true }; }; + arr[ITERATOR] = function () { return iter; }; + exec(arr); + } catch (e) { /* empty */ } + return safe; +}; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.2.5.3 get RegExp.prototype.flags +var anObject = __webpack_require__(1); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var hide = __webpack_require__(13); +var redefine = __webpack_require__(14); +var fails = __webpack_require__(3); +var defined = __webpack_require__(23); +var wks = __webpack_require__(5); + +module.exports = function (KEY, length, exec) { + var SYMBOL = wks(KEY); + var fns = exec(defined, SYMBOL, ''[KEY]); + var strfn = fns[0]; + var rxfn = fns[1]; + if (fails(function () { + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + })) { + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } +}; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(1); +var aFunction = __webpack_require__(10); +var SPECIES = __webpack_require__(5)('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(14); +var redefineAll = __webpack_require__(43); +var meta = __webpack_require__(32); +var forOf = __webpack_require__(34); +var anInstance = __webpack_require__(42); +var isObject = __webpack_require__(4); +var fails = __webpack_require__(3); +var $iterDetect = __webpack_require__(58); +var setToStringTag = __webpack_require__(44); +var inheritIfRequired = __webpack_require__(74); + +module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + var fixMethod = function (KEY) { + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function (a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a) { + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + if (!ACCEPT_ITERABLES) { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base(), target, C); + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && proto.clear) delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; +}; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var hide = __webpack_require__(13); +var uid = __webpack_require__(35); +var TYPED = uid('typed_array'); +var VIEW = uid('view'); +var ABV = !!(global.ArrayBuffer && global.DataView); +var CONSTR = ABV; +var i = 0; +var l = 9; +var Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// Forced replacement prototype accessors methods +module.exports = __webpack_require__(36) || !__webpack_require__(3)(function () { + var K = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }); + delete __webpack_require__(2)[K]; +}); + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(0); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { of: function of() { + var length = arguments.length; + var A = Array(length); + while (length--) A[length] = arguments[length]; + return new this(A); + } }); +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var ctx = __webpack_require__(19); +var forOf = __webpack_require__(34); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { + var mapFn = arguments[1]; + var mapping, A, n, cb; + aFunction(this); + mapping = mapFn !== undefined; + if (mapping) aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + if (mapping) { + n = 0; + cb = ctx(mapFn, arguments[2], 2); + forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)); + }); + } else { + forOf(source, false, A.push, A); + } + return new this(A); + } }); +}; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +var document = __webpack_require__(2).document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(18); +var LIBRARY = __webpack_require__(36); +var wksExt = __webpack_require__(96); +var defineProperty = __webpack_require__(6).f; +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); +}; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(50)('keys'); +var uid = __webpack_require__(35); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(2).document; +module.exports = document && document.documentElement; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = __webpack_require__(27); +var gOPS = __webpack_require__(52); +var pIE = __webpack_require__(48); +var toObject = __webpack_require__(9); +var IObject = __webpack_require__(47); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __webpack_require__(3)(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = gOPS.f; + var isEnum = pIE.f; + while (aLen > index) { + var S = IObject(arguments[index++]); + var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; +} : $assign; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = __webpack_require__(4); +var anObject = __webpack_require__(1); +var check = function (O, proto) { + anObject(O); + if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = __webpack_require__(19)(Function.call, __webpack_require__(15).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { buggy = true; } + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +var setPrototypeOf = __webpack_require__(73).set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; +}; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports) { + +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toInteger = __webpack_require__(24); +var defined = __webpack_require__(23); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; +}; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports) { + +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(24); +var defined = __webpack_require__(23); +// true -> String#at +// false -> String#codePointAt +module.exports = function (TO_STRING) { + return function (that, pos) { + var s = String(defined(that)); + var i = toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +// helper for String#{startsWith, endsWith, includes} +var isRegExp = __webpack_require__(55); +var defined = __webpack_require__(23); + +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +var MATCH = __webpack_require__(5)('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; +}; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(40); +var ITERATOR = __webpack_require__(5)('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $defineProperty = __webpack_require__(6); +var createDesc = __webpack_require__(31); + +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = __webpack_require__(213); + +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + +var toObject = __webpack_require__(9); +var toAbsoluteIndex = __webpack_require__(37); +var toLength = __webpack_require__(8); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(33); +var step = __webpack_require__(87); +var Iterators = __webpack_require__(40); +var toIObject = __webpack_require__(11); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = __webpack_require__(56)(Array, 'Array', function (iterated, kind) { + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return step(1); + } + if (kind == 'keys') return step(0, index); + if (kind == 'values') return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); + + +/***/ }), +/* 87 */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(19); +var invoke = __webpack_require__(54); +var html = __webpack_require__(71); +var cel = __webpack_require__(67); +var global = __webpack_require__(2); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (__webpack_require__(20)(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var macrotask = __webpack_require__(88).set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __webpack_require__(20)(process) == 'process'; + +module.exports = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if (Observer) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + var promise = Promise.resolve(); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __webpack_require__(10); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +// all object keys, includes non-enumerable and symbols +var gOPN = __webpack_require__(38); +var gOPS = __webpack_require__(52); +var anObject = __webpack_require__(1); +var Reflect = __webpack_require__(2).Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var DESCRIPTORS = __webpack_require__(7); +var LIBRARY = __webpack_require__(36); +var $typed = __webpack_require__(63); +var hide = __webpack_require__(13); +var redefineAll = __webpack_require__(43); +var fails = __webpack_require__(3); +var anInstance = __webpack_require__(42); +var toInteger = __webpack_require__(24); +var toLength = __webpack_require__(8); +var toIndex = __webpack_require__(119); +var gOPN = __webpack_require__(38).f; +var dP = __webpack_require__(6).f; +var arrayFill = __webpack_require__(85); +var setToStringTag = __webpack_require__(44); +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length!'; +var WRONG_INDEX = 'Wrong index!'; +var $ArrayBuffer = global[ARRAY_BUFFER]; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = global.Infinity; +var BaseBuffer = $ArrayBuffer; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; +var BUFFER = 'buffer'; +var BYTE_LENGTH = 'byteLength'; +var BYTE_OFFSET = 'byteOffset'; +var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; +var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; +var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +function packIEEE754(value, mLen, nBytes) { + var buffer = Array(nBytes); + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; + var i = 0; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + var e, m, c; + value = abs(value); + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if (value * (c = pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +} +function unpackIEEE754(buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = eLen - 7; + var i = nBytes - 1; + var s = buffer[i--]; + var e = s & 127; + var m; + s >>= 7; + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +} + +function unpackI32(bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +} +function packI8(it) { + return [it & 0xff]; +} +function packI16(it) { + return [it & 0xff, it >> 8 & 0xff]; +} +function packI32(it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +} +function packF64(it) { + return packIEEE754(it, 52, 8); +} +function packF32(it) { + return packIEEE754(it, 23, 4); +} + +function addGetter(C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); +} + +function get(view, bytes, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +} +function set(view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = conversion(+value); + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +} + +if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + this._b = arrayFill.call(Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH]; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if (!fails(function () { + $ArrayBuffer(1); + }) || !fails(function () { + new $ArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer(); // eslint-disable-line no-new + new $ArrayBuffer(1.5); // eslint-disable-line no-new + new $ArrayBuffer(NaN); // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new BaseBuffer(toIndex(length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var path = __webpack_require__(126); +var invoke = __webpack_require__(54); +var aFunction = __webpack_require__(10); +module.exports = function (/* ...pargs */) { + var fn = aFunction(this); + var length = arguments.length; + var pargs = Array(length); + var i = 0; + var _ = path._; + var holder = false; + while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; + return function (/* ...args */) { + var that = this; + var aLen = arguments.length; + var j = 0; + var k = 0; + var args; + if (!holder && !aLen) return invoke(fn, pargs, that); + args = pargs.slice(); + if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; + while (aLen > k) args.push(arguments[k++]); + return invoke(fn, args, that); + }; +}; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +module.exports = function (regExp, replace) { + var replacer = replace === Object(replace) ? function (part) { + return replace[part]; + } : replace; + return function (it) { + return String(it).replace(regExp, replacer); + }; +}; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(7) && !__webpack_require__(3)(function () { + return Object.defineProperty(__webpack_require__(67)('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(5); + + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(27); +var toIObject = __webpack_require__(11); +module.exports = function (object, el) { + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var index = 0; + var key; + while (length > index) if (O[key = keys[index++]] === el) return key; +}; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(12); +var toIObject = __webpack_require__(11); +var arrayIndexOf = __webpack_require__(51)(false); +var IE_PROTO = __webpack_require__(69)('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6); +var anObject = __webpack_require__(1); +var getKeys = __webpack_require__(27); + +module.exports = __webpack_require__(7) ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + return O; +}; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(11); +var gOPN = __webpack_require__(38).f; +var toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function (it) { + try { + return gOPN(it); + } catch (e) { + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var aFunction = __webpack_require__(10); +var isObject = __webpack_require__(4); +var invoke = __webpack_require__(54); +var arraySlice = [].slice; +var factories = {}; + +var construct = function (F, len, args) { + if (!(len in factories)) { + for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = arraySlice.call(arguments, 1); + var bound = function (/* args... */) { + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if (isObject(fn.prototype)) bound.prototype = fn.prototype; + return bound; +}; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +var cof = __webpack_require__(20); +module.exports = function (it, msg) { + if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); + return +it; +}; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var isObject = __webpack_require__(4); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseFloat = __webpack_require__(2).parseFloat; +var $trim = __webpack_require__(45).trim; + +module.exports = 1 / $parseFloat(__webpack_require__(75) + '-0') !== -Infinity ? function parseFloat(str) { + var string = $trim(String(str), 3); + var result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseInt = __webpack_require__(2).parseInt; +var $trim = __webpack_require__(45).trim; +var ws = __webpack_require__(75); +var hex = /^[-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports) { + +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var sign = __webpack_require__(77); +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); + +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; + +module.exports = Math.fround || function fround(x) { + var $abs = Math.abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(1); +module.exports = function (iterator, fn, value, entries) { + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) anObject(ret.call(iterator)); + throw e; + } +}; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__(10); +var toObject = __webpack_require__(9); +var IObject = __webpack_require__(47); +var toLength = __webpack_require__(8); + +module.exports = function (that, callbackfn, aLen, memo, isRight) { + aFunction(callbackfn); + var O = toObject(that); + var self = IObject(O); + var length = toLength(O.length); + var index = isRight ? length - 1 : 0; + var i = isRight ? -1 : 1; + if (aLen < 2) for (;;) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (isRight ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + +var toObject = __webpack_require__(9); +var toAbsoluteIndex = __webpack_require__(37); +var toLength = __webpack_require__(8); + +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +// 21.2.5.3 get RegExp.prototype.flags() +if (__webpack_require__(7) && /./g.flags != 'g') __webpack_require__(6).f(RegExp.prototype, 'flags', { + configurable: true, + get: __webpack_require__(59) +}); + + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +var newPromiseCapability = __webpack_require__(90); + +module.exports = function (C, x) { + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(115); +var validate = __webpack_require__(46); +var MAP = 'Map'; + +// 23.1 Map Objects +module.exports = __webpack_require__(62)(MAP, function (get) { + return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = strong.getEntry(validate(this, MAP), key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); + } +}, strong, true); + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var dP = __webpack_require__(6).f; +var create = __webpack_require__(28); +var redefineAll = __webpack_require__(43); +var ctx = __webpack_require__(19); +var anInstance = __webpack_require__(42); +var forOf = __webpack_require__(34); +var $iterDefine = __webpack_require__(56); +var step = __webpack_require__(87); +var setSpecies = __webpack_require__(41); +var DESCRIPTORS = __webpack_require__(7); +var fastKey = __webpack_require__(32).fastKey; +var validate = __webpack_require__(46); +var SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; + // frozen object case + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } +}; + +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = validate(this, NAME); + var entry = getEntry(that, key); + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + validate(this, NAME); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(validate(this, NAME), key); + } + }); + if (DESCRIPTORS) dP(C.prototype, 'size', { + get: function () { + return validate(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; + // change existing entry + if (entry) { + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; + // add to index + if (index !== 'F') that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function (iterated, kind) { + this._t = validate(iterated, NAME); // target + this._k = kind; // kind + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + // get next entry + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if (kind == 'keys') return step(0, entry.k); + if (kind == 'values') return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(115); +var validate = __webpack_require__(46); +var SET = 'Set'; + +// 23.2 Set Objects +module.exports = __webpack_require__(62)(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); + } +}, strong); + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var each = __webpack_require__(26)(0); +var redefine = __webpack_require__(14); +var meta = __webpack_require__(32); +var assign = __webpack_require__(72); +var weak = __webpack_require__(118); +var isObject = __webpack_require__(4); +var fails = __webpack_require__(3); +var validate = __webpack_require__(46); +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var tmp = {}; +var InternalMap; + +var wrapper = function (get) { + return function WeakMap() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}; + +var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + if (isObject(key)) { + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return weak.def(validate(this, WEAK_MAP), key, value); + } +}; + +// 23.3 WeakMap Objects +var $WeakMap = module.exports = __webpack_require__(62)(WEAK_MAP, wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + InternalMap = weak.getConstructor(wrapper, WEAK_MAP); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function (key) { + var proto = $WeakMap.prototype; + var method = proto[key]; + redefine(proto, key, function (a, b) { + // store frozen objects on internal weakmap shim + if (isObject(a) && !isExtensible(a)) { + if (!this._f) this._f = new InternalMap(); + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); +} + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefineAll = __webpack_require__(43); +var getWeak = __webpack_require__(32).getWeak; +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(4); +var anInstance = __webpack_require__(42); +var forOf = __webpack_require__(34); +var createArrayMethod = __webpack_require__(26); +var $has = __webpack_require__(12); +var validate = __webpack_require__(46); +var arrayFind = createArrayMethod(5); +var arrayFindIndex = createArrayMethod(6); +var id = 0; + +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function (that) { + return that._l || (that._l = new UncaughtFrozenStore()); +}; +var UncaughtFrozenStore = function () { + this.a = []; +}; +var findUncaughtFrozen = function (store, key) { + return arrayFind(store.a, function (it) { + return it[0] === key; + }); +}; +UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function (key) { + var index = arrayFindIndex(this.a, function (it) { + return it[0] === key; + }); + if (~index) this.a.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + if (!isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + if (!isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function (that, key, value) { + var data = getWeak(anObject(key), true); + if (data === true) uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore +}; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/ecma262/#sec-toindex +var toInteger = __webpack_require__(24); +var toLength = __webpack_require__(8); +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length!'); + return length; +}; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var isArray = __webpack_require__(53); +var isObject = __webpack_require__(4); +var toLength = __webpack_require__(8); +var ctx = __webpack_require__(19); +var IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable'); + +function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; + var element, spreadable; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + spreadable = false; + if (isObject(element)) { + spreadable = element[IS_CONCAT_SPREADABLE]; + spreadable = spreadable !== undefined ? !!spreadable : isArray(element); + } + + if (spreadable && depth > 0) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1fffffffffffff) throw TypeError(); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; +} + +module.exports = flattenIntoArray; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = __webpack_require__(8); +var repeat = __webpack_require__(76); +var defined = __webpack_require__(23); + +module.exports = function (that, maxLength, fillString, left) { + var S = String(defined(that)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + if (intMaxLength <= stringLength || fillStr == '') return S; + var fillLen = intMaxLength - stringLength; + var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(27); +var toIObject = __webpack_require__(11); +var isEnum = __webpack_require__(48).f; +module.exports = function (isEntries) { + return function (it) { + var O = toIObject(it); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) if (isEnum.call(O, key = keys[i++])) { + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = __webpack_require__(39); +var from = __webpack_require__(124); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +var forOf = __webpack_require__(34); + +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports) { + +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + // eslint-disable-next-line no-self-compare + || x != x + // eslint-disable-next-line no-self-compare + || inLow != inLow + // eslint-disable-next-line no-self-compare + || inHigh != inHigh + // eslint-disable-next-line no-self-compare + || outLow != outLow + // eslint-disable-next-line no-self-compare + || outHigh != outHigh + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(2); + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(39); +var ITERATOR = __webpack_require__(5)('iterator'); +var Iterators = __webpack_require__(40); +module.exports = __webpack_require__(18).isIterable = function (it) { + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + // eslint-disable-next-line no-prototype-builtins + || Iterators.hasOwnProperty(classof(O)); +}; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6); +var gOPD = __webpack_require__(15); +var ownKeys = __webpack_require__(91); +var toIObject = __webpack_require__(11); + +module.exports = function define(target, mixin) { + var keys = ownKeys(toIObject(mixin)); + var length = keys.length; + var i = 0; + var key; + while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; +}; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(130); +__webpack_require__(132); +__webpack_require__(133); +__webpack_require__(134); +__webpack_require__(135); +__webpack_require__(136); +__webpack_require__(137); +__webpack_require__(138); +__webpack_require__(139); +__webpack_require__(140); +__webpack_require__(141); +__webpack_require__(142); +__webpack_require__(143); +__webpack_require__(144); +__webpack_require__(145); +__webpack_require__(146); +__webpack_require__(148); +__webpack_require__(149); +__webpack_require__(150); +__webpack_require__(151); +__webpack_require__(152); +__webpack_require__(153); +__webpack_require__(154); +__webpack_require__(155); +__webpack_require__(156); +__webpack_require__(157); +__webpack_require__(158); +__webpack_require__(159); +__webpack_require__(160); +__webpack_require__(161); +__webpack_require__(162); +__webpack_require__(163); +__webpack_require__(164); +__webpack_require__(165); +__webpack_require__(166); +__webpack_require__(167); +__webpack_require__(168); +__webpack_require__(169); +__webpack_require__(170); +__webpack_require__(171); +__webpack_require__(172); +__webpack_require__(173); +__webpack_require__(174); +__webpack_require__(175); +__webpack_require__(176); +__webpack_require__(177); +__webpack_require__(178); +__webpack_require__(179); +__webpack_require__(180); +__webpack_require__(181); +__webpack_require__(182); +__webpack_require__(183); +__webpack_require__(184); +__webpack_require__(185); +__webpack_require__(186); +__webpack_require__(187); +__webpack_require__(188); +__webpack_require__(189); +__webpack_require__(190); +__webpack_require__(191); +__webpack_require__(192); +__webpack_require__(193); +__webpack_require__(194); +__webpack_require__(195); +__webpack_require__(196); +__webpack_require__(197); +__webpack_require__(198); +__webpack_require__(199); +__webpack_require__(200); +__webpack_require__(201); +__webpack_require__(202); +__webpack_require__(203); +__webpack_require__(204); +__webpack_require__(205); +__webpack_require__(206); +__webpack_require__(207); +__webpack_require__(208); +__webpack_require__(209); +__webpack_require__(210); +__webpack_require__(211); +__webpack_require__(212); +__webpack_require__(214); +__webpack_require__(215); +__webpack_require__(216); +__webpack_require__(217); +__webpack_require__(218); +__webpack_require__(219); +__webpack_require__(220); +__webpack_require__(221); +__webpack_require__(222); +__webpack_require__(223); +__webpack_require__(224); +__webpack_require__(225); +__webpack_require__(86); +__webpack_require__(226); +__webpack_require__(227); +__webpack_require__(228); +__webpack_require__(111); +__webpack_require__(229); +__webpack_require__(230); +__webpack_require__(231); +__webpack_require__(232); +__webpack_require__(233); +__webpack_require__(114); +__webpack_require__(116); +__webpack_require__(117); +__webpack_require__(234); +__webpack_require__(235); +__webpack_require__(236); +__webpack_require__(237); +__webpack_require__(238); +__webpack_require__(239); +__webpack_require__(240); +__webpack_require__(241); +__webpack_require__(242); +__webpack_require__(243); +__webpack_require__(244); +__webpack_require__(245); +__webpack_require__(246); +__webpack_require__(247); +__webpack_require__(248); +__webpack_require__(249); +__webpack_require__(250); +__webpack_require__(251); +__webpack_require__(253); +__webpack_require__(254); +__webpack_require__(256); +__webpack_require__(257); +__webpack_require__(258); +__webpack_require__(259); +__webpack_require__(260); +__webpack_require__(261); +__webpack_require__(262); +__webpack_require__(263); +__webpack_require__(264); +__webpack_require__(265); +__webpack_require__(266); +__webpack_require__(267); +__webpack_require__(268); +__webpack_require__(269); +__webpack_require__(270); +__webpack_require__(271); +__webpack_require__(272); +__webpack_require__(273); +__webpack_require__(274); +__webpack_require__(275); +__webpack_require__(276); +__webpack_require__(277); +__webpack_require__(278); +__webpack_require__(279); +__webpack_require__(280); +__webpack_require__(281); +__webpack_require__(282); +__webpack_require__(283); +__webpack_require__(284); +__webpack_require__(285); +__webpack_require__(286); +__webpack_require__(287); +__webpack_require__(288); +__webpack_require__(289); +__webpack_require__(290); +__webpack_require__(291); +__webpack_require__(292); +__webpack_require__(293); +__webpack_require__(294); +__webpack_require__(295); +__webpack_require__(296); +__webpack_require__(297); +__webpack_require__(298); +__webpack_require__(299); +__webpack_require__(300); +__webpack_require__(301); +__webpack_require__(302); +__webpack_require__(303); +__webpack_require__(304); +__webpack_require__(305); +__webpack_require__(306); +__webpack_require__(307); +__webpack_require__(308); +__webpack_require__(309); +__webpack_require__(310); +__webpack_require__(311); +__webpack_require__(312); +__webpack_require__(313); +__webpack_require__(314); +__webpack_require__(315); +__webpack_require__(316); +__webpack_require__(317); +__webpack_require__(318); +__webpack_require__(319); +__webpack_require__(320); +__webpack_require__(321); +__webpack_require__(322); +__webpack_require__(323); +__webpack_require__(324); +__webpack_require__(325); +__webpack_require__(326); +__webpack_require__(49); +__webpack_require__(327); +__webpack_require__(127); +__webpack_require__(328); +__webpack_require__(329); +__webpack_require__(330); +__webpack_require__(331); +__webpack_require__(332); +__webpack_require__(333); +__webpack_require__(334); +__webpack_require__(335); +__webpack_require__(336); +module.exports = __webpack_require__(337); + + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(2); +var has = __webpack_require__(12); +var DESCRIPTORS = __webpack_require__(7); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(14); +var META = __webpack_require__(32).KEY; +var $fails = __webpack_require__(3); +var shared = __webpack_require__(50); +var setToStringTag = __webpack_require__(44); +var uid = __webpack_require__(35); +var wks = __webpack_require__(5); +var wksExt = __webpack_require__(96); +var wksDefine = __webpack_require__(68); +var keyOf = __webpack_require__(97); +var enumKeys = __webpack_require__(131); +var isArray = __webpack_require__(53); +var anObject = __webpack_require__(1); +var toIObject = __webpack_require__(11); +var toPrimitive = __webpack_require__(22); +var createDesc = __webpack_require__(31); +var _create = __webpack_require__(28); +var gOPNExt = __webpack_require__(100); +var $GOPD = __webpack_require__(15); +var $DP = __webpack_require__(6); +var $keys = __webpack_require__(27); +var gOPD = $GOPD.f; +var dP = $DP.f; +var gOPN = gOPNExt.f; +var $Symbol = global.Symbol; +var $JSON = global.JSON; +var _stringify = $JSON && $JSON.stringify; +var PROTOTYPE = 'prototype'; +var HIDDEN = wks('_hidden'); +var TO_PRIMITIVE = wks('toPrimitive'); +var isEnum = {}.propertyIsEnumerable; +var SymbolRegistry = shared('symbol-registry'); +var AllSymbols = shared('symbols'); +var OPSymbols = shared('op-symbols'); +var ObjectProto = Object[PROTOTYPE]; +var USE_NATIVE = typeof $Symbol == 'function'; +var QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function () { + return _create(dP({}, 'a', { + get: function () { return dP(this, 'a', { value: 7 }).a; } + })).a != 7; +}) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto, key); + if (protoDesc) delete ObjectProto[key]; + dP(it, key, D); + if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function (tag) { + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto) $defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if (has(AllSymbols, key)) { + if (!D.enumerable) { + if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _create(D, { enumerable: createDesc(0, false) }); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P) { + anObject(it); + var keys = enumKeys(P = toIObject(P)); + var i = 0; + var l = keys.length; + var key; + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P) { + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = toPrimitive(key, true)); + if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = toIObject(it); + key = toPrimitive(key, true); + if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto; + var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if (!USE_NATIVE) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function (value) { + if (this === ObjectProto) $set.call(OPSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(38).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(48).f = $propertyIsEnumerable; + __webpack_require__(52).f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !__webpack_require__(36)) { + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function (name) { + return wrap(wks(name)); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); + +for (var es6Symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); + +for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key) { + if (isSymbol(key)) return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function () { setter = true; }, + useSimple: function () { setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it) { + if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + var args = [it]; + var i = 1; + var replacer, $replacer; + while (arguments.length > i) args.push(arguments[i++]); + replacer = args[1]; + if (typeof replacer == 'function') $replacer = replacer; + if ($replacer || !isArray(replacer)) replacer = function (key, value) { + if ($replacer) value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(13)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(27); +var gOPS = __webpack_require__(52); +var pIE = __webpack_require__(48); +module.exports = function (it) { + var result = getKeys(it); + var getSymbols = gOPS.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = pIE.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; +}; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(6).f }); + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperties: __webpack_require__(99) }); + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = __webpack_require__(11); +var $getOwnPropertyDescriptor = __webpack_require__(15).f; + +__webpack_require__(25)('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: __webpack_require__(28) }); + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = __webpack_require__(9); +var $getPrototypeOf = __webpack_require__(16); + +__webpack_require__(25)('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); + }; +}); + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(9); +var $keys = __webpack_require__(27); + +__webpack_require__(25)('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 Object.getOwnPropertyNames(O) +__webpack_require__(25)('getOwnPropertyNames', function () { + return __webpack_require__(100).f; +}); + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.5 Object.freeze(O) +var isObject = __webpack_require__(4); +var meta = __webpack_require__(32).onFreeze; + +__webpack_require__(25)('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.17 Object.seal(O) +var isObject = __webpack_require__(4); +var meta = __webpack_require__(32).onFreeze; + +__webpack_require__(25)('seal', function ($seal) { + return function seal(it) { + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.15 Object.preventExtensions(O) +var isObject = __webpack_require__(4); +var meta = __webpack_require__(32).onFreeze; + +__webpack_require__(25)('preventExtensions', function ($preventExtensions) { + return function preventExtensions(it) { + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.12 Object.isFrozen(O) +var isObject = __webpack_require__(4); + +__webpack_require__(25)('isFrozen', function ($isFrozen) { + return function isFrozen(it) { + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.13 Object.isSealed(O) +var isObject = __webpack_require__(4); + +__webpack_require__(25)('isSealed', function ($isSealed) { + return function isSealed(it) { + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.11 Object.isExtensible(O) +var isObject = __webpack_require__(4); + +__webpack_require__(25)('isExtensible', function ($isExtensible) { + return function isExtensible(it) { + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { assign: __webpack_require__(72) }); + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.10 Object.is(value1, value2) +var $export = __webpack_require__(0); +$export($export.S, 'Object', { is: __webpack_require__(147) }); + + +/***/ }), +/* 147 */ +/***/ (function(module, exports) { + +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __webpack_require__(0); +$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(73).set }); + + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.3.6 Object.prototype.toString() +var classof = __webpack_require__(39); +var test = {}; +test[__webpack_require__(5)('toStringTag')] = 'z'; +if (test + '' != '[object z]') { + __webpack_require__(14)(Object.prototype, 'toString', function toString() { + return '[object ' + classof(this) + ']'; + }, true); +} + + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = __webpack_require__(0); + +$export($export.P, 'Function', { bind: __webpack_require__(101) }); + + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6).f; +var FProto = Function.prototype; +var nameRE = /^\s*function ([^ (]*)/; +var NAME = 'name'; + +// 19.2.4.2 name +NAME in FProto || __webpack_require__(7) && dP(FProto, NAME, { + configurable: true, + get: function () { + try { + return ('' + this).match(nameRE)[1]; + } catch (e) { + return ''; + } + } +}); + + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var isObject = __webpack_require__(4); +var getPrototypeOf = __webpack_require__(16); +var HAS_INSTANCE = __webpack_require__(5)('hasInstance'); +var FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(6).f(FunctionProto, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; +} }); + + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var has = __webpack_require__(12); +var cof = __webpack_require__(20); +var inheritIfRequired = __webpack_require__(74); +var toPrimitive = __webpack_require__(22); +var fails = __webpack_require__(3); +var gOPN = __webpack_require__(38).f; +var gOPD = __webpack_require__(15).f; +var dP = __webpack_require__(6).f; +var $trim = __webpack_require__(45).trim; +var NUMBER = 'Number'; +var $Number = global[NUMBER]; +var Base = $Number; +var proto = $Number.prototype; +// Opera ~12 has broken Object#toString +var BROKEN_COF = cof(__webpack_require__(28)(proto)) == NUMBER; +var TRIM = 'trim' in String.prototype; + +// 7.1.3 ToNumber(argument) +var toNumber = function (argument) { + var it = toPrimitive(argument, false); + if (typeof it == 'string' && it.length > 2) { + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0); + var third, radix, maxCode; + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default: return +it; + } + for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { + $Number = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for (var keys = __webpack_require__(7) ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++) { + if (has(Base, key = keys[j]) && !has($Number, key)) { + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + __webpack_require__(14)(global, NUMBER, $Number); +} + + +/***/ }), +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toInteger = __webpack_require__(24); +var aNumberValue = __webpack_require__(102); +var repeat = __webpack_require__(76); +var $toFixed = 1.0.toFixed; +var floor = Math.floor; +var data = [0, 0, 0, 0, 0, 0]; +var ERROR = 'Number.toFixed: incorrect invocation!'; +var ZERO = '0'; + +var multiply = function (n, c) { + var i = -1; + var c2 = c; + while (++i < 6) { + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function (n) { + var i = 6; + var c = 0; + while (--i >= 0) { + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function () { + var i = 6; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || data[i] !== 0) { + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !__webpack_require__(3)(function () { + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits) { + var x = aNumberValue(this, ERROR); + var f = toInteger(fractionDigits); + var s = ''; + var m = ZERO; + var e, z, j, k; + if (f < 0 || f > 20) throw RangeError(ERROR); + // eslint-disable-next-line no-self-compare + if (x != x) return 'NaN'; + if (x <= -1e21 || x >= 1e21) return String(x); + if (x < 0) { + s = '-'; + x = -x; + } + if (x > 1e-21) { + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = f; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if (f > 0) { + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); + + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $fails = __webpack_require__(3); +var aNumberValue = __webpack_require__(102); +var $toPrecision = 1.0.toPrecision; + +$export($export.P + $export.F * ($fails(function () { + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function () { + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision) { + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); + + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.1 Number.EPSILON +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.2 Number.isFinite(number) +var $export = __webpack_require__(0); +var _isFinite = __webpack_require__(2).isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it) { + return typeof it == 'number' && _isFinite(it); + } +}); + + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { isInteger: __webpack_require__(103) }); + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.4 Number.isNaN(number) +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; + } +}); + + +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.5 Number.isSafeInteger(number) +var $export = __webpack_require__(0); +var isInteger = __webpack_require__(103); +var abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); + + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); + + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseFloat = __webpack_require__(104); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); + + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseInt = __webpack_require__(105); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); + + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseInt = __webpack_require__(105); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); + + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseFloat = __webpack_require__(104); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); + + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.3 Math.acosh(x) +var $export = __webpack_require__(0); +var log1p = __webpack_require__(106); +var sqrt = Math.sqrt; +var $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); + + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.5 Math.asinh(x) +var $export = __webpack_require__(0); +var $asinh = Math.asinh; + +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.7 Math.atanh(x) +var $export = __webpack_require__(0); +var $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.9 Math.cbrt(x) +var $export = __webpack_require__(0); +var sign = __webpack_require__(77); + +$export($export.S, 'Math', { + cbrt: function cbrt(x) { + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.11 Math.clz32(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.12 Math.cosh(x) +var $export = __webpack_require__(0); +var exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x) { + return (exp(x = +x) + exp(-x)) / 2; + } +}); + + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.14 Math.expm1(x) +var $export = __webpack_require__(0); +var $expm1 = __webpack_require__(78); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); + + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { fround: __webpack_require__(107) }); + + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = __webpack_require__(0); +var abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.18 Math.imul(x, y) +var $export = __webpack_require__(0); +var $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * __webpack_require__(3)(function () { + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y) { + var UINT16 = 0xffff; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); + + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.21 Math.log10(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + log10: function log10(x) { + return Math.log(x) * Math.LOG10E; + } +}); + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.20 Math.log1p(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { log1p: __webpack_require__(106) }); + + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.22 Math.log2(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + log2: function log2(x) { + return Math.log(x) / Math.LN2; + } +}); + + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.28 Math.sign(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { sign: __webpack_require__(77) }); + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.30 Math.sinh(x) +var $export = __webpack_require__(0); +var expm1 = __webpack_require__(78); +var exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * __webpack_require__(3)(function () { + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x) { + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.33 Math.tanh(x) +var $export = __webpack_require__(0); +var expm1 = __webpack_require__(78); +var exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.34 Math.trunc(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + trunc: function trunc(it) { + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); + + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var toAbsoluteIndex = __webpack_require__(37); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var toLength = __webpack_require__(8); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.1.3.25 String.prototype.trim() +__webpack_require__(45)('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); + + +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $at = __webpack_require__(79)(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); + + +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + +var $export = __webpack_require__(0); +var toLength = __webpack_require__(8); +var context = __webpack_require__(80); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * __webpack_require__(81)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); + + +/***/ }), +/* 189 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.7 String.prototype.includes(searchString, position = 0) + +var $export = __webpack_require__(0); +var context = __webpack_require__(80); +var INCLUDES = 'includes'; + +$export($export.P + $export.F * __webpack_require__(81)(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(76) +}); + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + +var $export = __webpack_require__(0); +var toLength = __webpack_require__(8); +var context = __webpack_require__(80); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * __webpack_require__(81)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(79)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(56)(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; +}); + + +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.2 String.prototype.anchor(name) +__webpack_require__(17)('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; +}); + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.3 String.prototype.big() +__webpack_require__(17)('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); + + +/***/ }), +/* 195 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.4 String.prototype.blink() +__webpack_require__(17)('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.5 String.prototype.bold() +__webpack_require__(17)('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.6 String.prototype.fixed() +__webpack_require__(17)('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); + + +/***/ }), +/* 198 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.7 String.prototype.fontcolor(color) +__webpack_require__(17)('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); + + +/***/ }), +/* 199 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.8 String.prototype.fontsize(size) +__webpack_require__(17)('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); + + +/***/ }), +/* 200 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.9 String.prototype.italics() +__webpack_require__(17)('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); + + +/***/ }), +/* 201 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.10 String.prototype.link(url) +__webpack_require__(17)('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); + + +/***/ }), +/* 202 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.11 String.prototype.small() +__webpack_require__(17)('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.12 String.prototype.strike() +__webpack_require__(17)('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); + + +/***/ }), +/* 204 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.13 String.prototype.sub() +__webpack_require__(17)('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.14 String.prototype.sup() +__webpack_require__(17)('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); + + +/***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = __webpack_require__(0); + +$export($export.S, 'Array', { isArray: __webpack_require__(53) }); + + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(19); +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var call = __webpack_require__(108); +var isArrayIter = __webpack_require__(82); +var toLength = __webpack_require__(8); +var createProperty = __webpack_require__(83); +var getIterFn = __webpack_require__(49); + +$export($export.S + $export.F * !__webpack_require__(58)(function (iter) { Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iterFn = getIterFn(O); + var length, result, step, iterator; + if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for (result = new C(length); length > index; index++) { + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } +}); + + +/***/ }), +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var createProperty = __webpack_require__(83); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * __webpack_require__(3)(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */) { + var index = 0; + var aLen = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(aLen); + while (aLen > index) createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); + + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.13 Array.prototype.join(separator) +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (__webpack_require__(47) != Object || !__webpack_require__(21)(arrayJoin)), 'Array', { + join: function join(separator) { + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); + + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var html = __webpack_require__(71); +var cof = __webpack_require__(20); +var toAbsoluteIndex = __webpack_require__(37); +var toLength = __webpack_require__(8); +var arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * __webpack_require__(3)(function () { + if (html) arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end) { + var len = toLength(this.length); + var klass = cof(this); + end = end === undefined ? len : end; + if (klass == 'Array') return arraySlice.call(this, begin, end); + var start = toAbsoluteIndex(begin, len); + var upTo = toAbsoluteIndex(end, len); + var size = toLength(upTo - start); + var cloned = Array(size); + var i = 0; + for (; i < size; i++) cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); + + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var toObject = __webpack_require__(9); +var fails = __webpack_require__(3); +var $sort = [].sort; +var test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function () { + // IE8- + test.sort(undefined); +}) || !fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !__webpack_require__(21)($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $forEach = __webpack_require__(26)(0); +var STRICT = __webpack_require__(21)([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +var isArray = __webpack_require__(53); +var SPECIES = __webpack_require__(5)('species'); + +module.exports = function (original) { + var C; + if (isArray(original)) { + C = original.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return C === undefined ? Array : C; +}; + + +/***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $map = __webpack_require__(26)(1); + +$export($export.P + $export.F * !__webpack_require__(21)([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 215 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $filter = __webpack_require__(26)(2); + +$export($export.P + $export.F * !__webpack_require__(21)([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 216 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $some = __webpack_require__(26)(3); + +$export($export.P + $export.F * !__webpack_require__(21)([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 217 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $every = __webpack_require__(26)(4); + +$export($export.P + $export.F * !__webpack_require__(21)([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 218 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $reduce = __webpack_require__(109); + +$export($export.P + $export.F * !__webpack_require__(21)([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); + + +/***/ }), +/* 219 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $reduce = __webpack_require__(109); + +$export($export.P + $export.F * !__webpack_require__(21)([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); + + +/***/ }), +/* 220 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $indexOf = __webpack_require__(51)(false); +var $native = [].indexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(21)($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); + + +/***/ }), +/* 221 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var toInteger = __webpack_require__(24); +var toLength = __webpack_require__(8); +var $native = [].lastIndexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(21)($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; + var O = toIObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; + return -1; + } +}); + + +/***/ }), +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = __webpack_require__(0); + +$export($export.P, 'Array', { copyWithin: __webpack_require__(110) }); + +__webpack_require__(33)('copyWithin'); + + +/***/ }), +/* 223 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = __webpack_require__(0); + +$export($export.P, 'Array', { fill: __webpack_require__(85) }); + +__webpack_require__(33)('fill'); + + +/***/ }), +/* 224 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = __webpack_require__(0); +var $find = __webpack_require__(26)(5); +var KEY = 'find'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(33)(KEY); + + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = __webpack_require__(0); +var $find = __webpack_require__(26)(6); +var KEY = 'findIndex'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(33)(KEY); + + +/***/ }), +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(41)('Array'); + + +/***/ }), +/* 227 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var inheritIfRequired = __webpack_require__(74); +var dP = __webpack_require__(6).f; +var gOPN = __webpack_require__(38).f; +var isRegExp = __webpack_require__(55); +var $flags = __webpack_require__(59); +var $RegExp = global.RegExp; +var Base = $RegExp; +var proto = $RegExp.prototype; +var re1 = /a/g; +var re2 = /a/g; +// "new" creates a new object, old webkit buggy here +var CORRECT_NEW = new $RegExp(re1) !== re1; + +if (__webpack_require__(7) && (!CORRECT_NEW || __webpack_require__(3)(function () { + re2[__webpack_require__(5)('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; +}))) { + $RegExp = function RegExp(p, f) { + var tiRE = this instanceof $RegExp; + var piRE = isRegExp(p); + var fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function (key) { + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function () { return Base[key]; }, + set: function (it) { Base[key] = it; } + }); + }; + for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + __webpack_require__(14)(global, 'RegExp', $RegExp); +} + +__webpack_require__(41)('RegExp'); + + +/***/ }), +/* 228 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(111); +var anObject = __webpack_require__(1); +var $flags = __webpack_require__(59); +var DESCRIPTORS = __webpack_require__(7); +var TO_STRING = 'toString'; +var $toString = /./[TO_STRING]; + +var define = function (fn) { + __webpack_require__(14)(RegExp.prototype, TO_STRING, fn, true); +}; + +// 21.2.5.14 RegExp.prototype.toString() +if (__webpack_require__(3)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { + define(function toString() { + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if ($toString.name != TO_STRING) { + define(function toString() { + return $toString.call(this); + }); +} + + +/***/ }), +/* 229 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@match logic +__webpack_require__(60)('match', 1, function (defined, MATCH, $match) { + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; +}); + + +/***/ }), +/* 230 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@replace logic +__webpack_require__(60)('replace', 2, function (defined, REPLACE, $replace) { + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue) { + 'use strict'; + var O = defined(this); + var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; +}); + + +/***/ }), +/* 231 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@search logic +__webpack_require__(60)('search', 1, function (defined, SEARCH, $search) { + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; +}); + + +/***/ }), +/* 232 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@split logic +__webpack_require__(60)('split', 2, function (defined, SPLIT, $split) { + 'use strict'; + var isRegExp = __webpack_require__(55); + var _split = $split; + var $push = [].push; + var $SPLIT = 'split'; + var LENGTH = 'length'; + var LAST_INDEX = 'lastIndex'; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while (match = separatorCopy.exec(string)) { + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + // eslint-disable-next-line no-loop-func + if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { + for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; + }); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + $split = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit) { + var O = defined(this); + var fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; +}); + + +/***/ }), +/* 233 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(36); +var global = __webpack_require__(2); +var ctx = __webpack_require__(19); +var classof = __webpack_require__(39); +var $export = __webpack_require__(0); +var isObject = __webpack_require__(4); +var aFunction = __webpack_require__(10); +var anInstance = __webpack_require__(42); +var forOf = __webpack_require__(34); +var speciesConstructor = __webpack_require__(61); +var task = __webpack_require__(88).set; +var microtask = __webpack_require__(89)(); +var newPromiseCapabilityModule = __webpack_require__(90); +var perform = __webpack_require__(112); +var promiseResolve = __webpack_require__(113); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; + +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch (e) { /* empty */ } +}(); + +// helpers +var sameConstructor = LIBRARY ? function (a, b) { + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; +} : function (a, b) { + return a === b; +}; +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); + if (domain) domain.exit(); + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + if (promise._h == 1) return false; + var chain = promise._a || promise._c; + var i = 0; + var reaction; + while (chain.length > i) { + reaction = chain[i++]; + if (reaction.fail || !isUnhandled(reaction.promise)) return false; + } return true; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); +}; +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } +}; + +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(43)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return sameConstructor($Promise, C) + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +__webpack_require__(44)($Promise, PROMISE); +__webpack_require__(41)(PROMISE); +Wrapper = __webpack_require__(18)[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if (x instanceof $Promise && sameConstructor(x.constructor, this)) return x; + return promiseResolve(this, x); + } +}); +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(58)(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } +}); + + +/***/ }), +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var weak = __webpack_require__(118); +var validate = __webpack_require__(46); +var WEAK_SET = 'WeakSet'; + +// 23.4 WeakSet Objects +__webpack_require__(62)(WEAK_SET, function (get) { + return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value) { + return weak.def(validate(this, WEAK_SET), value, true); + } +}, weak, false, true); + + +/***/ }), +/* 235 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var rApply = (__webpack_require__(2).Reflect || {}).apply; +var fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !__webpack_require__(3)(function () { + rApply(function () { /* empty */ }); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList) { + var T = aFunction(target); + var L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); + + +/***/ }), +/* 236 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = __webpack_require__(0); +var create = __webpack_require__(28); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(4); +var fails = __webpack_require__(3); +var bind = __webpack_require__(101); +var rConstruct = (__webpack_require__(2).Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + rConstruct(function () { /* empty */ }); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); + + +/***/ }), +/* 237 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = __webpack_require__(6); +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var toPrimitive = __webpack_require__(22); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * __webpack_require__(3)(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 238 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = __webpack_require__(0); +var gOPD = __webpack_require__(15).f; +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey) { + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); + + +/***/ }), +/* 239 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 26.1.5 Reflect.enumerate(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var Enumerate = function (iterated) { + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = []; // keys + var key; + for (key in iterated) keys.push(key); +}; +__webpack_require__(57)(Enumerate, 'Object', function () { + var that = this; + var keys = that._k; + var key; + do { + if (that._i >= keys.length) return { value: undefined, done: true }; + } while (!((key = keys[that._i++]) in that._t)); + return { value: key, done: false }; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target) { + return new Enumerate(target); + } +}); + + +/***/ }), +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = __webpack_require__(15); +var getPrototypeOf = __webpack_require__(16); +var has = __webpack_require__(12); +var $export = __webpack_require__(0); +var isObject = __webpack_require__(4); +var anObject = __webpack_require__(1); + +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var desc, proto; + if (anObject(target) === receiver) return target[propertyKey]; + if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', { get: get }); + + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = __webpack_require__(15); +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return gOPD.f(anObject(target), propertyKey); + } +}); + + +/***/ }), +/* 242 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = __webpack_require__(0); +var getProto = __webpack_require__(16); +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target) { + return getProto(anObject(target)); + } +}); + + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.9 Reflect.has(target, propertyKey) +var $export = __webpack_require__(0); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.10 Reflect.isExtensible(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target) { + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); + + +/***/ }), +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.11 Reflect.ownKeys(target) +var $export = __webpack_require__(0); + +$export($export.S, 'Reflect', { ownKeys: __webpack_require__(91) }); + + +/***/ }), +/* 246 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.12 Reflect.preventExtensions(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + if ($preventExtensions) $preventExtensions(target); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 247 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = __webpack_require__(6); +var gOPD = __webpack_require__(15); +var getPrototypeOf = __webpack_require__(16); +var has = __webpack_require__(12); +var $export = __webpack_require__(0); +var createDesc = __webpack_require__(31); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(4); + +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDesc = gOPD.f(anObject(target), propertyKey); + var existingDescriptor, proto; + if (!ownDesc) { + if (isObject(proto = getPrototypeOf(target))) { + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if (has(ownDesc, 'value')) { + if (ownDesc.writable === false || !isObject(receiver)) return false; + existingDescriptor = gOPD.f(receiver, propertyKey) || createDesc(0); + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', { set: set }); + + +/***/ }), +/* 248 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = __webpack_require__(0); +var setProto = __webpack_require__(73); + +if (setProto) $export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto) { + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = __webpack_require__(0); + +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); + + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(22); + +$export($export.P + $export.F * __webpack_require__(3)(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); + + +/***/ }), +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = __webpack_require__(0); +var toISOString = __webpack_require__(252); + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { + toISOString: toISOString +}); + + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var fails = __webpack_require__(3); +var getTime = Date.prototype.getTime; +var $toISOString = Date.prototype.toISOString; + +var lz = function (num) { + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +module.exports = (fails(function () { + return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + $toISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var d = this; + var y = d.getUTCFullYear(); + var m = d.getUTCMilliseconds(); + var s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; +} : $toISOString; + + +/***/ }), +/* 253 */ +/***/ (function(module, exports, __webpack_require__) { + +var DateProto = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var $toString = DateProto[TO_STRING]; +var getTime = DateProto.getTime; +if (new Date(NaN) + '' != INVALID_DATE) { + __webpack_require__(14)(DateProto, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare + return value === value ? $toString.call(this) : INVALID_DATE; + }); +} + + +/***/ }), +/* 254 */ +/***/ (function(module, exports, __webpack_require__) { + +var TO_PRIMITIVE = __webpack_require__(5)('toPrimitive'); +var proto = Date.prototype; + +if (!(TO_PRIMITIVE in proto)) __webpack_require__(13)(proto, TO_PRIMITIVE, __webpack_require__(255)); + + +/***/ }), +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var anObject = __webpack_require__(1); +var toPrimitive = __webpack_require__(22); +var NUMBER = 'number'; + +module.exports = function (hint) { + if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; + + +/***/ }), +/* 256 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $typed = __webpack_require__(63); +var buffer = __webpack_require__(92); +var anObject = __webpack_require__(1); +var toAbsoluteIndex = __webpack_require__(37); +var toLength = __webpack_require__(8); +var isObject = __webpack_require__(4); +var ArrayBuffer = __webpack_require__(2).ArrayBuffer; +var speciesConstructor = __webpack_require__(61); +var $ArrayBuffer = buffer.ArrayBuffer; +var $DataView = buffer.DataView; +var $isView = $typed.ABV && ArrayBuffer.isView; +var $slice = $ArrayBuffer.prototype.slice; +var VIEW = $typed.VIEW; +var ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it) { + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * __webpack_require__(3)(function () { + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end) { + if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength; + var first = toAbsoluteIndex(start, len); + var final = toAbsoluteIndex(end === undefined ? len : end, len); + var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(final - first)); + var viewS = new $DataView(this); + var viewT = new $DataView(result); + var index = 0; + while (first < final) { + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +__webpack_require__(41)(ARRAY_BUFFER); + + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +$export($export.G + $export.W + $export.F * !__webpack_require__(63).ABV, { + DataView: __webpack_require__(92).DataView +}); + + +/***/ }), +/* 258 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 259 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); + + +/***/ }), +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 266 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/Array.prototype.includes +var $export = __webpack_require__(0); +var $includes = __webpack_require__(51)(true); + +$export($export.P, 'Array', { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +__webpack_require__(33)('includes'); + + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap +var $export = __webpack_require__(0); +var flattenIntoArray = __webpack_require__(120); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var aFunction = __webpack_require__(10); +var arraySpeciesCreate = __webpack_require__(84); + +$export($export.P, 'Array', { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen, A; + aFunction(callbackfn); + sourceLen = toLength(O.length); + A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); + return A; + } +}); + +__webpack_require__(33)('flatMap'); + + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten +var $export = __webpack_require__(0); +var flattenIntoArray = __webpack_require__(120); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var toInteger = __webpack_require__(24); +var arraySpeciesCreate = __webpack_require__(84); + +$export($export.P, 'Array', { + flatten: function flatten(/* depthArg = 1 */) { + var depthArg = arguments[0]; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); + +__webpack_require__(33)('flatten'); + + +/***/ }), +/* 270 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/mathiasbynens/String.prototype.at +var $export = __webpack_require__(0); +var $at = __webpack_require__(79)(true); + +$export($export.P, 'String', { + at: function at(pos) { + return $at(this, pos); + } +}); + + +/***/ }), +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(0); +var $pad = __webpack_require__(121); + +$export($export.P, 'String', { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); + + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(0); +var $pad = __webpack_require__(121); + +$export($export.P, 'String', { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); + + +/***/ }), +/* 273 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(45)('trimLeft', function ($trim) { + return function trimLeft() { + return $trim(this, 1); + }; +}, 'trimStart'); + + +/***/ }), +/* 274 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(45)('trimRight', function ($trim) { + return function trimRight() { + return $trim(this, 2); + }; +}, 'trimEnd'); + + +/***/ }), +/* 275 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/String.prototype.matchAll/ +var $export = __webpack_require__(0); +var defined = __webpack_require__(23); +var toLength = __webpack_require__(8); +var isRegExp = __webpack_require__(55); +var getFlags = __webpack_require__(59); +var RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function (regexp, string) { + this._r = regexp; + this._s = string; +}; + +__webpack_require__(57)($RegExpStringIterator, 'RegExp String', function next() { + var match = this._r.exec(this._s); + return { value: match, done: match === null }; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp) { + defined(this); + if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); + var S = String(this); + var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); + var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); + + +/***/ }), +/* 276 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(68)('asyncIterator'); + + +/***/ }), +/* 277 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(68)('observable'); + + +/***/ }), +/* 278 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = __webpack_require__(0); +var ownKeys = __webpack_require__(91); +var toIObject = __webpack_require__(11); +var gOPD = __webpack_require__(15); +var createProperty = __webpack_require__(83); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIObject(object); + var getDesc = gOPD.f; + var keys = ownKeys(O); + var result = {}; + var i = 0; + var key, desc; + while (keys.length > i) { + desc = getDesc(O, key = keys[i++]); + if (desc !== undefined) createProperty(result, key, desc); + } + return result; + } +}); + + +/***/ }), +/* 279 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(0); +var $values = __webpack_require__(122)(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); + + +/***/ }), +/* 280 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(0); +var $entries = __webpack_require__(122)(true); + +$export($export.S, 'Object', { + entries: function entries(it) { + return $entries(it); + } +}); + + +/***/ }), +/* 281 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var aFunction = __webpack_require__(10); +var $defineProperty = __webpack_require__(6); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { + __defineGetter__: function __defineGetter__(P, getter) { + $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), +/* 282 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var aFunction = __webpack_require__(10); +var $defineProperty = __webpack_require__(6); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { + __defineSetter__: function __defineSetter__(P, setter) { + $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), +/* 283 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(22); +var getPrototypeOf = __webpack_require__(16); +var getOwnPropertyDescriptor = __webpack_require__(15).f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.get; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), +/* 284 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(22); +var getPrototypeOf = __webpack_require__(16); +var getOwnPropertyDescriptor = __webpack_require__(15).f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.set; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), +/* 285 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(0); + +$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(123)('Map') }); + + +/***/ }), +/* 286 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(0); + +$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(123)('Set') }); + + +/***/ }), +/* 287 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +__webpack_require__(65)('Map'); + + +/***/ }), +/* 288 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +__webpack_require__(65)('Set'); + + +/***/ }), +/* 289 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +__webpack_require__(65)('WeakMap'); + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +__webpack_require__(65)('WeakSet'); + + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +__webpack_require__(66)('Map'); + + +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +__webpack_require__(66)('Set'); + + +/***/ }), +/* 293 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +__webpack_require__(66)('WeakMap'); + + +/***/ }), +/* 294 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +__webpack_require__(66)('WeakSet'); + + +/***/ }), +/* 295 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(0); + +$export($export.G, { global: __webpack_require__(2) }); + + +/***/ }), +/* 296 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(0); + +$export($export.S, 'System', { global: __webpack_require__(2) }); + + +/***/ }), +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/ljharb/proposal-is-error +var $export = __webpack_require__(0); +var cof = __webpack_require__(20); + +$export($export.S, 'Error', { + isError: function isError(it) { + return cof(it) === 'Error'; + } +}); + + +/***/ }), +/* 298 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + clamp: function clamp(x, lower, upper) { + return Math.min(upper, Math.max(lower, x)); + } +}); + + +/***/ }), +/* 299 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); + + +/***/ }), +/* 300 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var RAD_PER_DEG = 180 / Math.PI; + +$export($export.S, 'Math', { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); + + +/***/ }), +/* 301 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var scale = __webpack_require__(125); +var fround = __webpack_require__(107); + +$export($export.S, 'Math', { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); + } +}); + + +/***/ }), +/* 302 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); + + +/***/ }), +/* 303 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); + + +/***/ }), +/* 304 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + imulh: function imulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); + + +/***/ }), +/* 305 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); + + +/***/ }), +/* 306 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var DEG_PER_RAD = Math.PI / 180; + +$export($export.S, 'Math', { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); + + +/***/ }), +/* 307 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { scale: __webpack_require__(125) }); + + +/***/ }), +/* 308 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + umulh: function umulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); + + +/***/ }), +/* 309 */ +/***/ (function(module, exports, __webpack_require__) { + +// http://jfbastien.github.io/papers/Math.signbit.html +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; +} }); + + +/***/ }), +/* 310 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// https://github.com/tc39/proposal-promise-finally + +var $export = __webpack_require__(0); +var core = __webpack_require__(18); +var global = __webpack_require__(2); +var speciesConstructor = __webpack_require__(61); +var promiseResolve = __webpack_require__(113); + +$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { + var C = speciesConstructor(this, core.Promise || global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); +} }); + + +/***/ }), +/* 311 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-promise-try +var $export = __webpack_require__(0); +var newPromiseCapability = __webpack_require__(90); +var perform = __webpack_require__(112); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); + + +/***/ }), +/* 312 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var toMetaKey = metadata.key; +var ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +} }); + + +/***/ }), +/* 313 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var toMetaKey = metadata.key; +var getOrCreateMetadataMap = metadata.map; +var store = metadata.store; + +metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +} }); + + +/***/ }), +/* 314 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(16); +var ordinaryHasOwnMetadata = metadata.has; +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 315 */ +/***/ (function(module, exports, __webpack_require__) { + +var Set = __webpack_require__(116); +var from = __webpack_require__(124); +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(16); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), +/* 316 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 317 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), +/* 318 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(16); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 319 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 320 */ +/***/ (function(module, exports, __webpack_require__) { + +var $metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var aFunction = __webpack_require__(10); +var toMetaKey = $metadata.key; +var ordinaryDefineOwnMetadata = $metadata.set; + +$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, targetKey) { + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +} }); + + +/***/ }), +/* 321 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = __webpack_require__(0); +var microtask = __webpack_require__(89)(); +var process = __webpack_require__(2).process; +var isNode = __webpack_require__(20)(process) == 'process'; + +$export($export.G, { + asap: function asap(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); + + +/***/ }), +/* 322 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/zenparsing/es-observable +var $export = __webpack_require__(0); +var global = __webpack_require__(2); +var core = __webpack_require__(18); +var microtask = __webpack_require__(89)(); +var OBSERVABLE = __webpack_require__(5)('observable'); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var anInstance = __webpack_require__(42); +var redefineAll = __webpack_require__(43); +var hide = __webpack_require__(13); +var forOf = __webpack_require__(34); +var RETURN = forOf.RETURN; + +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function (subscription) { + var cleanup = subscription._c; + if (cleanup) { + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function (subscription) { + return subscription._o === undefined; +}; + +var closeSubscription = function (subscription) { + if (!subscriptionClosed(subscription)) { + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function (observer, subscriber) { + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer); + var subscription = cleanup; + if (cleanup != null) { + if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch (e) { + observer.error(e); + return; + } if (subscriptionClosed(this)) cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { closeSubscription(this); } +}); + +var SubscriptionObserver = function (subscription) { + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if (m) return m.call(observer, value); + } catch (e) { + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value) { + var subscription = this._s; + if (subscriptionClosed(subscription)) throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if (!m) throw value; + value = m.call(observer, value); + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn) { + var that = this; + return new (core.Promise || global.Promise)(function (resolve, reject) { + aFunction(fn); + var subscription = that.subscribe({ + next: function (value) { + try { + return fn(value); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if (method) { + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); + } + return new C(function (observer) { + var done = false; + microtask(function () { + if (!done) { + try { + if (forOf(x, false, function (it) { + observer.next(it); + if (done) return RETURN; + }) === RETURN) return; + } catch (e) { + if (done) throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + }, + of: function of() { + for (var i = 0, l = arguments.length, items = Array(l); i < l;) items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function (observer) { + var done = false; + microtask(function () { + if (!done) { + for (var j = 0; j < items.length; ++j) { + observer.next(items[j]); + if (done) return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function () { return this; }); + +$export($export.G, { Observable: $Observable }); + +__webpack_require__(41)('Observable'); + + +/***/ }), +/* 323 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $task = __webpack_require__(88); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); + + +/***/ }), +/* 324 */ +/***/ (function(module, exports, __webpack_require__) { + +var $iterators = __webpack_require__(86); +var getKeys = __webpack_require__(27); +var redefine = __webpack_require__(14); +var global = __webpack_require__(2); +var hide = __webpack_require__(13); +var Iterators = __webpack_require__(40); +var wks = __webpack_require__(5); +var ITERATOR = wks('iterator'); +var TO_STRING_TAG = wks('toStringTag'); +var ArrayValues = Iterators.Array; + +var DOMIterables = { + CSSRuleList: true, // TODO: Not spec compliant, should be false. + CSSStyleDeclaration: false, + CSSValueList: false, + ClientRectList: false, + DOMRectList: false, + DOMStringList: false, + DOMTokenList: true, + DataTransferItemList: false, + FileList: false, + HTMLAllCollection: false, + HTMLCollection: false, + HTMLFormElement: false, + HTMLSelectElement: false, + MediaList: true, // TODO: Not spec compliant, should be false. + MimeTypeArray: false, + NamedNodeMap: false, + NodeList: true, + PaintRequestList: false, + Plugin: false, + PluginArray: false, + SVGLengthList: false, + SVGNumberList: false, + SVGPathSegList: false, + SVGPointList: false, + SVGStringList: false, + SVGTransformList: false, + SourceBufferList: false, + StyleSheetList: true, // TODO: Not spec compliant, should be false. + TextTrackCueList: false, + TextTrackList: false, + TouchList: false +}; + +for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { + var NAME = collections[i]; + var explicit = DOMIterables[NAME]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + var key; + if (proto) { + if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); + if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); + } +} + + +/***/ }), +/* 325 */ +/***/ (function(module, exports, __webpack_require__) { + +// ie9- setTimeout & setInterval additional parameters fix +var global = __webpack_require__(2); +var $export = __webpack_require__(0); +var invoke = __webpack_require__(54); +var partial = __webpack_require__(93); +var navigator = global.navigator; +var MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check +var wrap = function (set) { + return MSIE ? function (fn, time /* , ...args */) { + return set(invoke( + partial, + [].slice.call(arguments, 2), + // eslint-disable-next-line no-new-func + typeof fn == 'function' ? fn : Function(fn) + ), time); + } : set; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); + + +/***/ }), +/* 326 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(19); +var $export = __webpack_require__(0); +var createDesc = __webpack_require__(31); +var assign = __webpack_require__(72); +var create = __webpack_require__(28); +var getPrototypeOf = __webpack_require__(16); +var getKeys = __webpack_require__(27); +var dP = __webpack_require__(6); +var keyOf = __webpack_require__(97); +var aFunction = __webpack_require__(10); +var forOf = __webpack_require__(34); +var isIterable = __webpack_require__(127); +var $iterCreate = __webpack_require__(57); +var step = __webpack_require__(87); +var isObject = __webpack_require__(4); +var toIObject = __webpack_require__(11); +var DESCRIPTORS = __webpack_require__(7); +var has = __webpack_require__(12); + +// 0 -> Dict.forEach +// 1 -> Dict.map +// 2 -> Dict.filter +// 3 -> Dict.some +// 4 -> Dict.every +// 5 -> Dict.find +// 6 -> Dict.findKey +// 7 -> Dict.mapPairs +var createDictMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_EVERY = TYPE == 4; + return function (object, callbackfn, that /* = undefined */) { + var f = ctx(callbackfn, that, 3); + var O = toIObject(object); + var result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict)() : undefined; + var key, val, res; + for (key in O) if (has(O, key)) { + val = O[key]; + res = f(val, key, object); + if (TYPE) { + if (IS_MAP) result[key] = res; // map + else if (res) switch (TYPE) { + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if (IS_EVERY) return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; +}; +var findKey = createDictMethod(6); + +var createDictIter = function (kind) { + return function (it) { + return new DictIterator(it, kind); + }; +}; +var DictIterator = function (iterated, kind) { + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind +}; +$iterCreate(DictIterator, 'Dict', function () { + var that = this; + var O = that._t; + var keys = that._a; + var kind = that._k; + var key; + do { + if (that._i >= keys.length) { + that._t = undefined; + return step(1); + } + } while (!has(O, key = keys[that._i++])); + if (kind == 'keys') return step(0, key); + if (kind == 'values') return step(0, O[key]); + return step(0, [key, O[key]]); +}); + +function Dict(iterable) { + var dict = create(null); + if (iterable != undefined) { + if (isIterable(iterable)) { + forOf(iterable, true, function (key, value) { + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; +} +Dict.prototype = null; + +function reduce(object, mapfn, init) { + aFunction(mapfn); + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var memo, key; + if (arguments.length < 3) { + if (!length) throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while (length > i) if (has(O, key = keys[i++])) { + memo = mapfn(memo, O[key], key, object); + } + return memo; +} + +function includes(object, el) { + // eslint-disable-next-line no-self-compare + return (el == el ? keyOf(object, el) : findKey(object, function (it) { + // eslint-disable-next-line no-self-compare + return it != it; + })) !== undefined; +} + +function get(object, key) { + if (has(object, key)) return object[key]; +} +function set(object, key, value) { + if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; +} + +function isDict(it) { + return isObject(it) && getPrototypeOf(it) === Dict.prototype; +} + +$export($export.G + $export.F, { Dict: Dict }); + +$export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict +}); + + +/***/ }), +/* 327 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var get = __webpack_require__(49); +module.exports = __webpack_require__(18).getIterator = function (it) { + var iterFn = get(it); + if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; + + +/***/ }), +/* 328 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(18); +var $export = __webpack_require__(0); +var partial = __webpack_require__(93); +// https://esdiscuss.org/topic/promise-returning-delay-function +$export($export.G + $export.F, { + delay: function delay(time) { + return new (core.Promise || global.Promise)(function (resolve) { + setTimeout(partial.call(resolve, true), time); + }); + } +}); + + +/***/ }), +/* 329 */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(126); +var $export = __webpack_require__(0); + +// Placeholder +__webpack_require__(18)._ = path._ = path._ || {}; + +$export($export.P + $export.F, 'Function', { part: __webpack_require__(93) }); + + +/***/ }), +/* 330 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { isObject: __webpack_require__(4) }); + + +/***/ }), +/* 331 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { classof: __webpack_require__(39) }); + + +/***/ }), +/* 332 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var define = __webpack_require__(128); + +$export($export.S + $export.F, 'Object', { define: define }); + + +/***/ }), +/* 333 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var define = __webpack_require__(128); +var create = __webpack_require__(28); + +$export($export.S + $export.F, 'Object', { + make: function (proto, mixin) { + return define(create(proto), mixin); + } +}); + + +/***/ }), +/* 334 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(56)(Number, 'Number', function (iterated) { + this._l = +iterated; + this._i = 0; +}, function () { + var i = this._i++; + var done = !(i < this._l); + return { done: done, value: done ? undefined : i }; +}); + + +/***/ }), +/* 335 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/benjamingr/RexExp.escape +var $export = __webpack_require__(0); +var $re = __webpack_require__(94)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); + + +/***/ }), +/* 336 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $re = __webpack_require__(94)(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}); + +$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); + + +/***/ }), +/* 337 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $re = __webpack_require__(94)(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}); + +$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); + + +/***/ }) +/******/ ]); +// CommonJS export +if(typeof module != 'undefined' && module.exports)module.exports = __e; +// RequireJS export +else if(typeof define == 'function' && define.amd)define(function(){return __e}); +// Export to global object +else __g.core = __e; +}(1, 1); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/core-js/client/core.min.js b/node_modules/csscomb/node_modules/core-js/client/core.min.js new file mode 100644 index 0000000..e910540 --- /dev/null +++ b/node_modules/csscomb/node_modules/core-js/client/core.min.js @@ -0,0 +1,10 @@ +/** + * core-js 2.5.0 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2017 Denis Pushkarev + */ +!function(t,n,r){"use strict";!function(t){function __webpack_require__(r){if(n[r])return n[r].exports;var e=n[r]={i:r,l:!1,exports:{}};return t[r].call(e.exports,e,e.exports,__webpack_require__),e.l=!0,e.exports}var n={};__webpack_require__.m=t,__webpack_require__.c=n,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=129)}([function(t,n,e){var i=e(2),o=e(18),u=e(13),c=e(14),f=e(19),a=function(t,n,e){var s,l,h,p,v=t&a.F,g=t&a.G,y=t&a.S,d=t&a.P,_=t&a.B,b=g?i:y?i[n]||(i[n]={}):(i[n]||{}).prototype,S=g?o:o[n]||(o[n]={}),m=S.prototype||(S.prototype={});g&&(e=n);for(s in e)h=((l=!v&&b&&b[s]!==r)?b:e)[s],p=_&&l?f(h,i):d&&"function"==typeof h?f(Function.call,h):h,b&&c(b,s,h,t&a.U),S[s]!=h&&u(S,s,p),d&&m[s]!=h&&(m[s]=h)};i.core=o,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,n,r){var e=r(4);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,r){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof n&&(n=e)},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(50)("wks"),i=r(35),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var e=r(1),i=r(95),o=r(22),u=Object.defineProperty;n.f=r(7)?Object.defineProperty:function defineProperty(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(c){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){t.exports=!r(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(24),i=Math.min;t.exports=function(t){return t>0?i(e(t),9007199254740991):0}},function(t,n,r){var e=r(23);t.exports=function(t){return Object(e(t))}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,r){var e=r(47),i=r(23);t.exports=function(t){return e(i(t))}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){var e=r(6),i=r(31);t.exports=r(7)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(2),i=r(13),o=r(12),u=r(35)("src"),c=Function.toString,f=(""+c).split("toString");r(18).inspectSource=function(t){return c.call(t)},(t.exports=function(t,n,r,c){var a="function"==typeof r;a&&(o(r,"name")||i(r,"name",n)),t[n]!==r&&(a&&(o(r,u)||i(r,u,t[n]?""+t[n]:f.join(String(n)))),t===e?t[n]=r:c?t[n]?t[n]=r:i(t,n,r):(delete t[n],i(t,n,r)))})(Function.prototype,"toString",function toString(){return"function"==typeof this&&this[u]||c.call(this)})},function(t,n,r){var e=r(48),i=r(31),o=r(11),u=r(22),c=r(12),f=r(95),a=Object.getOwnPropertyDescriptor;n.f=r(7)?a:function getOwnPropertyDescriptor(t,n){if(t=o(t),n=u(n,!0),f)try{return a(t,n)}catch(r){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},function(t,n,r){var e=r(12),i=r(9),o=r(69)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,r){var e=r(0),i=r(3),o=r(23),u=/"/g,c=function(t,n,r,e){var i=String(o(t)),c="<"+n;return""!==r&&(c+=" "+r+'="'+String(e).replace(u,""")+'"'),c+">"+i+""};t.exports=function(t,n){var r={};r[t]=n(c),e(e.P+e.F*i(function(){var n=""[t]('"');return n!==n.toLowerCase()||n.split('"').length>3}),"String",r)}},function(n,r){var e=n.exports={version:"2.5.0"};"number"==typeof t&&(t=e)},function(t,n,e){var i=e(10);t.exports=function(t,n,e){if(i(t),n===r)return t;switch(e){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(3);t.exports=function(t,n){return!!t&&e(function(){n?t.call(null,function(){},1):t.call(null)})}},function(t,n,r){var e=r(4);t.exports=function(t,n){if(!e(t))return t;var r,i;if(n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!e(i=r.call(t)))return i;if(!n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,n){t.exports=function(t){if(t==r)throw TypeError("Can't call method on "+t);return t}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(0),i=r(18),o=r(3);t.exports=function(t,n){var r=(i.Object||{})[t]||Object[t],u={};u[t]=n(r),e(e.S+e.F*o(function(){r(1)}),"Object",u)}},function(t,n,e){var i=e(19),o=e(47),u=e(9),c=e(8),f=e(84);t.exports=function(t,n){var e=1==t,a=2==t,s=3==t,l=4==t,h=6==t,p=5==t||h,v=n||f;return function(n,f,g){for(var y,d,_=u(n),b=o(_),S=i(f,g,3),m=c(b.length),x=0,w=e?v(n,m):a?v(n,0):r;m>x;x++)if((p||x in b)&&(y=b[x],d=S(y,x,_),t))if(e)w[x]=d;else if(d)switch(t){case 3:return!0;case 5:return y;case 6:return x;case 2:w.push(y)}else if(l)return!1;return h?-1:s||l?l:w}}},function(t,n,r){var e=r(98),i=r(70);t.exports=Object.keys||function keys(t){return e(t,i)}},function(t,n,e){var i=e(1),o=e(99),u=e(70),c=e(69)("IE_PROTO"),f=function(){},a=function(){var t,n=e(67)("iframe"),r=u.length;for(n.style.display="none",e(71).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write(" -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -v1.4 -* Improved module context detection -* Removed public RNG functions - -v1.3.2: -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -v1.3: -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/package.json b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/package.json deleted file mode 100644 index 561b24b..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "lib": ".", - "main": "./uuid.js", - "repository": { - "type": "git", - "url": "https://github.com/broofa/node-uuid.git" - }, - "version": "1.4.0", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\nv1.4\n* Improved module context detection\n* Removed public RNG functions\n\nv1.3.2:\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\nv1.3:\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "_id": "node-uuid@1.4.0", - "dist": { - "shasum": "07f9b2337572ff6275c775e1d48513f3a45d7a65", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz" - }, - "maintainers": [ - { - "name": "broofa", - "email": "robert@broofa.com" - } - ], - "directories": {}, - "_shasum": "07f9b2337572ff6275c775e1d48513f3a45d7a65", - "_from": "node-uuid@1.4.0", - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "homepage": "https://github.com/broofa/node-uuid" -} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/compare_v1.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/compare_v1.js deleted file mode 100644 index 05af822..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/compare_v1.js +++ /dev/null @@ -1,63 +0,0 @@ -var assert = require('assert'), - nodeuuid = require('../uuid'), - uuidjs = require('uuid-js'), - libuuid = require('uuid').generate, - util = require('util'), - exec = require('child_process').exec, - os = require('os'); - -// On Mac Os X / macports there's only the ossp-uuid package that provides uuid -// On Linux there's uuid-runtime which provides uuidgen -var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; - -function compare(ids) { - console.log(ids); - for (var i = 0; i < ids.length; i++) { - var id = ids[i].split('-'); - id = [id[2], id[1], id[0]].join(''); - ids[i] = id; - } - var sorted = ([].concat(ids)).sort(); - - if (sorted.toString() !== ids.toString()) { - console.log('Warning: sorted !== ids'); - } else { - console.log('everything in order!'); - } -} - -// Test time order of v1 uuids -var ids = []; -while (ids.length < 10e3) ids.push(nodeuuid.v1()); - -var max = 10; -console.log('node-uuid:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); -compare(ids); - -console.log(''); -console.log('uuidjs:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); -compare(ids); - -console.log(''); -console.log('libuuid:'); -ids = []; -var count = 0; -var last = function() { - compare(ids); -} -var cb = function(err, stdout, stderr) { - ids.push(stdout.substring(0, stdout.length-1)); - count++; - if (count < max) { - return next(); - } - last(); -}; -var next = function() { - exec(uuidCmd, cb); -}; -next(); diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/test.html b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/test.html deleted file mode 100644 index d80326e..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/test.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/test.js deleted file mode 100644 index 2469225..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/test/test.js +++ /dev/null @@ -1,228 +0,0 @@ -if (!this.uuid) { - // node.js - uuid = require('../uuid'); -} - -// -// x-platform log/assert shims -// - -function _log(msg, type) { - type = type || 'log'; - - if (typeof(document) != 'undefined') { - document.write('
' + msg.replace(/\n/g, '
') + '
'); - } - if (typeof(console) != 'undefined') { - var color = { - log: '\033[39m', - warn: '\033[33m', - error: '\033[31m' - }; - console[type](color[type] + msg + color.log); - } -} - -function log(msg) {_log(msg, 'log');} -function warn(msg) {_log(msg, 'warn');} -function error(msg) {_log(msg, 'error');} - -function assert(res, msg) { - if (!res) { - error('FAIL: ' + msg); - } else { - log('Pass: ' + msg); - } -} - -// -// Unit tests -// - -// Verify ordering of v1 ids created with explicit times -var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00 - -function compare(name, ids) { - ids = ids.map(function(id) { - return id.split('-').reverse().join('-'); - }).sort(); - var sorted = ([].concat(ids)).sort(); - - assert(sorted.toString() == ids.toString(), name + ' have expected order'); -} - -// Verify ordering of v1 ids created using default behavior -compare('uuids with current time', [ - uuid.v1(), - uuid.v1(), - uuid.v1(), - uuid.v1(), - uuid.v1() -]); - -// Verify ordering of v1 ids created with explicit times -compare('uuids with time option', [ - uuid.v1({msecs: TIME - 10*3600*1000}), - uuid.v1({msecs: TIME - 1}), - uuid.v1({msecs: TIME}), - uuid.v1({msecs: TIME + 1}), - uuid.v1({msecs: TIME + 28*24*3600*1000}) -]); - -assert( - uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}), - 'IDs created at same msec are different' -); - -// Verify throw if too many ids created -var thrown = false; -try { - uuid.v1({msecs: TIME, nsecs: 10000}); -} catch (e) { - thrown = true; -} -assert(thrown, 'Exception thrown when > 10K ids created in 1 ms'); - -// Verify clock regression bumps clockseq -var uidt = uuid.v1({msecs: TIME}); -var uidtb = uuid.v1({msecs: TIME - 1}); -assert( - parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1, - 'Clock regression by msec increments the clockseq' -); - -// Verify clock regression bumps clockseq -var uidtn = uuid.v1({msecs: TIME, nsecs: 10}); -var uidtnb = uuid.v1({msecs: TIME, nsecs: 9}); -assert( - parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1, - 'Clock regression by nsec increments the clockseq' -); - -// Verify explicit options produce expected id -var id = uuid.v1({ - msecs: 1321651533573, - nsecs: 5432, - clockseq: 0x385c, - node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ] -}); -assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id'); - -// Verify adjacent ids across a msec boundary are 1 time unit apart -var u0 = uuid.v1({msecs: TIME, nsecs: 9999}); -var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0}); - -var before = u0.split('-')[0], after = u1.split('-')[0]; -var dt = parseInt(after, 16) - parseInt(before, 16); -assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart'); - -// -// Test parse/unparse -// - -id = '00112233445566778899aabbccddeeff'; -assert(uuid.unparse(uuid.parse(id.substr(0,10))) == - '00112233-4400-0000-0000-000000000000', 'Short parse'); -assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) == - '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse'); - -// -// Perf tests -// - -var generators = { - v1: uuid.v1, - v4: uuid.v4 -}; - -var UUID_FORMAT = { - v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i, - v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i -}; - -var N = 1e4; - -// Get %'age an actual value differs from the ideal value -function divergence(actual, ideal) { - return Math.round(100*100*(actual - ideal)/ideal)/100; -} - -function rate(msg, t) { - log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second'); -} - -for (var version in generators) { - var counts = {}, max = 0; - var generator = generators[version]; - var format = UUID_FORMAT[version]; - - log('\nSanity check ' + N + ' ' + version + ' uuids'); - for (var i = 0, ok = 0; i < N; i++) { - id = generator(); - if (!format.test(id)) { - throw Error(id + ' is not a valid UUID string'); - } - - if (id != uuid.unparse(uuid.parse(id))) { - assert(fail, id + ' is not a valid id'); - } - - // Count digits for our randomness check - if (version == 'v4') { - var digits = id.replace(/-/g, '').split(''); - for (var j = digits.length-1; j >= 0; j--) { - var c = digits[j]; - max = Math.max(max, counts[c] = (counts[c] || 0) + 1); - } - } - } - - // Check randomness for v4 UUIDs - if (version == 'v4') { - // Limit that we get worried about randomness. (Purely empirical choice, this!) - var limit = 2*100*Math.sqrt(1/N); - - log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)'); - - for (var i = 0; i < 16; i++) { - var c = i.toString(16); - var bar = '', n = counts[c], p = Math.round(n/max*100|0); - - // 1-3,5-8, and D-F: 1:16 odds over 30 digits - var ideal = N*30/16; - if (i == 4) { - // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits - ideal = N*(1 + 30/16); - } else if (i >= 8 && i <= 11) { - // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits - ideal = N*(1/4 + 30/16); - } else { - // Otherwise: 1:16 odds on 30 digits - ideal = N*30/16; - } - var d = divergence(n, ideal); - - // Draw bar using UTF squares (just for grins) - var s = n/max*50 | 0; - while (s--) bar += '='; - - assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)'); - } - } -} - -// Perf tests -for (var version in generators) { - log('\nPerformance testing ' + version + ' UUIDs'); - var generator = generators[version]; - var buf = new uuid.BufferClass(16); - - for (var i = 0, t = Date.now(); i < N; i++) generator(); - rate('uuid.' + version + '()', t); - - for (var i = 0, t = Date.now(); i < N; i++) generator('binary'); - rate('uuid.' + version + '(\'binary\')', t); - - for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf); - rate('uuid.' + version + '(\'binary\', buffer)', t); -} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/uuid.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/uuid.js deleted file mode 100644 index 4795b9d..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/uuid.js +++ /dev/null @@ -1,245 +0,0 @@ -// uuid.js -// -// (c) 2010-2012 Robert Kieffer -// MIT License -// https://github.com/broofa/node-uuid -(function() { - var _global = this; - - // Unique ID creation requires a high quality random # generator. We feature - // detect to determine the best RNG source, normalizing to a function that - // returns 128-bits of randomness, since that's what's usually required - var _rng; - - // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html - // - // Moderately fast, high quality - if (typeof(require) == 'function') { - try { - var _rb = require('crypto').randomBytes; - _rng = _rb && function() {return _rb(16);}; - } catch(e) {} - } - - if (!_rng && _global.crypto && crypto.getRandomValues) { - // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto - // - // Moderately fast, high quality - var _rnds8 = new Uint8Array(16); - _rng = function whatwgRNG() { - crypto.getRandomValues(_rnds8); - return _rnds8; - }; - } - - if (!_rng) { - // Math.random()-based (RNG) - // - // If all else fails, use Math.random(). It's fast, but is of unspecified - // quality. - var _rnds = new Array(16); - _rng = function() { - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) === 0) r = Math.random() * 0x100000000; - _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return _rnds; - }; - } - - // Buffer class to use - var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; - - // Maps for number <-> hex string conversion - var _byteToHex = []; - var _hexToByte = {}; - for (var i = 0; i < 256; i++) { - _byteToHex[i] = (i + 0x100).toString(16).substr(1); - _hexToByte[_byteToHex[i]] = i; - } - - // **`parse()` - Parse a UUID into it's component bytes** - function parse(s, buf, offset) { - var i = (buf && offset) || 0, ii = 0; - - buf = buf || []; - s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { - if (ii < 16) { // Don't overflow! - buf[i + ii++] = _hexToByte[oct]; - } - }); - - // Zero out remaining bytes if string was short - while (ii < 16) { - buf[i + ii++] = 0; - } - - return buf; - } - - // **`unparse()` - Convert UUID byte array (ala parse()) into a string** - function unparse(buf, offset) { - var i = offset || 0, bth = _byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; - } - - // **`v1()` - Generate time-based UUID** - // - // Inspired by https://github.com/LiosK/UUID.js - // and http://docs.python.org/library/uuid.html - - // random #'s we need to init node and clockseq - var _seedBytes = _rng(); - - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] - ]; - - // Per 4.2.2, randomize (14 bit) clockseq - var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; - - // Previous uuid creation time - var _lastMSecs = 0, _lastNSecs = 0; - - // See https://github.com/broofa/node-uuid for API details - function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - - var clockseq = options.clockseq != null ? options.clockseq : _clockseq; - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs != null ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq == null) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - var node = options.node || _nodeId; - for (var n = 0; n < 6; n++) { - b[i + n] = node[n]; - } - - return buf ? buf : unparse(b); - } - - // **`v4()` - Generate random UUID** - - // See https://github.com/broofa/node-uuid for API details - function v4(options, buf, offset) { - // Deprecated - 'format' argument, as supported in v1.2 - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options == 'binary' ? new BufferClass(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || _rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ii++) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || unparse(rnds); - } - - // Export public API - var uuid = v4; - uuid.v1 = v1; - uuid.v4 = v4; - uuid.parse = parse; - uuid.unparse = unparse; - uuid.BufferClass = BufferClass; - - if (_global.define && define.amd) { - // Publish as AMD module - define(function() {return uuid;}); - } else if (typeof(module) != 'undefined' && module.exports) { - // Publish as node.js module - module.exports = uuid; - } else { - // Publish as global (in browsers) - var _previousRoot = _global.uuid; - - // **`noConflict()` - (browser only) to reset global 'uuid' var** - uuid.noConflict = function() { - _global.uuid = _previousRoot; - return uuid; - }; - - _global.uuid = uuid; - } -}()); diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jscs.json b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jscs.json deleted file mode 100644 index e512a1f..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jscs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "requireMultipleVarDecl": true, - "requireCurlyBraces": ["if", "else", "for", "while", "do"], - "disallowLeftStickedOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], - "disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], - "requireRightStickedOperators": ["!"], - "requireLeftStickedOperators": [","], - "disallowKeywords": ["with"], - "disallowMulipleLineBreaks": true, - "requireAlignedObjectValues": "skipWithLineBreak", - "validateJSDoc": { - "checkParamNames": true, - "requireParamTypes": true - }, - "excludeFiles": [ - "node_modules", - "lib-cov", - "html-report" - ] -} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.travis.yml b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.travis.yml deleted file mode 100644 index bfb5528..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js - -node_js: - - "0.10" - - "0.8" diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/README.md b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/README.md deleted file mode 100644 index 450af93..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/README.md +++ /dev/null @@ -1,49 +0,0 @@ -vow-queue [![NPM version](https://badge.fury.io/js/vow-queue.png)](http://badge.fury.io/js/vow-queue) [![Build Status](https://secure.travis-ci.org/dfilatov/vow-queue.png)](http://travis-ci.org/dfilatov/vow-queue) -=============== - -vow-queue is a module for task queue with weights and priorities - -Installation ------------- - -Module can be installed using `npm`: - -``` -npm install vow-queue -``` - -or `bower`: - -``` -bower install vow-queue -``` - -Usage ------ - -````javascript -var Queue = require('vow-queue'), - queue = new Queue({ weightLimit : 10 }); - -queue.enqueue(function() { // simple function - return 2 * 2; -}); - -queue.enqueue(function() { // function returns a promise - // do job - return promise; -}); - -queue.enqueue( // task with custom priority and weight - function() { - // do job - }, - { - priority : 3, // this task will be started before the previous two - weight : 5 - }); - -queue.start(); // starts tasks processing - -queue.enqueue(function() { }); // and enqueue yet another task -```` diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/bower.json b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/bower.json deleted file mode 100644 index 6034717..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/bower.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name" : "vow-queue", - "version" : "0.3.1", - "main" : "lib/queue.js", - "ignore" : ["**/.*", "node_modules", "test", "utils", "Makefile", ".jshintrc", "package.json", "jscs.json"] -} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/package.json b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/package.json deleted file mode 100644 index 6b7b449..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "vow-queue", - "author": { - "name": "Dmitry Filatov", - "email": "dfilatov@yandex-team.ru" - }, - "description": "Vow-based task queue", - "version": "0.3.1", - "contributors": [ - { - "name": "Dmitry Filatov", - "email": "dfilatov@yandex-team.ru" - } - ], - "engines": { - "node": ">= 0.8.0" - }, - "main": "lib/queue", - "dependencies": { - "vow": "~0.4.0" - }, - "devDependencies": { - "vow": "~0.4.0", - "jshint": "2.1.3", - "mocha": "1.11.0", - "chai": "*", - "jscs": "1.0.0", - "istanbul": "0.1.39", - "mocha-istanbul": "*" - }, - "scripts": { - "test": "make validate", - "lint": "make lint", - "coverage": "make coverage", - "clean": "make clean" - }, - "repository": { - "type": "git", - "url": "http://github.com/dfilatov/vow-queue.git" - }, - "bugs": { - "url": "https://github.com/dfilatov/vow-queue/issues" - }, - "homepage": "https://github.com/dfilatov/vow-queue", - "_id": "vow-queue@0.3.1", - "dist": { - "shasum": "598c51a15b0a81a6d5fc05f4761ceb462de1e868", - "tarball": "http://registry.npmjs.org/vow-queue/-/vow-queue-0.3.1.tgz" - }, - "_from": "vow-queue@0.3.1", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "dfilatov", - "email": "dfilatov@yandex-team.ru" - }, - "maintainers": [ - { - "name": "dfilatov", - "email": "dfilatov@yandex-team.ru" - } - ], - "directories": {}, - "_shasum": "598c51a15b0a81a6d5fc05f4761ceb462de1e868", - "_resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.3.1.tgz", - "readme": "vow-queue [![NPM version](https://badge.fury.io/js/vow-queue.png)](http://badge.fury.io/js/vow-queue) [![Build Status](https://secure.travis-ci.org/dfilatov/vow-queue.png)](http://travis-ci.org/dfilatov/vow-queue)\n===============\n\nvow-queue is a module for task queue with weights and priorities\n\nInstallation\n------------\n\nModule can be installed using `npm`:\n\n```\nnpm install vow-queue\n```\n\nor `bower`:\n\n```\nbower install vow-queue\n```\n\nUsage\n-----\n\n````javascript\nvar Queue = require('vow-queue'),\n queue = new Queue({ weightLimit : 10 });\n \nqueue.enqueue(function() { // simple function\n return 2 * 2;\n});\n\nqueue.enqueue(function() { // function returns a promise\n // do job\n return promise;\n});\n\nqueue.enqueue( // task with custom priority and weight\n function() {\n // do job\n },\n {\n priority : 3, // this task will be started before the previous two\n weight : 5\n });\n \nqueue.start(); // starts tasks processing\n\nqueue.enqueue(function() { }); // and enqueue yet another task\n````\n", - "readmeFilename": "README.md" -} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/package.json b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/package.json deleted file mode 100644 index 9069d3b..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "vow-fs", - "version": "0.3.2", - "description": "File I/O by Vow", - "homepage": "https://github.com/dfilatov/vow-fs", - "keywords": [ - "vow", - "promise", - "file system" - ], - "author": { - "name": "Dmitry Filatov", - "email": "dfilatov@yandex-team.ru" - }, - "contributors": [ - { - "name": "Dmitry Filatov", - "email": "dfilatov@yandex-team.ru" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/dfilatov/vow-fs.git" - }, - "dependencies": { - "node-uuid": "1.4.0", - "vow": "0.4.4", - "vow-queue": "0.3.1", - "glob": "3.2.8" - }, - "devDependencies": { - "nodeunit": "", - "istanbul": "" - }, - "main": "lib/fs", - "engines": { - "node": ">= 0.6.0" - }, - "scripts": { - "test": "./node_modules/istanbul/lib/cli.js test test/runner.js" - }, - "bugs": { - "url": "https://github.com/dfilatov/vow-fs/issues" - }, - "_id": "vow-fs@0.3.2", - "dist": { - "shasum": "ea2b034d85e1db8c277eb2e9a86d1c15f5d38e7a", - "tarball": "http://registry.npmjs.org/vow-fs/-/vow-fs-0.3.2.tgz" - }, - "_from": "vow-fs@0.3.2", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "dfilatov", - "email": "dfilatov@yandex-team.ru" - }, - "maintainers": [ - { - "name": "dfilatov", - "email": "dfilatov@yandex-team.ru" - } - ], - "directories": {}, - "_shasum": "ea2b034d85e1db8c277eb2e9a86d1c15f5d38e7a", - "_resolved": "https://registry.npmjs.org/vow-fs/-/vow-fs-0.3.2.tgz", - "readme": "vow-fs [![NPM version](https://badge.fury.io/js/vow-fs.png)](http://badge.fury.io/js/vow-fs) [![Build Status](https://secure.travis-ci.org/dfilatov/vow-fs.png)](http://travis-ci.org/dfilatov/vow-fs)\n======\n\n[Vow](https://github.com/dfilatov/vow)-based file I/O for Node.js\n\nRequirements\n------------\nVow-fs works with Node.js 0.6, 0.8 and 0.10.\n\nGetting Started\n---------------\nYou can install vow-fs using Node Package Manager (npm):\n\n npm install vow-fs\n\n####Usage####\n````javascript\nvar fs = require('vow-fs');\n````\n\nAPI\n---\n####read(path, [encoding=utf8])####\nReturns a promise for the file's content at a given ````path````.\n####write(path, data, [encoding=utf8])####\nWrites ````data```` to file at a given ````path````. Returns a promise for the completion of the operation.\n####append(path, data, [encoding=utf8])####\nAppends````data```` to file's content at a given ````path````. Returns a promise for the completion of the operation.\n####remove(path)####\nRemoves a file at a given ````path````. Returns a promise for the completion of the operation.\n####copy(sourcePath, targetPath)####\nCopies a file from ````sourcePath```` to ````targetPath````. Returns a promise for the completion of the operation.\n####move(sourcePath, targetPath)####\nMoves a file or directory from ````sourcePath```` to ````targetPath````. Returns a promise for the completion of the operation.\n####stat(path)####\nReturns a promise for the metadata about the given ````path```` as a [Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats) object.\n####exists(path)####\nReturns a promise for whether the given ````path```` exists.\n####link(sourcePath, targetPath)####\nCreates a hard link from the ````sourcePath```` to ````targetPath````.\n####symLink(sourcePath, targetPath, [type=file])####\nCreates a symbolic link from the ````sourcePath```` to ````targetPath````.\n####chown(path, uid, gid)####\nChanges the owner of a given ````path````.\n####chmod(path, mode)####\nChanges the mode of a given ````path```` to ````mode````.\n####absolute(path)####\n####isFile(path)####\nReturns a promise for whether the given ````path```` is a file.\n####isDir(path)####\nReturns a promise for whether the given ````path```` is a directory.\n####isSocket(path)####\nReturns a promise for whether the given ````path```` is a socket.\n####isSymLink(path)####\nReturns a promise for whether the given ````path```` is a symbolic link.\n####makeTmpFile([options])####\nMakes a temporary file. Returns a promise with generated path to file.\nThe ````options````:\n * prefix (absent by default)\n * dir (operating system's directory for temp files by default)\n * ext (````.tmp```` by default)\n\n####listDir(path)####\nReturns a promise for a list of files and directories in directory at the given ````path````.\n####makeDir(path, [mode=0777], [failIfExist=false])####\nMakes a directory at a given ````path```` and any necessary subdirectories (like ````mkdir -p````). Returns a promise for the completion of the operation.\n####removeDir(path)####\nRecursively removes a directory at a given path (like ````remove -rf````). Returns a promise for the completion of the operation.\n####glob(pattern, [options])####\nMatches files using the patterns. See https://github.com/isaacs/node-glob for details.\n", - "readmeFilename": "README.md" -} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/copy.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/copy.js deleted file mode 100644 index 8935f5b..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/copy.js +++ /dev/null @@ -1,101 +0,0 @@ -var fs = require('fs'), - path = require('path'), - vfs = require('../lib/fs'), - TEST_DIR = path.join(__dirname, 'test-dir'); - -module.exports = { - setUp : function(done) { - fs.mkdirSync(TEST_DIR); - done(); - }, - - tearDown : function(done) { - fs.rmdirSync(TEST_DIR); - done(); - }, - - 'should copy file' : function(test) { - var sourceFile = path.join(TEST_DIR, 'source-file'), - targetFile = path.join(TEST_DIR, 'target-file'); - fs.writeFileSync(sourceFile, 'source'); - vfs.copy(sourceFile, targetFile) - .then(function() { - test.equal(fs.readFileSync(targetFile, 'utf8'), 'source'); - }) - .always(function() { - fs.unlinkSync(sourceFile); - fs.unlinkSync(targetFile); - test.done(); - }); - }, - - 'should copy file if target exists' : function(test) { - var sourceFile = path.join(TEST_DIR, 'source-file'), - targetFile = path.join(TEST_DIR, 'target-file'); - fs.writeFileSync(sourceFile, 'source'); - fs.writeFileSync(targetFile, 'target'); - vfs.copy(sourceFile, targetFile) - .then(function() { - test.equal(fs.readFileSync(targetFile, 'utf8'), 'source'); - }) - .always(function() { - fs.unlinkSync(sourceFile); - fs.unlinkSync(targetFile); - test.done(); - }); - }, - - 'should not copy file if source is directory' : function(test) { - var sourceDir = path.join(TEST_DIR, 'source-dir'), - targetFile = path.join(TEST_DIR, 'target-file'); - fs.mkdirSync(sourceDir); - vfs.copy(sourceDir, targetFile) - .then( - function() { - test.ok(false); - }, - function(err) { - test.equal(err.code, 'EISDIR'); - }) - .always(function() { - fs.rmdirSync(sourceDir); - test.done(); - }); - }, - - 'should not copy file if target is directory' : function(test) { - var sourceFile = path.join(TEST_DIR, 'source-file'), - targetDir = path.join(TEST_DIR, 'target-dir'); - fs.writeFileSync(sourceFile, 'source'); - fs.mkdirSync(targetDir); - vfs.copy(sourceFile, targetDir) - .then( - function() { - test.ok(false); - }, - function(err) { - test.equal(err.code, 'EISDIR'); - }) - .always(function() { - fs.unlinkSync(sourceFile); - fs.rmdirSync(targetDir); - test.done(); - }); - }, - - 'should not copy if target not exists' : function(test) { - var sourceFile = path.join(TEST_DIR, 'source-file'), - targetFile = path.join(TEST_DIR, 'target-file'); - vfs.copy(sourceFile, targetFile) - .then( - function() { - test.ok(false); - }, - function(err) { - test.equal(err.code, 'ENOENT'); - }) - .always(function() { - test.done(); - }); - } -}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/issymlink.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/issymlink.js deleted file mode 100644 index 96d02cf..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/issymlink.js +++ /dev/null @@ -1,45 +0,0 @@ -var fs = require('fs'), - path = require('path'), - vfs = require('../lib/fs'), - TEST_DIR = path.join(__dirname, 'test-dir'); - -module.exports = { - setUp : function(done) { - fs.mkdirSync(TEST_DIR); - done(); - }, - - tearDown : function(done) { - fs.rmdirSync(TEST_DIR); - done(); - }, - - 'should return true if the file is a symbolic link' : function(test) { - var sourceFile = path.join(TEST_DIR, 'source-file'), - targetFile = path.join(TEST_DIR, 'target-file'); - fs.writeFileSync(sourceFile, 'source'); - fs.symlinkSync(sourceFile, targetFile); - vfs.isSymLink(targetFile) - .then(function(isSymLink) { - test.ok(isSymLink); - }) - .always(function() { - fs.unlinkSync(sourceFile); - fs.unlinkSync(targetFile); - test.done(); - }); - }, - - 'should return false if the file is not a symbolic link' : function(test) { - var sourceFile = path.join(TEST_DIR, 'source-file'); - fs.writeFileSync(sourceFile, 'source'); - vfs.isSymLink(sourceFile) - .then(function(isSymLink) { - test.ok(!isSymLink); - }) - .always(function() { - fs.unlinkSync(sourceFile); - test.done(); - }); - } -}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/makedir.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/makedir.js deleted file mode 100644 index aa47973..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/makedir.js +++ /dev/null @@ -1,128 +0,0 @@ -var fs = require('fs'), - path = require('path'), - vfs = require('../lib/fs'), - TEST_DIR = path.join(__dirname, 'test-dir'); - -module.exports = { - setUp : function(done) { - fs.mkdirSync(TEST_DIR); - done(); - }, - - tearDown : function(done) { - fs.rmdirSync(TEST_DIR); - done(); - }, - - 'should make directory' : function(test) { - var dir = path.join(TEST_DIR, 'a'); - vfs.makeDir(dir) - .then( - function() { - return vfs.exists(dir); - }, - function() { - test.ok(false); - }) - .always(function(promise) { - test.ok(promise.valueOf()); - test.ok(fs.statSync(dir).isDirectory()); - fs.rmdirSync(dir); - test.done(); - }); - }, - - 'should make directory if exists' : function(test) { - var dir = path.join(TEST_DIR, 'a'); - fs.mkdirSync(dir); - vfs.makeDir(dir) - .then( - function() { - return vfs.exists(dir); - }, - function() { - test.ok(false); - }) - .always(function(promise) { - test.ok(promise.valueOf()); - test.ok(fs.statSync(dir).isDirectory()); - fs.rmdirSync(dir); - test.done(); - }); - }, - - 'should be failed if directory exists' : function(test) { - var dir = path.join(TEST_DIR, 'a'); - fs.mkdirSync(dir); - vfs.makeDir(dir, true) - .then( - function() { - test.ok(false); - }, - function() { - test.ok(true); - }) - .always(function() { - fs.rmdirSync(dir); - test.done(); - }); - }, - - 'should be failed if file with same name exists' : function(test) { - var dir = path.join(TEST_DIR, 'test-file'); - fs.writeFileSync(dir, 'test'); - vfs.makeDir(dir) - .then( - function() { - test.ok(false); - }, - function() { - test.ok(true); - }) - .always(function() { - fs.unlinkSync(path.join(TEST_DIR, 'test-file')); - test.done(); - }); - }, - - 'should make directory tree' : function(test) { - var dir = path.join(TEST_DIR, 'a/b/c'); - vfs.makeDir(dir) - .then( - function() { - return vfs.exists(dir); - }, - function() { - test.ok(false); - }) - .always(function(promise) { - test.ok(promise.valueOf()); - test.ok(fs.statSync(dir).isDirectory()); - fs.rmdirSync(path.join(TEST_DIR, 'a/b/c')); - fs.rmdirSync(path.join(TEST_DIR, 'a/b')); - fs.rmdirSync(path.join(TEST_DIR, 'a')); - test.done(); - }); - }, - - 'should make directory tree if exists' : function(test) { - var dir = path.join(TEST_DIR, 'a/b/c'); - fs.mkdirSync(path.join(TEST_DIR, 'a')); - fs.mkdirSync(path.join(TEST_DIR, 'a', 'b')); - fs.mkdirSync(dir); - vfs.makeDir(dir) - .then( - function() { - test.ok(true); - }, - function() { - test.ok(false); - }) - .always(function() { - fs.rmdirSync(path.join(TEST_DIR, 'a/b/c')); - fs.rmdirSync(path.join(TEST_DIR, 'a/b')); - fs.rmdirSync(path.join(TEST_DIR, 'a')); - test.done(); - }); - } -}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/maketmpfile.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/maketmpfile.js deleted file mode 100644 index 74bf309..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/maketmpfile.js +++ /dev/null @@ -1,103 +0,0 @@ -var fs = require('fs'), - path = require('path'), - os = require('os'), - vfs = require('../lib/fs'), - tmpDir = os.tmpdir || os.tmpDir || function() { return '/tmp'; }, - TEST_DIR = path.join(__dirname, 'test-dir'); - -module.exports = { - setUp : function(done) { - fs.mkdirSync(TEST_DIR); - done(); - }, - - tearDown : function(done) { - fs.rmdirSync(TEST_DIR); - done(); - }, - - 'should make temporary file with default options' : function(test) { - var filePath; - vfs.makeTmpFile() - .then( - function(_filePath) { - return vfs.exists(filePath = _filePath); - }, - function() { - test.ok(false); - throw Error(); - }) - .then(function(exists) { - fs.unlinkSync(filePath); - test.strictEqual(path.dirname(filePath), path.resolve(tmpDir())); - test.strictEqual(path.extname(filePath), '.tmp'); - test.ok(exists); - }) - .always(function() { - test.done(); - }); - }, - - 'should make temporary file in custom directory' : function(test) { - var filePath; - vfs.makeTmpFile({ dir : TEST_DIR }) - .then( - function(_filePath) { - return vfs.exists(filePath = _filePath); - }, - function() { - test.ok(false); - throw Error(); - }) - .then(function(exists) { - fs.unlinkSync(filePath); - test.ok(exists); - test.strictEqual(path.dirname(filePath), TEST_DIR); - }) - .always(function() { - test.done(); - }) - }, - - 'should make temporary file with custom prefix' : function(test) { - var filePath; - vfs.makeTmpFile({ prefix : '__prefix' }) - .then( - function(_filePath) { - return vfs.exists(filePath = _filePath); - }, - function() { - test.ok(false); - throw Error(); - }) - .then(function(exists) { - fs.unlinkSync(filePath); - test.ok(exists); - test.ok(filePath.indexOf('__prefix') > -1); - }) - .always(function() { - test.done(); - }) - }, - - 'should make temporary file with custom extension' : function(test) { - var filePath; - vfs.makeTmpFile({ ext : '.css' }) - .then( - function(_filePath) { - return vfs.exists(filePath = _filePath); - }, - function() { - test.ok(false); - throw Error(); - }) - .then(function(exists) { - fs.unlinkSync(filePath); - test.ok(exists); - test.strictEqual(path.extname(filePath), '.css'); - }) - .always(function() { - test.done(); - }) - } -}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/removedir.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/removedir.js deleted file mode 100644 index 6c44881..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/removedir.js +++ /dev/null @@ -1,74 +0,0 @@ -var fs = require('fs'), - path = require('path'), - vfs = require('../lib/fs'), - TEST_DIR = path.join(__dirname, 'test-dir'); - -module.exports = { - setUp : function(done) { - fs.mkdirSync(TEST_DIR); - done(); - }, - - tearDown : function(done) { - fs.rmdirSync(TEST_DIR); - done(); - }, - - 'should remove empty directory' : function(test) { - var dir = path.join(TEST_DIR, 'dir'); - fs.mkdirSync(dir); - vfs.removeDir(dir) - .then( - function() { - return vfs.exists(dir); - }, - function() { - test.ok(false); - }) - .always(function(promise) { - test.ok(!promise.valueOf()); - test.done(); - }); - }, - - 'should remove directory tree' : function(test) { - var dir = path.join(TEST_DIR, 'dir'); - fs.mkdirSync(dir); - fs.mkdirSync(path.join(dir, 'a')); - fs.writeFileSync(path.join(dir, 'a', 'file'), 'file'); - fs.mkdirSync(path.join(dir, 'a', 'b')); - fs.writeFileSync(path.join(dir, 'a', 'b', 'file1'), 'file1'); - fs.writeFileSync(path.join(dir, 'a', 'b', 'file2'), 'file2'); - vfs.removeDir(dir) - .then( - function() { - return vfs.exists(dir); - }, - function() { - test.ok(false); - }) - .always(function(promise) { - test.ok(!promise.valueOf()); - test.done(); - }); - }, - - 'should not remove file' : function(test) { - var filePath = path.join(TEST_DIR, 'file'); - fs.writeFileSync(filePath, 'file'); - vfs.removeDir(filePath) - .then( - function() { - test.ok(false); - }, - function(err) { - test.equal(err.code, 'ENOTDIR'); - return vfs.exists(filePath); - }) - .always(function(promise) { - test.ok(promise.valueOf()); - fs.unlinkSync(filePath); - test.done(); - }); - } -}; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/runner.js b/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/runner.js deleted file mode 100644 index dd657ad..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/test/runner.js +++ /dev/null @@ -1,15 +0,0 @@ -var fs = require('fs'), - path = require('path'); - -require('nodeunit').reporters.default.run( - fs.readdirSync(__dirname) - .filter(function(file){ - return fs.statSync(path.join(__dirname, file)).isFile() && file !== 'runner.js'; - }) - .map(function(file) { - return path.join('test', file); - }), - null, - function(err) { - err && process.exit(1); - }); \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/csscomb-core/package.json b/node_modules/csscomb/node_modules/csscomb-core/package.json deleted file mode 100644 index f410090..0000000 --- a/node_modules/csscomb/node_modules/csscomb-core/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "csscomb-core", - "version": "2.0.2", - "description": "Framework for writing postprocessors", - "dependencies": { - "gonzales-pe": "~3.0.0", - "minimatch": "0.2.12", - "vow": "0.4.4", - "vow-fs": "0.3.2" - }, - "main": "lib/core.js", - "maintainers": [ - { - "name": "Tony Ganch", - "email": "tonyganch+github@gmail.com", - "url": "http://tonyganch.com/" - } - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/csscomb/core" - }, - "readme": "# CSScomb Core\n\nCSScomb Core is a framework for writing postprocessors. \nIt provides you with a nice set of features:\n\n1. Parser with support of preprocessors\n1. API to create and use options\n1. API to process files and directories\n\n\n## Usage\n\n```js\nvar Comb = require('csscomb-core');\n// Constructor accepts a list of options to use and list of acceptable syntaxes.\nvar comb = new Comb(options, 'css');\n```\n\nFor a simple example of usage take a look [at a template project](https://github.com/csscomb/core-template). \nFeel free to fork it and modify.\n\n## List of public methods\n\nThere are a number of methods that become available once you create an instance.\n\n### comb.use(option)\n\nUse a plugin.\n\n- Params: *{Object}* Option's plugin\n- Return: *{CombCore}* Instance's object\n\n### comb.configure(config)\n\nLoad configuration from JSON. \nActivate and configure needed options.\n\n- Params: *{Object}* Config\n- Return: *{CombCore}* Instance's object\n\n### comb.getOptionsOrder()\n\nGet list of available options in exact order they will be processed. \nCan be used for testing purpose.\n\n- Return: *{Array}* List of options' names\n\n### comb.getValue(optionName)\n\nGet option's value. \nCan be used inside plugin's `process` method.\n\n- Params: *{String}* Option's name\n- Return: Value set by user for this option\n\n### comb.getSyntax()\n\nGet name of syntax that is currently being used. \nCan be used inside plugin's `process` method.\n\n- Return: *{String}* Syntax name\n\n### comb.processPath(path)\n\nProcess a file or a directory.\n\n- Params: *{String}* Path to file or directory\n- Return: *{Promise}*\n\n### comb.processDirectory(path)\n\nProcess all files in a directory.\n\n- Params: *{String}* Path to directory\n- Return: *{Promise}*\n\n### comb.processFile(path)\n\nProcess a single file.\n\n- Params: *{String}* Path to file\n- Return: *{Promise}*\n\n### comb.processString(string, options)\n\nProcess a string.\n\n- Params: \n *{String}* Code to process \n *{{context: String, filename: String, syntax: String}}* Options (optional)\n where *context* is\n Gonzales PE rule, *filename* is a file's name that is used to display errors and\n *syntax* is syntax name with `css` being a default value. \n- Return: *{String}* Processed string\n\n## Writing a plugin\n\nA plugin is a JavaScript object that has methods to set value and process AST\nnodes. \nTake a look at [Flip Comb](https://github.com/csscomb/core-template/blob/master/lib/options/flip-comments.js) for an example. \nThere are some fields you should take care of.\n\n### name\n\nOption's name as it should be used in config.\n\n- Required: yes\n- Acceptable value: *{String}*\n- Example: `\"flip-comments\"`\n\n### syntax\n\nList of syntaxes the option supports. \nThis depends on parser possibilities. \nCurrently the following work fine: `css`, `less`, `sass` and `scss`.\n\n- Required: yes\n- Acceptable value: *{Array}*\n- Example: `['css']`\n\n### accepts\n\nIn order to tell CSScomb Core which values are acceptable, plugin should have\neither `accepts` or `setValue` field. \n`accepts` should be used to provide patterns, while `setValue` is good for\nmodifying value before using it.\n\nYou can use one or several of the following: \n– `boolean: [true]` \n– `boolean: [false]` \n– `boolean: [true, false]` \n– `string: /regexp/` \n– `number: true`\n\n- Required: no, but if this field is missed, `setValue` must be set\n- Acceptable value: *{Object}*\n- Example: `{ boolean: [true] }`\n\n### setValue\n\nFunction to modify option's value before using it. \nThis field overrides `accepts` field if it's set in the plugin too.\n\n- Required: no, but if this field is missed, `accepts` must be set\n- Acceptable value: *{Function}*\n- Example: ` function(value) { return value * 4; }`\n\n### runBefore\n\nRun the plugin before another option. \n\n- Required: no\n- Acceptable value: *{String}* Another option's name\n- Example: `\"block-indent\"`\n\n### process\n\nModify AST nodes.\n\n- Required: yes\n- Acceptable value: *{Function}*\n- Example:
function(nodeType, nodeContent) {\n        if (nodeType === 'commentML') node[0] = ' (╯°□°)╯︵ ┻━┻ ';\n}
\n", - "readmeFilename": "README.md", - "gitHead": "dec99b7e4998ae8b11f8776770042a57277ca3dc", - "bugs": { - "url": "https://github.com/csscomb/core/issues" - }, - "homepage": "https://github.com/csscomb/core", - "_id": "csscomb-core@2.0.2", - "scripts": {}, - "_shasum": "a4defe2368b0a7528f6552e147029f82cc938745", - "_from": "csscomb-core@>=2.0.0-0 <2.1.0-0" -} diff --git a/node_modules/csscomb/node_modules/fs.realpath/LICENSE b/node_modules/csscomb/node_modules/fs.realpath/LICENSE new file mode 100644 index 0000000..5bd884c --- /dev/null +++ b/node_modules/csscomb/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + 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. diff --git a/node_modules/csscomb/node_modules/fs.realpath/README.md b/node_modules/csscomb/node_modules/fs.realpath/README.md new file mode 100644 index 0000000..a42ceac --- /dev/null +++ b/node_modules/csscomb/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/node_modules/csscomb/node_modules/fs.realpath/index.js b/node_modules/csscomb/node_modules/fs.realpath/index.js new file mode 100644 index 0000000..b09c7c7 --- /dev/null +++ b/node_modules/csscomb/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/node_modules/csscomb/node_modules/fs.realpath/old.js b/node_modules/csscomb/node_modules/fs.realpath/old.js new file mode 100644 index 0000000..b40305e --- /dev/null +++ b/node_modules/csscomb/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/node_modules/csscomb/node_modules/fs.realpath/package.json b/node_modules/csscomb/node_modules/fs.realpath/package.json new file mode 100644 index 0000000..28735d5 --- /dev/null +++ b/node_modules/csscomb/node_modules/fs.realpath/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + { + "raw": "fs.realpath@^1.0.0", + "scope": null, + "escapedName": "fs.realpath", + "name": "fs.realpath", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob" + ] + ], + "_from": "fs.realpath@>=1.0.0 <2.0.0", + "_id": "fs.realpath@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/fs.realpath", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/fs.realpath-1.0.0.tgz_1466015941059_0.3332864767871797" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.9.1", + "_phantomChildren": {}, + "_requested": { + "raw": "fs.realpath@^1.0.0", + "scope": null, + "escapedName": "fs.realpath", + "name": "fs.realpath", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "_shrinkwrap": null, + "_spec": "fs.realpath@^1.0.0", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/fs.realpath/issues" + }, + "dependencies": {}, + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "tarball": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" + }, + "files": [ + "old.js", + "index.js" + ], + "gitHead": "03e7c884431fe185dfebbc9b771aeca339c1807a", + "homepage": "https://github.com/isaacs/fs.realpath#readme", + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "fs.realpath", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "1.0.0" +} diff --git a/node_modules/csscomb/node_modules/glob/LICENSE b/node_modules/csscomb/node_modules/glob/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/csscomb/node_modules/glob/README.md b/node_modules/csscomb/node_modules/glob/README.md new file mode 100644 index 0000000..baa1d1b --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/README.md @@ -0,0 +1,368 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/node_modules/csscomb/node_modules/glob/changelog.md b/node_modules/csscomb/node_modules/glob/changelog.md new file mode 100644 index 0000000..4163677 --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/node_modules/csscomb/node_modules/glob/common.js b/node_modules/csscomb/node_modules/glob/common.js new file mode 100644 index 0000000..66651bb --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/csscomb/node_modules/glob/glob.js b/node_modules/csscomb/node_modules/glob/glob.js new file mode 100644 index 0000000..58dec0f --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/csscomb/node_modules/glob/node_modules/minimatch/LICENSE b/node_modules/csscomb/node_modules/glob/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/csscomb/node_modules/glob/node_modules/minimatch/README.md b/node_modules/csscomb/node_modules/glob/node_modules/minimatch/README.md new file mode 100644 index 0000000..ad72b81 --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/node_modules/minimatch/README.md @@ -0,0 +1,209 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/csscomb/node_modules/glob/node_modules/minimatch/minimatch.js b/node_modules/csscomb/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..5b5f8cf --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,923 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/csscomb/node_modules/glob/node_modules/minimatch/package.json b/node_modules/csscomb/node_modules/glob/node_modules/minimatch/package.json new file mode 100644 index 0000000..4d7e459 --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/node_modules/minimatch/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "minimatch@^3.0.4", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.4", + "spec": ">=3.0.4 <4.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob" + ] + ], + "_from": "minimatch@>=3.0.4 <4.0.0", + "_id": "minimatch@3.0.4", + "_inCache": true, + "_installable": true, + "_location": "/glob/minimatch", + "_nodeVersion": "8.0.0-pre", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.4.tgz_1494180669024_0.22628829116001725" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "5.0.0-beta.43", + "_phantomChildren": {}, + "_requested": { + "raw": "minimatch@^3.0.4", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.4", + "spec": ">=3.0.4 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083", + "_shrinkwrap": null, + "_spec": "minimatch@^3.0.4", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "description": "a glob matcher in javascript", + "devDependencies": { + "tap": "^10.3.2" + }, + "directories": {}, + "dist": { + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "shasum": "5166e286457f03306064be5497e8dbb0c3d32083", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "minimatch.js" + ], + "gitHead": "e46989a323d5f0aa4781eff5e2e6e7aafa223321", + "homepage": "https://github.com/isaacs/minimatch#readme", + "license": "ISC", + "main": "minimatch.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --cov" + }, + "version": "3.0.4" +} diff --git a/node_modules/csscomb/node_modules/glob/package.json b/node_modules/csscomb/node_modules/glob/package.json new file mode 100644 index 0000000..e500928 --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "glob@latest", + "scope": null, + "escapedName": "glob", + "name": "glob", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb" + ] + ], + "_from": "glob@latest", + "_id": "glob@7.1.2", + "_inCache": true, + "_installable": true, + "_location": "/glob", + "_nodeVersion": "8.0.0-pre", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/glob-7.1.2.tgz_1495224925341_0.07115248567424715" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "5.0.0-beta.56", + "_phantomChildren": { + "brace-expansion": "1.1.8" + }, + "_requested": { + "raw": "glob@latest", + "scope": null, + "escapedName": "glob", + "name": "glob", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "/", + "/vow-fs" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "_shasum": "c19c9df9a028702d678612384a6552404c636d15", + "_shrinkwrap": null, + "_spec": "glob@latest", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^7.1.2", + "tick": "0.0.6" + }, + "directories": {}, + "dist": { + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "shasum": "c19c9df9a028702d678612384a6552404c636d15", + "tarball": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "gitHead": "8fa8d561e08c9eed1d286c6a35be2cd8123b2fb7", + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.1.2" +} diff --git a/node_modules/csscomb/node_modules/glob/sync.js b/node_modules/csscomb/node_modules/glob/sync.js new file mode 100644 index 0000000..c952134 --- /dev/null +++ b/node_modules/csscomb/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/.editorconfig b/node_modules/csscomb/node_modules/gonzales-pe/.editorconfig new file mode 100644 index 0000000..5b42e03 --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/.editorconfig @@ -0,0 +1,6 @@ +# EditorConfig is awesome: http://EditorConfig.org +root = true + +[*] +indent_style = space +indent_size = 2 diff --git a/node_modules/csscomb/node_modules/gonzales-pe/.eslintrc.yaml b/node_modules/csscomb/node_modules/gonzales-pe/.eslintrc.yaml new file mode 100644 index 0000000..897280e --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/.eslintrc.yaml @@ -0,0 +1,63 @@ +--- + parserOptions: + ecmaVersion: 6 + sourceType: module + env: + es6: true + mocha: true + rules: + no-dupe-args: error + no-dupe-keys: error + no-duplicate-case: error + no-empty: error + no-func-assign: error + no-inner-declarations: error + no-irregular-whitespace: error + no-unexpected-multiline: error + no-unreachable: error + use-isnan: error + valid-jsdoc: + - off + - + prefer: + returns: return + preferType: + Boolean: boolean + Number: number + String: string + array: Array + object: Object + requireReturn: false + requireParamDescription: false + requireReturnDescription: false + valid-typeof: error + dot-location: + - error + - property + eqeqeq: error + no-empty-function: error + no-extend-native: error + no-extra-bind: error + no-multi-spaces: error + no-native-reassign: error + no-redeclare: error + no-return-assign: error + no-unused-expressions: error + radix: error + yoda: error + no-unused-vars: error + array-bracket-spacing: error + comma-spacing: error + indent: + - off + - 2 + max-len: error + max-params: + - warn + - 5 + no-lonely-if: error + no-nested-ternary: error + no-spaced-func: error + no-trailing-spaces: error + no-var: off + prefer-const: off diff --git a/node_modules/csscomb/node_modules/gonzales-pe/.gitmessage.txt b/node_modules/csscomb/node_modules/gonzales-pe/.gitmessage.txt new file mode 100644 index 0000000..2397edd --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/.gitmessage.txt @@ -0,0 +1,23 @@ +# Commit message format: [tag] Subject +# For a list of available tags see below. +# If this commit is applied it will...: + + +# Why was this change made?: + + +# Any references to tickets, articles, etc?: + + +# Available tags: +# [api] - for commits that change API +# [cli] - for commits that change CLI +# [css] - for commits that change anything in css syntax +# [docs] - for commits that change documentation +# [less] - for commits that change anything in less syntax +# [sass] - for commits that change anything in sass syntax +# [scss] - for commits that change anything in scss syntax +# [node] - for commits that change internal logic of nodes +# [refactor] - for commits that make code better without changing api +# [tests] - for commits that change test files only +# [tools] - for commits that change how dev environment works diff --git a/node_modules/csscomb/node_modules/gonzales-pe/.jscs.json b/node_modules/csscomb/node_modules/gonzales-pe/.jscs.json new file mode 100644 index 0000000..f4af042 --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/.jscs.json @@ -0,0 +1,64 @@ +{ + "disallowMultipleSpaces": true, + "disallowMultipleVarDecl": true, + "disallowPaddingNewlinesInBlocks": true, + "disallowSpaceBeforePostfixUnaryOperators": true, + "disallowSpacesInCallExpression": true, + "disallowSpacesInFunction": { + "beforeOpeningRoundBrace": true + }, + "disallowSpacesInsideArrayBrackets": true, + "disallowSpacesInsideObjectBrackets": true, + "disallowSpacesInsideParentheses": true, + "disallowTrailingComma": true, + "disallowTrailingWhitespace": true, + "esnext": true, + "excludeFiles": ["src/syntaxes.js"], + "maximumLineLength": 80, + "requireBlocksOnNewline": 1, + "requireCapitalizedComments": true, + "requireCapitalizedConstructors": true, + "requireCommaBeforeLineBreak": true, + "requireDotNotation": true, + "requireLineBreakAfterVariableAssignment": true, + "requireSemicolons": true, + "requireSpaceAfterBinaryOperators": true, + "requireSpaceAfterKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "while", + "return", + "typeof" + ], + "requireSpaceAfterLineComment": true, + "requireSpaceBeforeBinaryOperators": true, + "requireSpaceBeforeBlockStatements": true, + "requireSpaceBeforeKeywords": [ + "else", + "while", + "catch" + ], + "requireSpaceBetweenArguments": true, + "requireSpacesInForStatement": true, + "validateIndentation": 2, + "validateQuoteMarks": { + "mark": "'", + "escape": true + }, + "jsDoc": { + "checkAnnotations": "closurecompiler", + "checkParamNames": true, + "checkRedundantParams": true, + "checkRedundantReturns": true, + "checkReturnTypes": true, + "checkTypes": true, + "requireParamTypes": true, + "requireReturnTypes": true + } +} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/.jshintrc b/node_modules/csscomb/node_modules/gonzales-pe/.jshintrc new file mode 100644 index 0000000..1feb3bd --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/.jshintrc @@ -0,0 +1,10 @@ +{ + "eqeqeq": true, + "esnext": true, + "freeze": true, + "node": true, + "strict": true, + "undef": true, + "unused": true, + "-W084": true +} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/.npmignore b/node_modules/csscomb/node_modules/gonzales-pe/.npmignore index 1b51eb1..d434fb6 100644 --- a/node_modules/csscomb/node_modules/gonzales-pe/.npmignore +++ b/node_modules/csscomb/node_modules/gonzales-pe/.npmignore @@ -1,8 +1,6 @@ -*.iml -.DS_Store -GNUmakefile -.idea/ -benchmark/ +docs/ log/ +node_modules/ +scripts/ src/ test/ diff --git a/node_modules/csscomb/node_modules/gonzales-pe/.travis.yml b/node_modules/csscomb/node_modules/gonzales-pe/.travis.yml new file mode 100644 index 0000000..feae4ca --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/.travis.yml @@ -0,0 +1,14 @@ +language: node_js + +node_js: + - "5.0" + - "4.2" + - "4.1" + - "4.0" + - "0.12" + - "0.11" + - "0.10" + +matrix: + allow_failures: + - node_js: "0.11" diff --git a/node_modules/csscomb/node_modules/gonzales-pe/CHANGELOG.md b/node_modules/csscomb/node_modules/gonzales-pe/CHANGELOG.md index 7945431..131b077 100644 --- a/node_modules/csscomb/node_modules/gonzales-pe/CHANGELOG.md +++ b/node_modules/csscomb/node_modules/gonzales-pe/CHANGELOG.md @@ -1,18 +1,319 @@ -Gonzales changelog -================== +# Changelog -29.12.2013, Version 2.0.2 -------------------------- +#### Legend: + +:japanese_ogre: — be afraid of this change because it breaks the way things +worked before. +:star: — some new thing has been added. +:green_apple: — some bad thing has been fixed. + +## 22.10.2016, version 3.4.7 + +:green_apple: Included forgotten test for #226. +:green_apple: Fixed issue when `!important` was not parsed as function argument. + +## 22.10.2016, version 3.4.6 + +:green_apple: Changed parsing of `ident` nodes which fixed issue with asterisks +being parsed as idents instead of operators. +:green_apple: Fixed capitalisation in Changelog. + +## 20.10.2016, version 3.4.5 + +:green_apple: Change parser to strip DOS newlines from comments. +:star: Add links to README.md. + +## 12.08.2016, version 3.4.4 + +:green_apple: Fixed parsing of numbers following interpolation in class +selectors in Sass and SCSS. + +## 08.08.2016, version 3.4.3 + +:green_apple: Fixed parsing of unicode ranges. + +## 04.08.2016, version 3.4.2 + +:green_apple: Disable Google Closure Compiler due to some errors in parsing. + +## 27.07.2016, version 3.4.1 + +:star: Added publich script. +:green_apple: Fixed post-refactor error in Node#last method. + +## 27.07.2016, version 3.4.0 + +:star: Added `unicode-range` and `urange` node types in CSS, Less, Sass and SCSS. +:green_apple: Fixed parsing of trailing interpolation in compound selector in Sass and SCSS. +:green_apple: Fix parsing of hyphens after interpolation with parentSelectors in Sass and SCSS. +:green_apple: Added ESLint and moved linters to a separate script. +:green_apple: Fixed incorrect dimension wrap of unicode-ranges in CSS, Sass and SCSS. +:green_apple: Fixed parsing of hyphens in interpolated idents in Sass and SCSS. +:green_apple: Added compilation of JS using Google Closure. + +## 01.07.2016, version 3.3.6 + +:green_apple: Fixed parsing of nth selector without numbers before `n`. + +## 21.06.2016, version 3.3.5 + +:green_apple: Fixed issue with content at-rule and keyframes in Sass and SCSS. +:green_apple: Fixed namespace attribute selector in CSS, Sass and SCSS. +:green_apple: Fixed issue with modulo operator in values in Sass. +:green_apple: Fixed usage of @content with keyframes in Sass and SCSS. +:green_apple: Fixed namespace attribute selector issue in CSS, Sass and SCSS. +:green_apple: Fixed parsing of interpolations in pseudo-classes in Sass and SCSS. +:green_apple: Fixed interpolated percentage keyframe selector issue in Sass and SCSS. +:green_apple: Updated Travis config to not include environment variables. + +## 18.05.2016, version 3.3.4 + +:green_apple: Fixed mistake from `@3.3.2` version when parent selector was +"correctly" parsed as property instead of value. + +## 18.05.2016, version 3.3.3 + +:green_apple: Fixed prepublish script to build lib. + +## 18.05.2016, version 3.3.2 + +:star: Added AppVeyor badge. +:green_apple: Fixed build file to glue multiple syntaxes into one file. +:green_apple: Fixed parsing of functions inside urls in Sass. +:green_apple: Fixed parsing of mulitple keyframe selectors in CSS, Sass and SCSS. +:green_apple: Fixed parsing of parent selector as property in Sass and SCSS. +:green_apple: Fixed parsing of parent selector inside interpolations in Sass and SCSS. + +## 29.04.2016, version 3.3.1 + +:star: Added config for AppVeyor to run automated tests on Windows. +:green_apple: Fix installation for Windows. + +## 28.04.2016, version 3.3.0 + +:star: Added browser support. `build.sh` now build a script that can be used in +browsers. + +## 28.04.2016, version 3.2.7 + +:green_apple: Fixed typos and example in documentation. +:green_apple: Fixed parsing of functions inside urls in SCSS. +:green_apple: Fixed parsing of selectors starting with combinators in Sass, SCSS +and Less. +:green_apple: Fixed incorrect CRLF line numbers. +:green_apple: Fixed parsing of extends that sometimes were incorrectly parsed +as atrules. + +## 07.02.2016, version 3.2.6 + +:green_apple: Fixed the issue with installation of the package with npm@3. + +## 07.02.2016, version 3.2.5 + +:green_apple: Fixed parsing of nested multiline selectors group. + +## 07.02.2016, version 3.2.4 + +:star: Added support for `!global` in Sass. + +## 07.02.2016, version 3.2.3 + +:star: Modified `npm test` to remove `.DS_Store` files before running tests. +:star: Updated Travis config to use Node@5.0. +:star: Updated Travis config to include compiler info. +:star: Made it possible to build files if module is installed from github. +:green_apple: Fixed parsing of interpolation content in Sass and SCSS. +:green_apple: Fixed parsing of interpolation as part of parent selector +extension in Sass and SCSS. +:green_apple: Fixed issue with keyframeSelector in includes in SCSS. + +## 17.01.2016, version 3.2.2 + +:green_apple: Made `ParsingError#message` property writeable. + +## 19.10.2015, version 3.2.1 + +#### Parsing rules + +:green_apple: Fixed the issue when selectors inside extends were not wrapped in +`selector` nodes in Sass and SCSS. +:green_apple: Fixed parsing of multiple selectors in extends in Sass and SCSS. + +## 19.10.2015, version 3.2.0 + +#### Node types + +:star: Added new node type: `parentSelectorExtension`. + +#### Parsing rules + +:green_apple: Fixed parsing of parent selectors with extensions, like +`&__element` or `&--modifier`. + +## 19.10.2015, version 3.1.1 + +#### Parsing rules + +:green_apple: Fixed parsing of selectors starting or ending with a combinator +in Less, Sass and SCSS. + +## 18.10.2015, version 3.1.0 + +#### CLI + +:green_apple: Fixed passing a `--context` argument. +:green_apple: Fixed printing of a simplified tree. + +#### Node types + +:star: Added new node type: `keyframesSelector`. + +#### Parsing rules + +:green_apple: Fixed parsing of keyframes in all syntaxes. + +## 18.10.2015, version 3.0.3 + +#### Parsing rules + +:green_apple: Fixed parsing of spaces inside interpolations in Sass and SCSS. + +## 18.10.2015, version 3.0.2 + +#### Parsing rules + +:green_apple: Fixed the issue when operators were parsed as idents inside +parentheses in Sass and SCSS. + +## 18.10.2015, version 3.0.1 + +#### Parsing rules +:green_apple: Fixed parsing of parent selectors in SCSS and Less. +:green_apple: Fixed parsing of placeholders inside selectors in SCSS. + +## 18.10.2015, version 3.0.0 + +#### CLI + +:japanese_ogre: Made cli process stdin only if `-` argument is passed. +:star: Added help message. + +#### API + +:japanese_ogre: Renamed `parseTree.remove` to `parseTree.removeChild()`. +:japanese_ogre: Unwraped callback parameters for `traverse...` methods. +:japanese_ogre: Made `first()`, `last()` and `get()` methods return `null` if no child nodes were found. +:japanese_ogre: Made `node.length` return a number of child nodes. +:japanese_ogre: Renamed `rule` to `context`. +:star: Made `parseTree.removeChild()` return a removed node. +:star: Added `traverseBy...` methods to all nodes, not only root ones. +:star: Added support for specifying a tab size in spaces. + +#### Parsing rules + +:green_apple: Fixed parsing of single-line comments after `url` token. +:green_apple: Fixed parsing of interpolations inside id selectors in Less. +:green_apple: Fixed parsing of selectors according to spec. +:green_apple: Fixed parsing of placeholders as selectors in SCSS. + +#### Misc + +:star: Added Travis badge to Readme page. +:star: Added init script to build sources. +:star: Added commit message template. + +## 05.10.2015, version 3.0.0-beta + +#### CLI + +:star: Added `--simple` flag for printing a simplified tree structure. +:green_apple: CLI now prints parse tree to stdout. + +#### API + +:japanese_ogre: Parse tree is now represented as objects, not arrays. +:japanese_ogre: Renamed `gonzales.srcToAST()` to `gonzales.parse()`. +See [Readme](README.md#gonzalesparsecss-options). +:japanese_ogre: Renamed `gonzales.astToSrc()` to `parseTree.toString()`. +See [Readme](README.md#parsetreetostring). +:japanese_ogre: Renamed `gonzales.astToString()` to `parseTree.toJson()`. +See [Readme](README.md#parsetreetojson). +:star: Added information about column number to nodes. +:star: Added information about end position to nodes. +:green_apple: Made empty strings to be parsed as empty nodes. + +#### Node types + +:japanese_ogre: In Sass renamed `interpolatedVariable` to `interpolation`. +:japanese_ogre: Separated `include` and `extend` nodes. +:japanese_ogre: Replaced `filter` with `declaration`. +:japanese_ogre: Replaced `braces` with `brackets` and `parentheses`. +:japanese_ogre: Replaced `atrulers` with `block`. +:japanese_ogre: Renamed `nthSelector` to `pseudoClass`. +:japanese_ogre: Renamed `atrules`, `atruler` and `atruleb` to `atrule`. +:japanese_ogre: Renamed `functionBody` to `arguments`. +:japanese_ogre: Renamed `functionExpression` to `expression`. +:japanese_ogre: Renamed `attrib` to `attributeSelector`. +:japanese_ogre: Renamed `attrselector` to `attributeMatch`. +:japanese_ogre: Renamed `commentSL` to `singlelineComment`. +:japanese_ogre: Renamed `commentML` to `multilineComment`. +:japanese_ogre: Renamed `declDelim` to `declarationDelimiter`. +:japanese_ogre: Renamed `delim` to `delimiter`. +:japanese_ogre: Renamed `propertyDelim` to `propertyDelimiter`. +:japanese_ogre: Renamed `pseudoc` to `pseudoClass`. +:japanese_ogre: Renamed `pseudoe` to `pseudoElement`. +:japanese_ogre: Renamed `s` to `space`. +:japanese_ogre: Renamed `shash` to `color`. +:japanese_ogre: Renamed `vhash` to `id`. +:japanese_ogre: Removed `atrulerq`, `unary` and `unknown`. +:star: Added `attributeFlags`. +:star: Added `attributeName`. +:star: Added `attributeValue`. +:star: Added `conditionalStatement`. +:star: Added `namePrefix`. +:star: Added `namespacePrefix`. +:star: Added `namespaceSeparator`. +:star: Added `typeSelector`. + +#### Parsing rules + +:japanese_ogre: Spaces that separate two nodes are now put between those +nodes in parse tree. +:star: Added support for `extend` nodes in Less. +:star: Added support for equality and inequality signs in Sass and SCSS. +:star: Added support for `/deep/` combinator. +:star: Added support for `!optional` and `!global` in Sass and SCSS. +:green_apple: Fixed parsing of interpolations in Sass and SCSS. +:green_apple: Fixed parsing of arguments in Sass, SCSS and Less. +:green_apple: Fixed parsing of declaration delimiters in Sass. +:green_apple: Fixed the issue when pseudo-classes were parsed like declarations. +:green_apple: Fixed parsing of selectors on multiple lines in Sass. +:green_apple: Fixed parsing of percent sign as operator in SCSS. +:green_apple: Fixed parsing of pseudo-elements as selectors in Sass. + +#### Misc + +:star: Added Babel to build source files. +:star: Used mocha for tests. +:star: Added helper scripts. +:star: Added Travis config. +:rocket: Improved tests structure. +:rocket: Separated log and test scripts. +:rocket: Improved error messages. +:rocket: Removed benchmark tests. +:rocket: Moved source files from `lib` to `src` directory. +:rocket: Made package availbale for install from GitHub. + +## 29.12.2013, version 2.0.2 - Sass includes can have both arguments list and content block, i.e. `@include nani() { color: tomato }` is valid syntax. -18.11.2013, Version 2.0.1 -------------------------- +## 18.11.2013, version 2.0.1 + - Bring back lost whitespaces and comments -11.11.2013, Version 2.0.0 -------------------------- +## 11.11.2013, version 2.0.0 - Support preprocessors: Sass (both SCSS and indented syntax), LESS. - New node types: @@ -44,45 +345,37 @@ Gonzales changelog - Add script to test one specific css string - Add token's index number to info object -11.02.2013, Version 1.0.7 -------------------------- +## 11.02.2013, version 1.0.7 - Identifiers like `_0` are identifiers now. - Throw error instead of console.error: https://github.com/css/csso/issues/109 -25.11.2012, Version 1.0.6 -------------------------- +## 25.11.2012, version 1.0.6 - Typo fix (global variable leak): https://github.com/css/csso/pull/110 - Attribute selectors extended by `|`. - `not(..)` pseudo-class special support: https://github.com/css/csso/issues/111 -28.10.2012, Version 1.0.5 -------------------------- +## 28.10.2012, version 1.0.5 - Better error line numbering: https://github.com/css/gonzales/issues/2 -11.10.2012, Version 1.0.4 -------------------------- +## 11.10.2012, version 1.0.4 - CSSO issue (@page inside @media error): https://github.com/css/csso/issues/90 -10.10.2012, Version 1.0.3 -------------------------- +## 10.10.2012, version 1.0.3 - Both .t-1 and .t-01 should be idents: https://github.com/css/gonzales/issues/1 -08.10.2012, Version 1.0.2 -------------------------- +## 08.10.2012, version 1.0.2 - CSSO issue (filter + important breaks csso v1.3.1): https://github.com/css/csso/issues/87 -08.10.2012, Version 1.0.1 -------------------------- +## 08.10.2012, version 1.0.1 - CSSO issue ("filter" IE property breaks CSSO v1.3.0): https://github.com/css/csso/issues/86 -03.10.2012, Version 1.0.0 -------------------------- +## 03.10.2012, version 1.0.0 - First revision. diff --git a/node_modules/csscomb/node_modules/gonzales-pe/README.md b/node_modules/csscomb/node_modules/gonzales-pe/README.md index 7319a3f..f2154dd 100644 --- a/node_modules/csscomb/node_modules/gonzales-pe/README.md +++ b/node_modules/csscomb/node_modules/gonzales-pe/README.md @@ -1,70 +1,772 @@ -Gonzales is a fast CSS parser. -Gonzales PE is a rework with support of preprocessors. +# Gonzales PE @dev -Currently those are supported: SCSS, Sass, LESS. +[![Build Status](https://travis-ci.org/tonyganch/gonzales-pe.svg)] +(https://travis-ci.org/tonyganch/gonzales-pe) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/m29jphtrqt398v2o/branch/dev?svg=true)] +(https://ci.appveyor.com/project/tonyganch/gonzales-pe/branch/dev) -For a plan of future work see [issue #4](https://github.com/tonyganch/gonzales-pe/issues/4). +Gonzales PE is a CSS parser which plays nicely with preprocessors. +Currently those are supported: SCSS, Sass, LESS. +Try out Gonzales PE online: [Gonzales PE Playground](http://tonyganch.com/gonzales-pe/). ## Install -To install globally: +(1) To install command-line tool globally: - npm install gonzales-pe -g +```bash +npm install -g git://github.com/tonyganch/gonzales-pe.git#dev +``` + +(2) To install parser as a project dependency: + +```bash +npm install --save git://github.com/tonyganch/gonzales-pe.git#dev +``` + +(3) If for some reason you want to build files yourself: + +```bash +# Clone the repo. +git clone git@github.com:tonyganch/gonzales-pe.git +# Go to dev branch. +git checkout dev +# Install project dependencies. +npm install +# Install git hooks and build files. +npm run init +``` + +## API + +Basically there are a few things you can do: + +1. parse css string and get a parse tree in return; +2. modify tree nodes; +3. remove tree nodes; +4. add new nodes to the tree; +5. convert modified tree back to a string. + +The different type of tree nodes can be found in [docs/node-types.md](https://github.com/tonyganch/gonzales-pe/blob/dev/docs/node-types.md). + +In examples below I assume that `gonzales` is a parser module and `parseTree` +is some parsed css: + +```js +let gonzales = require('gonzales-pe'); +let parseTree = gonzales.parse(css); +``` + +### gonzales.createNode(options) -To install as a project dependency: +##### Description - npm install gonzales-pe +Creates a new node. Useful when you need to add something to a tree. -To install dev branch: +##### Parameters - npm install git://github.com/tonyganch/gonzales-pe.git#dev + + + + + + + +
{Object}optionsOptions to pass to a `Node` constructor.
-To clone from github: +##### Returns - git clone git@github.com:tonyganch/gonzales-pe.git + + + + + +
{Object}A new node.
-## Build +##### Examples -If you installed/cloned the repo from GitHub, make sure to build library files -first. -It can be done by running `make` in the module's root directory. -`make` will build both Node.js and web versions (all files are comments-free -but not compressed). -If you need a minified version for production, feel free to use uglifier of -your choice. +```js +let css = 'a {color: tomato}'; +let parseTree = gonzales.parse(css); +let node = gonzales.createNode({ type: 'animal', content: 'panda' }); +parseTree.content.push(node); +``` + + +### gonzales.parse(css[, options]) + +##### Description + +Parses a css string. + +##### Parameters + + + + + + + + + + + + +
{string}cssA string to parse.
{Object=}optionsOptional. Additional options: +
    +
  • + {string} syntax — any of the following: css, + less, sass, scss. + Default one is css. +
  • +
  • + {string} context — root node's type. For a list of available + values see "Node types". Default + one is stylesheet. +
  • +
  • + {number} tabSize — size of a tab character in spaces. + Default one is 1. +
  • +
+
+ +##### Returns + + + + + + +
{Object}Parse tree.
+ +##### Examples + +```js +let css = 'a {color: tomato}'; +let parseTree = gonzales.parse(css); +``` + +```js +let less = 'a {$color: tomato}'; +let parseTree = gonzales.parse(less, {syntax: 'less'}); +``` + +```js +let less = '$color: tomato'; +let parseTree = gonzales.parse(less, {syntax: 'less', rule: 'declaration'}); +``` + +### parseTree.contains(type) + +##### Description + +Checks whether there is a child node of given type. -## Use +##### Parameters -Require Gonzales in your project: + + + + + + +
{string}type + Node type we're looking for. For a list of available values see + "Node types". +
- var gonzales = require('gonzales-pe'); +##### Returns -Do something: + + + + + +
{boolean} + true if a tree contains a child node of a given type, + false otherwise. +
+ +##### Examples + +```js +if (parseTree.contains('space')) { + doSomething(); +} +``` - var css = 'a { color: tomato }'; - console.log(gonzales.cssToAST(css)); +### parseTree.content + +##### Returns + + + + + + +
{string|Array}Node's content (child nodes or a string).
+ +### parseTree.eachFor([type, ]callback) + +##### Description + +Calls a function for every child node in tree. If `type` parameter is passed, +calls a function only for child nodes of a given type. The main difference from +`parseTree.forEach()` is that this method loops through node list from the end +to beginning. + +##### Parameters + + + + + + + + + + + + +
{string=}type + Optional. A node type by which to filter child nodes before applying + a callback function. For a list of available values see + "Node types". +
{Function}callback + Function to call for every child node. Accepts following parameters: +
    +
  • {Object} — a child node;
  • +
  • {number} — index of the child node in node list;
  • +
  • + {Object} — parent node (equals to parseTree). +
  • +
+
+ +##### Examples + +```js +parseTree.eachFor(function(childNode) { + doSomething(childNode); +}); +``` -You can learn more about available methods on [Gonzales usage](doc/Gonzales-Usage.md) page. +```js +// Remove all child spaces. +parseTree.eachFor('space', function(spaceNode, i) { + parseTree.removeChild(i); +}); +``` -AST is described on [Gonzales AST description](doc/AST-Description.md) page. +### parseTree.end + +##### Returns + + + + + + +
{Object} + End position of the node. Contains following info: +
    +
  • + {number} line — last symbol's line number + (1-based index); +
  • +
  • + {number} column — last symbol's column number + (1-based index). +
  • +
+
+ +### parseTree.first([type]) + +##### Description + +Gets the first child node. If `type` parameter is passed, gets the first child +node of a given type. If no node has been found, returns `null`. + +##### Parameters + + + + + + + +
{string=}type + Optional. Node type to look for. For a list of available values see + "Node types". +
+ +##### Returns + + + + + + +
{?Object}A node.
+ +##### Examples + +```js +let node = parseTree.first(); +node.content = 'panda'; +``` -You can also invoke gonzales via a shell command (if you globally install it via `npm install gonzales-pe -g`) +```js +let node = parseTree.first('multilineComment'); +node.content = 'panda'; +``` +### parseTree.forEach([type, ]callback) + +##### Description + +Calls a function for every child node in tree. If `type` parameter is passed, +calls a function only for child nodes of a given type. The main difference from +`parseTree.eachFor()` is that this method loops through node list from the +beginnig to end. + +##### Parameters + + + + + + + + + + + + +
{string=}type + Optional. A node type by which to filter child nodes before applying + a callback function. For a list of available values see + "Node types". +
{Function}callback + Function to call for every child node. Accepts following parameters: +
    +
  • {Object} — a child node;
  • +
  • {number} — index of the child node in node list;
  • +
  • + {Object} — parent node (equals to parseTree). +
  • +
+
+ +##### Examples + +```js +parseTree.forEach(function(childNode) { + doSomething(); +}); ``` -gonzales myFile.css + +```js +parseTree.forEach('space', function(spaceNode) { + doSomething(); +}); ``` -Outputs the AST for that file. Example output: +### parseTree.get(index) + +##### Description + +Gets *nth* child of the `parseTree`. If no node has been found, returns `null`. +##### Parameters + + + + + + + +
{number}indexIndex number of node which we're looking for.
+ +##### Returns + + + + + + +
{?Object}A node.
+ +##### Examples + +```js +var node = parseTree.get(2); +doSomething(node); ``` -['stylesheet', - ['atrules', - ['atkeyword', - ['ident', 'import']], - ['s', ' -']]] + +### parseTree.insert(index, node) + +##### Description + +Inserts a node to a given position in `parseTree`. + +##### Parameters + + + + + + + + + + + + +
{number}indexIndex of position where to insert the node.
{Object}nodeA node to insert.
+ +##### Examples + +```js +let node = gonzales.createNode({type: 'animal', content: 'panda'}); +parseTree.insert(2, node); ``` +### parseTree.is(type) + +##### Description + +Checks whether the node is of given type. + +##### Parameters + + + + + + + +
{string}type + A node type against which to check type of parseTree. + For a list of available values see + "Node types". +
+ +##### Returns + + + + + + +
{boolean} + true if types are equal, false otherwise. +
+ +##### Examples + +```js +if (node.is('space')) { + node.content = ''; +} +``` + +### parseTree.last(type) + +Gets the last child node. If `type` parameter is passed, gets the last child +node of a given type. If no node has been found, returns `null`. + +##### Parameters + + + + + + + +
{string=}type + Optional. Node type to look for. For a list of available values see + "Node types". +
+ +##### Returns + + + + + + +
{?Object}A node.
+ +##### Examples + +```js +let node = parseTree.last(); +node.content = 'panda'; +``` + +```js +let node = parseTree.last('multilineComment'); +node.content = 'panda'; +``` + +### parseTree.length + +##### Returns + + + + + + +
{number}Number of child nodes.
+ +### parseTree.removeChild(index) + +##### Description + +Removes a child node at a given position. + +##### Parameters + + + + + + + +
{number}indexIndex of a child node we need to remove.
+ +##### Returns + + + + + + +
{Object}Removed node.
+##### Examples + +```js +// Swap nodes. +var node = parseTree.removeChild(1); +parseTree.insert(0, node); +``` + +### parseTree.start + +##### Returns + + + + + + +
{Object} + Start position of the node. Contains following info: +
    +
  • + {number} line — first symbol's line number + (1-based index); +
  • +
  • + {number} column — first symbol's column number + (1-based index). +
  • +
+
+ + +### parseTree.syntax + +##### Returns + + + + + + +
{string}Syntax of original parsed string.
+ +### parseTree.toJson() + +##### Description + +Converts parse tree to JSON. Useful for printing. + +##### Returns + + + + + + +
{Object}Parse tree in JSON
+ +### parseTree.toString() + +##### Description + +Converts parse tree back to string according to original syntax. + +##### Returns + + + + + + +
{string}A compiled string.
+ +##### Examples + +```js +let css = parseTree.toString(); +``` + +### parseTree.traverse(callback) + +##### Description + +Calls the function for every node in a tree including `parseTree` itself. + +##### Parameters + + + + + + + +
{Function}callback + Function to apply to every node. Accepts following parameters: +
    +
  • {Object} — a node to which we apply callback;
  • +
  • {number} — node's index number inside its parent;
  • +
  • {Object} — a node's parent;
  • +
  • + {number} — node's nesting level relative to its parent. +
  • +
+
+ +##### Examples + +```js +parseTree.traverse(function(node, index, parent) { + if (node.is('multilineComment')) { + parent.removeChild(index); + } else if (node.is('space')) { + node.content = ' '; + } +}); +``` + +### parseTree.traverseByType(type, callback) + +##### Description + +This method should be called for a root node, because calling it for a child +will be more time consuming. +Calls the function for every node of a given type. This means not just child +nodes, but grandchilds and so on. + +##### Parameters + + + + + + + + + + + + +
{string}type + Node type. For a list of available values please see + "Node types". +
{Function}callback + Function to apply to every node of a given type. + Accepts following parameters: +
    +
  • {Object} — a node to which we apply callback;
  • +
  • {number} — node's index number inside its parent;
  • +
  • {Object} — a node's parent.
  • +
+
+ +##### Examples + +```js +// Remove all comments. +parseTree.traverseByType('multilineComment', function(node, index, parent) { + parent.removeChild(index); +}); +``` + +### parseTree.traverseByTypes(types, callback) + +##### Description + +This method should be called for a root node, because calling it for a child +will be more time consuming. +Calls the function for every node of given types. This means not just child +nodes, but grandchilds and so on. + +##### Parameters + + + + + + + + + + + + +
{Array.string}types + List of node types. For a list of available values please see + "Node types". +
{Function}callback + Function to apply to every node of given types. + Accepts following parameters: +
    +
  • {Object} — a node to which we apply callback;
  • +
  • {number} — node's index number inside its parent;
  • +
  • {Object} — a node's parent.
  • +
+
+ +##### Examples + +```js +// Remove all comments and spaces. +let types = ['multilineComment', 'space']; +parseTree.traverseByTypes(types, function(node, index, parent) { + parent.removeChild(index); +}); +``` + +### parseTree.type + +##### Returns + + + + + + +
{string} + Node type. For a list of available values see + "Node types". +
+ + ## Test To run tests: @@ -74,8 +776,8 @@ To run tests: This command will build library files from sources and run tests on all files in syntax directories. -Every test has 3 files: source stylesheet, expected AST and expected string -compiled back from AST to css. +Every test has 3 files: source stylesheet, expected parse tree and expected +string compiled back from parse tree to css. If some tests fail, you can find information in test logs: @@ -90,9 +792,7 @@ If you want to test one specific string or get a general idea of how Gonzales works, you can use `test/ast.js` file. Simply change the first two strings (`css` and `syntax` vars) and run: - node test/ast.js - -Please remember to also run `make` every time you modify any source files. + node test/single-test.js ## Report diff --git a/node_modules/csscomb/node_modules/gonzales-pe/appveyor.yml b/node_modules/csscomb/node_modules/gonzales-pe/appveyor.yml new file mode 100644 index 0000000..2d3905d --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/appveyor.yml @@ -0,0 +1,21 @@ +# Test against this version of Node.js +environment: + nodejs_version: "4.2" + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm test + +# Don't actually build. +build: off diff --git a/node_modules/csscomb/node_modules/gonzales-pe/bin/gonzales.js b/node_modules/csscomb/node_modules/gonzales-pe/bin/gonzales.js index adfe102..22968a2 100755 --- a/node_modules/csscomb/node_modules/gonzales-pe/bin/gonzales.js +++ b/node_modules/csscomb/node_modules/gonzales-pe/bin/gonzales.js @@ -1,11 +1,116 @@ -var gonzales = require('../lib/gonzales'), - fs = require('fs'), - filename = process.argv[2]; +#!/usr/bin/env node -if (!filename) { - console.log('Please supply a filename. Usage "gonzales file"'); - process.exit(); +'use strict'; + +var parseArgs = require('minimist'); +var gonzales = require('..'); +var fs = require('fs'); +var path = require('path'); + +var options = getOptions(); + +if (options.help) { + displayHelp(); + process.exit(0); +} + +if (isSTDIN()) { + processSTDIN(); +} else { + processFile(options._[0]); } -console.log(gonzales.astToTree(gonzales.cssToAST(fs.readFileSync(filename).toString()))); +function getOptions() { + var parserOptions = { + boolean: ['silent', 'simple'], + alias: { + help: 'h', + syntax: 's', + context: 'c' + } + }; + return parseArgs(process.argv.slice(2), parserOptions); +} + +function isSTDIN() { + return options._.indexOf('-') !== -1; +} + +function processSTDIN() { + var input = ''; + process.stdin.resume(); + process.stdin.setEncoding('utf8'); + process.stdin.on('data', data => { + input += data; + }); + process.stdin.on('end', () => { + processInputData(input); + }); +} +function processFile(file) { + if (!file) process.exit(0); + if (!options.syntax) options.syntax = path.extname(file).substring(1); + var css = fs.readFileSync(file, 'utf-8').trim(); + processInputData(css); +} + +function processInputData(input) { + try { + var ast = gonzales.parse(input, { + syntax: options.syntax, + context: options.context + }); + printTree(ast); + process.exit(0); + } catch (e) { + if (!options.silent) process.stderr.write(e.toString()); + process.exit(1); + } +} + +function printTree(ast) { + if (!options.simple) { + var tree = ast.toJson(); + process.stdout.write(tree); + } else { + var lastLevel; + + ast.traverse(function(node, i, parent, lastLevel) { + var type = node.type; + var spaces = new Array(lastLevel).join(' |'); + if (typeof node.content === 'string') { + var content = JSON.stringify(node.content); + console.log(spaces, '->', type); + console.log(spaces, ' ', content); + } else { + console.log(spaces, '->', type); + } + }); + + var spaces = new Array(lastLevel).join(' -'); + console.log(spaces); + } +} + +function displayHelp() { + var help = [ + 'NAME', + ' gonzlaes-pe — Parse a css file and print its parse tree in JSON', + '', + 'SYNOPSIS', + ' gonzales-pe [options] file.js', + ' cat file.js | gonzales-pe [options] -', + '', + 'OPTIONS', + ' -s, --syntax', + ' Syntax name: css, less, sass or scss.', + ' -c, --context', + ' Context of code part. See docs on node types for more info.', + ' --simple', + ' Print a simplified parse tree structure instead of JSON.', + ' --silent', + ' Don\'t print any error messages.' + ]; + console.log(help.join('\n')); +} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/doc/AST-Description.md b/node_modules/csscomb/node_modules/gonzales-pe/doc/AST-Description.md deleted file mode 100644 index cac1124..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/doc/AST-Description.md +++ /dev/null @@ -1,1214 +0,0 @@ -### 1. Gonzales AST — Abstract Syntax Tree - -If you don't know what AST is, first read [article at Wikipedia] (http://en.wikipedia.org/wiki/Abstract_syntax_tree). - -In general Gonzales AST looks like this: - - ['stylesheet', - ['atrules', ..], - ['s', ' '], - ['commentML', 'sample'], - ['ruleset', - ['selector', ..]], - ['block', ..]] - -#### Known issues - -*operator* / *unary* — rather artificial division, in addition *unary* is -misnamed. Utilities working with AST may need to handle both types of nodes -instead of one. - -*raw* — currently *raw* contains unparsed `progid` IE. In the future it makes -sense to parse that parts in full AST. - -### 2. Node structure - -Node is a JavaScript array of the following type: - - ['token type', <- required - ] <- optional - -Content can be other nodes or CSS source. - -In case `needInfo` parameter was `true`, the node includes info object. -It contains token's index number and token's line number: - - [{ ln: ln, tn: tn }, <- info object - 'token type', <- required - ] <- optional - -### 3. Node types - -In alphabetical order. - -#### arguments - -Mixin's arguments. -Valid only for scss syntax. -Can be any number of: -- *string*, -- *ident*, -- *vhash*, -- *variable*, -- *number*, -- *declaration*, - -wraped with braces, mixed with spaces and separated with commas. - -``` -(10) - -↓ - -['arguments', - ['number', '10']] -``` - -#### atkeyword - -@-rule identifier. - -``` -@font-face - -↓ - -['atkeyword', - ['ident', 'font-face']] -``` - -#### atruleb - -Block @-rule. - -Consists of: -- *atkeyword* (@-rule identifier), -- rule, and -- *block*. - -``` -@test x y {p:v} - -↓ - -['atruleb', - ['atkeyword', - ['ident', 'test']], - ['s', ' '], - ['ident', 'x'], - ['s', ' '], - ['ident', 'y'], - ['s', ' '], - ['block', - ['declaration', - ['property', - ['ident', 'p']], - ['propertyDelim'], - ['value', - ['ident', 'v']]]]] -``` - -#### atruler, atrulerq, atrulers - -@-rule with a ruleset. - -Consists of: -- *atkeyword* (@-rule identifier), -- rule, and -- styles set. - -``` -@media x y {s{p:v}} - -↓ - -['atruler', - ['atkeyword', - ['ident', 'media']], - ['atrulerq', - ['s', ' '], - ['ident', 'x'], - ['s', ' '], - ['ident', 'y'], - ['s', ' ']], - ['atrulers', - ['ruleset', - ['selector', - ['simpleselector', - ['ident', 's']]], - ['block', - ['declaration', - ['property', - ['ident', 'p']], - ['propertyDelim'], - ['value', - ['ident', 'v']]]]]]] -``` - -#### atrules - -Single-line @-rule. - -Consists of: -- *atkeyword* (@-rule identifier), and -- rule. - -``` -@import url('/css/styles.css') - -↓ - -['atrules', - ['atkeyword', - ['ident', 'import']], - ['s', ' '], - ['uri', - ['string', ''/css/styles.css'']]] -``` - -#### attrib - -Attribute selector. - -``` -[a='b'] - -↓ - -['attrib', - ['ident', 'a'], - ['attrselector', '='], - ['string', ''b'']] -``` - -#### attrselector - -Attribute selector operator: `=`, `~=`, `^=`, `$=`, `*=`, `|=`. - -``` -[a='b'] - -↓ - -['attrib', - ['ident', 'a'], - ['attrselector', '='], - ['string', ''b'']] -``` - -#### block - -Part of the style in braces: `{...}`. -For `*.sass` files — code that will be compiled to a block. - -``` -{ color: red } - -↓ - -['block', - ['s', ' '], - ['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'red'], - ['s', ' ']]]] -``` - -#### braces - -Braces and their content. - -``` -() -(1) - -↓ - -['braces', '(', ')'] -['braces', '(', ')', - ['number', '1']] -``` - -#### class - -Class. - -``` -.abc - -↓ - -['class', - ['ident', 'abc']] -``` - -#### combinator - -Combinator: `+`, `>`, `~`. - -``` -x+y { .. } - -↓ - -['simpleselector', - ['ident', 'x'], - ['combinator', '+'], - ['ident', 'y']] -``` - -#### commentML - -Multi-line comment. - -``` -/* test */ - -↓ - -['commentML', ' test '] -``` - -#### commentSL - -Single-line comment. -Valid for less, scss and sass. - -``` -// comment - -↓ - -['commentSL', ' comment'] -``` - -#### condition - -Condition. -Valid for less, scss and sass. - -``` -@if nani == panda - -↓ - -['condition', - ['atkeyword', - ['ident', 'if']], - ['s', ' '], - ['ident', 'nani'], - ['s', ' '], - ['operator', '='], - ['operator', '='], - ['s', ' '], - ['ident', 'panda']] -``` - -#### declaration - -Property/value pair. - -Consists of: -- *property*, -- *propertyDelim* and -- *value* - -mixed with spaces and comments. - -``` -color: red - -↓ - -['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'red']]] -``` - -#### declDelim - -Declaration delimiter in block: `\n` for sass, `;` for other syntaxes. - -``` -x {a: b; c: d} - -↓ - -['block', - ['declaration', - ['property', - ['ident', 'a']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'b']]], - ['declDelim'], - ['s', ' '], - ['declaration', - ['property', - ['ident', 'c']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'd']]]] -``` - -#### default - -`!default` keyword. -Valid only for scss and syntax. - -``` -a: b !default - -↓ - -['declaration', - ['property', - ['ident', 'a']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'b'], - ['s', ' '], - ['default']]] -``` - -#### delim - -Simple selector delimiter in selector: `,`. - -``` -x,y{ .. } - -↓ - -['selector', - ['simpleselector', - ['ident', 'x']], - ['delim'], - ['simpleselector', - ['ident', 'y']]] -``` - -#### dimension - -Number with dimension unit. - -``` -10px - -↓ - -['dimension', - ['number', '10'], - ['ident', 'px']] -``` - -#### escapedString - -Escaped string. -Valid only for less. - -``` -~"ms:alwaysHasItsOwnSyntax.For.@{what}()" - -↓ - -['escapedString', '"ms:alwaysHasItsOwnSyntax.For.@{what}()"']] -``` - -#### filter, filterv, progid - -Node to store IE `filter`. - -Consists of: -- *property* (property name), -- *filterv* (contents), and -- *progid* (`progid` itself). - -``` -filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='a.png',sizingMethod='scale') - -↓ - -['filter', - ['property', - ['ident', 'filter']], - ['propertyDelim'], - ['filterv', - ['progid', - ['raw', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src='a.png',sizingMethod='scale')']]]] -``` - -#### function, functionBody - -Function. - -Consists of: -- *ident* (function name), and -- *functionBody* (function body). - -``` -color: rgb(255,0,0) - -↓ - -['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['function', - ['ident', 'rgb'], - ['functionBody', - ['number', '255'], - ['operator', ','], - ['number', '0'], - ['operator', ','], - ['number', '0']]]]] -``` - -#### functionExpression - -Node to store `expression`. - -``` -left:expression(document.body.offsetWidth+1) - -↓ - -['declaration', - ['property', - ['ident', 'left']], - ['propertyDelim'], - ['value', - ['functionExpression', 'document.body.offsetWidth+1']]] -``` - -#### ident - -Identifiers or names. - -In *atkeyword*: - -``` -@import ..; - -↓ - -['atkeyword', - ['ident', 'import']] -``` - -In *class*: -``` -.abc - -↓ - -['class', - ['ident', 'abc']] -``` - -In *dimension*: -``` -10px - -↓ - -['dimension', - ['number', '10'], - ['ident', 'px']] -``` - -#### important - -`!important` keyword. - -``` -a: b !important - -↓ - -['declaration', - ['property', - ['ident', 'a']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'b'], - ['s', ' '], - ['important']]] -``` - -#### include - -Included mixin. - -For scss and sass: - -``` -@include nani - -↓ - -['include', - ['atkeyword', - ['ident', 'include']], - ['s', ' '], - ['simpleselector', - ['ident', 'nani']]] -``` - -For less: - -``` -.nani(2px) - -↓ - -['include', - ['class', - ['ident', 'nani']], - ['arguments', - ['dimension', - ['number', '2'], - ['ident', 'px']]]] -``` - -#### interpolatedVariable - -Valid only for less. - -``` -@{nani} - -↓ - -['interpolatedVariable', - ['ident', 'nani']] -``` - -#### interpolation - -Interpolated expression - -Valid only for scss and sass. - -``` -#{$nani} - -↓ - -['interpolation', - ['variable', - ['ident', 'nani']]] -``` - - -#### loop - -Valid only for scss and sass. - -``` -@while 1 > 2 {a{p:v}} - -↓ - -['loop', - ['atkeyword', - ['ident', 'while']], - ['s', ' '], - ['number', '1'], - ['s', ' '], - ['operator', '>'], - ['s', ' '], - ['number', '2'], - ['s', ' '], - ['block', - ['ruleset', - ['selector', - ['simpleselector', - ['ident', 'a']]], - ['block', - ['declaration', - ['property', - ['ident', 'p']], - ['propertyDelim'], - ['value', - ['ident', 'v']]]]]]] -``` - -#### mixin - -For scss and sass: - -``` -@mixin nani {color:tomato} - -↓ - -['mixin', - ['atkeyword', - ['ident', 'mixin']], - ['s', ' '], - ['ident', 'nani'], - ['s', ' '], - ['block', - ['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['ident', 'tomato']]]]] -``` - -For less: - -``` -.nani (@color) {color:@color} - -↓ - -['mixin', - ['class', - ['ident', 'nani']], - ['s', ' '], - ['arguments', - ['variable', - ['ident', 'color']]], - ['s', ' '], - ['block', - ['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['variable', - ['ident', 'color']]]]]] -``` - -#### namespace - -Namespace sign in *simpleselector*. - -``` -*|E { .. } - -↓ - -['simpleselector', - ['ident', '*'], - ['namespace'], - ['ident', 'E']] -``` - -#### nth - -Numbers and identifiers in *nthselector*. - -``` -:nth-child(2n+1) - -↓ - -['nthselector', - ['ident', 'nth-child'], - ['nth', '2n'], - ['unary', '+'], - ['nth', '1']] -``` - -#### nthselector - -`:nth-` pseudo-classes. - -It consists of a pseudo-class *ident* and content. - -``` -:nth-last-child(+3n-2) - -↓ - -['nthselector', - ['ident', 'nth-last-child'], - ['unary', '+'], - ['nth', '3n'], - ['unary', '-'], - ['nth', '2']] -``` - -#### number - -Number. - -``` -10 -12.34 - -↓ - -['number', '10'] -['number', '12.34'] -``` - -#### operator - -Operator: `/`, `,`, `:`, `=`. - -``` -test(x,y) - -↓ - -['function', - ['ident', 'test'], - ['functionBody', - ['ident', 'x'], - ['operator', ','], - ['ident', 'y']]] -``` - -#### parentselector - -Valid only for less, scss and sass. - -``` -&.nani - -↓ - -['parentselector'], -['class', - ['ident', 'nani']] -``` - -#### percentage - -Number with percent sign. - -``` -10% - -↓ - -['percentage', - ['number', '10']] -``` - -#### placeholder - -Placeholder. -Valid only for scss and sass. - -``` -%button - -↓ - -['placeholder', - ['ident', 'button']] -``` - -#### property - -CSS property. - -``` -top:0 -$color: tomato - -↓ - -['declaration', - ['property', - ['ident', 'top']], - ['propertyDelim'], - ['value', - ['number', '0']]] - - -['declaration', - ['property', - ['variable', 'color']], - ['propertyDelim'], - ['value', - ['ident', 'tomato']]] -``` - -#### propertyDelim - -Delimiter `:` between property and value. - -``` -color: tomato - -↓ - -['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'tomato']]] -``` - -Sass allows you to put `:` before property: - -``` -:color tomato - -↓ - -['declaration', - ['propertyDelim'], - ['property', - ['ident', 'color'], - ['s', ' ']], - ['value', - ['ident', 'tomato']]] -``` - -#### pseudoc - -Pseudo-class. - -``` -test:visited - -↓ - -['simpleselector', - ['ident', 'test'], - ['pseudoc', - ['ident', 'visited']]] -``` - -#### pseudoe - -Pseudo-element. - -``` -p::first-line - -↓ - -['simpleselector', - ['ident', 'p'], - ['pseudoe', - ['ident', 'first-line']]] -``` - -#### raw - -Unparsed parts of the style. Refers to a specific browser specific extensions, -usually IE `filter`. - -``` -progid:DXImageTransform.Microsoft.AlphaImageLoader(src='a.png',sizingMethod='scale') - -↓ - -['progid', - ['raw', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src='a.png',sizingMethod='scale')']]]] -``` - -#### ruleset - -A set of rules with selectors. - -Consists of: -- *selector* (selector), and -- *block* (a set of rules). - -``` -x, y {p:v} - -↓ - -['ruleset', - ['selector', - ['simpleselector', - ['ident', 'x']], - ['delim'], - ['simpleselector', - ['s', ' '], - ['ident', 'y'], - ['s', ' ']]], - ['block', - ['declaration', - ['property', - ['ident', 'p']], - ['propertyDelim'], - ['value', - ['ident', 'v']]]]] -``` - -#### s - -Whitespace: space, `\t`, `\n`, `\r`. - -``` -/*a*/ /*b*/ - -↓ - -['commentML', 'a'], -['s', ' '], -['commentML', 'b'] -``` - -#### selector - -Node to store *simpleselector* groups. - -``` -x, y, [a=b] { .. } - -↓ - -['selector', - ['simpleselector', - ['ident', 'x']], - ['delim'], - ['simpleselector', - ['s', ' '], - ['ident', 'y']], - ['delim'], - ['simpleselector', - ['s', ' '], - ['attrib', - ['ident', 'a'], - ['attrselector', '='], - ['ident', 'b']], - ['s', ' ']]] -``` - -#### shash - -Hexadecimal number in *simpleselector*. - -``` -.. #FFF .. { .. } - -↓ - -['shash', 'FFF'] -``` - -#### simpleselector - -Sets of selectors between a commas. - -``` -x, y+z { .. } - -↓ - -['selector', - ['simpleselector', - ['ident', 'x']], - ['delim'], - ['simpleselector', - ['s', ' '], - ['ident', 'y'], - ['combinator', '+'], - ['ident', 'z'], - ['s', ' ']]] -``` - -#### string - -String wraped with single or double quotes. - -``` -'test' -"test" - -↓ - -['string', ''test''] -['string', '"test"'] -``` - -#### stylesheet - -Style. The root node of AST. - -Can consist of: - -- rulesets (sets of rules with selectors), -- @-rules, -- whitespaces, -- single-line comments, -- multi-line comments. - -``` -@import "x.png"; /*sample*/ x{p:v} - -↓ - -['stylesheet', - ['atrules', - ['atkeyword', - ['ident', 'import']], - ['s', ' '], - ['string', '"x.png"']], - ['s', ' '], - ['commentML', 'sample'], - ['s', ' '], - ['ruleset', - ['selector', - ['simpleselector', - ['ident', 'x']]], - ['block', - ['declaration', - ['property', - ['ident', 'p']], - ['propertyDelim'], - ['value', - ['ident', 'v']]]]]] -``` - -#### unary - -Unary (or arithmetical) sign: `+`, `-`. - -``` -nth-last-child(3n+0) - -↓ - -['nthselector', - ['ident', 'nth-last-child'], - ['nth', '3n'], - ['unary', '+'], - ['nth', '0']] -``` - -#### unknown - -Node to store invalid (or unknown) parts of the style, that parser can extract and continue on. - -``` -// invalid - -↓ - -['stylesheet', - ['unknown', '// invalid']] -``` - -#### uri - -URI. - -``` -@import url('/css/styles.css') - -↓ - -['atrules', - ['atkeyword', - ['ident', 'import']], - ['s', ' '], - ['uri', - ['string', ''/css/styles.css'']]] -``` - -#### value - -Value of a property. - -``` -color: tomato - -↓ - -['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'tomato']]] -``` - -#### variable - -Valid for less, scss and sass. - -Sass: - -``` -$color - -↓ - -['variable', - ['ident', 'color']] -``` - -LESS: -``` -@color -@@foo - -↓ - -['variable', - ['ident', 'color']] - -['variable', - ['variable', - ['ident', 'foo']]] -``` - -#### variableslist - -Valid for less, scss and sass. - -Sass: -``` -$arguments... - -↓ - -['variableslist', - ['variable', - ['ident', 'arguments']]] -``` - -LESS: -``` -@rest... - -↓ - -['variableslist', - ['variable', - ['ident', 'rest']]] -``` - -#### vhash - -Hexadecimal number in *value*. - -``` -.. { ..: #FFF } - -↓ - -['vhash', 'FFF'] -``` diff --git a/node_modules/csscomb/node_modules/gonzales-pe/doc/Gonzales-Usage.md b/node_modules/csscomb/node_modules/gonzales-pe/doc/Gonzales-Usage.md deleted file mode 100644 index ddee44b..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/doc/Gonzales-Usage.md +++ /dev/null @@ -1,148 +0,0 @@ -### Gonzales usage - -#### 1. Sample - -With the help of this sample, you can check if Gonzales is installed correctly and if its (three) functions are working properly. - -It is assumed that in the production code you will change AST in a more intelligent way. - -Sample code: - - var gonzales = require('gonzales-pe'), - src = 'a { color: red }', - ast = gonzales.cssToAST(src); - - console.log('== CSS:'); - console.log(src); - - console.log('\n== CSS -> AST:'); - console.log(gonzales.astToTree(ast)); - - ast[1][1][1][1][1] = 'b'; - - console.log('\n== AST\':'); - console.log(gonzales.astToTree(ast)); - - console.log('\n== AST\' -> CSS:'); - console.log(gonzales.astToCSS(ast)); - -Result: - - == CSS: - a { color: red } - - == CSS -> AST: - ['stylesheet', - ['ruleset', - ['selector', - ['simpleselector', - ['ident', 'a'], - ['s', ' ']]], - ['block', - ['s', ' '], - ['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'red'], - ['s', ' ']]]]]] - - == AST': - ['stylesheet', - ['ruleset', - ['selector', - ['simpleselector', - ['ident', 'b'], - ['s', ' ']]], - ['block', - ['s', ' '], - ['declaration', - ['property', - ['ident', 'color']], - ['propertyDelim'], - ['value', - ['s', ' '], - ['ident', 'red'], - ['s', ' ']]]]]] - - == AST' -> CSS: - b { color: red } - -#### 2. API - -In Node.js you can use Gonzales module this way: -``` -gonzales = require('gonzales-pe'); -``` - -You can use AST through the next functions. - -##### CSS -> AST - -It parses source style to AST: -``` -gonzales.cssToAST({ - css: css, - rule: rule, - needInfo: true, - syntax: 'scss' -}); -``` -where: - -- `css` — a string with the CSS style; -- `rule` — a string with the token type in case the style is not complete - (`'stylesheet'` is default); -- `needInfo` — whether to include info object into AST (`false` is default); -- `syntax` — a string with syntax name (`css` is default, other supported - syntaxes are: `scss`, `sass` and `less`). - -Example 1: if you want to parse only *declaration*, you have to call: -``` -gonzales.cssToAST({ - css: 'color: red', - rule: 'declaration' -}); -``` - -Example 2: in case the style is complete and you don't need an info object, -the call is shortned to: -``` -gonzales.cssToAST(css); -``` - -Example 3: if you want to parse a sass file: -``` -gonzales.cssToAST({ - css: css, - syntax: 'sass' -}); -``` - -##### AST -> CSS - -Translates AST to style: -``` -gonzales.astToCSS({ - ast: ast, - syntax: 'scss' -}) -``` -where: - -- `ast` — AST to be translated; -- `syntax` — a string with syntax name (`css` is default). - -##### AST -> TREE - -Translates AST to the string representation of the tree: -``` -gonzales.astToTree(ast); -``` -where: - -- `ast` — AST to be translated. - -This function is useful for debugging or learning purposes. diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-src.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-src.js deleted file mode 100644 index ced440a..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-src.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = function astToSrc(options) { - var ast, syntax, stringify; - - ast = typeof options === 'string' ? options : options.ast; - syntax = options.syntax || 'css'; - - try { - stringify = require('./' + syntax + '/stringify'); - } catch (e) { - return console.error('Syntax "' + syntax + '" is not supported yet, sorry'); - } - - return stringify(ast); -} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-string.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-string.js deleted file mode 100644 index 9409119..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/ast-to-string.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = (function() { - function dummySpaces(num) { - return ' ' - .substr(0, num * 2); - } - - return function astToString(tree, level) { - level = level || 0; - var spaces, string; - - if (level) { - spaces = dummySpaces(level); - string = '\n' + spaces + '['; - } else { - string = '['; - } - - tree.forEach(function(node) { - if (typeof node.ln !== 'undefined') return; - string += Array.isArray(node) ? - astToString(node, level + 1) : - ('\'' + node.toString() + '\''); - string += ', '; - }); - - return string.substr(0, string.length - 2) + ']'; - }; -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/mark.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/mark.js deleted file mode 100644 index 426b97e..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/mark.js +++ /dev/null @@ -1,117 +0,0 @@ -var TokenType = require('../token-types'); - -module.exports = (function() { - /** - * Mark whitespaces and comments - */ - function markSC(tokens) { - var tokensLength = tokens.length; - var ws = -1, // flag for whitespaces - sc = -1, // flag for whitespaces and comments - t; // current token - - // For every token in the token list, mark spaces and line breaks - // as spaces (set both `ws` and `sc` flags). Mark multiline comments - // with `sc` flag. - // If there are several spaces or tabs or line breaks or multiline - // comments in a row, group them: take the last one's index number - // and save it to the first token in the group as a reference - // (e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` - // for a group of whitespaces and comments): - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - - if (ws === -1) ws = i; - if (sc === -1) sc = i; - - break; - case TokenType.CommentML: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - t.sc = true; - - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - } - - /** - * Pair brackets - */ - function markBrackets(tokens) { - var tokensLength = tokens.length; - var ps = [], // parenthesis - sbs = [], // square brackets - cbs = [], // curly brackets - t; // current token - - // For every token in the token list, if we meet an opening (left) - // bracket, push its index number to a corresponding array. - // If we then meet a closing (right) bracket, look at the corresponding - // array. If there are any elements (records about previously met - // left brackets), take a token of the last left bracket (take - // the last index number from the array and find a token with - // this index number) and save right bracket's index as a reference: - for (var i = 0; i < tokens.length; i++) { - t = tokens[i]; - switch(t.type) { - case TokenType.LeftParenthesis: - ps.push(i); - break; - case TokenType.RightParenthesis: - if (ps.length) { - t.left = ps.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftSquareBracket: - sbs.push(i); - break; - case TokenType.RightSquareBracket: - if (sbs.length) { - t.left = sbs.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftCurlyBracket: - cbs.push(i); - break; - case TokenType.RightCurlyBracket: - if (cbs.length) { - t.left = cbs.pop(); - tokens[t.left].right = i; - } - break; - } - } - } - - return function(tokens) { - // Mark paired brackets: - markBrackets(tokens); - // Mark whitespaces and comments: - markSC(tokens); - } -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/node-types.js deleted file mode 100644 index b9d74c7..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/node-types.js +++ /dev/null @@ -1,49 +0,0 @@ -module.exports = { - ArgumentsType: 'arguments', - AtkeywordType: 'atkeyword', - AtrulebType: 'atruleb', - AtrulerType: 'atruler', - AtrulerqType: 'atrulerq', - AtrulersType: 'atrulers', - AtrulesType: 'atrules', - AttribType: 'attrib', - AttrselectorType: 'attrselector', - BlockType: 'block', - BracesType: 'braces', - ClassType: 'class', - CombinatorType: 'combinator', - CommentMLType: 'commentML', - DeclarationType: 'declaration', - DeclDelimType: 'declDelim', - DelimType: 'delim', - DimensionType: 'dimension', - FilterType: 'filter', - FiltervType: 'filterv', - FunctionType: 'function', - FunctionExpressionType: 'functionExpression', - IdentType: 'ident', - ImportantType: 'important', - NamespaceType: 'namespace', - NthType: 'nth', - NthselectorType: 'nthselector', - NumberType: 'number', - OperatorType: 'operator', - PercentageType: 'percentage', - ProgidType: 'progid', - PropertyType: 'property', - PropertyDelimType: 'propertyDelim', - PseudocType: 'pseudoc', - PseudoeType: 'pseudoe', - RawType: 'raw', - RulesetType: 'ruleset', - SType: 's', - SelectorType: 'selector', - ShashType: 'shash', - SimpleselectorType: 'simpleselector', - StringType: 'string', - StylesheetType: 'stylesheet', - UnaryType: 'unary', - UriType: 'uri', - ValueType: 'value', - VhashType: 'vhash' -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/rules.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/rules.js deleted file mode 100644 index 6fac5c6..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/rules.js +++ /dev/null @@ -1,2514 +0,0 @@ -var TokenType = require('../token-types'); -var NodeType = require('./node-types'); - -module.exports = (function() { - var tokens, tokensLength, pos; - - var rules = { - 'arguments': function() { return checkArguments(pos) && getArguments(); }, - 'atkeyword': function() { return checkAtkeyword(pos) && getAtkeyword(); }, - 'atruleb': function() { return checkAtruleb(pos) && getAtruleb(); }, - 'atruler': function() { return checkAtruler(pos) && getAtruler(); }, - 'atrulerq': function() { return checkAtrulerq(pos) && getAtrulerq(); }, - 'atrulers': function() { return checkAtrulers(pos) && getAtrulers(); }, - 'atrules': function() { return checkAtrules(pos) && getAtrules(); }, - 'attrib': function() { return checkAttrib(pos) && getAttrib(); }, - 'attrselector': function() { return checkAttrselector(pos) && getAttrselector(); }, - 'block': function() { return checkBlock(pos) && getBlock(); }, - 'braces': function() { return checkBraces(pos) && getBraces(); }, - 'class': function() { return checkClass(pos) && getClass(); }, - 'combinator': function() { return checkCombinator(pos) && getCombinator(); }, - 'commentML': function() { return checkCommentML(pos) && getCommentML(); }, - 'declaration': function() { return checkDeclaration(pos) && getDeclaration(); }, - 'declDelim': function() { return checkDeclDelim(pos) && getDeclDelim(); }, - 'delim': function() { return checkDelim(pos) && getDelim(); }, - 'dimension': function() { return checkDimension(pos) && getDimension(); }, - 'filter': function() { return checkFilter(pos) && getFilter(); }, - 'filterv': function() { return checkFilterv(pos) && getFilterv(); }, - 'functionExpression': function() { return checkFunctionExpression(pos) && getFunctionExpression(); }, - 'function': function() { return checkFunction(pos) && getFunction(); }, - 'ident': function() { return checkIdent(pos) && getIdent(); }, - 'important': function() { return checkImportant(pos) && getImportant(); }, - 'namespace': function() { return checkNamespace(pos) && getNamespace(); }, - 'nth': function() { return checkNth(pos) && getNth(); }, - 'nthselector': function() { return checkNthselector(pos) && getNthselector(); }, - 'number': function() { return checkNumber(pos) && getNumber(); }, - 'operator': function() { return checkOperator(pos) && getOperator(); }, - 'percentage': function() { return checkPercentage(pos) && getPercentage(); }, - 'progid': function() { return checkProgid(pos) && getProgid(); }, - 'property': function() { return checkProperty(pos) && getProperty(); }, - 'propertyDelim': function() { return checkPropertyDelim(pos) && getPropertyDelim(); }, - 'pseudoc': function() { return checkPseudoc(pos) && getPseudoc(); }, - 'pseudoe': function() { return checkPseudoe(pos) && getPseudoe(); }, - 'ruleset': function() { return checkRuleset(pos) && getRuleset(); }, - 's': function() { return checkS(pos) && getS(); }, - 'selector': function() { return checkSelector(pos) && getSelector(); }, - 'shash': function() { return checkShash(pos) && getShash(); }, - 'simpleselector': function() { return checkSimpleSelector(pos) && getSimpleSelector(); }, - 'string': function() { return checkString(pos) && getString(); }, - 'stylesheet': function() { return checkStylesheet(pos) && getStylesheet(); }, - 'unary': function() { return checkUnary(pos) && getUnary(); }, - 'uri': function() { return checkUri(pos) && getUri(); }, - 'value': function() { return checkValue(pos) && getValue(); }, - 'vhash': function() { return checkVhash(pos) && getVhash(); } - }; - - /** - * Stop parsing and display error - * @param {Number=} i Token's index number - */ - function throwError(i) { - var ln = i ? tokens[i].ln : tokens[pos].ln; - - throw {line: ln, syntax: 'css'}; - } - - /** - * @param {Object} exclude - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkExcluding(exclude, i) { - var start = i; - - while(i < tokensLength) { - if (exclude[tokens[i++].type]) break; - } - - return i - start - 2; - } - - /** - * @param {Number} start - * @param {Number} finish - * @returns {String} - */ - function joinValues(start, finish) { - var s = ''; - - for (var i = start; i < finish + 1; i++) { - s += tokens[i].value; - } - - return s; - } - - /** - * @param {Number} start - * @param {Number} num - * @returns {String} - */ - function joinValues2(start, num) { - if (start + num - 1 >= tokensLength) return; - - var s = ''; - - for (var i = 0; i < num; i++) { - s += tokens[start + i].value; - } - - return s; - } - - -///////////////////////////////////// -///////////////////////////////////// -///////////////////////////////////// - - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAny(i) { - return checkBraces(i) || - checkString(i) || - checkPercentage(i) || - checkDimension(i) || - checkNumber(i) || - checkUri(i) || - checkFunctionExpression(i) || - checkFunction(i) || - checkIdent(i) || - checkClass(i) || - checkUnary(i); - } - - /** - * @returns {Array} - */ - function getAny() { - if (checkBraces(pos)) return getBraces(); - else if (checkString(pos)) return getString(); - else if (checkPercentage(pos)) return getPercentage(); - else if (checkDimension(pos)) return getDimension(); - else if (checkNumber(pos)) return getNumber(); - else if (checkUri(pos)) return getUri(); - else if (checkFunctionExpression(pos)) return getFunctionExpression(); - else if (checkFunction(pos)) return getFunction(); - else if (checkIdent(pos)) return getIdent(); - else if (checkClass(pos)) return getClass(); - else if (checkUnary(pos)) return getUnary(); - } - - /** - * Check if token is part of an @-word (e.g. `@import`, `@include`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtkeyword(i) { - var l; - - // Check that token is `@`: - if (i >= tokensLength || - tokens[i++].type !== TokenType.CommercialAt) return 0; - - return (l = checkIdent(i)) ? l + 1 : 0; - } - - /** - * Get node with @-word - * @returns {Array} `['atkeyword', ['ident', x]]` where `x` is - * an identifier without - * `@` (e.g. `import`, `include`) - */ - function getAtkeyword() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AtkeywordType, getIdent()]; - - return x; - } - - /** - * Check if token is part of an attribute selector (e.g. `[attr]`, - * `[attr='panda']`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib(i) { - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftSquareBracket || - !tokens[i].right) return 0; - - return tokens[i].right - i + 1; - } - - /** - * Get node with an attribute selector - * @returns {Array} `['attrib', ['ident', x], ['attrselector', y]*, [z]*]` - * where `x` is attribute's name, `y` is operator (if there is any) - * and `z` is attribute's value (if there is any) - */ - function getAttrib() { - if (checkAttrib1(pos)) return getAttrib1(); - if (checkAttrib2(pos)) return getAttrib2(); - } - - /** - * Check if token is part of an attribute selector of the form `[attr='value']` - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib1(i) { - var start = i, - l; - - if (i++ >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkAttrselector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i) || checkString(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - } - - /** - * Get node with an attribute selector of the form `[attr='value']` - * @returns {Array} `['attrib', ['ident', x], ['attrselector', y], [z]]` - * where `x` is attribute's name, `y` is operator and `z` is attribute's - * value - */ - function getAttrib1() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AttribType] - .concat(getSC()) - .concat([getIdent()]) - .concat(getSC()) - .concat([getAttrselector()]) - .concat(getSC()) - .concat([checkString(pos)? getString() : getIdent()]) - .concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an attribute selector of the form `[attr]` - * Attribute can not be empty, e.g. `[]`. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib2(i) { - var start = i, - l; - - if (i++ >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - } - - /** - * Get node with an attribute selector of the form `[attr]` - * @returns {Array} `['attrib', ['ident', x]]` where `x` is attribute's name - */ - function getAttrib2() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AttribType] - .concat(getSC()) - .concat([getIdent()]) - .concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an attribute selector operator (`=`, `~=`, - * `^=`, `$=`, `*=` or `|=`) - * @param {Number} i Token's index number - * @returns {Number} Length of operator (`0` if token is not part of an - * operator, `1` or `2` if it is). - */ - function checkAttrselector(i) { - if (i >= tokensLength) return 0; - - if (tokens[i].type === TokenType.EqualsSign) return 1; - - // TODO: Add example or remove - if (tokens[i].type === TokenType.VerticalLine && - (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign)) - return 1; - - if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0; - - switch(tokens[i].type) { - case TokenType.Tilde: - case TokenType.CircumflexAccent: - case TokenType.DollarSign: - case TokenType.Asterisk: - case TokenType.VerticalLine: - return 2; - } - - return 0; - } - - /** - * Get node with an attribute selector operator (`=`, `~=`, `^=`, `$=`, - * `*=` or `|=`) - * @returns {Array} `['attrselector', x]` where `x` is an operator. - */ - function getAttrselector() { - var startPos = pos, - s = tokens[pos++].value, - x; - - if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value; - - x = [NodeType.AttrselectorType, s]; - - return x; - } - - /** - * Check if token is a part of an @-rule - * @param {Number} i Token's index number - * @returns {Number} Length of @-rule - */ - function checkAtrule(i) { - var l; - - if (i >= tokensLength) return 0; - - // If token already has a record of being part of an @-rule, - // return the @-rule's length: - if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l; - - // If token is part of an @-rule, save the rule's type to token: - if (l = checkAtruler(i)) tokens[i].atrule_type = 1; // @-rule with ruleset - else if (l = checkAtruleb(i)) tokens[i].atrule_type = 2; // block @-rule - else if (l = checkAtrules(i)) tokens[i].atrule_type = 3; // single-line @-rule - else return 0; - - // If token is part of an @-rule, save the rule's length to token: - tokens[i].atrule_l = l; - - return l; - } - - /** - * Get node with @-rule - * @returns {Array} - */ - function getAtrule() { - switch (tokens[pos].atrule_type) { - case 1: return getAtruler(); // @-rule with ruleset - case 2: return getAtruleb(); // block @-rule - case 3: return getAtrules(); // single-line @-rule - } - } - - /** - * Check if token is part of a block @-rule - * @param {Number} i Token's index number - * @returns {Number} Length of the @-rule - */ - function checkAtruleb(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkTsets(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a block @-rule - * @returns {Array} `['atruleb', ['atkeyword', x], y, ['block', z]]` - */ - function getAtruleb() { - var startPos = pos, - x; - - x = [NodeType.AtrulebType, getAtkeyword()] - .concat(getTsets()) - .concat([getBlock()]); - - return x; - } - - /** - * Check if token is part of an @-rule with ruleset - * @param {Number} i Token's index number - * @returns {Number} Length of the @-rule - */ - function checkAtruler(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkAtrulerq(i)) i += l; - - if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++; - else return 0; - - if (l = checkAtrulers(i)) i += l; - - if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++; - else return 0; - - return i - start; - } - - /** - * Get node with an @-rule with ruleset - * @returns {Array} ['atruler', ['atkeyword', x], y, z] - */ - function getAtruler() { - var startPos = pos, - x; - - x = [NodeType.AtrulerType, getAtkeyword(), getAtrulerq()]; - - pos++; - - x.push(getAtrulers()); - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrulerq(i) { - return checkTsets(i); - } - - /** - * @returns {Array} `['atrulerq', x]` - */ - function getAtrulerq() { - var startPos = pos, - x; - - x = [NodeType.AtrulerqType].concat(getTsets()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrulers(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - while (l = checkRuleset(i) || checkAtrule(i) || checkSC(i)) { - i += l; - } - - tokens[i].atrulers_end = 1; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `['atrulers', x]` - */ - function getAtrulers() { - var startPos = pos, - x; - - x = [NodeType.AtrulersType].concat(getSC()); - - while (!tokens[pos].atrulers_end) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkAtrule(pos)) x.push(getAtrule()); - else if (checkRuleset(pos)) x.push(getRuleset()); - } - - x = x.concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrules(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkTsets(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `['atrules', ['atkeyword', x], y]` - */ - function getAtrules() { - var startPos = pos, - x; - - x = [NodeType.AtrulesType, getAtkeyword()].concat(getTsets()); - - return x; - } - - /** - * Check if token is part of a block (e.g. `{...}`). - * @param {Number} i Token's index number - * @returns {Number} Length of the block - */ - function checkBlock(i) { - return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ? - tokens[i].right - i + 1 : 0; - } - - /** - * Get node with a block - * @returns {Array} `['block', x]` - */ - function getBlock() { - var startPos = pos, - end = tokens[pos].right, - x = [NodeType.BlockType]; - - pos++; - - - while (pos < end) { - if (checkBlockdecl(pos)) x = x.concat(getBlockdecl()); - else throwError(); - } - - pos = end + 1; - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkBlockdecl(i) { - var l; - - if (i >= tokensLength) return 0; - - if (l = checkBlockdecl1(i)) tokens[i].bd_type = 1; - else if (l = checkBlockdecl2(i)) tokens[i].bd_type = 2; - else if (l = checkBlockdecl3(i)) tokens[i].bd_type = 3; - else if (l = checkBlockdecl4(i)) tokens[i].bd_type = 4; - else return 0; - - return l; - } - - /** - * @returns {Array} - */ - function getBlockdecl() { - switch (tokens[pos].bd_type) { - case 1: return getBlockdecl1(); - case 2: return getBlockdecl2(); - case 3: return getBlockdecl3(); - case 4: return getBlockdecl4(); - } - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl1(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkFilter(i)) tokens[i].bd_kind = 1; - else if (l = checkDeclaration(i)) tokens[i].bd_kind = 2; - else if (l = checkAtrule(i)) tokens[i].bd_kind = 3; - else return 0; - - i += l; - - if (l = checkSC(i)) i += l; - - if (i < tokensLength && (l = checkDeclDelim(i))) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - return i - start; - } - - /** - * sc*:s0 (atrule | ruleset | filter | declaration):x declDelim:y sc*:s1 -> concat(s0, [x], [y], s1) - * @returns {Array} - */ - function getBlockdecl1() { - var sc = getSC(), - x; - - switch (tokens[pos].bd_kind) { - case 1: - x = getFilter(); - break; - case 2: - x = getDeclaration(); - break; - case 3: - x = getAtrule(); - break; - } - - return sc - .concat([x]) - .concat(getSC()) - .concat([getDeclDelim()]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl2(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkFilter(i)) tokens[i].bd_kind = 1; - else if (l = checkDeclaration(i)) tokens[i].bd_kind = 2; - else if (l = checkAtrule(i)) tokens[i].bd_kind = 3; - else return 0; - - i += l; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getBlockdecl2() { - var sc = getSC(), - x; - - switch (tokens[pos].bd_kind) { - case 1: - x = getFilter(); - break; - case 2: - x = getDeclaration(); - break; - case 3: - x = getAtrule(); - break; - } - - return sc - .concat([x]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl3(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkDeclDelim(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `[s0, ['declDelim'], s1]` where `s0` and `s1` are - * are optional whitespaces. - */ - function getBlockdecl3() { - return getSC() - .concat([getDeclDelim()]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl4(i) { - return checkSC(i); - } - - /** - * @returns {Array} - */ - function getBlockdecl4() { - return getSC(); - } - - /** - * Check if token is part of text inside parentheses or square brackets - * (e.g. `(1)`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBraces(i) { - if (i >= tokensLength || - (tokens[i].type !== TokenType.LeftParenthesis && - tokens[i].type !== TokenType.LeftSquareBracket)) return 0; - - return tokens[i].right - i + 1; - } - - /** - * Get node with text inside parentheses or square brackets (e.g. `(1)`) - * @returns {Array} `['braces', l, r, x*]` where `l` is a left bracket - * (e.g. `'('`), `r` is a right bracket (e.g. `')'`) and `x` is - * parsed text inside those brackets (if there is any) - * (e.g. `['number', '1']`) - */ - function getBraces() { - var startPos = pos, - left = pos, - right = tokens[pos].right, - x; - - pos++; - - var tsets = getTsets(); - - pos++; - - x = [NodeType.BracesType, tokens[left].value, tokens[right].value] - .concat(tsets); - - return x; - } - - /** - * Check if token is part of a class selector (e.g. `.abc`) - * @param {Number} i Token's index number - * @returns {Number} Length of the class selector - */ - function checkClass(i) { - var l; - - if (i >= tokensLength) return 0; - - if (tokens[i].class_l) return tokens[i].class_l; - - if (tokens[i++].type === TokenType.FullStop && (l = checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - - return 0; - } - - /** - * Get node with a class selector - * @returns {Array} `['class', ['ident', x]]` where x is a class's - * identifier (without `.`, e.g. `abc`). - */ - function getClass() { - var startPos = pos, - x = [NodeType.ClassType]; - - pos++; - - x.push(getIdent()); - - return x; - } - - /** - * Check if token is a combinator (`+`, `>` or `~`) - * @param {Number} i Token's index number - * @returns {Number} Length of the combinator - */ - function checkCombinator(i) { - if (i >= tokensLength) return 0; - - switch (tokens[i].type) { - case TokenType.PlusSign: - case TokenType.GreaterThanSign: - case TokenType.Tilde: - return 1; - } - - return 0; - } - - /** - * Get node with a combinator (`+`, `>` or `~`) - * @returns {Array} `['combinator', x]` where `x` is a combinator - * converted to string. - */ - function getCombinator() { - var startPos = pos, - x; - - x = [NodeType.CombinatorType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is a multiline comment. - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a multiline comment, otherwise `0` - */ - function checkCommentML(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0; - } - - /** - * Get node with a multiline comment - * @returns {Array} `['commentML', x]` where `x` - * is the comment's text (without `/*` and `* /`). - */ - function getCommentML() { - var startPos = pos, - s = tokens[pos].value.substring(2), - l = s.length, - x; - - if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2); - - pos++; - - x = [NodeType.CommentMLType, s]; - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkDeclaration(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkProperty(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkPropertyDelim(i)) i++; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkValue(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a declaration - * @returns {Array} `['declaration', ['property', x], ['propertyDelim'], - * ['value', y]]` - */ - function getDeclaration() { - var startPos = pos, - x = [NodeType.DeclarationType]; - - x.push(getProperty()); - x = x.concat(getSC()); - x.push(getPropertyDelim()); - x = x.concat(getSC()); - x.push(getValue()); - - return x; - } - - /** - * Check if token is a semicolon - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a semicolon, otherwise `0` - */ - function checkDeclDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0; - } - - /** - * Get node with a semicolon - * @returns {Array} `['declDelim']` - */ - function getDeclDelim() { - var startPos = pos, - x = [NodeType.DeclDelimType]; - - pos++; - - return x; - } - - /** - * Check if token is a comma - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a comma, otherwise `0` - */ - function checkDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0; - } - - /** - * Get node with a comma - * @returns {Array} `['delim']` - */ - function getDelim() { - var startPos = pos, - x = [NodeType.DelimType]; - - pos++; - - return x; - } - - /** - * Check if token is part of a number with dimension unit (e.g. `10px`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkDimension(i) { - var ln = checkNumber(i), - li; - - if (i >= tokensLength || - !ln || - i + ln >= tokensLength) return 0; - - return (li = checkNmName2(i + ln)) ? ln + li : 0; - } - - /** - * Get node of a number with dimension unit - * @returns {Array} `['dimension', ['number', x], ['ident', y]]` where - * `x` is a number converted to string (e.g. `'10'`) and `y` is - * a dimension unit (e.g. `'px'`). - */ - function getDimension() { - var startPos = pos, - x = [NodeType.DimensionType, getNumber()], - ident = [NodeType.IdentType, getNmName2()]; - - x.push(ident); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilter(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkFilterp(i)) i += l; - else return 0; - - if (tokens[i].type === TokenType.Colon) i++; - else return 0; - - if (l = checkFilterv(i)) i += l; - else return 0; - - return i - start; - } - - /** - * @returns {Array} `['filter', x, y]` - */ - function getFilter() { - var startPos = pos, - x = [NodeType.FilterType, getFilterp()]; - - pos++; - - x.push(getFilterv()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilterp(i) { - var start = i, - l, - x; - - if (i >= tokensLength) return 0; - - if (tokens[i].value === 'filter') l = 1; - else { - x = joinValues2(i, 2); - - if (x === '-filter' || x === '_filter' || x === '*filter') l = 2; - else { - x = joinValues2(i, 4); - - if (x === '-ms-filter') l = 4; - else return 0; - } - } - - tokens[start].filterp_l = l; - - i += l; - - if (checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getFilterp() { - var startPos = pos, - ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)], - x; - - pos += tokens[pos].filterp_l; - - x = [NodeType.PropertyType, ident].concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilterv(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkProgid(i)) i += l; - else return 0; - - while (l = checkProgid(i)) { - i += l; - } - - tokens[start].last_progid = i; - - if (i < tokensLength && (l = checkSC(i))) i += l; - - if (i < tokensLength && (l = checkImportant(i))) i += l; - - return i - start; - } - - /** - * progid+:x -> [#filterv].concat(x) - * @returns {Array} - */ - function getFilterv() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - - x = x.concat(getSC()); - - while (pos < last_progid) { - x.push(getProgid()); - } - - if (checkSC(pos)) x = x.concat(getSC()); - - if (pos < tokensLength && checkImportant(pos)) x.push(getImportant()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunctionExpression(i) { - var start = i; - - if (i >= tokensLength || tokens[i++].value !== 'expression' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; - - return tokens[i].right - start + 1; - } - - /** - * @returns {Array} - */ - function getFunctionExpression() { - var startPos = pos, - x, e; - - pos++; - - e = joinValues(pos + 1, tokens[pos].right - 1); - - pos = tokens[pos].right + 1; - - x = [NodeType.FunctionExpressionType, e]; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunction(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkIdent(i)) i +=l; - else return 0; - - return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ? - tokens[i].right - start + 1 : 0; - } - - /** - * @returns {Array} - */ - function getFunction() { - var startPos = pos, - ident = getIdent(), - x = [NodeType.FunctionType, ident], - body; - - body = ident[1] === 'not' ? getNotArguments() : getArguments(); - - x.push(body); - - return x; - } - - /** - * @returns {Array} - */ - function getArguments() { - var startPos = pos, - x = [NodeType.ArgumentsType], - body; - - pos++; - - while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { - if (checkDeclaration(pos)) x.push(getDeclaration()); - else if (checkArgument(pos)) { - body = getArgument(); - if (typeof body[0] === 'string') x.push(body); - else x = x.concat(body); - } else if (checkClass(pos)) x.push(getClass()); - else throwError(); - } - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkArgument(i) { - return checkVhash(i) || - checkAny(i) || - checkSC(i) || - checkOperator(i); - } - - /** - * @returns {Array} - */ - function getArgument() { - if (checkVhash(pos)) return getVhash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkOperator(pos)) return getOperator(); - } - - /** - * @returns {Array} - */ - function getNotArguments() { - var startPos = pos, - x = [NodeType.ArgumentsType]; - - pos++; - - while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { - if (checkSimpleSelector(pos)) x.push(getSimpleSelector()); - else throwError(); - } - - pos++; - - return x; - } - - /** - * Check if token is part of an identifier - * @param {Number} i Token's index number - * @returns {Number} Length of the identifier - */ - function checkIdent(i) { - var start = i, - wasIdent, - l; - - if (i >= tokensLength) return 0; - - // Check if token is part of an identifier starting with `_`: - if (tokens[i].type === TokenType.LowLine) return checkIdentLowLine(i); - - // If token is a character, `-`, `$` or `*`, skip it & continue: - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.Asterisk) i++; - else return 0; - - // Remember if previous token's type was identifier: - wasIdent = tokens[i - 1].type === TokenType.Identifier; - - for (; i < tokensLength; i++) { - if (i >= tokensLength) break; - - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine) { - if (tokens[i].type !== TokenType.Identifier && - (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break; - else wasIdent = true; - } - } - - if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0; - - tokens[start].ident_last = i - 1; - - return i - start; - } - - /** - * Check if token is part of an identifier starting with `_` - * @param {Number} i Token's index number - * @returns {Number} Length of the identifier - */ - function checkIdentLowLine(i) { - var start = i; - - if (i++ >= tokensLength) return 0; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.DecimalNumber && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier) break; - } - - // Save index number of the last token of the identifier: - tokens[start].ident_last = i - 1; - - return i - start; - } - - /** - * Get node with an identifier - * @returns {Array} `['ident', x]` where `x` is identifier's name - */ - function getIdent() { - var startPos = pos, - x = [NodeType.IdentType, joinValues(pos, tokens[pos].ident_last)]; - - pos = tokens[pos].ident_last + 1; - - return x; - } - - /** - * Check if token is part of `!important` word - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkImportant(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].value === 'important' ? i - start + 1 : 0; - } - - /** - * Get node with `!important` word - * @returns {Array} `['important', sc]` where `sc` is optional whitespace - */ - function getImportant() { - var startPos = pos, - x = [NodeType.ImportantType]; - - pos++; - - x = x.concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is a namespace sign (`|`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is `|`, `0` if not - */ - function checkNamespace(i) { - return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0; - } - - /** - * Get node with a namespace sign - * @returns {Array} `['namespace']` - */ - function getNamespace() { - var startPos = pos, - x = [NodeType.NamespaceType]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNmName(i) { - var start = i; - - if (i >= tokensLength) return 0; - - // start char / word - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.LowLine || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DecimalNumber) i++; - else return 0; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier && - tokens[i].type !== TokenType.DecimalNumber) break; - } - - tokens[start].nm_name_last = i - 1; - - return i - start; - } - - /** - * @returns {String} - */ - function getNmName() { - var s = joinValues(pos, tokens[pos].nm_name_last); - - pos = tokens[pos].nm_name_last + 1; - - return s; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNmName2(i) { - if (tokens[i].type === TokenType.Identifier) return 1; - else if (tokens[i].type !== TokenType.DecimalNumber) return 0; - - i++; - - return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1; - } - - /** - * @returns {String} - */ - function getNmName2() { - var s = tokens[pos].value; - - if (tokens[pos++].type === TokenType.DecimalNumber && - pos < tokensLength && - tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value; - - return s; - } - - /** - * Check if token is part of an nth-selector's identifier (e.g. `2n+1`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth(i) { - if (i >= tokensLength) return 0; - - return checkNth1(i) || checkNth2(i); - } - - /** - * Check if token is part of an nth-selector's identifier in the form of - * sequence of decimals and n-s (e.g. `3`, `n`, `2n+1`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth1(i) { - var start = i; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.DecimalNumber && - tokens[i].value !== 'n') break; - } - - if (i !== start) tokens[start].nth_last = i - 1; - - return i - start; - } - - /** - * Get node for nth-selector's identifier (e.g. `2n+1`) - * @returns {Array} `['nth', x]` where `x` is identifier's text - */ - function getNth() { - var startPos = pos, - x = [NodeType.NthType]; - - if (tokens[pos].nth_last) { - x.push(joinValues(pos, tokens[pos].nth_last)); - pos = tokens[pos].nth_last + 1; - } else { - x.push(tokens[pos++].value); - } - - return x; - } - - /** - * Check if token is part of `even` or `odd` nth-selector's identifier - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth2(i) { - return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNthf(i) { - var start = i, - l = 0; - - if (tokens[i++].type !== TokenType.Colon) return 0; - - // There was `:`: - l++; - - if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0; - - // There was either `nth-` or `last-`: - l += 2; - - if ('child' === tokens[i].value) { - l += 1; - } else if ('last-child' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('last-of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value + - tokens[i + 3].value + - tokens[i + 4].value) { - l += 5; - } else return 0; - - tokens[start + 1].nthf_last = start + l - 1; - - return l; - } - - /** - * @returns {String} - */ - function getNthf() { - pos++; - - var s = joinValues(pos, tokens[pos].nthf_last); - - pos = tokens[pos].nthf_last + 1; - - return s; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNthselector(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkNthf(i)) i += l; - else return 0; - - if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0; - - l++; - - var rp = tokens[i++].right; - - while (i < rp) { - if (l = checkSC(i) || - checkUnary(i) || - checkNth(i)) i += l; - else return 0; - } - - return rp - start + 1; - } - - /** - * @returns {Array} - */ - function getNthselector() { - var startPos = pos, - nthf = [NodeType.IdentType, getNthf()], - x = [NodeType.NthselectorType]; - - x.push(nthf); - - pos++; - - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkUnary(pos)) x.push(getUnary()); - else if (checkNth(pos)) x.push(getNth()); - } - - pos++; - - return x; - } - - /** - * Check if token is part of a number - * @param {Number} i Token's index number - * @returns {Number} Length of number - */ - function checkNumber(i) { - if (i >= tokensLength) return 0; - - if (tokens[i].number_l) return tokens[i].number_l; - - // `10`: - if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && - (!tokens[i + 1] || - (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) - return (tokens[i].number_l = 1, tokens[i].number_l); - - // `10.`: - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber))) - return (tokens[i].number_l = 2, tokens[i].number_l); - - // `.10`: - if (i < tokensLength && - tokens[i].type === TokenType.FullStop && - tokens[i + 1].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 2, tokens[i].number_l); - - // `10.10`: - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 3, tokens[i].number_l); - - return 0; - } - - /** - * Get node with number - * @returns {Array} `['number', x]` where `x` is a number converted - * to string. - */ - function getNumber() { - var s = '', - startPos = pos, - l = tokens[pos].number_l, - x = [NodeType.NumberType]; - - for (var j = 0; j < l; j++) { - s += tokens[pos + j].value; - } - - pos += l; - - x.push(s); - - return x; - } - - /** - * Check if token is an operator (`/`, `,`, `:` or `=`). - * @param {Number} i Token's index number - * @returns {Number} `1` if token is an operator, otherwise `0` - */ - function checkOperator(i) { - if (i >= tokensLength) return 0; - - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - return 1; - } - - return 0; - } - - /** - * Get node with an operator - * @returns {Array} `['operator', x]` where `x` is an operator converted - * to string. - */ - function getOperator() { - var startPos = pos, - x = [NodeType.OperatorType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is part of a number with percent sign (e.g. `10%`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPercentage(i) { - var x; - - if (i >= tokensLength) return 0; - - x = checkNumber(i); - - if (!x || i + x >= tokensLength) return 0; - - return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0; - } - - /** - * Get node of number with percent sign - * @returns {Array} `['percentage', ['number', x]]` where `x` is a number - * (without percent sign) converted to string. - */ - function getPercentage() { - var startPos = pos, - x = [NodeType.PercentageType, getNumber()]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkProgid(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6; - else return 0; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (tokens[i].type === TokenType.LeftParenthesis) { - tokens[start].progid_end = tokens[i].right; - i = tokens[i].right + 1; - } else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getProgid() { - var startPos = pos, - progid_end = tokens[pos].progid_end, - x; - - x = [NodeType.ProgidType] - .concat(getSC()) - .concat([_getProgid(progid_end)]) - .concat(getSC()); - - return x; - } - - /** - * @param {Number} progid_end - * @returns {Array} - */ - function _getProgid(progid_end) { - var startPos = pos, - x = [NodeType.RawType, joinValues(pos, progid_end)]; - - pos = progid_end + 1; - - return x; - } - - /** - * Check if token is part of a property - * @param {Number} i Token's index number - * @returns {Number} Length of the property - */ - function checkProperty(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkIdent(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a property - * @returns {Array} `['property', x]` - */ - function getProperty() { - var startPos = pos, - x = [NodeType.PropertyType]; - - x.push(getIdent()); - - return x; - } - - /** - * Check if token is a colon - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a colon, otherwise `0` - */ - function checkPropertyDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0; - } - - /** - * Get node with a colon - * @returns {Array} `['propertyDelim']` - */ - function getPropertyDelim() { - var startPos = pos, - x = [NodeType.PropertyDelimType]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudo(i) { - return checkPseudoe(i) || - checkPseudoc(i); - } - - /** - * @returns {Array} - */ - function getPseudo() { - if (checkPseudoe(pos)) return getPseudoe(); - if (checkPseudoc(pos)) return getPseudoc(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudoe(i) { - var l; - - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - - return (l = checkIdent(i)) ? l + 2 : 0; - } - - /** - * @returns {Array} - */ - function getPseudoe() { - var startPos = pos, - x = [NodeType.PseudoeType]; - - pos += 2; - - x.push(getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudoc(i) { - var l; - - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - - return (l = checkFunction(i) || checkIdent(i)) ? l + 1 : 0; - } - - /** - * @returns {Array} - */ - function getPseudoc() { - var startPos = pos, - x = [NodeType.PseudocType]; - - pos ++; - - x.push(checkFunction(pos) ? getFunction() : getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkRuleset(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[start].ruleset_l) return tokens[start].ruleset_l; - - while (i < tokensLength) { - if (l = checkBlock(i)) {i += l; break;} - else if (l = checkSelector(i)) i += l; - else return 0; - } - - tokens[start].ruleset_l = i - start; - - return i - start; - } - - /** - * @returns {Array} - */ - function getRuleset() { - var startPos = pos, - x = [NodeType.RulesetType]; - - while (pos < tokensLength) { - if (checkBlock(pos)) {x.push(getBlock()); break;} - else if (checkSelector(pos)) x.push(getSelector()); - else break; - } - - return x; - } - - /** - * Check if token is marked as a space (if it's a space or a tab - * or a line break). - * @param i - * @returns {Number} Number of spaces in a row starting with the given token. - */ - function checkS(i) { - return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0; - } - - /** - * Get node with spaces - * @returns {Array} `['s', x]` where `x` is a string containing spaces - */ - function getS() { - var startPos = pos, - x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)]; - - pos = tokens[pos].ws_last + 1; - - return x; - } - - /** - * Check if token is a space or a comment. - * @param {Number} i Token's index number - * @returns {Number} Number of similar (space or comment) tokens - * in a row starting with the given token. - */ - function checkSC(i) { - var l, - lsc = 0; - - while (i < tokensLength) { - if (!(l = checkS(i)) && - !(l = checkCommentML(i))) break; - i += l; - lsc += l; - } - - return lsc || 0; - } - - /** - * Get node with spaces and comments - * @returns {Array} Array containing nodes with spaces (if there are any) - * and nodes with comments (if there are any): - * `[['s', x]*, ['comment', y]*]` where `x` is a string of spaces - * and `y` is a comment's text (without `/*` and `* /`). - */ - function getSC() { - var sc = []; - - if (pos >= tokensLength) return sc; - - while (pos < tokensLength) { - if (checkS(pos)) sc.push(getS()); - else if (checkCommentML(pos)) sc.push(getCommentML()); - else break; - } - - return sc; - } - - /** - * Check if token is part of a selector - * @param {Number} i Token's index number - * @returns {Number} Length of the selector - */ - function checkSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector(i) || checkDelim(i)) i += l; - else break; - } - - if (i !== start) tokens[start].selector_end = i - 1; - - return i - start; - } - - /** - * @returns {Array} - */ - function getSelector() { - var startPos = pos, - x = [NodeType.SelectorType], - selector_end = tokens[pos].selector_end; - - while (pos <= selector_end) { - x.push(checkDelim(pos) ? getDelim() : getSimpleSelector()); - } - - return x; - } - - /** - * Check if token is part of a hexadecimal number (e.g. `#fff`) inside - * a simple selector - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkShash(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - - return (l = checkNmName(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a hexadecimal number (e.g. `#fff`) inside a simple - * selector - * @returns {Array} `['shash', x]` where `x` is a hexadecimal number - * converted to string (without `#`, e.g. `fff`) - */ - function getShash() { - var startPos = pos, - x = [NodeType.ShashType]; - - pos++; - - x.push(getNmName()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector1(i)) i += l; - else break; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getSimpleSelector() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - - while (pos < tokensLength) { - if (!checkSimpleSelector1(pos)) break; - t = getSimpleSelector1(); - - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector1(i) { - return checkNthselector(i) || - checkCombinator(i) || - checkAttrib(i) || - checkPseudo(i) || - checkShash(i) || - checkAny(i) || - checkSC(i) || - checkNamespace(i); - } - - /** - * @returns {Array} - */ - function getSimpleSelector1() { - if (checkNthselector(pos)) return getNthselector(); - else if (checkCombinator(pos)) return getCombinator(); - else if (checkAttrib(pos)) return getAttrib(); - else if (checkPseudo(pos)) return getPseudo(); - else if (checkShash(pos)) return getShash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkNamespace(pos)) return getNamespace(); - } - - /** - * Check if token is part of a string (text wrapped in quotes) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is part of a string, `0` if not - */ - function checkString(i) { - return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0; - } - - /** - * Get string's node - * @returns {Array} `['string', x]` where `x` is a string (including - * quotes). - */ - function getString() { - var startPos = pos, - x = [NodeType.StringType, tokens[pos++].value]; - - return x; - } - - /** - * Validate stylesheet: it should consist of any number (0 or more) of - * rulesets (sets of rules with selectors), @-rules, whitespaces or - * comments. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkStylesheet(i) { - var start = i, - l; - - // Check every token: - while (i < tokensLength) { - if (l = checkSC(i) || - checkDeclDelim(i) || - checkAtrule(i) || - checkRuleset(i)) i += l; - else throwError(i); - } - - return i - start; - } - - /** - * @returns {Array} `['stylesheet', x]` where `x` is all stylesheet's - * nodes. - */ - function getStylesheet() { - var startPos = pos, - x = [NodeType.StylesheetType]; - - while (pos < tokensLength) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkRuleset(pos)) x.push(getRuleset()); - else if (checkAtrule(pos)) x.push(getAtrule()); - else if (checkDeclDelim(pos)) x.push(getDeclDelim()); - else throwError(); - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkTset(i) { - return checkVhash(i) || - checkAny(i) || - checkSC(i) || - checkOperator(i); - } - - /** - * @returns {Array} - */ - function getTset() { - if (checkVhash(pos)) return getVhash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkOperator(pos)) return getOperator(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkTsets(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - while (l = checkTset(i)) { - i += l; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getTsets() { - var x = [], - t; - - while (t = getTset()) { - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * Check if token is an unary (arithmetical) sign (`+` or `-`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is an unary sign, `0` if not - */ - function checkUnary(i) { - return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0; - } - - /** - * Get node with an unary (arithmetical) sign (`+` or `-`) - * @returns {Array} `['unary', x]` where `x` is an unary sign - * converted to string. - */ - function getUnary() { - var startPos = pos, - x = [NodeType.UnaryType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is part of URI (e.g. `url('/css/styles.css')`) - * @param {Number} i Token's index number - * @returns {Number} Length of URI - */ - function checkUri(i) { - var start = i; - - if (i >= tokensLength || tokens[i++].value !== 'url' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) - return 0; - - return tokens[i].right - start + 1; - } - - /** - * Get node with URI - * @returns {Array} `['uri', x]` where `x` is URI's nodes (without `url` - * and braces, e.g. `['string', ''/css/styles.css'']`). - */ - function getUri() { - var startPos = pos, - uriExcluding = {}, - uri, - l, - raw; - - pos += 2; - - uriExcluding[TokenType.Space] = 1; - uriExcluding[TokenType.Tab] = 1; - uriExcluding[TokenType.Newline] = 1; - uriExcluding[TokenType.LeftParenthesis] = 1; - uriExcluding[TokenType.RightParenthesis] = 1; - - if (checkUri1(pos)) { - uri = [NodeType.UriType] - .concat(getSC()) - .concat([getString()]) - .concat(getSC()); - - pos++; - } else { - uri = [NodeType.UriType].concat(getSC()), - l = checkExcluding(uriExcluding, pos), - raw = [NodeType.RawType, joinValues(pos, pos + l)]; - - uri.push(raw); - - pos += l + 1; - - uri = uri.concat(getSC()); - - pos++; - } - - return uri; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkUri1(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0; - - i++; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * Check if token is part of a value - * @param {Number} i Token's index number - * @returns {Number} Length of the value - */ - function checkValue(i) { - var start = i, - l, s, _i; - - while (i < tokensLength) { - s = checkSC(i); - _i = i + s; - - if (l = _checkValue(_i)) i += l + s; - else break; - } - - return i - start; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function _checkValue(i) { - return checkVhash(i) || - checkAny(i) || - checkOperator(i) || - checkImportant(i); - } - - /** - * @returns {Array} - */ - function getValue() { - var startPos = pos, - x = [NodeType.ValueType], - s, _pos; - - while (pos < tokensLength) { - s = checkSC(pos); - _pos = pos + s; - - if (!_checkValue(_pos)) break; - - if (s) x = x.concat(getSC()); - x.push(_getValue()); - } - - return x; - } - - /** - * @returns {Array} - */ - function _getValue() { - if (checkVhash(pos)) return getVhash(); - else if (checkAny(pos)) return getAny(); - else if (checkOperator(pos)) return getOperator(); - else if (checkImportant(pos)) return getImportant(); - } - - /** - * Check if token is part of a hexadecimal number (e.g. `#fff`) inside - * some value - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkVhash(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - - return (l = checkNmName2(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a hexadecimal number (e.g. `#fff`) inside some value - * @returns {Array} `['vhash', x]` where `x` is a hexadecimal number - * converted to string (without `#`, e.g. `'fff'`). - */ - function getVhash() { - var startPos = pos, - x = [NodeType.VhashType]; - - pos++; - - x.push(getNmName2()); - - return x; - } - - return function(_tokens, rule) { - tokens = _tokens; - tokensLength = tokens.length; - pos = 0; - - return rules[rule](); - }; -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/stringify.js deleted file mode 100644 index 166f77e..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/stringify.js +++ /dev/null @@ -1,97 +0,0 @@ -module.exports = function stringify(tree) { - // TODO: Better error message - if (!tree) throw new Error('We need tree to translate'); - - var _m_simple = { - 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1, - 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1 - }, - _m_composite = { - 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1, - 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1, - 'ident': 1, 'selector': 1, 'progid': 1, 'property': 1, - 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 - }, - _m_primitive = { - 'declDelim': ';', 'delim': ',', 'namespace': '|', - 'propertyDelim' : ':' - }; - - function _t(tree) { - var t = tree[0]; - if (t in _m_primitive) return _m_primitive[t]; - else if (t in _m_simple) return _simple(tree); - else if (t in _m_composite) return _composite(tree); - return _unique[t](tree); - } - - function _composite(t, i) { - var s = ''; - i = i === undefined ? 1 : i; - for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); - return s; - } - - function _simple(t) { - return t[1]; - } - - var _unique = { - 'arguments': function(t) { - return '(' + _composite(t) + ')'; - }, - 'atkeyword': function(t) { - return '@' + _t(t[1]); - }, - 'atruler': function(t) { - return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}'; - }, - 'attrib': function(t) { - return '[' + _composite(t) + ']'; - }, - 'block': function(t) { - return '{' + _composite(t) + '}'; - }, - 'braces': function(t) { - return t[1] + _composite(t, 3) + t[2]; - }, - 'class': function(t) { - return '.' + _t(t[1]); - }, - 'commentML': function (t) { - return '/*' + t[1] + '*/'; - }, - 'filter': function(t) { - return _t(t[1]) + ':' + _t(t[2]); - }, - 'functionExpression': function(t) { - return 'expression(' + t[1] + ')'; - }, - 'important': function(t) { - return '!' + _composite(t) + 'important'; - }, - 'nthselector': function(t) { - return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')'; - }, - 'percentage': function(t) { - return _t(t[1]) + '%'; - }, - 'pseudoc': function(t) { - return ':' + _t(t[1]); - }, - 'pseudoe': function(t) { - return '::' + _t(t[1]); - }, - 'shash': function (t) { - return '#' + t[1]; - }, - 'uri': function(t) { - return 'url(' + _composite(t) + ')'; - }, - 'vhash': function(t) { - return '#' + t[1]; - } - }; - - return _t(tree); -} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/tokenizer.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/css/tokenizer.js deleted file mode 100644 index a79ffda..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/css/tokenizer.js +++ /dev/null @@ -1,249 +0,0 @@ -module.exports = function(css) { - var TokenType = require('../token-types'); - - var tokens = [], - urlMode = false, - blockMode = 0, - c, // current character - cn, // next character - pos = 0, - tn = 0, - ln = 1; - - var Punctuation = { - ' ': TokenType.Space, - '\n': TokenType.Newline, - '\r': TokenType.Newline, - '\t': TokenType.Tab, - '!': TokenType.ExclamationMark, - '"': TokenType.QuotationMark, - '#': TokenType.NumberSign, - '$': TokenType.DollarSign, - '%': TokenType.PercentSign, - '&': TokenType.Ampersand, - '\'': TokenType.Apostrophe, - '(': TokenType.LeftParenthesis, - ')': TokenType.RightParenthesis, - '*': TokenType.Asterisk, - '+': TokenType.PlusSign, - ',': TokenType.Comma, - '-': TokenType.HyphenMinus, - '.': TokenType.FullStop, - '/': TokenType.Solidus, - ':': TokenType.Colon, - ';': TokenType.Semicolon, - '<': TokenType.LessThanSign, - '=': TokenType.EqualsSign, - '>': TokenType.GreaterThanSign, - '?': TokenType.QuestionMark, - '@': TokenType.CommercialAt, - '[': TokenType.LeftSquareBracket, - ']': TokenType.RightSquareBracket, - '^': TokenType.CircumflexAccent, - '_': TokenType.LowLine, - '{': TokenType.LeftCurlyBracket, - '|': TokenType.VerticalLine, - '}': TokenType.RightCurlyBracket, - '~': TokenType.Tilde - }; - - /** - * Add a token to the token list - * @param {string} type - * @param {string} value - */ - function pushToken(type, value) { - tokens.push({ tn: tn++, ln: ln, type: type, value: value }); - } - - /** - * Check if a character is a decimal digit - * @param {string} c Character - * @returns {boolean} - */ - function isDecimalDigit(c) { - return '0123456789'.indexOf(c) >= 0; - } - - /** - * Parse spaces - * @param {string} css Unparsed part of CSS string - */ - function parseSpaces(css) { - var start = pos; - - // Read the string until we meet a non-space character: - for (; pos < css.length; pos++) { - if (css.charAt(pos) !== ' ') break; - } - - // Add a substring containing only spaces to tokens: - pushToken(TokenType.Space, css.substring(start, pos)); - pos--; - } - - /** - * Parse a string within quotes - * @param {string} css Unparsed part of CSS string - * @param {string} q Quote (either `'` or `"`) - */ - function parseString(css, q) { - var start = pos; - - // Read the string until we meet a matching quote: - for (pos = pos + 1; pos < css.length; pos++) { - // Skip escaped quotes: - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) === q) break; - } - - // Add the string (including quotes) to tokens: - pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1)); - } - - /** - * Parse numbers - * @param {string} css Unparsed part of CSS string - */ - function parseDecimalNumber(css) { - var start = pos; - - // Read the string until we meet a character that's not a digit: - for (; pos < css.length; pos++) { - if (!isDecimalDigit(css.charAt(pos))) break; - } - - // Add the number to tokens: - pushToken(TokenType.DecimalNumber, css.substring(start, pos)); - pos--; - } - - /** - * Parse identifier - * @param {string} css Unparsed part of CSS string - */ - function parseIdentifier(css) { - var start = pos; - - // Skip all opening slashes: - while (css.charAt(pos) === '/') pos++; - - // Read the string until we meet a punctuation mark: - for (; pos < css.length; pos++) { - // Skip all '\': - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) in Punctuation) break; - } - - var ident = css.substring(start, pos); - - // Enter url mode if parsed substring is `url`: - urlMode = urlMode || ident === 'url'; - - // Add identifier to tokens: - pushToken(TokenType.Identifier, ident); - pos--; - } - - /** - * Parse a multiline comment - * @param {string} css Unparsed part of CSS string - */ - function parseMLComment(css) { - var start = pos; - - // Read the string until we meet `*/`. - // Since we already know first 2 characters (`/*`), start reading - // from `pos + 2`: - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') { - pos++; - break; - } - } - - // Add full comment (including `/*` and `*/`) to the list of tokens: - pushToken(TokenType.CommentML, css.substring(start, pos + 1)); - } - - function parseSLComment(css) { - var start = pos; - - // Read the string until we meet line break. - // Since we already know first 2 characters (`//`), start reading - // from `pos + 2`: - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { - break; - } - } - - // Add comment (including `//` and line break) to the list of tokens: - pushToken(TokenType.CommentSL, css.substring(start, pos)); - pos--; - } - - /** - * Convert a CSS string to a list of tokens - * @param {string} css CSS string - * @returns {Array} List of tokens - * @private - */ - function getTokens(css) { - // Parse string, character by character: - for (pos = 0; pos < css.length; pos++) { - c = css.charAt(pos); - cn = css.charAt(pos + 1); - - // If we meet `/*`, it's a start of a multiline comment. - // Parse following characters as a multiline comment: - if (c === '/' && cn === '*') { - parseMLComment(css); - } - - // If we meet `//` and it is not a part of url: - else if (!urlMode && c === '/' && cn === '/') { - // If we're currently inside a block, treat `//` as a start - // of identifier. Else treat `//` as a start of a single-line - // comment: - if (blockMode > 0) parseIdentifier(css); - else parseSLComment(css); - } - - // If current character is a double or single quote, it's a start - // of a string: - else if (c === '"' || c === "'") { - parseString(css, c); - } - - // If current character is a space: - else if (c === ' ') { - parseSpaces(css) - } - - // If current character is a punctuation mark: - else if (c in Punctuation) { - // Add it to the list of tokens: - pushToken(Punctuation[c], c); - if (c === '\n' || c === '\r') ln++; // Go to next line - if (c === ')') urlMode = false; // exit url mode - if (c === '{') blockMode++; // enter a block - if (c === '}') blockMode--; // exit a block - } - - // If current character is a decimal digit: - else if (isDecimalDigit(c)) { - parseDecimalNumber(css); - } - - // If current character is anything else: - else { - parseIdentifier(css); - } - } - - return tokens; - } - - return getTokens(css); -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.ast-to-css.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.ast-to-css.js deleted file mode 100644 index 911aac3..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.ast-to-css.js +++ /dev/null @@ -1,121 +0,0 @@ -function astToCSS(options) { - var tree, hasInfo, syntax; - if (!options) throw new Error('We need tree to translate'); - tree = typeof options === 'string' ? options : options.ast; - hasInfo = typeof tree[0] === 'object'; - syntax = options.syntax || 'css'; - var _m_simple = { - 'attrselector': 1, 'combinator': 1, 'ident': 1, 'nth': 1, 'number': 1, - 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1, 'unknown': 1 - }, - _m_composite = { - 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, - 'declaration': 1, 'dimension': 1, 'filterv': 1, 'include': 1, - 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1, - 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 - }, - _m_primitive = { - 'cdc': 'cdc', 'cdo': 'cdo', - 'declDelim': syntax === 'sass' ? '\n' : ';', - 'delim': ',', - 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' - }; - function _t(tree) { - var t = tree[hasInfo? 1 : 0]; - if (t in _m_primitive) return _m_primitive[t]; - else if (t in _m_simple) return _simple(tree); - else if (t in _m_composite) return _composite(tree); - return _unique[t](tree); - } - function _composite(t, i) { - var s = ''; - i = i === undefined ? (hasInfo? 2 : 1) : i; - for (; i < t.length; i++) s += _t(t[i]); - return s; - } - function _simple(t) { - return t[hasInfo? 2 : 1]; - } - var _unique = { - 'arguments': function(t) { - return '(' + _composite(t) + ')'; - }, - 'atkeyword': function(t) { - return '@' + _t(t[hasInfo? 2 : 1]); - }, - 'atruler': function(t) { - return _t(t[hasInfo? 2 : 1]) + _t(t[hasInfo? 3 : 2]) + '{' + _t(t[hasInfo? 4 : 3]) + '}'; - }, - 'attrib': function(t) { - return '[' + _composite(t) + ']'; - }, - 'block': function(t) { - return syntax === 'sass' ? _composite(t) : '{' + _composite(t) + '}'; - }, - 'braces': function(t) { - return t[hasInfo? 2 : 1] + _composite(t, hasInfo? 4 : 3) + t[hasInfo? 3 : 2]; - }, - 'class': function(t) { - return '.' + _t(t[hasInfo? 2 : 1]); - }, - 'commentML': function (t) { - return '/*' + t[hasInfo? 2 : 1] + (syntax === 'sass' ? '' : '*/'); - }, - 'commentSL': function (t) { - return '/' + '/' + t[hasInfo? 2 : 1]; - }, - 'default': function(t) { - return '!' + _composite(t) + 'default'; - }, - 'escapedString': function(t) { - return '~' + t[hasInfo? 2 : 1]; - }, - 'filter': function(t) { - return _t(t[hasInfo? 2 : 1]) + ':' + _t(t[hasInfo? 3 : 2]); - }, - 'functionExpression': function(t) { - return 'expression(' + t[hasInfo? 2 : 1] + ')'; - }, - 'function': function(t) { - return _simple(t[hasInfo? 2 : 1]) + '(' + _composite(t[hasInfo? 3: 2]) + ')'; - }, - 'important': function(t) { - return '!' + _composite(t) + 'important'; - }, - 'interpolatedVariable': function(t) { - return (syntax === 'less' ? '@{' : '#\{$') + _t(t[hasInfo? 2 : 1]) + '}'; - }, - 'nthselector': function(t) { - return ':' + _simple(t[hasInfo? 2 : 1]) + '(' + _composite(t, hasInfo? 3 : 2) + ')'; - }, - 'percentage': function(t) { - return _t(t[hasInfo? 2 : 1]) + '%'; - }, - 'placeholder': function(t) { - return '%' + _t(t[hasInfo? 2 : 1]); - }, - 'pseudoc': function(t) { - return ':' + _t(t[hasInfo? 2 : 1]); - }, - 'pseudoe': function(t) { - return '::' + _t(t[hasInfo? 2 : 1]); - }, - 'shash': function (t) { - return '#' + t[hasInfo? 2 : 1]; - }, - 'uri': function(t) { - return 'url(' + _composite(t) + ')'; - }, - 'variable': function(t) { - return (syntax === 'less' ? '@' : '$') + _t(t[hasInfo? 2 : 1]); - }, - 'variableslist': function(t) { - return _t(t[hasInfo? 2 : 1]) + '...'; - }, - 'vhash': function(t) { - return '#' + t[hasInfo? 2 : 1]; - } - }; - return _t(tree); -} -exports.astToCSS = astToCSS; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.css-to-ast.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.css-to-ast.js deleted file mode 100644 index 1d30504..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.css-to-ast.js +++ /dev/null @@ -1,3832 +0,0 @@ -var cssToAST = (function() { - var syntaxes = {}, - s, - needInfo, - tokens, - tokensLength, - tn = 0, - ln = 1, - pos = 0; - function pushToken(type, value) { - tokens.push({ tn: tn++, ln: ln, type: type, value: value }); - } - function throwError(i) { - var ln = i ? tokens[i].ln : tokens[pos].ln; - throw new Error('Please check the validity of the CSS block starting from the line #' + ln); - } - function getInfo(i) { - return { ln: tokens[i].ln, tn: tokens[i].tn }; - } - function checkExcluding(exclude, i) { - var start = i; - while(i < tokensLength) { - if (exclude[tokens[i++].type]) break; - } - return i - start - 2; - } - function joinValues(start, finish) { - var s = ''; - for (var i = start; i < finish + 1; i++) { - s += tokens[i].value; - } - return s; - } - function joinValues2(start, num) { - if (start + num - 1 >= tokensLength) return; - var s = ''; - for (var i = 0; i < num; i++) { - s += tokens[start + i].value; - } - return s; - } -var TokenType = { - StringSQ: 'StringSQ', - StringDQ: 'StringDQ', - CommentML: 'CommentML', - CommentSL: 'CommentSL', - Newline: 'Newline', - Space: 'Space', - Tab: 'Tab', - ExclamationMark: 'ExclamationMark', - QuotationMark: 'QuotationMark', - NumberSign: 'NumberSign', - DollarSign: 'DollarSign', - PercentSign: 'PercentSign', - Ampersand: 'Ampersand', - Apostrophe: 'Apostrophe', - LeftParenthesis: 'LeftParenthesis', - RightParenthesis: 'RightParenthesis', - Asterisk: 'Asterisk', - PlusSign: 'PlusSign', - Comma: 'Comma', - HyphenMinus: 'HyphenMinus', - FullStop: 'FullStop', - Solidus: 'Solidus', - Colon: 'Colon', - Semicolon: 'Semicolon', - LessThanSign: 'LessThanSign', - EqualsSign: 'EqualsSign', - GreaterThanSign: 'GreaterThanSign', - QuestionMark: 'QuestionMark', - CommercialAt: 'CommercialAt', - LeftSquareBracket: 'LeftSquareBracket', - ReverseSolidus: 'ReverseSolidus', - RightSquareBracket: 'RightSquareBracket', - CircumflexAccent: 'CircumflexAccent', - LowLine: 'LowLine', - LeftCurlyBracket: 'LeftCurlyBracket', - VerticalLine: 'VerticalLine', - RightCurlyBracket: 'RightCurlyBracket', - Tilde: 'Tilde', - Identifier: 'Identifier', - DecimalNumber: 'DecimalNumber' -}; -var NodeType = { - ArgumentsType: 'arguments', - AtkeywordType: 'atkeyword', - AtrulebType: 'atruleb', - AtrulerType: 'atruler', - AtrulerqType: 'atrulerq', - AtrulersType: 'atrulers', - AtrulesType: 'atrules', - AttribType: 'attrib', - AttrselectorType: 'attrselector', - BlockType: 'block', - BracesType: 'braces', - CdcType: 'cdc', - CdoType: 'cdo', - ClassType: 'class', - CombinatorType: 'combinator', - CommentMLType: 'commentML', - CommentSLType: 'commentSL', - ConditionType: 'condition', - DeclarationType: 'declaration', - DeclDelimType: 'declDelim', - DefaultType: 'default', - DelimType: 'delim', - DimensionType: 'dimension', - EscapedStringType: 'escapedString', - FilterType: 'filter', - FiltervType: 'filterv', - FunctionType: 'function', - FunctionBodyType: 'functionBody', - FunctionExpressionType: 'functionExpression', - IdentType: 'ident', - ImportantType: 'important', - IncludeType :'include', - InterpolatedVariableType: 'interpolatedVariable', - LoopType: 'loop', - MixinType: 'mixin', - NamespaceType: 'namespace', - NthType: 'nth', - NthselectorType: 'nthselector', - NumberType: 'number', - OperatorType: 'operator', - ParentSelectorType: 'parentselector', - PercentageType: 'percentage', - PlaceholderType: 'placeholder', - ProgidType: 'progid', - PropertyType: 'property', - PropertyDelimType: 'propertyDelim', - PseudocType: 'pseudoc', - PseudoeType: 'pseudoe', - RawType: 'raw', - RulesetType: 'ruleset', - SType: 's', - SelectorType: 'selector', - ShashType: 'shash', - SimpleselectorType: 'simpleselector', - StringType: 'string', - StylesheetType: 'stylesheet', - UnaryType: 'unary', - UnknownType: 'unknown', - UriType: 'uri', - ValueType: 'value', - VariableType: 'variable', - VariablesListType: 'variableslist', - VhashType: 'vhash' -}; -var getTokens = (function() { - var Punctuation, - urlMode = false, - blockMode = 0; - Punctuation = { - ' ': TokenType.Space, - '\n': TokenType.Newline, - '\r': TokenType.Newline, - '\t': TokenType.Tab, - '!': TokenType.ExclamationMark, - '"': TokenType.QuotationMark, - '#': TokenType.NumberSign, - '$': TokenType.DollarSign, - '%': TokenType.PercentSign, - '&': TokenType.Ampersand, - '\'': TokenType.Apostrophe, - '(': TokenType.LeftParenthesis, - ')': TokenType.RightParenthesis, - '*': TokenType.Asterisk, - '+': TokenType.PlusSign, - ',': TokenType.Comma, - '-': TokenType.HyphenMinus, - '.': TokenType.FullStop, - '/': TokenType.Solidus, - ':': TokenType.Colon, - ';': TokenType.Semicolon, - '<': TokenType.LessThanSign, - '=': TokenType.EqualsSign, - '>': TokenType.GreaterThanSign, - '?': TokenType.QuestionMark, - '@': TokenType.CommercialAt, - '[': TokenType.LeftSquareBracket, - ']': TokenType.RightSquareBracket, - '^': TokenType.CircumflexAccent, - '_': TokenType.LowLine, - '{': TokenType.LeftCurlyBracket, - '|': TokenType.VerticalLine, - '}': TokenType.RightCurlyBracket, - '~': TokenType.Tilde - }; - function isDecimalDigit(c) { - return '0123456789'.indexOf(c) >= 0; - } - function parseSpaces(css) { - var start = pos; - for (; pos < css.length; pos++) { - if (css.charAt(pos) !== ' ') break; - } - pushToken(TokenType.Space, css.substring(start, pos)); - pos--; - } - function parseString(css, q) { - var start = pos; - for (pos = pos + 1; pos < css.length; pos++) { - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) === q) break; - } - pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1)); - } - function parseDecimalNumber(css) { - var start = pos; - for (; pos < css.length; pos++) { - if (!isDecimalDigit(css.charAt(pos))) break; - } - pushToken(TokenType.DecimalNumber, css.substring(start, pos)); - pos--; - } - function parseIdentifier(css) { - var start = pos; - while (css.charAt(pos) === '/') pos++; - for (; pos < css.length; pos++) { - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) in Punctuation) break; - } - var ident = css.substring(start, pos); - urlMode = urlMode || ident === 'url'; - pushToken(TokenType.Identifier, ident); - pos--; - } - function _getTokens(css, syntax) { - var c, - cn; - tokens = []; - pos = 0; - tn = 0; - ln = 1; - for (pos = 0; pos < css.length; pos++) { - c = css.charAt(pos); - cn = css.charAt(pos + 1); - if (c === '/' && cn === '*') { - s.parseMLComment(css); - } - else if (!urlMode && c === '/' && cn === '/') { - if (syntax === 'css' && blockMode > 0) parseIdentifier(css); - else s.parseSLComment && s.parseSLComment(css); - } - else if (c === '"' || c === "'") { - parseString(css, c); - } - else if (c === ' ') { - parseSpaces(css) - } - else if (c in Punctuation) { - pushToken(Punctuation[c], c); - if (c === '\n' || c === '\r') ln++; - if (c === ')') urlMode = false; - if (c === '{') blockMode++; - if (c === '}') blockMode--; - } - else if (isDecimalDigit(c)) { - parseDecimalNumber(css); - } - else { - parseIdentifier(css); - } - } - } - return function(s, syntax) { - return _getTokens(s, syntax); - }; -}()); -var rules = { - 'arguments': function() { if (s.checkArguments(pos)) return s.getArguments() }, - 'atkeyword': function() { if (s.checkAtkeyword(pos)) return s.getAtkeyword() }, - 'atruleb': function() { if (s.checkAtruleb(pos)) return s.getAtruleb() }, - 'atruler': function() { if (s.checkAtruler(pos)) return s.getAtruler() }, - 'atrulerq': function() { if (s.checkAtrulerq(pos)) return s.getAtrulerq() }, - 'atrulers': function() { if (s.checkAtrulers(pos)) return s.getAtrulers() }, - 'atrules': function() { if (s.checkAtrules(pos)) return s.getAtrules() }, - 'attrib': function() { if (s.checkAttrib(pos)) return s.getAttrib() }, - 'attrselector': function() { if (s.checkAttrselector(pos)) return s.getAttrselector() }, - 'block': function() { if (s.checkBlock(pos)) return s.getBlock() }, - 'braces': function() { if (s.checkBraces(pos)) return s.getBraces() }, - 'class': function() { if (s.checkClass(pos)) return s.getClass() }, - 'combinator': function() { if (s.checkCombinator(pos)) return s.getCombinator() }, - 'commentML': function() { if (s.checkCommentML(pos)) return s.getCommentML() }, - 'commentSL': function() { if (s.checkCommentSL(pos)) return s.getCommentSL() }, - 'condition': function() { if (s.checkCondition(pos)) return s.getCondition() }, - 'declaration': function() { if (s.checkDeclaration(pos)) return s.getDeclaration() }, - 'declDelim': function() { if (s.checkDeclDelim(pos)) return s.getDeclDelim() }, - 'default': function () { if (s.checkDefault(pos)) return s.getDefault() }, - 'delim': function() { if (s.checkDelim(pos)) return s.getDelim() }, - 'dimension': function() { if (s.checkDimension(pos)) return s.getDimension() }, - 'escapedString': function() { if (s.checkEscapedString(pos)) return s.getEscapedString() }, - 'filter': function() { if (s.checkFilter(pos)) return s.getFilter() }, - 'filterv': function() { if (s.checkFilterv(pos)) return s.getFilterv() }, - 'functionExpression': function() { if (s.checkFunctionExpression(pos)) return s.getFunctionExpression() }, - 'function': function() { if (s.checkFunction(pos)) return s.getFunction() }, - 'ident': function() { if (s.checkIdent(pos)) return s.getIdent() }, - 'important': function() { if (s.checkImportant(pos)) return s.getImportant() }, - 'include': function () { if (s.checkInclude(pos)) return s.getInclude() }, - 'interpolatedVariable': function () { if (s.checkInterpolatedVariable(pos)) return s.getInterpolatedVariable() }, - 'loop': function() { if (s.checkLoop(pos)) return s.getLoop() }, - 'mixin': function () { if (s.checkMixin(pos)) return s.getMixin() }, - 'namespace': function() { if (s.checkNamespace(pos)) return s.getNamespace() }, - 'nth': function() { if (s.checkNth(pos)) return s.getNth() }, - 'nthselector': function() { if (s.checkNthselector(pos)) return s.getNthselector() }, - 'number': function() { if (s.checkNumber(pos)) return s.getNumber() }, - 'operator': function() { if (s.checkOperator(pos)) return s.getOperator() }, - 'parentselector': function () { if (s.checkParentSelector(pos)) return s.getParentSelector() }, - 'percentage': function() { if (s.checkPercentage(pos)) return s.getPercentage() }, - 'placeholder': function() { if (s.checkPlaceholder(pos)) return s.getPlaceholder() }, - 'progid': function() { if (s.checkProgid(pos)) return s.getProgid() }, - 'property': function() { if (s.checkProperty(pos)) return s.getProperty() }, - 'propertyDelim': function() { if (s.checkPropertyDelim(pos)) return s.getPropertyDelim() }, - 'pseudoc': function() { if (s.checkPseudoc(pos)) return s.getPseudoc() }, - 'pseudoe': function() { if (s.checkPseudoe(pos)) return s.getPseudoe() }, - 'ruleset': function() { if (s.checkRuleset(pos)) return s.getRuleset() }, - 's': function() { if (s.checkS(pos)) return s.getS() }, - 'selector': function() { if (s.checkSelector(pos)) return s.getSelector() }, - 'shash': function() { if (s.checkShash(pos)) return s.getShash() }, - 'simpleselector': function() { if (s.checkSimpleSelector(pos)) return s.getSimpleSelector() }, - 'string': function() { if (s.checkString(pos)) return s.getString() }, - 'stylesheet': function() { if (s.checkStylesheet(pos)) return s.getStylesheet() }, - 'unary': function() { if (s.checkUnary(pos)) return s.getUnary() }, - 'unknown': function() { if (s.checkUnknown(pos)) return s.getUnknown() }, - 'uri': function() { if (s.checkUri(pos)) return s.getUri() }, - 'value': function() { if (s.checkValue(pos)) return s.getValue() }, - 'variable': function () { if (s.checkVariable(pos)) return s.getVariable() }, - 'variableslist': function () { if (s.checkVariablesList(pos)) return s.getVariablesList() }, - 'vhash': function() { if (s.checkVhash(pos)) return s.getVhash() } -}; -syntaxes.css = { - checkAny: function(i) { - return this.checkBraces(i) || - this.checkString(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkFunctionExpression(i) || - this.checkFunction(i) || - this.checkIdent(i) || - this.checkClass(i) || - this.checkUnary(i); - }, - getAny: function() { - if (this.checkBraces(pos)) return this.getBraces(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression(); - else if (this.checkFunction(pos)) return this.getFunction(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - else if (this.checkUnary(pos)) return this.getUnary(); - }, - checkAtkeyword: function(i) { - var l; - if (i >= tokensLength || - tokens[i++].type !== TokenType.CommercialAt) return 0; - return (l = this.checkIdent(i)) ? l + 1 : 0; - }, - getAtkeyword: function() { - var startPos = pos, - x; - pos++; - x = [NodeType.AtkeywordType, this.getIdent()]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAttrib: function(i) { - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftSquareBracket || - !tokens[i].right) return 0; - return tokens[i].right - i + 1; - }, - getAttrib: function() { - if (this.checkAttrib1(pos)) return this.getAttrib1(); - if (this.checkAttrib2(pos)) return this.getAttrib2(); - }, - checkAttrib1: function(i) { - var start = i, - l; - if (i++ >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkAttrselector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i) || this.checkString(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - }, - getAttrib1: function() { - var startPos = pos, - x; - pos++; - x = [NodeType.AttribType] - .concat(this.getSC()) - .concat([this.getIdent()]) - .concat(this.getSC()) - .concat([this.getAttrselector()]) - .concat(this.getSC()) - .concat([this.checkString(pos)? this.getString() : this.getIdent()]) - .concat(this.getSC()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAttrib2: function(i) { - var start = i, - l; - if (i++ >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - }, - getAttrib2: function() { - var startPos = pos, - x; - pos++; - x = [NodeType.AttribType] - .concat(this.getSC()) - .concat([this.getIdent()]) - .concat(this.getSC()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAttrselector: function(i) { - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.EqualsSign) return 1; - if (tokens[i].type === TokenType.VerticalLine && - (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign)) - return 1; - if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0; - switch(tokens[i].type) { - case TokenType.Tilde: - case TokenType.CircumflexAccent: - case TokenType.DollarSign: - case TokenType.Asterisk: - case TokenType.VerticalLine: - return 2; - } - return 0; - }, - getAttrselector: function() { - var startPos = pos, - s = tokens[pos++].value, - x; - if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value; - x = [NodeType.AttrselectorType, s]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtrule: function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l; - if (l = this.checkAtruler(i)) tokens[i].atrule_type = 1; - else if (l = this.checkAtruleb(i)) tokens[i].atrule_type = 2; - else if (l = this.checkAtrules(i)) tokens[i].atrule_type = 3; - else return 0; - tokens[i].atrule_l = l; - return l; - }, - getAtrule: function() { - switch (tokens[pos].atrule_type) { - case 1: return this.getAtruler(); - case 2: return this.getAtruleb(); - case 3: return this.getAtrules(); - } - }, - checkAtruleb: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (l = this.checkTsets(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - return i - start; - }, - getAtruleb: function() { - var startPos = pos, - x; - x = [NodeType.AtrulebType, this.getAtkeyword()] - .concat(this.getTsets()) - .concat([this.getBlock()]); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtruler: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (l = this.checkAtrulerq(i)) i += l; - if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++; - else return 0; - if (l = this.checkAtrulers(i)) i += l; - if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++; - else return 0; - return i - start; - }, - getAtruler: function() { - var startPos = pos, - x; - x = [NodeType.AtrulerType, this.getAtkeyword(), this.getAtrulerq()]; - pos++; - x.push(this.getAtrulers()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtrulerq: function(i) { - return this.checkTsets(i); - }, - getAtrulerq: function() { - var startPos = pos, - x; - x = [NodeType.AtrulerqType].concat(this.getTsets()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtrulers: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - while (l = this.checkRuleset(i) || this.checkAtrule(i) || this.checkSC(i)) { - i += l; - } - tokens[i].atrulers_end = 1; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getAtrulers: function() { - var startPos = pos, - x; - x = [NodeType.AtrulersType].concat(this.getSC()); - while (!tokens[pos].atrulers_end) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkRuleset(pos)) x.push(this.getRuleset()); - else x.push(this.getAtrule()); - } - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtrules: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (l = this.checkTsets(i)) i += l; - return i - start; - }, - getAtrules: function() { - var startPos = pos, - x; - x = [NodeType.AtrulesType, this.getAtkeyword()].concat(this.getTsets()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkBlock: function(i) { - return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ? - tokens[i].right - i + 1 : 0; - }, - getBlock: function() { - var startPos = pos, - end = tokens[pos].right, - x = [NodeType.BlockType]; - pos++; - while (pos < end) { - if (this.checkBlockdecl(pos)) x = x.concat(this.getBlockdecl()); - else throwError(); - } - pos = end + 1; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkBlockdecl: function(i) { - var l; - if (i >= tokensLength) return 0; - if (l = this.checkBlockdecl1(i)) tokens[i].bd_type = 1; - else if (l = this.checkBlockdecl2(i)) tokens[i].bd_type = 2; - else if (l = this.checkBlockdecl3(i)) tokens[i].bd_type = 3; - else if (l = this.checkBlockdecl4(i)) tokens[i].bd_type = 4; - else return 0; - return l; - }, - getBlockdecl: function() { - switch (tokens[pos].bd_type) { - case 1: return this.getBlockdecl1(); - case 2: return this.getBlockdecl2(); - case 3: return this.getBlockdecl3(); - case 4: return this.getBlockdecl4(); - } - }, - checkBlockdecl1: function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkFilter(i)) tokens[i].bd_kind = 1; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 2; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 3; - else return 0; - i += l; - if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - return i - start; - }, - getBlockdecl1: function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getFilter(); - break; - case 2: - x = this.getDeclaration(); - break; - case 3: - x = this.getAtrule(); - break; - } - return sc - .concat([x]) - .concat([this.getDeclDelim()]) - .concat(this.getSC()); - }, - checkBlockdecl2: function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkFilter(i)) tokens[i].bd_kind = 1; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 2; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 3; - else return 0; - i += l; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getBlockdecl2: function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getFilter(); - break; - case 2: - x = this.getDeclaration(); - break; - case 3: - x = this.getAtrule(); - break; - } - return sc - .concat([x]) - .concat(this.getSC()); - }, - checkBlockdecl3: function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkDeclDelim(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getBlockdecl3: function() { - return this.getSC() - .concat([this.getDeclDelim()]) - .concat(this.getSC()); - }, - checkBlockdecl4: function(i) { - return this.checkSC(i); - }, - getBlockdecl4: function() { - return this.getSC(); - }, - checkBraces: function(i) { - if (i >= tokensLength || - (tokens[i].type !== TokenType.LeftParenthesis && - tokens[i].type !== TokenType.LeftSquareBracket)) return 0; - return tokens[i].right - i + 1; - }, - getBraces: function() { - var startPos = pos, - left = pos, - right = tokens[pos].right, - x; - pos++; - var tsets = this.getTsets(); - pos++; - x = [NodeType.BracesType, tokens[left].value, tokens[right].value] - .concat(tsets); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkClass: function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].class_l) return tokens[i].class_l; - if (tokens[i++].type === TokenType.FullStop && (l = this.checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - return 0; - }, - getClass: function() { - var startPos = pos, - x = [NodeType.ClassType]; - pos++; - x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkCombinator: function(i) { - if (i >= tokensLength) return 0; - switch (tokens[i].type) { - case TokenType.PlusSign: - case TokenType.GreaterThanSign: - case TokenType.Tilde: - return 1; - } - return 0; - }, - getCombinator: function() { - var startPos = pos, - x; - x = [NodeType.CombinatorType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkCommentML: function(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0; - }, - getCommentML: function() { - var startPos = pos, - s = tokens[pos].value.substring(2), - l = s.length, - x; - if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2); - pos++; - x = [NodeType.CommentMLType, s]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkDeclaration: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkProperty(i)) i += l; - else return 0; - if (l = this.checkPropertyDelim(i)) i++; - else return 0; - if (l = this.checkValue(i)) i += l; - else return 0; - return i - start; - }, - getDeclaration: function() { - var startPos = pos, - x = [NodeType.DeclarationType]; - x.push(this.getProperty()); - x.push(this.getPropertyDelim()); - x.push(this.getValue()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkDeclDelim: function(i) { - return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0; - }, - getDeclDelim: function() { - var startPos = pos, - x = [NodeType.DeclDelimType]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkDelim: function(i) { - return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0; - }, - getDelim: function() { - var startPos = pos, - x = [NodeType.DelimType]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkDimension: function(i) { - var ln = this.checkNumber(i), - li; - if (i >= tokensLength || - !ln || - i + ln >= tokensLength) return 0; - return (li = this.checkNmName2(i + ln)) ? ln + li : 0; - }, - getDimension: function() { - var startPos = pos, - x = [NodeType.DimensionType, this.getNumber()], - ident = [NodeType.IdentType, this.getNmName2()]; - if (needInfo) ident.unshift(getInfo(startPos)); - x.push(ident); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFilter: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkFilterp(i)) i += l; - else return 0; - if (tokens[i].type === TokenType.Colon) i++; - else return 0; - if (l = this.checkFilterv(i)) i += l; - else return 0; - return i - start; - }, - getFilter: function() { - var startPos = pos, - x = [NodeType.FilterType, this.getFilterp()]; - pos++; - x.push(this.getFilterv()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFilterp: function(i) { - var start = i, - l, - x; - if (i >= tokensLength) return 0; - if (tokens[i].value === 'filter') l = 1; - else { - x = joinValues2(i, 2); - if (x === '-filter' || x === '_filter' || x === '*filter') l = 2; - else { - x = joinValues2(i, 4); - if (x === '-ms-filter') l = 4; - else return 0; - } - } - tokens[start].filterp_l = l; - i += l; - if (this.checkSC(i)) i += l; - return i - start; - }, - getFilterp: function() { - var startPos = pos, - ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)], - x; - if (needInfo) ident.unshift(getInfo(startPos)); - pos += tokens[pos].filterp_l; - x = [NodeType.PropertyType, ident].concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFilterv: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkProgid(i)) i += l; - else return 0; - while (l = this.checkProgid(i)) { - i += l; - } - tokens[start].last_progid = i; - if (i < tokensLength && (l = this.checkSC(i))) i += l; - if (i < tokensLength && (l = this.checkImportant(i))) i += l; - return i - start; - }, - getFilterv: function() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - x = x.concat(this.getSC()); - while (pos < last_progid) { - x.push(this.getProgid()); - } - if (this.checkSC(pos)) x = x.concat(this.getSC()); - if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFunctionExpression: function(i) { - var start = i; - if (i >= tokensLength || tokens[i++].value !== 'expression' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; - return tokens[i].right - start + 1; - }, - getFunctionExpression: function() { - var startPos = pos, - x, e; - pos++; - e = joinValues(pos + 1, tokens[pos].right - 1); - pos = tokens[pos].right + 1; - x = [NodeType.FunctionExpressionType, e]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFunction: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkIdent(i)) i +=l; - else return 0; - return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ? - tokens[i].right - start + 1 : 0; - }, - getFunction: function() { - var startPos = pos, - ident = this.getIdent(), - x = [NodeType.FunctionType, ident], - body; - pos++; - body = ident[needInfo ? 2 : 1] === 'not' ? this.getNotFunctionBody() : this.getFunctionBody(); - x.push(body); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - getFunctionBody: function() { - var startPos = pos, - x = [NodeType.FunctionBodyType], - body; - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (this.checkDeclaration(pos)) x.push(this.getDeclaration()); - else if (this.checkTset(pos)) { - body = this.getTset(); - if ((needInfo && typeof body[1] === 'string') || typeof body[0] === 'string') x.push(body); - else x = x.concat(body); - } else if (this.checkClass(pos)) x.push(this.getClass()); - else throwError(); - } - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - getNotFunctionBody: function() { - var startPos = pos, - x = [NodeType.FunctionBodyType]; - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (this.checkSimpleSelector(pos)) x.push(this.getSimpleSelector()); - else throwError(); - } - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkIdent: function(i) { - var start = i, - wasIdent, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i); - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.Asterisk) i++; - else return 0; - wasIdent = tokens[i - 1].type === TokenType.Identifier; - for (; i < tokensLength; i++) { - if (i >= tokensLength) break; - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine) { - if (tokens[i].type !== TokenType.Identifier && - (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break; - else wasIdent = true; - } - } - if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0; - tokens[start].ident_last = i - 1; - return i - start; - }, - checkIdentLowLine: function(i) { - var start = i; - if (i++ >= tokensLength) return 0; - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.DecimalNumber && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier) break; - } - tokens[start].ident_last = i - 1; - return i - start; - }, - getIdent: function() { - var startPos = pos, - x = [NodeType.IdentType, joinValues(pos, tokens[pos].ident_last)]; - pos = tokens[pos].ident_last + 1; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkImportant: function(i) { - var start = i, - l; - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - if (l = this.checkSC(i)) i += l; - return tokens[i].value === 'important' ? i - start + 1 : 0; - }, - getImportant: function() { - var startPos = pos, - x = [NodeType.ImportantType]; - pos++; - x = x.concat(this.getSC()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkNamespace: function(i) { - return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0; - }, - getNamespace: function() { - var startPos = pos, - x = [NodeType.NamespaceType]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkNmName: function(i) { - var start = i; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.LowLine || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DecimalNumber) i++; - else return 0; - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier && - tokens[i].type !== TokenType.DecimalNumber) break; - } - tokens[start].nm_name_last = i - 1; - return i - start; - }, - getNmName: function() { - var s = joinValues(pos, tokens[pos].nm_name_last); - pos = tokens[pos].nm_name_last + 1; - return s; - }, - checkNmName2: function(i) { - if (tokens[i].type === TokenType.Identifier) return 1; - else if (tokens[i].type !== TokenType.DecimalNumber) return 0; - i++; - return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1; - }, - getNmName2: function() { - var s = tokens[pos].value; - if (tokens[pos++].type === TokenType.DecimalNumber && - pos < tokensLength && - tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value; - return s; - }, - checkNth: function(i) { - if (i >= tokensLength) return 0; - return this.checkNth1(i) || this.checkNth2(i); - }, - checkNth1: function(i) { - var start = i; - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.DecimalNumber && - tokens[i].value !== 'n') break; - } - if (i !== start) tokens[start].nth_last = i - 1; - return i - start; - }, - getNth: function() { - var startPos = pos, - x = [NodeType.NthType]; - if (tokens[pos].nth_last) { - x.push(joinValues(pos, tokens[pos].nth_last)); - pos = tokens[pos].nth_last + 1; - } else { - x.push(tokens[pos++].value); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkNth2: function(i) { - return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0; - }, - checkNthf: function(i) { - var start = i, - l = 0; - if (tokens[i++].type !== TokenType.Colon) return 0; - l++; - if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0; - l += 2; - if ('child' === tokens[i].value) { - l += 1; - } else if ('last-child' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('last-of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value + - tokens[i + 3].value + - tokens[i + 4].value) { - l += 5; - } else return 0; - tokens[start + 1].nthf_last = start + l - 1; - return l; - }, - getNthf: function() { - pos++; - var s = joinValues(pos, tokens[pos].nthf_last); - pos = tokens[pos].nthf_last + 1; - return s; - }, - checkNthselector: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkNthf(i)) i += l; - else return 0; - if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0; - l++; - var rp = tokens[i++].right; - while (i < rp) { - if (l = this.checkSC(i) || - this.checkUnary(i) || - this.checkNth(i)) i += l; - else return 0; - } - return rp - start + 1; - }, - getNthselector: function() { - var startPos = pos, - nthf = [NodeType.IdentType, this.getNthf()], - x = [NodeType.NthselectorType]; - if (needInfo) nthf.unshift(getInfo(startPos)); - x.push(nthf); - pos++; - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkUnary(pos)) x.push(this.getUnary()); - else if (this.checkNth(pos)) x.push(this.getNth()); - } - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkNumber: function(i) { - if (i >= tokensLength) return 0; - if (tokens[i].number_l) return tokens[i].number_l; - if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && - (!tokens[i + 1] || - (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) - return (tokens[i].number_l = 1, tokens[i].number_l); - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber))) - return (tokens[i].number_l = 2, tokens[i].number_l); - if (i < tokensLength && - tokens[i].type === TokenType.FullStop && - tokens[i + 1].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 2, tokens[i].number_l); - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 3, tokens[i].number_l); - return 0; - }, - getNumber: function() { - var s = '', - startPos = pos, - l = tokens[pos].number_l, - x = [NodeType.NumberType]; - for (var j = 0; j < l; j++) { - s += tokens[pos + j].value; - } - pos += l; - x.push(s); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkOperator: function(i) { - if (i >= tokensLength) return 0; - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - return 1; - } - return 0; - }, - getOperator: function() { - var startPos = pos, - x = [NodeType.OperatorType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkPercentage: function(i) { - var x; - if (i >= tokensLength) return 0; - x = this.checkNumber(i); - if (!x || i + x >= tokensLength) return 0; - return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0; - }, - getPercentage: function() { - var startPos = pos, - x = [NodeType.PercentageType, this.getNumber()]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkProgid: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6; - else return 0; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (tokens[i].type === TokenType.LeftParenthesis) { - tokens[start].progid_end = tokens[i].right; - i = tokens[i].right + 1; - } else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getProgid: function() { - var startPos = pos, - progid_end = tokens[pos].progid_end, - x; - x = [NodeType.ProgidType] - .concat(this.getSC()) - .concat([this._getProgid(progid_end)]) - .concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - _getProgid: function(progid_end) { - var startPos = pos, - x = [NodeType.RawType, joinValues(pos, progid_end)]; - pos = progid_end + 1; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkProperty: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getProperty: function() { - var startPos = pos, - x = [NodeType.PropertyType]; - x.push(this.getIdent()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkPropertyDelim: function(i) { - return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0; - }, - getPropertyDelim: function() { - var startPos = pos, - x = [NodeType.PropertyDelimType]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkPseudo: function(i) { - return this.checkPseudoe(i) || - this.checkPseudoc(i); - }, - getPseudo: function() { - if (this.checkPseudoe(pos)) return this.getPseudoe(); - if (this.checkPseudoc(pos)) return this.getPseudoc(); - }, - checkPseudoe: function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkIdent(i)) ? l + 2 : 0; - }, - getPseudoe: function() { - var startPos = pos, - x = [NodeType.PseudoeType]; - pos += 2; - x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkPseudoc: function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0; - }, - getPseudoc: function() { - var startPos = pos, - x = [NodeType.PseudocType]; - pos ++; - x.push(this.checkFunction(pos) ? this.getFunction() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkRuleset: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[start].ruleset_l) return tokens[start].ruleset_l; - while (i < tokensLength) { - if (l = this.checkBlock(i)) {i += l; break;} - else if (l = this.checkSelector(i)) i += l; - else return 0; - } - tokens[start].ruleset_l = i - start; - return i - start; - }, - getRuleset: function() { - var startPos = pos, - x = [NodeType.RulesetType]; - while (pos < tokensLength) { - if (this.checkBlock(pos)) {x.push(this.getBlock()); break;} - else if (this.checkSelector(pos)) x.push(this.getSelector()); - else break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkS: function(i) { - return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0; - }, - getS: function() { - var startPos = pos, - x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)]; - pos = tokens[pos].ws_last + 1; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkSC: function(i) { - var l, - lsc = 0; - while (i < tokensLength) { - if (!(l = this.checkS(i)) && - !(l = this.checkCommentML(i))) break; - i += l; - lsc += l; - } - return lsc || 0; - }, - getSC: function() { - var sc = []; - if (pos >= tokensLength) return sc; - while (pos < tokensLength) { - if (this.checkS(pos)) sc.push(this.getS()); - else if (this.checkCommentML(pos)) sc.push(this.getCommentML()); - else break; - } - return sc; - }, - checkSelector: function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSimpleSelector(i) || this.checkDelim(i)) i += l; - else break; - } - if (i !== start) tokens[start].selector_end = i - 1; - return i - start; - }, - getSelector: function() { - var startPos = pos, - x = [NodeType.SelectorType], - selector_end = tokens[pos].selector_end; - while (pos <= selector_end) { - x.push(this.checkDelim(pos) ? this.getDelim() : this.getSimpleSelector()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkShash: function(i) { - var l; - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - return (l = this.checkNmName(i + 1)) ? l + 1 : 0; - }, - getShash: function() { - var startPos = pos, - x = [NodeType.ShashType]; - pos++; - x.push(this.getNmName()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkSimpleSelector: function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSimpleSelector1(i)) i += l; - else break; - } - return i - start; - }, - getSimpleSelector: function() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - while (pos < tokensLength) { - if (!this.checkSimpleSelector1(pos)) break; - t = this.getSimpleSelector1(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkSimpleSelector1: function(i) { - return this.checkNthselector(i) || - this.checkCombinator(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkAny(i) || - this.checkSC(i) || - this.checkNamespace(i); - }, - getSimpleSelector1: function() { - if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkCombinator(pos)) return this.getCombinator(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkNamespace(pos)) return this.getNamespace(); - }, - checkString: function(i) { - return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0; - }, - getString: function() { - var startPos = pos, - x = [NodeType.StringType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkStylesheet: function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSC(i) || - this.checkDeclDelim(i) || - this.checkAtrule(i) || - this.checkRuleset(i) || - this.checkUnknown(i)) i += l; - else throwError(i); - } - return i - start; - }, - getStylesheet: function() { - var startPos = pos, - x = [NodeType.StylesheetType]; - while (pos < tokensLength) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkRuleset(pos)) x.push(this.getRuleset()); - else if (this.checkAtrule(pos)) x.push(this.getAtrule()); - else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim()); - else if (this.checkUnknown(pos)) x.push(this.getUnknown()); - else throwError(); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkTset: function(i) { - return this.checkVhash(i) || - this.checkAny(i) || - this.checkSC(i) || - this.checkOperator(i); - }, - getTset: function() { - if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkOperator(pos)) return this.getOperator(); - }, - checkTsets: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - while (l = this.checkTset(i)) { - i += l; - } - return i - start; - }, - getTsets: function() { - var x = [], - t; - while (t = this.getTset()) { - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return x; - }, - checkUnary: function(i) { - return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0; - }, - getUnary: function() { - var startPos = pos, - x = [NodeType.UnaryType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkUnknown: function(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - }, - getUnknown: function() { - var startPos = pos, - x = [NodeType.UnknownType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkUri: function(i) { - var start = i; - if (i >= tokensLength || tokens[i++].value !== 'url' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) - return 0; - return tokens[i].right - start + 1; - }, - getUri: function() { - var startPos = pos, - uriExcluding = {}, - uri, - l, - raw; - pos += 2; - uriExcluding[TokenType.Space] = 1; - uriExcluding[TokenType.Tab] = 1; - uriExcluding[TokenType.Newline] = 1; - uriExcluding[TokenType.LeftParenthesis] = 1; - uriExcluding[TokenType.RightParenthesis] = 1; - if (this.checkUri1(pos)) { - uri = [NodeType.UriType] - .concat(this.getSC()) - .concat([this.getString()]) - .concat(this.getSC()); - pos++; - } else { - uri = [NodeType.UriType].concat(this.getSC()), - l = checkExcluding(uriExcluding, pos), - raw = [NodeType.RawType, joinValues(pos, pos + l)]; - if (needInfo) raw.unshift(getInfo(startPos)); - uri.push(raw); - pos += l + 1; - uri = uri.concat(this.getSC()); - pos++; - } - return needInfo ? (uri.unshift(getInfo(startPos)), uri) : uri; - }, - checkUri1: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0; - i++; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - checkValue: function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this._checkValue(i)) i += l; - else break; - } - return i - start; - }, - _checkValue: function(i) { - return this.checkSC(i) || - this.checkVhash(i) || - this.checkAny(i) || - this.checkOperator(i) || - this.checkImportant(i); - }, - getValue: function() { - var startPos = pos, - x = [NodeType.ValueType], - t, - _pos; - while (pos < tokensLength) { - _pos = pos; - if (!this._checkValue(pos)) break; - t = this._getValue(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - _getValue: function() { - if (this.checkSC(pos)) return this.getSC(); - else if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkOperator(pos)) return this.getOperator(); - else if (this.checkImportant(pos)) return this.getImportant(); - }, - checkVhash: function(i) { - var l; - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - return (l = this.checkNmName2(i + 1)) ? l + 1 : 0; - }, - getVhash: function() { - var startPos = pos, - x = [NodeType.VhashType]; - pos++; - x.push(this.getNmName2()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - markSC: function() { - var ws = -1, - sc = -1, - t; - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - if (ws === -1) ws = i; - if (sc === -1) sc = i; - break; - case TokenType.CommentML: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - t.sc = true; - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - }, - markBrackets: function() { - var ps = [], - sbs = [], - cbs = [], - t; - for (var i = 0; i < tokens.length; i++) { - t = tokens[i]; - switch(t.type) { - case TokenType.LeftParenthesis: - ps.push(i); - break; - case TokenType.RightParenthesis: - if (ps.length) { - t.left = ps.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftSquareBracket: - sbs.push(i); - break; - case TokenType.RightSquareBracket: - if (sbs.length) { - t.left = sbs.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftCurlyBracket: - cbs.push(i); - break; - case TokenType.RightCurlyBracket: - if (cbs.length) { - t.left = cbs.pop(); - tokens[t.left].right = i; - } - break; - } - } - }, - parseMLComment: function(css) { - var start = pos; - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') { - pos++; - break; - } - } - pushToken(TokenType.CommentML, css.substring(start, pos + 1)); - }, - parseSLComment: function(css) { - var start = pos; - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { - break; - } - } - pushToken(TokenType.CommentSL, css.substring(start, pos)); - pos--; - } -}; -(function() { - var scss = Object.create(syntaxes.css); - scss.checkAny = function(i) { - return this.checkBraces(i) || - this.checkString(i) || - this.checkVariablesList(i) || - this.checkVariable(i) || - this.checkPlaceholder(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkFunctionExpression(i) || - this.checkFunction(i) || - this.checkIdent(i) || - this.checkClass(i) || - this.checkUnary(i); - }; - scss.getAny = function() { - if (this.checkBraces(pos)) return this.getBraces(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkVariablesList(pos)) return this.getVariablesList(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkPlaceholder(pos)) return this.getPlaceholder(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression(); - else if (this.checkFunction(pos)) return this.getFunction(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - else if (this.checkUnary(pos)) return this.getUnary(); - }; - scss.checkArguments = function (i) { - var start = i, - l; - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftParenthesis) return 0; - i++; - while (i < tokens[start].right) { - if (l = this.checkArgument(i)) i +=l; - else return 0; - } - return tokens[start].right - start + 1; - }; - scss.getArguments = function() { - var startPos = pos, - arguments = [], - x; - pos++; - while (x = this.getArgument()) { - if ((needInfo && typeof x[1] === 'string') || typeof x[0] === 'string') arguments.push(x); - else arguments = arguments.concat(x); - } - pos++; - x = [NodeType.ArgumentsType].concat(arguments); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkArgument = function(i) { - return this.checkDeclaration(i) || - this.checkVariablesList(i) || - this.checkVariable(i) || - this.checkSC(i) || - this.checkDelim(i) || - this.checkDeclDelim(i) || - this.checkString(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkIdent(i) || - this.checkVhash(i); - }; - scss.getArgument = function() { - if (this.checkDeclaration(pos)) return this.getDeclaration(); - else if (this.checkVariablesList(pos)) return this.getVariablesList(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkDelim(pos)) return this.getDelim(); - else if (this.checkDeclDelim(pos)) return this.getDeclDelim(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkVhash(pos)) return this.getVhash(); - }; - scss.checkBlockdecl1 = function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = this.checkLoop(i)) tokens[i].bd_kind = 3; - else if (l = this.checkFilter(i)) tokens[i].bd_kind = 4; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 5; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 6; - else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 7; - else return 0; - i += l; - if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - return i - start; - }; - scss.getBlockdecl1 = function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getCondition(); - break; - case 2: - x = this.getInclude(); - break; - case 3: - x = this.getLoop(); - break; - case 4: - x = this.getFilter(); - break; - case 5: - x = this.getDeclaration(); - break; - case 6: - x = this.getAtrule(); - break; - case 7: - x = this.getRuleset(); - break; - } - return sc - .concat([x]) - .concat([this.getDeclDelim()]) - .concat(this.getSC()); - }; - scss.checkBlockdecl2 = function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = this.checkLoop(i)) tokens[i].bd_kind = 3; - else if (l = this.checkFilter(i)) tokens[i].bd_kind = 4; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 5; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 6; - else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 7; - else return 0; - i += l; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getBlockdecl2 = function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getCondition(); - break; - case 2: - x = this.getInclude(); - break; - case 3: - x = this.getLoop(); - break; - case 4: - x = this.getFilter(); - break; - case 5: - x = this.getDeclaration(); - break; - case 6: - x = this.getAtrule(); - break; - case 7: - x = this.getRuleset(); - break; - } - return sc - .concat([x]) - .concat(this.getSC()); - }; - scss.checkClass = function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].class_l) return tokens[i].class_l; - if (tokens[i++].type === TokenType.FullStop && - (l = this.checkInterpolatedVariable(i) || this.checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - return 0; - }; - scss.getClass = function() { - var startPos = pos, - x = [NodeType.ClassType]; - pos++; - x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkCommentSL = function(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - }; - scss.getCommentSL = function() { - var startPos = pos, - x; - x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkCondition = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['if', 'else'].indexOf(tokens[start + 1].value) < 0) return 0; - while (i < tokensLength) { - if (l = this.checkBlock(i)) break; - else if (l = this.checkVariable(i) || - this.checkIdent(i) || - this.checkSC(i) || - this.checkNumber(i) || - this.checkOperator(i) || - this.checkCombinator(i) || - this.checkString(i)) i += l; - else return 0; - } - return i - start; - }; - scss.getCondition = function() { - var startPos = pos, - x = [NodeType.ConditionType]; - x.push(this.getAtkeyword()); - while (pos < tokensLength) { - if (this.checkBlock(pos)) break; - else if (this.checkVariable(pos)) x.push(this.getVariable()); - else if (this.checkIdent(pos)) x.push(this.getIdent()); - else if (this.checkNumber(pos)) x.push(this.getNumber()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else if (this.checkCombinator(pos)) x.push(this.getCombinator()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkString(pos)) x.push(this.getString()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkDefault = function(i) { - var start = i, - l; - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - if (l = this.checkSC(i)) i += l; - return tokens[i].value === 'default' ? i - start + 1 : 0; - }; - scss.getDefault = function() { - var startPos = pos, - x = [NodeType.DefaultType], - sc; - pos++; - sc = this.getSC(); - pos++; - x = x.concat(sc); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkIdent = function(i) { - var start = i, - wasIdent, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i); - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.Asterisk) i++; - else return 0; - wasIdent = tokens[i - 1].type === TokenType.Identifier; - for (; i < tokensLength; i++) { - if (l = this.checkInterpolatedVariable(i)) i += l; - if (i >= tokensLength) break; - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine) { - if (tokens[i].type !== TokenType.Identifier && - (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break; - else wasIdent = true; - } - } - if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0; - tokens[start].ident_last = i - 1; - return i - start; - }; - scss.checkInclude = function(i) { - var l; - if (i >= tokensLength) return 0; - if (l = this.checkInclude1(i)) tokens[i].include_type = 1; - else if (l = this.checkInclude2(i)) tokens[i].include_type = 2; - else if (l = this.checkInclude3(i)) tokens[i].include_type = 3; - else if (l = this.checkInclude4(i)) tokens[i].include_type = 4; - return l; - }; - scss.getInclude = function() { - switch (tokens[pos].include_type) { - case 1: return this.getInclude1(); - case 2: return this.getInclude2(); - case 3: return this.getInclude3(); - case 4: return this.getInclude4(); - } - }; - scss.checkInclude1 = function(i) { - var start = i, - l; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getInclude1 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getAtkeyword()); - x = x.concat(this.getSC()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getArguments()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkInclude2 = function(i) { - var start = i, - l; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getInclude2 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getAtkeyword()); - x = x.concat(this.getSC()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getArguments()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkInclude3 = function(i) { - var start = i, - l; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getInclude3 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getAtkeyword()); - x = x.concat(this.getSC()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkInclude4 = function(i) { - var start = i, - l; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getInclude4 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getAtkeyword()); - x = x.concat(this.getSC()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkIncludeSelector = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSimpleSelector2(i)) i += l; - else break; - } - return i - start; - }; - scss.getIncludeSelector = function() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - while (pos < tokensLength && this.checkSimpleSelector2(pos)) { - t = this.getSimpleSelector2(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkInterpolatedVariable = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type !== TokenType.NumberSign || - !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket || - !tokens[i + 2] || tokens[i + 2].type !== TokenType.DollarSign) return 0; - i += 3; - if (l = this.checkIdent(i)) i += l; - else return 0; - return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0; - }; - scss.getInterpolatedVariable = function() { - var startPos = pos, - x = [NodeType.InterpolatedVariableType]; - pos += 3; - x.push(this.getIdent()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkLoop = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['for', 'each', 'while'].indexOf(tokens[start + 1].value) < 0) return 0; - while (i < tokensLength) { - if (l = this.checkBlock(i)) { - i += l; - break; - } else if (l = this.checkVariable(i) || - this.checkIdent(i) || - this.checkSC(i) || - this.checkNumber(i) || - this.checkOperator(i) || - this.checkCombinator(i) || - this.checkString(i)) i += l; - else return 0; - } - return i - start; - }; - scss.getLoop = function() { - var startPos = pos, - x = [NodeType.LoopType]; - x.push(this.getAtkeyword()); - while (pos < tokensLength) { - if (this.checkBlock(pos)) { - x.push(this.getBlock()); - break; - } - else if (this.checkVariable(pos)) x.push(this.getVariable()); - else if (this.checkIdent(pos)) x.push(this.getIdent()); - else if (this.checkNumber(pos)) x.push(this.getNumber()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else if (this.checkCombinator(pos)) x.push(this.getCombinator()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkString(pos)) x.push(this.getString()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkMixin = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if ((l = this.checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - return i - start; - }; - scss.getMixin = function() { - var startPos = pos, - x = [NodeType.MixinType, this.getAtkeyword()]; - x = x.concat(this.getSC()); - if (this.checkIdent(pos)) x.push(this.getIdent()); - x = x.concat(this.getSC()); - if (this.checkArguments(pos)) x.push(this.getArguments()); - x = x.concat(this.getSC()); - if (this.checkBlock(pos)) x.push(this.getBlock()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkOperator = function(i) { - if (i >= tokensLength) return 0; - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - case TokenType.LessThanSign: - case TokenType.GreaterThanSign: - case TokenType.Asterisk: - return 1; - } - return 0; - }; - scss.checkParentSelector = function(i) { - return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0; - }; - scss.getParentSelector = function() { - var startPos = pos, - x = [NodeType.ParentSelectorType, '&']; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkPlaceholder = function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].placeholder_l) return tokens[i].placeholder_l; - if (tokens[i].type === TokenType.PercentSign && (l = this.checkIdent(i + 1))) { - tokens[i].placeholder_l = l + 1; - return l + 1; - } else return 0; - }; - scss.getPlaceholder = function() { - var startPos = pos, - x = [NodeType.PlaceholderType]; - pos++; - x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkProperty = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkVariable(i) || this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getProperty = function() { - var startPos = pos, - x = [NodeType.PropertyType]; - x.push(this.checkVariable(pos) ? this.getVariable() : this.getIdent()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkPseudoe = function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkInterpolatedVariable(i) || this.checkIdent(i)) ? l + 2 : 0; - }; - scss.getPseudoe = function() { - var startPos = pos, - x = [NodeType.PseudoeType]; - pos += 2; - x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkPseudoc = function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkInterpolatedVariable(i) || this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0; - }; - scss.getPseudoc = function() { - var startPos = pos, - x = [NodeType.PseudocType]; - pos ++; - if (this.checkInterpolatedVariable(pos)) x.push(this.getInterpolatedVariable()); - else if (this.checkFunction(pos)) x.push(this.getFunction()); - else x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkSC = function(i) { - if (i >= tokensLength) return 0; - var l, - lsc = 0, - ln = tokens[i].ln; - while (i < tokensLength) { - if (!(l = this.checkS(i)) && - !(l = this.checkCommentML(i)) && - !(l = this.checkCommentSL(i))) break; - i += l; - lsc += l; - } - return lsc || 0; - }; - scss.getSC = function() { - var sc = []; - if (pos >= tokensLength) return sc; - while (pos < tokensLength) { - if (this.checkS(pos)) sc.push(this.getS()); - else if (this.checkCommentML(pos)) sc.push(this.getCommentML()); - else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL()); - else break; - } - return sc; - }; - scss.checkSimpleSelector1 = function(i) { - return this.checkParentSelector(i) || - this.checkNthselector(i) || - this.checkCombinator(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkAny(i) || - this.checkSC(i) || - this.checkNamespace(i); - }; - scss.getSimpleSelector1 = function() { - if (this.checkParentSelector(pos)) return this.getParentSelector(); - else if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkCombinator(pos)) return this.getCombinator(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkNamespace(pos)) return this.getNamespace(); - }; - scss.checkSimpleSelector2 = function(i) { - return this.checkParentSelector(i) || - this.checkNthselector(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkPlaceholder(i) || - this.checkIdent(i) || - this.checkClass(i); - }; - scss.getSimpleSelector2 = function() { - if (this.checkParentSelector(pos)) return this.getParentSelector(); - else if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkPlaceholder(pos)) return this.getPlaceholder(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - }; - scss.checkStylesheet = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSC(i) || - this.checkDeclaration(i) || - this.checkDeclDelim(i) || - this.checkInclude(i) || - this.checkMixin(i) || - this.checkLoop(i) || - this.checkAtrule(i) || - this.checkRuleset(i)) i += l; - else throwError(i); - } - return i - start; - }; - scss.getStylesheet = function() { - var startPos = pos, - x = [NodeType.StylesheetType]; - while (pos < tokensLength) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkRuleset(pos)) x.push(this.getRuleset()); - else if (this.checkInclude(pos)) x.push(this.getInclude()); - else if (this.checkMixin(pos)) x.push(this.getMixin()); - else if (this.checkLoop(pos)) x.push(this.getLoop()); - else if (this.checkAtrule(pos)) x.push(this.getAtrule()); - else if (this.checkDeclaration(pos)) x.push(this.getDeclaration()); - else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim()); - else throwError(); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkValue = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this._checkValue(i)) i += l; - if (!l || this.checkBlock(i - l)) break; - } - return i - start; - }; - scss._checkValue = function(i) { - return this.checkSC(i) || - this.checkInterpolatedVariable(i) || - this.checkVariable(i) || - this.checkVhash(i) || - this.checkBlock(i) || - this.checkAny(i) || - this.checkAtkeyword(i) || - this.checkOperator(i) || - this.checkImportant(i) || - this.checkDefault(i); - }; - scss.getValue = function() { - var startPos = pos, - x = [NodeType.ValueType], - t, _pos; - while (pos < tokensLength) { - _pos = pos; - if (!this._checkValue(pos)) break; - t = this._getValue(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - if (this.checkBlock(_pos)) break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss._getValue = function() { - if (this.checkSC(pos)) return this.getSC(); - else if (this.checkInterpolatedVariable(pos)) return this.getInterpolatedVariable(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkBlock(pos)) return this.getBlock(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkAtkeyword(pos)) return this.getAtkeyword(); - else if (this.checkOperator(pos)) return this.getOperator(); - else if (this.checkImportant(pos)) return this.getImportant(); - else if (this.checkDefault(pos)) return this.getDefault(); - }; - scss.checkVariable = function(i) { - var l; - if (i >= tokensLength || tokens[i].type !== TokenType.DollarSign) return 0; - return (l = this.checkIdent(i + 1)) ? l + 1 : 0; - }; - scss.getVariable = function() { - var startPos = pos, - x = [NodeType.VariableType]; - pos++; - x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkVariablesList = function(i) { - var d = 0, - l; - if (i >= tokensLength) return 0; - if (l = this.checkVariable(i)) i+= l; - else return 0; - while (i < tokensLength && tokens[i].type === TokenType.FullStop) { - d++; - i++; - } - return d === 3 ? l + d : 0; - }; - scss.getVariablesList = function() { - var startPos = pos, - x = [NodeType.VariablesListType, this.getVariable()]; - pos += 3; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.markSC = function() { - var ws = -1, - sc = -1, - t; - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - if (ws === -1) ws = i; - if (sc === -1) sc = i; - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - t.sc = true; - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - }; - syntaxes.scss = scss; -})(); -(function() { - var sass = Object.create(syntaxes.scss); - sass.checkBlock = function(i) { - return i < tokensLength && tokens[i].block_end ? - tokens[i].block_end - i + 1 : 0; - }; - sass.getBlock = function() { - var startPos = pos, - end = tokens[pos].block_end, - x = [NodeType.BlockType]; - while (pos < end) { - if (this.checkBlockdecl(pos)) x = x.concat(this.getBlockdecl()); - else throwError(); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.getCommentML = function() { - var startPos = pos, - s = tokens[pos].value.substring(2), - l = s.length, - x; - pos++; - x = [NodeType.CommentMLType, s]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkDeclaration = function(i) { - return this.checkDeclaration1(i) || this.checkDeclaration2(i); - }; - sass.getDeclaration = function() { - return this.checkDeclaration1(pos) ? this.getDeclaration1() : this.getDeclaration2(); - }; - sass.checkDeclaration1 = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkProperty(i)) i += l; - else return 0; - if (l = this.checkPropertyDelim(i)) i++; - else return 0; - if (l = this.checkValue(i)) i += l; - else return 0; - return i - start; - }; - sass.getDeclaration1 = function() { - var startPos = pos, - x = [NodeType.DeclarationType]; - x.push(this.getProperty()); - x.push(this.getPropertyDelim()); - x.push(this.getValue()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkDeclaration2 = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkPropertyDelim(i)) i++; - else return 0; - if (l = this.checkProperty(i)) i += l; - else return 0; - if (l = this.checkValue(i)) i += l; - else return 0; - return i - start; - }; - sass.getDeclaration2 = function() { - var startPos = pos, - x = [NodeType.DeclarationType]; - x.push(this.getPropertyDelim()); - x.push(this.getProperty()); - x.push(this.getValue()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkDeclDelim = function(i) { - if (i >= tokensLength) return 0; - return (tokens[i].type === TokenType.Newline || - tokens[i].type === TokenType.Semicolon) ? 1 : 0; - }; - sass.checkFilterv = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkProgid(i)) i += l; - else return 0; - while (l = this.checkProgid(i)) { - i += l; - } - tokens[start].last_progid = i; - if (this.checkDeclDelim(i)) return i - start; - if (i < tokensLength && (l = this.checkSC(i))) i += l; - if (i < tokensLength && (l = this.checkImportant(i))) i += l; - return i - start; - }; - sass.getFilterv = function() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - while (pos < last_progid) { - x.push(this.getProgid()); - } - if (this.checkDeclDelim(pos)) return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - if (this.checkSC(pos)) x = x.concat(this.getSC()); - if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkInclude = function(i) { - var l; - if (i >= tokensLength) return 0; - if (l = this.checkInclude1(i)) tokens[i].include_type = 1; - else if (l = this.checkInclude2(i)) tokens[i].include_type = 2; - else if (l = this.checkInclude3(i)) tokens[i].include_type = 3; - else if (l = this.checkInclude4(i)) tokens[i].include_type = 4; - else if (l = this.checkInclude5(i)) tokens[i].include_type = 5; - else if (l = this.checkInclude6(i)) tokens[i].include_type = 6; - else if (l = this.checkInclude7(i)) tokens[i].include_type = 7; - else if (l = this.checkInclude8(i)) tokens[i].include_type = 8; - return l; - }; - sass.getInclude = function() { - switch (tokens[pos].include_type) { - case 1: return this.getInclude1(); - case 2: return this.getInclude2(); - case 3: return this.getInclude3(); - case 4: return this.getInclude4(); - case 5: return this.getInclude5(); - case 6: return this.getInclude6(); - case 7: return this.getInclude7(); - case 8: return this.getInclude8(); - } - }; - sass.checkInclude5 = function(i) { - var start = i, - l; - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - sass.getInclude5 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getOperator()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getArguments()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkInclude6 = function(i) { - var start = i, - l; - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - sass.getInclude6 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getOperator()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getArguments()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkInclude7 = function(i) { - var start = i, - l; - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - sass.getInclude7 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getOperator()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkInclude8 = function(i) { - var start = i, - l; - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - sass.getInclude8 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getOperator()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkMixin = function(i) { - return this.checkMixin1(i) || this.checkMixin2(i); - }; - sass.getMixin = function() { - return this.checkMixin1(pos) ? this.getMixin1() : this.getMixin2(); - }; - sass.checkMixin1 = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if ((l = this.checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else { - if (l = this.checkArguments(i)) i += l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - } - return i - start; - }; - sass.getMixin1 = function() { - var startPos = pos, - x = [NodeType.MixinType, this.getAtkeyword()]; - x = x.concat(this.getSC()); - if (this.checkIdent(pos)) x.push(this.getIdent()); - x = x.concat(this.getSC()); - if (this.checkBlock(pos)) x.push(this.getBlock()); - else { - if (this.checkArguments(pos)) x.push(this.getArguments()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkMixin2 = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.EqualsSign) i++; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else { - if (l = this.checkArguments(i)) i += l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - } - return i - start; - }; - sass.getMixin2 = function() { - var startPos = pos, - x = [NodeType.MixinType, this.getOperator()]; - x = x.concat(this.getSC()); - if (this.checkIdent(pos)) x.push(this.getIdent()); - x = x.concat(this.getSC()); - if (this.checkBlock(pos)) x.push(this.getBlock()); - else { - if (this.checkArguments(pos)) x.push(this.getArguments()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkProgid = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6; - else return 0; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (tokens[i].type === TokenType.LeftParenthesis) { - tokens[start].progid_end = tokens[i].right; - i = tokens[i].right + 1; - } else return 0; - return i - start; - }; - sass.getProgid = function() { - var startPos = pos, - progid_end = tokens[pos].progid_end, - x; - x = [NodeType.ProgidType] - .concat(this.getSC()) - .concat([this._getProgid(progid_end)]); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkSC = function(i) { - if (!tokens[i]) return 0; - var l, - lsc = 0, - ln = tokens[i].ln; - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - if (!(l = this.checkS(i)) && - !(l = this.checkCommentML(i)) && - !(l = this.checkCommentSL(i))) break; - i += l; - lsc += l; - } - return lsc || 0; - }; - sass.getSC = function() { - var sc = [], - ln; - if (pos >= tokensLength) return sc; - ln = tokens[pos].ln; - while (pos < tokensLength) { - if (tokens[pos].ln !== ln) break; - else if (this.checkS(pos)) sc.push(this.getS()); - else if (this.checkCommentML(pos)) sc.push(this.getCommentML()); - else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL()); - else break; - } - return sc; - }; - sass.checkSelector = function(i) { - var start = i, - l, ln; - if (i >= tokensLength) return 0; - ln = tokens[i].ln; - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - if ((l = this.checkDeclDelim(i) && this.checkBlock(i + l)) || this.checkSC(i)) i += l; - if (l = this.checkSimpleSelector(i) || this.checkDelim(i)) i += l; - else break; - } - tokens[start].selector_end = i - 1; - return i - start; - }; - sass.getSelector = function() { - var startPos = pos, - x = [NodeType.SelectorType], - selector_end = tokens[pos].selector_end, - ln = tokens[pos].ln; - while (pos <= selector_end) { - if (tokens[pos].ln !== ln) break; - if ((l = this.checkDeclDelim(pos)) && this.checkBlock(pos + l)) x.push(this.getDeclDelim()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - x.push(this.checkDelim(pos) ? this.getDelim() : this.getSimpleSelector()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkSimpleSelector = function(i) { - if (i >= tokensLength) return 0; - var start = i, - l, - ln = tokens[i].ln; - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - if (l = this.checkSimpleSelector1(i)) i += l; - else break; - } - return (i - start) || 0; - }; - sass.getSimpleSelector = function() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t, - ln = tokens[pos].ln; - while (pos < tokensLength) { - if (tokens[pos].ln !== ln || - !this.checkSimpleSelector1(pos)) break; - t = this.getSimpleSelector1(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkValue = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (this.checkDeclDelim(i)) break; - if (l = this._checkValue(i)) i += l; - if (!l || this.checkBlock(i - l)) break; - } - return i - start; - }; - sass.getValue = function() { - var startPos = pos, - x = [NodeType.ValueType], - t, _pos; - while (pos < tokensLength) { - _pos = pos; - if (this.checkDeclDelim(pos)) break; - if (!this._checkValue(pos)) break; - t = this._getValue(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - if (this.checkBlock(_pos)) break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass._checkValue = function(i) { - return this.checkS(i) || - this.checkCommentML(i) || - this.checkCommentSL(i) || - this.checkVhash(i) || - this.checkAny(i) || - this.checkOperator(i) || - this.checkImportant(i); - }; - sass._getValue = function() { - if (this.checkS(pos)) return this.getS(); - if (this.checkCommentML(pos)) return this.getCommentML(); - if (this.checkCommentSL(pos)) return this.getCommentSL(); - else if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkOperator(pos)) return this.getOperator(); - else if (this.checkImportant(pos)) return this.getImportant(); - }; - sass.markSC = function() { - var ws = -1, - sc = -1, - t; - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - t.ws = true; - t.sc = true; - if (ws === -1) ws = i; - if (sc === -1) sc = i; - break; - case TokenType.Newline: - t.ws = true; - t.sc = true; - ws = ws === -1 ? i : ws; - sc = sc === -1 ? i : ws; - tokens[ws].ws_last = i; - tokens[sc].sc_last = i; - ws = -1; - sc = -1; - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - t.sc = true; - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - }; - sass.markBlocks = function() { - var blocks = [], - currentLN = 1, - currentIL = 0, - prevIL = 0, - i = 0, - l = tokens.length, - iw; - for (; i != l; i++) { - if (!tokens[i - 1]) continue; - if (tokens[i].ln == currentLN) continue; - else currentLN = tokens[i].ln; - prevIL = currentIL; - if (tokens[i].type !== TokenType.Space) currentIL = 0; - else { - if (!iw) iw = tokens[i].value.length; - prevIL = currentIL; - currentIL = tokens[i].value.length / iw; - } - if (prevIL === currentIL) continue; - else if (currentIL > prevIL) { - blocks.push(i); - continue; - } else { - var il = prevIL; - while (blocks.length > 0 && il !== currentIL) { - tokens[blocks.pop()].block_end = i - 1; - il--; - } - } - } - while (blocks.length > 0) { - tokens[blocks.pop()].block_end = i - 1; - } - }; - sass.parseMLComment = function(css) { - var start = pos; - var il = 0; - for (var _pos = pos - 1; _pos > -1; _pos--) { - if (css.charAt(_pos) === ' ') il++; - else break; - } - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n') { - var _il = 0; - for (var _pos = pos + 1; _pos < css.length; _pos++) { - if (css.charAt(_pos) === ' ') _il++; - else break; - } - if (_il > il) { - pos = _pos; - } else break; - } - } - pushToken(TokenType.CommentML, css.substring(start, pos + 1)); - }; - sass.parseSLComment = function(css) { - var start = pos; - var il = 0; - var onlyToken = false; - for (var _pos = pos - 1; _pos > -1; _pos--) { - if (css.charAt(_pos) === ' ') il++; - else if (css.charAt(_pos) === '\n') { - onlyToken = true; - break; - } else break; - } - if (_pos === -1) onlyToken = true; - if (!onlyToken) { - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { - break; - } - } - } else { - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n') { - var _il = 0; - for (var _pos = pos + 1; _pos < css.length; _pos++) { - if (css.charAt(_pos) === ' ') _il++; - else break; - } - if (_il > il) { - pos = _pos; - } else break; - } - } - } - pushToken(TokenType.CommentSL, css.substring(start, pos)); - pos--; - }; - syntaxes.sass = sass; -})(); -(function() { - var less = Object.create(syntaxes.css); - less.checkAny = function(i) { - return this.checkBraces(i) || - this.checkString(i) || - this.checkVariablesList(i) || - this.checkVariable(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkFunctionExpression(i) || - this.checkFunction(i) || - this.checkIdent(i) || - this.checkClass(i) || - this.checkUnary(i); - }; - less.getAny = function() { - if (this.checkBraces(pos)) return this.getBraces(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkVariablesList(pos)) return this.getVariablesList(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression(); - else if (this.checkFunction(pos)) return this.getFunction(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - else if (this.checkUnary(pos)) return this.getUnary(); - }; - less.checkArguments = function (i) { - var start = i, - l; - if (i >= tokensLength || - tokens[i++].type !== TokenType.LeftParenthesis) return 0; - while (i < tokens[start].right) { - if (l = this.checkArgument(i)) i +=l; - else return 0; - } - return tokens[start].right - start + 1; - }; - less.getArguments = function() { - var startPos = pos, - arguments = [], - x; - pos++; - while (x = this.getArgument()) { - if ((needInfo && typeof x[1] === 'string') || typeof x[0] === 'string') arguments.push(x); - else arguments = arguments.concat(x); - } - pos++; - x = [NodeType.ArgumentsType].concat(arguments); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkArgument = function(i) { - return this.checkDeclaration(i) || - this.checkVariablesList(i) || - this.checkVariable(i) || - this.checkSC(i) || - this.checkDelim(i) || - this.checkDeclDelim(i) || - this.checkString(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkIdent(i) || - this.checkVhash(i); - }; - less.getArgument = function() { - if (this.checkDeclaration(pos)) return this.getDeclaration(); - else if (this.checkVariablesList(pos)) return this.getVariablesList(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkDelim(pos)) return this.getDelim(); - else if (this.checkDeclDelim(pos)) return this.getDeclDelim(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkVhash(pos)) return this.getVhash(); - }; - less.checkBlockdecl1 = function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = this.checkFilter(i)) tokens[i].bd_kind = 3; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 4; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 5; - else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 6; - else return 0; - i += l; - if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - return i - start; - } - less.getBlockdecl1 = function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getCondition(); - break; - case 2: - x = this.getInclude(); - break; - case 3: - x = this.getFilter(); - break; - case 4: - x = this.getDeclaration(); - break; - case 5: - x = this.getAtrule(); - break; - case 6: - x = this.getRuleset(); - break; - } - return sc - .concat([x]) - .concat([this.getDeclDelim()]) - .concat(this.getSC()); - }; - less.checkBlockdecl2 = function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = this.checkFilter(i)) tokens[i].bd_kind = 3; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 4; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 5; - else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 6; - else return 0; - i += l; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - less.getBlockdecl2 = function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getCondition(); - break; - case 2: - x = this.getInclude(); - break; - case 3: - x = this.getFilter(); - break; - case 4: - x = this.getDeclaration(); - break; - case 5: - x = this.getAtrule(); - break; - case 6: - x = this.getRuleset(); - break; - } - return sc - .concat([x]) - .concat(this.getSC()); - }; - less.checkClass = function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].class_l) return tokens[i].class_l; - if (tokens[i++].type === TokenType.FullStop && - (l = this.checkInterpolatedVariable(i) || this.checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - return 0; - }; - less.getClass = function() { - var startPos = pos, - x = [NodeType.ClassType]; - pos++; - x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkCommentSL = function(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - }; - less.getCommentSL = function() { - var startPos = pos, - x; - x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkCondition = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if ((l = this.checkIdent(i)) && tokens[i].value === 'when') i += l; - else return 0; - while (i < tokensLength) { - if (l = this.checkBlock(i)) break; - if (l = this.checkFunction(i) | - this.checkBraces(i) || - this.checkVariable(i) || - this.checkIdent(i) || - this.checkSC(i) || - this.checkNumber(i) || - this.checkDelim(i) || - this.checkOperator(i) || - this.checkCombinator(i) || - this.checkString(i)) i += l; - else return 0; - } - return i - start; - }; - less.getCondition = function() { - var startPos = pos, - x = [NodeType.ConditionType]; - x.push(this.getIdent()); - while (pos < tokensLength) { - if (this.checkBlock(pos)) break; - else if (this.checkFunction(pos)) x.push(this.getFunction()); - else if (this.checkBraces(pos)) x.push(this.getBraces()); - else if (this.checkVariable(pos)) x.push(this.getVariable()); - else if (this.checkIdent(pos)) x.push(this.getIdent()); - else if (this.checkNumber(pos)) x.push(this.getNumber()); - else if (this.checkDelim(pos)) x.push(this.getDelim()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else if (this.checkCombinator(pos)) x.push(this.getCombinator()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkString(pos)) x.push(this.getString()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkEscapedString = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.Tilde && (l = this.checkString(i + 1))) return i + l - start; - else return 0; - }; - less.getEscapedString = function() { - var startPos = pos, - x = [NodeType.EscapedStringType]; - pos++; - x.push(tokens[pos++].value); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkFilterv = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkProgid(i) || this.checkEscapedString(i)) i += l; - else return 0; - while (l = this.checkProgid(i) || this.checkEscapedString(i)) { - i += l; - } - tokens[start].last_progid = i; - if (i < tokensLength && (l = this.checkSC(i))) i += l; - if (i < tokensLength && (l = this.checkImportant(i))) i += l; - return i - start; - }; - less.getFilterv = function() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - x = x.concat(this.getSC()); - while (pos < last_progid) { - x.push(this.checkProgid(pos) ? this.getProgid() : this.getEscapedString()); - } - if (this.checkSC(pos)) x = x.concat(this.getSC()); - if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - less.checkIdent = function(i) { - var start = i, - wasIdent, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i); - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.Asterisk) i++; - else return 0; - wasIdent = tokens[i - 1].type === TokenType.Identifier; - for (; i < tokensLength; i++) { - if (l = this.checkInterpolatedVariable(i)) i += l; - if (i >= tokensLength) break; - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine) { - if (tokens[i].type !== TokenType.Identifier && - (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break; - else wasIdent = true; - } - } - if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0; - tokens[start].ident_last = i - 1; - return i - start; - }; - less.checkInclude = function(i) { - var l; - if (i >= tokensLength) return 0; - if (l = this.checkInclude1(i)) tokens[i].include_type = 1; - else if (l = this.checkInclude2(i)) tokens[i].include_type = 2; - return l; - }; - less.getInclude = function() { - switch (tokens[pos].include_type) { - case 1: return this.getInclude1(); - case 2: return this.getInclude2(); - } - }; - less.checkInclude1 = function(i) { - var start = i, - l; - if (l = this.checkClass(i) || this.checkShash(i)) i += l; - else return 0; - while (i < tokensLength) { - if (l = this.checkClass(i) || this.checkShash(i) || this.checkSC(i)) i += l; - else if (tokens[i].type == TokenType.GreaterThanSign) i++; - else break; - } - if (l = this.checkArguments(i)) i += l; - else return 0; - if (i < tokensLength && (l = this.checkSC(i))) i += l; - if (i < tokensLength && (l = this.checkImportant(i))) i += l; - return i - start; - }; - less.getInclude1 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.checkClass(pos) ? this.getClass() : this.getShash()); - while (pos < tokensLength) { - if (this.checkClass(pos)) x.push(this.getClass()); - else if (this.checkShash(pos)) x.push(this.getShash()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else break; - } - x.push(this.getArguments()); - x = x.concat(this.getSC()); - if (this.checkImportant(pos)) x.push(this.getImportant()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkInclude2 = function(i) { - var start = i, - l; - if (l = this.checkClass(i) || this.checkShash(i)) i += l; - else return 0; - while (i < tokensLength) { - if (l = this.checkClass(i) || this.checkShash(i) || this.checkSC(i)) i += l; - else if (tokens[i].type == TokenType.GreaterThanSign) i++; - else break; - } - return i - start; - }; - less.getInclude2 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.checkClass(pos) ? this.getClass() : this.getShash()); - while (pos < tokensLength) { - if (this.checkClass(pos)) x.push(this.getClass()); - else if (this.checkShash(pos)) x.push(this.getShash()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkIncludeSelector = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSimpleSelector2(i)) i += l; - else break; - } - return i - start; - }; - less.getIncludeSelector = function() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - while (pos < tokensLength && this.checkSimpleSelector2(pos)) { - t = this.getSimpleSelector2(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkInterpolatedVariable = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type !== TokenType.CommercialAt || - !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket) return 0; - i += 2; - if (l = this.checkIdent(i)) i += l; - else return 0; - return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0; - }; - less.getInterpolatedVariable = function() { - var startPos = pos, - x = [NodeType.InterpolatedVariableType]; - pos += 2; - x.push(this.getIdent()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkMixin = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkClass(i) || this.checkShash(i)) i +=l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - return i - start; - }; - less.getMixin = function() { - var startPos = pos, - x = [NodeType.MixinType]; - x.push(this.checkClass(pos) ? this.getClass() : this.getShash()); - x = x.concat(this.getSC()); - if (this.checkArguments(pos)) x.push(this.getArguments()); - x = x.concat(this.getSC()); - if (this.checkBlock(pos)) x.push(this.getBlock()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkOperator = function(i) { - if (i >= tokensLength) return 0; - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - case TokenType.LessThanSign: - case TokenType.GreaterThanSign: - case TokenType.Asterisk: - return 1; - } - return 0; - }; - less.checkParentSelector = function(i) { - return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0; - }; - less.getParentSelector = function() { - var startPos = pos, - x = [NodeType.ParentSelectorType, '&']; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkProperty = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkVariable(i) || this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - less.getProperty = function() { - var startPos = pos, - x = [NodeType.PropertyType]; - if (this.checkVariable(pos)) x.push(this.getVariable()); - else x.push(this.getIdent()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkPseudoe = function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkInterpolatedVariable(i) || this.checkIdent(i)) ? l + 2 : 0; - }; - less.getPseudoe = function() { - var startPos = pos, - x = [NodeType.PseudoeType]; - pos += 2; - x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkPseudoc = function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkInterpolatedVariable(i) || this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0; - }; - less.getPseudoc = function() { - var startPos = pos, - x = [NodeType.PseudocType]; - pos ++; - if (this.checkInterpolatedVariable(pos)) x.push(this.getInterpolatedVariable()); - else if (this.checkFunction(pos)) x.push(this.getFunction()); - else x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkSC = function(i) { - if (i >= tokensLength) return 0; - var l, - lsc = 0, - ln = tokens[i].ln; - while (i < tokensLength) { - if (!(l = this.checkS(i)) && - !(l = this.checkCommentML(i)) && - !(l = this.checkCommentSL(i))) break; - i += l; - lsc += l; - } - return lsc || 0; - }; - less.getSC = function() { - var sc = [], - ln; - if (pos >= tokensLength) return sc; - ln = tokens[pos].ln; - while (pos < tokensLength) { - if (this.checkS(pos)) sc.push(this.getS()); - else if (this.checkCommentML(pos)) sc.push(this.getCommentML()); - else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL()); - else break; - } - return sc; - }; - less.checkSimpleSelector1 = function(i) { - return this.checkParentSelector(i) || - this.checkNthselector(i) || - this.checkCombinator(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkAny(i) || - this.checkSC(i) || - this.checkNamespace(i); - }; - less.getSimpleSelector1 = function() { - if (this.checkParentSelector(pos)) return this.getParentSelector(); - else if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkCombinator(pos)) return this.getCombinator(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkNamespace(pos)) return this.getNamespace(); - }; - less.checkSimpleSelector2 = function(i) { - return this.checkParentSelector(i) || - this.checkNthselector(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkIdent(i) || - this.checkClass(i); - }; - less.getSimpleSelector2 = function() { - if (this.checkParentSelector(pos)) return this.getParentSelector(); - else if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - }; - less.checkStylesheet = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSC(i) || - this.checkDeclaration(i) || - this.checkDeclDelim(i) || - this.checkInclude(i) || - this.checkMixin(i) || - this.checkAtrule(i) || - this.checkRuleset(i)) i += l; - else throwError(i); - } - return i - start; - }; - less.getStylesheet = function() { - var startPos = pos, - x = [NodeType.StylesheetType]; - while (pos < tokensLength) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkRuleset(pos)) x.push(this.getRuleset()); - else if (this.checkInclude(pos)) x.push(this.getInclude()); - else if (this.checkMixin(pos)) x.push(this.getMixin()); - else if (this.checkAtrule(pos)) x.push(this.getAtrule()); - else if (this.checkDeclaration(pos)) x.push(this.getDeclaration()); - else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim()); - else throwError(); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkValue = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this._checkValue(i)) i += l; - if (!l || this.checkBlock(i - l)) break; - } - return i - start; - }; - less._checkValue = function(i) { - return this.checkSC(i) || - this.checkEscapedString(i) || - this.checkInterpolatedVariable(i) || - this.checkVariable(i) || - this.checkVhash(i) || - this.checkBlock(i) || - this.checkAny(i) || - this.checkAtkeyword(i) || - this.checkOperator(i) || - this.checkImportant(i); - }; - less.getValue = function() { - var startPos = pos, - x = [NodeType.ValueType], - t, _pos; - while (pos < tokensLength) { - _pos = pos; - if (!this._checkValue(pos)) break; - t = this._getValue(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - if (this.checkBlock(_pos)) break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less._getValue = function() { - if (this.checkSC(pos)) return this.getSC(); - else if (this.checkEscapedString(pos)) return this.getEscapedString(); - else if (this.checkInterpolatedVariable(pos)) return this.getInterpolatedVariable(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkBlock(pos)) return this.getBlock(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkAtkeyword(pos)) return this.getAtkeyword(); - else if (this.checkOperator(pos)) return this.getOperator(); - else if (this.checkImportant(pos)) return this.getImportant(); - }; - less.checkVariable = function(i) { - var l; - if (i >= tokensLength || tokens[i].type !== TokenType.CommercialAt) return 0; - if (tokens[i - 1] && - tokens[i - 1].type === TokenType.CommercialAt && - tokens[i - 2] && - tokens[i - 2].type === TokenType.CommercialAt) return 0; - return (l = this.checkVariable(i + 1) || this.checkIdent(i + 1)) ? l + 1 : 0; - }; - less.getVariable = function() { - var startPos = pos, - x = [NodeType.VariableType]; - pos++; - if (this.checkVariable(pos)) x.push(this.getVariable()); - else x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkVariablesList = function(i) { - var d = 0, - l; - if (i >= tokensLength) return 0; - if (l = this.checkVariable(i)) i+= l; - else return 0; - while (tokens[i] && tokens[i].type === TokenType.FullStop) { - d++; - i++; - } - return d === 3 ? l + d : 0; - }; - less.getVariablesList = function() { - var startPos = pos, - x = [NodeType.VariablesListType, this.getVariable()]; - pos += 3; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.markSC = function() { - var ws = -1, - sc = -1, - t; - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - if (ws === -1) ws = i; - if (sc === -1) sc = i; - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - t.sc = true; - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - }; - syntaxes.less = less; -})(); - return function(options) { - var css, rule, syntax; - if (!options) throw new Error('Please, pass a string to parse'); - css = typeof options === 'string'? options : options.css; - if (!css) throw new Error('String can not be empty'); - rule = options.rule || 'stylesheet'; - needInfo = options.needInfo || false; - syntax = options.syntax || 'css'; - if (!syntaxes[syntax]) throw new Error('Syntax "' + _syntax + - '" is not currently supported, sorry'); - s = syntaxes[syntax]; - getTokens(css, syntax); - tokensLength = tokens.length; - pos = 0; - s.markBrackets(); - s.markSC(); - s.markBlocks && s.markBlocks(); - return rules[rule](); - } -}()); -exports.cssToAST = cssToAST; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.js index 3802a0a..16d0821 100644 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.js +++ b/node_modules/csscomb/node_modules/gonzales-pe/lib/gonzales.js @@ -1,5 +1,11873 @@ -module.exports = { - astToSrc: require('./ast-to-src'), - astToString: require('./ast-to-string'), - srcToAST: require('./src-to-ast') -}; +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["gonzales"] = factory(); + else + root["gonzales"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Node = __webpack_require__(1); + var parse = __webpack_require__(7); + + module.exports = { + createNode: function (options) { + return new Node(options); + }, + parse: parse + }; + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + /** + * @param {string} type + * @param {array|string} content + * @param {number} line + * @param {number} column + * @constructor + */ + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var Node = (function () { + function Node(options) { + _classCallCheck(this, Node); + + this.type = options.type; + this.content = options.content; + this.syntax = options.syntax; + + if (options.start) this.start = options.start; + if (options.end) this.end = options.end; + } + + /** + * @param {String} type Node type + * @return {Boolean} Whether there is a child node of given type + */ + + Node.prototype.contains = function contains(type) { + return this.content.some(function (node) { + return node.type === type; + }); + }; + + /** + * @param {String} type Node type + * @param {Function} callback Function to call for every found node + */ + + Node.prototype.eachFor = function eachFor(type, callback) { + if (!Array.isArray(this.content)) return; + + if (typeof type !== 'string') { + callback = type; + type = null; + } + + var l = this.content.length; + var breakLoop; + + for (var i = l; i--;) { + if (breakLoop === null) break; + + if (!type || this.content[i] && this.content[i].type === type) breakLoop = callback(this.content[i], i, this); + } + + if (breakLoop === null) return null; + }; + + /** + * @param {String} type + * @return {?Node} First child node or `null` if nothing's been found. + */ + + Node.prototype.first = function first(type) { + if (!Array.isArray(this.content)) return null; + + if (!type) return this.content[0]; + + var i = 0; + var l = this.content.length; + + for (; i < l; i++) { + if (this.content[i].type === type) return this.content[i]; + } + + return null; + }; + + /** + * @param {String} type Node type + * @param {Function} callback Function to call for every found node + */ + + Node.prototype.forEach = function forEach(type, callback) { + if (!Array.isArray(this.content)) return; + + if (typeof type !== 'string') { + callback = type; + type = null; + } + + var i = 0; + var l = this.content.length; + var breakLoop; + + for (; i < l; i++) { + if (breakLoop === null) break; + + if (!type || this.content[i] && this.content[i].type === type) breakLoop = callback(this.content[i], i, this); + } + + if (breakLoop === null) return null; + }; + + /** + * @param {Number} index + * @return {?Node} + */ + + Node.prototype.get = function get(index) { + if (!Array.isArray(this.content)) return null; + + var node = this.content[index]; + return node ? node : null; + }; + + /** + * @param {Number} index + * @param {Node} node + */ + + Node.prototype.insert = function insert(index, node) { + if (!Array.isArray(this.content)) return; + + this.content.splice(index, 0, node); + }; + + /** + * @param {String} type + * @return {Boolean} Whether the node is of given type + */ + + Node.prototype.is = function is(type) { + return this.type === type; + }; + + /** + * @param {String} type + * @return {?Node} Last child node or `null` if nothing's been found. + */ + + Node.prototype.last = function last(type) { + if (!Array.isArray(this.content)) return null; + + var i = this.content.length; + if (!type) return this.content[i - 1]; + + for (; i--;) { + if (this.content[i].type === type) return this.content[i]; + } + + return null; + }; + + /** + * Number of child nodes. + * @type {number} + */ + + /** + * @param {Number} index + * @return {Node} + */ + + Node.prototype.removeChild = function removeChild(index) { + if (!Array.isArray(this.content)) return; + + var removedChild = this.content.splice(index, 1); + + return removedChild; + }; + + Node.prototype.toJson = function toJson() { + return JSON.stringify(this, false, 2); + }; + + Node.prototype.toString = function toString() { + var stringify = undefined; + + try { + stringify = __webpack_require__(2)("./" + this.syntax + '/stringify'); + } catch (e) { + var message = 'Syntax "' + this.syntax + '" is not supported yet, sorry'; + return console.error(message); + } + + return stringify(this); + }; + + /** + * @param {Function} callback + */ + + Node.prototype.traverse = function traverse(callback, index) { + var level = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2]; + var parent = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + + var breakLoop; + var x; + + level++; + + callback(this, index, parent, level); + + if (!Array.isArray(this.content)) return; + + for (var i = 0, l = this.content.length; i < l; i++) { + breakLoop = this.content[i].traverse(callback, i, level, this); + if (breakLoop === null) break; + + // If some nodes were removed or added: + if (x = this.content.length - l) { + l += x; + i += x; + } + } + + if (breakLoop === null) return null; + }; + + Node.prototype.traverseByType = function traverseByType(type, callback) { + this.traverse(function (node) { + if (node.type === type) callback.apply(node, arguments); + }); + }; + + Node.prototype.traverseByTypes = function traverseByTypes(types, callback) { + this.traverse(function (node) { + if (types.indexOf(node.type) !== -1) callback.apply(node, arguments); + }); + }; + + _createClass(Node, [{ + key: 'length', + get: function () { + if (!Array.isArray(this.content)) return 0; + return this.content.length; + } + }]); + + return Node; + })(); + + module.exports = Node; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + var map = { + "./css/stringify": 3, + "./less/stringify": 4, + "./sass/stringify": 5, + "./scss/stringify": 6 + }; + function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); + }; + function webpackContextResolve(req) { + return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); + }; + webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); + }; + webpackContext.resolve = webpackContextResolve; + module.exports = webpackContext; + webpackContext.id = 2; + + +/***/ }, +/* 3 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function stringify(tree) { + // TODO: Better error message + if (!tree) throw new Error('We need tree to translate'); + + function _t(tree) { + var type = tree.type; + if (_unique[type]) return _unique[type](tree); + if (typeof tree.content === 'string') return tree.content; + if (Array.isArray(tree.content)) return _composite(tree.content); + return ''; + } + + function _composite(t, i) { + if (!t) return ''; + + var s = ''; + i = i || 0; + for (; i < t.length; i++) s += _t(t[i]); + return s; + } + + var _unique = { + 'arguments': function (t) { + return '(' + _composite(t.content) + ')'; + }, + 'atkeyword': function (t) { + return '@' + _composite(t.content); + }, + 'attributeSelector': function (t) { + return '[' + _composite(t.content) + ']'; + }, + 'block': function (t) { + return '{' + _composite(t.content) + '}'; + }, + 'brackets': function (t) { + return '[' + _composite(t.content) + ']'; + }, + 'class': function (t) { + return '.' + _composite(t.content); + }, + 'color': function (t) { + return '#' + t.content; + }, + 'expression': function (t) { + return 'expression(' + t.content + ')'; + }, + 'id': function (t) { + return '#' + _composite(t.content); + }, + 'multilineComment': function (t) { + return '/*' + t.content + '*/'; + }, + 'nthSelector': function (t) { + return ':' + _t(t.content[0]) + '(' + _composite(t.content.slice(1)) + ')'; + }, + 'parentheses': function (t) { + return '(' + _composite(t.content) + ')'; + }, + 'percentage': function (t) { + return _composite(t.content) + '%'; + }, + 'pseudoClass': function (t) { + return ':' + _composite(t.content); + }, + 'pseudoElement': function (t) { + return '::' + _composite(t.content); + }, + 'uri': function (t) { + return 'url(' + _composite(t.content) + ')'; + } + }; + + return _t(tree); + }; + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function stringify(tree) { + // TODO: Better error message + if (!tree) throw new Error('We need tree to translate'); + + function _t(tree) { + var type = tree.type; + if (_unique[type]) return _unique[type](tree); + if (typeof tree.content === 'string') return tree.content; + if (Array.isArray(tree.content)) return _composite(tree.content); + return ''; + } + + function _composite(t, i) { + if (!t) return ''; + + var s = ''; + i = i || 0; + for (; i < t.length; i++) s += _t(t[i]); + return s; + } + + var _unique = { + 'arguments': function (t) { + return '(' + _composite(t.content) + ')'; + }, + 'atkeyword': function (t) { + return '@' + _composite(t.content); + }, + 'attributeSelector': function (t) { + return '[' + _composite(t.content) + ']'; + }, + 'block': function (t) { + return '{' + _composite(t.content) + '}'; + }, + 'brackets': function (t) { + return '[' + _composite(t.content) + ']'; + }, + 'class': function (t) { + return '.' + _composite(t.content); + }, + 'color': function (t) { + return '#' + t.content; + }, + 'escapedString': function (t) { + return '~' + t.content; + }, + 'expression': function (t) { + return 'expression(' + t.content + ')'; + }, + 'id': function (t) { + return '#' + _composite(t.content); + }, + 'interpolatedVariable': function (t) { + return '@{' + _composite(t.content) + '}'; + }, + 'multilineComment': function (t) { + return '/*' + t.content + '*/'; + }, + 'nthSelector': function (t) { + return ':' + _t(t.content[0]) + '(' + _composite(t.content.slice(1)) + ')'; + }, + 'parentheses': function (t) { + return '(' + _composite(t.content) + ')'; + }, + 'percentage': function (t) { + return _composite(t.content) + '%'; + }, + 'pseudoClass': function (t) { + return ':' + _composite(t.content); + }, + 'pseudoElement': function (t) { + return '::' + _composite(t.content); + }, + 'singlelineComment': function (t) { + return '/' + '/' + t.content; + }, + 'uri': function (t) { + return 'url(' + _composite(t.content) + ')'; + }, + 'variable': function (t) { + return '@' + _composite(t.content); + }, + 'variablesList': function (t) { + return _composite(t.content) + '...'; + } + }; + + return _t(tree); + }; + +/***/ }, +/* 5 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function stringify(tree) { + // TODO: Better error message + if (!tree) throw new Error('We need tree to translate'); + + function _t(tree) { + var type = tree.type; + if (_unique[type]) return _unique[type](tree); + if (typeof tree.content === 'string') return tree.content; + if (Array.isArray(tree.content)) return _composite(tree.content); + return ''; + } + + function _composite(t, i) { + if (!t) return ''; + + var s = ''; + i = i || 0; + for (; i < t.length; i++) s += _t(t[i]); + return s; + } + + var _unique = { + 'arguments': function (t) { + return '(' + _composite(t.content) + ')'; + }, + 'atkeyword': function (t) { + return '@' + _composite(t.content); + }, + 'attributeSelector': function (t) { + return '[' + _composite(t.content) + ']'; + }, + 'block': function (t) { + return _composite(t.content); + }, + 'brackets': function (t) { + return '[' + _composite(t.content) + ']'; + }, + 'class': function (t) { + return '.' + _composite(t.content); + }, + 'color': function (t) { + return '#' + t.content; + }, + 'expression': function (t) { + return 'expression(' + t.content + ')'; + }, + 'id': function (t) { + return '#' + _composite(t.content); + }, + 'interpolation': function (t) { + return '#{' + _composite(t.content) + '}'; + }, + 'multilineComment': function (t) { + return '/*' + t.content; + }, + 'nthSelector': function (t) { + return ':' + _t(t.content[0]) + '(' + _composite(t.content.slice(1)) + ')'; + }, + 'parentheses': function (t) { + return '(' + _composite(t.content) + ')'; + }, + 'percentage': function (t) { + return _composite(t.content) + '%'; + }, + 'placeholder': function (t) { + return '%' + _composite(t.content); + }, + 'pseudoClass': function (t) { + return ':' + _composite(t.content); + }, + 'pseudoElement': function (t) { + return '::' + _composite(t.content); + }, + 'singlelineComment': function (t) { + return '/' + '/' + t.content; + }, + 'uri': function (t) { + return 'url(' + _composite(t.content) + ')'; + }, + 'variable': function (t) { + return '$' + _composite(t.content); + }, + 'variablesList': function (t) { + return _composite(t.content) + '...'; + } + }; + + return _t(tree); + }; + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = function stringify(tree) { + // TODO: Better error message + if (!tree) throw new Error('We need tree to translate'); + + function _t(tree) { + var type = tree.type; + if (_unique[type]) return _unique[type](tree); + if (typeof tree.content === 'string') return tree.content; + if (Array.isArray(tree.content)) return _composite(tree.content); + return ''; + } + + function _composite(t, i) { + if (!t) return ''; + + var s = ''; + i = i || 0; + for (; i < t.length; i++) s += _t(t[i]); + return s; + } + + var _unique = { + 'arguments': function (t) { + return '(' + _composite(t.content) + ')'; + }, + 'atkeyword': function (t) { + return '@' + _composite(t.content); + }, + 'attributeSelector': function (t) { + return '[' + _composite(t.content) + ']'; + }, + 'block': function (t) { + return '{' + _composite(t.content) + '}'; + }, + 'brackets': function (t) { + return '[' + _composite(t.content) + ']'; + }, + 'class': function (t) { + return '.' + _composite(t.content); + }, + 'color': function (t) { + return '#' + t.content; + }, + 'expression': function (t) { + return 'expression(' + t.content + ')'; + }, + 'id': function (t) { + return '#' + _composite(t.content); + }, + 'interpolation': function (t) { + return '#{' + _composite(t.content) + '}'; + }, + 'multilineComment': function (t) { + return '/*' + t.content + '*/'; + }, + 'nthSelector': function (t) { + return ':' + _t(t.content[0]) + '(' + _composite(t.content.slice(1)) + ')'; + }, + 'parentheses': function (t) { + return '(' + _composite(t.content) + ')'; + }, + 'percentage': function (t) { + return _composite(t.content) + '%'; + }, + 'placeholder': function (t) { + return '%' + _composite(t.content); + }, + 'pseudoClass': function (t) { + return ':' + _composite(t.content); + }, + 'pseudoElement': function (t) { + return '::' + _composite(t.content); + }, + 'singlelineComment': function (t) { + return '/' + '/' + t.content; + }, + 'uri': function (t) { + return 'url(' + _composite(t.content) + ')'; + }, + 'variable': function (t) { + return '$' + _composite(t.content); + }, + 'variablesList': function (t) { + return _composite(t.content) + '...'; + } + }; + + return _t(tree); + }; + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var ParsingError = __webpack_require__(8); + var syntaxes = __webpack_require__(10); + + var isInteger = Number.isInteger || function (value) { + return typeof value === 'number' && Math.floor(value) === value; + }; + + /** + * @param {String} css + * @param {Object} options + * @return {Object} AST + */ + function parser(css, options) { + if (typeof css !== 'string') throw new Error('Please, pass a string to parse');else if (!css) return __webpack_require__(29)(); + + var syntax = options && options.syntax || 'css'; + var context = options && options.context || 'stylesheet'; + var tabSize = options && options.tabSize; + if (!isInteger(tabSize) || tabSize < 1) tabSize = 1; + + var syntaxParser = syntaxes[syntax]; + + if (!syntaxParser) { + var message = 'Syntax "' + syntax + '" is not supported yet, sorry'; + return console.error(message); + } + + var getTokens = syntaxParser.tokenizer; + var mark = syntaxParser.mark; + var parse = syntaxParser.parse; + + var tokens = getTokens(css, tabSize); + mark(tokens); + + var ast; + try { + ast = parse(tokens, context); + } catch (e) { + if (!e.syntax) throw e; + throw new ParsingError(e, css); + } + + return ast; + } + + module.exports = parser; + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var parserPackage = __webpack_require__(9); + + /** + * @param {Error} e + * @param {String} css + */ + function ParsingError(e, css) { + this.line = e.line; + this.syntax = e.syntax; + this.css_ = css; + } + + ParsingError.prototype = Object.defineProperties({ + /** + * @type {String} + * @private + */ + customMessage_: '', + + /** + * @type {Number} + */ + line: null, + + /** + * @type {String} + */ + name: 'Parsing error', + + /** + * @type {String} + */ + syntax: null, + + /** + * @type {String} + */ + version: parserPackage.version, + + /** + * @return {String} + */ + toString: function () { + return [this.name + ': ' + this.message, '', this.context, '', 'Syntax: ' + this.syntax, 'Gonzales PE version: ' + this.version].join('\n'); + } + }, { + context: { /** + * @type {String} + */ + + get: function () { + var LINES_AROUND = 2; + + var result = []; + var currentLineNumber = this.line; + var start = currentLineNumber - 1 - LINES_AROUND; + var end = currentLineNumber + LINES_AROUND; + var lines = this.css_.split(/\r\n|\r|\n/); + + for (var i = start; i < end; i++) { + var line = lines[i]; + if (!line) continue; + var ln = i + 1; + var mark = ln === currentLineNumber ? '*' : ' '; + result.push(ln + mark + '| ' + line); + } + + return result.join('\n'); + }, + configurable: true, + enumerable: true + }, + message: { + + /** + * @type {String} + */ + + get: function () { + if (this.customMessage_) { + return this.customMessage_; + } else { + var message = 'Please check validity of the block'; + if (typeof this.line === 'number') message += ' starting from line #' + this.line; + return message; + } + }, + set: function (message) { + this.customMessage_ = message; + }, + configurable: true, + enumerable: true + } + }); + + module.exports = ParsingError; + +/***/ }, +/* 9 */ +/***/ function(module, exports) { + + module.exports = { + "name": "gonzales-pe", + "description": "Gonzales Preprocessor Edition (fast CSS parser)", + "version": "3.4.7", + "homepage": "http://github.com/tonyganch/gonzales-pe", + "bugs": "http://github.com/tonyganch/gonzales-pe/issues", + "license": "MIT", + "author": { + "name": "Tony Ganch", + "email": "tonyganch+github@gmail.com", + "url": "http://tonyganch.com" + }, + "main": "./lib/gonzales", + "repository": { + "type": "git", + "url": "http://github.com/tonyganch/gonzales-pe.git" + }, + "scripts": { + "autofix-tests": "bash ./scripts/build.sh && bash ./scripts/autofix-tests.sh", + "build": "bash ./scripts/build.sh", + "init": "bash ./scripts/init.sh", + "lint": "bash ./scripts/lint.sh", + "log": "bash ./scripts/log.sh", + "prepublish": "bash ./scripts/prepublish.sh", + "postpublish": "bash ./scripts/postpublish.sh", + "test": "bash ./scripts/test.sh", + "watch": "bash ./scripts/watch.sh" + }, + "bin": { + "gonzales": "./bin/gonzales.js" + }, + "dependencies": { + "minimist": "1.1.x" + }, + "devDependencies": { + "babel-loader": "^5.3.2", + "coffee-script": "~1.7.1", + "eslint": "^3.0.0", + "jscs": "2.1.0", + "jshint": "2.8.0", + "json-loader": "^0.5.3", + "mocha": "2.2.x", + "webpack": "^1.12.2", + "webpack-closure-compiler": "^2.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }; + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = { + css: __webpack_require__(11), + less: __webpack_require__(17), + sass: __webpack_require__(21), + scss: __webpack_require__(25) + }; + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = { + mark: __webpack_require__(12), + parse: __webpack_require__(14), + stringify: __webpack_require__(3), + tokenizer: __webpack_require__(16) + }; + module.exports = exports['default']; + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var TokenType = __webpack_require__(13); + + /** + * Mark whitespaces and comments + * @param {Array} tokens + */ + function markSpacesAndComments(tokens) { + var tokensLength = tokens.length; + var spaces = [-1, -1]; + var type; // Current token's type + + // For every token in the token list, mark spaces and line breaks + // as spaces (set both `ws` and `sc` flags). Mark multiline comments + // with `sc` flag. + // If there are several spaces or tabs or line breaks or multiline + // comments in a row, group them: take the last one's index number + // and save it to the first token in the group as a reference: + // e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` + // for a group of whitespaces and comments. + for (var i = 0; i < tokensLength; i++) { + type = tokens[i].type; + + if (type === TokenType.Space || type === TokenType.Tab || type === TokenType.Newline) { + markSpace(tokens, i, spaces); + } else if (type === TokenType.CommentML) { + markComment(tokens, i, spaces); + } else { + markEndOfSpacesAndComments(tokens, i, spaces); + } + } + + markEndOfSpacesAndComments(tokens, i, spaces); + } + + function markSpace(tokens, i, spaces) { + var token = tokens[i]; + token.ws = true; + token.sc = true; + + if (spaces[0] === -1) spaces[0] = i; + if (spaces[1] === -1) spaces[1] = i; + } + + function markComment(tokens, i, spaces) { + var ws = spaces[0]; + tokens[i].sc = true; + + if (ws !== -1) { + tokens[ws].ws_last = i - 1; + spaces[0] = -1; + } + } + + function markEndOfSpacesAndComments(tokens, i, spaces) { + var ws = spaces[0]; + var sc = spaces[1]; + if (ws !== -1) { + tokens[ws].ws_last = i - 1; + spaces[0] = -1; + } + if (sc !== -1) { + tokens[sc].sc_last = i - 1; + spaces[1] = -1; + } + } + + /** + * Pair brackets + * @param {Array} tokens + */ + function markBrackets(tokens) { + var tokensLength = tokens.length; + var ps = []; // Parentheses + var sbs = []; // Square brackets + var cbs = []; // Curly brackets + var t = undefined; // Current token + + // For every token in the token list, if we meet an opening (left) + // bracket, push its index number to a corresponding array. + // If we then meet a closing (right) bracket, look at the corresponding + // array. If there are any elements (records about previously met + // left brackets), take a token of the last left bracket (take + // the last index number from the array and find a token with + // this index number) and save right bracket's index as a reference: + for (var i = 0; i < tokensLength; i++) { + t = tokens[i]; + var type = t.type; + + if (type === TokenType.LeftParenthesis) { + ps.push(i); + } else if (type === TokenType.RightParenthesis) { + if (ps.length) { + t.left = ps.pop(); + tokens[t.left].right = i; + } + } else if (type === TokenType.LeftSquareBracket) { + sbs.push(i); + } else if (type === TokenType.RightSquareBracket) { + if (sbs.length) { + t.left = sbs.pop(); + tokens[t.left].right = i; + } + } else if (type === TokenType.LeftCurlyBracket) { + cbs.push(i); + } else if (type === TokenType.RightCurlyBracket) { + if (cbs.length) { + t.left = cbs.pop(); + tokens[t.left].right = i; + } + } + } + } + + /** + * @param {Array} tokens + */ + function markTokens(tokens) { + // Mark paired brackets: + markBrackets(tokens); + // Mark whitespaces and comments: + markSpacesAndComments(tokens); + } + + module.exports = markTokens; + +/***/ }, +/* 13 */ +/***/ function(module, exports) { + + // jscs:disable + + 'use strict'; + + module.exports = { + StringSQ: 'StringSQ', + StringDQ: 'StringDQ', + CommentML: 'CommentML', + CommentSL: 'CommentSL', + + Newline: 'Newline', + Space: 'Space', + Tab: 'Tab', + + ExclamationMark: 'ExclamationMark', // ! + QuotationMark: 'QuotationMark', // " + NumberSign: 'NumberSign', // # + DollarSign: 'DollarSign', // $ + PercentSign: 'PercentSign', // % + Ampersand: 'Ampersand', // & + Apostrophe: 'Apostrophe', // ' + LeftParenthesis: 'LeftParenthesis', // ( + RightParenthesis: 'RightParenthesis', // ) + Asterisk: 'Asterisk', // * + PlusSign: 'PlusSign', // + + Comma: 'Comma', // , + HyphenMinus: 'HyphenMinus', // - + FullStop: 'FullStop', // . + Solidus: 'Solidus', // / + Colon: 'Colon', // : + Semicolon: 'Semicolon', // ; + LessThanSign: 'LessThanSign', // < + EqualsSign: 'EqualsSign', // = + EqualitySign: 'EqualitySign', // == + InequalitySign: 'InequalitySign', // != + GreaterThanSign: 'GreaterThanSign', // > + QuestionMark: 'QuestionMark', // ? + CommercialAt: 'CommercialAt', // @ + LeftSquareBracket: 'LeftSquareBracket', // [ + ReverseSolidus: 'ReverseSolidus', // \ + RightSquareBracket: 'RightSquareBracket', // ] + CircumflexAccent: 'CircumflexAccent', // ^ + LowLine: 'LowLine', // _ + LeftCurlyBracket: 'LeftCurlyBracket', // { + VerticalLine: 'VerticalLine', // | + RightCurlyBracket: 'RightCurlyBracket', // } + Tilde: 'Tilde', // ~ + + Identifier: 'Identifier', + DecimalNumber: 'DecimalNumber' + }; + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Node = __webpack_require__(1); + var NodeType = __webpack_require__(15); + var TokenType = __webpack_require__(13); + + /** + * @type {Array} + */ + var tokens; + + /** + * @type {Number} + */ + var tokensLength; + + /** + * @type {Number} + */ + var pos; + + var contexts = { + 'atkeyword': function () { + return checkAtkeyword(pos) && getAtkeyword(); + }, + 'atrule': function () { + return checkAtrule(pos) && getAtrule(); + }, + 'block': function () { + return checkBlock(pos) && getBlock(); + }, + 'brackets': function () { + return checkBrackets(pos) && getBrackets(); + }, + 'class': function () { + return checkClass(pos) && getClass(); + }, + 'combinator': function () { + return checkCombinator(pos) && getCombinator(); + }, + 'commentML': function () { + return checkCommentML(pos) && getCommentML(); + }, + 'declaration': function () { + return checkDeclaration(pos) && getDeclaration(); + }, + 'declDelim': function () { + return checkDeclDelim(pos) && getDeclDelim(); + }, + 'delim': function () { + return checkDelim(pos) && getDelim(); + }, + 'dimension': function () { + return checkDimension(pos) && getDimension(); + }, + 'expression': function () { + return checkExpression(pos) && getExpression(); + }, + 'function': function () { + return checkFunction(pos) && getFunction(); + }, + 'ident': function () { + return checkIdent(pos) && getIdent(); + }, + 'important': function () { + return checkImportant(pos) && getImportant(); + }, + 'namespace': function () { + return checkNamespace(pos) && getNamespace(); + }, + 'number': function () { + return checkNumber(pos) && getNumber(); + }, + 'operator': function () { + return checkOperator(pos) && getOperator(); + }, + 'parentheses': function () { + return checkParentheses(pos) && getParentheses(); + }, + 'percentage': function () { + return checkPercentage(pos) && getPercentage(); + }, + 'progid': function () { + return checkProgid(pos) && getProgid(); + }, + 'property': function () { + return checkProperty(pos) && getProperty(); + }, + 'propertyDelim': function () { + return checkPropertyDelim(pos) && getPropertyDelim(); + }, + 'pseudoc': function () { + return checkPseudoc(pos) && getPseudoc(); + }, + 'pseudoe': function () { + return checkPseudoe(pos) && getPseudoe(); + }, + 'ruleset': function () { + return checkRuleset(pos) && getRuleset(); + }, + 's': function () { + return checkS(pos) && getS(); + }, + 'selector': function () { + return checkSelector(pos) && getSelector(); + }, + 'shash': function () { + return checkShash(pos) && getShash(); + }, + 'string': function () { + return checkString(pos) && getString(); + }, + 'stylesheet': function () { + return checkStylesheet(pos) && getStylesheet(); + }, + 'unary': function () { + return checkUnary(pos) && getUnary(); + }, + 'unicodeRange': function () { + return checkUnicodeRange(pos) && getUnicodeRange(); + }, + 'urange': function () { + return checkUrange(pos) && getUrange(); + }, + 'uri': function () { + return checkUri(pos) && getUri(); + }, + 'value': function () { + return checkValue(pos) && getValue(); + }, + 'vhash': function () { + return checkVhash(pos) && getVhash(); + } + }; + + /** + * Stop parsing and display error. + * @param {Number=} i Token's index number + */ + function throwError(i) { + var ln = tokens[i].ln; + + throw { line: ln, syntax: 'css' }; + } + + /** + * @param {Object} exclude + * @param {Number} i Token's index number + * @return {Number} + */ + function checkExcluding(exclude, i) { + var start = i; + + while (i < tokensLength) { + if (exclude[tokens[i++].type]) break; + } + + return i - start - 2; + } + + /** + * @param {Number} start + * @param {Number} finish + * @return {String} + */ + function joinValues(start, finish) { + var s = ''; + + for (var i = start; i < finish + 1; i++) { + s += tokens[i].value; + } + + return s; + } + + /** + * @param {Number} start + * @param {Number} num + * @return {String} + */ + function joinValues2(start, num) { + if (start + num - 1 >= tokensLength) return; + + var s = ''; + + for (var i = 0; i < num; i++) { + s += tokens[start + i].value; + } + + return s; + } + + function getLastPosition(content, line, column, colOffset) { + return typeof content === 'string' ? getLastPositionForString(content, line, column, colOffset) : getLastPositionForArray(content, line, column, colOffset); + } + + function getLastPositionForString(content, line, column, colOffset) { + var position = []; + + if (!content) { + position = [line, column]; + if (colOffset) position[1] += colOffset - 1; + return position; + } + + var lastLinebreak = content.lastIndexOf('\n'); + var endsWithLinebreak = lastLinebreak === content.length - 1; + var splitContent = content.split('\n'); + var linebreaksCount = splitContent.length - 1; + var prevLinebreak = linebreaksCount === 0 || linebreaksCount === 1 ? -1 : content.length - splitContent[linebreaksCount - 1].length - 2; + + // Line: + var offset = endsWithLinebreak ? linebreaksCount - 1 : linebreaksCount; + position[0] = line + offset; + + // Column: + if (endsWithLinebreak) { + offset = prevLinebreak !== -1 ? content.length - prevLinebreak : content.length - 1; + } else { + offset = linebreaksCount !== 0 ? content.length - lastLinebreak - column - 1 : content.length - 1; + } + position[1] = column + offset; + + if (!colOffset) return position; + + if (endsWithLinebreak) { + position[0]++; + position[1] = colOffset; + } else { + position[1] += colOffset; + } + + return position; + } + + function getLastPositionForArray(content, line, column, colOffset) { + var position; + + if (content.length === 0) { + position = [line, column]; + } else { + var c = content[content.length - 1]; + if (c.hasOwnProperty('end')) { + position = [c.end.line, c.end.column]; + } else { + position = getLastPosition(c.content, line, column); + } + } + + if (!colOffset) return position; + + if (tokens[pos - 1].type !== 'Newline') { + position[1] += colOffset; + } else { + position[0]++; + position[1] = 1; + } + + return position; + } + + function newNode(type, content, line, column, end) { + if (!end) end = getLastPosition(content, line, column); + return new Node({ + type: type, + content: content, + start: { + line: line, + column: column + }, + end: { + line: end[0], + column: end[1] + }, + syntax: 'css' + }); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkAny(i) { + var l; + + if (l = checkBrackets(i)) tokens[i].any_child = 1;else if (l = checkParentheses(i)) tokens[i].any_child = 2;else if (l = checkString(i)) tokens[i].any_child = 3;else if (l = checkPercentage(i)) tokens[i].any_child = 4;else if (l = checkDimension(i)) tokens[i].any_child = 5;else if (l = checkUnicodeRange(i)) tokens[i].any_child = 13;else if (l = checkNumber(i)) tokens[i].any_child = 6;else if (l = checkUri(i)) tokens[i].any_child = 7;else if (l = checkExpression(i)) tokens[i].any_child = 8;else if (l = checkFunction(i)) tokens[i].any_child = 9;else if (l = checkIdent(i)) tokens[i].any_child = 10;else if (l = checkClass(i)) tokens[i].any_child = 11;else if (l = checkUnary(i)) tokens[i].any_child = 12; + + return l; + } + + /** + * @return {Node} + */ + function getAny() { + var childType = tokens[pos].any_child; + + if (childType === 1) return getBrackets();else if (childType === 2) return getParentheses();else if (childType === 3) return getString();else if (childType === 4) return getPercentage();else if (childType === 5) return getDimension();else if (childType === 13) return getUnicodeRange();else if (childType === 6) return getNumber();else if (childType === 7) return getUri();else if (childType === 8) return getExpression();else if (childType === 9) return getFunction();else if (childType === 10) return getIdent();else if (childType === 11) return getClass();else if (childType === 12) return getUnary(); + } + + /** + * Check if token is part of an @-word (e.g. `@import`, `@include`) + * @param {Number} i Token's index number + * @return {Number} + */ + function checkAtkeyword(i) { + var l; + + // Check that token is `@`: + if (i >= tokensLength || tokens[i++].type !== TokenType.CommercialAt) return 0; + + return (l = checkIdent(i)) ? l + 1 : 0; + } + + /** + * Get node with @-word + * @return {Node} + */ + function getAtkeyword() { + var type = NodeType.AtkeywordType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + pos++; + + content.push(getIdent()); + + return newNode(type, content, line, column); + } + + /** + * Check if token is a part of an @-rule + * @param {Number} i Token's index number + * @return {Number} Length of @-rule + */ + function checkAtrule(i) { + var l; + + if (i >= tokensLength) return 0; + + // If token already has a record of being part of an @-rule, + // return the @-rule's length: + if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l; + + // If token is part of an @-rule, save the rule's type to token. + // @keyframes: + if (l = checkKeyframesRule(i)) tokens[i].atrule_type = 4; + // @-rule with ruleset: + else if (l = checkAtruler(i)) tokens[i].atrule_type = 1; + // Block @-rule: + else if (l = checkAtruleb(i)) tokens[i].atrule_type = 2; + // Single-line @-rule: + else if (l = checkAtrules(i)) tokens[i].atrule_type = 3;else return 0; + + // If token is part of an @-rule, save the rule's length to token: + tokens[i].atrule_l = l; + + return l; + } + + /** + * Get node with @-rule + * @return {Node} + */ + function getAtrule() { + switch (tokens[pos].atrule_type) { + case 1: + return getAtruler(); // @-rule with ruleset + case 2: + return getAtruleb(); // Block @-rule + case 3: + return getAtrules(); // Single-line @-rule + case 4: + return getKeyframesRule(); + } + } + + /** + * Check if token is part of a block @-rule + * @param {Number} i Token's index number + * @return {Number} Length of the @-rule + */ + function checkAtruleb(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkAtkeyword(i)) i += l;else return 0; + + if (l = checkTsets(i)) i += l; + + if (l = checkBlock(i)) i += l;else return 0; + + return i - start; + } + + /** + * Get node with a block @-rule + * @return {Node} + */ + function getAtruleb() { + var type = NodeType.AtruleType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getAtkeyword()].concat(getTsets()).concat([getBlock()]); + + return newNode(type, content, line, column); + } + + /** + * Check if token is part of an @-rule with ruleset + * @param {Number} i Token's index number + * @return {Number} Length of the @-rule + */ + function checkAtruler(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkAtkeyword(i)) i += l;else return 0; + + if (l = checkTsets(i)) i += l; + + if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;else return 0; + + if (l = checkAtrulers(i)) i += l; + + if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++;else return 0; + + return i - start; + } + + /** + * Get node with an @-rule with ruleset + * @return {Node} + */ + function getAtruler() { + var type = NodeType.AtruleType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getAtkeyword()]; + + content = content.concat(getTsets()); + + content.push(getAtrulers()); + + return newNode(type, content, line, column); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkAtrulers(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkSC(i)) i += l; + + while (i < tokensLength) { + if (l = checkSC(i)) tokens[i].atrulers_child = 1;else if (l = checkAtrule(i)) tokens[i].atrulers_child = 2;else if (l = checkRuleset(i)) tokens[i].atrulers_child = 3;else break; + i += l; + } + + tokens[i].atrulers_end = 1; + + if (l = checkSC(i)) i += l; + + return i - start; + } + + /** + * @return {Node} + */ + function getAtrulers() { + var type = NodeType.BlockType; + var token = tokens[pos++]; + var line = token.ln; + var column = token.col; + var content = getSC(); + + while (!tokens[pos].atrulers_end) { + var childType = tokens[pos].atrulers_child; + if (childType === 1) content = content.concat(getSC());else if (childType === 2) content.push(getAtrule());else if (childType === 3) content.push(getRuleset()); + } + + content = content.concat(getSC()); + + var end = getLastPosition(content, line, column, 1); + pos++; + + return newNode(type, content, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkAtrules(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkAtkeyword(i)) i += l;else return 0; + + if (l = checkTsets(i)) i += l; + + return i - start; + } + + /** + * @return {Node} + */ + function getAtrules() { + var type = NodeType.AtruleType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getAtkeyword()].concat(getTsets()); + + return newNode(type, content, line, column); + } + + /** + * Check if token is part of a block (e.g. `{...}`). + * @param {Number} i Token's index number + * @return {Number} Length of the block + */ + function checkBlock(i) { + return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ? tokens[i].right - i + 1 : 0; + } + + /** + * Get node with a block + * @return {Node} + */ + function getBlock() { + var type = NodeType.BlockType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var end = tokens[pos++].right; + var content = []; + + while (pos < end) { + if (checkBlockdecl(pos)) content = content.concat(getBlockdecl());else throwError(pos); + } + + var end_ = getLastPosition(content, line, column, 1); + pos = end + 1; + + return newNode(type, content, line, column, end_); + } + + /** + * Check if token is part of a declaration (property-value pair) + * @param {Number} i Token's index number + * @return {Number} Length of the declaration + */ + function checkBlockdecl(i) { + var l; + + if (i >= tokensLength) return 0; + + if (l = checkBlockdecl1(i)) tokens[i].bd_type = 1;else if (l = checkBlockdecl2(i)) tokens[i].bd_type = 2;else if (l = checkBlockdecl3(i)) tokens[i].bd_type = 3;else if (l = checkBlockdecl4(i)) tokens[i].bd_type = 4;else return 0; + + return l; + } + + /** + * @return {Array} + */ + function getBlockdecl() { + switch (tokens[pos].bd_type) { + case 1: + return getBlockdecl1(); + case 2: + return getBlockdecl2(); + case 3: + return getBlockdecl3(); + case 4: + return getBlockdecl4(); + } + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkBlockdecl1(i) { + var start = i; + var l = undefined; + + if (l = checkSC(i)) i += l; + + if (l = checkDeclaration(i)) tokens[i].bd_kind = 1;else if (l = checkAtrule(i)) tokens[i].bd_kind = 2;else return 0; + + i += l; + + if (l = checkSC(i)) i += l; + + if (i < tokensLength && (l = checkDeclDelim(i))) i += l;else return 0; + + if (l = checkSC(i)) i += l;else return 0; + + return i - start; + } + + /** + * @return {Array} + */ + function getBlockdecl1() { + var sc = getSC(); + var x = undefined; + + switch (tokens[pos].bd_kind) { + case 1: + x = getDeclaration(); + break; + case 2: + x = getAtrule(); + break; + } + + return sc.concat([x]).concat(getSC()).concat([getDeclDelim()]).concat(getSC()); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkBlockdecl2(i) { + var start = i; + var l = undefined; + + if (l = checkSC(i)) i += l; + + if (l = checkDeclaration(i)) tokens[i].bd_kind = 1;else if (l = checkAtrule(i)) tokens[i].bd_kind = 2;else return 0; + + i += l; + + if (l = checkSC(i)) i += l; + + return i - start; + } + + /** + * @return {Array} + */ + function getBlockdecl2() { + var sc = getSC(); + var x = undefined; + + switch (tokens[pos].bd_kind) { + case 1: + x = getDeclaration(); + break; + case 2: + x = getAtrule(); + break; + } + + return sc.concat([x]).concat(getSC()); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkBlockdecl3(i) { + var start = i; + var l = undefined; + + if (l = checkSC(i)) i += l; + + if (l = checkDeclDelim(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + return i - start; + } + + /** + * @return {Array} + */ + function getBlockdecl3() { + return getSC().concat([getDeclDelim()]).concat(getSC()); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkBlockdecl4(i) { + return checkSC(i); + } + + /** + * @return {Array} + */ + function getBlockdecl4() { + return getSC(); + } + + /** + * Check if token is part of text inside square brackets, e.g. `[1]` + * @param {Number} i Token's index number + * @return {Number} + */ + function checkBrackets(i) { + if (i >= tokensLength || tokens[i].type !== TokenType.LeftSquareBracket) return 0; + + return tokens[i].right - i + 1; + } + + /** + * Get node with text inside square brackets, e.g. `[1]` + * @return {Node} + */ + function getBrackets() { + var type = NodeType.BracketsType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + + pos++; + + var tsets = getTsets(); + var end = getLastPosition(tsets, line, column, 1); + pos++; + + return newNode(type, tsets, line, column, end); + } + + /** + * Check if token is part of a class selector (e.g. `.abc`) + * @param {Number} i Token's index number + * @return {Number} Length of the class selector + */ + function checkClass(i) { + var l; + + if (i >= tokensLength) return 0; + + if (tokens[i].class_l) return tokens[i].class_l; + + if (tokens[i++].type === TokenType.FullStop && (l = checkIdent(i))) { + tokens[i].class_l = l + 1; + return l + 1; + } + + return 0; + } + + /** + * Get node with a class selector + * @return {Node} + */ + function getClass() { + var type = NodeType.ClassType; + var token = tokens[pos++]; + var line = token.ln; + var column = token.col; + var content = [getIdent()]; + + return newNode(type, content, line, column); + } + + function checkCombinator(i) { + if (i >= tokensLength) return 0; + + var l = undefined; + if (l = checkCombinator1(i)) tokens[i].combinatorType = 1;else if (l = checkCombinator2(i)) tokens[i].combinatorType = 2;else if (l = checkCombinator3(i)) tokens[i].combinatorType = 3; + + return l; + } + + function getCombinator() { + var type = tokens[pos].combinatorType; + if (type === 1) return getCombinator1(); + if (type === 2) return getCombinator2(); + if (type === 3) return getCombinator3(); + } + /** + * (1) `||` + */ + function checkCombinator1(i) { + if (tokens[i].type === TokenType.VerticalLine && tokens[i + 1].type === TokenType.VerticalLine) return 2;else return 0; + } + + function getCombinator1() { + var type = NodeType.CombinatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = '||'; + + pos += 2; + return newNode(type, content, line, column); + } + + /** + * (1) `>` + * (2) `+` + * (3) `~` + */ + function checkCombinator2(i) { + var type = tokens[i].type; + if (type === TokenType.PlusSign || type === TokenType.GreaterThanSign || type === TokenType.Tilde) return 1;else return 0; + } + + function getCombinator2() { + var type = NodeType.CombinatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = tokens[pos++].value; + + return newNode(type, content, line, column); + } + + /** + * (1) `/panda/` + */ + function checkCombinator3(i) { + var start = i; + + if (tokens[i].type === TokenType.Solidus) i++;else return 0; + + var l = undefined; + if (l = checkIdent(i)) i += l;else return 0; + + if (tokens[i].type === TokenType.Solidus) i++;else return 0; + + return i - start; + } + + function getCombinator3() { + var type = NodeType.CombinatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + + // Skip `/`. + pos++; + var ident = getIdent(); + + // Skip `/`. + pos++; + + var content = '/' + ident.content + '/'; + + return newNode(type, content, line, column); + } + + /** + * Check if token is a multiline comment. + * @param {Number} i Token's index number + * @return {Number} `1` if token is a multiline comment, otherwise `0` + */ + function checkCommentML(i) { + return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0; + } + + /** + * Get node with a multiline comment + * @return {Node} + */ + function getCommentML() { + var type = NodeType.CommentMLType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = tokens[pos].value.substring(2); + var l = content.length; + + if (content.charAt(l - 2) === '*' && content.charAt(l - 1) === '/') content = content.substring(0, l - 2); + + var end = getLastPosition(content, line, column, 2); + if (end[0] === line) end[1] += 2; + pos++; + + return newNode(type, content, line, column, end); + } + + /** + * Check if token is part of a declaration (property-value pair) + * @param {Number} i Token's index number + * @return {Number} Length of the declaration + */ + function checkDeclaration(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkProperty(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkPropertyDelim(i)) i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkValue(i)) i += l;else return 0; + + return i - start; + } + + /** + * Get node with a declaration + * @return {Node} + */ + function getDeclaration() { + var type = NodeType.DeclarationType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + + var content = [getProperty()].concat(getSC()).concat([getPropertyDelim()]).concat(getSC()).concat([getValue()]); + + return newNode(type, content, line, column); + } + + /** + * Check if token is a semicolon + * @param {Number} i Token's index number + * @return {Number} `1` if token is a semicolon, otherwise `0` + */ + function checkDeclDelim(i) { + return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0; + } + + /** + * Get node with a semicolon + * @return {Node} + */ + function getDeclDelim() { + var type = NodeType.DeclDelimType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = ';'; + + pos++; + + return newNode(type, content, line, column); + } + + /** + * Check if token is a comma + * @param {Number} i Token's index number + * @return {Number} `1` if token is a comma, otherwise `0` + */ + function checkDelim(i) { + return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0; + } + + /** + * Get node with a comma + * @return {Node} + */ + function getDelim() { + var type = NodeType.DelimType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = ','; + + pos++; + + return newNode(type, content, line, column); + } + + /** + * Check if token is part of a number with dimension unit (e.g. `10px`) + * @param {Number} i Token's index number + * @return {Number} + */ + function checkDimension(i) { + var ln = checkNumber(i); + var li = undefined; + + if (i >= tokensLength || !ln || i + ln >= tokensLength) return 0; + + return (li = checkUnit(i + ln)) ? ln + li : 0; + } + + /** + * Get node of a number with dimension unit + * @return {Node} + */ + function getDimension() { + var type = NodeType.DimensionType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getNumber(), getUnit()]; + + return newNode(type, content, line, column); + } + + /** + * Check if token is unit + * @param {Number} i Token's index number + * @return {Number} + */ + function checkUnit(i) { + var units = ['em', 'ex', 'ch', 'rem', 'vh', 'vw', 'vmin', 'vmax', 'px', 'mm', 'q', 'cm', 'in', 'pt', 'pc', 'deg', 'grad', 'rad', 'turn', 's', 'ms', 'Hz', 'kHz', 'dpi', 'dpcm', 'dppx']; + + return units.indexOf(tokens[i].value) !== -1 ? 1 : 0; + } + + /** + * Get unit node of type ident + * @return {Node} An ident node containing the unit value + */ + function getUnit() { + var type = NodeType.IdentType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = token.value; + + pos++; + + return newNode(type, content, line, column); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkExpression(i) { + var start = i; + + if (i >= tokensLength || tokens[i++].value !== 'expression' || i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) { + return 0; + } + + return tokens[i].right - start + 1; + } + + /** + * @return {Node} + */ + function getExpression() { + var type = NodeType.ExpressionType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + + pos++; + + var content = joinValues(pos + 1, tokens[pos].right - 1); + var end = getLastPosition(content, line, column, 1); + if (end[0] === line) end[1] += 11; + pos = tokens[pos].right + 1; + + return newNode(type, content, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkFunction(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ? tokens[i].right - start + 1 : 0; + } + + /** + * @return {Node} + */ + function getFunction() { + var type = NodeType.FunctionType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var ident = getIdent(); + var content = [ident]; + + content.push(getArguments()); + + return newNode(type, content, line, column); + } + + /** + * @return {Node} + */ + function getArguments() { + var type = NodeType.ArgumentsType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + var body = undefined; + + pos++; + + while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { + if (checkDeclaration(pos)) content.push(getDeclaration());else if (checkArgument(pos)) { + body = getArgument(); + if (typeof body.content === 'string') content.push(body);else content = content.concat(body); + } else if (checkClass(pos)) content.push(getClass());else throwError(pos); + } + + var end = getLastPosition(content, line, column, 1); + pos++; + + return newNode(type, content, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkArgument(i) { + var l; + + if (l = checkVhash(i)) tokens[i].argument_child = 1;else if (l = checkAny(i)) tokens[i].argument_child = 2;else if (l = checkSC(i)) tokens[i].argument_child = 3;else if (l = checkOperator(i)) tokens[i].argument_child = 4; + + return l; + } + + /** + * @return {Node} + */ + function getArgument() { + var childType = tokens[pos].argument_child; + if (childType === 1) return getVhash();else if (childType === 2) return getAny();else if (childType === 3) return getSC();else if (childType === 4) return getOperator(); + } + + /** + * Check if token is part of an identifierю + * Grammar from CSS spec: + * h [0-9a-f] + * nonascii [\240-\377] + * unicode \\{h}{1,6}(\r\n|[ \t\r\n\f])? + * escape {unicode}|\\[^\r\n\f0-9a-f] + * nmstart [_a-z]|{nonascii}|{escape} + * nmchar [_a-z0-9-]|{nonascii}|{escape} + * ident -?{nmstart}{nmchar}* + * + * @param {number} i Token's index number + * @return {number} Length of the identifier + */ + function checkIdent(i) { + var start = i; + + if (i >= tokensLength) return 0; + + if (tokens[i].type === TokenType.HyphenMinus) i++; + + if (tokens[i].type === TokenType.LowLine || tokens[i].type === TokenType.Identifier) i++;else return 0; + + for (; i < tokensLength; i++) { + if (tokens[i].type !== TokenType.HyphenMinus && tokens[i].type !== TokenType.LowLine && tokens[i].type !== TokenType.Identifier && tokens[i].type !== TokenType.DecimalNumber) break; + } + + tokens[start].ident_last = i - 1; + + return i - start; + } + + /** + * Get node with an identifier + * @return {Node} + */ + function getIdent() { + var type = NodeType.IdentType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = joinValues(pos, tokens[pos].ident_last); + + pos = tokens[pos].ident_last + 1; + + return newNode(type, content, line, column); + } + + /** + * Check if token is part of `!important` word + * @param {Number} i Token's index number + * @return {Number} + */ + function checkImportant(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark) return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].value === 'important') { + tokens[start].importantEnd = i; + return i - start + 1; + } else { + return 0; + } + } + + /** + * Get node with `!important` word + * @return {Node} + */ + function getImportant() { + var type = NodeType.ImportantType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = joinValues(pos, token.importantEnd); + + pos = token.importantEnd + 1; + + return newNode(type, content, line, column); + } + + /** + * Check a single keyframe block - `5% {}` + * @param {Number} i + * @returns {Number} + */ + function checkKeyframesBlock(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkKeyframesSelectorsGroup(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkBlock(i)) i += l;else return 0; + + return i - start; + } + + /** + * Get a single keyframe block - `5% {}` + * @returns {Node} + */ + function getKeyframesBlock() { + var type = NodeType.RulesetType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [].concat(getKeyframesSelectorsGroup(), getSC(), [getBlock()]); + + return newNode(type, content, line, column); + } + + /** + * Check all keyframe blocks - `5% {} 100% {}` + * @param {Number} i + * @returns {Number} + */ + function checkKeyframesBlocks(i) { + var start = i; + var l = undefined; + + if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkKeyframesBlock(i)) i += l;else return 0; + + while (tokens[i].type !== TokenType.RightCurlyBracket) { + if (l = checkSC(i)) i += l;else if (l = checkKeyframesBlock(i)) i += l;else break; + } + + if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++;else return 0; + + return i - start; + } + + /** + * Get all keyframe blocks - `5% {} 100% {}` + * @returns {Node} + */ + function getKeyframesBlocks() { + var type = NodeType.BlockType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + var keyframesBlocksEnd = token.right; + + // Skip `{`. + pos++; + + while (pos < keyframesBlocksEnd) { + if (checkSC(pos)) content = content.concat(getSC());else if (checkKeyframesBlock(pos)) content.push(getKeyframesBlock()); + } + + var end = getLastPosition(content, line, column, 1); + + // Skip `}`. + pos++; + + return newNode(type, content, line, column, end); + } + + /** + * Check if token is part of a @keyframes rule. + * @param {Number} i Token's index number + * @return {Number} Length of the @keyframes rule + */ + function checkKeyframesRule(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkAtkeyword(i)) i += l;else return 0; + + var atruleName = joinValues2(i - l, l); + if (atruleName.indexOf('keyframes') === -1) return 0; + + if (l = checkSC(i)) i += l;else return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkKeyframesBlocks(i)) i += l;else return 0; + + return i - start; + } + + /** + * @return {Node} + */ + function getKeyframesRule() { + var type = NodeType.AtruleType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [].concat([getAtkeyword()], getSC(), [getIdent()], getSC(), [getKeyframesBlocks()]); + + return newNode(type, content, line, column); + } + + /** + * Check a single keyframe selector - `5%`, `from` etc + * @param {Number} i + * @returns {Number} + */ + function checkKeyframesSelector(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) { + // Valid selectors are only `from` and `to`. + var selector = joinValues2(i, l); + if (selector !== 'from' && selector !== 'to') return 0; + + i += l; + tokens[start].keyframesSelectorType = 1; + } else if (l = checkPercentage(i)) { + i += l; + tokens[start].keyframesSelectorType = 2; + } else { + return 0; + } + + return i - start; + } + + /** + * Get a single keyframe selector + * @returns {Node} + */ + function getKeyframesSelector() { + var keyframesSelectorType = NodeType.KeyframesSelectorType; + var selectorType = NodeType.SelectorType; + + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (token.keyframesSelectorType === 1) { + content.push(getIdent()); + } else { + content.push(getPercentage()); + } + + var keyframesSelector = newNode(keyframesSelectorType, content, line, column); + return newNode(selectorType, [keyframesSelector], line, column); + } + + /** + * Check the keyframe's selector groups + * @param {Number} i + * @returns {Number} + */ + function checkKeyframesSelectorsGroup(i) { + var start = i; + var l = undefined; + + if (l = checkKeyframesSelector(i)) i += l;else return 0; + + while (i < tokensLength) { + var sb = checkSC(i); + var c = checkDelim(i + sb); + if (!c) break; + var sa = checkSC(i + sb + c); + if (l = checkKeyframesSelector(i + sb + c + sa)) i += sb + c + sa + l;else break; + } + + tokens[start].selectorsGroupEnd = i; + + return i - start; + } + + /** + * Get the keyframe's selector groups + * @returns {Array} An array of keyframe selectors + */ + function getKeyframesSelectorsGroup() { + var selectorsGroup = []; + var selectorsGroupEnd = tokens[pos].selectorsGroupEnd; + + selectorsGroup.push(getKeyframesSelector()); + + while (pos < selectorsGroupEnd) { + selectorsGroup = selectorsGroup.concat(getSC()); + selectorsGroup.push(getDelim()); + selectorsGroup = selectorsGroup.concat(getSC()); + selectorsGroup.push(getKeyframesSelector()); + } + + return selectorsGroup; + } + + /** + * Check if token is a namespace sign (`|`) + * @param {Number} i Token's index number + * @return {Number} `1` if token is `|`, `0` if not + */ + function checkNamespace(i) { + return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0; + } + + /** + * Get node with a namespace sign + * @return {Node} + */ + function getNamespace() { + var type = NodeType.NamespaceType; + var token = tokens[pos++]; + var line = token.ln; + var column = token.col; + var content = '|'; + + return newNode(type, content, line, column); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkNmName2(i) { + if (tokens[i].type === TokenType.Identifier) return 1;else if (tokens[i].type !== TokenType.DecimalNumber) return 0; + + i++; + + return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1; + } + + /** + * @return {String} + */ + function getNmName2() { + var s = tokens[pos].value; + + if (tokens[pos++].type === TokenType.DecimalNumber && pos < tokensLength && tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value; + + return s; + } + + /** + * Check if token is part of a number + * @param {Number} i Token's index number + * @return {Number} Length of number + */ + function checkNumber(i) { + if (i >= tokensLength) return 0; + + if (tokens[i].number_l) return tokens[i].number_l; + + // `10`: + if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && (!tokens[i + 1] || tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop)) { + tokens[i].number_l = 1; + return 1; + } + + // `10.`: + if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && (!tokens[i + 2] || tokens[i + 2].type !== TokenType.DecimalNumber)) { + tokens[i].number_l = 2; + return 2; + } + + // `.10`: + if (i < tokensLength && tokens[i].type === TokenType.FullStop && tokens[i + 1].type === TokenType.DecimalNumber) { + tokens[i].number_l = 2; + return 2; + } + + // `10.10`: + if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) { + tokens[i].number_l = 3; + return 3; + } + + return 0; + } + + /** + * Get node with number + * @return {Node} + */ + function getNumber() { + var type = NodeType.NumberType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = ''; + var l = tokens[pos].number_l; + + for (var j = 0; j < l; j++) { + content += tokens[pos + j].value; + } + + pos += l; + + return newNode(type, content, line, column); + } + + /** + * Check if token is an operator (`/`, `,`, `:` or `=`). + * @param {Number} i Token's index number + * @return {Number} `1` if token is an operator, otherwise `0` + */ + function checkOperator(i) { + if (i >= tokensLength) return 0; + + switch (tokens[i].type) { + case TokenType.Solidus: + case TokenType.Comma: + case TokenType.Colon: + case TokenType.EqualsSign: + return 1; + } + + return 0; + } + + /** + * Get node with an operator + * @return {Node} + */ + function getOperator() { + var type = NodeType.OperatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = token.value; + + pos++; + + return newNode(type, content, line, column); + } + + /** + * Check if token is part of text inside parentheses, e.g. `(1)` + * @param {Number} i Token's index number + * @return {Number} + */ + function checkParentheses(i) { + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + return tokens[i].right - i + 1; + } + + /** + * Get node with text inside parentheses, e.g. `(1)` + * @return {Node} + */ + function getParentheses() { + var type = NodeType.ParenthesesType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + + pos++; + + var tsets = getTsets(); + var end = getLastPosition(tsets, line, column, 1); + pos++; + + return newNode(type, tsets, line, column, end); + } + + /** + * Check if token is part of a number with percent sign (e.g. `10%`) + * @param {Number} i Token's index number + * @return {Number} + */ + function checkPercentage(i) { + var x; + + if (i >= tokensLength) return 0; + + x = checkNumber(i); + + if (!x || i + x >= tokensLength) return 0; + + return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0; + } + + /** + * Get node of number with percent sign + * @return {Node} + */ + function getPercentage() { + var type = NodeType.PercentageType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getNumber()]; + + var end = getLastPosition(content, line, column, 1); + pos++; + + return newNode(type, content, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkProgid(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6;else return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].type === TokenType.LeftParenthesis) { + tokens[start].progid_end = tokens[i].right; + i = tokens[i].right + 1; + } else return 0; + + return i - start; + } + + /** + * @return {Node} + */ + function getProgid() { + var type = NodeType.ProgidType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var progid_end = token.progid_end; + var content = joinValues(pos, progid_end); + + pos = progid_end + 1; + + return newNode(type, content, line, column); + } + + /** + * Check if token is part of a property + * @param {Number} i Token's index number + * @return {Number} Length of the property + */ + function checkProperty(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + return i - start; + } + + /** + * Get node with a property + * @return {Node} + */ + function getProperty() { + var type = NodeType.PropertyType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getIdent()]; + + return newNode(type, content, line, column); + } + + /** + * Check if token is a colon + * @param {Number} i Token's index number + * @return {Number} `1` if token is a colon, otherwise `0` + */ + function checkPropertyDelim(i) { + return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0; + } + + /** + * Get node with a colon + * @return {Node} + */ + function getPropertyDelim() { + var type = NodeType.PropertyDelimType; + var token = tokens[pos++]; + var line = token.ln; + var column = token.col; + var content = ':'; + + return newNode(type, content, line, column); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkPseudo(i) { + return checkPseudoe(i) || checkPseudoc(i); + } + + /** + * @return {Node} + */ + function getPseudo() { + if (checkPseudoe(pos)) return getPseudoe(); + if (checkPseudoc(pos)) return getPseudoc(); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkPseudoe(i) { + var l; + + if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; + + return (l = checkIdent(i)) ? l + 2 : 0; + } + + /** + * @return {Node} + */ + function getPseudoe() { + var type = NodeType.PseudoeType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + pos += 2; + + content.push(getIdent()); + + return newNode(type, content, line, column); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkPseudoc(i) { + var l; + + if (i >= tokensLength || tokens[i].type !== TokenType.Colon) return 0; + + if (l = checkPseudoClass1(i)) tokens[i].pseudoClassType = 1;else if (l = checkPseudoClass2(i)) tokens[i].pseudoClassType = 2;else if (l = checkPseudoClass3(i)) tokens[i].pseudoClassType = 3;else if (l = checkPseudoClass4(i)) tokens[i].pseudoClassType = 4;else if (l = checkPseudoClass5(i)) tokens[i].pseudoClassType = 5;else if (l = checkPseudoClass6(i)) tokens[i].pseudoClassType = 6;else return 0; + + return l; + } + + /** + * @return {Node} + */ + function getPseudoc() { + var childType = tokens[pos].pseudoClassType; + if (childType === 1) return getPseudoClass1(); + if (childType === 2) return getPseudoClass2(); + if (childType === 3) return getPseudoClass3(); + if (childType === 4) return getPseudoClass4(); + if (childType === 5) return getPseudoClass5(); + if (childType === 6) return getPseudoClass6(); + } + + /** + * (1) `:panda(selector)` + * (2) `:panda(selector, selector)` + */ + function checkPseudoClass1(i) { + var start = i; + + // Skip `:`. + i++; + + var l = undefined; + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSelectorsGroup(i)) i += l;else return 0; + + if (i !== right) return 0; + + return i - start + 1; + } + + /** + * (-) `:not(panda)` + */ + function getPseudoClass1() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + content.push(getIdent()); + + { + var _type = NodeType.ArgumentsType; + var _token = tokens[pos]; + var _line = _token.ln; + var _column = _token.col; + + // Skip `(`. + pos++; + + var selectors = getSelectorsGroup(); + var end = getLastPosition(selectors, _line, _column, 1); + var args = newNode(_type, selectors, _line, _column, end); + content.push(args); + + // Skip `)`. + pos++; + } + + return newNode(type, content, line, column); + } + + /** + * (1) `:nth-child(odd)` + * (2) `:nth-child(even)` + * (3) `:lang(de-DE)` + */ + function checkPseudoClass2(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSC(i)) i += l; + + if (l = checkIdent(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (i !== right) return 0; + + return i - start + 1; + } + + function getPseudoClass2() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + // Skip `(`. + pos++; + + var l = tokens[pos].ln; + var c = tokens[pos].col; + var value = []; + + value = value.concat(getSC()); + value.push(getIdent()); + value = value.concat(getSC()); + + var end = getLastPosition(value, l, c, 1); + var args = newNode(NodeType.ArgumentsType, value, l, c, end); + content.push(args); + + // Skip `)`. + pos++; + + return newNode(type, content, line, column); + } + + /** + * (-) `:nth-child(-3n + 2)` + */ + function checkPseudoClass3(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSC(i)) i += l; + + if (l = checkUnary(i)) i += l; + if (i >= tokensLength) return 0; + if (tokens[i].type === TokenType.DecimalNumber) i++; + + if (i >= tokensLength) return 0; + if (tokens[i].value === 'n') i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (i >= tokensLength) return 0; + if (tokens[i].value === '+' || tokens[i].value === '-') i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].type === TokenType.DecimalNumber) i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (i !== right) return 0; + + return i - start + 1; + } + + function getPseudoClass3() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + var l = tokens[pos].ln; + var c = tokens[pos].col; + var value = []; + + // Skip `(`. + pos++; + + if (checkUnary(pos)) value.push(getUnary()); + if (checkNumber(pos)) value.push(getNumber()); + + { + var _l = tokens[pos].ln; + var _c = tokens[pos].col; + var _content = tokens[pos].value; + var _ident = newNode(NodeType.IdentType, _content, _l, _c); + value.push(_ident); + pos++; + } + + value = value.concat(getSC()); + if (checkUnary(pos)) value.push(getUnary()); + value = value.concat(getSC()); + if (checkNumber(pos)) value.push(getNumber()); + value = value.concat(getSC()); + + var end = getLastPosition(value, l, c, 1); + var args = newNode(NodeType.ArgumentsType, value, l, c, end); + content.push(args); + + // Skip `)`. + pos++; + + return newNode(type, content, line, column); + } + + /** + * (-) `:nth-child(-3n)` + */ + function checkPseudoClass4(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength) return 0; + if (tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSC(i)) i += l; + + if (l = checkUnary(i)) i += l; + if (tokens[i].type === TokenType.DecimalNumber) i++; + + if (tokens[i].value === 'n') i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (i !== right) return 0; + + return i - start + 1; + } + + function getPseudoClass4() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + // Skip `(`. + pos++; + + var l = tokens[pos].ln; + var c = tokens[pos].col; + var value = []; + + if (checkUnary(pos)) value.push(getUnary()); + if (checkNumber(pos)) value.push(getNumber()); + if (checkIdent(pos)) value.push(getIdent()); + value = value.concat(getSC()); + + var end = getLastPosition(value, l, c, 1); + var args = newNode(NodeType.ArgumentsType, value, l, c, end); + content.push(args); + + // Skip `)`. + pos++; + + return newNode(type, content, line, column); + } + + /** + * (-) `:nth-child(+8)` + */ + function checkPseudoClass5(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength) return 0; + if (tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSC(i)) i += l; + + if (l = checkUnary(i)) i += l; + if (tokens[i].type === TokenType.DecimalNumber) i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (i !== right) return 0; + + return i - start + 1; + } + + function getPseudoClass5() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + // Skip `(`. + pos++; + + var l = tokens[pos].ln; + var c = tokens[pos].col; + var value = []; + + if (checkUnary(pos)) value.push(getUnary()); + if (checkNumber(pos)) value.push(getNumber()); + value = value.concat(getSC()); + + var end = getLastPosition(value, l, c, 1); + var args = newNode(NodeType.ArgumentsType, value, l, c, end); + content.push(args); + + // Skip `)`. + pos++; + + return newNode(type, content, line, column); + } + + /** + * (-) `:checked` + */ + function checkPseudoClass6(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + return i - start; + } + + function getPseudoClass6() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + return newNode(type, content, line, column); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkRuleset(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkSelectorsGroup(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkBlock(i)) i += l;else return 0; + + return i - start; + } + + /** + * @return {Node} + */ + function getRuleset() { + var type = NodeType.RulesetType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + content = content.concat(getSelectorsGroup()); + content = content.concat(getSC()); + content.push(getBlock()); + + return newNode(type, content, line, column); + } + + /** + * Check if token is marked as a space (if it's a space or a tab + * or a line break). + * @param {Number} i + * @return {Number} Number of spaces in a row starting with the given token. + */ + function checkS(i) { + return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0; + } + + /** + * Get node with spaces + * @return {Node} + */ + function getS() { + var type = NodeType.SType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = joinValues(pos, tokens[pos].ws_last); + + pos = tokens[pos].ws_last + 1; + + return newNode(type, content, line, column); + } + + /** + * Check if token is a space or a comment. + * @param {Number} i Token's index number + * @return {Number} Number of similar (space or comment) tokens + * in a row starting with the given token. + */ + function checkSC(i) { + var l = undefined; + var lsc = 0; + + while (i < tokensLength) { + if (l = checkS(i)) tokens[i].sc_child = 1;else if (l = checkCommentML(i)) tokens[i].sc_child = 2;else break; + i += l; + lsc += l; + } + + return lsc || 0; + } + + /** + * Get node with spaces and comments + * @return {Array} + */ + function getSC() { + var sc = []; + + if (pos >= tokensLength) return sc; + + while (pos < tokensLength) { + var childType = tokens[pos].sc_child; + if (childType === 1) sc.push(getS());else if (childType === 2) sc.push(getCommentML());else break; + } + + return sc; + } + + /** + * Check if token is part of a hexadecimal number (e.g. `#fff`) inside + * a simple selector + * @param {Number} i Token's index number + * @return {Number} + */ + function checkShash(i) { + var l; + + if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; + + return (l = checkIdent(i + 1)) ? l + 1 : 0; + } + + /** + * Get node with a hexadecimal number (e.g. `#fff`) inside a simple + * selector + * @return {Node} + */ + function getShash() { + var type = NodeType.ShashType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + pos++; + + var ident = getIdent(); + content.push(ident); + + return newNode(type, content, line, column); + } + + /** + * Check if token is part of a string (text wrapped in quotes) + * @param {Number} i Token's index number + * @return {Number} `1` if token is part of a string, `0` if not + */ + function checkString(i) { + if (i >= tokensLength) { + return 0; + } + + if (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) { + return 1; + } + + return 0; + } + + /** + * Get string's node + * @return {Array} `['string', x]` where `x` is a string (including + * quotes). + */ + function getString() { + var type = NodeType.StringType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = token.value; + + pos++; + + return newNode(type, content, line, column); + } + + /** + * Validate stylesheet: it should consist of any number (0 or more) of + * rulesets (sets of rules with selectors), @-rules, whitespaces or + * comments. + * @param {Number} i Token's index number + * @return {Number} + */ + function checkStylesheet(i) { + var start = i; + var l = undefined; + + // Check every token: + while (i < tokensLength) { + if (l = checkSC(i)) tokens[i].stylesheet_child = 1;else if (l = checkRuleset(i)) tokens[i].stylesheet_child = 2;else if (l = checkAtrule(i)) tokens[i].stylesheet_child = 3;else if (l = checkDeclDelim(i)) tokens[i].stylesheet_child = 4;else throwError(i); + + i += l; + } + + return i - start; + } + + /** + * @return {Array} `['stylesheet', x]` where `x` is all stylesheet's + * nodes. + */ + function getStylesheet() { + var type = NodeType.StylesheetType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + var childType = undefined; + + while (pos < tokensLength) { + childType = tokens[pos].stylesheet_child; + if (childType === 1) content = content.concat(getSC());else if (childType === 2) content.push(getRuleset());else if (childType === 3) content.push(getAtrule());else if (childType === 4) content.push(getDeclDelim()); + } + + return newNode(type, content, line, column); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkTset(i) { + var l; + + if (l = checkVhash(i)) tokens[i].tset_child = 1;else if (l = checkAny(i)) tokens[i].tset_child = 2;else if (l = checkSC(i)) tokens[i].tset_child = 3;else if (l = checkOperator(i)) tokens[i].tset_child = 4; + + return l; + } + + /** + * @return {Array} + */ + function getTset() { + var childType = tokens[pos].tset_child; + if (childType === 1) return getVhash();else if (childType === 2) return getAny();else if (childType === 3) return getSC();else if (childType === 4) return getOperator(); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkTsets(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + while (l = checkTset(i)) { + i += l; + } + + return i - start; + } + + /** + * @return {Array} + */ + function getTsets() { + var x = []; + var t = undefined; + + while (checkTset(pos)) { + t = getTset(); + if (typeof t.content === 'string') x.push(t);else x = x.concat(t); + } + + return x; + } + + /** + * Check if token is an unary (arithmetical) sign (`+` or `-`) + * @param {Number} i Token's index number + * @return {Number} `1` if token is an unary sign, `0` if not + */ + function checkUnary(i) { + if (i >= tokensLength) { + return 0; + } + + if (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) { + return 1; + } + + return 0; + } + + /** + * Get node with an unary (arithmetical) sign (`+` or `-`) + * @return {Array} `['unary', x]` where `x` is an unary sign + * converted to string. + */ + function getUnary() { + var type = NodeType.OperatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = token.value; + + pos++; + + return newNode(type, content, line, column); + } + + /** + * Check if token is a unicode range (single or multiple nodes) + * @param {number} i Token's index + * @return {number} Unicode range node's length + */ + function checkUnicodeRange(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkUrange(i)) i += l;else return 0; + + while (i < tokensLength) { + var spaceBefore = checkSC(i); + var comma = checkDelim(i + spaceBefore); + if (!comma) break; + + var spaceAfter = checkSC(i + spaceBefore + comma); + if (l = checkUrange(i + spaceBefore + comma + spaceAfter)) { + i += spaceBefore + comma + spaceAfter + l; + } else break; + } + + return i - start; + } + + /** + * Get a unicode range node + * @return {Node} + */ + function getUnicodeRange() { + var type = NodeType.UnicodeRangeType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + while (pos < tokensLength) { + if (checkSC(pos)) content = content.concat(getSC());else if (checkDelim(pos)) content.push(getDelim());else if (checkUrange(pos)) content.push(getUrange());else break; + } + + return newNode(type, content, line, column); + } + + /** + * Check if token is a u-range (part of a unicode-range) + * (1) `U+416` + * (2) `U+400-4ff` + * (3) `U+4??` + * @param {number} i Token's index + * @return {number} Urange node's length + */ + function checkUrange(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + // Check for unicode prefix (u+ or U+) + if (tokens[i].value === 'U' || tokens[i].value === 'u') i += 1;else return 0; + + if (i >= tokensLength) return 0; + + if (tokens[i].value === '+') i += 1;else return 0; + + while (i < tokensLength) { + if (l = checkIdent(i)) i += l;else if (l = checkNumber(i)) i += l;else if (l = checkUnary(i)) i += l;else if (l = _checkUnicodeWildcard(i)) i += l;else break; + } + + tokens[start].urangeEnd = i - 1; + + return i - start; + } + + /** + * Get a u-range node (part of a unicode-range) + * @return {Node} + */ + function getUrange() { + var startPos = pos; + var type = NodeType.UrangeType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + content = joinValues(startPos, tokens[startPos].urangeEnd); + pos = tokens[startPos].urangeEnd + 1; + + return newNode(type, content, line, column); + } + + /** + * Check for unicode wildcard characters `?` + * @param {number} i Token's index + * @return {number} Wildcard length + */ + function _checkUnicodeWildcard(i) { + var start = i; + + if (i >= tokensLength) return 0; + + while (i < tokensLength) { + if (tokens[i].type === TokenType.QuestionMark) i += 1;else break; + } + + return i - start; + } + + /** + * Check if token is part of URI (e.g. `url('/css/styles.css')`) + * @param {Number} i Token's index number + * @return {Number} Length of URI + */ + function checkUri(i) { + var start = i; + + if (i >= tokensLength || tokens[i].value !== 'url') return 0; + i += 1; + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + return tokens[i].right - start + 1; + } + + /** + * Get node with URI + * @return {Array} `['uri', x]` where `x` is URI's nodes (without `url` + * and braces, e.g. `['string', ''/css/styles.css'']`). + */ + function getUri() { + var startPos = pos; + var uriExcluding = {}; + var uri = undefined; + var l = undefined; + var raw = undefined; + + var rawContent = undefined; + var t = undefined; + + pos += 2; + + uriExcluding[TokenType.Space] = 1; + uriExcluding[TokenType.Tab] = 1; + uriExcluding[TokenType.Newline] = 1; + uriExcluding[TokenType.LeftParenthesis] = 1; + uriExcluding[TokenType.RightParenthesis] = 1; + + if (checkUri1(pos)) { + uri = [].concat(getSC()).concat([getString()]).concat(getSC()); + } else { + uri = checkSC(pos) ? getSC() : []; + l = checkExcluding(uriExcluding, pos); + rawContent = joinValues(pos, pos + l); + t = tokens[pos]; + raw = newNode(NodeType.RawType, rawContent, t.ln, t.col); + + uri.push(raw); + + pos += l + 1; + + if (checkSC(pos)) uri = uri.concat(getSC()); + } + + t = tokens[startPos]; + var line = t.ln; + var column = t.col; + var end = getLastPosition(uri, line, column, 1); + pos++; + + return newNode(NodeType.UriType, uri, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function checkUri1(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0; + + i++; + + if (l = checkSC(i)) i += l; + + return i - start; + } + + /** + * Check if token is part of a value + * @param {Number} i Token's index number + * @return {Number} Length of the value + */ + function checkValue(i) { + var start = i; + var l = undefined; + var s = undefined; + var _i = undefined; + + while (i < tokensLength) { + s = checkSC(i); + _i = i + s; + + if (l = _checkValue(_i)) i += l + s;else break; + } + + tokens[start].value_end = i; + return i - start; + } + + /** + * @return {Array} + */ + function getValue() { + var startPos = pos; + var end = tokens[pos].value_end; + var x = []; + + while (pos < end) { + if (tokens[pos].value_child) x.push(_getValue());else x = x.concat(getSC()); + } + + var t = tokens[startPos]; + return newNode(NodeType.ValueType, x, t.ln, t.col); + } + + /** + * @param {Number} i Token's index number + * @return {Number} + */ + function _checkValue(i) { + var l; + + if (l = checkProgid(i)) tokens[i].value_child = 1;else if (l = checkVhash(i)) tokens[i].value_child = 2;else if (l = checkAny(i)) tokens[i].value_child = 3;else if (l = checkOperator(i)) tokens[i].value_child = 4;else if (l = checkImportant(i)) tokens[i].value_child = 5; + + return l; + } + + /** + * @return {Array} + */ + function _getValue() { + var childType = tokens[pos].value_child; + if (childType === 1) return getProgid();else if (childType === 2) return getVhash();else if (childType === 3) return getAny();else if (childType === 4) return getOperator();else if (childType === 5) return getImportant(); + } + + /** + * Check if token is part of a hexadecimal number (e.g. `#fff`) inside + * some value + * @param {Number} i Token's index number + * @return {Number} + */ + function checkVhash(i) { + var l; + + if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; + + return (l = checkNmName2(i + 1)) ? l + 1 : 0; + } + + /** + * Get node with a hexadecimal number (e.g. `#fff`) inside some value + * @return {Array} `['vhash', x]` where `x` is a hexadecimal number + * converted to string (without `#`, e.g. `'fff'`). + */ + function getVhash() { + var type = NodeType.VhashType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = undefined; + + pos++; + + content = getNmName2(); + var end = getLastPosition(content, line, column + 1); + return newNode(type, content, line, column, end); + } + + module.exports = function (_tokens, context) { + tokens = _tokens; + tokensLength = tokens.length; + pos = 0; + + return contexts[context](); + }; + + function checkSelectorsGroup(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + if (l = checkSelector(i)) i += l;else return 0; + + while (i < tokensLength) { + var sb = checkSC(i); + var c = checkDelim(i + sb); + if (!c) break; + var sa = checkSC(i + sb + c); + if (l = checkSelector(i + sb + c + sa)) i += sb + c + sa + l;else break; + } + + tokens[start].selectorsGroupEnd = i; + return i - start; + } + + function getSelectorsGroup() { + var selectorsGroup = []; + var selectorsGroupEnd = tokens[pos].selectorsGroupEnd; + + selectorsGroup.push(getSelector()); + + while (pos < selectorsGroupEnd) { + selectorsGroup = selectorsGroup.concat(getSC()); + selectorsGroup.push(getDelim()); + selectorsGroup = selectorsGroup.concat(getSC()); + selectorsGroup.push(getSelector()); + } + + return selectorsGroup; + } + + function checkSelector(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + if (l = checkCompoundSelector(i)) i += l;else return 0; + + while (i < tokensLength) { + var sb = checkSC(i); + var c = checkCombinator(i + sb); + if (!sb && !c) break; + var sa = checkSC(i + sb + c); + if (l = checkCompoundSelector(i + sb + c + sa)) i += sb + c + sa + l;else break; + } + + tokens[start].selectorEnd = i; + return i - start; + } + + function getSelector() { + var type = NodeType.SelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var selectorEnd = token.selectorEnd; + var content = undefined; + + content = getCompoundSelector(); + + while (pos < selectorEnd) { + content = content.concat(getSC()); + if (checkCombinator(pos)) content.push(getCombinator()); + content = content.concat(getSC()); + content = content.concat(getCompoundSelector()); + } + + return newNode(type, content, line, column); + } + + function checkCompoundSelector(i) { + var l = undefined; + + if (l = checkCompoundSelector1(i)) { + tokens[i].compoundSelectorType = 1; + } else if (l = checkCompoundSelector2(i)) { + tokens[i].compoundSelectorType = 2; + } + + return l; + } + + function getCompoundSelector() { + var type = tokens[pos].compoundSelectorType; + if (type === 1) return getCompoundSelector1(); + if (type === 2) return getCompoundSelector2(); + } + + function checkCompoundSelector1(i) { + if (i >= tokensLength) return 0; + + var start = i; + + var l = undefined; + if (l = checkTypeSelector(i)) i += l;else return 0; + + while (i < tokensLength) { + var _l2 = checkShash(i) || checkClass(i) || checkAttributeSelector(i) || checkPseudo(i); + if (_l2) i += _l2;else break; + } + + tokens[start].compoundSelectorEnd = i; + + return i - start; + } + + function getCompoundSelector1() { + var sequence = []; + var compoundSelectorEnd = tokens[pos].compoundSelectorEnd; + + sequence.push(getTypeSelector()); + + while (pos < compoundSelectorEnd) { + if (checkShash(pos)) sequence.push(getShash());else if (checkClass(pos)) sequence.push(getClass());else if (checkAttributeSelector(pos)) sequence.push(getAttributeSelector());else if (checkPseudo(pos)) sequence.push(getPseudo()); + } + + return sequence; + } + + function checkCompoundSelector2(i) { + if (i >= tokensLength) return 0; + + var start = i; + + while (i < tokensLength) { + var l = checkShash(i) || checkClass(i) || checkAttributeSelector(i) || checkPseudo(i); + if (l) i += l;else break; + } + + tokens[start].compoundSelectorEnd = i; + + return i - start; + } + + function getCompoundSelector2() { + var sequence = []; + var compoundSelectorEnd = tokens[pos].compoundSelectorEnd; + + while (pos < compoundSelectorEnd) { + if (checkShash(pos)) sequence.push(getShash());else if (checkClass(pos)) sequence.push(getClass());else if (checkAttributeSelector(pos)) sequence.push(getAttributeSelector());else if (checkPseudo(pos)) sequence.push(getPseudo()); + } + + return sequence; + } + + function checkTypeSelector(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + if (l = checkNamePrefix(i)) i += l; + + if (tokens[i].type === TokenType.Asterisk) i++;else if (l = checkIdent(i)) i += l;else return 0; + + return i - start; + } + + function getTypeSelector() { + var type = NodeType.TypeSelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (checkNamePrefix(pos)) content.push(getNamePrefix()); + + token = tokens[pos]; + if (token.type === TokenType.Asterisk) { + var asteriskNode = newNode(NodeType.IdentType, '*', token.ln, token.col); + content.push(asteriskNode); + pos++; + } else if (checkIdent(pos)) content.push(getIdent()); + + return newNode(type, content, line, column); + } + + function checkAttributeSelector(i) { + var l = undefined; + if (l = checkAttributeSelector1(i)) tokens[i].attributeSelectorType = 1;else if (l = checkAttributeSelector2(i)) tokens[i].attributeSelectorType = 2; + + return l; + } + + function getAttributeSelector() { + var type = tokens[pos].attributeSelectorType; + if (type === 1) return getAttributeSelector1();else return getAttributeSelector2(); + } + + /** + * (1) `[panda=nani]` + * (2) `[panda='nani']` + * (3) `[panda='nani' i]` + * + */ + function checkAttributeSelector1(i) { + var start = i; + + if (tokens[i].type === TokenType.LeftSquareBracket) i++;else return 0; + + var l = undefined; + if (l = checkSC(i)) i += l; + + if (l = checkAttributeName(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkAttributeMatch(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkAttributeValue(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkAttributeFlags(i)) { + i += l; + if (l = checkSC(i)) i += l; + } + + if (tokens[i].type === TokenType.RightSquareBracket) i++;else return 0; + + return i - start; + } + + function getAttributeSelector1() { + var type = NodeType.AttributeSelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `[`. + pos++; + + content = content.concat(getSC()); + content.push(getAttributeName()); + content = content.concat(getSC()); + content.push(getAttributeMatch()); + content = content.concat(getSC()); + content.push(getAttributeValue()); + content = content.concat(getSC()); + + if (checkAttributeFlags(pos)) { + content.push(getAttributeFlags()); + content = content.concat(getSC()); + } + + // Skip `]`. + pos++; + + var end = getLastPosition(content, line, column, 1); + return newNode(type, content, line, column, end); + } + + /** + * (1) `[panda]` + */ + function checkAttributeSelector2(i) { + var start = i; + + if (tokens[i].type === TokenType.LeftSquareBracket) i++;else return 0; + + var l = undefined; + if (l = checkSC(i)) i += l; + + if (l = checkAttributeName(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].type === TokenType.RightSquareBracket) i++;else return 0; + + return i - start; + } + + function getAttributeSelector2() { + var type = NodeType.AttributeSelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `[`. + pos++; + + content = content.concat(getSC()); + content.push(getAttributeName()); + content = content.concat(getSC()); + + // Skip `]`. + pos++; + + var end = getLastPosition(content, line, column, 1); + return newNode(type, content, line, column, end); + } + + function checkAttributeName(i) { + var start = i; + var l = undefined; + + if (l = checkNamePrefix(i)) i += l; + + if (l = checkIdent(i)) i += l;else return 0; + + return i - start; + } + + function getAttributeName() { + var type = NodeType.AttributeNameType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (checkNamePrefix(pos)) content.push(getNamePrefix()); + content.push(getIdent()); + + return newNode(type, content, line, column); + } + + function checkAttributeMatch(i) { + var l = undefined; + if (l = checkAttributeMatch1(i)) tokens[i].attributeMatchType = 1;else if (l = checkAttributeMatch2(i)) tokens[i].attributeMatchType = 2; + + return l; + } + + function getAttributeMatch() { + var type = tokens[pos].attributeMatchType; + if (type === 1) return getAttributeMatch1();else return getAttributeMatch2(); + } + + function checkAttributeMatch1(i) { + var start = i; + + var type = tokens[i].type; + if (type === TokenType.Tilde || type === TokenType.VerticalLine || type === TokenType.CircumflexAccent || type === TokenType.DollarSign || type === TokenType.Asterisk) i++;else return 0; + + if (tokens[i].type === TokenType.EqualsSign) i++;else return 0; + + return i - start; + } + + function getAttributeMatch1() { + var type = NodeType.AttributeMatchType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = tokens[pos].value + tokens[pos + 1].value; + pos += 2; + + return newNode(type, content, line, column); + } + + function checkAttributeMatch2(i) { + if (tokens[i].type === TokenType.EqualsSign) return 1;else return 0; + } + + function getAttributeMatch2() { + var type = NodeType.AttributeMatchType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = '='; + + pos++; + return newNode(type, content, line, column); + } + + function checkAttributeValue(i) { + return checkString(i) || checkIdent(i); + } + + function getAttributeValue() { + var type = NodeType.AttributeValueType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (checkString(pos)) content.push(getString());else content.push(getIdent()); + + return newNode(type, content, line, column); + } + + function checkAttributeFlags(i) { + return checkIdent(i); + } + + function getAttributeFlags() { + var type = NodeType.AttributeFlagsType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getIdent()]; + + return newNode(type, content, line, column); + } + + function checkNamePrefix(i) { + if (i >= tokensLength) return 0; + + var l = undefined; + if (l = checkNamePrefix1(i)) tokens[i].namePrefixType = 1;else if (l = checkNamePrefix2(i)) tokens[i].namePrefixType = 2; + + return l; + } + + function getNamePrefix() { + var type = tokens[pos].namePrefixType; + if (type === 1) return getNamePrefix1();else return getNamePrefix2(); + } + + /** + * (1) `panda|` + * (2) `panda|` + */ + function checkNamePrefix1(i) { + var start = i; + var l = undefined; + + if (l = checkNamespacePrefix(i)) i += l;else return 0; + + if (l = checkCommentML(i)) i += l; + + if (l = checkNamespaceSeparator(i)) i += l;else return 0; + + return i - start; + } + + function getNamePrefix1() { + var type = NodeType.NamePrefixType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + content.push(getNamespacePrefix()); + + if (checkCommentML(pos)) content.push(getCommentML()); + + content.push(getNamespaceSeparator()); + + return newNode(type, content, line, column); + } + + /** + * (1) `|` + */ + function checkNamePrefix2(i) { + return checkNamespaceSeparator(i); + } + + function getNamePrefix2() { + var type = NodeType.NamePrefixType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getNamespaceSeparator()]; + + return newNode(type, content, line, column); + } + + /** + * (1) `*` + * (2) `panda` + */ + function checkNamespacePrefix(i) { + if (i >= tokensLength) return 0; + + var l = undefined; + + if (tokens[i].type === TokenType.Asterisk) return 1;else if (l = checkIdent(i)) return l;else return 0; + } + + function getNamespacePrefix() { + var type = NodeType.NamespacePrefixType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (tokens[pos].type === TokenType.Asterisk) { + var asteriskNode = newNode(NodeType.IdentType, '*', line, column); + content.push(asteriskNode); + pos++; + } else if (checkIdent(pos)) content.push(getIdent()); + + return newNode(type, content, line, column); + } + + /** + * (1) `|` + */ + function checkNamespaceSeparator(i) { + if (i >= tokensLength) return 0; + + if (tokens[i].type !== TokenType.VerticalLine) return 0; + + // Return false if `|=` - [attr|=value] + if (tokens[i + 1] && tokens[i + 1].type === TokenType.EqualsSign) return 0; + + return 1; + } + + function getNamespaceSeparator() { + var type = NodeType.NamespaceSeparatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = '|'; + + pos++; + return newNode(type, content, line, column); + } + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + 'use strict'; + + module.exports = { + ArgumentsType: 'arguments', + AtkeywordType: 'atkeyword', + AtruleType: 'atrule', + AttributeSelectorType: 'attributeSelector', + AttributeNameType: 'attributeName', + AttributeFlagsType: 'attributeFlags', + AttributeMatchType: 'attributeMatch', + AttributeValueType: 'attributeValue', + BlockType: 'block', + BracketsType: 'brackets', + ClassType: 'class', + CombinatorType: 'combinator', + CommentMLType: 'multilineComment', + CommentSLType: 'singlelineComment', + ConditionType: 'condition', + ConditionalStatementType: 'conditionalStatement', + DeclarationType: 'declaration', + DeclDelimType: 'declarationDelimiter', + DefaultType: 'default', + DelimType: 'delimiter', + DimensionType: 'dimension', + EscapedStringType: 'escapedString', + ExtendType: 'extend', + ExpressionType: 'expression', + FunctionType: 'function', + GlobalType: 'global', + IdentType: 'ident', + ImportantType: 'important', + IncludeType: 'include', + InterpolationType: 'interpolation', + InterpolatedVariableType: 'interpolatedVariable', + KeyframesSelectorType: 'keyframesSelector', + LoopType: 'loop', + MixinType: 'mixin', + NamePrefixType: 'namePrefix', + NamespacePrefixType: 'namespacePrefix', + NamespaceSeparatorType: 'namespaceSeparator', + NumberType: 'number', + OperatorType: 'operator', + OptionalType: 'optional', + ParenthesesType: 'parentheses', + ParentSelectorType: 'parentSelector', + ParentSelectorExtensionType: 'parentSelectorExtension', + PercentageType: 'percentage', + PlaceholderType: 'placeholder', + ProgidType: 'progid', + PropertyType: 'property', + PropertyDelimType: 'propertyDelimiter', + PseudocType: 'pseudoClass', + PseudoeType: 'pseudoElement', + RawType: 'raw', + RulesetType: 'ruleset', + SType: 'space', + SelectorType: 'selector', + ShashType: 'id', + StringType: 'string', + StylesheetType: 'stylesheet', + TypeSelectorType: 'typeSelector', + UnicodeRangeType: 'unicodeRange', + UriType: 'uri', + UrangeType: 'urange', + ValueType: 'value', + VariableType: 'variable', + VariablesListType: 'variablesList', + VhashType: 'color' + }; + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = function (css, tabSize) { + var TokenType = __webpack_require__(13); + + var tokens = []; + var urlMode = false; + var blockMode = 0; + var pos = 0; + var tn = 0; + var ln = 1; + var col = 1; + var cssLength = 0; + + var Punctuation = { + ' ': TokenType.Space, + '\n': TokenType.Newline, + '\r': TokenType.Newline, + '\t': TokenType.Tab, + '!': TokenType.ExclamationMark, + '"': TokenType.QuotationMark, + '#': TokenType.NumberSign, + '$': TokenType.DollarSign, + '%': TokenType.PercentSign, + '&': TokenType.Ampersand, + '\'': TokenType.Apostrophe, + '(': TokenType.LeftParenthesis, + ')': TokenType.RightParenthesis, + '*': TokenType.Asterisk, + '+': TokenType.PlusSign, + ',': TokenType.Comma, + '-': TokenType.HyphenMinus, + '.': TokenType.FullStop, + '/': TokenType.Solidus, + ':': TokenType.Colon, + ';': TokenType.Semicolon, + '<': TokenType.LessThanSign, + '=': TokenType.EqualsSign, + '>': TokenType.GreaterThanSign, + '?': TokenType.QuestionMark, + '@': TokenType.CommercialAt, + '[': TokenType.LeftSquareBracket, + ']': TokenType.RightSquareBracket, + '^': TokenType.CircumflexAccent, + '_': TokenType.LowLine, + '{': TokenType.LeftCurlyBracket, + '|': TokenType.VerticalLine, + '}': TokenType.RightCurlyBracket, + '~': TokenType.Tilde + }; + + /** + * Add a token to the token list + * @param {string} type + * @param {string} value + */ + function pushToken(type, value, column) { + tokens.push({ + tn: tn++, + ln: ln, + col: column, + type: type, + value: value + }); + } + + /** + * Check if a character is a decimal digit + * @param {string} c Character + * @returns {boolean} + */ + function isDecimalDigit(c) { + return '0123456789'.indexOf(c) >= 0; + } + + /** + * Parse spaces + * @param {string} css Unparsed part of CSS string + */ + function parseSpaces(css) { + var start = pos; + + // Read the string until we meet a non-space character: + for (; pos < cssLength; pos++) { + if (css.charAt(pos) !== ' ') break; + } + + // Add a substring containing only spaces to tokens: + pushToken(TokenType.Space, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Parse a string within quotes + * @param {string} css Unparsed part of CSS string + * @param {string} q Quote (either `'` or `"`) + */ + function parseString(css, q) { + var start = pos; + + // Read the string until we meet a matching quote: + for (pos++; pos < cssLength; pos++) { + // Skip escaped quotes: + if (css.charAt(pos) === '\\') pos++;else if (css.charAt(pos) === q) break; + } + + // Add the string (including quotes) to tokens: + pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1), col); + col += pos - start; + } + + /** + * Parse numbers + * @param {string} css Unparsed part of CSS string + */ + function parseDecimalNumber(css) { + var start = pos; + + // Read the string until we meet a character that's not a digit: + for (; pos < cssLength; pos++) { + if (!isDecimalDigit(css.charAt(pos))) break; + } + + // Add the number to tokens: + pushToken(TokenType.DecimalNumber, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Parse identifier + * @param {string} css Unparsed part of CSS string + */ + function parseIdentifier(css) { + var start = pos; + + // Skip all opening slashes: + while (css.charAt(pos) === '/') pos++; + + // Read the string until we meet a punctuation mark: + for (; pos < cssLength; pos++) { + // Skip all '\': + if (css.charAt(pos) === '\\') pos++;else if (Punctuation[css.charAt(pos)]) break; + } + + var ident = css.substring(start, pos--); + + // Enter url mode if parsed substring is `url`: + urlMode = urlMode || ident === 'url'; + + // Add identifier to tokens: + pushToken(TokenType.Identifier, ident, col); + col += pos - start; + } + + /** + * Parse a multiline comment + * @param {string} css Unparsed part of CSS string + */ + function parseMLComment(css) { + var start = pos; + + // Read the string until we meet `*/`. + // Since we already know first 2 characters (`/*`), start reading + // from `pos + 2`: + for (pos = pos + 2; pos < cssLength; pos++) { + if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') { + pos++; + break; + } + } + + // Add full comment (including `/*` and `*/`) to the list of tokens: + var comment = css.substring(start, pos + 1); + pushToken(TokenType.CommentML, comment, col); + + var newlines = comment.split('\n'); + if (newlines.length > 1) { + ln += newlines.length - 1; + col = newlines[newlines.length - 1].length; + } else { + col += pos - start; + } + } + + function parseSLComment(css) { + var start = pos; + + // Read the string until we meet line break. + // Since we already know first 2 characters (`//`), start reading + // from `pos + 2`: + for (pos += 2; pos < cssLength; pos++) { + if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { + break; + } + } + + // Add comment (including `//` and line break) to the list of tokens: + pushToken(TokenType.CommentSL, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Convert a CSS string to a list of tokens + * @param {string} css CSS string + * @returns {Array} List of tokens + * @private + */ + function getTokens(css) { + var c; // Current character + var cn; // Next character + + cssLength = css.length; + + // Parse string, character by character: + for (pos = 0; pos < cssLength; col++, pos++) { + c = css.charAt(pos); + cn = css.charAt(pos + 1); + + // If we meet `/*`, it's a start of a multiline comment. + // Parse following characters as a multiline comment: + if (c === '/' && cn === '*') { + parseMLComment(css); + } + + // If we meet `//` and it is not a part of url: + else if (!urlMode && c === '/' && cn === '/') { + // If we're currently inside a block, treat `//` as a start + // of identifier. Else treat `//` as a start of a single-line + // comment: + if (blockMode > 0) parseIdentifier(css);else parseSLComment(css); + } + + // If current character is a double or single quote, it's a start + // of a string: + else if (c === '"' || c === "'") { + parseString(css, c); + } + + // If current character is a space: + else if (c === ' ') { + parseSpaces(css); + } + + // If current character is a punctuation mark: + else if (Punctuation[c]) { + // Add it to the list of tokens: + pushToken(Punctuation[c], c, col); + if (c === '\n' || c === '\r') { + ln++; + col = 0; + } // Go to next line + else if (c === ')') urlMode = false; // Exit url mode + else if (c === '{') blockMode++; // Enter a block + else if (c === '}') blockMode--; // Exit a block + else if (c === '\t' && tabSize > 1) col += tabSize - 1; + } + + // If current character is a decimal digit: + else if (isDecimalDigit(c)) { + parseDecimalNumber(css); + } + + // If current character is anything else: + else { + parseIdentifier(css); + } + } + + return tokens; + } + + return getTokens(css); + }; + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = { + mark: __webpack_require__(18), + parse: __webpack_require__(19), + stringify: __webpack_require__(4), + tokenizer: __webpack_require__(20) + }; + module.exports = exports['default']; + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var TokenType = __webpack_require__(13); + + module.exports = (function () { + /** + * Mark whitespaces and comments + */ + function markSC(tokens) { + var tokensLength = tokens.length; + var ws = -1; // Flag for whitespaces + var sc = -1; // Flag for whitespaces and comments + var t = undefined; // Current token + + // For every token in the token list, mark spaces and line breaks + // as spaces (set both `ws` and `sc` flags). Mark multiline comments + // with `sc` flag. + // If there are several spaces or tabs or line breaks or multiline + // comments in a row, group them: take the last one's index number + // and save it to the first token in the group as a reference: + // e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` + // for a group of whitespaces and comments. + for (var i = 0; i < tokensLength; i++) { + t = tokens[i]; + switch (t.type) { + case TokenType.Space: + case TokenType.Tab: + case TokenType.Newline: + t.ws = true; + t.sc = true; + + if (ws === -1) ws = i; + if (sc === -1) sc = i; + + break; + case TokenType.CommentML: + case TokenType.CommentSL: + if (ws !== -1) { + tokens[ws].ws_last = i - 1; + ws = -1; + } + + t.sc = true; + + break; + default: + if (ws !== -1) { + tokens[ws].ws_last = i - 1; + ws = -1; + } + + if (sc !== -1) { + tokens[sc].sc_last = i - 1; + sc = -1; + } + } + } + + if (ws !== -1) tokens[ws].ws_last = i - 1; + if (sc !== -1) tokens[sc].sc_last = i - 1; + } + + /** + * Pair brackets + */ + function markBrackets(tokens) { + var tokensLength = tokens.length; + var ps = []; // Parentheses + var sbs = []; // Square brackets + var cbs = []; // Curly brackets + var t = undefined; // Current token + + // For every token in the token list, if we meet an opening (left) + // bracket, push its index number to a corresponding array. + // If we then meet a closing (right) bracket, look at the corresponding + // array. If there are any elements (records about previously met + // left brackets), take a token of the last left bracket (take + // the last index number from the array and find a token with + // this index number) and save right bracket's index as a reference: + for (var i = 0; i < tokensLength; i++) { + t = tokens[i]; + switch (t.type) { + case TokenType.LeftParenthesis: + ps.push(i); + break; + case TokenType.RightParenthesis: + if (ps.length) { + t.left = ps.pop(); + tokens[t.left].right = i; + } + break; + case TokenType.LeftSquareBracket: + sbs.push(i); + break; + case TokenType.RightSquareBracket: + if (sbs.length) { + t.left = sbs.pop(); + tokens[t.left].right = i; + } + break; + case TokenType.LeftCurlyBracket: + cbs.push(i); + break; + case TokenType.RightCurlyBracket: + if (cbs.length) { + t.left = cbs.pop(); + tokens[t.left].right = i; + } + break; + } + } + } + + return function (tokens) { + markBrackets(tokens); + markSC(tokens); + }; + })(); + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Node = __webpack_require__(1); + var NodeType = __webpack_require__(15); + var TokenType = __webpack_require__(13); + + var tokens = undefined; + var tokensLength = undefined; + var pos = undefined; + + var contexts = { + 'arguments': function () { + return checkArguments(pos) && getArguments(); + }, + 'atkeyword': function () { + return checkAtkeyword(pos) && getAtkeyword(); + }, + 'atrule': function () { + return checkAtrule(pos) && getAtrule(); + }, + 'block': function () { + return checkBlock(pos) && getBlock(); + }, + 'brackets': function () { + return checkBrackets(pos) && getBrackets(); + }, + 'class': function () { + return checkClass(pos) && getClass(); + }, + 'combinator': function () { + return checkCombinator(pos) && getCombinator(); + }, + 'commentML': function () { + return checkCommentML(pos) && getCommentML(); + }, + 'commentSL': function () { + return checkCommentSL(pos) && getCommentSL(); + }, + 'condition': function () { + return checkCondition(pos) && getCondition(); + }, + 'declaration': function () { + return checkDeclaration(pos) && getDeclaration(); + }, + 'declDelim': function () { + return checkDeclDelim(pos) && getDeclDelim(); + }, + 'delim': function () { + return checkDelim(pos) && getDelim(); + }, + 'dimension': function () { + return checkDimension(pos) && getDimension(); + }, + 'escapedString': function () { + return checkEscapedString(pos) && getEscapedString(); + }, + 'expression': function () { + return checkExpression(pos) && getExpression(); + }, + 'extend': function () { + return checkExtend(pos) && getExtend(); + }, + 'function': function () { + return checkFunction(pos) && getFunction(); + }, + 'ident': function () { + return checkIdent(pos) && getIdent(); + }, + 'important': function () { + return checkImportant(pos) && getImportant(); + }, + 'include': function () { + return checkInclude(pos) && getInclude(); + }, + 'interpolatedVariable': function () { + return checkInterpolatedVariable(pos) && getInterpolatedVariable(); + }, + 'mixin': function () { + return checkMixin(pos) && getMixin(); + }, + 'namespace': function () { + return checkNamespace(pos) && getNamespace(); + }, + 'number': function () { + return checkNumber(pos) && getNumber(); + }, + 'operator': function () { + return checkOperator(pos) && getOperator(); + }, + 'parentheses': function () { + return checkParentheses(pos) && getParentheses(); + }, + 'parentselector': function () { + return checkParentSelector(pos) && getParentSelector(); + }, + 'percentage': function () { + return checkPercentage(pos) && getPercentage(); + }, + 'progid': function () { + return checkProgid(pos) && getProgid(); + }, + 'property': function () { + return checkProperty(pos) && getProperty(); + }, + 'propertyDelim': function () { + return checkPropertyDelim(pos) && getPropertyDelim(); + }, + 'pseudoc': function () { + return checkPseudoc(pos) && getPseudoc(); + }, + 'pseudoe': function () { + return checkPseudoe(pos) && getPseudoe(); + }, + 'ruleset': function () { + return checkRuleset(pos) && getRuleset(); + }, + 's': function () { + return checkS(pos) && getS(); + }, + 'selector': function () { + return checkSelector(pos) && getSelector(); + }, + 'shash': function () { + return checkShash(pos) && getShash(); + }, + 'string': function () { + return checkString(pos) && getString(); + }, + 'stylesheet': function () { + return checkStylesheet(pos) && getStylesheet(); + }, + 'unary': function () { + return checkUnary(pos) && getUnary(); + }, + 'unicodeRange': function () { + return checkUnicodeRange(pos) && getUnicodeRange(); + }, + 'urange': function () { + return checkUrange(pos) && getUrange(); + }, + 'uri': function () { + return checkUri(pos) && getUri(); + }, + 'value': function () { + return checkValue(pos) && getValue(); + }, + 'variable': function () { + return checkVariable(pos) && getVariable(); + }, + 'variableslist': function () { + return checkVariablesList(pos) && getVariablesList(); + }, + 'vhash': function () { + return checkVhash(pos) && getVhash(); + } + }; + + /** + * Stop parsing and display error + * @param {Number=} i Token's index number + */ + function throwError(i) { + var ln = tokens[i].ln; + + throw { line: ln, syntax: 'less' }; + } + + /** + * @param {Object} exclude + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkExcluding(exclude, i) { + var start = i; + + while (i < tokensLength) { + if (exclude[tokens[i++].type]) break; + } + + return i - start - 2; + } + + /** + * @param {Number} start + * @param {Number} finish + * @returns {String} + */ + function joinValues(start, finish) { + var s = ''; + + for (var i = start; i < finish + 1; i++) { + s += tokens[i].value; + } + + return s; + } + + /** + * @param {Number} start + * @param {Number} num + * @returns {String} + */ + function joinValues2(start, num) { + if (start + num - 1 >= tokensLength) return; + + var s = ''; + + for (var i = 0; i < num; i++) { + s += tokens[start + i].value; + } + + return s; + } + + function getLastPosition(content, line, column, colOffset) { + return typeof content === 'string' ? getLastPositionForString(content, line, column, colOffset) : getLastPositionForArray(content, line, column, colOffset); + } + + function getLastPositionForString(content, line, column, colOffset) { + var position = []; + + if (!content) { + position = [line, column]; + if (colOffset) position[1] += colOffset - 1; + return position; + } + + var lastLinebreak = content.lastIndexOf('\n'); + var endsWithLinebreak = lastLinebreak === content.length - 1; + var splitContent = content.split('\n'); + var linebreaksCount = splitContent.length - 1; + var prevLinebreak = linebreaksCount === 0 || linebreaksCount === 1 ? -1 : content.length - splitContent[linebreaksCount - 1].length - 2; + + // Line: + var offset = endsWithLinebreak ? linebreaksCount - 1 : linebreaksCount; + position[0] = line + offset; + + // Column: + if (endsWithLinebreak) { + offset = prevLinebreak !== -1 ? content.length - prevLinebreak : content.length - 1; + } else { + offset = linebreaksCount !== 0 ? content.length - lastLinebreak - column - 1 : content.length - 1; + } + position[1] = column + offset; + + if (!colOffset) return position; + + if (endsWithLinebreak) { + position[0]++; + position[1] = colOffset; + } else { + position[1] += colOffset; + } + + return position; + } + + function getLastPositionForArray(content, line, column, colOffset) { + var position; + + if (content.length === 0) { + position = [line, column]; + } else { + var c = content[content.length - 1]; + if (c.hasOwnProperty('end')) { + position = [c.end.line, c.end.column]; + } else { + position = getLastPosition(c.content, line, column); + } + } + + if (!colOffset) return position; + + if (tokens[pos - 1].type !== 'Newline') { + position[1] += colOffset; + } else { + position[0]++; + position[1] = 1; + } + + return position; + } + + function newNode(type, content, line, column, end) { + if (!end) end = getLastPosition(content, line, column); + return new Node({ + type: type, + content: content, + start: { + line: line, + column: column + }, + end: { + line: end[0], + column: end[1] + }, + syntax: 'less' + }); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkAny(i) { + var l; + + if (l = checkBrackets(i)) tokens[i].any_child = 1;else if (l = checkParentheses(i)) tokens[i].any_child = 2;else if (l = checkString(i)) tokens[i].any_child = 3;else if (l = checkVariablesList(i)) tokens[i].any_child = 4;else if (l = checkVariable(i)) tokens[i].any_child = 5;else if (l = checkPercentage(i)) tokens[i].any_child = 6;else if (l = checkDimension(i)) tokens[i].any_child = 7;else if (l = checkUnicodeRange(i)) tokens[i].any_child = 15;else if (l = checkNumber(i)) tokens[i].any_child = 8;else if (l = checkUri(i)) tokens[i].any_child = 9;else if (l = checkExpression(i)) tokens[i].any_child = 10;else if (l = checkFunction(i)) tokens[i].any_child = 11;else if (l = checkIdent(i)) tokens[i].any_child = 12;else if (l = checkClass(i)) tokens[i].any_child = 13;else if (l = checkUnary(i)) tokens[i].any_child = 14; + + return l; + } + + /** + * @returns {Array} + */ + function getAny() { + var childType = tokens[pos].any_child; + + if (childType === 1) return getBrackets(); + if (childType === 2) return getParentheses(); + if (childType === 3) return getString(); + if (childType === 4) return getVariablesList(); + if (childType === 5) return getVariable(); + if (childType === 6) return getPercentage(); + if (childType === 7) return getDimension(); + if (childType === 15) return getUnicodeRange(); + if (childType === 8) return getNumber(); + if (childType === 9) return getUri(); + if (childType === 10) return getExpression(); + if (childType === 11) return getFunction(); + if (childType === 12) return getIdent(); + if (childType === 13) return getClass(); + if (childType === 14) return getUnary(); + } + + /** + * Check if token is part of mixin's arguments. + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkArguments(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength || tokens[i++].type !== TokenType.LeftParenthesis) return 0; + + while (i < tokens[start].right) { + if (l = checkArgument(i)) i += l;else return 0; + } + + return tokens[start].right - start + 1; + } + + /** + * Check if token is valid to be part of arguments list. + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkArgument(i) { + var l; + + if (l = checkEscapedString(i)) tokens[i].argument_child = 1;else if (l = checkDeclaration(i)) tokens[i].argument_child = 2;else if (l = checkVariablesList(i)) tokens[i].argument_child = 3;else if (l = checkVariable(i)) tokens[i].argument_child = 4;else if (l = checkSC(i)) tokens[i].argument_child = 5;else if (l = checkUnary(i)) tokens[i].argument_child = 6;else if (l = checkOperator(i)) tokens[i].argument_child = 7;else if (l = checkDelim(i)) tokens[i].argument_child = 8;else if (l = checkDeclDelim(i)) tokens[i].argument_child = 9;else if (l = checkString(i)) tokens[i].argument_child = 10;else if (l = checkPercentage(i)) tokens[i].argument_child = 11;else if (l = checkDimension(i)) tokens[i].argument_child = 12;else if (l = checkNumber(i)) tokens[i].argument_child = 13;else if (l = checkUri(i)) tokens[i].argument_child = 14;else if (l = checkFunction(i)) tokens[i].argument_child = 15;else if (l = checkIdent(i)) tokens[i].argument_child = 16;else if (l = checkVhash(i)) tokens[i].argument_child = 17;else if (l = checkBlock(i)) tokens[i].argument_child = 18;else if (l = checkParentheses(i)) tokens[i].argument_child = 19; + + return l; + } + + /** + * @returns {Array} Node that is part of arguments list. + */ + function getArgument() { + var childType = tokens[pos].argument_child; + + if (childType === 1) return getEscapedString(); + if (childType === 2) return getDeclaration(); + if (childType === 3) return getVariablesList(); + if (childType === 4) return getVariable(); + if (childType === 5) return getSC(); + if (childType === 6) return getUnary(); + if (childType === 7) return getOperator(); + if (childType === 8) return getDelim(); + if (childType === 9) return getDeclDelim(); + if (childType === 10) return getString(); + if (childType === 11) return getPercentage(); + if (childType === 12) return getDimension(); + if (childType === 13) return getNumber(); + if (childType === 14) return getUri(); + if (childType === 15) return getFunction(); + if (childType === 16) return getIdent(); + if (childType === 17) return getVhash(); + if (childType === 18) return getBlock(); + if (childType === 19) return getParentheses(); + } + + /** + * Check if token is part of an @-word (e.g. `@import`, `@include`) + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkAtkeyword(i) { + var l; + + // Check that token is `@`: + if (i >= tokensLength || tokens[i++].type !== TokenType.CommercialAt) return 0; + + return (l = checkIdent(i)) ? l + 1 : 0; + } + + /** + * Get node with @-word + * @returns {Array} `['atkeyword', ['ident', x]]` where `x` is + * an identifier without + * `@` (e.g. `import`, `include`) + */ + function getAtkeyword() { + var token = tokens[pos++]; + var content = [getIdent()]; + + return newNode(NodeType.AtkeywordType, content, token.ln, token.col); + } + + /** + * Check if token is a part of an @-rule + * @param {Number} i Token's index number + * @returns {Number} Length of @-rule + */ + function checkAtrule(i) { + var l; + + if (i >= tokensLength) return 0; + + // If token already has a record of being part of an @-rule, + // return the @-rule's length: + if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l; + + // If token is part of an @-rule, save the rule's type to token. + if (l = checkKeyframesRule(i)) tokens[i].atrule_type = 4; + // @-rule with ruleset: + else if (l = checkAtruler(i)) tokens[i].atrule_type = 1; + // Block @-rule: + else if (l = checkAtruleb(i)) tokens[i].atrule_type = 2; + // Single-line @-rule: + else if (l = checkAtrules(i)) tokens[i].atrule_type = 3;else return 0; + + // If token is part of an @-rule, save the rule's length to token: + tokens[i].atrule_l = l; + + return l; + } + + /** + * Get node with @-rule + * @returns {Array} + */ + function getAtrule() { + switch (tokens[pos].atrule_type) { + case 1: + return getAtruler(); // @-rule with ruleset + case 2: + return getAtruleb(); // Block @-rule + case 3: + return getAtrules(); // Single-line @-rule + case 4: + return getKeyframesRule(); + } + } + + /** + * Check if token is part of a block @-rule + * @param {Number} i Token's index number + * @returns {Number} Length of the @-rule + */ + function checkAtruleb(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkAtkeyword(i)) i += l;else return 0; + + if (l = checkTsets(i)) i += l; + + if (l = checkBlock(i)) i += l;else return 0; + + return i - start; + } + + /** + * Get node with a block @-rule + * @returns {Array} `['atruleb', ['atkeyword', x], y, ['block', z]]` + */ + function getAtruleb() { + var startPos = pos; + var content = [getAtkeyword()].concat(getTsets()).concat([getBlock()]); + + var token = tokens[startPos]; + return newNode(NodeType.AtruleType, content, token.ln, token.col); + } + + /** + * Check if token is part of an @-rule with ruleset + * @param {Number} i Token's index number + * @returns {Number} Length of the @-rule + */ + function checkAtruler(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkAtkeyword(i)) i += l;else return 0; + + if (l = checkTsets(i)) i += l; + + if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;else return 0; + + if (l = checkAtrulers(i)) i += l; + + if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++;else return 0; + + return i - start; + } + + /** + * Get node with an @-rule with ruleset + * @returns {Array} ['atruler', ['atkeyword', x], y, z] + */ + function getAtruler() { + var startPos = pos; + var content = [getAtkeyword()]; + content = content.concat(getTsets()); + content.push(getAtrulers()); + + var token = tokens[startPos]; + return newNode(NodeType.AtruleType, content, token.ln, token.col); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkAtrulers(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkSC(i)) i += l; + + while (i < tokensLength) { + if (l = checkSC(i)) tokens[i].atrulers_child = 1;else if (l = checkAtrule(i)) tokens[i].atrulers_child = 2;else if (l = checkRuleset(i)) tokens[i].atrulers_child = 3;else break; + i += l; + } + + tokens[i].atrulers_end = 1; + + if (l = checkSC(i)) i += l; + + return i - start; + } + + /** + * @returns {Array} `['atrulers', x]` + */ + function getAtrulers() { + var token = tokens[pos++]; + var line = token.ln; + var column = token.col; + var content = getSC(); + + while (!tokens[pos].atrulers_end) { + var childType = tokens[pos].atrulers_child; + if (childType === 1) content = content.concat(getSC());else if (childType === 2) content.push(getAtrule());else if (childType === 3) content.push(getRuleset()); + } + + content = content.concat(getSC()); + + var end = getLastPosition(content, line, column, 1); + pos++; + + return newNode(NodeType.BlockType, content, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkAtrules(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkAtkeyword(i)) i += l;else return 0; + + if (l = checkTsets(i)) i += l; + + return i - start; + } + + /** + * @returns {Array} `['atrules', ['atkeyword', x], y]` + */ + function getAtrules() { + var startPos = pos; + var content = [getAtkeyword()].concat(getTsets()); + + var token = tokens[startPos]; + return newNode(NodeType.AtruleType, content, token.ln, token.col); + } + + /** + * Check if token is part of a block (e.g. `{...}`). + * @param {Number} i Token's index number + * @returns {Number} Length of the block + */ + function checkBlock(i) { + return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ? tokens[i].right - i + 1 : 0; + } + + /** + * Get node with a block + * @returns {Array} `['block', x]` + */ + function getBlock() { + var startPos = pos; + var end = tokens[pos++].right; + var content = []; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + while (pos < end) { + if (checkBlockdecl(pos)) content = content.concat(getBlockdecl());else throwError(pos); + } + + var end_ = getLastPosition(content, line, column, 1); + pos = end + 1; + + return newNode(NodeType.BlockType, content, line, column, end_); + } + + /** + * Check if token is part of a declaration (property-value pair) + * @param {Number} i Token's index number + * @returns {Number} Length of the declaration + */ + function checkBlockdecl(i) { + var l; + + if (i >= tokensLength) return 0; + + if (l = checkBlockdecl1(i)) tokens[i].bd_type = 1;else if (l = checkBlockdecl2(i)) tokens[i].bd_type = 2;else if (l = checkBlockdecl3(i)) tokens[i].bd_type = 3;else if (l = checkBlockdecl4(i)) tokens[i].bd_type = 4;else return 0; + + return l; + } + + /** + * @returns {Array} + */ + function getBlockdecl() { + switch (tokens[pos].bd_type) { + case 1: + return getBlockdecl1(); + case 2: + return getBlockdecl2(); + case 3: + return getBlockdecl3(); + case 4: + return getBlockdecl4(); + } + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkBlockdecl1(i) { + var start = i; + var l = undefined; + + if (l = checkSC(i)) i += l; + + if (l = checkCondition(i)) tokens[i].bd_kind = 1;else if (l = checkExtend(i)) tokens[i].bd_kind = 6;else if (l = checkRuleset(i)) tokens[i].bd_kind = 2;else if (l = checkDeclaration(i)) tokens[i].bd_kind = 3;else if (l = checkAtrule(i)) tokens[i].bd_kind = 4;else if (l = checkInclude(i)) tokens[i].bd_kind = 5;else return 0; + + i += l; + + if (i < tokensLength && (l = checkDeclDelim(i))) i += l;else return 0; + + if (l = checkSC(i)) i += l;else return 0; + + return i - start; + } + + /** + * @returns {Array} + */ + function getBlockdecl1() { + var sc = getSC(); + var x = undefined; + + switch (tokens[pos].bd_kind) { + case 1: + x = getCondition(); + break; + case 2: + x = getRuleset(); + break; + case 3: + x = getDeclaration(); + break; + case 4: + x = getAtrule(); + break; + case 5: + x = getInclude(); + break; + case 6: + x = getExtend(); + break; + } + + return sc.concat([x]).concat([getDeclDelim()]).concat(getSC()); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkBlockdecl2(i) { + var start = i; + var l = undefined; + + if (l = checkSC(i)) i += l; + + if (l = checkCondition(i)) tokens[i].bd_kind = 1;else if (l = checkExtend(i)) tokens[i].bd_kind = 3;else if (l = checkRuleset(i)) tokens[i].bd_kind = 6;else if (l = checkDeclaration(i)) tokens[i].bd_kind = 4;else if (l = checkAtrule(i)) tokens[i].bd_kind = 5;else if (l = checkInclude(i)) tokens[i].bd_kind = 2;else return 0; + + i += l; + + if (l = checkSC(i)) i += l; + + return i - start; + } + + /** + * @returns {Array} + */ + function getBlockdecl2() { + var sc = getSC(); + var x = undefined; + + switch (tokens[pos].bd_kind) { + case 1: + x = getCondition(); + break; + case 2: + x = getInclude(); + break; + case 3: + x = getExtend(); + break; + case 4: + x = getDeclaration(); + break; + case 5: + x = getAtrule(); + break; + case 6: + x = getRuleset(); + break; + } + + return sc.concat([x]).concat(getSC()); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkBlockdecl3(i) { + var start = i; + var l = undefined; + + if (l = checkSC(i)) i += l; + + if (l = checkDeclDelim(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + return i - start; + } + + /** + * @returns {Array} `[s0, ['declDelim'], s1]` where `s0` and `s1` are + * are optional whitespaces. + */ + function getBlockdecl3() { + return getSC().concat([getDeclDelim()]).concat(getSC()); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkBlockdecl4(i) { + return checkSC(i); + } + + /** + * @returns {Array} + */ + function getBlockdecl4() { + return getSC(); + } + + /** + * Check if token is part of text inside square brackets, e.g. `[1]` + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkBrackets(i) { + if (i >= tokensLength || tokens[i].type !== TokenType.LeftSquareBracket) return 0; + + return tokens[i].right - i + 1; + } + + /** + * Get node with text inside square brackets, e.g. `[1]` + * @returns {Node} + */ + function getBrackets() { + var startPos = pos++; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + var tsets = getTsets(); + + var end = getLastPosition(tsets, line, column, 1); + pos++; + + return newNode(NodeType.BracketsType, tsets, line, column, end); + } + + /** + * Check if token is part of a class selector (e.g. `.abc`) + * @param {Number} i Token's index number + * @returns {Number} Length of the class selector + */ + function checkClass(i) { + var l; + + if (i >= tokensLength) return 0; + + if (tokens[i].class_l) return tokens[i].class_l; + + if (tokens[i++].type === TokenType.FullStop) { + if (l = checkInterpolatedVariable(i)) tokens[i].class_child = 1;else if (l = checkIdent(i)) tokens[i].class_child = 2;else return 0; + + tokens[i].class_l = l + 1; + return l + 1; + } + + return 0; + } + + /** + * Get node with a class selector + * @returns {Array} `['class', ['ident', x]]` where x is a class's + * identifier (without `.`, e.g. `abc`). + */ + function getClass() { + var startPos = pos++; + var content = []; + + var childType = tokens[pos].class_child; + if (childType === 1) content.push(getInterpolatedVariable());else content.push(getIdent()); + + var token = tokens[startPos]; + return newNode(NodeType.ClassType, content, token.ln, token.col); + } + + function checkCombinator(i) { + if (i >= tokensLength) return 0; + + var l = undefined; + if (l = checkCombinator1(i)) tokens[i].combinatorType = 1;else if (l = checkCombinator2(i)) tokens[i].combinatorType = 2;else if (l = checkCombinator3(i)) tokens[i].combinatorType = 3; + + return l; + } + + function getCombinator() { + var type = tokens[pos].combinatorType; + if (type === 1) return getCombinator1(); + if (type === 2) return getCombinator2(); + if (type === 3) return getCombinator3(); + } + /** + * (1) `||` + */ + function checkCombinator1(i) { + if (tokens[i].type === TokenType.VerticalLine && tokens[i + 1].type === TokenType.VerticalLine) return 2;else return 0; + } + + function getCombinator1() { + var type = NodeType.CombinatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = '||'; + + pos += 2; + return newNode(type, content, line, column); + } + + /** + * (1) `>` + * (2) `+` + * (3) `~` + */ + function checkCombinator2(i) { + var type = tokens[i].type; + if (type === TokenType.PlusSign || type === TokenType.GreaterThanSign || type === TokenType.Tilde) return 1;else return 0; + } + + function getCombinator2() { + var type = NodeType.CombinatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = tokens[pos++].value; + + return newNode(type, content, line, column); + } + + /** + * (1) `/panda/` + */ + function checkCombinator3(i) { + var start = i; + + if (tokens[i].type === TokenType.Solidus) i++;else return 0; + + var l = undefined; + if (l = checkIdent(i)) i += l;else return 0; + + if (tokens[i].type === TokenType.Solidus) i++;else return 0; + + return i - start; + } + + function getCombinator3() { + var type = NodeType.CombinatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + + // Skip `/`. + pos++; + var ident = getIdent(); + + // Skip `/`. + pos++; + + var content = '/' + ident.content + '/'; + + return newNode(type, content, line, column); + } + + /** + * Check if token is a multiline comment. + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a multiline comment, otherwise `0` + */ + function checkCommentML(i) { + return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0; + } + + /** + * Get node with a multiline comment + * @returns {Array} `['commentML', x]` where `x` + * is the comment's text (without `/*` and `* /`). + */ + function getCommentML() { + var startPos = pos; + var s = tokens[pos].value.substring(2); + var l = s.length; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2); + + var end = getLastPosition(s, line, column, 2); + if (end[0] === line) end[1] += 2; + pos++; + + return newNode(NodeType.CommentMLType, s, line, column, end); + } + + /** + * Check if token is part of a single-line comment. + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a single-line comment, otherwise `0` + */ + function checkCommentSL(i) { + return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; + } + + /** + * Get node with a single-line comment. + * @returns {Array} + */ + function getCommentSL() { + var startPos = pos; + var x = tokens[pos++].value.substring(2); + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + var end = getLastPosition(x, line, column + 2); + return newNode(NodeType.CommentSLType, x, line, column, end); + } + + /** + * Check if token is part of a condition. + * @param {Number} i Token's index number + * @return {Number} Length of the condition + */ + function checkCondition(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if ((l = checkIdent(i)) && tokens[i].value === 'when') i += l;else return 0; + + while (i < tokensLength) { + if (l = checkBlock(i)) { + tokens[i].condition_child = 0; + break; + } else if (l = checkFunction(i)) tokens[i].condition_child = 1;else if (l = checkBrackets(i)) tokens[i].condition_child = 2;else if (l = checkParentheses(i)) tokens[i].condition_child = 3;else if (l = checkVariable(i)) tokens[i].condition_child = 4;else if (l = checkIdent(i)) tokens[i].condition_child = 5;else if (l = checkNumber(i)) tokens[i].condition_child = 6;else if (l = checkDelim(i)) tokens[i].condition_child = 7;else if (l = checkOperator(i)) tokens[i].condition_child = 8;else if (l = checkCombinator(i)) tokens[i].condition_child = 9;else if (l = checkSC(i)) tokens[i].condition_child = 10;else if (l = checkString(i)) tokens[i].condition_child = 11;else return 0; + + i += l; + } + + return i - start; + } + + /** + * Get node with a condition. + * @returns {Array} `['condition', x]` + */ + function getCondition() { + var startPos = pos; + var x = []; + + x.push(getIdent()); + + while (pos < tokensLength) { + var childType = tokens[pos].condition_child; + + if (childType === 0) break;else if (childType === 1) x.push(getFunction());else if (childType === 2) x.push(getBrackets());else if (childType === 3) x.push(getParentheses());else if (childType === 4) x.push(getVariable());else if (childType === 5) x.push(getIdent());else if (childType === 6) x.push(getNumber());else if (childType === 7) x.push(getDelim());else if (childType === 8) x.push(getOperator());else if (childType === 9) x.push(getCombinator());else if (childType === 10) x = x.concat(getSC());else if (childType === 11) x.push(getString()); + } + + var token = tokens[startPos]; + return newNode(NodeType.ConditionType, x, token.ln, token.col); + } + + /** + * Check if token is part of a declaration (property-value pair) + * @param {Number} i Token's index number + * @returns {Number} Length of the declaration + */ + function checkDeclaration(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkProperty(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkPropertyDelim(i)) i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkValue(i)) i += l;else return 0; + + return i - start; + } + + /** + * Get node with a declaration + * @returns {Array} `['declaration', ['property', x], ['propertyDelim'], + * ['value', y]]` + */ + function getDeclaration() { + var startPos = pos; + var x = [getProperty()].concat(getSC()).concat([getPropertyDelim()]).concat(getSC()).concat([getValue()]); + + var token = tokens[startPos]; + return newNode(NodeType.DeclarationType, x, token.ln, token.col); + } + + /** + * Check if token is a semicolon + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a semicolon, otherwise `0` + */ + function checkDeclDelim(i) { + return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0; + } + + /** + * Get node with a semicolon + * @returns {Array} `['declDelim']` + */ + function getDeclDelim() { + var startPos = pos++; + + var token = tokens[startPos]; + return newNode(NodeType.DeclDelimType, ';', token.ln, token.col); + } + + /** + * Check if token is a comma + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a comma, otherwise `0` + */ + function checkDelim(i) { + return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0; + } + + /** + * Get node with a comma + * @returns {Array} `['delim']` + */ + function getDelim() { + var startPos = pos++; + + var token = tokens[startPos]; + return newNode(NodeType.DelimType, ',', token.ln, token.col); + } + + /** + * Check if token is part of a number with dimension unit (e.g. `10px`) + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkDimension(i) { + var ln = checkNumber(i); + var li = undefined; + + if (i >= tokensLength || !ln || i + ln >= tokensLength) return 0; + + return (li = checkNmName2(i + ln)) ? ln + li : 0; + } + + /** + * Get node of a number with dimension unit + * @returns {Array} `['dimension', ['number', x], ['ident', y]]` where + * `x` is a number converted to string (e.g. `'10'`) and `y` is + * a dimension unit (e.g. `'px'`). + */ + function getDimension() { + var startPos = pos; + var x = [getNumber()]; + var token = tokens[pos]; + var ident = newNode(NodeType.IdentType, getNmName2(), token.ln, token.col); + + x.push(ident); + + token = tokens[startPos]; + return newNode(NodeType.DimensionType, x, token.ln, token.col); + } + + /** + * Check if token is part of an escaped string (e.g. `~"ms:something"`). + * @param {Number} i Token's index number + * @returns {Number} Length of the string (including `~` and quotes) + */ + function checkEscapedString(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (tokens[i].type === TokenType.Tilde && (l = checkString(i + 1))) return i + l - start;else return 0; + } + + /** + * Get node with an escaped string + * @returns {Array} `['escapedString', ['string', x]]` where `x` is a string + * without `~` but with quotes + */ + function getEscapedString() { + var startPos = pos++; + var x = tokens[pos++].value; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + var end = getLastPosition(x, line, column + 1); + return newNode(NodeType.EscapedStringType, x, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkExpression(i) { + var start = i; + + if (i >= tokensLength || tokens[i++].value !== 'expression' || i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) { + return 0; + } + + return tokens[i].right - start + 1; + } + + /** + * @returns {Array} + */ + function getExpression() { + var startPos = pos++; + var x = undefined; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + x = joinValues(pos + 1, tokens[pos].right - 1); + var end = getLastPosition(x, line, column, 1); + if (end[0] === line) end[1] += 11; + pos = tokens[pos].right + 1; + + return newNode(NodeType.ExpressionType, x, token.ln, token.col, end); + } + + function checkExtend(i) { + if (i >= tokensLength) return 0; + + var l; + if (l = checkExtend1(i)) tokens[i].extendType = 1;else if (l = checkExtend2(i)) tokens[i].extendType = 2;else return 0; + + return l; + } + + function getExtend() { + var childType = tokens[pos].extendType; + if (childType === 1) return getExtend1(); + if (childType === 2) return getExtend2(); + } + + /** + * (1) `selector:extend(selector) {...}` + */ + function checkExtend1(i) { + var start = i; + var l; + + if (i >= tokensLength) return 0; + + if (l = checkExtendSelector(i)) i += l;else return 0; + + if (tokens[i + 1] && tokens[i + 1].value === 'extend' && (l = checkPseudoc(i))) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkBlock(i)) i += l;else return 0; + + return i - start; + } + + function getExtend1() { + var startPos = pos; + var x = [].concat(getExtendSelector(), [getPseudoc()], getSC(), [getBlock()]); + + var token = tokens[startPos]; + return newNode(NodeType.ExtendType, x, token.ln, token.col); + } + + /** + * (1) `selector:extend(selector)` + */ + function checkExtend2(i) { + var start = i; + var l; + + if (i >= tokensLength) return 0; + + if (l = checkExtendSelector(i)) i += l;else return 0; + + if (tokens[i + 1] && tokens[i + 1].value === 'extend' && (l = checkPseudoc(i))) i += l;else return 0; + + return i - start; + } + + function getExtend2() { + var startPos = pos; + var x = [].concat(getExtendSelector(), [getPseudoc()]); + + var token = tokens[startPos]; + return newNode(NodeType.ExtendType, x, token.ln, token.col); + } + + function checkExtendSelector(i) { + var l; + + if (l = checkParentSelectorWithExtension(i)) tokens[i].extend_type = 1;else if (l = checkIdent(i)) tokens[i].extend_type = 2;else if (l = checkClass(i)) tokens[i].extend_type = 3;else if (l = checkShash(i)) tokens[i].extend_type = 4; + + return l; + } + + function getExtendSelector() { + var childType = tokens[pos].extend_type; + + if (childType === 1) return getParentSelectorWithExtension(); + if (childType === 2) return [getIdent()]; + if (childType === 3) return [getClass()]; + if (childType === 4) return [getShash()]; + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkFunction(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ? tokens[i].right - start + 1 : 0; + } + + /** + * @returns {Array} + */ + function getFunction() { + var token = tokens[pos]; + var ident = getIdent(); + var x = [ident]; + var body; + + body = getArguments(); + + x.push(body); + + return newNode(NodeType.FunctionType, x, token.ln, token.col); + } + + /** + * @returns {Array} + */ + function getArguments() { + var startPos = pos; + var x = []; + var body = undefined; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + pos++; + + while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { + if (checkDeclaration(pos)) x.push(getDeclaration());else if (checkArgument(pos)) { + body = getArgument(); + if (typeof body.content === 'string') x.push(body);else x = x.concat(body); + } else if (checkClass(pos)) x.push(getClass());else throwError(pos); + } + + var end = getLastPosition(x, line, column, 1); + pos++; + + return newNode(NodeType.ArgumentsType, x, line, column, end); + } + + /** + * Check if token is part of an identifier + * @param {Number} i Token's index number + * @returns {Number} Length of the identifier + */ + function checkIdent(i) { + var start = i; + + if (i >= tokensLength) return 0; + + if (tokens[i].type === TokenType.HyphenMinus) i++; + + if (tokens[i].type === TokenType.LowLine || tokens[i].type === TokenType.Identifier) i++;else return 0; + + for (; i < tokensLength; i++) { + if (tokens[i].type !== TokenType.HyphenMinus && tokens[i].type !== TokenType.LowLine && tokens[i].type !== TokenType.Identifier && tokens[i].type !== TokenType.DecimalNumber) break; + } + + tokens[start].ident_last = i - 1; + + return i - start; + } + + /** + * Get node with an identifier + * @returns {Array} `['ident', x]` where `x` is identifier's name + */ + function getIdent() { + var startPos = pos; + var x = joinValues(pos, tokens[pos].ident_last); + + pos = tokens[pos].ident_last + 1; + + var token = tokens[startPos]; + return newNode(NodeType.IdentType, x, token.ln, token.col); + } + + /** + * @param {number} i Token's index number + * @returns {number} Length of the identifier + */ + function checkPartialIdent(i) { + var start = i; + + if (i >= tokensLength) return 0; + + for (; i < tokensLength; i++) { + if (tokens[i].type !== TokenType.HyphenMinus && tokens[i].type !== TokenType.LowLine && tokens[i].type !== TokenType.Identifier && tokens[i].type !== TokenType.DecimalNumber) break; + } + + tokens[start].ident_last = i - 1; + + return i - start; + } + + /** + * Check if token is part of `!important` word + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkImportant(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark) return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].value === 'important') { + tokens[start].importantEnd = i; + return i - start + 1; + } else { + return 0; + } + } + + /** + * Get node with `!important` word + * @returns {Array} `['important', sc]` where `sc` is optional whitespace + */ + function getImportant() { + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = joinValues(pos, token.importantEnd); + + pos = token.importantEnd + 1; + + return newNode(NodeType.ImportantType, content, line, column); + } + + /** + * Check if token is part of an include (`@include` or `@extend` directive). + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkInclude(i) { + var l; + + if (i >= tokensLength) return 0; + + if (l = checkInclude1(i)) tokens[i].include_type = 1;else if (l = checkInclude2(i)) tokens[i].include_type = 2; + + return l; + } + + /** + * Get node with included mixin + * @returns {Array} `['include', x]` + */ + function getInclude() { + switch (tokens[pos].include_type) { + case 1: + return getInclude1(); + case 2: + return getInclude2(); + } + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkInclude1(i) { + var start = i; + var l = undefined; + + if (l = checkClass(i) || checkShash(i)) i += l;else return 0; + + while (i < tokensLength) { + if (l = checkClass(i) || checkShash(i) || checkSC(i)) i += l;else if (tokens[i].type === TokenType.GreaterThanSign) i++;else break; + } + + if (l = checkArguments(i)) i += l;else return 0; + + if (i < tokensLength && (l = checkSC(i))) i += l; + + if (i < tokensLength && (l = checkImportant(i))) i += l; + + return i - start; + } + + /** + * @returns {Array} `['include', x]` + */ + function getInclude1() { + var startPos = pos; + var x = []; + + x.push(checkClass(pos) ? getClass() : getShash()); + + while (pos < tokensLength) { + if (checkClass(pos)) x.push(getClass());else if (checkShash(pos)) x.push(getShash());else if (checkSC(pos)) x = x.concat(getSC());else if (checkOperator(pos)) x.push(getOperator());else break; + } + + x.push(getArguments()); + + x = x.concat(getSC()); + + if (checkImportant(pos)) x.push(getImportant()); + + var token = tokens[startPos]; + return newNode(NodeType.IncludeType, x, token.ln, token.col); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkInclude2(i) { + var start = i; + var l = undefined; + + if (l = checkClass(i) || checkShash(i)) i += l;else return 0; + + while (i < tokensLength) { + if (l = checkClass(i) || checkShash(i) || checkSC(i)) i += l;else if (tokens[i].type === TokenType.GreaterThanSign) i++;else break; + } + + return i - start; + } + + /** + * @returns {Array} `['include', x]` + */ + function getInclude2() { + var startPos = pos; + var x = []; + + x.push(checkClass(pos) ? getClass() : getShash()); + + while (pos < tokensLength) { + if (checkClass(pos)) x.push(getClass());else if (checkShash(pos)) x.push(getShash());else if (checkSC(pos)) x = x.concat(getSC());else if (checkOperator(pos)) x.push(getOperator());else break; + } + + var token = tokens[startPos]; + return newNode(NodeType.IncludeType, x, token.ln, token.col); + } + + /** + * Check if token is part of LESS interpolated variable + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkInterpolatedVariable(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (tokens[i].type !== TokenType.CommercialAt || !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket) { + return 0; + } + + i += 2; + + if (l = checkIdent(i)) i += l;else return 0; + + return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0; + } + + /** + * Get node with LESS interpolated variable + * @returns {Array} `['interpolatedVariable', x]` + */ + function getInterpolatedVariable() { + var startPos = pos; + var x = []; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + // Skip `@{`: + pos += 2; + + x.push(getIdent()); + + // Skip `}`: + var end = getLastPosition(x, line, column, 1); + pos++; + + return newNode(NodeType.InterpolatedVariableType, x, line, column, end); + } + + function checkKeyframesBlock(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkKeyframesSelector(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkBlock(i)) i += l;else return 0; + + return i - start; + } + + function getKeyframesBlock() { + var type = NodeType.RulesetType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [].concat([getKeyframesSelector()], getSC(), [getBlock()]); + + return newNode(type, content, line, column); + } + + function checkKeyframesBlocks(i) { + var start = i; + var l = undefined; + + if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkKeyframesBlock(i)) i += l;else return 0; + + while (tokens[i].type !== TokenType.RightCurlyBracket) { + if (l = checkSC(i)) i += l;else if (l = checkKeyframesBlock(i)) i += l;else break; + } + + if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++;else return 0; + + return i - start; + } + + function getKeyframesBlocks() { + var type = NodeType.BlockType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + var keyframesBlocksEnd = token.right; + + // Skip `{`. + pos++; + + while (pos < keyframesBlocksEnd) { + if (checkSC(pos)) content = content.concat(getSC());else if (checkKeyframesBlock(pos)) content.push(getKeyframesBlock()); + } + + var end = getLastPosition(content, line, column, 1); + + // Skip `}`. + pos++; + + return newNode(type, content, line, column, end); + } + + /** + * Check if token is part of a @keyframes rule. + * @param {Number} i Token's index number + * @return {Number} Length of the @keyframes rule + */ + function checkKeyframesRule(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkAtkeyword(i)) i += l;else return 0; + + var atruleName = joinValues2(i - l, l); + if (atruleName.indexOf('keyframes') === -1) return 0; + + if (l = checkSC(i)) i += l;else return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkKeyframesBlocks(i)) i += l;else return 0; + + return i - start; + } + + /** + * @return {Node} + */ + function getKeyframesRule() { + var type = NodeType.AtruleType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [].concat([getAtkeyword()], getSC(), [getIdent()], getSC(), [getKeyframesBlocks()]); + + return newNode(type, content, line, column); + } + + function checkKeyframesSelector(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) { + // Valid selectors are only `from` and `to`. + var selector = joinValues2(i, l); + if (selector !== 'from' && selector !== 'to') return 0; + + i += l; + tokens[start].keyframesSelectorType = 1; + } else if (l = checkPercentage(i)) { + i += l; + tokens[start].keyframesSelectorType = 2; + } else { + return 0; + } + + return i - start; + } + + function getKeyframesSelector() { + var keyframesSelectorType = NodeType.KeyframesSelectorType; + var selectorType = NodeType.SelectorType; + + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (token.keyframesSelectorType === 1) { + content.push(getIdent()); + } else { + content.push(getPercentage()); + } + + var keyframesSelector = newNode(keyframesSelectorType, content, line, column); + return newNode(selectorType, [keyframesSelector], line, column); + } + + /** + * Check if token is part of a LESS mixin + * @param {Number} i Token's index number + * @returns {Number} Length of the mixin + */ + function checkMixin(i) { + var l; + + if (i >= tokensLength) return 0; + + if (l = checkMixin1(i)) tokens[i].mixin_type = 1;else if (l = checkMixin2(i)) tokens[i].mixin_type = 2;else return 0; + + return l; + } + + /** + * @returns {Array} + */ + function getMixin() { + switch (tokens[pos].mixin_type) { + case 1: + return getMixin1(); + case 2: + return getMixin2(); + } + } + + function checkMixin1(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkClass(i) || checkShash(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkArguments(i)) i += l; + + if (l = checkSC(i)) i += l; + + if (l = checkBlock(i)) i += l;else return 0; + + return i - start; + } + + /** + * Get node with a mixin + * @returns {Array} `['mixin', x]` + */ + function getMixin1() { + var startPos = pos; + var x = []; + + x.push(checkClass(pos) ? getClass() : getShash()); + + x = x.concat(getSC()); + + if (checkArguments(pos)) x.push(getArguments()); + + x = x.concat(getSC()); + + if (checkBlock(pos)) x.push(getBlock()); + + var token = tokens[startPos]; + return newNode(NodeType.MixinType, x, token.ln, token.col); + } + + /** + * Check if token is part of a LESS mixin + * @param {Number} i Token's index number + * @returns {Number} Length of the mixin + */ + function checkMixin2(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkClass(i) || checkShash(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkArguments(i)) i += l; + + return i - start; + } + + /** + * Get node with a mixin + * @returns {Array} `['mixin', x]` + */ + function getMixin2() { + var startPos = pos; + var x = []; + + x.push(checkClass(pos) ? getClass() : getShash()); + + x = x.concat(getSC()); + + if (checkArguments(pos)) x.push(getArguments()); + + var token = tokens[startPos]; + return newNode(NodeType.MixinType, x, token.ln, token.col); + } + + /** + * Check if token is a namespace sign (`|`) + * @param {Number} i Token's index number + * @returns {Number} `1` if token is `|`, `0` if not + */ + function checkNamespace(i) { + return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0; + } + + /** + * Get node with a namespace sign + * @returns {Array} `['namespace']` + */ + function getNamespace() { + var startPos = pos++; + + var token = tokens[startPos]; + return newNode(NodeType.NamespaceType, '|', token.ln, token.col); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkNmName2(i) { + if (tokens[i].type === TokenType.Identifier) return 1;else if (tokens[i].type !== TokenType.DecimalNumber) return 0; + + i++; + + return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1; + } + + /** + * @returns {String} + */ + function getNmName2() { + var s = tokens[pos].value; + + if (tokens[pos++].type === TokenType.DecimalNumber && pos < tokensLength && tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value; + + return s; + } + + /** + * Check if token is part of a number + * @param {Number} i Token's index number + * @returns {Number} Length of number + */ + function checkNumber(i) { + if (i >= tokensLength) return 0; + + if (tokens[i].number_l) return tokens[i].number_l; + + // `10`: + if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && (!tokens[i + 1] || tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop)) { + tokens[i].number_l = 1; + return 1; + } + + // `10.`: + if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && (!tokens[i + 2] || tokens[i + 2].type !== TokenType.DecimalNumber)) { + tokens[i].number_l = 2; + return 2; + } + + // `.10`: + if (i < tokensLength && tokens[i].type === TokenType.FullStop && tokens[i + 1].type === TokenType.DecimalNumber) { + tokens[i].number_l = 2; + return 2; + } + + // `10.10`: + if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) { + tokens[i].number_l = 3; + return 3; + } + + return 0; + } + + /** + * Get node with number + * @returns {Array} `['number', x]` where `x` is a number converted + * to string. + */ + function getNumber() { + var x = ''; + var startPos = pos; + var l = tokens[pos].number_l; + + for (var j = 0; j < l; j++) { + x += tokens[pos + j].value; + } + + pos += l; + + var token = tokens[startPos]; + return newNode(NodeType.NumberType, x, token.ln, token.col); + } + + /** + * Check if token is an operator (`/`, `,`, `:`, `=`, `>`, `<` or `*`) + * @param {Number} i Token's index number + * @returns {Number} `1` if token is an operator, otherwise `0` + */ + function checkOperator(i) { + if (i >= tokensLength) return 0; + + switch (tokens[i].type) { + case TokenType.Solidus: + case TokenType.Comma: + case TokenType.Colon: + case TokenType.EqualsSign: + case TokenType.LessThanSign: + case TokenType.GreaterThanSign: + case TokenType.Asterisk: + return 1; + } + + return 0; + } + + /** + * Get node with an operator + * @returns {Array} `['operator', x]` where `x` is an operator converted + * to string. + */ + function getOperator() { + var startPos = pos; + var x = tokens[pos++].value; + + var token = tokens[startPos]; + return newNode(NodeType.OperatorType, x, token.ln, token.col); + } + + /** + * Check if token is part of text inside parentheses, e.g. `(1)` + * @param {Number} i Token's index number + * @return {Number} + */ + function checkParentheses(i) { + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + return tokens[i].right - i + 1; + } + + /** + * Get node with text inside parentheses, e.g. `(1)` + * @return {Node} + */ + function getParentheses() { + var type = NodeType.ParenthesesType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + + pos++; + + var tsets = getTsets(); + + var end = getLastPosition(tsets, line, column, 1); + pos++; + + return newNode(type, tsets, line, column, end); + } + + /** + * Check if token is a parent selector (`&`). + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkParentSelector(i) { + return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0; + } + + /** + * Get node with a parent selector + * @returns {Array} `['parentSelector']` + */ + function getParentSelector() { + var startPos = pos++; + + var token = tokens[startPos]; + return newNode(NodeType.ParentSelectorType, '&', token.ln, token.col); + } + + function checkParentSelectorExtension(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + while (i < tokensLength) { + if (l = checkNumber(i) || checkPartialIdent(i)) i += l;else break; + } + + return i - start; + } + + function getParentSelectorExtension() { + var type = NodeType.ParentSelectorExtensionType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + while (pos < tokensLength) { + if (checkNumber(pos)) content.push(getNumber());else if (checkPartialIdent(pos)) content.push(getIdent());else break; + } + + return newNode(type, content, line, column); + } + + function checkParentSelectorWithExtension(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + if (l = checkParentSelector(i)) i += l;else return 0; + + if (l = checkParentSelectorExtension(i)) i += l; + + return i - start; + } + + function getParentSelectorWithExtension() { + var content = [getParentSelector()]; + + if (checkParentSelectorExtension(pos)) content.push(getParentSelectorExtension()); + + return content; + } + + /** + * Check if token is part of a number with percent sign (e.g. `10%`) + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkPercentage(i) { + var x; + + if (i >= tokensLength) return 0; + + x = checkNumber(i); + + if (!x || i + x >= tokensLength) return 0; + + return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0; + } + + /** + * Get node of number with percent sign + * @returns {Array} `['percentage', ['number', x]]` where `x` is a number + * (without percent sign) converted to string. + */ + function getPercentage() { + var startPos = pos; + var x = [getNumber()]; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + var end = getLastPosition(x, line, column, 1); + pos++; + + return newNode(NodeType.PercentageType, x, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkProgid(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6;else return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].type === TokenType.LeftParenthesis) { + tokens[start].progid_end = tokens[i].right; + i = tokens[i].right + 1; + } else return 0; + + return i - start; + } + + /** + * @returns {Array} + */ + function getProgid() { + var startPos = pos; + var progid_end = tokens[pos].progid_end; + var x = joinValues(pos, progid_end); + + pos = progid_end + 1; + var token = tokens[startPos]; + return newNode(NodeType.ProgidType, x, token.ln, token.col); + } + + /** + * Check if token is part of a property + * @param {Number} i Token's index number + * @returns {Number} Length of the property + */ + function checkProperty(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkVariable(i) || checkIdent(i)) i += l;else return 0; + + return i - start; + } + + /** + * Get node with a property + * @returns {Array} `['property', x]` + */ + function getProperty() { + var startPos = pos; + var x = []; + + if (checkVariable(pos)) x.push(getVariable());else x.push(getIdent()); + + var token = tokens[startPos]; + return newNode(NodeType.PropertyType, x, token.ln, token.col); + } + + /** + * Check if token is a colon + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a colon, otherwise `0` + */ + function checkPropertyDelim(i) { + return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0; + } + + /** + * Get node with a colon + * @returns {Array} `['propertyDelim']` + */ + function getPropertyDelim() { + var startPos = pos++; + + var token = tokens[startPos]; + return newNode(NodeType.PropertyDelimType, ':', token.ln, token.col); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkPseudo(i) { + return checkPseudoe(i) || checkPseudoc(i); + } + + /** + * @returns {Array} + */ + function getPseudo() { + if (checkPseudoe(pos)) return getPseudoe(); + if (checkPseudoc(pos)) return getPseudoc(); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkPseudoe(i) { + var l; + + if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; + + return (l = checkInterpolatedVariable(i) || checkIdent(i)) ? l + 2 : 0; + } + + /** + * @returns {Array} + */ + function getPseudoe() { + var startPos = pos; + var x = []; + + pos += 2; + + if (checkInterpolatedVariable(pos)) { + x.push(getInterpolatedVariable()); + } else { + x.push(getIdent()); + } + + var token = tokens[startPos]; + return newNode(NodeType.PseudoeType, x, token.ln, token.col); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkPseudoc(i) { + var l; + + if (i >= tokensLength || tokens[i].type !== TokenType.Colon) return 0; + + if (l = checkPseudoClass3(i)) tokens[i].pseudoClassType = 3;else if (l = checkPseudoClass4(i)) tokens[i].pseudoClassType = 4;else if (l = checkPseudoClass5(i)) tokens[i].pseudoClassType = 5;else if (l = checkPseudoClass1(i)) tokens[i].pseudoClassType = 1;else if (l = checkPseudoClass2(i)) tokens[i].pseudoClassType = 2;else if (l = checkPseudoClass6(i)) tokens[i].pseudoClassType = 6;else return 0; + + return l; + } + + function getPseudoc() { + var childType = tokens[pos].pseudoClassType; + if (childType === 1) return getPseudoClass1(); + if (childType === 2) return getPseudoClass2(); + if (childType === 3) return getPseudoClass3(); + if (childType === 4) return getPseudoClass4(); + if (childType === 5) return getPseudoClass5(); + if (childType === 6) return getPseudoClass6(); + } + + /** + * (1) `:not(selector)` + * (2) `:extend(selector, selector)` + */ + function checkPseudoClass1(i) { + var start = i; + + // Skip `:`. + i++; + + var l = undefined; + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSelectorsGroup(i)) i += l;else return 0; + + if (i !== right) return 0; + + return right - start + 1; + } + + /** + * (-) `:not(panda)` + */ + function getPseudoClass1() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + content.push(getIdent()); + + { + var _type = NodeType.ArgumentsType; + var _token = tokens[pos]; + var _line = _token.ln; + var _column = _token.col; + + // Skip `(`. + pos++; + + var selectors = getSelectorsGroup(); + var end = getLastPosition(selectors, _line, _column, 1); + var args = newNode(_type, selectors, _line, _column, end); + content.push(args); + + // Skip `)`. + pos++; + } + + return newNode(type, content, line, column); + } + + /** + * (1) `:nth-child(odd)` + * (2) `:nth-child(even)` + * (3) `:lang(de-DE)` + */ + function checkPseudoClass2(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSC(i)) i += l; + + if (l = checkIdent(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (i !== right) return 0; + + return i - start + 1; + } + + function getPseudoClass2() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + { + // Skip `(`. + pos++; + + var l = tokens[pos].ln; + var c = tokens[pos].col; + var value = []; + + value = value.concat(getSC()); + value.push(getIdent()); + value = value.concat(getSC()); + + var end = getLastPosition(value, l, c, 1); + var args = newNode(NodeType.ArgumentsType, value, l, c, end); + content.push(args); + + // Skip `)`. + pos++; + } + + return newNode(type, content, line, column); + } + + /** + * (-) `:nth-child(-3n + 2)` + */ + function checkPseudoClass3(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSC(i)) i += l; + + if (l = checkUnary(i)) i += l; + if (i >= tokensLength) return 0; + if (tokens[i].type === TokenType.DecimalNumber) i++; + + if (i >= tokensLength) return 0; + if (tokens[i].value === 'n') i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (i >= tokensLength) return 0; + if (tokens[i].value === '+' || tokens[i].value === '-') i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].type === TokenType.DecimalNumber) i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (i !== right) return 0; + + return i - start + 1; + } + + function getPseudoClass3() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + var l = tokens[pos].ln; + var c = tokens[pos].col; + var value = []; + + // Skip `(`. + pos++; + + if (checkUnary(pos)) value.push(getUnary()); + if (checkNumber(pos)) value.push(getNumber()); + + { + var _l = tokens[pos].ln; + var _c = tokens[pos].col; + var _content = tokens[pos].value; + var _ident = newNode(NodeType.IdentType, _content, _l, _c); + value.push(_ident); + pos++; + } + + value = value.concat(getSC()); + if (checkUnary(pos)) value.push(getUnary()); + value = value.concat(getSC()); + if (checkNumber(pos)) value.push(getNumber()); + value = value.concat(getSC()); + + var end = getLastPosition(value, l, c, 1); + var args = newNode(NodeType.ArgumentsType, value, l, c, end); + content.push(args); + + // Skip `)`. + pos++; + + return newNode(type, content, line, column); + } + + /** + * (-) `:nth-child(-3n)` + */ + function checkPseudoClass4(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength) return 0; + if (tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSC(i)) i += l; + + if (l = checkUnary(i)) i += l; + if (tokens[i].type === TokenType.DecimalNumber) i++; + + if (tokens[i].value === 'n') i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (i !== right) return 0; + + return i - start + 1; + } + + function getPseudoClass4() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + // Skip `(`. + pos++; + + var l = tokens[pos].ln; + var c = tokens[pos].col; + var value = []; + + if (checkUnary(pos)) value.push(getUnary()); + if (checkNumber(pos)) value.push(getNumber()); + if (checkIdent(pos)) value.push(getIdent()); + value = value.concat(getSC()); + + var end = getLastPosition(value, l, c, 1); + var args = newNode(NodeType.ArgumentsType, value, l, c, end); + content.push(args); + + // Skip `)`. + pos++; + + return newNode(type, content, line, column); + } + + /** + * (-) `:nth-child(+8)` + */ + function checkPseudoClass5(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkIdent(i)) i += l;else return 0; + + if (i >= tokensLength) return 0; + if (tokens[i].type !== TokenType.LeftParenthesis) return 0; + + var right = tokens[i].right; + + // Skip `(`. + i++; + + if (l = checkSC(i)) i += l; + + if (l = checkUnary(i)) i += l; + if (tokens[i].type === TokenType.DecimalNumber) i++;else return 0; + + if (l = checkSC(i)) i += l; + + if (i !== right) return 0; + + return i - start + 1; + } + + function getPseudoClass5() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = getIdent(); + content.push(ident); + + // Skip `(`. + pos++; + + var l = tokens[pos].ln; + var c = tokens[pos].col; + var value = []; + + if (checkUnary(pos)) value.push(getUnary()); + if (checkNumber(pos)) value.push(getNumber()); + value = value.concat(getSC()); + + var end = getLastPosition(value, l, c, 1); + var args = newNode(NodeType.ArgumentsType, value, l, c, end); + content.push(args); + + // Skip `)`. + pos++; + + return newNode(type, content, line, column); + } + + /** + * (-) `:checked` + */ + function checkPseudoClass6(i) { + var start = i; + var l = 0; + + // Skip `:`. + i++; + + if (i >= tokensLength) return 0; + + if (l = checkInterpolatedVariable(i)) i += l;else if (l = checkIdent(i)) i += l;else return 0; + + return i - start; + } + + function getPseudoClass6() { + var type = NodeType.PseudocType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `:`. + pos++; + + var ident = checkInterpolatedVariable(pos) ? getInterpolatedVariable() : getIdent(); + content.push(ident); + + return newNode(type, content, line, column); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkRuleset(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkSelectorsGroup(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkBlock(i)) i += l;else return 0; + + return i - start; + } + + function getRuleset() { + var type = NodeType.RulesetType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + content = content.concat(getSelectorsGroup()); + content = content.concat(getSC()); + content.push(getBlock()); + + return newNode(type, content, line, column); + } + + /** + * Check if token is marked as a space (if it's a space or a tab + * or a line break). + * @param {Number} i + * @returns {Number} Number of spaces in a row starting with the given token. + */ + function checkS(i) { + return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0; + } + + /** + * Get node with spaces + * @returns {Array} `['s', x]` where `x` is a string containing spaces + */ + function getS() { + var startPos = pos; + var x = joinValues(pos, tokens[pos].ws_last); + + pos = tokens[pos].ws_last + 1; + + var token = tokens[startPos]; + return newNode(NodeType.SType, x, token.ln, token.col); + } + + /** + * Check if token is a space or a comment. + * @param {Number} i Token's index number + * @returns {Number} Number of similar (space or comment) tokens + * in a row starting with the given token. + */ + function checkSC(i) { + if (i >= tokensLength) return 0; + + var l = undefined; + var lsc = 0; + + while (i < tokensLength) { + if (!(l = checkS(i)) && !(l = checkCommentML(i)) && !(l = checkCommentSL(i))) break; + i += l; + lsc += l; + } + + return lsc || 0; + } + + /** + * Get node with spaces and comments + * @returns {Array} Array containing nodes with spaces (if there are any) + * and nodes with comments (if there are any): + * `[['s', x]*, ['comment', y]*]` where `x` is a string of spaces + * and `y` is a comment's text (without `/*` and `* /`). + */ + function getSC() { + var sc = []; + + if (pos >= tokensLength) return sc; + + while (pos < tokensLength) { + if (checkS(pos)) sc.push(getS());else if (checkCommentML(pos)) sc.push(getCommentML());else if (checkCommentSL(pos)) sc.push(getCommentSL());else break; + } + + return sc; + } + + /** + * Check if token is part of a hexadecimal number (e.g. `#fff`) inside + * a simple selector + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkShash(i) { + var l; + + if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; + + if (l = checkInterpolatedVariable(i + 1) || checkIdent(i + 1)) return l + 1;else return 0; + } + + /** + * Get node with a hexadecimal number (e.g. `#fff`) inside a simple + * selector + * @returns {Array} `['shash', x]` where `x` is a hexadecimal number + * converted to string (without `#`, e.g. `fff`) + */ + function getShash() { + var startPos = pos; + var x = []; + + pos++; + + if (checkInterpolatedVariable(pos)) x.push(getInterpolatedVariable());else x.push(getIdent()); + + var token = tokens[startPos]; + return newNode(NodeType.ShashType, x, token.ln, token.col); + } + + /** + * Check if token is part of a string (text wrapped in quotes) + * @param {Number} i Token's index number + * @returns {Number} `1` if token is part of a string, `0` if not + */ + function checkString(i) { + if (i >= tokensLength) { + return 0; + } + + if (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) { + return 1; + } + + return 0; + } + + /** + * Get string's node + * @returns {Array} `['string', x]` where `x` is a string (including + * quotes). + */ + function getString() { + var startPos = pos; + var x = tokens[pos++].value; + + var token = tokens[startPos]; + return newNode(NodeType.StringType, x, token.ln, token.col); + } + + /** + * Validate stylesheet: it should consist of any number (0 or more) of + * rulesets (sets of rules with selectors), @-rules, whitespaces or + * comments. + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkStylesheet(i) { + var start = i; + var l = undefined; + + // Check every token: + while (i < tokensLength) { + if (l = checkSC(i) || checkAtrule(i) || checkRuleset(i) || checkMixin(i) || checkDeclaration(i) || checkDeclDelim(i)) i += l;else throwError(i); + } + + return i - start; + } + + /** + * @returns {Array} `['stylesheet', x]` where `x` is all stylesheet's + * nodes. + */ + function getStylesheet() { + var startPos = pos; + var x = []; + + while (pos < tokensLength) { + if (checkSC(pos)) x = x.concat(getSC());else if (checkAtrule(pos)) x.push(getAtrule());else if (checkRuleset(pos)) x.push(getRuleset());else if (checkMixin(pos)) x.push(getMixin());else if (checkDeclaration(pos)) x.push(getDeclaration());else if (checkDeclDelim(pos)) x.push(getDeclDelim());else throwError(pos); + } + + var token = tokens[startPos]; + return newNode(NodeType.StylesheetType, x, token.ln, token.col); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkTset(i) { + var l; + + if (l = checkVhash(i)) tokens[i].tset_child = 1;else if (l = checkAny(i)) tokens[i].tset_child = 2;else if (l = checkSC(i)) tokens[i].tset_child = 3;else if (l = checkOperator(i)) tokens[i].tset_child = 4; + + return l; + } + + /** + * @returns {Array} + */ + function getTset() { + var childType = tokens[pos].tset_child; + if (childType === 1) return getVhash();else if (childType === 2) return getAny();else if (childType === 3) return getSC();else if (childType === 4) return getOperator(); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkTsets(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + while (l = checkTset(i)) { + i += l; + } + + return i - start; + } + + /** + * @returns {Array} + */ + function getTsets() { + var x = []; + var t = undefined; + + while (checkTset(pos)) { + t = getTset(); + if (typeof t.content === 'string') x.push(t);else x = x.concat(t); + } + + return x; + } + + /** + * Check if token is an unary (arithmetical) sign (`+` or `-`) + * @param {Number} i Token's index number + * @returns {Number} `1` if token is an unary sign, `0` if not + */ + function checkUnary(i) { + if (i >= tokensLength) { + return 0; + } + + if (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) { + return 1; + } + + return 0; + } + + /** + * Get node with an unary (arithmetical) sign (`+` or `-`) + * @returns {Array} `['unary', x]` where `x` is an unary sign + * converted to string. + */ + function getUnary() { + var startPos = pos; + var x = tokens[pos++].value; + + var token = tokens[startPos]; + return newNode(NodeType.OperatorType, x, token.ln, token.col); + } + + /** + * Check if token is a unicode range (single or multiple nodes) + * @param {number} i Token's index + * @return {number} Unicode range node's length + */ + function checkUnicodeRange(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkUrange(i)) i += l;else return 0; + + while (i < tokensLength) { + var spaceBefore = checkSC(i); + var comma = checkDelim(i + spaceBefore); + if (!comma) break; + + var spaceAfter = checkSC(i + spaceBefore + comma); + if (l = checkUrange(i + spaceBefore + comma + spaceAfter)) { + i += spaceBefore + comma + spaceAfter + l; + } else break; + } + + return i - start; + } + + /** + * Get a unicode range node + * @return {Node} + */ + function getUnicodeRange() { + var type = NodeType.UnicodeRangeType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + while (pos < tokensLength) { + if (checkSC(pos)) content = content.concat(getSC());else if (checkDelim(pos)) content.push(getDelim());else if (checkUrange(pos)) content.push(getUrange());else break; + } + + return newNode(type, content, line, column); + } + + /** + * Check if token is a u-range (part of a unicode-range) + * (1) `U+416` + * (2) `U+400-4ff` + * (3) `U+4??` + * @param {number} i Token's index + * @return {number} Urange node's length + */ + function checkUrange(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + // Check for unicode prefix (u+ or U+) + if (tokens[i].value === 'U' || tokens[i].value === 'u') i += 1;else return 0; + + if (i >= tokensLength) return 0; + + if (tokens[i].value === '+') i += 1;else return 0; + + while (i < tokensLength) { + if (l = checkIdent(i)) i += l;else if (l = checkNumber(i)) i += l;else if (l = checkUnary(i)) i += l;else if (l = _checkUnicodeWildcard(i)) i += l;else break; + } + + tokens[start].urangeEnd = i - 1; + + return i - start; + } + + /** + * Get a u-range node (part of a unicode-range) + * @return {Node} + */ + function getUrange() { + var startPos = pos; + var type = NodeType.UrangeType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + content = joinValues(startPos, tokens[startPos].urangeEnd); + pos = tokens[startPos].urangeEnd + 1; + + return newNode(type, content, line, column); + } + + /** + * Check for unicode wildcard characters `?` + * @param {number} i Token's index + * @return {number} Wildcard length + */ + function _checkUnicodeWildcard(i) { + var start = i; + + if (i >= tokensLength) return 0; + + while (i < tokensLength) { + if (tokens[i].type === TokenType.QuestionMark) i += 1;else break; + } + + return i - start; + } + + /** + * Check if token is part of URI (e.g. `url('/css/styles.css')`) + * @param {Number} i Token's index number + * @returns {Number} Length of URI + */ + function checkUri(i) { + var start = i; + + if (i >= tokensLength || tokens[i++].value !== 'url' || i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; + + return tokens[i].right - start + 1; + } + + /** + * Get node with URI + * @returns {Array} `['uri', x]` where `x` is URI's nodes (without `url` + * and braces, e.g. `['string', ''/css/styles.css'']`). + */ + function getUri() { + var startPos = pos; + var uriExcluding = {}; + var uri = undefined; + var token = undefined; + var l = undefined; + var raw = undefined; + + pos += 2; + + uriExcluding[TokenType.Space] = 1; + uriExcluding[TokenType.Tab] = 1; + uriExcluding[TokenType.Newline] = 1; + uriExcluding[TokenType.LeftParenthesis] = 1; + uriExcluding[TokenType.RightParenthesis] = 1; + + if (checkUri1(pos)) { + uri = [].concat(getSC()).concat([getString()]).concat(getSC()); + } else { + uri = getSC(); + l = checkExcluding(uriExcluding, pos); + token = tokens[pos]; + raw = newNode(NodeType.RawType, joinValues(pos, pos + l), token.ln, token.col); + + uri.push(raw); + + pos += l + 1; + + uri = uri.concat(getSC()); + } + + token = tokens[startPos]; + var line = token.ln; + var column = token.col; + var end = getLastPosition(uri, line, column, 1); + pos++; + return newNode(NodeType.UriType, uri, line, column, end); + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkUri1(i) { + var start = i; + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) { + return 0; + } + + i++; + + if (l = checkSC(i)) i += l; + + return i - start; + } + + /** + * Check if token is part of a value + * @param {Number} i Token's index number + * @returns {Number} Length of the value + */ + function checkValue(i) { + var start = i; + var l = undefined; + var s = undefined; + var _i = undefined; + + while (i < tokensLength) { + s = checkSC(i); + _i = i + s; + + if (l = _checkValue(_i)) i += l + s; + if (!l || checkBlock(_i)) break; + } + + return i - start; + } + + /** + * @param {Number} i Token's index number + * @returns {Number} + */ + function _checkValue(i) { + return checkEscapedString(i) || checkInterpolatedVariable(i) || checkVariable(i) || checkVhash(i) || checkBlock(i) || checkProgid(i) || checkAny(i) || checkAtkeyword(i) || checkOperator(i) || checkImportant(i); + } + + /** + * @returns {Array} + */ + function getValue() { + var startPos = pos; + var x = []; + var s = undefined; + var _pos = undefined; + + while (pos < tokensLength) { + s = checkSC(pos); + _pos = pos + s; + + if (!_checkValue(_pos)) break; + + if (s) x = x.concat(getSC()); + x.push(_getValue()); + } + + var token = tokens[startPos]; + return newNode(NodeType.ValueType, x, token.ln, token.col); + } + + /** + * @returns {Array} + */ + function _getValue() { + if (checkEscapedString(pos)) return getEscapedString();else if (checkInterpolatedVariable(pos)) return getInterpolatedVariable();else if (checkVariable(pos)) return getVariable();else if (checkVhash(pos)) return getVhash();else if (checkBlock(pos)) return getBlock();else if (checkProgid(pos)) return getProgid();else if (checkAny(pos)) return getAny();else if (checkAtkeyword(pos)) return getAtkeyword();else if (checkOperator(pos)) return getOperator();else if (checkImportant(pos)) return getImportant(); + } + + /** + * Check if token is part of LESS variable + * @param {Number} i Token's index number + * @returns {Number} Length of the variable + */ + function checkVariable(i) { + var l; + + if (i >= tokensLength || tokens[i].type !== TokenType.CommercialAt) return 0; + + if (tokens[i - 1] && tokens[i - 1].type === TokenType.CommercialAt && tokens[i - 2] && tokens[i - 2].type === TokenType.CommercialAt) return 0; + + return (l = checkVariable(i + 1) || checkIdent(i + 1)) ? l + 1 : 0; + } + + /** + * Get node with a variable + * @returns {Array} `['variable', ['ident', x]]` where `x` is + * a variable name. + */ + function getVariable() { + var startPos = pos; + var x = []; + + pos++; + + if (checkVariable(pos)) x.push(getVariable());else x.push(getIdent()); + + var token = tokens[startPos]; + return newNode(NodeType.VariableType, x, token.ln, token.col); + } + + /** + * Check if token is part of a variables list (e.g. `@rest...`). + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkVariablesList(i) { + var d = 0; // Number of dots + var l = undefined; + + if (i >= tokensLength) return 0; + + if (l = checkVariable(i)) i += l;else return 0; + + while (tokens[i] && tokens[i].type === TokenType.FullStop) { + d++; + i++; + } + + return d === 3 ? l + d : 0; + } + + /** + * Get node with a variables list + * @returns {Array} `['variableslist', ['variable', ['ident', x]]]` where + * `x` is a variable name. + */ + function getVariablesList() { + var startPos = pos; + var x = [getVariable()]; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + var end = getLastPosition(x, line, column, 3); + pos += 3; + + return newNode(NodeType.VariablesListType, x, line, column, end); + } + + /** + * Check if token is part of a hexadecimal number (e.g. `#fff`) inside + * some value + * @param {Number} i Token's index number + * @returns {Number} + */ + function checkVhash(i) { + var l; + + if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; + + return (l = checkNmName2(i + 1)) ? l + 1 : 0; + } + + /** + * Get node with a hexadecimal number (e.g. `#fff`) inside some value + * @returns {Array} `['vhash', x]` where `x` is a hexadecimal number + * converted to string (without `#`, e.g. `'fff'`). + */ + function getVhash() { + var startPos = pos; + var x = undefined; + var token = tokens[startPos]; + var line = token.ln; + var column = token.col; + + pos++; + + x = getNmName2(); + var end = getLastPosition(x, line, column + 1); + return newNode(NodeType.VhashType, x, line, column, end); + } + + module.exports = function (_tokens, context) { + tokens = _tokens; + tokensLength = tokens.length; + pos = 0; + + return contexts[context](); + }; + + function checkSelectorsGroup(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + if (l = checkSelector(i)) i += l;else return 0; + + while (i < tokensLength) { + var sb = checkSC(i); + var c = checkDelim(i + sb); + if (!c) break; + var sa = checkSC(i + sb + c); + if (l = checkSelector(i + sb + c + sa)) i += sb + c + sa + l;else break; + } + + tokens[start].selectorsGroupEnd = i; + return i - start; + } + + function getSelectorsGroup() { + var selectorsGroup = []; + var selectorsGroupEnd = tokens[pos].selectorsGroupEnd; + + selectorsGroup.push(getSelector()); + + while (pos < selectorsGroupEnd) { + selectorsGroup = selectorsGroup.concat(getSC()); + selectorsGroup.push(getDelim()); + selectorsGroup = selectorsGroup.concat(getSC()); + selectorsGroup.push(getSelector()); + } + + return selectorsGroup; + } + + function checkSelector(i) { + var l; + + if (l = checkSelector1(i)) tokens[i].selectorType = 1;else if (l = checkSelector2(i)) tokens[i].selectorType = 2; + + return l; + } + + function getSelector() { + var selectorType = tokens[pos].selectorType; + if (selectorType === 1) return getSelector1();else return getSelector2(); + } + + /** + * Checks for selector which starts with a compound selector. + */ + function checkSelector1(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + if (l = checkCompoundSelector(i)) i += l;else return 0; + + while (i < tokensLength) { + var s = checkSC(i); + var c = checkCombinator(i + s); + if (!s && !c) break; + if (c) { + i += s + c; + s = checkSC(i); + } + + if (l = checkCompoundSelector(i + s)) i += s + l;else break; + } + + tokens[start].selectorEnd = i; + return i - start; + } + + function getSelector1() { + var type = NodeType.SelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var selectorEnd = token.selectorEnd; + var content = getCompoundSelector(); + + while (pos < selectorEnd) { + if (checkSC(pos)) content = content.concat(getSC());else if (checkCombinator(pos)) content.push(getCombinator());else if (checkCompoundSelector(pos)) content = content.concat(getCompoundSelector()); + } + + return newNode(type, content, line, column); + } + + /** + * Checks for a selector that starts with a combinator. + */ + function checkSelector2(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + if (l = checkCombinator(i)) i += l;else return 0; + + while (i < tokensLength) { + var sb = checkSC(i); + if (l = checkCompoundSelector(i + sb)) i += sb + l;else break; + + var sa = checkSC(i); + var c = checkCombinator(i + sa); + if (!sa && !c) break; + if (c) { + i += sa + c; + } + } + + tokens[start].selectorEnd = i; + return i - start; + } + + function getSelector2() { + var type = NodeType.SelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var selectorEnd = token.selectorEnd; + var content = [getCombinator()]; + + while (pos < selectorEnd) { + if (checkSC(pos)) content = content.concat(getSC());else if (checkCombinator(pos)) content.push(getCombinator());else if (checkCompoundSelector(pos)) content = content.concat(getCompoundSelector()); + } + + return newNode(type, content, line, column); + } + + function checkCompoundSelector(i) { + var l = undefined; + + if (l = checkCompoundSelector1(i)) { + tokens[i].compoundSelectorType = 1; + } else if (l = checkCompoundSelector2(i)) { + tokens[i].compoundSelectorType = 2; + } + + return l; + } + + function getCompoundSelector() { + var type = tokens[pos].compoundSelectorType; + if (type === 1) return getCompoundSelector1(); + if (type === 2) return getCompoundSelector2(); + } + + function checkCompoundSelector1(i) { + if (i >= tokensLength) return 0; + + var start = i; + + var l = undefined; + if (l = checkTypeSelector(i) || checkParentSelectorWithExtension(i)) i += l;else return 0; + + while (i < tokensLength) { + var _l2 = checkShash(i) || checkClass(i) || checkAttributeSelector(i) || checkPseudo(i); + if (_l2) i += _l2;else break; + } + + tokens[start].compoundSelectorEnd = i; + + return i - start; + } + + function getCompoundSelector1() { + var sequence = []; + var compoundSelectorEnd = tokens[pos].compoundSelectorEnd; + + if (checkTypeSelector(pos)) sequence.push(getTypeSelector());else if (checkParentSelectorWithExtension(pos)) sequence = sequence.concat(getParentSelectorWithExtension()); + + while (pos < compoundSelectorEnd) { + if (checkShash(pos)) sequence.push(getShash());else if (checkClass(pos)) sequence.push(getClass());else if (checkAttributeSelector(pos)) sequence.push(getAttributeSelector());else if (checkPseudo(pos)) sequence.push(getPseudo()); + } + + return sequence; + } + + function checkCompoundSelector2(i) { + if (i >= tokensLength) return 0; + + var start = i; + + while (i < tokensLength) { + var l = checkShash(i) || checkClass(i) || checkAttributeSelector(i) || checkPseudo(i); + if (l) i += l;else break; + } + + tokens[start].compoundSelectorEnd = i; + + return i - start; + } + + function getCompoundSelector2() { + var sequence = []; + var compoundSelectorEnd = tokens[pos].compoundSelectorEnd; + + while (pos < compoundSelectorEnd) { + if (checkShash(pos)) sequence.push(getShash());else if (checkClass(pos)) sequence.push(getClass());else if (checkAttributeSelector(pos)) sequence.push(getAttributeSelector());else if (checkPseudo(pos)) sequence.push(getPseudo()); + } + + return sequence; + } + + function checkTypeSelector(i) { + if (i >= tokensLength) return 0; + + var start = i; + var l = undefined; + + if (l = checkNamePrefix(i)) i += l; + + if (tokens[i].type === TokenType.Asterisk) i++;else if (l = checkIdent(i)) i += l;else return 0; + + return i - start; + } + + function getTypeSelector() { + var type = NodeType.TypeSelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (checkNamePrefix(pos)) content.push(getNamePrefix()); + + token = tokens[pos]; + if (token.type === TokenType.Asterisk) { + var asteriskNode = newNode(NodeType.IdentType, '*', token.ln, token.col); + content.push(asteriskNode); + pos++; + } else if (checkIdent(pos)) content.push(getIdent()); + + return newNode(type, content, line, column); + } + + function checkAttributeSelector(i) { + var l = undefined; + if (l = checkAttributeSelector1(i)) tokens[i].attributeSelectorType = 1;else if (l = checkAttributeSelector2(i)) tokens[i].attributeSelectorType = 2; + + return l; + } + + function getAttributeSelector() { + var type = tokens[pos].attributeSelectorType; + if (type === 1) return getAttributeSelector1();else return getAttributeSelector2(); + } + + /** + * (1) `[panda=nani]` + * (2) `[panda='nani']` + * (3) `[panda='nani' i]` + * + */ + function checkAttributeSelector1(i) { + var start = i; + + if (tokens[i].type === TokenType.LeftSquareBracket) i++;else return 0; + + var l = undefined; + if (l = checkSC(i)) i += l; + + if (l = checkAttributeName(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkAttributeMatch(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkAttributeValue(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (l = checkAttributeFlags(i)) { + i += l; + if (l = checkSC(i)) i += l; + } + + if (tokens[i].type === TokenType.RightSquareBracket) i++;else return 0; + + return i - start; + } + + function getAttributeSelector1() { + var type = NodeType.AttributeSelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `[`. + pos++; + + content = content.concat(getSC()); + content.push(getAttributeName()); + content = content.concat(getSC()); + content.push(getAttributeMatch()); + content = content.concat(getSC()); + content.push(getAttributeValue()); + content = content.concat(getSC()); + + if (checkAttributeFlags(pos)) { + content.push(getAttributeFlags()); + content = content.concat(getSC()); + } + + // Skip `]`. + pos++; + + var end = getLastPosition(content, line, column, 1); + return newNode(type, content, line, column, end); + } + + /** + * (1) `[panda]` + */ + function checkAttributeSelector2(i) { + var start = i; + + if (tokens[i].type === TokenType.LeftSquareBracket) i++;else return 0; + + var l = undefined; + if (l = checkSC(i)) i += l; + + if (l = checkAttributeName(i)) i += l;else return 0; + + if (l = checkSC(i)) i += l; + + if (tokens[i].type === TokenType.RightSquareBracket) i++;else return 0; + + return i - start; + } + + function getAttributeSelector2() { + var type = NodeType.AttributeSelectorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + // Skip `[`. + pos++; + + content = content.concat(getSC()); + content.push(getAttributeName()); + content = content.concat(getSC()); + + // Skip `]`. + pos++; + + var end = getLastPosition(content, line, column, 1); + return newNode(type, content, line, column, end); + } + + function checkAttributeName(i) { + var start = i; + var l = undefined; + + if (l = checkNamePrefix(i)) i += l; + + if (l = checkIdent(i)) i += l;else return 0; + + return i - start; + } + + function getAttributeName() { + var type = NodeType.AttributeNameType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (checkNamePrefix(pos)) content.push(getNamePrefix()); + content.push(getIdent()); + + return newNode(type, content, line, column); + } + + function checkAttributeMatch(i) { + var l = undefined; + if (l = checkAttributeMatch1(i)) tokens[i].attributeMatchType = 1;else if (l = checkAttributeMatch2(i)) tokens[i].attributeMatchType = 2; + + return l; + } + + function getAttributeMatch() { + var type = tokens[pos].attributeMatchType; + if (type === 1) return getAttributeMatch1();else return getAttributeMatch2(); + } + + function checkAttributeMatch1(i) { + var start = i; + + var type = tokens[i].type; + if (type === TokenType.Tilde || type === TokenType.VerticalLine || type === TokenType.CircumflexAccent || type === TokenType.DollarSign || type === TokenType.Asterisk) i++;else return 0; + + if (tokens[i].type === TokenType.EqualsSign) i++;else return 0; + + return i - start; + } + + function getAttributeMatch1() { + var type = NodeType.AttributeMatchType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = tokens[pos].value + tokens[pos + 1].value; + pos += 2; + + return newNode(type, content, line, column); + } + + function checkAttributeMatch2(i) { + if (tokens[i].type === TokenType.EqualsSign) return 1;else return 0; + } + + function getAttributeMatch2() { + var type = NodeType.AttributeMatchType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = '='; + + pos++; + return newNode(type, content, line, column); + } + + function checkAttributeValue(i) { + return checkString(i) || checkIdent(i); + } + + function getAttributeValue() { + var type = NodeType.AttributeValueType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (checkString(pos)) content.push(getString());else content.push(getIdent()); + + return newNode(type, content, line, column); + } + + function checkAttributeFlags(i) { + return checkIdent(i); + } + + function getAttributeFlags() { + var type = NodeType.AttributeFlagsType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getIdent()]; + + return newNode(type, content, line, column); + } + + function checkNamePrefix(i) { + if (i >= tokensLength) return 0; + + var l = undefined; + if (l = checkNamePrefix1(i)) tokens[i].namePrefixType = 1;else if (l = checkNamePrefix2(i)) tokens[i].namePrefixType = 2; + + return l; + } + + function getNamePrefix() { + var type = tokens[pos].namePrefixType; + if (type === 1) return getNamePrefix1();else return getNamePrefix2(); + } + + /** + * (1) `panda|` + * (2) `panda|` + */ + function checkNamePrefix1(i) { + var start = i; + var l = undefined; + + if (l = checkNamespacePrefix(i)) i += l;else return 0; + + if (l = checkCommentML(i)) i += l; + + if (l = checkNamespaceSeparator(i)) i += l;else return 0; + + return i - start; + } + + function getNamePrefix1() { + var type = NodeType.NamePrefixType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + content.push(getNamespacePrefix()); + + if (checkCommentML(pos)) content.push(getCommentML()); + + content.push(getNamespaceSeparator()); + + return newNode(type, content, line, column); + } + + /** + * (1) `|` + */ + function checkNamePrefix2(i) { + return checkNamespaceSeparator(i); + } + + function getNamePrefix2() { + var type = NodeType.NamePrefixType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = [getNamespaceSeparator()]; + + return newNode(type, content, line, column); + } + + /** + * (1) `*` + * (2) `panda` + */ + function checkNamespacePrefix(i) { + if (i >= tokensLength) return 0; + + var l = undefined; + + if (tokens[i].type === TokenType.Asterisk) return 1;else if (l = checkIdent(i)) return l;else return 0; + } + + function getNamespacePrefix() { + var type = NodeType.NamespacePrefixType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = []; + + if (tokens[pos].type === TokenType.Asterisk) { + var asteriskNode = newNode(NodeType.IdentType, '*', line, column); + content.push(asteriskNode); + pos++; + } else if (checkIdent(pos)) content.push(getIdent()); + + return newNode(type, content, line, column); + } + + /** + * (1) `|` + */ + function checkNamespaceSeparator(i) { + if (i >= tokensLength) return 0; + + if (tokens[i].type === TokenType.VerticalLine) return 1;else return 0; + } + + function getNamespaceSeparator() { + var type = NodeType.NamespaceSeparatorType; + var token = tokens[pos]; + var line = token.ln; + var column = token.col; + var content = '|'; + + pos++; + return newNode(type, content, line, column); + } + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = function (css, tabSize) { + var TokenType = __webpack_require__(13); + + var tokens = []; + var urlMode = false; + var c = undefined; // Current character + var cn = undefined; // Next character + var pos = 0; + var tn = 0; + var ln = 1; + var col = 1; + + var Punctuation = { + ' ': TokenType.Space, + '\n': TokenType.Newline, + '\r': TokenType.Newline, + '\t': TokenType.Tab, + '!': TokenType.ExclamationMark, + '"': TokenType.QuotationMark, + '#': TokenType.NumberSign, + '$': TokenType.DollarSign, + '%': TokenType.PercentSign, + '&': TokenType.Ampersand, + '\'': TokenType.Apostrophe, + '(': TokenType.LeftParenthesis, + ')': TokenType.RightParenthesis, + '*': TokenType.Asterisk, + '+': TokenType.PlusSign, + ',': TokenType.Comma, + '-': TokenType.HyphenMinus, + '.': TokenType.FullStop, + '/': TokenType.Solidus, + ':': TokenType.Colon, + ';': TokenType.Semicolon, + '<': TokenType.LessThanSign, + '=': TokenType.EqualsSign, + '>': TokenType.GreaterThanSign, + '?': TokenType.QuestionMark, + '@': TokenType.CommercialAt, + '[': TokenType.LeftSquareBracket, + ']': TokenType.RightSquareBracket, + '^': TokenType.CircumflexAccent, + '_': TokenType.LowLine, + '{': TokenType.LeftCurlyBracket, + '|': TokenType.VerticalLine, + '}': TokenType.RightCurlyBracket, + '~': TokenType.Tilde + }; + + /** + * Add a token to the token list + * @param {string} type + * @param {string} value + */ + function pushToken(type, value, column) { + tokens.push({ + tn: tn++, + ln: ln, + col: column, + type: type, + value: value + }); + } + + /** + * Check if a character is a decimal digit + * @param {string} c Character + * @returns {boolean} + */ + function isDecimalDigit(c) { + return '0123456789'.indexOf(c) >= 0; + } + + /** + * Parse spaces + * @param {string} css Unparsed part of CSS string + */ + function parseSpaces(css) { + var start = pos; + + // Read the string until we meet a non-space character: + for (; pos < css.length; pos++) { + if (css.charAt(pos) !== ' ') break; + } + + // Add a substring containing only spaces to tokens: + pushToken(TokenType.Space, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Parse a string within quotes + * @param {string} css Unparsed part of CSS string + * @param {string} q Quote (either `'` or `"`) + */ + function parseString(css, q) { + var start = pos; + + // Read the string until we meet a matching quote: + for (pos++; pos < css.length; pos++) { + // Skip escaped quotes: + if (css.charAt(pos) === '\\') pos++;else if (css.charAt(pos) === q) break; + } + + // Add the string (including quotes) to tokens: + var type = q === '"' ? TokenType.StringDQ : TokenType.StringSQ; + pushToken(type, css.substring(start, pos + 1), col); + col += pos - start; + } + + /** + * Parse numbers + * @param {string} css Unparsed part of CSS string + */ + function parseDecimalNumber(css) { + var start = pos; + + // Read the string until we meet a character that's not a digit: + for (; pos < css.length; pos++) { + if (!isDecimalDigit(css.charAt(pos))) break; + } + + // Add the number to tokens: + pushToken(TokenType.DecimalNumber, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Parse identifier + * @param {string} css Unparsed part of CSS string + */ + function parseIdentifier(css) { + var start = pos; + + // Skip all opening slashes: + while (css.charAt(pos) === '/') pos++; + + // Read the string until we meet a punctuation mark: + for (; pos < css.length; pos++) { + // Skip all '\': + if (css.charAt(pos) === '\\') pos++;else if (css.charAt(pos) in Punctuation) break; + } + + var ident = css.substring(start, pos--); + + // Enter url mode if parsed substring is `url`: + if (!urlMode && ident === 'url' && css.charAt(pos + 1) === '(') { + urlMode = true; + } + + // Add identifier to tokens: + pushToken(TokenType.Identifier, ident, col); + col += pos - start; + } + + /** + * Parse a multiline comment + * @param {string} css Unparsed part of CSS string + */ + function parseMLComment(css) { + var start = pos; + + // Read the string until we meet `*/`. + // Since we already know first 2 characters (`/*`), start reading + // from `pos + 2`: + for (pos = pos + 2; pos < css.length; pos++) { + if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') { + pos++; + break; + } + } + + // Add full comment (including `/*` and `*/`) to the list of tokens: + var comment = css.substring(start, pos + 1); + pushToken(TokenType.CommentML, comment, col); + + var newlines = comment.split('\n'); + if (newlines.length > 1) { + ln += newlines.length - 1; + col = newlines[newlines.length - 1].length; + } else { + col += pos - start; + } + } + + /** + * Parse a single line comment + * @param {string} css Unparsed part of CSS string + */ + function parseSLComment(css) { + var start = pos; + + // Read the string until we meet line break. + // Since we already know first 2 characters (`//`), start reading + // from `pos + 2`: + for (pos += 2; pos < css.length; pos++) { + if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { + break; + } + } + + // Add comment (including `//` and line break) to the list of tokens: + pushToken(TokenType.CommentSL, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Convert a CSS string to a list of tokens + * @param {string} css CSS string + * @returns {Array} List of tokens + * @private + */ + function getTokens(css) { + // Parse string, character by character: + for (pos = 0; pos < css.length; col++, pos++) { + c = css.charAt(pos); + cn = css.charAt(pos + 1); + + // If we meet `/*`, it's a start of a multiline comment. + // Parse following characters as a multiline comment: + if (c === '/' && cn === '*') { + parseMLComment(css); + } + + // If we meet `//` and it is not a part of url: + else if (!urlMode && c === '/' && cn === '/') { + // If we're currently inside a block, treat `//` as a start + // of identifier. Else treat `//` as a start of a single-line + // comment: + parseSLComment(css); + } + + // If current character is a double or single quote, it's a start + // of a string: + else if (c === '"' || c === "'") { + parseString(css, c); + } + + // If current character is a space: + else if (c === ' ') { + parseSpaces(css); + } + + // If current character is a punctuation mark: + else if (c in Punctuation) { + // Add it to the list of tokens: + pushToken(Punctuation[c], c, col); + if (c === '\n' || c === '\r') { + ln++; + col = 0; + } // Go to next line + if (c === ')') urlMode = false; // Exit url mode + else if (c === '\t' && tabSize > 1) col += tabSize - 1; + } + + // If current character is a decimal digit: + else if (isDecimalDigit(c)) { + parseDecimalNumber(css); + } + + // If current character is anything else: + else { + parseIdentifier(css); + } + } + + return tokens; + } + + return getTokens(css); + }; + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = { + mark: __webpack_require__(22), + parse: __webpack_require__(23), + stringify: __webpack_require__(5), + tokenizer: __webpack_require__(24) + }; + module.exports = exports['default']; + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var TokenType = __webpack_require__(13); + + module.exports = (function () { + /** + * Mark whitespaces and comments + */ + function markSC(tokens) { + var tokensLength = tokens.length; + var ws = -1; // Flag for whitespaces + var sc = -1; // Flag for whitespaces and comments + var t = undefined; // Current token + + // For every token in the token list, mark spaces and line breaks + // as spaces (set both `ws` and `sc` flags). Mark multiline comments + // with `sc` flag. + // If there are several spaces or tabs or line breaks or multiline + // comments in a row, group them: take the last one's index number + // and save it to the first token in the group as a reference: + // e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` + // for a group of whitespaces and comments. + for (var i = 0; i < tokensLength; i++) { + t = tokens[i]; + switch (t.type) { + case TokenType.Space: + case TokenType.Tab: + t.ws = true; + t.sc = true; + + if (ws === -1) ws = i; + if (sc === -1) sc = i; + + break; + case TokenType.Newline: + t.ws = true; + t.sc = true; + + ws = ws === -1 ? i : ws; + sc = sc === -1 ? i : ws; + + tokens[ws].ws_last = i - 1; + tokens[sc].sc_last = i - 1; + tokens[i].ws_last = i; + tokens[i].sc_last = i; + + ws = -1; + sc = -1; + + break; + case TokenType.CommentML: + case TokenType.CommentSL: + if (ws !== -1) { + tokens[ws].ws_last = i - 1; + ws = -1; + } + + t.sc = true; + + break; + default: + if (ws !== -1) { + tokens[ws].ws_last = i - 1; + ws = -1; + } + + if (sc !== -1) { + tokens[sc].sc_last = i - 1; + sc = -1; + } + } + } + + if (ws !== -1) tokens[ws].ws_last = i - 1; + if (sc !== -1) tokens[sc].sc_last = i - 1; + } + + /** + * Pair brackets + */ + function markBrackets(tokens) { + var tokensLength = tokens.length; + var ps = []; // Parentheses + var sbs = []; // Square brackets + var cbs = []; // Curly brackets + var t = undefined; // Current token + + // For every token in the token list, if we meet an opening (left) + // bracket, push its index number to a corresponding array. + // If we then meet a closing (right) bracket, look at the corresponding + // array. If there are any elements (records about previously met + // left brackets), take a token of the last left bracket (take + // the last index number from the array and find a token with + // this index number) and save right bracket's index as a reference: + for (var i = 0; i < tokensLength; i++) { + t = tokens[i]; + switch (t.type) { + case TokenType.LeftParenthesis: + ps.push(i); + break; + case TokenType.RightParenthesis: + if (ps.length) { + t.left = ps.pop(); + tokens[t.left].right = i; + } + break; + case TokenType.LeftSquareBracket: + sbs.push(i); + break; + case TokenType.RightSquareBracket: + if (sbs.length) { + t.left = sbs.pop(); + tokens[t.left].right = i; + } + break; + case TokenType.LeftCurlyBracket: + cbs.push(i); + break; + case TokenType.RightCurlyBracket: + if (cbs.length) { + t.left = cbs.pop(); + tokens[t.left].right = i; + } + break; + } + } + } + + function markBlocks(tokens) { + var blocks = {}; + var currentIL = 0; + var i = 0; + var l = tokens.length; + var iw = undefined; + + for (; i !== l; i++) { + if (!tokens[i - 1]) continue; + + // Skip all tokens on current line: + if (tokens[i].type !== TokenType.Newline) continue; + + var end = getBlockEnd(tokens, i + 1, currentIL, iw); + if (!iw) iw = end.iw; + + if (end.indent && end.indent === currentIL) continue; + + // Not found nested block. + if (end.end !== null) { + markBlocksWithIndent(tokens, blocks, end); + + for (var z = end.end + 1; z < l; z++) { + if (tokens[z].type === TokenType.Space || tokens[z].type === TokenType.Tab || tokens[z].type === TokenType.CommentSL || tokens[z].type === TokenType.CommentML) continue; + if (tokens[z].type === TokenType.Newline) i = z; + break; + } + } + + if (!blocks[end.indent]) blocks[end.indent] = []; + blocks[end.indent].push(i + 1); + currentIL = end.indent; + } + + markBlocksWithIndent(tokens, blocks, { end: i - 1, indent: 0 }); + } + + function getBlockEnd(tokens, i, indent, iw, maybeEnd) { + var spaces = ''; + if (!maybeEnd) maybeEnd = i - 1; + + if (!tokens[i]) return { end: maybeEnd, indent: 0 }; + + for (var l = tokens.length; i < l; i++) { + if (tokens[i].type === TokenType.Space || tokens[i].type === TokenType.Tab || tokens[i].type === TokenType.CommentML || tokens[i].type === TokenType.CommentSL || tokens[i].type === TokenType.Newline) { + spaces += tokens[i].value; + continue; + } + + // Got all spaces. + // Find trailing spaces. + var lastNewline = spaces.lastIndexOf('\n'); + spaces = spaces.slice(lastNewline + 1); + + // Mark previous node as block end. + if (!spaces) return { end: maybeEnd, indent: 0 }; + + if (!iw) iw = spaces.length; + var newIndent = spaces.length / iw; + + if (newIndent < indent) return { end: maybeEnd, indent: newIndent, iw: iw }; + + if (newIndent === indent) { + // Look for line end + for (; i < l; i++) { + if (tokens[i].type !== TokenType.Newline) continue; + var end = getBlockEnd(tokens, i + 1, indent, iw, maybeEnd); + return { end: end.end, indent: indent, iw: iw }; + } + + return { end: i - 1, indent: newIndent, iw: iw }; + } else { + // If newIndent > indent + return { end: null, indent: newIndent, iw: iw }; + } + } + + return { end: i - 1 }; + } + + function markBlocksWithIndent(tokens, blocks, end) { + for (var indent in blocks) { + if (indent < end.indent + 1) continue; + var block = blocks[indent]; + if (!block) continue; + + for (var x = 0; x < block.length; x++) { + var y = block[x]; + tokens[y].block_end = end.end; + } + blocks[indent] = null; + } + } + + return function (tokens) { + markBrackets(tokens); + markSC(tokens); + markBlocks(tokens); + }; + })(); + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict';var Node=__webpack_require__(1);var NodeType=__webpack_require__(15);var TokenType=__webpack_require__(13);var tokens=undefined;var tokensLength=undefined;var pos=undefined;var contexts={'arguments':function(){return checkArguments(pos) && getArguments();},'atkeyword':function(){return checkAtkeyword(pos) && getAtkeyword();},'atrule':function(){return checkAtrule(pos) && getAtrule();},'block':function(){return checkBlock(pos) && getBlock();},'brackets':function(){return checkBrackets(pos) && getBrackets();},'class':function(){return checkClass(pos) && getClass();},'combinator':function(){return checkCombinator(pos) && getCombinator();},'commentML':function(){return checkCommentML(pos) && getCommentML();},'commentSL':function(){return checkCommentSL(pos) && getCommentSL();},'condition':function(){return checkCondition(pos) && getCondition();},'conditionalStatement':function(){return checkConditionalStatement(pos) && getConditionalStatement();},'declaration':function(){return checkDeclaration(pos) && getDeclaration();},'declDelim':function(){return checkDeclDelim(pos) && getDeclDelim();},'default':function(){return checkDefault(pos) && getDefault();},'delim':function(){return checkDelim(pos) && getDelim();},'dimension':function(){return checkDimension(pos) && getDimension();},'expression':function(){return checkExpression(pos) && getExpression();},'extend':function(){return checkExtend(pos) && getExtend();},'function':function(){return checkFunction(pos) && getFunction();},'global':function(){return checkGlobal(pos) && getGlobal();},'ident':function(){return checkIdent(pos) && getIdent();},'important':function(){return checkImportant(pos) && getImportant();},'include':function(){return checkInclude(pos) && getInclude();},'interpolation':function(){return checkInterpolation(pos) && getInterpolation();},'loop':function(){return checkLoop(pos) && getLoop();},'mixin':function(){return checkMixin(pos) && getMixin();},'namespace':function(){return checkNamespace(pos) && getNamespace();},'number':function(){return checkNumber(pos) && getNumber();},'operator':function(){return checkOperator(pos) && getOperator();},'optional':function(){return checkOptional(pos) && getOptional();},'parentheses':function(){return checkParentheses(pos) && getParentheses();},'parentselector':function(){return checkParentSelector(pos) && getParentSelector();},'percentage':function(){return checkPercentage(pos) && getPercentage();},'placeholder':function(){return checkPlaceholder(pos) && getPlaceholder();},'progid':function(){return checkProgid(pos) && getProgid();},'property':function(){return checkProperty(pos) && getProperty();},'propertyDelim':function(){return checkPropertyDelim(pos) && getPropertyDelim();},'pseudoc':function(){return checkPseudoc(pos) && getPseudoc();},'pseudoe':function(){return checkPseudoe(pos) && getPseudoe();},'ruleset':function(){return checkRuleset(pos) && getRuleset();},'s':function(){return checkS(pos) && getS();},'selector':function(){return checkSelector(pos) && getSelector();},'shash':function(){return checkShash(pos) && getShash();},'string':function(){return checkString(pos) && getString();},'stylesheet':function(){return checkStylesheet(pos) && getStylesheet();},'unary':function(){return checkUnary(pos) && getUnary();},'unicodeRange':function(){return checkUnicodeRange(pos) && getUnicodeRange();},'urange':function(){return checkUrange(pos) && getUrange();},'uri':function(){return checkUri(pos) && getUri();},'value':function(){return checkValue(pos) && getValue();},'variable':function(){return checkVariable(pos) && getVariable();},'variableslist':function(){return checkVariablesList(pos) && getVariablesList();},'vhash':function(){return checkVhash(pos) && getVhash();}}; /** + * Stops parsing and display error. + * + * @param {number=} opt_i Token's index number + */function throwError(opt_i){var ln=opt_i?tokens[opt_i].ln:tokens[pos].ln;throw {line:ln,syntax:'sass'};} /** + * @param {!Object} exclude + * @param {number} i Token's index number + * @return {number} + */function checkExcluding(exclude,i){var start=i;while(i < tokensLength) {if(exclude[tokens[i++].type])break;}return i - start - 2;} /** + * @param {number} start + * @param {number} finish + * @return {string} + */function joinValues(start,finish){var s='';for(var i=start;i < finish + 1;i++) {s += tokens[i].value;}return s;} /** + * @param {number} start + * @param {number} num + * @return {string} + */function joinValues2(start,num){if(start + num - 1 >= tokensLength)return;var s='';for(var i=0;i < num;i++) {s += tokens[start + i].value;}return s;} /** + * @param {string|!Array} content + * @param {number} line + * @param {number} column + * @param {number} colOffset + */function getLastPosition(content,line,column,colOffset){return typeof content === 'string'?getLastPositionForString(content,line,column,colOffset):getLastPositionForArray(content,line,column,colOffset);} /** + * @param {string} content + * @param {number} line + * @param {number} column + * @param {number} colOffset + */function getLastPositionForString(content,line,column,colOffset){var position=[];if(!content){position = [line,column];if(colOffset)position[1] += colOffset - 1;return position;}var lastLinebreak=content.lastIndexOf('\n');var endsWithLinebreak=lastLinebreak === content.length - 1;var splitContent=content.split('\n');var linebreaksCount=splitContent.length - 1;var prevLinebreak=linebreaksCount === 0 || linebreaksCount === 1?-1:content.length - splitContent[linebreaksCount - 1].length - 2; // Line: + var offset=endsWithLinebreak?linebreaksCount - 1:linebreaksCount;position[0] = line + offset; // Column: + if(endsWithLinebreak){offset = prevLinebreak !== -1?content.length - prevLinebreak:content.length - 1;}else {offset = linebreaksCount !== 0?content.length - lastLinebreak - column - 1:content.length - 1;}position[1] = column + offset;if(!colOffset)return position;if(endsWithLinebreak){position[0]++;position[1] = colOffset;}else {position[1] += colOffset;}return position;} /** + * @param {!Array} content + * @param {number} line + * @param {number} column + * @param {number} colOffset + */function getLastPositionForArray(content,line,column,colOffset){var position;if(content.length === 0){position = [line,column];}else {var c=content[content.length - 1];if(c.hasOwnProperty('end')){position = [c.end.line,c.end.column];}else {position = getLastPosition(c.content,line,column);}}if(!colOffset)return position;if(tokens[pos - 1].type !== 'Newline'){position[1] += colOffset;}else {position[0]++;position[1] = 1;}return position;} /** + * @param {string} type + * @param {string|!Array} content + * @param {number} line + * @param {number} column + * @param {!Array} end + */function newNode(type,content,line,column,end){if(!end)end = getLastPosition(content,line,column);return new Node({type:type,content:content,start:{line:line,column:column},end:{line:end[0],column:end[1]},syntax:'sass'});} /** + * @param {number} i Token's index number + * @return {number} + */function checkAny(i){var l;if(l = checkBrackets(i))tokens[i].any_child = 1;else if(l = checkParentheses(i))tokens[i].any_child = 2;else if(l = checkString(i))tokens[i].any_child = 3;else if(l = checkVariablesList(i))tokens[i].any_child = 4;else if(l = checkVariable(i))tokens[i].any_child = 5;else if(l = checkPlaceholder(i))tokens[i].any_child = 6;else if(l = checkPercentage(i))tokens[i].any_child = 7;else if(l = checkDimension(i))tokens[i].any_child = 8;else if(l = checkUnicodeRange(i))tokens[i].any_child = 17;else if(l = checkNumber(i))tokens[i].any_child = 9;else if(l = checkUri(i))tokens[i].any_child = 10;else if(l = checkExpression(i))tokens[i].any_child = 11;else if(l = checkFunction(i))tokens[i].any_child = 12;else if(l = checkInterpolation(i))tokens[i].any_child = 13;else if(l = checkIdent(i))tokens[i].any_child = 14;else if(l = checkClass(i))tokens[i].any_child = 15;else if(l = checkUnary(i))tokens[i].any_child = 16;return l;} /** + * @return {!Node} + */function getAny(){var childType=tokens[pos].any_child;if(childType === 1)return getBrackets();else if(childType === 2)return getParentheses();else if(childType === 3)return getString();else if(childType === 4)return getVariablesList();else if(childType === 5)return getVariable();else if(childType === 6)return getPlaceholder();else if(childType === 7)return getPercentage();else if(childType === 8)return getDimension();else if(childType === 17)return getUnicodeRange();else if(childType === 9)return getNumber();else if(childType === 10)return getUri();else if(childType === 11)return getExpression();else if(childType === 12)return getFunction();else if(childType === 13)return getInterpolation();else if(childType === 14)return getIdent();else if(childType === 15)return getClass();else if(childType === 16)return getUnary();} /** + * Checks if token is part of mixin's arguments. + * + * @param {number} i Token's index number + * @return {number} Length of arguments + */function checkArguments(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;i++;while(i < tokens[start].right) {if(l = checkArgument(i))i += l;else return 0;}return tokens[start].right - start + 1;} /** + * Checks if token is valid to be part of arguments list + * + * @param {number} i Token's index number + * @return {number} Length of argument + */function checkArgument(i){var l;if(l = checkBrackets(i))tokens[i].argument_child = 1;else if(l = checkParentheses(i))tokens[i].argument_child = 2;else if(l = checkDeclaration(i))tokens[i].argument_child = 3;else if(l = checkFunction(i))tokens[i].argument_child = 4;else if(l = checkVariablesList(i))tokens[i].argument_child = 5;else if(l = checkVariable(i))tokens[i].argument_child = 6;else if(l = checkSC(i))tokens[i].argument_child = 7;else if(l = checkDelim(i))tokens[i].argument_child = 8;else if(l = checkDeclDelim(i))tokens[i].argument_child = 9;else if(l = checkString(i))tokens[i].argument_child = 10;else if(l = checkPercentage(i))tokens[i].argument_child = 11;else if(l = checkDimension(i))tokens[i].argument_child = 12;else if(l = checkNumber(i))tokens[i].argument_child = 13;else if(l = checkUri(i))tokens[i].argument_child = 14;else if(l = checkInterpolation(i))tokens[i].argument_child = 15;else if(l = checkIdent(i))tokens[i].argument_child = 16;else if(l = checkVhash(i))tokens[i].argument_child = 17;else if(l = checkOperator(i))tokens[i].argument_child = 18;else if(l = checkUnary(i))tokens[i].argument_child = 19;else if(l = checkParentSelector(i))tokens[i].argument_child = 20;else if(l = checkImportant(i))tokens[i].argument_child = 21;return l;} /** + * @return {!Node} + */function getArgument(){var childType=tokens[pos].argument_child;if(childType === 1)return getBrackets();else if(childType === 2)return getParentheses();else if(childType === 3)return getDeclaration();else if(childType === 4)return getFunction();else if(childType === 5)return getVariablesList();else if(childType === 6)return getVariable();else if(childType === 7)return getSC();else if(childType === 8)return getDelim();else if(childType === 9)return getDeclDelim();else if(childType === 10)return getString();else if(childType === 11)return getPercentage();else if(childType === 12)return getDimension();else if(childType === 13)return getNumber();else if(childType === 14)return getUri();else if(childType === 15)return getInterpolation();else if(childType === 16)return getIdent();else if(childType === 17)return getVhash();else if(childType === 18)return getOperator();else if(childType === 19)return getUnary();else if(childType === 20)return getParentSelector();else if(childType === 21)return getImportant();} /** + * Checks if token is part of an @-word (e.g. `@import`, `@include`). + * + * @param {number} i Token's index number + * @return {number} + */function checkAtkeyword(i){var l; // Check that token is `@`: + if(i >= tokensLength || tokens[i++].type !== TokenType.CommercialAt)return 0;return (l = checkIdentOrInterpolation(i))?l + 1:0;} /** + * Gets node with @-word. + * + * @return {!Node} + */function getAtkeyword(){var startPos=pos++;var x=getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.AtkeywordType,x,token.ln,token.col);} /** + * Checks if token is a part of an @-rule. + * + * @param {number} i Token's index number + * @return {number} Length of @-rule + */function checkAtrule(i){var l;if(i >= tokensLength)return 0; // If token already has a record of being part of an @-rule, + // return the @-rule's length: + if(tokens[i].atrule_l !== undefined)return tokens[i].atrule_l; // If token is part of an @-rule, save the rule's type to token. + // @keyframes: + if(l = checkKeyframesRule(i))tokens[i].atrule_type = 4; // @-rule with ruleset: + else if(l = checkAtruler(i))tokens[i].atrule_type = 1; // Block @-rule: + else if(l = checkAtruleb(i))tokens[i].atrule_type = 2; // Single-line @-rule: + else if(l = checkAtrules(i))tokens[i].atrule_type = 3;else return 0; // If token is part of an @-rule, save the rule's length to token: + tokens[i].atrule_l = l;return l;} /** + * Gets node with @-rule. + * + * @return {!Node} + */function getAtrule(){switch(tokens[pos].atrule_type){case 1:return getAtruler(); // @-rule with ruleset + case 2:return getAtruleb(); // Block @-rule + case 3:return getAtrules(); // Single-line @-rule + case 4:return getKeyframesRule();}} /** + * Checks if token is part of a block @-rule. + * + * @param {number} i Token's index number + * @return {number} Length of the @-rule + */function checkAtruleb(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(l = checkTsets(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Gets node with a block @-rule. + * + * @return {!Node} + */function getAtruleb(){var startPos=pos;var x=undefined;x = [getAtkeyword()].concat(getTsets()).concat([getBlock()]);var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);} /** + * Checks if token is part of an @-rule with ruleset. + * + * @param {number} i Token's index number + * @return {number} Length of the @-rule + */function checkAtruler(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(l = checkTsets(i))i += l;if(l = checkAtrulers(i))i += l;else return 0;return i - start;} /** + * Gets node with an @-rule with ruleset. + * + * @return {!Node} + */function getAtruler(){var startPos=pos;var x=undefined;x = [getAtkeyword()].concat(getTsets());x.push(getAtrulers());var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkAtrulers(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(!tokens[i].block_end)return 0;if(l = checkSC(i))i += l;if(l = checkRuleset(i) || checkAtrule(i))i += l;else return 0;while(l = checkRuleset(i) || checkAtrule(i) || checkSC(i)) {i += l;}if(i < tokensLength)tokens[i].atrulers_end = 1;return i - start;} /** + * @return {!Node} + */function getAtrulers(){var startPos=pos;var token=tokens[startPos];var line=token.ln;var column=token.col;var x=getSC();while(pos < tokensLength && !tokens[pos].atrulers_end) {if(checkSC(pos))x = x.concat(getSC());else if(checkAtrule(pos))x.push(getAtrule());else if(checkRuleset(pos))x.push(getRuleset());}var end=getLastPosition(x,line,column);return newNode(NodeType.BlockType,x,token.ln,token.col,end);} /** + * @param {number} i Token's index number + * @return {number} + */function checkAtrules(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(l = checkTsets(i))i += l;return i - start;} /** + * @return {!Node} + */function getAtrules(){var startPos=pos;var x=undefined;x = [getAtkeyword()].concat(getTsets());var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);} /** + * Checks if token is part of a block (e.g. `{...}`). + * + * @param {number} i Token's index number + * @return {number} Length of the block + */function checkBlock(i){return i < tokensLength && tokens[i].block_end?tokens[i].block_end - i + 1:0;} /** + * Gets node with a block. + * + * @return {!Node} + */function getBlock(){var startPos=pos;var end=tokens[pos].block_end;var x=[];var token=tokens[startPos];while(pos < end) {if(checkBlockdecl(pos))x = x.concat(getBlockdecl());else throwError();}return newNode(NodeType.BlockType,x,token.ln,token.col);} /** + * Checks if token is part of a declaration (property-value pair). + * + * @param {number} i Token's index number + * @return {number} Length of the declaration + */function checkBlockdecl(i){var l;if(i >= tokensLength)return 0;if(l = checkBlockdecl7(i))tokens[i].bd_type = 7;else if(l = checkBlockdecl5(i))tokens[i].bd_type = 5;else if(l = checkBlockdecl6(i))tokens[i].bd_type = 6;else if(l = checkBlockdecl1(i))tokens[i].bd_type = 1;else if(l = checkBlockdecl2(i))tokens[i].bd_type = 2;else if(l = checkBlockdecl3(i))tokens[i].bd_type = 3;else if(l = checkBlockdecl4(i))tokens[i].bd_type = 4;else return 0;return l;} /** + * @return {!Array} + */function getBlockdecl(){switch(tokens[pos].bd_type){case 1:return getBlockdecl1();case 2:return getBlockdecl2();case 3:return getBlockdecl3();case 4:return getBlockdecl4();case 5:return getBlockdecl5();case 6:return getBlockdecl6();case 7:return getBlockdecl7();}} /** + * @param {number} i Token's index number + * @return {number} + */function checkBlockdecl1(i){var start=i;var l=undefined;if(l = checkInclude(i))tokens[i].bd_kind = 2;else if(l = checkDeclaration(i))tokens[i].bd_kind = 5;else if(l = checkAtrule(i))tokens[i].bd_kind = 6;else return 0;i += l;if(tokens[start].bd_kind === 2 && [2,4,6,8].indexOf(tokens[start].include_type) === -1)return 0;if(tokens[start].bd_kind === 6 && tokens[start].atrule_type === 3)return 0;while(i < tokensLength) {if(l = checkDeclDelim(i))return i + l - start;if(l = checkS(i))i += l;else if(l = checkCommentSL(i))i += l;else break;}return 0;} /** + * @return {!Array} + */function getBlockdecl1(){var x=[];var _x=[];var kind=tokens[pos].bd_kind;switch(kind){case 2:x.push(getInclude());break;case 5:x.push(getDeclaration());break;case 6:x.push(getAtrule());break;}while(pos < tokensLength) {var _pos=pos;if(checkDeclDelim(pos)){_x.push(getDeclDelim());x = x.concat(_x);break;}if(checkS(pos))_x.push(getS());else if(checkCommentSL(pos))_x.push(getCommentSL());else {pos = _pos;break;}}return x;} /** + * @param {number} i Token's index number + * @return {number} + */function checkBlockdecl2(i){var start=i;var l=undefined;if(l = checkConditionalStatement(i))tokens[i].bd_kind = 1;else if(l = checkInclude(i))tokens[i].bd_kind = 2;else if(l = checkExtend(i))tokens[i].bd_kind = 4;else if(l = checkMixin(i))tokens[i].bd_kind = 8;else if(l = checkLoop(i))tokens[i].bd_kind = 3;else if(l = checkRuleset(i))tokens[i].bd_kind = 7;else if(l = checkDeclaration(i))tokens[i].bd_kind = 5;else if(l = checkAtrule(i))tokens[i].bd_kind = 6;else return 0;i += l;while(i < tokensLength) {if(l = checkS(i))i += l;else if(l = checkCommentSL(i))i += l;else break;}return i - start;} /** + * @return {!Array} + */function getBlockdecl2(){var x=[];switch(tokens[pos].bd_kind){case 1:x.push(getConditionalStatement());break;case 2:x.push(getInclude());break;case 3:x.push(getLoop());break;case 4:x.push(getExtend());break;case 5:x.push(getDeclaration());break;case 6:x.push(getAtrule());break;case 7:x.push(getRuleset());break;case 8:x.push(getMixin());break;}while(pos < tokensLength) {if(checkS(pos))x.push(getS());else if(checkCommentSL(pos))x.push(getCommentSL());else break;}return x;} /** + * @param {number} i Token's index number + * @return {number} + */function checkBlockdecl3(i){var start=i;var l=undefined;if(l = checkConditionalStatement(i))tokens[i].bd_kind = 1;else if(l = checkInclude(i))tokens[i].bd_kind = 2;else if(l = checkExtend(i))tokens[i].bd_kind = 4;else if(l = checkLoop(i))tokens[i].bd_kind = 3;else if(l = checkRuleset(i))tokens[i].bd_kind = 7;else if(l = checkDeclaration(i))tokens[i].bd_kind = 5;else if(l = checkAtrule(i))tokens[i].bd_kind = 6;else return 0;i += l;return i - start;} /** + * @return {!Array} + */function getBlockdecl3(){var x=undefined;switch(tokens[pos].bd_kind){case 1:x = getConditionalStatement();break;case 2:x = getInclude();break;case 3:x = getLoop();break;case 4:x = getExtend();break;case 5:x = getDeclaration();break;case 6:x = getAtrule();break;case 7:x = getRuleset();break;}return [x];} /** + * @param {number} i Token's index number + * @return {number} + */function checkBlockdecl4(i){return checkSC(i);} /** + * @return {!Array} + */function getBlockdecl4(){return getSC();} /** + * @param {number} i Token's index number + * @return {number} + */function checkBlockdecl5(i){var start=i;var l=undefined;if(l = checkInclude(i))i += l;else if(l = checkRuleset(i))i += l;else return 0;while(i < tokensLength) {if(l = checkS(i))i += l;else if(l = checkCommentSL(i))i += l;else break;}return i - start;} /** + * @return {!Array} + */function getBlockdecl5(){var x=[];if(checkInclude(pos))x.push(getInclude());else x.push(getRuleset());while(pos < tokensLength) {if(checkS(pos))x.push(getS());else if(checkCommentSL(pos))x.push(getCommentSL());else break;}return x;} /** + * @param {number} i Token's index number + * @return {number} + */function checkBlockdecl6(i){var start=i;var l=undefined;if(l = checkInclude(i))i += l;else if(l = checkRuleset(i))i += l;else return 0;return i - start;} /** + * @return {!Array} + */function getBlockdecl6(){var x=undefined;if(checkInclude(pos))x = getInclude();else x = getRuleset();return [x];} /** + * @param {number} i Token's index number + * @return {number} + */function checkBlockdecl7(i){var start=i;var l=undefined;if(l = checkInclude(i))i += l;else return 0;if([2,4,6,8].indexOf(tokens[start].include_type) === -1)return 0;while(i < tokensLength) {if(l = checkDeclDelim(i))return i + l - start;if(l = checkS(i))i += l;else if(l = checkCommentSL(i))i += l;else break;}return 0;} /** + * @return {!Array} + */function getBlockdecl7(){var x=[];var _x=[];x.push(getInclude());while(pos < tokensLength) {var _pos=pos;if(checkDeclDelim(pos)){_x.push(getDeclDelim());x = x.concat(_x);break;}if(checkS(pos))_x.push(getS());else if(checkCommentSL(pos))_x.push(getCommentSL());else {pos = _pos;break;}}return x;} /** + * Checks if token is part of text inside square brackets, e.g. `[1]`. + * + * @param {number} i Token's index number + * @return {number} + */function checkBrackets(i){if(i >= tokensLength || tokens[i].type !== TokenType.LeftSquareBracket)return 0;return tokens[i].right - i + 1;} /** + * Gets node with text inside square brackets, e.g. `[1]`. + * + * @return {!Node} + */function getBrackets(){var startPos=pos;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;var tsets=getTsets();var end=getLastPosition(tsets,line,column,1);pos++;return newNode(NodeType.BracketsType,tsets,token.ln,token.col,end);} /** + * Checks if token is part of a class selector (e.g. `.abc`). + * + * @param {number} i Token's index number + * @return {number} Length of the class selector + */function checkClass(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(tokens[i].class_l)return tokens[i].class_l;if(tokens[i++].type !== TokenType.FullStop)return 0; // Check for `-` at beginning + if(tokens[i].type === TokenType.HyphenMinus)i += 1;if(l = checkIdentOrInterpolation(i))i += l;else return 0;while(i < tokensLength) {if(l = checkIdentOrInterpolation(i) || checkNumber(i))i += l;else if(tokens[i].type === TokenType.HyphenMinus)i += 1;else break;}tokens[start].classEnd = i;return i - start;} /** + * Gets node with a class selector. + * + * @return {!Node} + */function getClass(){var startPos=pos;var type=NodeType.ClassType;var token=tokens[startPos];var line=token.ln;var column=token.col;var content=[];var end=token.classEnd; // Skip `.` + pos++;while(pos < end) {if(checkIdentOrInterpolation(pos)){content = content.concat(getIdentOrInterpolation());}else if(checkNumber(pos)){content = content.concat(getNumber());}else if(tokens[pos].type === TokenType.HyphenMinus){content.push(newNode(NodeType.IdentType,tokens[pos].value,tokens[pos].ln,tokens[pos].col));pos++;}else break;}return newNode(type,content,line,column);} /** + * @param {number} i + * @return {number} + */function checkCombinator(i){if(i >= tokensLength)return 0;var l=undefined;if(l = checkCombinator1(i))tokens[i].combinatorType = 1;else if(l = checkCombinator2(i))tokens[i].combinatorType = 2;else if(l = checkCombinator3(i))tokens[i].combinatorType = 3;return l;} /** + * @return {!Node} + */function getCombinator(){var type=tokens[pos].combinatorType;if(type === 1)return getCombinator1();if(type === 2)return getCombinator2();if(type === 3)return getCombinator3();} /** + * (1) `||` + * + * @param {number} i + * @return {number} + */function checkCombinator1(i){if(tokens[i].type === TokenType.VerticalLine && tokens[i + 1].type === TokenType.VerticalLine)return 2;else return 0;} /** + * @return {!Node} + */function getCombinator1(){var type=NodeType.CombinatorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content='||';pos += 2;return newNode(type,content,line,column);} /** + * (1) `>` + * (2) `+` + * (3) `~` + * + * @param {number} i + * @return {number} + */function checkCombinator2(i){var type=tokens[i].type;if(type === TokenType.PlusSign || type === TokenType.GreaterThanSign || type === TokenType.Tilde)return 1;else return 0;}function getCombinator2(){var type=NodeType.CombinatorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=tokens[pos++].value;return newNode(type,content,line,column);} /** + * (1) `/panda/` + */function checkCombinator3(i){var start=i;if(tokens[i].type === TokenType.Solidus)i++;else return 0;var l=undefined;if(l = checkIdent(i))i += l;else return 0;if(tokens[i].type === TokenType.Solidus)i++;else return 0;return i - start;}function getCombinator3(){var type=NodeType.CombinatorType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `/`. + pos++;var ident=getIdent(); // Skip `/`. + pos++;var content='/' + ident.content + '/';return newNode(type,content,line,column);} /** + * Check if token is a multiline comment. + * @param {number} i Token's index number + * @return {number} `1` if token is a multiline comment, otherwise `0` + */function checkCommentML(i){return i < tokensLength && tokens[i].type === TokenType.CommentML?1:0;} /** + * Get node with a multiline comment + * @return {Array} `['commentML', x]` where `x` + * is the comment's text (without `/*` and `* /`). + */function getCommentML(){var startPos=pos;var x=tokens[pos].value.substring(2);var token=tokens[startPos];var line=token.ln;var column=token.col;var end=getLastPosition(x,line,column + 2);pos++;return newNode(NodeType.CommentMLType,x,token.ln,token.col,end);} /** + * Check if token is part of a single-line comment. + * @param {number} i Token's index number + * @return {number} `1` if token is a single-line comment, otherwise `0` + */function checkCommentSL(i){return i < tokensLength && tokens[i].type === TokenType.CommentSL?1:0;} /** + * Get node with a single-line comment. + * @return {Array} `['commentSL', x]` where `x` is comment's message + * (without `//`) + */function getCommentSL(){var startPos=pos;var token=tokens[startPos];var line=token.ln;var column=token.col;var x=tokens[pos++].value.substring(2);var end=!x?[line,column + 1]:getLastPosition(x,line,column + 2);return newNode(NodeType.CommentSLType,x,token.ln,token.col,end);} /** + * Check if token is part of a condition + * (e.g. `@if ...`, `@else if ...` or `@else ...`). + * @param {number} i Token's index number + * @return {number} Length of the condition + */function checkCondition(i){var start=i;var l=undefined;var _i=undefined;var s=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(['if','else'].indexOf(tokens[start + 1].value) < 0)return 0;while(i < tokensLength) {if(l = checkBlock(i))break;s = checkSC(i);_i = i + s;if(l = _checkCondition(_i))i += l + s;else break;}return i - start;}function _checkCondition(i){return checkVariable(i) || checkNumber(i) || checkInterpolation(i) || checkIdent(i) || checkOperator(i) || checkCombinator(i) || checkString(i);} /** + * Get node with a condition. + * @return {Array} `['condition', x]` + */function getCondition(){var startPos=pos;var x=[getAtkeyword()];while(pos < tokensLength) {if(checkBlock(pos))break;var s=checkSC(pos);var _pos=pos + s;if(!_checkCondition(_pos))break;if(s)x = x.concat(getSC());x.push(_getCondition());}var token=tokens[startPos];return newNode(NodeType.ConditionType,x,token.ln,token.col);}function _getCondition(){if(checkVariable(pos))return getVariable();if(checkNumber(pos))return getNumber();if(checkInterpolation(pos))return getInterpolation();if(checkIdent(pos))return getIdent();if(checkOperator(pos))return getOperator();if(checkCombinator(pos))return getCombinator();if(checkString(pos))return getString();} /** + * Check if token is part of a conditional statement + * (e.g. `@if ... {} @else if ... {} @else ... {}`). + * @param {number} i Token's index number + * @return {number} Length of the condition + */function checkConditionalStatement(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkCondition(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with a condition. + * @return {Array} `['condition', x]` + */function getConditionalStatement(){var startPos=pos;var x=[];x.push(getCondition());x = x.concat(getSC());x.push(getBlock());var token=tokens[startPos];return newNode(NodeType.ConditionalStatementType,x,token.ln,token.col);} /** + * Check if token is part of a declaration (property-value pair) + * @param {number} i Token's index number + * @return {number} Length of the declaration + */function checkDeclaration(i){return checkDeclaration1(i) || checkDeclaration2(i);} /** + * Get node with a declaration + * @return {Array} `['declaration', ['property', x], ['propertyDelim'], + * ['value', y]]` + */function getDeclaration(){return checkDeclaration1(pos)?getDeclaration1():getDeclaration2();} /** + * Check if token is part of a declaration (property-value pair) + * @param {number} i Token's index number + * @return {number} Length of the declaration + */function checkDeclaration1(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkProperty(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkPropertyDelim(i))i++;else return 0;if(l = checkValue(i))return i + l - start;if(l = checkS(i))i += l;if(l = checkValue(i))i += l;else return 0;return i - start;} /** + * Get node with a declaration + * @return {Array} `['declaration', ['property', x], ['propertyDelim'], + * ['value', y]]` + */function getDeclaration1(){var startPos=pos;var x=[];x.push(getProperty());if(checkS(pos))x.push(getS());x.push(getPropertyDelim());if(checkS(pos))x.push(getS());x.push(getValue());var token=tokens[startPos];return newNode(NodeType.DeclarationType,x,token.ln,token.col);} /** + * Check if token is part of a declaration (property-value pair) + * @param {number} i Token's index number + * @return {number} Length of the declaration + */function checkDeclaration2(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkPropertyDelim(i))i++;else return 0;if(l = checkProperty(i))i += l;else return 0;if(l = checkValue(i))return i + l - start;if(l = checkSC(i))i += l;if(l = checkValue(i))i += l;else return 0;return i - start;} /** + * Get node with a declaration + * @return {Array} `['declaration', ['propertyDelim'], ['property', x], + * ['value', y]]` + */function getDeclaration2(){var startPos=pos;var x=[];x.push(getPropertyDelim());x.push(getProperty());x = x.concat(getSC());x.push(getValue());var token=tokens[startPos];return newNode(NodeType.DeclarationType,x,token.ln,token.col);} /** + * Check if token is a semicolon + * @param {number} i Token's index number + * @return {number} `1` if token is a semicolon, otherwise `0` + */function checkDeclDelim(i){if(i >= tokensLength)return 0;return tokens[i].type === TokenType.Newline || tokens[i].type === TokenType.Semicolon?1:0;} /** + * Get node with a semicolon + * @return {Array} `['declDelim']` + */function getDeclDelim(){var startPos=pos++;var token=tokens[startPos];return newNode(NodeType.DeclDelimType,'\n',token.ln,token.col);} /** + * Check if token if part of `!default` word. + * @param {number} i Token's index number + * @return {number} Length of the `!default` word + */function checkDefault(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark)return 0;if(l = checkSC(i))i += l;if(tokens[i].value === 'default'){tokens[start].defaultEnd = i;return i - start + 1;}else {return 0;}} /** + * Get node with a `!default` word + * @return {Array} `['default', sc]` where `sc` is optional whitespace + */function getDefault(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.defaultEnd);pos = token.defaultEnd + 1;return newNode(NodeType.DefaultType,content,line,column);} /** + * Check if token is a comma + * @param {number} i Token's index number + * @return {number} `1` if token is a comma, otherwise `0` + */function checkDelim(i){return i < tokensLength && tokens[i].type === TokenType.Comma?1:0;} /** + * Get node with a comma + * @return {Array} `['delim']` + */function getDelim(){var startPos=pos++;var token=tokens[startPos];return newNode(NodeType.DelimType,',',token.ln,token.col);} /** + * Check if token is part of a number with dimension unit (e.g. `10px`) + * @param {Number} i Token's index number + * @return {Number} + */function checkDimension(i){var ln=checkNumber(i);var li=undefined;if(i >= tokensLength || !ln || i + ln >= tokensLength)return 0;return (li = checkUnit(i + ln))?ln + li:0;} /** + * Get node of a number with dimension unit + * @return {Node} + */function getDimension(){var type=NodeType.DimensionType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[getNumber(),getUnit()];return newNode(type,content,line,column);} /** + * Check if token is unit + * @param {Number} i Token's index number + * @return {Number} + */function checkUnit(i){var units=['em','ex','ch','rem','vh','vw','vmin','vmax','px','mm','q','cm','in','pt','pc','deg','grad','rad','turn','s','ms','Hz','kHz','dpi','dpcm','dppx'];return units.indexOf(tokens[i].value) !== -1?1:0;} /** + * Get unit node of type ident + * @return {Node} An ident node containing the unit value + */function getUnit(){var type=NodeType.IdentType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=token.value;pos++;return newNode(type,content,line,column);} /** + * @param {number} i Token's index number + * @return {number} + */function checkExpression(i){var start=i;if(i >= tokensLength || tokens[i++].value !== 'expression' || i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis){return 0;}return tokens[i].right - start + 1;} /** + * @return {Array} + */function getExpression(){var startPos=pos;var x=undefined;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;x = joinValues(pos + 1,tokens[pos].right - 1);var end=getLastPosition(x,line,column,1);if(end[0] === line)end[1] += 11;pos = tokens[pos].right + 1;return newNode(NodeType.ExpressionType,x,token.ln,token.col,end);}function checkExtend(i){var l=0;if(l = checkExtend1(i))tokens[i].extend_child = 1;else if(l = checkExtend2(i))tokens[i].extend_child = 2;return l;}function getExtend(){var type=tokens[pos].extend_child;if(type === 1)return getExtend1();else if(type === 2)return getExtend2();} /** + * Checks if token is part of an extend with `!optional` flag. + * @param {number} i + */function checkExtend1(i){var start=i;var l;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'extend')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkSelectorsGroup(i))i += l;else return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkOptional(i))i += l;else return 0;return i - start;}function getExtend1(){var startPos=pos;var x=[].concat([getAtkeyword()],getSC(),getSelectorsGroup(),getSC(),getOptional());var token=tokens[startPos];return newNode(NodeType.ExtendType,x,token.ln,token.col);} /** + * Checks if token is part of an extend without `!optional` flag. + * @param {number} i + */function checkExtend2(i){var start=i;var l;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'extend')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkSelectorsGroup(i))i += l;else return 0;return i - start;}function getExtend2(){var startPos=pos;var x=[].concat([getAtkeyword()],getSC(),getSelectorsGroup());var token=tokens[startPos];return newNode(NodeType.ExtendType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkFunction(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis?tokens[i].right - start + 1:0;} /** + * @return {Array} + */function getFunction(){var startPos=pos;var x=getIdentOrInterpolation();var body=undefined;body = getArguments();x.push(body);var token=tokens[startPos];return newNode(NodeType.FunctionType,x,token.ln,token.col);} /** + * @return {Array} + */function getArguments(){var startPos=pos;var x=[];var body=undefined;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;while(pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) {if(checkDeclaration(pos))x.push(getDeclaration());else if(checkArgument(pos)){body = getArgument();if(typeof body.content === 'string')x.push(body);else x = x.concat(body);}else if(checkClass(pos))x.push(getClass());else throwError();}var end=getLastPosition(x,line,column,1);pos++;return newNode(NodeType.ArgumentsType,x,token.ln,token.col,end);} /** + * Check if token is part of `!global` word + * @param {number} i Token's index number + * @return {number} + */function checkGlobal(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark)return 0;if(l = checkSC(i))i += l;if(tokens[i].value === 'global'){tokens[start].globalEnd = i;return i - start + 1;}else {return 0;}} /** + * Get node with `!global` word + */function getGlobal(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.globalEnd);pos = token.globalEnd + 1;return newNode(NodeType.GlobalType,content,line,column);} /** + * Check if token is part of an identifier + * @param {number} i Token's index number + * @return {number} Length of the identifier + */function checkIdent(i){var start=i;if(i >= tokensLength)return 0;if(tokens[i].type === TokenType.HyphenMinus && tokens[i + 1].type === TokenType.DecimalNumber)return 0;if(tokens[i].type === TokenType.HyphenMinus)i++;if(tokens[i].type === TokenType.LowLine || tokens[i].type === TokenType.Identifier)i++;else return 0;for(;i < tokensLength;i++) {if(tokens[i].type !== TokenType.HyphenMinus && tokens[i].type !== TokenType.LowLine && tokens[i].type !== TokenType.Identifier && tokens[i].type !== TokenType.DecimalNumber)break;}tokens[start].ident_last = i - 1;return i - start;} /** + * Get node with an identifier + * @return {Array} `['ident', x]` where `x` is identifier's name + */function getIdent(){var startPos=pos;var x=joinValues(pos,tokens[pos].ident_last);pos = tokens[pos].ident_last + 1;var token=tokens[startPos];return newNode(NodeType.IdentType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @returns {number} Length of the identifier + */function checkPartialIdent(i){var start=i;if(i >= tokensLength)return 0;for(;i < tokensLength;i++) {if(tokens[i].type !== TokenType.HyphenMinus && tokens[i].type !== TokenType.LowLine && tokens[i].type !== TokenType.Identifier && tokens[i].type !== TokenType.DecimalNumber)break;}tokens[start].ident_last = i - 1;return i - start;}function checkIdentOrInterpolation(i){var start=i;var l=undefined;while(i < tokensLength) {if(l = checkInterpolation(i) || checkIdent(i))i += l;else break;}return i - start;}function getIdentOrInterpolation(){var x=[];while(pos < tokensLength) {if(checkInterpolation(pos))x.push(getInterpolation());else if(checkIdent(pos))x.push(getIdent());else break;}return x;} /** + * Check if token is part of `!important` word + * @param {number} i Token's index number + * @return {number} + */function checkImportant(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark)return 0;if(l = checkSC(i))i += l;if(tokens[i].value === 'important'){tokens[start].importantEnd = i;return i - start + 1;}else {return 0;}} /** + * Get node with `!important` word + * @return {Array} `['important', sc]` where `sc` is optional whitespace + */function getImportant(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.importantEnd);pos = token.importantEnd + 1;return newNode(NodeType.ImportantType,content,line,column);} /** + * Check if token is part of an included mixin (`@include` or `@extend` + * directive). + * @param {number} i Token's index number + * @return {number} Length of the included mixin + */function checkInclude(i){var l;if(i >= tokensLength)return 0;if(l = checkInclude1(i))tokens[i].include_type = 1;else if(l = checkInclude2(i))tokens[i].include_type = 2;else if(l = checkInclude3(i))tokens[i].include_type = 3;else if(l = checkInclude4(i))tokens[i].include_type = 4;else if(l = checkInclude5(i))tokens[i].include_type = 5;else if(l = checkInclude6(i))tokens[i].include_type = 6;else if(l = checkInclude7(i))tokens[i].include_type = 7;else if(l = checkInclude8(i))tokens[i].include_type = 8;return l;} /** + * Get node with included mixin + * @return {Array} `['include', x]` + */function getInclude(){switch(tokens[pos].include_type){case 1:return getInclude1();case 2:return getInclude2();case 3:return getInclude3();case 4:return getInclude4();case 5:return getInclude5();case 6:return getInclude6();case 7:return getInclude7();case 8:return getInclude8();}} /** + * Check if token is part of an included mixin like `@include nani(foo) {...}` + * @param {number} i Token's index number + * @return {number} Length of the include + */function checkInclude1(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkArguments(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with included mixin like `@include nani(foo) {...}` + * @return {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, + * ['arguments', z], sc, ['block', q], sc` where `x` is `include` or + * `extend`, `y` is mixin's identifier (selector), `z` are arguments + * passed to the mixin, `q` is block passed to the mixin and `sc` + * are optional whitespaces + */function getInclude1(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation(),getSC(),getArguments(),getSC(),getBlock());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an included mixin like `@include nani(foo)` + * @param {number} i Token's index number + * @return {number} Length of the include + */function checkInclude2(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkArguments(i))i += l;else return 0;return i - start;} /** + * Get node with included mixin like `@include nani(foo)` + * @return {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, + * ['arguments', z], sc]` where `x` is `include` or `extend`, `y` is + * mixin's identifier (selector), `z` are arguments passed to the + * mixin and `sc` are optional whitespaces + */function getInclude2(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation(),getSC(),getArguments());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an included mixin with a content block passed + * as an argument (e.g. `@include nani {...}`) + * @param {number} i Token's index number + * @return {number} Length of the mixin + */function checkInclude3(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with an included mixin with a content block passed + * as an argument (e.g. `@include nani {...}`) + * @return {Array} `['include', x]` + */function getInclude3(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation(),getSC(),getBlock());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkInclude4(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;} /** + * @return {Array} `['include', x]` + */function getInclude4(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an included mixin like `+nani(foo) {...}` + * @param {number} i Token's index number + * @return {number} Length of the include + */function checkInclude5(i){var start=i;var l=undefined;if(tokens[i].type === TokenType.PlusSign)i++;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkArguments(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with included mixin like `+nani(foo) {...}` + * @return {Array} `['include', ['operator', '+'], ['selector', x], sc, + * ['arguments', y], sc, ['block', z], sc` where `x` is + * mixin's identifier (selector), `y` are arguments passed to the + * mixin, `z` is block passed to mixin and `sc` are optional whitespaces + */function getInclude5(){var startPos=pos;var x=[].concat(getOperator(),getIdentOrInterpolation(),getSC(),getArguments(),getSC(),getBlock());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an included mixin like `+nani(foo)` + * @param {number} i Token's index number + * @return {number} Length of the include + */function checkInclude6(i){var start=i;var l=undefined;if(tokens[i].type === TokenType.PlusSign)i++;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkArguments(i))i += l;else return 0;return i - start;} /** + * Get node with included mixin like `+nani(foo)` + * @return {Array} `['include', ['operator', '+'], ['selector', y], sc, + * ['arguments', z], sc]` where `y` is + * mixin's identifier (selector), `z` are arguments passed to the + * mixin and `sc` are optional whitespaces + */function getInclude6(){var startPos=pos;var x=[].concat(getOperator(),getIdentOrInterpolation(),getSC(),getArguments());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an included mixin with a content block passed + * as an argument (e.g. `+nani {...}`) + * @param {number} i Token's index number + * @return {number} Length of the mixin + */function checkInclude7(i){var start=i;var l=undefined;if(tokens[i].type === TokenType.PlusSign)i++;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with an included mixin with a content block passed + * as an argument (e.g. `+nani {...}`) + * @return {Array} `['include', x]` + */function getInclude7(){var startPos=pos;var x=[].concat(getOperator(),getIdentOrInterpolation(),getSC(),getBlock());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkInclude8(i){var start=i;var l=undefined;if(tokens[i].type === TokenType.PlusSign)i++;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;} /** + * @return {Array} `['include', x]` + */function getInclude8(){var startPos=pos;var x=[].concat(getOperator(),getIdentOrInterpolation());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an interpolated variable (e.g. `#{$nani}`). + * @param {number} i Token's index number + * @return {number} + */function checkInterpolation(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.NumberSign || !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket)return 0;i += 2;while(tokens[i].type !== TokenType.RightCurlyBracket) {if(l = checkArgument(i))i += l;else return 0;}return tokens[i].type === TokenType.RightCurlyBracket?i - start + 1:0;} /** + * Get node with an interpolated variable + * @return {Array} `['interpolation', x]` + */function getInterpolation(){var startPos=pos;var x=[];var token=tokens[startPos];var line=token.ln;var column=token.col; // Skip `#{`: + pos += 2;while(pos < tokensLength && tokens[pos].type !== TokenType.RightCurlyBracket) {var body=getArgument();if(typeof body.content === 'string')x.push(body);else x = x.concat(body);}var end=getLastPosition(x,line,column,1); // Skip `}`: + pos++;return newNode(NodeType.InterpolationType,x,token.ln,token.col,end);} /** + * Check a single keyframe block - `5% {}` + * @param {number} i + * @return {number} + */function checkKeyframesBlock(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkKeyframesSelectorsGroup(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get a single keyframe block - `5% {}` + * @return {Node} + */function getKeyframesBlock(){var type=NodeType.RulesetType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[].concat(getKeyframesSelectorsGroup(),getSC(),[getBlock()]);return newNode(type,content,line,column);} /** + * Check all keyframe blocks - `5% {} 100% {}` + * @param {number} i + * @return {number} + */function checkKeyframesBlocks(i){return i < tokensLength && tokens[i].block_end?tokens[i].block_end - i + 1:0;} /** + * Get all keyframe blocks - `5% {} 100% {}` + * @return {Node} + */function getKeyframesBlocks(){var type=NodeType.BlockType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];var keyframesBlocksEnd=token.block_end;while(pos < keyframesBlocksEnd) {if(checkSC(pos))content = content.concat(getSC());else if(checkKeyframesBlock(pos))content.push(getKeyframesBlock());else if(checkAtrule(pos))content.push(getAtrule()); // @content + else break;}return newNode(type,content,line,column);} /** + * Check if token is part of a @keyframes rule. + * @param {number} i Token's index number + * @return {number} Length of the @keyframes rule + */function checkKeyframesRule(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;var atruleName=joinValues2(i - l,l);if(atruleName.indexOf('keyframes') === -1)return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkKeyframesBlocks(i))i += l;else return 0;return i - start;} /** + * @return {Node} + */function getKeyframesRule(){var type=NodeType.AtruleType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[].concat([getAtkeyword()],getSC(),getIdentOrInterpolation(),getSC(),[getKeyframesBlocks()]);return newNode(type,content,line,column);} /** + * Check a single keyframe selector - `5%`, `from` etc + * @param {number} i + * @return {number} + */function checkKeyframesSelector(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkIdent(i)){ // Valid selectors are only `from` and `to`. + var selector=joinValues2(i,l);if(selector !== 'from' && selector !== 'to')return 0;i += l;tokens[start].keyframesSelectorType = 1;}else if(l = checkPercentage(i)){i += l;tokens[start].keyframesSelectorType = 2;}else if(l = checkInterpolation(i)){i += l;tokens[start].keyframesSelectorType = 3;}else {return 0;}return i - start;} /** + * Get a single keyframe selector + * @return {Node} + */function getKeyframesSelector(){var keyframesSelectorType=NodeType.KeyframesSelectorType;var selectorType=NodeType.SelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(token.keyframesSelectorType === 1){content.push(getIdent());}else if(token.keyframesSelectorType === 2){content.push(getPercentage());}else if(token.keyframesSelectorType === 3){content.push(getInterpolation());}var keyframesSelector=newNode(keyframesSelectorType,content,line,column);return newNode(selectorType,[keyframesSelector],line,column);} /** + * Check the keyframe's selector groups + * @param {number} i + * @return {number} + */function checkKeyframesSelectorsGroup(i){var start=i;var l=undefined;if(l = checkKeyframesSelector(i))i += l;else return 0;while(i < tokensLength) {var sb=checkSC(i);var c=checkDelim(i + sb);if(!c)break;var sa=checkSC(i + sb + c);if(l = checkKeyframesSelector(i + sb + c + sa))i += sb + c + sa + l;else break;}tokens[start].selectorsGroupEnd = i;return i - start;} /** + * Get the keyframe's selector groups + * @return {Array} An array of keyframe selectors + */function getKeyframesSelectorsGroup(){var selectorsGroup=[];var selectorsGroupEnd=tokens[pos].selectorsGroupEnd;selectorsGroup.push(getKeyframesSelector());while(pos < selectorsGroupEnd) {selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup.push(getDelim());selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup.push(getKeyframesSelector());}return selectorsGroup;} /** + * Check if token is part of a loop. + * @param {number} i Token's index number + * @return {number} Length of the loop + */function checkLoop(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(['for','each','while'].indexOf(tokens[start + 1].value) < 0)return 0;while(i < tokensLength) {if(l = checkBlock(i)){i += l;break;}else if(l = checkVariable(i) || checkNumber(i) || checkInterpolation(i) || checkIdent(i) || checkSC(i) || checkOperator(i) || checkCombinator(i) || checkString(i))i += l;else return 0;}return i - start;} /** + * Get node with a loop. + * @return {Array} `['loop', x]` + */function getLoop(){var startPos=pos;var x=[];x.push(getAtkeyword());while(pos < tokensLength) {if(checkBlock(pos)){x.push(getBlock());break;}else if(checkVariable(pos))x.push(getVariable());else if(checkNumber(pos))x.push(getNumber());else if(checkInterpolation(pos))x.push(getInterpolation());else if(checkIdent(pos))x.push(getIdent());else if(checkOperator(pos))x.push(getOperator());else if(checkCombinator(pos))x.push(getCombinator());else if(checkSC(pos))x = x.concat(getSC());else if(checkString(pos))x.push(getString());}var token=tokens[startPos];return newNode(NodeType.LoopType,x,token.ln,token.col);} /** + * Check if token is part of a mixin + * @param {number} i Token's index number + * @return {number} Length of the mixin + */function checkMixin(i){return checkMixin1(i) || checkMixin2(i);} /** + * Get node with a mixin + * @return {Array} `['mixin', x]` + */function getMixin(){return checkMixin1(pos)?getMixin1():getMixin2();} /** + * Check if token is part of a mixin + * @param {number} i Token's index number + * @return {number} Length of the mixin + */function checkMixin1(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if((l = checkAtkeyword(i)) && tokens[i + 1].value === 'mixin')i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else {if(l = checkArguments(i))i += l;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;}return i - start;} /** + * Get node with a mixin + * @return {Array} `['mixin', x]` + */function getMixin1(){var startPos=pos;var x=[getAtkeyword()];x = x.concat(getSC());if(checkIdentOrInterpolation(pos))x = x.concat(getIdentOrInterpolation());x = x.concat(getSC());if(checkBlock(pos))x.push(getBlock());else {if(checkArguments(pos))x.push(getArguments());x = x.concat(getSC());x.push(getBlock());}var token=tokens[startPos];return newNode(NodeType.MixinType,x,token.ln,token.col);} /** + * Check if token is part of a mixin + * @param {number} i Token's index number + * @return {number} Length of the mixin + */function checkMixin2(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(tokens[i].type === TokenType.EqualsSign)i++;else return 0;if(l = checkSC(i))i += l;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else {if(l = checkArguments(i))i += l;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;}return i - start;} /** + * Get node with a mixin + * @return {Array} `['mixin', x]` + */function getMixin2(){var startPos=pos;var x=[getOperator()];x = x.concat(getSC());if(checkIdentOrInterpolation(pos))x = x.concat(getIdentOrInterpolation());x = x.concat(getSC());if(checkBlock(pos))x.push(getBlock());else {if(checkArguments(pos))x.push(getArguments());x = x.concat(getSC());x.push(getBlock());}var token=tokens[startPos];return newNode(NodeType.MixinType,x,token.ln,token.col);} /** + * Check if token is a namespace sign (`|`) + * @param {number} i Token's index number + * @return {number} `1` if token is `|`, `0` if not + */function checkNamespace(i){return i < tokensLength && tokens[i].type === TokenType.VerticalLine?1:0;} /** + * Get node with a namespace sign + * @return {Array} `['namespace']` + */function getNamespace(){var startPos=pos++;var token=tokens[startPos];return newNode(NodeType.NamespaceType,'|',token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkNmName2(i){if(tokens[i].type === TokenType.Identifier)return 1;else if(tokens[i].type !== TokenType.DecimalNumber)return 0;i++;return i < tokensLength && tokens[i].type === TokenType.Identifier?2:1;} /** + * @return {string} + */function getNmName2(){var s=tokens[pos].value;if(tokens[pos++].type === TokenType.DecimalNumber && pos < tokensLength && tokens[pos].type === TokenType.Identifier)s += tokens[pos++].value;return s;} /** + * Check if token is part of a number + * @param {number} i Token's index number + * @return {number} Length of number + */function checkNumber(i){if(i >= tokensLength)return 0;if(tokens[i].number_l)return tokens[i].number_l; // `10`: + if(i < tokensLength && tokens[i].type === TokenType.DecimalNumber && (!tokens[i + 1] || tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop)){tokens[i].number_l = 1;return 1;} // `10.`: + if(i < tokensLength && tokens[i].type === TokenType.DecimalNumber && tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && (!tokens[i + 2] || tokens[i + 2].type !== TokenType.DecimalNumber)){tokens[i].number_l = 2;return 2;} // `.10`: + if(i < tokensLength && tokens[i].type === TokenType.FullStop && tokens[i + 1].type === TokenType.DecimalNumber){tokens[i].number_l = 2;return 2;} // `10.10`: + if(i < tokensLength && tokens[i].type === TokenType.DecimalNumber && tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber){tokens[i].number_l = 3;return 3;}return 0;} /** + * Get node with number + * @return {Array} `['number', x]` where `x` is a number converted + * to string. + */function getNumber(){var s='';var startPos=pos;var l=tokens[pos].number_l;for(var j=0;j < l;j++) {s += tokens[pos + j].value;}pos += l;var token=tokens[startPos];return newNode(NodeType.NumberType,s,token.ln,token.col);} /** + * Check if token is an operator (`/`, `%`, `,`, `:` or `=`). + * @param {number} i Token's index number + * @return {number} `1` if token is an operator, otherwise `0` + */function checkOperator(i){if(i >= tokensLength)return 0;switch(tokens[i].type){case TokenType.Solidus:case TokenType.PercentSign:case TokenType.Comma:case TokenType.Colon:case TokenType.EqualsSign:case TokenType.EqualitySign:case TokenType.InequalitySign:case TokenType.LessThanSign:case TokenType.GreaterThanSign:case TokenType.Asterisk:return 1;}return 0;} /** + * Get node with an operator + * @return {Array} `['operator', x]` where `x` is an operator converted + * to string. + */function getOperator(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.OperatorType,x,token.ln,token.col);} /** + * Check if token is part of `!optional` word + * @param {number} i Token's index number + * @return {number} + */function checkOptional(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark)return 0;if(l = checkSC(i))i += l;if(tokens[i].value === 'optional'){tokens[start].optionalEnd = i;return i - start + 1;}else {return 0;}} /** + * Get node with `!optional` word + */function getOptional(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.optionalEnd);pos = token.optionalEnd + 1;return newNode(NodeType.OptionalType,content,line,column);} /** + * Check if token is part of text inside parentheses, e.g. `(1)` + * @param {number} i Token's index number + * @return {number} + */function checkParentheses(i){if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;return tokens[i].right - i + 1;} /** + * Get node with text inside parentheses, e.g. `(1)` + * @return {Node} + */function getParentheses(){var type=NodeType.ParenthesesType;var token=tokens[pos];var line=token.ln;var column=token.col;pos++;var tsets=getTsets();var end=getLastPosition(tsets,line,column,1);pos++;return newNode(type,tsets,line,column,end);} /** + * Check if token is a parent selector, e.g. `&` + * @param {number} i Token's index number + * @return {number} + */function checkParentSelector(i){return i < tokensLength && tokens[i].type === TokenType.Ampersand?1:0;} /** + * Get node with a parent selector + * @return {Node} + */function getParentSelector(){var startPos=pos;var token=tokens[startPos];pos++;return newNode(NodeType.ParentSelectorType,'&',token.ln,token.col);} /** + * Check if token is a parent selector extension, e.g. `&--foo-bar` + * @param {number} i Token's index number + * @returns {number} Length of the parent selector extension + */function checkParentSelectorExtension(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;while(i < tokensLength) {if(l = checkNumber(i) || checkPartialIdent(i) || checkIdentOrInterpolation(i))i += l;else break;}return i - start;} /** + * Get parent selector extension node + * @return {Node} + */function getParentSelectorExtension(){var type=NodeType.ParentSelectorExtensionType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];while(pos < tokensLength) {if(checkNumber(pos)){content.push(getNumber());}else if(checkPartialIdent(pos)){content.push(getIdent());}else if(checkIdentOrInterpolation(pos)){content = content.concat(getIdentOrInterpolation());}else break;}return newNode(type,content,line,column);} /** + * Check if token is a parent selector with an extension or not + * @param {number} i Token's index number + * @return {number} Length of the parent selector and extension if applicable + */function checkParentSelectorWithExtension(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkParentSelector(i))i += l;else return 0;if(l = checkParentSelectorExtension(i))i += l;return i - start;} /** + * Get parent selector node and extension node if applicable + * @return {Array} + */function getParentSelectorWithExtension(){var content=[getParentSelector()];if(checkParentSelectorExtension(pos))content.push(getParentSelectorExtension());return content;} /** + * Check if token is part of a number or an interpolation with a percent sign + * (e.g. `10%`). + * @param {number} i Token's index number + * @return {number} + */function checkPercentage(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkNumberOrInterpolation(i))i += l;else return 0;if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.PercentSign)return 0;return i - start + 1;} /** + * Get a percentage node that contains either a number or an interpolation + * @return {Object} The percentage node + */function getPercentage(){var startPos=pos;var token=tokens[startPos];var line=token.ln;var column=token.col;var content=getNumberOrInterpolation();var end=getLastPosition(content,line,column,1); // Skip % + pos++;return newNode(NodeType.PercentageType,content,token.ln,token.col,end);} /** + * Check if token is a number or an interpolation + * @param {number} i Token's index number + * @return {number} + */function checkNumberOrInterpolation(i){var start=i;var l=undefined;while(i < tokensLength) {if(l = checkInterpolation(i) || checkNumber(i))i += l;else break;}return i - start;} /** + * Get a number and/or interpolation node + * @return {Array} An array containing a single or multiple nodes + */function getNumberOrInterpolation(){var content=[];while(pos < tokensLength) {if(checkInterpolation(pos))content.push(getInterpolation());else if(checkNumber(pos))content.push(getNumber());else break;}return content;} /** + * Check if token is part of a placeholder selector (e.g. `%abc`). + * @param {number} i Token's index number + * @return {number} Length of the selector + */function checkPlaceholder(i){var l;if(i >= tokensLength)return 0;if(tokens[i].placeholder_l)return tokens[i].placeholder_l;if(tokens[i].type !== TokenType.PercentSign){return 0;}if(l = checkIdentOrInterpolation(i + 1)){tokens[i].placeholder_l = l + 1;return l + 1;}return 0;} /** + * Get node with a placeholder selector + * @return {Array} `['placeholder', ['ident', x]]` where x is a placeholder's + * identifier (without `%`, e.g. `abc`). + */function getPlaceholder(){var startPos=pos;pos++;var x=getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.PlaceholderType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkProgid(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(joinValues2(i,6) === 'progid:DXImageTransform.Microsoft.')i += 6;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(tokens[i].type === TokenType.LeftParenthesis){tokens[start].progid_end = tokens[i].right;i = tokens[i].right + 1;}else return 0;return i - start;} /** + * @return {Array} + */function getProgid(){var startPos=pos;var progid_end=tokens[pos].progid_end;var x=joinValues(pos,progid_end);pos = progid_end + 1;var token=tokens[startPos];return newNode(NodeType.ProgidType,x,token.ln,token.col);} /** + * Check if token is part of a property + * @param {number} i Token's index number + * @return {number} Length of the property + */function checkProperty(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkVariable(i) || checkIdentOrInterpolation(i))i += l;else return 0;return i - start;} /** + * Get node with a property + * @return {Array} `['property', x]` + */function getProperty(){var startPos=pos;var x=[];if(checkVariable(pos)){x.push(getVariable());}else {x = x.concat(getIdentOrInterpolation());}var token=tokens[startPos];return newNode(NodeType.PropertyType,x,token.ln,token.col);} /** + * Check if token is a colon + * @param {number} i Token's index number + * @return {number} `1` if token is a colon, otherwise `0` + */function checkPropertyDelim(i){return i < tokensLength && tokens[i].type === TokenType.Colon?1:0;} /** + * Get node with a colon + * @return {Array} `['propertyDelim']` + */function getPropertyDelim(){var startPos=pos++;var token=tokens[startPos];return newNode(NodeType.PropertyDelimType,':',token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkPseudo(i){return checkPseudoe(i) || checkPseudoc(i);} /** + * @return {Array} + */function getPseudo(){if(checkPseudoe(pos))return getPseudoe();if(checkPseudoc(pos))return getPseudoc();} /** + * @param {number} i Token's index number + * @return {number} + */function checkPseudoe(i){var l;if(i >= tokensLength || tokens[i++].type !== TokenType.Colon || i >= tokensLength || tokens[i++].type !== TokenType.Colon)return 0;return (l = checkIdentOrInterpolation(i))?l + 2:0;} /** + * @return {Array} + */function getPseudoe(){var startPos=pos;pos += 2;var x=getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.PseudoeType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkPseudoc(i){var l;if(i >= tokensLength || tokens[i].type !== TokenType.Colon)return 0;if(l = checkPseudoClass3(i))tokens[i].pseudoClassType = 3;else if(l = checkPseudoClass4(i))tokens[i].pseudoClassType = 4;else if(l = checkPseudoClass5(i))tokens[i].pseudoClassType = 5;else if(l = checkPseudoClass1(i))tokens[i].pseudoClassType = 1;else if(l = checkPseudoClass2(i))tokens[i].pseudoClassType = 2;else if(l = checkPseudoClass6(i))tokens[i].pseudoClassType = 6;else return 0;return l;} /** + * @return {Array} + */function getPseudoc(){var childType=tokens[pos].pseudoClassType;if(childType === 1)return getPseudoClass1();if(childType === 2)return getPseudoClass2();if(childType === 3)return getPseudoClass3();if(childType === 4)return getPseudoClass4();if(childType === 5)return getPseudoClass5();if(childType === 6)return getPseudoClass6();} /** + * (-) `:not(panda)` + */function checkPseudoClass1(i){var start=i; // Skip `:`. + i++;if(i >= tokensLength)return 0;var l=undefined;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSelectorsGroup(i))i += l;else return 0;if(i !== right)return 0;return right - start + 1;} /** + * (-) `:not(panda)` + */function getPseudoClass1(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[]; // Skip `:`. + pos++;content = content.concat(getIdentOrInterpolation());{var _type=NodeType.ArgumentsType;var _token=tokens[pos];var _line=_token.ln;var _column=_token.col; // Skip `(`. + pos++;var selectors=getSelectorsGroup();var end=getLastPosition(selectors,_line,_column,1);var args=newNode(_type,selectors,_line,_column,end);content.push(args); // Skip `)`. + pos++;}return newNode(type,content,line,column);} /** + * (1) `:nth-child(odd)` + * (2) `:nth-child(even)` + * (3) `:lang(de-DE)` + */function checkPseudoClass2(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSC(i))i += l;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(i !== right)return 0;return i - start + 1;}function getPseudoClass2(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[]; // Skip `:`. + pos++;content = content.concat(getIdentOrInterpolation());var l=tokens[pos].ln;var c=tokens[pos].col;var value=[]; // Skip `(`. + pos++;value = value.concat(getSC()).concat(getIdentOrInterpolation()).concat(getSC());var end=getLastPosition(value,l,c,1);var args=newNode(NodeType.ArgumentsType,value,l,c,end);content.push(args); // Skip `)`. + pos++;return newNode(type,content,line,column);} /** + * (-) `:nth-child(-3n + 2)` + */function checkPseudoClass3(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSC(i))i += l;if(l = checkUnary(i))i += l;if(l = checkNumberOrInterpolation(i))i += l;if(i >= tokensLength)return 0;if(tokens[i].value === 'n')i++;else return 0;if(l = checkSC(i))i += l;if(i >= tokensLength)return 0;if(tokens[i].type === TokenType.PlusSign || tokens[i].type === TokenType.HyphenMinus)i++;else return 0;if(l = checkSC(i))i += l;if(l = checkNumberOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(i !== right)return 0;return i - start + 1;}function getPseudoClass3(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `:`. + pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[]; // Skip `(`. + pos++;if(checkUnary(pos))value.push(getUnary());if(checkNumberOrInterpolation(pos))value = value.concat(getNumberOrInterpolation());{var _l=tokens[pos].ln;var _c=tokens[pos].col;var _content=tokens[pos].value;var ident=newNode(NodeType.IdentType,_content,_l,_c);value.push(ident);pos++;}value = value.concat(getSC());if(checkUnary(pos))value.push(getUnary());value = value.concat(getSC());if(checkNumberOrInterpolation(pos))value = value.concat(getNumberOrInterpolation());value = value.concat(getSC());var end=getLastPosition(value,l,c,1);var args=newNode(NodeType.ArgumentsType,value,l,c,end);content.push(args); // Skip `)`. + pos++;return newNode(type,content,line,column);} /** + * (-) `:nth-child(-3n)` + */function checkPseudoClass4(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSC(i))i += l;if(l = checkUnary(i))i += l;if(l = checkInterpolation(i))i += l;if(tokens[i].type === TokenType.DecimalNumber)i++;if(tokens[i].value === 'n')i++;else return 0;if(l = checkSC(i))i += l;if(i !== right)return 0;return i - start + 1;}function getPseudoClass4(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `:`. + pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[]; // Skip `(`. + pos++;if(checkUnary(pos))value.push(getUnary());if(checkInterpolation(pos))value.push(getInterpolation());if(checkNumber(pos))value.push(getNumber());if(checkIdent(pos))value.push(getIdent());value = value.concat(getSC());var end=getLastPosition(value,l,c,1);var args=newNode(NodeType.ArgumentsType,value,l,c,end);content.push(args); // Skip `)`. + pos++;return newNode(type,content,line,column);} /** + * (-) `:nth-child(+8)` + */function checkPseudoClass5(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSC(i))i += l;if(l = checkUnary(i))i += l;if(tokens[i].type === TokenType.DecimalNumber)i++;else return 0;if(l = checkSC(i))i += l;if(i !== right)return 0;return i - start + 1;}function getPseudoClass5(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `:`. + pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[]; // Skip `(`. + pos++;if(checkUnary(pos))value.push(getUnary());if(checkNumber(pos))value.push(getNumber());value = value.concat(getSC());var end=getLastPosition(value,l,c,1);var args=newNode(NodeType.ArgumentsType,value,l,c,end);content.push(args); // Skip `)`. + pos++;return newNode(type,content,line,column);} /** + * (-) `:checked` + */function checkPseudoClass6(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;}function getPseudoClass6(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `:`. + pos++;var content=getIdentOrInterpolation();return newNode(type,content,line,column);} /** + * @param {number} i Token's index number + * @return {number} + */function checkRuleset(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkSelectorsGroup(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i)){i += l;}else if(l = checkSC(i)){i += l;if(l = checkBlock(i))i += l;else return 0;}else return 0;return i - start;}function getRuleset(){var type=NodeType.RulesetType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];content = content.concat(getSelectorsGroup());content = content.concat(getSC());if(checkBlock(pos)){content.push(getBlock());}else {content = content.concat(getSC(),getBlock());}return newNode(type,content,line,column);} /** + * Check if token is marked as a space (if it's a space or a tab + * or a line break). + * @param {number} i + * @return {number} Number of spaces in a row starting with the given token. + */function checkS(i){return i < tokensLength && tokens[i].ws?tokens[i].ws_last - i + 1:0;} /** + * Get node with spaces + * @return {Array} `['s', x]` where `x` is a string containing spaces + */function getS(){var startPos=pos;var x=joinValues(pos,tokens[pos].ws_last);pos = tokens[pos].ws_last + 1;var token=tokens[startPos];return newNode(NodeType.SType,x,token.ln,token.col);} /** + * Check if token is a space or a comment. + * @param {number} i Token's index number + * @return {number} Number of similar (space or comment) tokens + * in a row starting with the given token. + */function checkSC(i){if(!tokens[i])return 0;var l=undefined;var lsc=0;var ln=tokens[i].ln;while(i < tokensLength) {if(tokens[i].ln !== ln)break;if(!(l = checkS(i)) && !(l = checkCommentML(i)) && !(l = checkCommentSL(i)))break;i += l;lsc += l;if(tokens[i] && tokens[i].type === TokenType.Newline)break;}return lsc || 0;} /** + * Get node with spaces and comments + * @return {Array} Array containing nodes with spaces (if there are any) + * and nodes with comments (if there are any): + * `[['s', x]*, ['comment', y]*]` where `x` is a string of spaces + * and `y` is a comment's text (without `/*` and `* /`). + */function getSC(){var sc=[];var ln=undefined;if(pos >= tokensLength)return sc;ln = tokens[pos].ln;while(pos < tokensLength) {if(tokens[pos].ln !== ln)break;else if(checkS(pos))sc.push(getS());else if(checkCommentML(pos))sc.push(getCommentML());else if(checkCommentSL(pos))sc.push(getCommentSL());else break;if(tokens[pos] && tokens[pos].type === TokenType.Newline)break;}return sc;} /** + * Check if token is part of a hexadecimal number (e.g. `#fff`) inside + * a simple selector + * @param {number} i Token's index number + * @return {number} + */function checkShash(i){var l;if(i >= tokensLength || tokens[i].type !== TokenType.NumberSign)return 0;return (l = checkIdentOrInterpolation(i + 1))?l + 1:0;} /** + * Get node with a hexadecimal number (e.g. `#fff`) inside a simple + * selector + * @return {Array} `['shash', x]` where `x` is a hexadecimal number + * converted to string (without `#`, e.g. `fff`) + */function getShash(){var startPos=pos;var token=tokens[startPos];pos++;var x=getIdentOrInterpolation();return newNode(NodeType.ShashType,x,token.ln,token.col);} /** + * Check if token is part of a string (text wrapped in quotes) + * @param {number} i Token's index number + * @return {number} `1` if token is part of a string, `0` if not + */function checkString(i){if(i >= tokensLength){return 0;}if(tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ){return 1;}return 0;} /** + * Get string's node + * @return {Array} `['string', x]` where `x` is a string (including + * quotes). + */function getString(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.StringType,x,token.ln,token.col);} /** + * Validate stylesheet: it should consist of any number (0 or more) of + * rulesets (sets of rules with selectors), @-rules, whitespaces or + * comments. + * @param {number} i Token's index number + * @return {number} + */function checkStylesheet(i){var start=i;var l=undefined;while(i < tokensLength) {if(l = checkSC(i) || checkDeclaration(i) || checkDeclDelim(i) || checkInclude(i) || checkExtend(i) || checkMixin(i) || checkLoop(i) || checkConditionalStatement(i) || checkAtrule(i) || checkRuleset(i))i += l;else throwError(i);}return i - start;} /** + * @return {Array} `['stylesheet', x]` where `x` is all stylesheet's + * nodes. + */function getStylesheet(){var startPos=pos;var x=[];var node;var wasDeclaration=false;while(pos < tokensLength) {if(wasDeclaration && checkDeclDelim(pos))node = getDeclDelim();else if(checkSC(pos))node = getSC();else if(checkRuleset(pos))node = getRuleset();else if(checkInclude(pos))node = getInclude();else if(checkExtend(pos))node = getExtend();else if(checkMixin(pos))node = getMixin();else if(checkLoop(pos))node = getLoop();else if(checkConditionalStatement(pos))node = getConditionalStatement();else if(checkAtrule(pos))node = getAtrule();else if(checkDeclaration(pos))node = getDeclaration();else throwError();wasDeclaration = node.type === NodeType.DeclarationType;if(Array.isArray(node))x = x.concat(node);else x.push(node);}var token=tokens[startPos];return newNode(NodeType.StylesheetType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @return {number} + */function checkTset(i){return checkVhash(i) || checkOperator(i) || checkAny(i) || checkSC(i) || checkInterpolation(i);} /** + * @return {Array} + */function getTset(){if(checkVhash(pos))return getVhash();else if(checkOperator(pos))return getOperator();else if(checkAny(pos))return getAny();else if(checkSC(pos))return getSC();else if(checkInterpolation(pos))return getInterpolation();} /** + * @param {number} i Token's index number + * @return {number} + */function checkTsets(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;while(tokens[i - 1].type !== TokenType.Newline && (l = checkTset(i))) {i += l;}return i - start;} /** + * @return {Array} + */function getTsets(){var x=[];var t=undefined;while(tokens[pos - 1].type !== TokenType.Newline && (t = getTset())) {if(typeof t.content === 'string')x.push(t);else x = x.concat(t);}return x;} /** + * Check if token is an unary (arithmetical) sign (`+` or `-`) + * @param {number} i Token's index number + * @return {number} `1` if token is an unary sign, `0` if not + */function checkUnary(i){if(i >= tokensLength){return 0;}if(tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign){return 1;}return 0;} /** + * Get node with an unary (arithmetical) sign (`+` or `-`) + * @return {Array} `['unary', x]` where `x` is an unary sign + * converted to string. + */function getUnary(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.OperatorType,x,token.ln,token.col);} /** + * Check if token is a unicode range (single or multiple nodes) + * @param {number} i Token's index + * @return {number} Unicode range node's length + */function checkUnicodeRange(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkUrange(i))i += l;else return 0;while(i < tokensLength) {var spaceBefore=checkSC(i);var comma=checkDelim(i + spaceBefore);if(!comma)break;var spaceAfter=checkSC(i + spaceBefore + comma);if(l = checkUrange(i + spaceBefore + comma + spaceAfter)){i += spaceBefore + comma + spaceAfter + l;}else break;}return i - start;} /** + * Get a unicode range node + * @return {Node} + */function getUnicodeRange(){var type=NodeType.UnicodeRangeType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];while(pos < tokensLength) {if(checkSC(pos))content = content.concat(getSC());else if(checkDelim(pos))content.push(getDelim());else if(checkUrange(pos))content.push(getUrange());else break;}return newNode(type,content,line,column);} /** + * Check if token is a u-range (part of a unicode-range) + * (1) `U+416` + * (2) `U+400-4ff` + * (3) `U+4??` + * @param {number} i Token's index + * @return {number} Urange node's length + */function checkUrange(i){var start=i;var l=undefined;if(i >= tokensLength)return 0; // Check for unicode prefix (u+ or U+) + if(tokens[i].value === 'U' || tokens[i].value === 'u')i += 1;else return 0;if(i >= tokensLength)return 0;if(tokens[i].value === '+')i += 1;else return 0;while(i < tokensLength) {if(l = checkIdent(i))i += l;else if(l = checkNumber(i))i += l;else if(l = checkUnary(i))i += l;else if(l = _checkUnicodeWildcard(i))i += l;else break;}tokens[start].urangeEnd = i - 1;return i - start;} /** + * Get a u-range node (part of a unicode-range) + * @return {Node} + */function getUrange(){var startPos=pos;var type=NodeType.UrangeType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];content = joinValues(startPos,tokens[startPos].urangeEnd);pos = tokens[startPos].urangeEnd + 1;return newNode(type,content,line,column);} /** + * Check for unicode wildcard characters `?` + * @param {number} i Token's index + * @return {number} Wildcard length + */function _checkUnicodeWildcard(i){var start=i;if(i >= tokensLength)return 0;while(i < tokensLength) {if(tokens[i].type === TokenType.QuestionMark)i += 1;else break;}return i - start;} /** + * Check if token is part of URI (e.g. `url('/css/styles.css')`) + * @param {number} i Token's index number + * @return {number} Length of URI + */function checkUri(i){var start=i;if(i >= tokensLength || tokens[i++].value !== 'url' || i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;return tokens[i].right - start + 1;} /** + * Get node with URI + * @return {Array} `['uri', x]` where `x` is URI's nodes (without `url` + * and braces, e.g. `['string', ''/css/styles.css'']`). + */function getUri(){var startPos=pos;var uriExcluding={};var uri=undefined;var token=undefined;var l=undefined;var raw=undefined;pos += 2;uriExcluding[TokenType.Space] = 1;uriExcluding[TokenType.Tab] = 1;uriExcluding[TokenType.Newline] = 1;uriExcluding[TokenType.LeftParenthesis] = 1;uriExcluding[TokenType.RightParenthesis] = 1;if(checkUriContent(pos)){uri = [].concat(getSC()).concat(getUriContent()).concat(getSC());}else {uri = [].concat(getSC());l = checkExcluding(uriExcluding,pos);token = tokens[pos];raw = newNode(NodeType.RawType,joinValues(pos,pos + l),token.ln,token.col);uri.push(raw);pos += l + 1;uri = uri.concat(getSC());}token = tokens[startPos];var line=token.ln;var column=token.col;var end=getLastPosition(uri,line,column,1);pos++;return newNode(NodeType.UriType,uri,token.ln,token.col,end);} /** + * @param {number} i Token's index number + * @return {number} + */function checkUriContent(i){return checkUri1(i) || checkFunction(i);} /** + * @return {Array} + */function getUriContent(){if(checkUri1(pos))return getString();else if(checkFunction(pos))return getFunction();} /** + * @param {number} i Token's index number + * @return {number} + */function checkUri1(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkSC(i))i += l;if(tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ)return 0;i++;if(l = checkSC(i))i += l;return i - start;} /** + * Check if token is part of a value + * @param {number} i Token's index number + * @return {number} Length of the value + */function checkValue(i){var start=i;var l=undefined;var s=undefined;var _i=undefined;while(i < tokensLength) {if(checkDeclDelim(i))break;if(l = checkBlock(i)){i += l;break;}s = checkS(i);_i = i + s;if(l = _checkValue(_i))i += l + s;if(!l || checkBlock(i - l))break;}return i - start;} /** + * @param {number} i Token's index number + * @return {number} + */function _checkValue(i){return checkVhash(i) || checkOperator(i) || checkImportant(i) || checkGlobal(i) || checkDefault(i) || checkProgid(i) || checkAny(i) || checkInterpolation(i) || checkParentSelector(i);} /** + * @return {Array} + */function getValue(){var startPos=pos;var x=[];var _pos=undefined;var s=undefined;while(pos < tokensLength) {if(checkDeclDelim(pos))break;s = checkS(pos);_pos = pos + s;if(checkDeclDelim(_pos))break;if(checkBlock(pos)){x.push(getBlock());break;}if(!_checkValue(_pos))break;if(s)x.push(getS());x.push(_getValue());if(checkBlock(_pos))break;}var token=tokens[startPos];return newNode(NodeType.ValueType,x,token.ln,token.col);} /** + * @return {Array} + */function _getValue(){if(checkVhash(pos))return getVhash();if(checkOperator(pos))return getOperator();if(checkImportant(pos))return getImportant();if(checkGlobal(pos))return getGlobal();if(checkDefault(pos))return getDefault();if(checkProgid(pos))return getProgid();if(checkAny(pos))return getAny();if(checkInterpolation(pos))return getInterpolation();if(checkParentSelector(pos))return getParentSelector();} /** + * Check if token is part of a variable + * @param {number} i Token's index number + * @return {number} Length of the variable + */function checkVariable(i){var l;if(i >= tokensLength || tokens[i].type !== TokenType.DollarSign)return 0;return (l = checkIdent(i + 1))?l + 1:0;} /** + * Get node with a variable + * @return {Array} `['variable', ['ident', x]]` where `x` is + * a variable name. + */function getVariable(){var startPos=pos;var x=[];pos++;x.push(getIdent());var token=tokens[startPos];return newNode(NodeType.VariableType,x,token.ln,token.col);} /** + * Check if token is part of a variables list (e.g. `$values...`). + * @param {number} i Token's index number + * @return {number} + */function checkVariablesList(i){var d=0; // Number of dots + var l=undefined;if(i >= tokensLength)return 0;if(l = checkVariable(i))i += l;else return 0;while(i < tokensLength && tokens[i].type === TokenType.FullStop) {d++;i++;}return d === 3?l + d:0;} /** + * Get node with a variables list + * @return {Array} `['variableslist', ['variable', ['ident', x]]]` where + * `x` is a variable name. + */function getVariablesList(){var startPos=pos;var x=[getVariable()];var token=tokens[startPos];var line=token.ln;var column=token.col;var end=getLastPosition(x,line,column,3);pos += 3;return newNode(NodeType.VariablesListType,x,token.ln,token.col,end);} /** + * Check if token is part of a hexadecimal number (e.g. `#fff`) inside + * some value + * @param {number} i Token's index number + * @return {number} + */function checkVhash(i){var l;if(i >= tokensLength || tokens[i].type !== TokenType.NumberSign)return 0;return (l = checkNmName2(i + 1))?l + 1:0;} /** + * Get node with a hexadecimal number (e.g. `#fff`) inside some value + * @return {Array} `['vhash', x]` where `x` is a hexadecimal number + * converted to string (without `#`, e.g. `'fff'`). + */function getVhash(){var startPos=pos;var x=undefined;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;x = getNmName2();var end=getLastPosition(x,line,column + 1);return newNode(NodeType.VhashType,x,token.ln,token.col,end);}module.exports = function(_tokens,context){tokens = _tokens;tokensLength = tokens.length;pos = 0;return contexts[context]();};function checkSelectorsGroup(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkSelector(i))i += l;else return 0;while(i < tokensLength) {var sb=checkSC(i);var c=checkDelim(i + sb);if(!c)break;var sa=checkSC(i + sb + c);var saa=sa?checkSC(i + sb + c + sa):0;if(l = checkSelector(i + sb + c + sa + saa))i += sb + c + sa + saa + l;else break;}tokens[start].selectorsGroupEnd = i;return i - start;}function getSelectorsGroup(){var selectorsGroup=[];var selectorsGroupEnd=tokens[pos].selectorsGroupEnd;selectorsGroup.push(getSelector());while(pos < selectorsGroupEnd) {selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup.push(getDelim());selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup.push(getSelector());}return selectorsGroup;}function checkSelector(i){var l;if(l = checkSelector1(i))tokens[i].selectorType = 1;else if(l = checkSelector2(i))tokens[i].selectorType = 2;return l;}function getSelector(){var selectorType=tokens[pos].selectorType;if(selectorType === 1)return getSelector1();else return getSelector2();} /** + * Checks for selector which starts with a compound selector. + */function checkSelector1(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkCompoundSelector(i))i += l;else return 0;while(i < tokensLength) {var s=checkSC(i);var c=checkCombinator(i + s);if(!s && !c)break;if(c){i += s + c;s = checkSC(i);}if(l = checkCompoundSelector(i + s))i += s + l;else break;}tokens[start].selectorEnd = i;return i - start;}function getSelector1(){var type=NodeType.SelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var selectorEnd=token.selectorEnd;var content=getCompoundSelector();while(pos < selectorEnd) {if(checkSC(pos))content = content.concat(getSC());else if(checkCombinator(pos))content.push(getCombinator());else if(checkCompoundSelector(pos))content = content.concat(getCompoundSelector());}return newNode(type,content,line,column);} /** + * Checks for a selector that starts with a combinator. + */function checkSelector2(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkCombinator(i))i += l;else return 0;while(i < tokensLength) {var sb=checkSC(i);if(l = checkCompoundSelector(i + sb))i += sb + l;else break;var sa=checkSC(i);var c=checkCombinator(i + sa);if(!sa && !c)break;if(c){i += sa + c;}}tokens[start].selectorEnd = i;return i - start;}function getSelector2(){var type=NodeType.SelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var selectorEnd=token.selectorEnd;var content=[getCombinator()];while(pos < selectorEnd) {if(checkSC(pos))content = content.concat(getSC());else if(checkCombinator(pos))content.push(getCombinator());else if(checkCompoundSelector(pos))content = content.concat(getCompoundSelector());}return newNode(type,content,line,column);}function checkCompoundSelector(i){var l=undefined;if(l = checkCompoundSelector1(i)){tokens[i].compoundSelectorType = 1;}else if(l = checkCompoundSelector2(i)){tokens[i].compoundSelectorType = 2;}return l;}function getCompoundSelector(){var type=tokens[pos].compoundSelectorType;if(type === 1)return getCompoundSelector1();if(type === 2)return getCompoundSelector2();} /** + * Check for compound selectors that start with either a type selector, + * placeholder or parent selector with extension + * (1) `foo.bar` + * (2) `foo[attr=val]` + * (3) `foo:first-of-type` + * (4) `foo%bar` + * @param {number} i Token's index + * @return {number} Compound selector's length + */function checkCompoundSelector1(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkTypeSelector(i) || checkPlaceholder(i) || checkParentSelectorWithExtension(i))i += l;else return 0;while(i < tokensLength) {var _l2=checkShash(i) || checkClass(i) || checkAttributeSelector(i) || checkPseudo(i) || checkPlaceholder(i);if(_l2)i += _l2;else break;}tokens[start].compoundSelectorEnd = i;return i - start;} /** + * @return {Array} An array of nodes that make up the compound selector + */function getCompoundSelector1(){var sequence=[];var compoundSelectorEnd=tokens[pos].compoundSelectorEnd;if(checkTypeSelector(pos))sequence.push(getTypeSelector());else if(checkPlaceholder(pos))sequence.push(getPlaceholder());else if(checkParentSelectorWithExtension(pos))sequence = sequence.concat(getParentSelectorWithExtension());while(pos < compoundSelectorEnd) {if(checkShash(pos))sequence.push(getShash());else if(checkClass(pos))sequence.push(getClass());else if(checkAttributeSelector(pos))sequence.push(getAttributeSelector());else if(checkPseudo(pos))sequence.push(getPseudo());else if(checkPlaceholder(pos))sequence.push(getPlaceholder());else break;}return sequence;} /** + * Check for all other compound selectors + * (1) `.foo.bar` + * (2) `.foo[attr=val]` + * (3) `.foo:first-of-type` + * (4) `.foo%bar` + * (5) `.foo#{$bar}` + * @param {number} i Token's index + * @return {number} Compound selector's length + */function checkCompoundSelector2(i){if(i >= tokensLength)return 0;var start=i;while(i < tokensLength) {var l=checkShash(i) || checkClass(i) || checkAttributeSelector(i) || checkPseudo(i) || checkPlaceholder(i) || checkInterpolation(i);if(l)i += l;else break;}tokens[start].compoundSelectorEnd = i;return i - start;} /** + * @return {Array} An array of nodes that make up the compound selector + */function getCompoundSelector2(){var sequence=[];var compoundSelectorEnd=tokens[pos].compoundSelectorEnd;while(pos < compoundSelectorEnd) {if(checkShash(pos))sequence.push(getShash());else if(checkClass(pos))sequence.push(getClass());else if(checkAttributeSelector(pos))sequence.push(getAttributeSelector());else if(checkPseudo(pos))sequence.push(getPseudo());else if(checkPlaceholder(pos))sequence.push(getPlaceholder());else if(checkInterpolation(pos))sequence.push(getInterpolation());else break;}return sequence;}function checkTypeSelector(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkNamePrefix(i))i += l;if(tokens[i].type === TokenType.Asterisk)i++;else if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;}function getTypeSelector(){var type=NodeType.TypeSelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(checkNamePrefix(pos))content.push(getNamePrefix());token = tokens[pos];if(token.type === TokenType.Asterisk){var asteriskNode=newNode(NodeType.IdentType,'*',token.ln,token.col);content.push(asteriskNode);pos++;}else if(checkIdentOrInterpolation(pos))content = content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);}function checkAttributeSelector(i){var l=undefined;if(l = checkAttributeSelector1(i))tokens[i].attributeSelectorType = 1;else if(l = checkAttributeSelector2(i))tokens[i].attributeSelectorType = 2;return l;}function getAttributeSelector(){var type=tokens[pos].attributeSelectorType;if(type === 1)return getAttributeSelector1();else return getAttributeSelector2();} /** + * (1) `[panda=nani]` + * (2) `[panda='nani']` + * (3) `[panda='nani' i]` + * + */function checkAttributeSelector1(i){var start=i;if(tokens[i].type === TokenType.LeftSquareBracket)i++;else return 0;var l=undefined;if(l = checkSC(i))i += l;if(l = checkAttributeName(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkAttributeMatch(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkAttributeValue(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkAttributeFlags(i)){i += l;if(l = checkSC(i))i += l;}if(tokens[i].type === TokenType.RightSquareBracket)i++;else return 0;return i - start;}function getAttributeSelector1(){var type=NodeType.AttributeSelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[]; // Skip `[`. + pos++;content = content.concat(getSC());content.push(getAttributeName());content = content.concat(getSC());content.push(getAttributeMatch());content = content.concat(getSC());content.push(getAttributeValue());content = content.concat(getSC());if(checkAttributeFlags(pos)){content.push(getAttributeFlags());content = content.concat(getSC());} // Skip `]`. + pos++;var end=getLastPosition(content,line,column,1);return newNode(type,content,line,column,end);} /** + * (1) `[panda]` + */function checkAttributeSelector2(i){var start=i;if(tokens[i].type === TokenType.LeftSquareBracket)i++;else return 0;var l=undefined;if(l = checkSC(i))i += l;if(l = checkAttributeName(i))i += l;else return 0;if(l = checkSC(i))i += l;if(tokens[i].type === TokenType.RightSquareBracket)i++;else return 0;return i - start;}function getAttributeSelector2(){var type=NodeType.AttributeSelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[]; // Skip `[`. + pos++;content = content.concat(getSC());content.push(getAttributeName());content = content.concat(getSC()); // Skip `]`. + pos++;var end=getLastPosition(content,line,column,1);return newNode(type,content,line,column,end);}function checkAttributeName(i){var start=i;var l=undefined;if(l = checkNamePrefix(i))i += l;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;}function getAttributeName(){var type=NodeType.AttributeNameType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(checkNamePrefix(pos))content.push(getNamePrefix());content = content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);}function checkAttributeMatch(i){var l=undefined;if(l = checkAttributeMatch1(i))tokens[i].attributeMatchType = 1;else if(l = checkAttributeMatch2(i))tokens[i].attributeMatchType = 2;return l;}function getAttributeMatch(){var type=tokens[pos].attributeMatchType;if(type === 1)return getAttributeMatch1();else return getAttributeMatch2();}function checkAttributeMatch1(i){var start=i;var type=tokens[i].type;if(type === TokenType.Tilde || type === TokenType.VerticalLine || type === TokenType.CircumflexAccent || type === TokenType.DollarSign || type === TokenType.Asterisk)i++;else return 0;if(tokens[i].type === TokenType.EqualsSign)i++;else return 0;return i - start;}function getAttributeMatch1(){var type=NodeType.AttributeMatchType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=tokens[pos].value + tokens[pos + 1].value;pos += 2;return newNode(type,content,line,column);}function checkAttributeMatch2(i){if(tokens[i].type === TokenType.EqualsSign)return 1;else return 0;}function getAttributeMatch2(){var type=NodeType.AttributeMatchType;var token=tokens[pos];var line=token.ln;var column=token.col;var content='=';pos++;return newNode(type,content,line,column);}function checkAttributeValue(i){return checkString(i) || checkIdentOrInterpolation(i);}function getAttributeValue(){var type=NodeType.AttributeValueType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(checkString(pos))content.push(getString());else content = content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);}function checkAttributeFlags(i){return checkIdentOrInterpolation(i);}function getAttributeFlags(){var type=NodeType.AttributeFlagsType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=getIdentOrInterpolation();return newNode(type,content,line,column);}function checkNamePrefix(i){if(i >= tokensLength)return 0;var l=undefined;if(l = checkNamePrefix1(i))tokens[i].namePrefixType = 1;else if(l = checkNamePrefix2(i))tokens[i].namePrefixType = 2;return l;}function getNamePrefix(){var type=tokens[pos].namePrefixType;if(type === 1)return getNamePrefix1();else return getNamePrefix2();} /** + * (1) `panda|` + * (2) `panda|` + */function checkNamePrefix1(i){var start=i;var l=undefined;if(l = checkNamespacePrefix(i))i += l;else return 0;if(l = checkCommentML(i))i += l;if(l = checkNamespaceSeparator(i))i += l;else return 0;return i - start;}function getNamePrefix1(){var type=NodeType.NamePrefixType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];content.push(getNamespacePrefix());if(checkCommentML(pos))content.push(getCommentML());content.push(getNamespaceSeparator());return newNode(type,content,line,column);} /** + * (1) `|` + */function checkNamePrefix2(i){return checkNamespaceSeparator(i);}function getNamePrefix2(){var type=NodeType.NamePrefixType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[getNamespaceSeparator()];return newNode(type,content,line,column);} /** + * (1) `*` + * (2) `panda` + */function checkNamespacePrefix(i){if(i >= tokensLength)return 0;var l=undefined;if(tokens[i].type === TokenType.Asterisk)return 1;else if(l = checkIdentOrInterpolation(i))return l;else return 0;}function getNamespacePrefix(){var type=NodeType.NamespacePrefixType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(token.type === TokenType.Asterisk){var asteriskNode=newNode(NodeType.IdentType,'*',token.ln,token.col);content.push(asteriskNode);pos++;}else if(checkIdentOrInterpolation(pos))content = content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);} /** + * (1) `|` + */function checkNamespaceSeparator(i){if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.VerticalLine)return 0; // Return false if `|=` - [attr|=value] + if(tokens[i + 1] && tokens[i + 1].type === TokenType.EqualsSign)return 0;return 1;}function getNamespaceSeparator(){var type=NodeType.NamespaceSeparatorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content='|';pos++;return newNode(type,content,line,column);} + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = function (css, tabSize) { + var TokenType = __webpack_require__(13); + + var tokens = []; + var urlMode = false; + var c = undefined; // Current character + var cn = undefined; // Next character + var pos = 0; + var tn = 0; + var ln = 1; + var col = 1; + + var Punctuation = { + ' ': TokenType.Space, + '\n': TokenType.Newline, + '\r': TokenType.Newline, + '\t': TokenType.Tab, + '!': TokenType.ExclamationMark, + '"': TokenType.QuotationMark, + '#': TokenType.NumberSign, + '$': TokenType.DollarSign, + '%': TokenType.PercentSign, + '&': TokenType.Ampersand, + '\'': TokenType.Apostrophe, + '(': TokenType.LeftParenthesis, + ')': TokenType.RightParenthesis, + '*': TokenType.Asterisk, + '+': TokenType.PlusSign, + ',': TokenType.Comma, + '-': TokenType.HyphenMinus, + '.': TokenType.FullStop, + '/': TokenType.Solidus, + ':': TokenType.Colon, + ';': TokenType.Semicolon, + '<': TokenType.LessThanSign, + '=': TokenType.EqualsSign, + '==': TokenType.EqualitySign, + '!=': TokenType.InequalitySign, + '>': TokenType.GreaterThanSign, + '?': TokenType.QuestionMark, + '@': TokenType.CommercialAt, + '[': TokenType.LeftSquareBracket, + ']': TokenType.RightSquareBracket, + '^': TokenType.CircumflexAccent, + '_': TokenType.LowLine, + '{': TokenType.LeftCurlyBracket, + '|': TokenType.VerticalLine, + '}': TokenType.RightCurlyBracket, + '~': TokenType.Tilde + }; + + /** + * Add a token to the token list + * @param {string} type + * @param {string} value + */ + function pushToken(type, value, column) { + tokens.push({ + tn: tn++, + ln: ln, + col: column, + type: type, + value: value + }); + } + + /** + * Check if a character is a decimal digit + * @param {string} c Character + * @returns {boolean} + */ + function isDecimalDigit(c) { + return '0123456789'.indexOf(c) >= 0; + } + + /** + * Parse spaces + * @param {string} css Unparsed part of CSS string + */ + function parseSpaces(css) { + var start = pos; + + // Read the string until we meet a non-space character: + for (; pos < css.length; pos++) { + if (css.charAt(pos) !== ' ') break; + } + + // Add a substring containing only spaces to tokens: + pushToken(TokenType.Space, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Parse a string within quotes + * @param {string} css Unparsed part of CSS string + * @param {string} q Quote (either `'` or `"`) + */ + function parseString(css, q) { + var start = pos; + + // Read the string until we meet a matching quote: + for (pos++; pos < css.length; pos++) { + // Skip escaped quotes: + if (css.charAt(pos) === '\\') pos++;else if (css.charAt(pos) === q) break; + } + + // Add the string (including quotes) to tokens: + var type = q === '"' ? TokenType.StringDQ : TokenType.StringSQ; + pushToken(type, css.substring(start, pos + 1), col); + col += pos - start; + } + + /** + * Parse numbers + * @param {string} css Unparsed part of CSS string + */ + function parseDecimalNumber(css) { + var start = pos; + + // Read the string until we meet a character that's not a digit: + for (; pos < css.length; pos++) { + if (!isDecimalDigit(css.charAt(pos))) break; + } + + // Add the number to tokens: + pushToken(TokenType.DecimalNumber, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Parse identifier + * @param {string} css Unparsed part of CSS string + */ + function parseIdentifier(css) { + var start = pos; + + // Skip all opening slashes: + while (css.charAt(pos) === '/') pos++; + + // Read the string until we meet a punctuation mark: + for (; pos < css.length; pos++) { + // Skip all '\': + if (css.charAt(pos) === '\\') pos++;else if (css.charAt(pos) in Punctuation) break; + } + + var ident = css.substring(start, pos--); + + // Enter url mode if parsed substring is `url`: + if (!urlMode && ident === 'url' && css.charAt(pos + 1) === '(') { + urlMode = true; + } + + // Add identifier to tokens: + pushToken(TokenType.Identifier, ident, col); + col += pos - start; + } + + /** + * Parse equality sign + */ + function parseEquality() { + pushToken(TokenType.EqualitySign, '==', col); + pos++; + col++; + } + + /** + * Parse inequality sign + */ + function parseInequality() { + pushToken(TokenType.InequalitySign, '!=', col); + pos++; + col++; + } + + /** + * Parse a multiline comment + * @param {string} css Unparsed part of CSS string + */ + function parseMLComment(css) { + var start = pos; + var col_ = col; + + // Get current indent level: + var il = 0; + for (var _pos = pos - 1; _pos > -1; _pos--) { + // TODO: Can be tabs: + if (css.charAt(_pos) === ' ') il++;else break; + } + + for (pos += 2; pos < css.length; pos++) { + if (css.charAt(pos) === '\n') { + var _pos = undefined; + // Get new line's indent level: + var _il = 0; + for (_pos = pos + 1; _pos < css.length; _pos++) { + if (css.charAt(_pos) === ' ') _il++;else break; + } + + if (_il > il) { + col = 0; + pos += _pos - pos; + } else { + pos--; + break; + } + } + } + + // If CRLF is used, we need to adjust pos + if (css.charAt(pos) === '\r') pos--; + + // Add full comment (including `/*`) to the list of tokens: + var comment = css.substring(start, pos + 1); + pushToken(TokenType.CommentML, comment, col_); + + var newlines = comment.split('\n'); + if (newlines.length > 1) { + ln += newlines.length - 1; + col = newlines[newlines.length - 1].length; + } else { + col += pos - start; + } + } + + /** + * Parse a single line comment + * @param {string} css Unparsed part of CSS string + */ + function parseSLComment(css) { + var start = pos; + var col_ = col; + var _pos; + + // Check if comment is the only token on the line, and if so, + // get current indent level: + var il = 0; + var onlyToken = false; + for (_pos = pos - 1; _pos > -1; _pos--) { + // TODO: Can be tabs: + if (css.charAt(_pos) === ' ') il++;else if (css.charAt(_pos) === '\n') { + onlyToken = true; + break; + } else break; + } + if (_pos === -1) onlyToken = true; + + // Read the string until we meet comment end. + // Since we already know first 2 characters (`//`), start reading + // from `pos + 2`: + if (!onlyToken) { + for (pos += 2; pos < css.length; pos++) { + if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { + break; + } + } + } else { + for (pos += 2; pos < css.length; pos++) { + if (css.charAt(pos) === '\n') { + // Get new line's indent level: + var _il = 0; + for (_pos = pos + 1; _pos < css.length; _pos++) { + if (css.charAt(_pos) === ' ') _il++;else break; + } + + if (_il > il) { + col = 0; + pos += _pos - pos; + } else { + break; + } + } + } + } + + // If CRLF is used, we need to adjust pos + if (css.charAt(pos - 1) === '\r') pos--; + + // Add comment (including `//` and line break) to the list of tokens: + var comment = css.substring(start, pos--); + pushToken(TokenType.CommentSL, comment, col_); + + var newlines = comment.split('\n'); + if (newlines.length > 1) { + ln += newlines.length - 1; + col = newlines[newlines.length - 1].length; + } else { + col += pos - start; + } + } + + /** + * Convert a CSS string to a list of tokens + * @param {string} css CSS string + * @returns {Array} List of tokens + * @private + */ + function getTokens(css) { + // Parse string, character by character: + for (pos = 0; pos < css.length; col++, pos++) { + c = css.charAt(pos); + cn = css.charAt(pos + 1); + + // If we meet `/*`, it's a start of a multiline comment. + // Parse following characters as a multiline comment: + if (c === '/' && cn === '*') { + parseMLComment(css); + } + + // If we meet `//` and it is not a part of url: + else if (!urlMode && c === '/' && cn === '/') { + // If we're currently inside a block, treat `//` as a start + // of identifier. Else treat `//` as a start of a single-line + // comment: + parseSLComment(css); + } + + // If current character is a double or single quote, it's a start + // of a string: + else if (c === '"' || c === "'") { + parseString(css, c); + } + + // If current character is a space: + else if (c === ' ') { + parseSpaces(css); + } + + // If current character is `=`, it must be combined with next `=` + else if (c === '=' && cn === '=') { + parseEquality(css); + } + + // If we meet `!=`, this must be inequality + else if (c === '!' && cn === '=') { + parseInequality(css); + } + + // If current character is a punctuation mark: + else if (c in Punctuation) { + // Check for CRLF here or just LF + if (c === '\r' && cn === '\n' || c === '\n') { + // If \r we know the next character is \n due to statement above + // so we push a CRLF token type to the token list and importantly + // skip the next character so as not to double count newlines or + // columns etc + if (c === '\r') { + pushToken(TokenType.Newline, '\r\n', col); + pos++; // If CRLF skip the next character and push crlf token + } else if (c === '\n') { + // If just a LF newline and not part of CRLF newline we can just + // push punctuation as usual + pushToken(Punctuation[c], c, col); + } + + ln++; // Go to next line + col = 0; // Reset the column count + } else if (c !== '\r' && c !== '\n') { + // Handle all other punctuation and add to list of tokens + pushToken(Punctuation[c], c, col); + } // Go to next line + if (c === ')') urlMode = false; // Exit url mode + else if (c === '\t' && tabSize > 1) col += tabSize - 1; + } + + // If current character is a decimal digit: + else if (isDecimalDigit(c)) { + parseDecimalNumber(css); + } + + // If current character is anything else: + else { + parseIdentifier(css); + } + } + + return tokens; + } + + return getTokens(css); + }; + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = { + mark: __webpack_require__(26), + parse: __webpack_require__(27), + stringify: __webpack_require__(6), + tokenizer: __webpack_require__(28) + }; + module.exports = exports['default']; + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var TokenType = __webpack_require__(13); + + module.exports = (function () { + /** + * Mark whitespaces and comments + */ + function markSC(tokens) { + var tokensLength = tokens.length; + var ws = -1; // Flag for whitespaces + var sc = -1; // Flag for whitespaces and comments + var t = undefined; // Current token + + // For every token in the token list, mark spaces and line breaks + // as spaces (set both `ws` and `sc` flags). Mark multiline comments + // with `sc` flag. + // If there are several spaces or tabs or line breaks or multiline + // comments in a row, group them: take the last one's index number + // and save it to the first token in the group as a reference: + // e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` + // for a group of whitespaces and comments. + for (var i = 0; i < tokensLength; i++) { + t = tokens[i]; + switch (t.type) { + case TokenType.Space: + case TokenType.Tab: + case TokenType.Newline: + t.ws = true; + t.sc = true; + + if (ws === -1) ws = i; + if (sc === -1) sc = i; + + break; + case TokenType.CommentML: + case TokenType.CommentSL: + if (ws !== -1) { + tokens[ws].ws_last = i - 1; + ws = -1; + } + + t.sc = true; + + break; + default: + if (ws !== -1) { + tokens[ws].ws_last = i - 1; + ws = -1; + } + + if (sc !== -1) { + tokens[sc].sc_last = i - 1; + sc = -1; + } + } + } + + if (ws !== -1) tokens[ws].ws_last = i - 1; + if (sc !== -1) tokens[sc].sc_last = i - 1; + } + + /** + * Pair brackets + */ + function markBrackets(tokens) { + var tokensLength = tokens.length; + var ps = []; // Parentheses + var sbs = []; // Square brackets + var cbs = []; // Curly brackets + var t = undefined; // Current token + + // For every token in the token list, if we meet an opening (left) + // bracket, push its index number to a corresponding array. + // If we then meet a closing (right) bracket, look at the corresponding + // array. If there are any elements (records about previously met + // left brackets), take a token of the last left bracket (take + // the last index number from the array and find a token with + // this index number) and save right bracket's index as a reference: + for (var i = 0; i < tokensLength; i++) { + t = tokens[i]; + switch (t.type) { + case TokenType.LeftParenthesis: + ps.push(i); + break; + case TokenType.RightParenthesis: + if (ps.length) { + t.left = ps.pop(); + tokens[t.left].right = i; + } + break; + case TokenType.LeftSquareBracket: + sbs.push(i); + break; + case TokenType.RightSquareBracket: + if (sbs.length) { + t.left = sbs.pop(); + tokens[t.left].right = i; + } + break; + case TokenType.LeftCurlyBracket: + cbs.push(i); + break; + case TokenType.RightCurlyBracket: + if (cbs.length) { + t.left = cbs.pop(); + tokens[t.left].right = i; + } + break; + } + } + } + + return function (tokens) { + markBrackets(tokens); + markSC(tokens); + }; + })(); + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict';var Node=__webpack_require__(1);var NodeType=__webpack_require__(15);var TokenType=__webpack_require__(13);var tokens=undefined;var tokensLength=undefined;var pos=undefined;var contexts={'arguments':function(){return checkArguments(pos) && getArguments();},'atkeyword':function(){return checkAtkeyword(pos) && getAtkeyword();},'atrule':function(){return checkAtrule(pos) && getAtrule();},'block':function(){return checkBlock(pos) && getBlock();},'brackets':function(){return checkBrackets(pos) && getBrackets();},'class':function(){return checkClass(pos) && getClass();},'combinator':function(){return checkCombinator(pos) && getCombinator();},'commentML':function(){return checkCommentML(pos) && getCommentML();},'commentSL':function(){return checkCommentSL(pos) && getCommentSL();},'condition':function(){return checkCondition(pos) && getCondition();},'conditionalStatement':function(){return checkConditionalStatement(pos) && getConditionalStatement();},'declaration':function(){return checkDeclaration(pos) && getDeclaration();},'declDelim':function(){return checkDeclDelim(pos) && getDeclDelim();},'default':function(){return checkDefault(pos) && getDefault();},'delim':function(){return checkDelim(pos) && getDelim();},'dimension':function(){return checkDimension(pos) && getDimension();},'expression':function(){return checkExpression(pos) && getExpression();},'extend':function(){return checkExtend(pos) && getExtend();},'function':function(){return checkFunction(pos) && getFunction();},'global':function(){return checkGlobal(pos) && getGlobal();},'ident':function(){return checkIdent(pos) && getIdent();},'important':function(){return checkImportant(pos) && getImportant();},'include':function(){return checkInclude(pos) && getInclude();},'interpolation':function(){return checkInterpolation(pos) && getInterpolation();},'loop':function(){return checkLoop(pos) && getLoop();},'mixin':function(){return checkMixin(pos) && getMixin();},'namespace':function(){return checkNamespace(pos) && getNamespace();},'number':function(){return checkNumber(pos) && getNumber();},'operator':function(){return checkOperator(pos) && getOperator();},'optional':function(){return checkOptional(pos) && getOptional();},'parentheses':function(){return checkParentheses(pos) && getParentheses();},'parentselector':function(){return checkParentSelector(pos) && getParentSelector();},'percentage':function(){return checkPercentage(pos) && getPercentage();},'placeholder':function(){return checkPlaceholder(pos) && getPlaceholder();},'progid':function(){return checkProgid(pos) && getProgid();},'property':function(){return checkProperty(pos) && getProperty();},'propertyDelim':function(){return checkPropertyDelim(pos) && getPropertyDelim();},'pseudoc':function(){return checkPseudoc(pos) && getPseudoc();},'pseudoe':function(){return checkPseudoe(pos) && getPseudoe();},'ruleset':function(){return checkRuleset(pos) && getRuleset();},'s':function(){return checkS(pos) && getS();},'selector':function(){return checkSelector(pos) && getSelector();},'shash':function(){return checkShash(pos) && getShash();},'string':function(){return checkString(pos) && getString();},'stylesheet':function(){return checkStylesheet(pos) && getStylesheet();},'unary':function(){return checkUnary(pos) && getUnary();},'unicodeRange':function(){return checkUnicodeRange(pos) && getUnicodeRange();},'urange':function(){return checkUrange(pos) && getUrange();},'uri':function(){return checkUri(pos) && getUri();},'value':function(){return checkValue(pos) && getValue();},'variable':function(){return checkVariable(pos) && getVariable();},'variableslist':function(){return checkVariablesList(pos) && getVariablesList();},'vhash':function(){return checkVhash(pos) && getVhash();}}; /** + * Stop parsing and display error + * @param {Number=} i Token's index number + */function throwError(i){var ln=i?tokens[i].ln:tokens[pos].ln;throw {line:ln,syntax:'scss'};} /** + * @param {Object} exclude + * @param {Number} i Token's index number + * @returns {Number} + */function checkExcluding(exclude,i){var start=i;while(i < tokensLength) {if(exclude[tokens[i++].type])break;}return i - start - 2;} /** + * @param {Number} start + * @param {Number} finish + * @returns {String} + */function joinValues(start,finish){var s='';for(var i=start;i < finish + 1;i++) {s += tokens[i].value;}return s;} /** + * @param {Number} start + * @param {Number} num + * @returns {String} + */function joinValues2(start,num){if(start + num - 1 >= tokensLength)return;var s='';for(var i=0;i < num;i++) {s += tokens[start + i].value;}return s;}function getLastPosition(content,line,column,colOffset){return typeof content === 'string'?getLastPositionForString(content,line,column,colOffset):getLastPositionForArray(content,line,column,colOffset);}function getLastPositionForString(content,line,column,colOffset){var position=[];if(!content){position = [line,column];if(colOffset)position[1] += colOffset - 1;return position;}var lastLinebreak=content.lastIndexOf('\n');var endsWithLinebreak=lastLinebreak === content.length - 1;var splitContent=content.split('\n');var linebreaksCount=splitContent.length - 1;var prevLinebreak=linebreaksCount === 0 || linebreaksCount === 1?-1:content.length - splitContent[linebreaksCount - 1].length - 2; // Line: + var offset=endsWithLinebreak?linebreaksCount - 1:linebreaksCount;position[0] = line + offset; // Column: + if(endsWithLinebreak){offset = prevLinebreak !== -1?content.length - prevLinebreak:content.length - 1;}else {offset = linebreaksCount !== 0?content.length - lastLinebreak - column - 1:content.length - 1;}position[1] = column + offset;if(!colOffset)return position;if(endsWithLinebreak){position[0]++;position[1] = colOffset;}else {position[1] += colOffset;}return position;}function getLastPositionForArray(content,line,column,colOffset){var position;if(content.length === 0){position = [line,column];}else {var c=content[content.length - 1];if(c.hasOwnProperty('end')){position = [c.end.line,c.end.column];}else {position = getLastPosition(c.content,line,column);}}if(!colOffset)return position;if(tokens[pos - 1].type !== 'Newline'){position[1] += colOffset;}else {position[0]++;position[1] = 1;}return position;}function newNode(type,content,line,column,end){if(!end)end = getLastPosition(content,line,column);return new Node({type:type,content:content,start:{line:line,column:column},end:{line:end[0],column:end[1]},syntax:'scss'});} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkAny(i){return checkBrackets(i) || checkParentheses(i) || checkString(i) || checkVariablesList(i) || checkVariable(i) || checkPlaceholder(i) || checkPercentage(i) || checkDimension(i) || checkUnicodeRange(i) || checkNumber(i) || checkUri(i) || checkExpression(i) || checkFunction(i) || checkInterpolation(i) || checkIdent(i) || checkClass(i) || checkUnary(i);} /** + * @returns {Array} + */function getAny(){if(checkBrackets(pos))return getBrackets();else if(checkParentheses(pos))return getParentheses();else if(checkString(pos))return getString();else if(checkVariablesList(pos))return getVariablesList();else if(checkVariable(pos))return getVariable();else if(checkPlaceholder(pos))return getPlaceholder();else if(checkPercentage(pos))return getPercentage();else if(checkDimension(pos))return getDimension();else if(checkUnicodeRange(pos))return getUnicodeRange();else if(checkNumber(pos))return getNumber();else if(checkUri(pos))return getUri();else if(checkExpression(pos))return getExpression();else if(checkFunction(pos))return getFunction();else if(checkInterpolation(pos))return getInterpolation();else if(checkIdent(pos))return getIdent();else if(checkClass(pos))return getClass();else if(checkUnary(pos))return getUnary();} /** + * Check if token is part of mixin's arguments. + * @param {Number} i Token's index number + * @returns {Number} Length of arguments + */function checkArguments(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;i++;while(i < tokens[start].right) {if(l = checkArgument(i))i += l;else return 0;}return tokens[start].right - start + 1;} /** + * Check if token is valid to be part of arguments list + * @param {Number} i Token's index number + * @returns {Number} Length of argument + */function checkArgument(i){return checkBrackets(i) || checkParentheses(i) || checkDeclaration(i) || checkFunction(i) || checkVariablesList(i) || checkVariable(i) || checkSC(i) || checkDelim(i) || checkDeclDelim(i) || checkString(i) || checkPercentage(i) || checkDimension(i) || checkNumber(i) || checkUri(i) || checkInterpolation(i) || checkIdent(i) || checkVhash(i) || checkOperator(i) || checkUnary(i) || checkImportant(i) || checkParentSelector(i);} /** + * @returns {Array} Node that is part of arguments list + */function getArgument(){if(checkBrackets(pos))return getBrackets();else if(checkParentheses(pos))return getParentheses();else if(checkDeclaration(pos))return getDeclaration();else if(checkFunction(pos))return getFunction();else if(checkVariablesList(pos))return getVariablesList();else if(checkVariable(pos))return getVariable();else if(checkSC(pos))return getSC();else if(checkDelim(pos))return getDelim();else if(checkDeclDelim(pos))return getDeclDelim();else if(checkString(pos))return getString();else if(checkPercentage(pos))return getPercentage();else if(checkDimension(pos))return getDimension();else if(checkNumber(pos))return getNumber();else if(checkUri(pos))return getUri();else if(checkInterpolation(pos))return getInterpolation();else if(checkIdent(pos))return getIdent();else if(checkVhash(pos))return getVhash();else if(checkOperator(pos))return getOperator();else if(checkUnary(pos))return getUnary();else if(checkImportant(pos))return getImportant();else if(checkParentSelector(pos))return getParentSelector();} /** + * Check if token is part of an @-word (e.g. `@import`, `@include`) + * @param {Number} i Token's index number + * @returns {Number} + */function checkAtkeyword(i){var l; // Check that token is `@`: + if(i >= tokensLength || tokens[i++].type !== TokenType.CommercialAt)return 0;return (l = checkIdentOrInterpolation(i))?l + 1:0;} /** + * Get node with @-word + * @returns {Array} `['atkeyword', ['ident', x]]` where `x` is + * an identifier without + * `@` (e.g. `import`, `include`) + */function getAtkeyword(){var startPos=pos;var x=undefined;pos++;x = getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.AtkeywordType,x,token.ln,token.col);} /** + * Check if token is a part of an @-rule + * @param {Number} i Token's index number + * @returns {Number} Length of @-rule + */function checkAtrule(i){var l;if(i >= tokensLength)return 0; // If token already has a record of being part of an @-rule, + // return the @-rule's length: + if(tokens[i].atrule_l !== undefined)return tokens[i].atrule_l; // If token is part of an @-rule, save the rule's type to token. + // @keyframes: + if(l = checkKeyframesRule(i))tokens[i].atrule_type = 4; // @-rule with ruleset: + else if(l = checkAtruler(i))tokens[i].atrule_type = 1; // Block @-rule: + else if(l = checkAtruleb(i))tokens[i].atrule_type = 2; // Single-line @-rule: + else if(l = checkAtrules(i))tokens[i].atrule_type = 3;else return 0; // If token is part of an @-rule, save the rule's length to token: + tokens[i].atrule_l = l;return l;} /** + * Get node with @-rule + * @returns {Array} + */function getAtrule(){switch(tokens[pos].atrule_type){case 1:return getAtruler(); // @-rule with ruleset + case 2:return getAtruleb(); // Block @-rule + case 3:return getAtrules(); // Single-line @-rule + case 4:return getKeyframesRule();}} /** + * Check if token is part of a block @-rule + * @param {Number} i Token's index number + * @returns {Number} Length of the @-rule + */function checkAtruleb(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(l = checkTsets(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with a block @-rule + * @returns {Array} `['atruleb', ['atkeyword', x], y, ['block', z]]` + */function getAtruleb(){var startPos=pos;var x=undefined;x = [getAtkeyword()].concat(getTsets()).concat([getBlock()]);var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);} /** + * Check if token is part of an @-rule with ruleset + * @param {Number} i Token's index number + * @returns {Number} Length of the @-rule + */function checkAtruler(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(l = checkTsets(i))i += l;if(i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket)i++;else return 0;if(l = checkAtrulers(i))i += l;if(i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket)i++;else return 0;return i - start;} /** + * Get node with an @-rule with ruleset + * @returns {Array} ['atruler', ['atkeyword', x], y, z] + */function getAtruler(){var startPos=pos;var x=undefined;x = [getAtkeyword()].concat(getTsets());x.push(getAtrulers());var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkAtrulers(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;while(l = checkRuleset(i) || checkAtrule(i) || checkSC(i)) {i += l;}if(i < tokensLength)tokens[i].atrulers_end = 1;return i - start;} /** + * @returns {Array} `['atrulers', x]` + */function getAtrulers(){var startPos=pos;var x=undefined;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;x = getSC();while(!tokens[pos].atrulers_end) {if(checkSC(pos))x = x.concat(getSC());else if(checkAtrule(pos))x.push(getAtrule());else if(checkRuleset(pos))x.push(getRuleset());}x = x.concat(getSC());var end=getLastPosition(x,line,column,1);pos++;return newNode(NodeType.BlockType,x,token.ln,token.col,end);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkAtrules(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(l = checkTsets(i))i += l;return i - start;} /** + * @returns {Array} `['atrules', ['atkeyword', x], y]` + */function getAtrules(){var startPos=pos;var x=undefined;x = [getAtkeyword()].concat(getTsets());var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);} /** + * Check if token is part of a block (e.g. `{...}`). + * @param {Number} i Token's index number + * @returns {Number} Length of the block + */function checkBlock(i){return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket?tokens[i].right - i + 1:0;} /** + * Get node with a block + * @returns {Array} `['block', x]` + */function getBlock(){var startPos=pos;var end=tokens[pos].right;var x=[];var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;while(pos < end) {if(checkBlockdecl(pos))x = x.concat(getBlockdecl());else throwError();}var end_=getLastPosition(x,line,column,1);pos = end + 1;return newNode(NodeType.BlockType,x,token.ln,token.col,end_);} /** + * Check if token is part of a declaration (property-value pair) + * @param {Number} i Token's index number + * @returns {Number} Length of the declaration + */function checkBlockdecl(i){var l;if(i >= tokensLength)return 0;if(l = checkBlockdecl1(i))tokens[i].bd_type = 1;else if(l = checkBlockdecl2(i))tokens[i].bd_type = 2;else if(l = checkBlockdecl3(i))tokens[i].bd_type = 3;else if(l = checkBlockdecl4(i))tokens[i].bd_type = 4;else return 0;return l;} /** + * @returns {Array} + */function getBlockdecl(){switch(tokens[pos].bd_type){case 1:return getBlockdecl1();case 2:return getBlockdecl2();case 3:return getBlockdecl3();case 4:return getBlockdecl4();}} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkBlockdecl1(i){var start=i;var l=undefined;if(l = checkSC(i))i += l;if(l = checkConditionalStatement(i))tokens[i].bd_kind = 1;else if(l = checkInclude(i))tokens[i].bd_kind = 2;else if(l = checkExtend(i))tokens[i].bd_kind = 4;else if(l = checkLoop(i))tokens[i].bd_kind = 3;else if(l = checkAtrule(i))tokens[i].bd_kind = 6;else if(l = checkRuleset(i))tokens[i].bd_kind = 7;else if(l = checkDeclaration(i))tokens[i].bd_kind = 5;else return 0;i += l;if(i < tokensLength && (l = checkDeclDelim(i)))i += l;else return 0;if(l = checkSC(i))i += l;return i - start;} /** + * @returns {Array} + */function getBlockdecl1(){var sc=getSC();var x=undefined;switch(tokens[pos].bd_kind){case 1:x = getConditionalStatement();break;case 2:x = getInclude();break;case 3:x = getLoop();break;case 4:x = getExtend();break;case 5:x = getDeclaration();break;case 6:x = getAtrule();break;case 7:x = getRuleset();break;}return sc.concat([x]).concat([getDeclDelim()]).concat(getSC());} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkBlockdecl2(i){var start=i;var l=undefined;if(l = checkSC(i))i += l;if(l = checkConditionalStatement(i))tokens[i].bd_kind = 1;else if(l = checkInclude(i))tokens[i].bd_kind = 2;else if(l = checkExtend(i))tokens[i].bd_kind = 4;else if(l = checkMixin(i))tokens[i].bd_kind = 8;else if(l = checkLoop(i))tokens[i].bd_kind = 3;else if(l = checkAtrule(i))tokens[i].bd_kind = 6;else if(l = checkRuleset(i))tokens[i].bd_kind = 7;else if(l = checkDeclaration(i))tokens[i].bd_kind = 5;else return 0;i += l;if(l = checkSC(i))i += l;return i - start;} /** + * @returns {Array} + */function getBlockdecl2(){var sc=getSC();var x=undefined;switch(tokens[pos].bd_kind){case 1:x = getConditionalStatement();break;case 2:x = getInclude();break;case 3:x = getLoop();break;case 4:x = getExtend();break;case 5:x = getDeclaration();break;case 6:x = getAtrule();break;case 7:x = getRuleset();break;case 8:x = getMixin();break;}return sc.concat([x]).concat(getSC());} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkBlockdecl3(i){var start=i;var l=undefined;if(l = checkSC(i))i += l;if(l = checkDeclDelim(i))i += l;else return 0;if(l = checkSC(i))i += l;return i - start;} /** + * @returns {Array} `[s0, ['declDelim'], s1]` where `s0` and `s1` are + * are optional whitespaces. + */function getBlockdecl3(){return getSC().concat([getDeclDelim()]).concat(getSC());} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkBlockdecl4(i){return checkSC(i);} /** + * @returns {Array} + */function getBlockdecl4(){return getSC();} /** + * Check if token is part of text inside square brackets, e.g. `[1]` + * @param {Number} i Token's index number + * @returns {Number} + */function checkBrackets(i){if(i >= tokensLength || tokens[i].type !== TokenType.LeftSquareBracket)return 0;return tokens[i].right - i + 1;} /** + * Get node with text inside parentheses or square brackets (e.g. `(1)`) + * @return {Node} + */function getBrackets(){var startPos=pos;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;var tsets=getTsets();var end=getLastPosition(tsets,line,column,1);pos++;return newNode(NodeType.BracketsType,tsets,token.ln,token.col,end);} /** + * Check if token is part of a class selector (e.g. `.abc`) + * @param {Number} i Token's index number + * @returns {Number} Length of the class selector + */function checkClass(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(tokens[i].class_l)return tokens[i].class_l;if(tokens[i++].type !== TokenType.FullStop)return 0; // Check for `-` at beginning. + if(tokens[i].type === TokenType.HyphenMinus)i += 1;if(l = checkIdentOrInterpolation(i))i += l;else return 0;while(i < tokensLength) {if(l = checkIdentOrInterpolation(i) || checkNumber(i))i += l;else if(tokens[i].type === TokenType.HyphenMinus)i += 1;else break;}tokens[start].classEnd = i;return i - start;} /** + * Get node with a class selector + * @returns {Array} `['class', ['ident', x]]` where x is a class's + * identifier (without `.`, e.g. `abc`). + */function getClass(){var startPos=pos;var type=NodeType.ClassType;var token=tokens[startPos];var line=token.ln;var column=token.col;var content=[];var end=token.classEnd; // Skip `.` + pos++;while(pos < end) {if(checkIdentOrInterpolation(pos)){content = content.concat(getIdentOrInterpolation());}else if(checkNumber(pos)){content = content.concat(getNumber());}else if(tokens[pos].type === TokenType.HyphenMinus){content.push(newNode(NodeType.IdentType,tokens[pos].value,tokens[pos].ln,tokens[pos].col));pos++;}else break;}return newNode(type,content,line,column);}function checkCombinator(i){if(i >= tokensLength)return 0;var l=undefined;if(l = checkCombinator1(i))tokens[i].combinatorType = 1;else if(l = checkCombinator2(i))tokens[i].combinatorType = 2;else if(l = checkCombinator3(i))tokens[i].combinatorType = 3;return l;}function getCombinator(){var type=tokens[pos].combinatorType;if(type === 1)return getCombinator1();if(type === 2)return getCombinator2();if(type === 3)return getCombinator3();} /** + * (1) `||` + */function checkCombinator1(i){if(tokens[i].type === TokenType.VerticalLine && tokens[i + 1].type === TokenType.VerticalLine)return 2;else return 0;}function getCombinator1(){var type=NodeType.CombinatorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content='||';pos += 2;return newNode(type,content,line,column);} /** + * (1) `>` + * (2) `+` + * (3) `~` + */function checkCombinator2(i){var type=tokens[i].type;if(type === TokenType.PlusSign || type === TokenType.GreaterThanSign || type === TokenType.Tilde)return 1;else return 0;}function getCombinator2(){var type=NodeType.CombinatorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=tokens[pos++].value;return newNode(type,content,line,column);} /** + * (1) `/panda/` + */function checkCombinator3(i){var start=i;if(tokens[i].type === TokenType.Solidus)i++;else return 0;var l=undefined;if(l = checkIdent(i))i += l;else return 0;if(tokens[i].type === TokenType.Solidus)i++;else return 0;return i - start;}function getCombinator3(){var type=NodeType.CombinatorType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `/`. + pos++;var ident=getIdent(); // Skip `/`. + pos++;var content='/' + ident.content + '/';return newNode(type,content,line,column);} /** + * Check if token is a multiline comment. + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a multiline comment, otherwise `0` + */function checkCommentML(i){return i < tokensLength && tokens[i].type === TokenType.CommentML?1:0;} /** + * Get node with a multiline comment + * @returns {Array} `['commentML', x]` where `x` + * is the comment's text (without `/*` and `* /`). + */function getCommentML(){var startPos=pos;var s=tokens[pos].value.substring(2);var l=s.length;var token=tokens[startPos];var line=token.ln;var column=token.col;if(s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/')s = s.substring(0,l - 2);var end=getLastPosition(s,line,column,2);if(end[0] === line)end[1] += 2;pos++;return newNode(NodeType.CommentMLType,s,token.ln,token.col,end);} /** + * Check if token is part of a single-line comment. + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a single-line comment, otherwise `0` + */function checkCommentSL(i){return i < tokensLength && tokens[i].type === TokenType.CommentSL?1:0;} /** + * Get node with a single-line comment. + * @returns {Array} `['commentSL', x]` where `x` is comment's message + * (without `//`) + */function getCommentSL(){var startPos=pos;var x=undefined;var token=tokens[startPos];var line=token.ln;var column=token.col;x = tokens[pos++].value.substring(2);var end=getLastPosition(x,line,column + 2);return newNode(NodeType.CommentSLType,x,token.ln,token.col,end);} /** + * Check if token is part of a condition + * (e.g. `@if ...`, `@else if ...` or `@else ...`). + * @param {Number} i Token's index number + * @returns {Number} Length of the condition + */function checkCondition(i){var start=i;var l=undefined;var _i=undefined;var s=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(['if','else'].indexOf(tokens[start + 1].value) < 0)return 0;while(i < tokensLength) {if(l = checkBlock(i))break;s = checkSC(i);_i = i + s;if(l = _checkCondition(_i))i += l + s;else break;}return i - start;}function _checkCondition(i){return checkVariable(i) || checkNumber(i) || checkInterpolation(i) || checkIdent(i) || checkOperator(i) || checkCombinator(i) || checkString(i);} /** + * Get node with a condition. + * @returns {Array} `['condition', x]` + */function getCondition(){var startPos=pos;var x=[];var s;var _pos;x.push(getAtkeyword());while(pos < tokensLength) {if(checkBlock(pos))break;s = checkSC(pos);_pos = pos + s;if(!_checkCondition(_pos))break;if(s)x = x.concat(getSC());x.push(_getCondition());}var token=tokens[startPos];return newNode(NodeType.ConditionType,x,token.ln,token.col);}function _getCondition(){if(checkVariable(pos))return getVariable();if(checkNumber(pos))return getNumber();if(checkInterpolation(pos))return getInterpolation();if(checkIdent(pos))return getIdent();if(checkOperator(pos))return getOperator();if(checkCombinator(pos))return getCombinator();if(checkString(pos))return getString();} /** + * Check if token is part of a conditional statement + * (e.g. `@if ... {} @else if ... {} @else ... {}`). + * @param {Number} i Token's index number + * @returns {Number} Length of the condition + */function checkConditionalStatement(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkCondition(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with a condition. + * @returns {Array} `['condition', x]` + */function getConditionalStatement(){var startPos=pos;var x=[];x.push(getCondition());x = x.concat(getSC());x.push(getBlock());var token=tokens[startPos];return newNode(NodeType.ConditionalStatementType,x,token.ln,token.col);} /** + * Check if token is part of a declaration (property-value pair) + * @param {Number} i Token's index number + * @returns {Number} Length of the declaration + */function checkDeclaration(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkProperty(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkPropertyDelim(i))i++;else return 0;if(l = checkSC(i))i += l;if(l = checkValue(i))i += l;else return 0;return i - start;} /** + * Get node with a declaration + * @returns {Array} `['declaration', ['property', x], ['propertyDelim'], + * ['value', y]]` + */function getDeclaration(){var startPos=pos;var x=[];x.push(getProperty());x = x.concat(getSC());x.push(getPropertyDelim());x = x.concat(getSC());x.push(getValue());var token=tokens[startPos];return newNode(NodeType.DeclarationType,x,token.ln,token.col);} /** + * Check if token is a semicolon + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a semicolon, otherwise `0` + */function checkDeclDelim(i){return i < tokensLength && tokens[i].type === TokenType.Semicolon?1:0;} /** + * Get node with a semicolon + * @returns {Array} `['declDelim']` + */function getDeclDelim(){var startPos=pos++;var token=tokens[startPos];return newNode(NodeType.DeclDelimType,';',token.ln,token.col);} /** + * Check if token if part of `!default` word. + * @param {Number} i Token's index number + * @returns {Number} Length of the `!default` word + */function checkDefault(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark)return 0;if(l = checkSC(i))i += l;if(tokens[i].value === 'default'){tokens[start].defaultEnd = i;return i - start + 1;}else {return 0;}} /** + * Get node with a `!default` word + * @returns {Array} `['default', sc]` where `sc` is optional whitespace + */function getDefault(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.defaultEnd);pos = token.defaultEnd + 1;return newNode(NodeType.DefaultType,content,line,column);} /** + * Check if token is a comma + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a comma, otherwise `0` + */function checkDelim(i){return i < tokensLength && tokens[i].type === TokenType.Comma?1:0;} /** + * Get node with a comma + * @returns {Array} `['delim']` + */function getDelim(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.DelimType,',',token.ln,token.col);} /** + * Check if token is part of a number with dimension unit (e.g. `10px`) + * @param {Number} i Token's index number + * @return {Number} + */function checkDimension(i){var ln=checkNumber(i);var li=undefined;if(i >= tokensLength || !ln || i + ln >= tokensLength)return 0;return (li = checkUnit(i + ln))?ln + li:0;} /** + * Get node of a number with dimension unit + * @return {Node} + */function getDimension(){var type=NodeType.DimensionType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[getNumber(),getUnit()];return newNode(type,content,line,column);} /** + * Check if token is unit + * @param {Number} i Token's index number + * @return {Number} + */function checkUnit(i){var units=['em','ex','ch','rem','vh','vw','vmin','vmax','px','mm','q','cm','in','pt','pc','deg','grad','rad','turn','s','ms','Hz','kHz','dpi','dpcm','dppx'];return units.indexOf(tokens[i].value) !== -1?1:0;} /** + * Get unit node of type ident + * @return {Node} An ident node containing the unit value + */function getUnit(){var type=NodeType.IdentType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=token.value;pos++;return newNode(type,content,line,column);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkExpression(i){var start=i;if(i >= tokensLength || tokens[i++].value !== 'expression' || i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;return tokens[i].right - start + 1;} /** + * @returns {Array} + */function getExpression(){var startPos=pos;var e;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;e = joinValues(pos + 1,tokens[pos].right - 1);var end=getLastPosition(e,line,column,1);if(end[0] === line)end[1] += 11;pos = tokens[pos].right + 1;return newNode(NodeType.ExpressionType,e,token.ln,token.col,end);}function checkExtend(i){var l=0;if(l = checkExtend1(i))tokens[i].extend_child = 1;else if(l = checkExtend2(i))tokens[i].extend_child = 2;return l;}function getExtend(){var type=tokens[pos].extend_child;if(type === 1)return getExtend1();else if(type === 2)return getExtend2();} /** + * Checks if token is part of an extend with `!optional` flag. + * @param {Number} i + */function checkExtend1(i){var start=i;var l;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'extend')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkSelectorsGroup(i))i += l;else return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkOptional(i))i += l;else return 0;return i - start;}function getExtend1(){var startPos=pos;var x=[].concat([getAtkeyword()],getSC(),getSelectorsGroup(),getSC(),[getOptional()]);var token=tokens[startPos];return newNode(NodeType.ExtendType,x,token.ln,token.col);} /** + * Checks if token is part of an extend without `!optional` flag. + * @param {Number} i + */function checkExtend2(i){var start=i;var l;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'extend')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkSelectorsGroup(i))i += l;else return 0;return i - start;}function getExtend2(){var startPos=pos;var x=[].concat([getAtkeyword()],getSC(),getSelectorsGroup());var token=tokens[startPos];return newNode(NodeType.ExtendType,x,token.ln,token.col);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkFunction(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis?tokens[i].right - start + 1:0;} /** + * @returns {Array} + */function getFunction(){var startPos=pos;var x=getIdentOrInterpolation();var body=undefined;body = getArguments();x.push(body);var token=tokens[startPos];return newNode(NodeType.FunctionType,x,token.ln,token.col);} /** + * @returns {Array} + */function getArguments(){var startPos=pos;var x=[];var body=undefined;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;while(pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) {if(checkDeclaration(pos))x.push(getDeclaration());else if(checkArgument(pos)){body = getArgument();if(typeof body.content === 'string')x.push(body);else x = x.concat(body);}else if(checkClass(pos))x.push(getClass());else throwError();}var end=getLastPosition(x,line,column,1);pos++;return newNode(NodeType.ArgumentsType,x,token.ln,token.col,end);} /** + * Check if token is part of an identifier + * @param {Number} i Token's index number + * @returns {Number} Length of the identifier + */function checkIdent(i){var start=i;if(i >= tokensLength)return 0; // Check if token is part of a negative number + if(tokens[i].type === TokenType.HyphenMinus && tokens[i + 1].type === TokenType.DecimalNumber)return 0;if(tokens[i].type === TokenType.HyphenMinus)i++;if(tokens[i].type === TokenType.LowLine || tokens[i].type === TokenType.Identifier)i++;else return 0;for(;i < tokensLength;i++) {if(tokens[i].type !== TokenType.HyphenMinus && tokens[i].type !== TokenType.LowLine && tokens[i].type !== TokenType.Identifier && tokens[i].type !== TokenType.DecimalNumber)break;}tokens[start].ident_last = i - 1;return i - start;} /** + * Get node with an identifier + * @returns {Array} `['ident', x]` where `x` is identifier's name + */function getIdent(){var startPos=pos;var x=joinValues(pos,tokens[pos].ident_last);pos = tokens[pos].ident_last + 1;var token=tokens[startPos];return newNode(NodeType.IdentType,x,token.ln,token.col);} /** + * @param {number} i Token's index number + * @returns {number} Length of the identifier + */function checkPartialIdent(i){var start=i;if(i >= tokensLength)return 0;for(;i < tokensLength;i++) {if(tokens[i].type !== TokenType.HyphenMinus && tokens[i].type !== TokenType.LowLine && tokens[i].type !== TokenType.Identifier && tokens[i].type !== TokenType.DecimalNumber)break;}tokens[start].ident_last = i - 1;return i - start;}function checkIdentOrInterpolation(i){var start=i;var l=undefined;while(i < tokensLength) {if(l = checkInterpolation(i) || checkIdent(i))i += l;else break;}return i - start;}function getIdentOrInterpolation(){var x=[];while(pos < tokensLength) {if(checkInterpolation(pos))x.push(getInterpolation());else if(checkIdent(pos))x.push(getIdent());else break;}return x;} /** + * Check if token is part of `!important` word + * @param {Number} i Token's index number + * @returns {Number} + */function checkImportant(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark)return 0;if(l = checkSC(i))i += l;if(tokens[i].value === 'important'){tokens[start].importantEnd = i;return i - start + 1;}else {return 0;}} /** + * Get node with `!important` word + * @returns {Array} `['important', sc]` where `sc` is optional whitespace + */function getImportant(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.importantEnd);pos = token.importantEnd + 1;return newNode(NodeType.ImportantType,content,line,column);} /** + * Check if token is part of an included mixin (`@include` or `@extend` + * directive). + * @param {Number} i Token's index number + * @returns {Number} Length of the included mixin + */function checkInclude(i){var l;if(i >= tokensLength)return 0;if(l = checkInclude1(i))tokens[i].include_type = 1;else if(l = checkInclude2(i))tokens[i].include_type = 2;else if(l = checkInclude3(i))tokens[i].include_type = 3;else if(l = checkInclude4(i))tokens[i].include_type = 4;else if(l = checkInclude5(i))tokens[i].include_type = 5;return l;} /** + * Check if token is part of `!global` word + * @param {Number} i Token's index number + * @returns {Number} + */function checkGlobal(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark)return 0;if(l = checkSC(i))i += l;if(tokens[i].value === 'global'){tokens[start].globalEnd = i;return i - start + 1;}else {return 0;}} /** + * Get node with `!global` word + */function getGlobal(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.globalEnd);pos = token.globalEnd + 1;return newNode(NodeType.GlobalType,content,line,column);} /** + * Get node with included mixin + * @returns {Array} `['include', x]` + */function getInclude(){switch(tokens[pos].include_type){case 1:return getInclude1();case 2:return getInclude2();case 3:return getInclude3();case 4:return getInclude4();case 5:return getInclude5();}} /** + * Get node with included mixin with keyfames selector like + * `@include nani(foo) { 0% {}}` + * @param {Number} i Token's index number + * @returns {Number} Length of the include + */function checkInclude1(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkArguments(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkKeyframesBlocks(i))i += l;else return 0;return i - start;} /** + * Get node with included mixin with keyfames selector like + * `@include nani(foo) { 0% {}}` + * @returns {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, + * ['arguments', z], sc, ['block', q], sc` where `x` is `include` or + * `extend`, `y` is mixin's identifier (selector), `z` are arguments + * passed to the mixin, `q` is block passed to the mixin containing a + * ruleset > selector > keyframesSelector, and `sc` are optional + * whitespaces + */function getInclude1(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation(),getSC(),getArguments(),getSC(),getKeyframesBlocks());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an included mixin like `@include nani(foo) {...}` + * @param {Number} i Token's index number + * @returns {Number} Length of the include + */function checkInclude2(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkArguments(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with included mixin like `@include nani(foo) {...}` + * @returns {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, + * ['arguments', z], sc, ['block', q], sc` where `x` is `include` or + * `extend`, `y` is mixin's identifier (selector), `z` are arguments + * passed to the mixin, `q` is block passed to the mixin and `sc` + * are optional whitespaces + */function getInclude2(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation(),getSC(),getArguments(),getSC(),getBlock());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an included mixin like `@include nani(foo)` + * @param {Number} i Token's index number + * @returns {Number} Length of the include + */function checkInclude3(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkArguments(i))i += l;else return 0;return i - start;} /** + * Get node with included mixin like `@include nani(foo)` + * @returns {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, + * ['arguments', z], sc]` where `x` is `include` or `extend`, `y` is + * mixin's identifier (selector), `z` are arguments passed to the + * mixin and `sc` are optional whitespaces + */function getInclude3(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation(),getSC(),getArguments());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an included mixin with a content block passed + * as an argument (e.g. `@include nani {...}`) + * @param {Number} i Token's index number + * @returns {Number} Length of the mixin + */function checkInclude4(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with an included mixin with a content block passed + * as an argument (e.g. `@include nani {...}`) + * @returns {Array} `['include', x]` + */function getInclude4(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation(),getSC(),getBlock());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkInclude5(i){var start=i;var l=undefined;if(l = checkAtkeyword(i))i += l;else return 0;if(tokens[start + 1].value !== 'include')return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;} /** + * @returns {Array} `['include', x]` + */function getInclude5(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);} /** + * Check if token is part of an interpolated variable (e.g. `#{$nani}`). + * @param {Number} i Token's index number + * @returns {Number} + */function checkInterpolation(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.NumberSign || !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket)return 0;i += 2;while(tokens[i].type !== TokenType.RightCurlyBracket) {if(l = checkArgument(i))i += l;else return 0;}return tokens[i].type === TokenType.RightCurlyBracket?i - start + 1:0;} /** + * Get node with an interpolated variable + * @returns {Array} `['interpolation', x]` + */function getInterpolation(){var startPos=pos;var x=[];var token=tokens[startPos];var line=token.ln;var column=token.col; // Skip `#{`: + pos += 2;while(pos < tokensLength && tokens[pos].type !== TokenType.RightCurlyBracket) {var body=getArgument();if(typeof body.content === 'string')x.push(body);else x = x.concat(body);}var end=getLastPosition(x,line,column,1); // Skip `}`: + pos++;return newNode(NodeType.InterpolationType,x,token.ln,token.col,end);} /** + * Check a single keyframe block - `5% {}` + * @param {Number} i + * @returns {Number} + */function checkKeyframesBlock(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkKeyframesSelectorsGroup(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get a single keyframe block - `5% {}` + * @returns {Node} + */function getKeyframesBlock(){var type=NodeType.RulesetType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[].concat(getKeyframesSelectorsGroup(),getSC(),[getBlock()]);return newNode(type,content,line,column);} /** + * Check all keyframe blocks - `5% {} 100% {}` + * @param {Number} i + * @returns {Number} + */function checkKeyframesBlocks(i){var start=i;var l=undefined;if(i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket)i++;else return 0;if(l = checkSC(i))i += l;if(l = checkKeyframesBlock(i))i += l;else return 0;while(tokens[i].type !== TokenType.RightCurlyBracket) {if(l = checkSC(i))i += l;else if(l = checkKeyframesBlock(i))i += l;else break;}if(i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket)i++;else return 0;return i - start;} /** + * Get all keyframe blocks - `5% {} 100% {}` + * @returns {Node} + */function getKeyframesBlocks(){var type=NodeType.BlockType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];var keyframesBlocksEnd=token.right; // Skip `{`. + pos++;while(pos < keyframesBlocksEnd) {if(checkSC(pos))content = content.concat(getSC());else if(checkKeyframesBlock(pos))content.push(getKeyframesBlock());else if(checkAtrule(pos))content.push(getAtrule()); // @content + else break;}var end=getLastPosition(content,line,column,1); // Skip `}`. + pos++;return newNode(type,content,line,column,end);} /** + * Check if token is part of a @keyframes rule. + * @param {Number} i Token's index number + * @return {Number} Length of the @keyframes rule + */function checkKeyframesRule(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;var atruleName=joinValues2(i - l,l);if(atruleName.indexOf('keyframes') === -1)return 0;if(l = checkSC(i))i += l;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkKeyframesBlocks(i))i += l;else return 0;return i - start;} /** + * @return {Node} + */function getKeyframesRule(){var type=NodeType.AtruleType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[].concat([getAtkeyword()],getSC(),getIdentOrInterpolation(),getSC(),[getKeyframesBlocks()]);return newNode(type,content,line,column);} /** + * Check a single keyframe selector - `5%`, `from` etc + * @param {Number} i + * @returns {Number} + */function checkKeyframesSelector(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkIdent(i)){ // Valid selectors are only `from` and `to`. + var selector=joinValues2(i,l);if(selector !== 'from' && selector !== 'to')return 0;i += l;tokens[start].keyframesSelectorType = 1;}else if(l = checkPercentage(i)){i += l;tokens[start].keyframesSelectorType = 2;}else if(l = checkInterpolation(i)){i += l;tokens[start].keyframesSelectorType = 3;}else {return 0;}return i - start;} /** + * Get a single keyframe selector + * @returns {Node} + */function getKeyframesSelector(){var keyframesSelectorType=NodeType.KeyframesSelectorType;var selectorType=NodeType.SelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(token.keyframesSelectorType === 1){content.push(getIdent());}else if(token.keyframesSelectorType === 2){content.push(getPercentage());}else if(token.keyframesSelectorType === 3){content.push(getInterpolation());}var keyframesSelector=newNode(keyframesSelectorType,content,line,column);return newNode(selectorType,[keyframesSelector],line,column);} /** + * Check the keyframe's selector groups + * @param {Number} i + * @returns {Number} + */function checkKeyframesSelectorsGroup(i){var start=i;var l=undefined;if(l = checkKeyframesSelector(i))i += l;else return 0;while(i < tokensLength) {var sb=checkSC(i);var c=checkDelim(i + sb);if(!c)break;var sa=checkSC(i + sb + c);if(l = checkKeyframesSelector(i + sb + c + sa))i += sb + c + sa + l;else break;}tokens[start].selectorsGroupEnd = i;return i - start;} /** + * Get the keyframe's selector groups + * @returns {Array} An array of keyframe selectors + */function getKeyframesSelectorsGroup(){var selectorsGroup=[];var selectorsGroupEnd=tokens[pos].selectorsGroupEnd;selectorsGroup.push(getKeyframesSelector());while(pos < selectorsGroupEnd) {selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup.push(getDelim());selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup.push(getKeyframesSelector());}return selectorsGroup;} /** + * Check if token is part of a loop. + * @param {Number} i Token's index number + * @returns {Number} Length of the loop + */function checkLoop(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkAtkeyword(i))i += l;else return 0;if(['for','each','while'].indexOf(tokens[start + 1].value) < 0)return 0;while(i < tokensLength) {if(l = checkBlock(i)){i += l;break;}else if(l = checkVariable(i) || checkNumber(i) || checkInterpolation(i) || checkIdent(i) || checkSC(i) || checkOperator(i) || checkCombinator(i) || checkString(i))i += l;else return 0;}return i - start;} /** + * Get node with a loop. + * @returns {Array} `['loop', x]` + */function getLoop(){var startPos=pos;var x=[];x.push(getAtkeyword());while(pos < tokensLength) {if(checkBlock(pos)){x.push(getBlock());break;}else if(checkVariable(pos))x.push(getVariable());else if(checkNumber(pos))x.push(getNumber());else if(checkInterpolation(pos))x.push(getInterpolation());else if(checkIdent(pos))x.push(getIdent());else if(checkOperator(pos))x.push(getOperator());else if(checkCombinator(pos))x.push(getCombinator());else if(checkSC(pos))x = x.concat(getSC());else if(checkString(pos))x.push(getString());}var token=tokens[startPos];return newNode(NodeType.LoopType,x,token.ln,token.col);} /** + * Check if token is part of a mixin + * @param {Number} i Token's index number + * @returns {Number} Length of the mixin + */function checkMixin(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if((l = checkAtkeyword(i)) && tokens[i + 1].value === 'mixin')i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkArguments(i))i += l;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;} /** + * Get node with a mixin + * @returns {Array} `['mixin', x]` + */function getMixin(){var startPos=pos;var x=[getAtkeyword()];x = x.concat(getSC());if(checkIdentOrInterpolation(pos))x = x.concat(getIdentOrInterpolation());x = x.concat(getSC());if(checkArguments(pos))x.push(getArguments());x = x.concat(getSC());if(checkBlock(pos))x.push(getBlock());var token=tokens[startPos];return newNode(NodeType.MixinType,x,token.ln,token.col);} /** + * Check if token is a namespace sign (`|`) + * @param {Number} i Token's index number + * @returns {Number} `1` if token is `|`, `0` if not + */function checkNamespace(i){return i < tokensLength && tokens[i].type === TokenType.VerticalLine?1:0;} /** + * Get node with a namespace sign + * @returns {Array} `['namespace']` + */function getNamespace(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.NamespaceType,'|',token.ln,token.col);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkNmName2(i){if(tokens[i].type === TokenType.Identifier)return 1;else if(tokens[i].type !== TokenType.DecimalNumber)return 0;i++;return i < tokensLength && tokens[i].type === TokenType.Identifier?2:1;} /** + * @returns {String} + */function getNmName2(){var s=tokens[pos].value;if(tokens[pos++].type === TokenType.DecimalNumber && pos < tokensLength && tokens[pos].type === TokenType.Identifier)s += tokens[pos++].value;return s;} /** + * Check if token is part of a number + * @param {Number} i Token's index number + * @returns {Number} Length of number + */function checkNumber(i){if(i >= tokensLength)return 0;if(tokens[i].number_l)return tokens[i].number_l; // `10`: + if(i < tokensLength && tokens[i].type === TokenType.DecimalNumber && (!tokens[i + 1] || tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop)){tokens[i].number_l = 1;return 1;} // `10.`: + if(i < tokensLength && tokens[i].type === TokenType.DecimalNumber && tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && (!tokens[i + 2] || tokens[i + 2].type !== TokenType.DecimalNumber)){tokens[i].number_l = 2;return 2;} // `.10`: + if(i < tokensLength && tokens[i].type === TokenType.FullStop && tokens[i + 1].type === TokenType.DecimalNumber){tokens[i].number_l = 2;return 2;} // `10.10`: + if(i < tokensLength && tokens[i].type === TokenType.DecimalNumber && tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber){tokens[i].number_l = 3;return 3;}return 0;} /** + * Get node with number + * @returns {Array} `['number', x]` where `x` is a number converted + * to string. + */function getNumber(){var s='';var startPos=pos;var l=tokens[pos].number_l;for(var j=0;j < l;j++) {s += tokens[pos + j].value;}pos += l;var token=tokens[startPos];return newNode(NodeType.NumberType,s,token.ln,token.col);} /** + * Check if token is an operator (`/`, `%`, `,`, `:` or `=`). + * @param {Number} i Token's index number + * @returns {Number} `1` if token is an operator, otherwise `0` + */function checkOperator(i){if(i >= tokensLength)return 0;switch(tokens[i].type){case TokenType.Solidus:case TokenType.PercentSign:case TokenType.Comma:case TokenType.Colon:case TokenType.EqualsSign:case TokenType.EqualitySign:case TokenType.InequalitySign:case TokenType.LessThanSign:case TokenType.GreaterThanSign:case TokenType.Asterisk:return 1;}return 0;} /** + * Get node with an operator + * @returns {Array} `['operator', x]` where `x` is an operator converted + * to string. + */function getOperator(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.OperatorType,x,token.ln,token.col);} /** + * Check if token is part of `!optional` word + * @param {Number} i Token's index number + * @returns {Number} + */function checkOptional(i){var start=i;var l=undefined;if(i >= tokensLength || tokens[i++].type !== TokenType.ExclamationMark)return 0;if(l = checkSC(i))i += l;if(tokens[i].value === 'optional'){tokens[start].optionalEnd = i;return i - start + 1;}else {return 0;}} /** + * Get node with `!optional` word + */function getOptional(){var token=tokens[pos];var line=token.ln;var column=token.col;var content=joinValues(pos,token.optionalEnd);pos = token.optionalEnd + 1;return newNode(NodeType.OptionalType,content,line,column);} /** + * Check if token is part of text inside parentheses, e.g. `(1)` + * @param {Number} i Token's index number + * @return {Number} + */function checkParentheses(i){if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;return tokens[i].right - i + 1;} /** + * Get node with text inside parentheses, e.g. `(1)` + * @return {Node} + */function getParentheses(){var type=NodeType.ParenthesesType;var token=tokens[pos];var line=token.ln;var column=token.col;pos++;var tsets=getTsets();var end=getLastPosition(tsets,line,column,1);pos++;return newNode(type,tsets,line,column,end);} /** + * Check if token is a parent selector, e.g. `&` + * @param {number} i Token's index number + * @return {number} + */function checkParentSelector(i){return i < tokensLength && tokens[i].type === TokenType.Ampersand?1:0;} /** + * Get node with a parent selector + * @return {Node} + */function getParentSelector(){var startPos=pos;var token=tokens[startPos];pos++;return newNode(NodeType.ParentSelectorType,'&',token.ln,token.col);} /** + * Check if token is a parent selector extension, e.g. `&--foo-bar` + * @param {number} i Token's index number + * @returns {number} Length of the parent selector extension + */function checkParentSelectorExtension(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;while(i < tokensLength) {if(l = checkNumber(i) || checkPartialIdent(i) || checkIdentOrInterpolation(i))i += l;else break;}return i - start;} /** + * Get parent selector extension node + * @return {Node} + */function getParentSelectorExtension(){var type=NodeType.ParentSelectorExtensionType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];while(pos < tokensLength) {if(checkNumber(pos)){content.push(getNumber());}else if(checkPartialIdent(pos)){content.push(getIdent());}else if(checkIdentOrInterpolation(pos)){content = content.concat(getIdentOrInterpolation());}else break;}return newNode(type,content,line,column);} /** + * Check if token is a parent selector with an extension or not + * @param {number} i Token's index number + * @return {number} Length of the parent selector and extension if applicable + */function checkParentSelectorWithExtension(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkParentSelector(i))i += l;else return 0;if(l = checkParentSelectorExtension(i))i += l;return i - start;} /** + * Get parent selector node and extension node if applicable + * @return {Array} + */function getParentSelectorWithExtension(){var content=[getParentSelector()];if(checkParentSelectorExtension(pos))content.push(getParentSelectorExtension());return content;} /** + * Check if token is part of a number or an interpolation with a percent sign + * (e.g. `10%`). + * @param {Number} i Token's index number + * @returns {Number} + */function checkPercentage(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkNumberOrInterpolation(i))i += l;else return 0;if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.PercentSign)return 0;return i - start + 1;} /** + * Get a percentage node that contains either a number or an interpolation + * @returns {Object} The percentage node + */function getPercentage(){var startPos=pos;var token=tokens[startPos];var line=token.ln;var column=token.col;var content=getNumberOrInterpolation();var end=getLastPosition(content,line,column,1); // Skip % + pos++;return newNode(NodeType.PercentageType,content,token.ln,token.col,end);} /** + * Check if token is a number or an interpolation + * @param {Number} i Token's index number + * @returns {Number} + */function checkNumberOrInterpolation(i){var start=i;var l=undefined;while(i < tokensLength) {if(l = checkInterpolation(i) || checkNumber(i))i += l;else break;}return i - start;} /** + * Get a number and/or interpolation node + * @returns {Array} An array containing a single or multiple nodes + */function getNumberOrInterpolation(){var content=[];while(pos < tokensLength) {if(checkInterpolation(pos))content.push(getInterpolation());else if(checkNumber(pos))content.push(getNumber());else break;}return content;} /** + * Check if token is part of a placeholder selector (e.g. `%abc`). + * @param {Number} i Token's index number + * @returns {Number} Length of the selector + */function checkPlaceholder(i){var l;if(i >= tokensLength)return 0;if(tokens[i].placeholder_l)return tokens[i].placeholder_l;if(tokens[i].type !== TokenType.PercentSign)return 0;if(l = checkIdentOrInterpolation(i + 1)){tokens[i].placeholder_l = l + 1;return l + 1;}else return 0;} /** + * Get node with a placeholder selector + * @returns {Array} `['placeholder', ['ident', x]]` where x is a placeholder's + * identifier (without `%`, e.g. `abc`). + */function getPlaceholder(){var startPos=pos;pos++;var x=getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.PlaceholderType,x,token.ln,token.col);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkProgid(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(joinValues2(i,6) === 'progid:DXImageTransform.Microsoft.')i += 6;else return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(tokens[i].type === TokenType.LeftParenthesis){tokens[start].progid_end = tokens[i].right;i = tokens[i].right + 1;}else return 0;return i - start;} /** + * @returns {Array} + */function getProgid(){var startPos=pos;var progid_end=tokens[pos].progid_end;var x=joinValues(pos,progid_end);pos = progid_end + 1;var token=tokens[startPos];return newNode(NodeType.ProgidType,x,token.ln,token.col);} /** + * Check if token is part of a property + * @param {Number} i Token's index number + * @returns {Number} Length of the property + */function checkProperty(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkVariable(i) || checkIdentOrInterpolation(i))i += l;else return 0;return i - start;} /** + * Get node with a property + * @returns {Array} `['property', x]` + */function getProperty(){var startPos=pos;var x=[];if(checkVariable(pos)){x.push(getVariable());}else {x = x.concat(getIdentOrInterpolation());}var token=tokens[startPos];return newNode(NodeType.PropertyType,x,token.ln,token.col);} /** + * Check if token is a colon + * @param {Number} i Token's index number + * @returns {Number} `1` if token is a colon, otherwise `0` + */function checkPropertyDelim(i){return i < tokensLength && tokens[i].type === TokenType.Colon?1:0;} /** + * Get node with a colon + * @returns {Array} `['propertyDelim']` + */function getPropertyDelim(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.PropertyDelimType,':',token.ln,token.col);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkPseudo(i){return checkPseudoe(i) || checkPseudoc(i);} /** + * @returns {Array} + */function getPseudo(){if(checkPseudoe(pos))return getPseudoe();if(checkPseudoc(pos))return getPseudoc();} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkPseudoe(i){var l;if(i >= tokensLength || tokens[i++].type !== TokenType.Colon || i >= tokensLength || tokens[i++].type !== TokenType.Colon)return 0;return (l = checkIdentOrInterpolation(i))?l + 2:0;} /** + * @returns {Array} + */function getPseudoe(){var startPos=pos;pos += 2;var x=getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.PseudoeType,x,token.ln,token.col);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkPseudoc(i){var l;if(i >= tokensLength || tokens[i].type !== TokenType.Colon)return 0;if(l = checkPseudoClass3(i))tokens[i].pseudoClassType = 3;else if(l = checkPseudoClass4(i))tokens[i].pseudoClassType = 4;else if(l = checkPseudoClass5(i))tokens[i].pseudoClassType = 5;else if(l = checkPseudoClass1(i))tokens[i].pseudoClassType = 1;else if(l = checkPseudoClass2(i))tokens[i].pseudoClassType = 2;else if(l = checkPseudoClass6(i))tokens[i].pseudoClassType = 6;else return 0;return l;} /** + * @returns {Array} + */function getPseudoc(){var childType=tokens[pos].pseudoClassType;if(childType === 1)return getPseudoClass1();if(childType === 2)return getPseudoClass2();if(childType === 3)return getPseudoClass3();if(childType === 4)return getPseudoClass4();if(childType === 5)return getPseudoClass5();if(childType === 6)return getPseudoClass6();} /** + * (-) `:not(panda)` + */function checkPseudoClass1(i){var start=i; // Skip `:`. + i++;if(i >= tokensLength)return 0;var l=undefined;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSelectorsGroup(i))i += l;else return 0;if(i !== right)return 0;return right - start + 1;} /** + * (-) `:not(panda)` + */function getPseudoClass1(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[]; // Skip `:`. + pos++;content = content.concat(getIdentOrInterpolation());{var _type=NodeType.ArgumentsType;var _token=tokens[pos];var _line=_token.ln;var _column=_token.col; // Skip `(`. + pos++;var selectors=getSelectorsGroup();var end=getLastPosition(selectors,_line,_column,1);var args=newNode(_type,selectors,_line,_column,end);content.push(args); // Skip `)`. + pos++;}return newNode(type,content,line,column);} /** + * (1) `:nth-child(odd)` + * (2) `:nth-child(even)` + * (3) `:lang(de-DE)` + */function checkPseudoClass2(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSC(i))i += l;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(i !== right)return 0;return i - start + 1;}function getPseudoClass2(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[]; // Skip `:`. + pos++;content = content.concat(getIdentOrInterpolation());var l=tokens[pos].ln;var c=tokens[pos].col;var value=[]; // Skip `(`. + pos++;value = value.concat(getSC()).concat(getIdentOrInterpolation()).concat(getSC());var end=getLastPosition(value,l,c,1);var args=newNode(NodeType.ArgumentsType,value,l,c,end);content.push(args); // Skip `)`. + pos++;return newNode(type,content,line,column);} /** + * (-) `:nth-child(-3n + 2)` + */function checkPseudoClass3(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSC(i))i += l;if(l = checkUnary(i))i += l;if(l = checkNumberOrInterpolation(i))i += l;if(i >= tokensLength)return 0;if(tokens[i].value === 'n')i++;else return 0;if(l = checkSC(i))i += l;if(i >= tokensLength)return 0;if(tokens[i].type === TokenType.PlusSign || tokens[i].type === TokenType.HyphenMinus)i++;else return 0;if(l = checkSC(i))i += l;if(l = checkNumberOrInterpolation(i))i += l;else return 0;if(l = checkSC(i))i += l;if(i !== right)return 0;return i - start + 1;}function getPseudoClass3(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `:`. + pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[]; // Skip `(`. + pos++;if(checkUnary(pos))value.push(getUnary());if(checkNumberOrInterpolation(pos))value = value.concat(getNumberOrInterpolation());{var _l=tokens[pos].ln;var _c=tokens[pos].col;var _content=tokens[pos].value;var ident=newNode(NodeType.IdentType,_content,_l,_c);value.push(ident);pos++;}value = value.concat(getSC());if(checkUnary(pos))value.push(getUnary());value = value.concat(getSC());if(checkNumberOrInterpolation(pos))value = value.concat(getNumberOrInterpolation());value = value.concat(getSC());var end=getLastPosition(value,l,c,1);var args=newNode(NodeType.ArgumentsType,value,l,c,end);content.push(args); // Skip `)`. + pos++;return newNode(type,content,line,column);} /** + * (-) `:nth-child(-3n)` + */function checkPseudoClass4(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSC(i))i += l; // Check for leading unary `-` + if(l = checkUnary(i))i += l; // Check for interpolation `#{i}` + if(l = checkInterpolation(i))i += l;if(tokens[i].type === TokenType.DecimalNumber)i++;if(tokens[i].value === 'n')i++;else return 0;if(l = checkSC(i))i += l;if(i !== right)return 0;return i - start + 1;}function getPseudoClass4(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `:`. + pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[]; // Skip `(`. + pos++;value = value.concat(getSC());if(checkUnary(pos))value.push(getUnary());if(checkInterpolation(pos))value.push(getInterpolation());if(checkNumber(pos))value.push(getNumber());if(checkIdent(pos))value.push(getIdent());value = value.concat(getSC());var end=getLastPosition(value,l,c,1);var args=newNode(NodeType.ArgumentsType,value,l,c,end);content.push(args); // Skip `)`. + pos++;return newNode(type,content,line,column);} /** + * (-) `:nth-child(+8)` + */function checkPseudoClass5(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.LeftParenthesis)return 0;var right=tokens[i].right; // Skip `(`. + i++;if(l = checkSC(i))i += l;if(l = checkUnary(i))i += l;if(tokens[i].type === TokenType.DecimalNumber)i++;else return 0;if(l = checkSC(i))i += l;if(i !== right)return 0;return i - start + 1;}function getPseudoClass5(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `:`. + pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[]; // Skip `(`. + pos++;if(checkUnary(pos))value.push(getUnary());if(checkNumber(pos))value.push(getNumber());value = value.concat(getSC());var end=getLastPosition(value,l,c,1);var args=newNode(NodeType.ArgumentsType,value,l,c,end);content.push(args); // Skip `)`. + pos++;return newNode(type,content,line,column);} /** + * (-) `:checked` + */function checkPseudoClass6(i){var start=i;var l=0; // Skip `:`. + i++;if(i >= tokensLength)return 0;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;}function getPseudoClass6(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col; // Skip `:`. + pos++;var content=getIdentOrInterpolation();return newNode(type,content,line,column);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkRuleset(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkSelectorsGroup(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkBlock(i))i += l;else return 0;return i - start;}function getRuleset(){var type=NodeType.RulesetType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];content = content.concat(getSelectorsGroup());content = content.concat(getSC());content.push(getBlock());return newNode(type,content,line,column);} /** + * Check if token is marked as a space (if it's a space or a tab + * or a line break). + * @param {Number} i + * @returns {Number} Number of spaces in a row starting with the given token. + */function checkS(i){return i < tokensLength && tokens[i].ws?tokens[i].ws_last - i + 1:0;} /** + * Get node with spaces + * @returns {Array} `['s', x]` where `x` is a string containing spaces + */function getS(){var startPos=pos;var x=joinValues(pos,tokens[pos].ws_last);pos = tokens[pos].ws_last + 1;var token=tokens[startPos];return newNode(NodeType.SType,x,token.ln,token.col);} /** + * Check if token is a space or a comment. + * @param {Number} i Token's index number + * @returns {Number} Number of similar (space or comment) tokens + * in a row starting with the given token. + */function checkSC(i){if(i >= tokensLength)return 0;var l=undefined;var lsc=0;while(i < tokensLength) {if(!(l = checkS(i)) && !(l = checkCommentML(i)) && !(l = checkCommentSL(i)))break;i += l;lsc += l;}return lsc || 0;} /** + * Get node with spaces and comments + * @returns {Array} Array containing nodes with spaces (if there are any) + * and nodes with comments (if there are any): + * `[['s', x]*, ['comment', y]*]` where `x` is a string of spaces + * and `y` is a comment's text (without `/*` and `* /`). + */function getSC(){var sc=[];if(pos >= tokensLength)return sc;while(pos < tokensLength) {if(checkS(pos))sc.push(getS());else if(checkCommentML(pos))sc.push(getCommentML());else if(checkCommentSL(pos))sc.push(getCommentSL());else break;}return sc;} /** + * Check if token is part of a hexadecimal number (e.g. `#fff`) inside + * a simple selector + * @param {Number} i Token's index number + * @returns {Number} + */function checkShash(i){var l;if(i >= tokensLength || tokens[i].type !== TokenType.NumberSign)return 0;return (l = checkIdentOrInterpolation(i + 1))?l + 1:0;} /** + * Get node with a hexadecimal number (e.g. `#fff`) inside a simple + * selector + * @returns {Array} `['shash', x]` where `x` is a hexadecimal number + * converted to string (without `#`, e.g. `fff`) + */function getShash(){var startPos=pos;var token=tokens[startPos];pos++;var x=getIdentOrInterpolation();return newNode(NodeType.ShashType,x,token.ln,token.col);} /** + * Check if token is part of a string (text wrapped in quotes) + * @param {Number} i Token's index number + * @returns {Number} `1` if token is part of a string, `0` if not + */function checkString(i){if(i >= tokensLength)return 0;if(tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ){return 1;}return 0;} /** + * Get string's node + * @returns {Array} `['string', x]` where `x` is a string (including + * quotes). + */function getString(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.StringType,x,token.ln,token.col);} /** + * Validate stylesheet: it should consist of any number (0 or more) of + * rulesets (sets of rules with selectors), @-rules, whitespaces or + * comments. + * @param {Number} i Token's index number + * @returns {Number} + */function checkStylesheet(i){var start=i;var l=undefined;while(i < tokensLength) {if(l = checkSC(i) || checkDeclaration(i) || checkDeclDelim(i) || checkInclude(i) || checkExtend(i) || checkMixin(i) || checkLoop(i) || checkConditionalStatement(i) || checkAtrule(i) || checkRuleset(i))i += l;else throwError(i);}return i - start;} /** + * @returns {Array} `['stylesheet', x]` where `x` is all stylesheet's + * nodes. + */function getStylesheet(){var startPos=pos;var x=[];while(pos < tokensLength) {if(checkSC(pos))x = x.concat(getSC());else if(checkRuleset(pos))x.push(getRuleset());else if(checkInclude(pos))x.push(getInclude());else if(checkExtend(pos))x.push(getExtend());else if(checkMixin(pos))x.push(getMixin());else if(checkLoop(pos))x.push(getLoop());else if(checkConditionalStatement(pos))x.push(getConditionalStatement());else if(checkAtrule(pos))x.push(getAtrule());else if(checkDeclaration(pos))x.push(getDeclaration());else if(checkDeclDelim(pos))x.push(getDeclDelim());else throwError();}var token=tokens[startPos];return newNode(NodeType.StylesheetType,x,token.ln,token.col);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkTset(i){return checkVhash(i) || checkOperator(i) || checkAny(i) || checkSC(i) || checkInterpolation(i);} /** + * @returns {Array} + */function getTset(){if(checkVhash(pos))return getVhash();else if(checkOperator(pos))return getOperator();else if(checkAny(pos))return getAny();else if(checkSC(pos))return getSC();else if(checkInterpolation(pos))return getInterpolation();} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkTsets(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;while(l = checkTset(i)) {i += l;}return i - start;} /** + * @returns {Array} + */function getTsets(){var x=[];var t=undefined;while(t = getTset()) {if(typeof t.content === 'string')x.push(t);else x = x.concat(t);}return x;} /** + * Check if token is an unary (arithmetical) sign (`+` or `-`) + * @param {Number} i Token's index number + * @returns {Number} `1` if token is an unary sign, `0` if not + */function checkUnary(i){if(i >= tokensLength){return 0;}if(tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign){return 1;}return 0;} /** + * Get node with an unary (arithmetical) sign (`+` or `-`) + * @returns {Array} `['unary', x]` where `x` is an unary sign + * converted to string. + */function getUnary(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.OperatorType,x,token.ln,token.col);} /** + * Check if token is a unicode range (single or multiple nodes) + * @param {number} i Token's index + * @return {number} Unicode range node's length + */function checkUnicodeRange(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkUrange(i))i += l;else return 0;while(i < tokensLength) {var spaceBefore=checkSC(i);var comma=checkDelim(i + spaceBefore);if(!comma)break;var spaceAfter=checkSC(i + spaceBefore + comma);if(l = checkUrange(i + spaceBefore + comma + spaceAfter)){i += spaceBefore + comma + spaceAfter + l;}else break;}return i - start;} /** + * Get a unicode range node + * @return {Node} + */function getUnicodeRange(){var type=NodeType.UnicodeRangeType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];while(pos < tokensLength) {if(checkSC(pos))content = content.concat(getSC());else if(checkDelim(pos))content.push(getDelim());else if(checkUrange(pos))content.push(getUrange());else break;}return newNode(type,content,line,column);} /** + * Check if token is a u-range (part of a unicode-range) + * (1) `U+416` + * (2) `U+400-4ff` + * (3) `U+4??` + * @param {number} i Token's index + * @return {number} Urange node's length + */function checkUrange(i){var start=i;var l=undefined;if(i >= tokensLength)return 0; // Check for unicode prefix (u+ or U+) + if(tokens[i].value === 'U' || tokens[i].value === 'u')i += 1;else return 0;if(i >= tokensLength)return 0;if(tokens[i].value === '+')i += 1;else return 0;while(i < tokensLength) {if(l = checkIdent(i))i += l;else if(l = checkNumber(i))i += l;else if(l = checkUnary(i))i += l;else if(l = _checkUnicodeWildcard(i))i += l;else break;}tokens[start].urangeEnd = i - 1;return i - start;} /** + * Get a u-range node (part of a unicode-range) + * @return {Node} + */function getUrange(){var startPos=pos;var type=NodeType.UrangeType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];content = joinValues(startPos,tokens[startPos].urangeEnd);pos = tokens[startPos].urangeEnd + 1;return newNode(type,content,line,column);} /** + * Check for unicode wildcard characters `?` + * @param {number} i Token's index + * @return {number} Wildcard length + */function _checkUnicodeWildcard(i){var start=i;if(i >= tokensLength)return 0;while(i < tokensLength) {if(tokens[i].type === TokenType.QuestionMark)i += 1;else break;}return i - start;} /** + * Check if token is part of URI (e.g. `url('/css/styles.css')`) + * @param {Number} i Token's index number + * @returns {Number} Length of URI + */function checkUri(i){var start=i;if(i >= tokensLength || tokens[i++].value !== 'url' || i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)return 0;return tokens[i].right - start + 1;} /** + * Get node with URI + * @returns {Array} `['uri', x]` where `x` is URI's nodes (without `url` + * and braces, e.g. `['string', ''/css/styles.css'']`). + */function getUri(){var startPos=pos;var uriExcluding={};var uri=undefined;var token=undefined;var l=undefined;var raw=undefined;pos += 2;uriExcluding[TokenType.Space] = 1;uriExcluding[TokenType.Tab] = 1;uriExcluding[TokenType.Newline] = 1;uriExcluding[TokenType.LeftParenthesis] = 1;uriExcluding[TokenType.RightParenthesis] = 1;if(checkUriContent(pos)){uri = [].concat(getSC()).concat(getUriContent()).concat(getSC());}else {uri = [].concat(getSC());l = checkExcluding(uriExcluding,pos);token = tokens[pos];raw = newNode(NodeType.RawType,joinValues(pos,pos + l),token.ln,token.col);uri.push(raw);pos += l + 1;uri = uri.concat(getSC());}token = tokens[startPos];var line=token.ln;var column=token.col;var end=getLastPosition(uri,line,column,1);pos++;return newNode(NodeType.UriType,uri,token.ln,token.col,end);} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkUriContent(i){return checkUri1(i) || checkFunction(i);} /** + * @returns {Array} + */function getUriContent(){if(checkUri1(pos))return getString();else if(checkFunction(pos))return getFunction();} /** + * @param {Number} i Token's index number + * @returns {Number} + */function checkUri1(i){var start=i;var l=undefined;if(i >= tokensLength)return 0;if(l = checkSC(i))i += l;if(tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ)return 0;i++;if(l = checkSC(i))i += l;return i - start;} /** + * Check if token is part of a value + * @param {Number} i Token's index number + * @returns {Number} Length of the value + */function checkValue(i){var start=i;var l=undefined;var s=undefined;var _i=undefined;while(i < tokensLength) {if(checkDeclDelim(i))break;s = checkSC(i);_i = i + s;if(l = _checkValue(_i))i += l + s;if(!l || checkBlock(i - l))break;}return i - start;} /** + * @param {Number} i Token's index number + * @returns {Number} + */function _checkValue(i){return checkInterpolation(i) || checkVariable(i) || checkVhash(i) || checkBlock(i) || checkAtkeyword(i) || checkOperator(i) || checkImportant(i) || checkGlobal(i) || checkDefault(i) || checkProgid(i) || checkAny(i) || checkParentSelector(i);} /** + * @returns {Array} + */function getValue(){var startPos=pos;var x=[];var _pos=undefined;var s=undefined;while(pos < tokensLength) {s = checkSC(pos);_pos = pos + s;if(checkDeclDelim(_pos))break;if(!_checkValue(_pos))break;if(s)x = x.concat(getSC());x.push(_getValue());if(checkBlock(_pos))break;}var token=tokens[startPos];return newNode(NodeType.ValueType,x,token.ln,token.col);} /** + * @returns {Array} + */function _getValue(){if(checkInterpolation(pos))return getInterpolation();else if(checkVariable(pos))return getVariable();else if(checkVhash(pos))return getVhash();else if(checkBlock(pos))return getBlock();else if(checkAtkeyword(pos))return getAtkeyword();else if(checkOperator(pos))return getOperator();else if(checkImportant(pos))return getImportant();else if(checkGlobal(pos))return getGlobal();else if(checkDefault(pos))return getDefault();else if(checkProgid(pos))return getProgid();else if(checkAny(pos))return getAny();else if(checkParentSelector(pos))return getParentSelector();} /** + * Check if token is part of a variable + * @param {Number} i Token's index number + * @returns {Number} Length of the variable + */function checkVariable(i){var l;if(i >= tokensLength || tokens[i].type !== TokenType.DollarSign)return 0;return (l = checkIdent(i + 1))?l + 1:0;} /** + * Get node with a variable + * @returns {Array} `['variable', ['ident', x]]` where `x` is + * a variable name. + */function getVariable(){var startPos=pos;var x=[];pos++;x.push(getIdent());var token=tokens[startPos];return newNode(NodeType.VariableType,x,token.ln,token.col);} /** + * Check if token is part of a variables list (e.g. `$values...`). + * @param {Number} i Token's index number + * @returns {Number} + */function checkVariablesList(i){var d=0; // Number of dots + var l=undefined;if(i >= tokensLength)return 0;if(l = checkVariable(i))i += l;else return 0;while(i < tokensLength && tokens[i].type === TokenType.FullStop) {d++;i++;}return d === 3?l + d:0;} /** + * Get node with a variables list + * @returns {Array} `['variableslist', ['variable', ['ident', x]]]` where + * `x` is a variable name. + */function getVariablesList(){var startPos=pos;var x=getVariable();var token=tokens[startPos];var line=token.ln;var column=token.col;var end=getLastPosition([x],line,column,3);pos += 3;return newNode(NodeType.VariablesListType,[x],token.ln,token.col,end);} /** + * Check if token is part of a hexadecimal number (e.g. `#fff`) inside + * some value + * @param {Number} i Token's index number + * @returns {Number} + */function checkVhash(i){var l;if(i >= tokensLength || tokens[i].type !== TokenType.NumberSign)return 0;return (l = checkNmName2(i + 1))?l + 1:0;} /** + * Get node with a hexadecimal number (e.g. `#fff`) inside some value + * @returns {Array} `['vhash', x]` where `x` is a hexadecimal number + * converted to string (without `#`, e.g. `'fff'`). + */function getVhash(){var startPos=pos;var x=undefined;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;x = getNmName2();var end=getLastPosition(x,line,column + 1);return newNode(NodeType.VhashType,x,token.ln,token.col,end);}module.exports = function(_tokens,context){tokens = _tokens;tokensLength = tokens.length;pos = 0;return contexts[context]();};function checkSelectorsGroup(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkSelector(i))i += l;else return 0;while(i < tokensLength) {var sb=checkSC(i);var c=checkDelim(i + sb);if(!c)break;var sa=checkSC(i + sb + c);if(l = checkSelector(i + sb + c + sa))i += sb + c + sa + l;else break;}tokens[start].selectorsGroupEnd = i;return i - start;}function getSelectorsGroup(){var selectorsGroup=[];var selectorsGroupEnd=tokens[pos].selectorsGroupEnd;selectorsGroup.push(getSelector());while(pos < selectorsGroupEnd) {selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup.push(getDelim());selectorsGroup = selectorsGroup.concat(getSC());selectorsGroup.push(getSelector());}return selectorsGroup;}function checkSelector(i){var l;if(l = checkSelector1(i))tokens[i].selectorType = 1;else if(l = checkSelector2(i))tokens[i].selectorType = 2;return l;}function getSelector(){var selectorType=tokens[pos].selectorType;if(selectorType === 1)return getSelector1();else return getSelector2();} /** + * Checks for selector which starts with a compound selector. + */function checkSelector1(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkCompoundSelector(i))i += l;else return 0;while(i < tokensLength) {var s=checkSC(i);var c=checkCombinator(i + s);if(!s && !c)break;if(c){i += s + c;s = checkSC(i);}if(l = checkCompoundSelector(i + s))i += s + l;else break;}tokens[start].selectorEnd = i;return i - start;}function getSelector1(){var type=NodeType.SelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var selectorEnd=token.selectorEnd;var content=getCompoundSelector();while(pos < selectorEnd) {if(checkSC(pos))content = content.concat(getSC());else if(checkCombinator(pos))content.push(getCombinator());else if(checkCompoundSelector(pos))content = content.concat(getCompoundSelector());}return newNode(type,content,line,column);} /** + * Checks for a selector that starts with a combinator. + */function checkSelector2(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkCombinator(i))i += l;else return 0;while(i < tokensLength) {var sb=checkSC(i);if(l = checkCompoundSelector(i + sb))i += sb + l;else break;var sa=checkSC(i);var c=checkCombinator(i + sa);if(!sa && !c)break;if(c){i += sa + c;}}tokens[start].selectorEnd = i;return i - start;}function getSelector2(){var type=NodeType.SelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var selectorEnd=token.selectorEnd;var content=[getCombinator()];while(pos < selectorEnd) {if(checkSC(pos))content = content.concat(getSC());else if(checkCombinator(pos))content.push(getCombinator());else if(checkCompoundSelector(pos))content = content.concat(getCompoundSelector());}return newNode(type,content,line,column);}function checkCompoundSelector(i){var l=undefined;if(l = checkCompoundSelector1(i)){tokens[i].compoundSelectorType = 1;}else if(l = checkCompoundSelector2(i)){tokens[i].compoundSelectorType = 2;}return l;}function getCompoundSelector(){var type=tokens[pos].compoundSelectorType;if(type === 1)return getCompoundSelector1();if(type === 2)return getCompoundSelector2();} /** + * Check for compound selectors that start with either a type selector, + * placeholder or parent selector with extension + * (1) `foo.bar` + * (2) `foo[attr=val]` + * (3) `foo:first-of-type` + * (4) `foo%bar` + * @param {number} i Token's index + * @return {number} Compound selector's length + */function checkCompoundSelector1(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkTypeSelector(i) || checkPlaceholder(i) || checkParentSelectorWithExtension(i))i += l;else return 0;while(i < tokensLength) {var _l2=checkShash(i) || checkClass(i) || checkAttributeSelector(i) || checkPseudo(i) || checkPlaceholder(i);if(_l2)i += _l2;else break;}tokens[start].compoundSelectorEnd = i;return i - start;} /** + * @return {Array} An array of nodes that make up the compound selector + */function getCompoundSelector1(){var sequence=[];var compoundSelectorEnd=tokens[pos].compoundSelectorEnd;if(checkTypeSelector(pos))sequence.push(getTypeSelector());else if(checkPlaceholder(pos))sequence.push(getPlaceholder());else if(checkParentSelectorWithExtension(pos))sequence = sequence.concat(getParentSelectorWithExtension());while(pos < compoundSelectorEnd) {if(checkShash(pos))sequence.push(getShash());else if(checkClass(pos))sequence.push(getClass());else if(checkAttributeSelector(pos))sequence.push(getAttributeSelector());else if(checkPseudo(pos))sequence.push(getPseudo());else if(checkPlaceholder(pos))sequence.push(getPlaceholder());else break;}return sequence;} /** + * Check for all other compound selectors + * (1) `.foo.bar` + * (2) `.foo[attr=val]` + * (3) `.foo:first-of-type` + * (4) `.foo%bar` + * (5) `.foo#{$bar}` + * @param {number} i Token's index + * @return {number} Compound selector's length + */function checkCompoundSelector2(i){if(i >= tokensLength)return 0;var start=i;while(i < tokensLength) {var l=checkShash(i) || checkClass(i) || checkAttributeSelector(i) || checkPseudo(i) || checkPlaceholder(i) || checkInterpolation(i);if(l)i += l;else break;}tokens[start].compoundSelectorEnd = i;return i - start;} /** + * @return {Array} An array of nodes that make up the compound selector + */function getCompoundSelector2(){var sequence=[];var compoundSelectorEnd=tokens[pos].compoundSelectorEnd;while(pos < compoundSelectorEnd) {if(checkShash(pos))sequence.push(getShash());else if(checkClass(pos))sequence.push(getClass());else if(checkAttributeSelector(pos))sequence.push(getAttributeSelector());else if(checkPseudo(pos))sequence.push(getPseudo());else if(checkPlaceholder(pos))sequence.push(getPlaceholder());else if(checkInterpolation(pos))sequence.push(getInterpolation());else break;}return sequence;}function checkTypeSelector(i){if(i >= tokensLength)return 0;var start=i;var l=undefined;if(l = checkNamePrefix(i))i += l;if(tokens[i].type === TokenType.Asterisk)i++;else if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;}function getTypeSelector(){var type=NodeType.TypeSelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(checkNamePrefix(pos))content.push(getNamePrefix());token = tokens[pos];if(token.type === TokenType.Asterisk){var asteriskNode=newNode(NodeType.IdentType,'*',token.ln,token.col);content.push(asteriskNode);pos++;}else if(checkIdentOrInterpolation(pos))content = content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);}function checkAttributeSelector(i){var l=undefined;if(l = checkAttributeSelector1(i))tokens[i].attributeSelectorType = 1;else if(l = checkAttributeSelector2(i))tokens[i].attributeSelectorType = 2;return l;}function getAttributeSelector(){var type=tokens[pos].attributeSelectorType;if(type === 1)return getAttributeSelector1();else return getAttributeSelector2();} /** + * (1) `[panda=nani]` + * (2) `[panda='nani']` + * (3) `[panda='nani' i]` + * + */function checkAttributeSelector1(i){var start=i;if(tokens[i].type === TokenType.LeftSquareBracket)i++;else return 0;var l=undefined;if(l = checkSC(i))i += l;if(l = checkAttributeName(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkAttributeMatch(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkAttributeValue(i))i += l;else return 0;if(l = checkSC(i))i += l;if(l = checkAttributeFlags(i)){i += l;if(l = checkSC(i))i += l;}if(tokens[i].type === TokenType.RightSquareBracket)i++;else return 0;return i - start;}function getAttributeSelector1(){var type=NodeType.AttributeSelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[]; // Skip `[`. + pos++;content = content.concat(getSC());content.push(getAttributeName());content = content.concat(getSC());content.push(getAttributeMatch());content = content.concat(getSC());content.push(getAttributeValue());content = content.concat(getSC());if(checkAttributeFlags(pos)){content.push(getAttributeFlags());content = content.concat(getSC());} // Skip `]`. + pos++;var end=getLastPosition(content,line,column,1);return newNode(type,content,line,column,end);} /** + * (1) `[panda]` + */function checkAttributeSelector2(i){var start=i;if(tokens[i].type === TokenType.LeftSquareBracket)i++;else return 0;var l=undefined;if(l = checkSC(i))i += l;if(l = checkAttributeName(i))i += l;else return 0;if(l = checkSC(i))i += l;if(tokens[i].type === TokenType.RightSquareBracket)i++;else return 0;return i - start;}function getAttributeSelector2(){var type=NodeType.AttributeSelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[]; // Skip `[`. + pos++;content = content.concat(getSC());content.push(getAttributeName());content = content.concat(getSC()); // Skip `]`. + pos++;var end=getLastPosition(content,line,column,1);return newNode(type,content,line,column,end);}function checkAttributeName(i){var start=i;var l=undefined;if(l = checkNamePrefix(i))i += l;if(l = checkIdentOrInterpolation(i))i += l;else return 0;return i - start;}function getAttributeName(){var type=NodeType.AttributeNameType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(checkNamePrefix(pos))content.push(getNamePrefix());content = content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);}function checkAttributeMatch(i){var l=undefined;if(l = checkAttributeMatch1(i))tokens[i].attributeMatchType = 1;else if(l = checkAttributeMatch2(i))tokens[i].attributeMatchType = 2;return l;}function getAttributeMatch(){var type=tokens[pos].attributeMatchType;if(type === 1)return getAttributeMatch1();else return getAttributeMatch2();}function checkAttributeMatch1(i){var start=i;var type=tokens[i].type;if(type === TokenType.Tilde || type === TokenType.VerticalLine || type === TokenType.CircumflexAccent || type === TokenType.DollarSign || type === TokenType.Asterisk)i++;else return 0;if(tokens[i].type === TokenType.EqualsSign)i++;else return 0;return i - start;}function getAttributeMatch1(){var type=NodeType.AttributeMatchType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=tokens[pos].value + tokens[pos + 1].value;pos += 2;return newNode(type,content,line,column);}function checkAttributeMatch2(i){if(tokens[i].type === TokenType.EqualsSign)return 1;else return 0;}function getAttributeMatch2(){var type=NodeType.AttributeMatchType;var token=tokens[pos];var line=token.ln;var column=token.col;var content='=';pos++;return newNode(type,content,line,column);}function checkAttributeValue(i){return checkString(i) || checkIdentOrInterpolation(i);}function getAttributeValue(){var type=NodeType.AttributeValueType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(checkString(pos))content.push(getString());else content = content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);}function checkAttributeFlags(i){return checkIdentOrInterpolation(i);}function getAttributeFlags(){var type=NodeType.AttributeFlagsType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=getIdentOrInterpolation();return newNode(type,content,line,column);}function checkNamePrefix(i){if(i >= tokensLength)return 0;var l=undefined;if(l = checkNamePrefix1(i))tokens[i].namePrefixType = 1;else if(l = checkNamePrefix2(i))tokens[i].namePrefixType = 2;return l;}function getNamePrefix(){var type=tokens[pos].namePrefixType;if(type === 1)return getNamePrefix1();else return getNamePrefix2();} /** + * (1) `panda|` + * (2) `panda|` + */function checkNamePrefix1(i){var start=i;var l=undefined;if(l = checkNamespacePrefix(i))i += l;else return 0;if(l = checkCommentML(i))i += l;if(l = checkNamespaceSeparator(i))i += l;else return 0;return i - start;}function getNamePrefix1(){var type=NodeType.NamePrefixType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];content.push(getNamespacePrefix());if(checkCommentML(pos))content.push(getCommentML());content.push(getNamespaceSeparator());return newNode(type,content,line,column);} /** + * (1) `|` + */function checkNamePrefix2(i){return checkNamespaceSeparator(i);}function getNamePrefix2(){var type=NodeType.NamePrefixType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[getNamespaceSeparator()];return newNode(type,content,line,column);} /** + * (1) `*` + * (2) `panda` + */function checkNamespacePrefix(i){if(i >= tokensLength)return 0;var l=undefined;if(tokens[i].type === TokenType.Asterisk)return 1;else if(l = checkIdentOrInterpolation(i))return l;else return 0;}function getNamespacePrefix(){var type=NodeType.NamespacePrefixType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];if(token.type === TokenType.Asterisk){var asteriskNode=newNode(NodeType.IdentType,'*',token.ln,token.col);content.push(asteriskNode);pos++;}else if(checkIdentOrInterpolation(pos))content = content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);} /** + * (1) `|` + */function checkNamespaceSeparator(i){if(i >= tokensLength)return 0;if(tokens[i].type !== TokenType.VerticalLine)return 0; // Return false if `|=` - [attr|=value] + if(tokens[i + 1] && tokens[i + 1].type === TokenType.EqualsSign)return 0;return 1;}function getNamespaceSeparator(){var type=NodeType.NamespaceSeparatorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content='|';pos++;return newNode(type,content,line,column);} + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + module.exports = function (css, tabSize) { + var TokenType = __webpack_require__(13); + + var tokens = []; + var urlMode = false; + var c = undefined; // Current character + var cn = undefined; // Next character + var pos = 0; + var tn = 0; + var ln = 1; + var col = 1; + + var Punctuation = { + ' ': TokenType.Space, + '\n': TokenType.Newline, + '\r': TokenType.Newline, + '\t': TokenType.Tab, + '!': TokenType.ExclamationMark, + '"': TokenType.QuotationMark, + '#': TokenType.NumberSign, + '$': TokenType.DollarSign, + '%': TokenType.PercentSign, + '&': TokenType.Ampersand, + '\'': TokenType.Apostrophe, + '(': TokenType.LeftParenthesis, + ')': TokenType.RightParenthesis, + '*': TokenType.Asterisk, + '+': TokenType.PlusSign, + ',': TokenType.Comma, + '-': TokenType.HyphenMinus, + '.': TokenType.FullStop, + '/': TokenType.Solidus, + ':': TokenType.Colon, + ';': TokenType.Semicolon, + '<': TokenType.LessThanSign, + '=': TokenType.EqualsSign, + '==': TokenType.EqualitySign, + '!=': TokenType.InequalitySign, + '>': TokenType.GreaterThanSign, + '?': TokenType.QuestionMark, + '@': TokenType.CommercialAt, + '[': TokenType.LeftSquareBracket, + ']': TokenType.RightSquareBracket, + '^': TokenType.CircumflexAccent, + '_': TokenType.LowLine, + '{': TokenType.LeftCurlyBracket, + '|': TokenType.VerticalLine, + '}': TokenType.RightCurlyBracket, + '~': TokenType.Tilde + }; + + /** + * Add a token to the token list + * @param {string} type + * @param {string} value + */ + function pushToken(type, value, column) { + tokens.push({ + tn: tn++, + ln: ln, + col: column, + type: type, + value: value + }); + } + + /** + * Check if a character is a decimal digit + * @param {string} c Character + * @returns {boolean} + */ + function isDecimalDigit(c) { + return '0123456789'.indexOf(c) >= 0; + } + + /** + * Parse spaces + * @param {string} css Unparsed part of CSS string + */ + function parseSpaces(css) { + var start = pos; + + // Read the string until we meet a non-space character: + for (; pos < css.length; pos++) { + if (css.charAt(pos) !== ' ') break; + } + + // Add a substring containing only spaces to tokens: + pushToken(TokenType.Space, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Parse a string within quotes + * @param {string} css Unparsed part of CSS string + * @param {string} q Quote (either `'` or `"`) + */ + function parseString(css, q) { + var start = pos; + + // Read the string until we meet a matching quote: + for (pos++; pos < css.length; pos++) { + // Skip escaped quotes: + if (css.charAt(pos) === '\\') pos++;else if (css.charAt(pos) === q) break; + } + + // Add the string (including quotes) to tokens: + var type = q === '"' ? TokenType.StringDQ : TokenType.StringSQ; + pushToken(type, css.substring(start, pos + 1), col); + col += pos - start; + } + + /** + * Parse numbers + * @param {string} css Unparsed part of CSS string + */ + function parseDecimalNumber(css) { + var start = pos; + + // Read the string until we meet a character that's not a digit: + for (; pos < css.length; pos++) { + if (!isDecimalDigit(css.charAt(pos))) break; + } + + // Add the number to tokens: + pushToken(TokenType.DecimalNumber, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Parse identifier + * @param {string} css Unparsed part of CSS string + */ + function parseIdentifier(css) { + var start = pos; + + // Skip all opening slashes: + while (css.charAt(pos) === '/') pos++; + + // Read the string until we meet a punctuation mark: + for (; pos < css.length; pos++) { + // Skip all '\': + if (css.charAt(pos) === '\\') pos++;else if (css.charAt(pos) in Punctuation) break; + } + + var ident = css.substring(start, pos--); + + // Enter url mode if parsed substring is `url`: + if (!urlMode && ident === 'url' && css.charAt(pos + 1) === '(') { + urlMode = true; + } + + // Add identifier to tokens: + pushToken(TokenType.Identifier, ident, col); + col += pos - start; + } + + /** + * Parse equality sign + */ + function parseEquality() { + pushToken(TokenType.EqualitySign, '==', col); + pos++; + col++; + } + + /** + * Parse inequality sign + */ + function parseInequality() { + pushToken(TokenType.InequalitySign, '!=', col); + pos++; + col++; + } + + /** + * Parse a multiline comment + * @param {string} css Unparsed part of CSS string + */ + function parseMLComment(css) { + var start = pos; + + // Read the string until we meet `*/`. + // Since we already know first 2 characters (`/*`), start reading + // from `pos + 2`: + for (pos += 2; pos < css.length; pos++) { + if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') { + pos++; + break; + } + } + + // Add full comment (including `/*` and `*/`) to the list of tokens: + var comment = css.substring(start, pos + 1); + pushToken(TokenType.CommentML, comment, col); + + var newlines = comment.split('\n'); + if (newlines.length > 1) { + ln += newlines.length - 1; + col = newlines[newlines.length - 1].length; + } else { + col += pos - start; + } + } + + /** + * Parse a single line comment + * @param {string} css Unparsed part of CSS string + */ + function parseSLComment(css) { + var start = pos; + + // Read the string until we meet line break. + // Since we already know first 2 characters (`//`), start reading + // from `pos + 2`: + for (pos += 2; pos < css.length; pos++) { + if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { + break; + } + } + + // Add comment (including `//` and line break) to the list of tokens: + pushToken(TokenType.CommentSL, css.substring(start, pos--), col); + col += pos - start; + } + + /** + * Convert a CSS string to a list of tokens + * @param {string} css CSS string + * @returns {Array} List of tokens + * @private + */ + function getTokens(css) { + // Parse string, character by character: + for (pos = 0; pos < css.length; col++, pos++) { + c = css.charAt(pos); + cn = css.charAt(pos + 1); + + // If we meet `/*`, it's a start of a multiline comment. + // Parse following characters as a multiline comment: + if (c === '/' && cn === '*') { + parseMLComment(css); + } + + // If we meet `//` and it is not a part of url: + else if (!urlMode && c === '/' && cn === '/') { + // If we're currently inside a block, treat `//` as a start + // of identifier. Else treat `//` as a start of a single-line + // comment: + parseSLComment(css); + } + + // If current character is a double or single quote, it's a start + // of a string: + else if (c === '"' || c === "'") { + parseString(css, c); + } + + // If current character is a space: + else if (c === ' ') { + parseSpaces(css); + } + + // If current character is `=`, it must be combined with next `=` + else if (c === '=' && cn === '=') { + parseEquality(css); + } + + // If we meet `!=`, this must be inequality + else if (c === '!' && cn === '=') { + parseInequality(css); + } + + // If current character is a punctuation mark: + else if (c in Punctuation) { + // Check for CRLF here or just LF + if (c === '\r' && cn === '\n' || c === '\n') { + // If \r we know the next character is \n due to statement above + // so we push a CRLF token type to the token list and importantly + // skip the next character so as not to double count newlines or + // columns etc + if (c === '\r') { + pushToken(TokenType.Newline, '\r\n', col); + pos++; // If CRLF skip the next character and push crlf token + } else if (c === '\n') { + // If just a LF newline and not part of CRLF newline we can just + // push punctuation as usual + pushToken(Punctuation[c], c, col); + } + + ln++; // Go to next line + col = 0; // Reset the column count + } else if (c !== '\r' && c !== '\n') { + // Handle all other punctuation and add to list of tokens + pushToken(Punctuation[c], c, col); + } // Go to next line + if (c === ')') urlMode = false; // Exit url mode + else if (c === '\t' && tabSize > 1) col += tabSize - 1; + } + + // If current character is a decimal digit: + else if (isDecimalDigit(c)) { + parseDecimalNumber(css); + } + + // If current character is anything else: + else { + parseIdentifier(css); + } + } + + return tokens; + } + + return getTokens(css); + }; + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var Node = __webpack_require__(1); + var NodeTypes = __webpack_require__(15); + + module.exports = function () { + return new Node({ + type: NodeTypes.StylesheetType, + content: [], + start: [0, 0], + end: [0, 0] + }); + }; + +/***/ } +/******/ ]) +}); +; \ No newline at end of file diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/mark.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/mark.js deleted file mode 100644 index 426b97e..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/mark.js +++ /dev/null @@ -1,117 +0,0 @@ -var TokenType = require('../token-types'); - -module.exports = (function() { - /** - * Mark whitespaces and comments - */ - function markSC(tokens) { - var tokensLength = tokens.length; - var ws = -1, // flag for whitespaces - sc = -1, // flag for whitespaces and comments - t; // current token - - // For every token in the token list, mark spaces and line breaks - // as spaces (set both `ws` and `sc` flags). Mark multiline comments - // with `sc` flag. - // If there are several spaces or tabs or line breaks or multiline - // comments in a row, group them: take the last one's index number - // and save it to the first token in the group as a reference - // (e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` - // for a group of whitespaces and comments): - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - - if (ws === -1) ws = i; - if (sc === -1) sc = i; - - break; - case TokenType.CommentML: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - t.sc = true; - - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - } - - /** - * Pair brackets - */ - function markBrackets(tokens) { - var tokensLength = tokens.length; - var ps = [], // parenthesis - sbs = [], // square brackets - cbs = [], // curly brackets - t; // current token - - // For every token in the token list, if we meet an opening (left) - // bracket, push its index number to a corresponding array. - // If we then meet a closing (right) bracket, look at the corresponding - // array. If there are any elements (records about previously met - // left brackets), take a token of the last left bracket (take - // the last index number from the array and find a token with - // this index number) and save right bracket's index as a reference: - for (var i = 0; i < tokens.length; i++) { - t = tokens[i]; - switch(t.type) { - case TokenType.LeftParenthesis: - ps.push(i); - break; - case TokenType.RightParenthesis: - if (ps.length) { - t.left = ps.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftSquareBracket: - sbs.push(i); - break; - case TokenType.RightSquareBracket: - if (sbs.length) { - t.left = sbs.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftCurlyBracket: - cbs.push(i); - break; - case TokenType.RightCurlyBracket: - if (cbs.length) { - t.left = cbs.pop(); - tokens[t.left].right = i; - } - break; - } - } - } - - return function(tokens) { - // Mark paired brackets: - markBrackets(tokens); - // Mark whitespaces and comments: - markSC(tokens); - } -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/node-types.js deleted file mode 100644 index c0e46eb..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/node-types.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - FUNCTION_BODY: 'functionBody', - FUNCTION_DECLARATION: 'functionDeclaration', - PARAMS: 'params', - PROGRAM: 'program', - SPACE: 'space', - TEXT: 'text' -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/rules.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/rules.js deleted file mode 100644 index 36464d1..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/rules.js +++ /dev/null @@ -1,281 +0,0 @@ -var TokenType = require('../token-types'); -var NodeType = require('./node-types'); - -module.exports = (function() { - var tokens, tokensLength, pos; - - var rules = { - 'functionBody': function() { return checkFunctionBody(pos) && getFunctionBody(); }, - 'functionDeclaration': function() { return checkFunctionDeclaration(pos) && getFunctionDeclaration(); }, - 'papams': function() { return checkParams(pos) && getParams(); }, - 'program': function() { return checkProgram(pos) && getProgram(); }, - 'space': function() { return checkSpace(pos) && getSpace(); }, - 'text': function() { return checkText(pos) && getText(); } - }; - - /** - * Stop parsing and display error - * @param {Number=} i Token's index number - */ - function throwError(i) { - var ln = i ? tokens[i].ln : tokens[pos].ln; - - throw {line: ln, syntax: 'js'}; - } - - /** - * @param {Object} exclude - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkExcluding(exclude, i) { - var start = i; - - while(i < tokensLength) { - if (exclude[tokens[i++].type]) break; - } - - return i - start - 2; - } - - /** - * @param {Number} start - * @param {Number} finish - * @returns {String} - */ - function joinValues(start, finish) { - var s = ''; - - for (var i = start; i < finish + 1; i++) { - s += tokens[i].value; - } - - return s; - } - - /** - * @param {Number} start - * @param {Number} num - * @returns {String} - */ - function joinValues2(start, num) { - if (start + num - 1 >= tokensLength) return; - - var s = ''; - - for (var i = 0; i < num; i++) { - s += tokens[start + i].value; - } - - return s; - } - - -///////////////////////////////////// -///////////////////////////////////// -///////////////////////////////////// - - function checkFunctionBody(i) { - var start = i; - - if (i >= tokensLength) return 0; - - if (tokens[i].type === TokenType.LeftCurlyBracket) i = tokens[i].right + 1; - else return 0; - - return i - start; - } - - function getFunctionBody() { - var startPos = pos, - x = [NodeType.FUNCTION_BODY]; - - // Skip `{`: - pos++; - - x.push(joinValues(pos, tokens[pos].right - 1)); - - // Skip `}`: - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunctionDeclaration(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[i].value === 'function') i++; - else return 0; - - if (l = checkSpace(i)) i += l; - else return 0; - - if (tokens[i].type === TokenType.Identifier) i++; - else return 0; - - if (l = checkSpace(i)) i += l; - - if (l = checkParams(i)) i += l; - else return 0; - - if (l = checkSpace(i)) i += l; - - if (l = checkFunctionBody(i)) i += l; - else return 0; - - return i - start; - } - - /** - * @returns {Array} - */ - function getFunctionDeclaration() { - var startPos = pos, - x = [NodeType.FUNCTION_DECLARATION]; - - // Skip `function` word: - pos++; - - x.push(getSpace()); - - // TODO: `getIdent`: - x.push(['ident', tokens[pos].value]); - pos++; - - if (checkSpace(pos)) x.push(getSpace()); - - x.push(getParams()); - - if (checkSpace(pos)) x.push(getSpace()); - - x.push(getFunctionBody()); - - return x; - } - - function checkParams(i) { - var start = i; - - if (tokens[i].type === TokenType.LeftParenthesis) i = tokens[i].right + 1; - else return 0; - - return i - start; - } - - function getParams() { - var startPos = pos, - x = [NodeType.PARAMS]; - - // Skip `(`: - pos++; - - x.push(joinValues(pos, tokens[pos].right - 1)); - - // Skip `)`: - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkProgram(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkFunctionDeclaration(i) || checkText(i)) i += l; - else break; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getProgram() { - var startPos = pos, - x = [NodeType.PROGRAM]; - - while (pos < tokensLength) { - if (checkFunctionDeclaration(pos)) x.push(getFunctionDeclaration()); - else if (checkText(pos)) x.push(getText()); - else throwError(); - } - - return x; - } - - /** - * Check if token is marked as a space (if it's a space or a tab - * or a line break). - * @param i - * @returns {Number} Number of spaces in a row starting with the given token. - */ - function checkSpace(i) { - return i < tokensLength && tokens[i].ws ? - tokens[i].ws_last - i + 1 : - 0; - } - - /** - * Get node with spaces - * @returns {Array} `['s', x]` where `x` is a string containing spaces - */ - function getSpace() { - var startPos = pos, - x = [NodeType.SPACE, joinValues(pos, tokens[pos].ws_last)]; - - pos = tokens[pos].ws_last + 1; - - return x; - } - - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkText(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - while (i < tokensLength && !checkFunctionDeclaration(i)) i++; - - return i - start; - } - - /** - * @returns {Array} - */ - function getText() { - var startPos = pos, - x = [NodeType.TEXT]; - - while (pos < tokensLength && !checkFunctionDeclaration(pos)) pos++; - - x.push(joinValues(startPos, pos - 1)); - - return x; - } - - return function(_tokens, rule) { - tokens = _tokens; - tokensLength = tokens.length; - pos = 0; - - return rules[rule](); - }; -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/stringify.js deleted file mode 100644 index 0ed02c2..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/stringify.js +++ /dev/null @@ -1,48 +0,0 @@ -module.exports = function stringify(tree) { - // TODO: Better error message - if (!tree) throw new Error('We need tree to translate'); - - var _m_simple = { - 'ident': 1, - 'space': 1, - 'text': 1 - }, - _m_composite = { - 'program': 1, - }, - _m_primitive = { - }; - - function _t(tree) { - var t = tree[0]; - if (t in _m_primitive) return _m_primitive[t]; - else if (t in _m_simple) return _simple(tree); - else if (t in _m_composite) return _composite(tree); - return _unique[t](tree); - } - - function _composite(t, i) { - var s = ''; - i = i === undefined ? 1 : i; - for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); - return s; - } - - function _simple(t) { - return t[1]; - } - - var _unique = { - 'functionBody': function(t) { - return '{' + t[1] + '}'; - }, - 'functionDeclaration': function(t) { - return 'function' + _composite(t); - }, - 'params': function(t) { - return '(' + t[1] + ')'; - } - }; - - return _t(tree); -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/tokenizer.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/js/tokenizer.js deleted file mode 100644 index f580f8b..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/js/tokenizer.js +++ /dev/null @@ -1,249 +0,0 @@ -module.exports = function(js) { - var TokenType = require('../token-types'); - - var tokens = [], - urlMode = false, - blockMode = 0, - c, // current character - cn, // next character - pos = 0, - tn = 0, - ln = 1; - - var Punctuation = { - ' ': TokenType.Space, - '\n': TokenType.Newline, - '\r': TokenType.Newline, - '\t': TokenType.Tab, - '!': TokenType.ExclamationMark, - '"': TokenType.QuotationMark, - '#': TokenType.NumberSign, - '$': TokenType.DollarSign, - '%': TokenType.PercentSign, - '&': TokenType.Ampersand, - '\'': TokenType.Apostrophe, - '(': TokenType.LeftParenthesis, - ')': TokenType.RightParenthesis, - '*': TokenType.Asterisk, - '+': TokenType.PlusSign, - ',': TokenType.Comma, - '-': TokenType.HyphenMinus, - '.': TokenType.FullStop, - '/': TokenType.Solidus, - ':': TokenType.Colon, - ';': TokenType.Semicolon, - '<': TokenType.LessThanSign, - '=': TokenType.EqualsSign, - '>': TokenType.GreaterThanSign, - '?': TokenType.QuestionMark, - '@': TokenType.CommercialAt, - '[': TokenType.LeftSquareBracket, - ']': TokenType.RightSquareBracket, - '^': TokenType.CircumflexAccent, - '_': TokenType.LowLine, - '{': TokenType.LeftCurlyBracket, - '|': TokenType.VerticalLine, - '}': TokenType.RightCurlyBracket, - '~': TokenType.Tilde - }; - - /** - * Add a token to the token list - * @param {string} type - * @param {string} value - */ - function pushToken(type, value) { - tokens.push({ tn: tn++, ln: ln, type: type, value: value }); - } - - /** - * Check if a character is a decimal digit - * @param {string} c Character - * @returns {boolean} - */ - function isDecimalDigit(c) { - return '0123456789'.indexOf(c) >= 0; - } - - /** - * Parse spaces - * @param {string} js Unparsed part of js string - */ - function parseSpaces(js) { - var start = pos; - - // Read the string until we meet a non-space character: - for (; pos < js.length; pos++) { - if (js.charAt(pos) !== ' ') break; - } - - // Add a substring containing only spaces to tokens: - pushToken(TokenType.Space, js.substring(start, pos)); - pos--; - } - - /** - * Parse a string within quotes - * @param {string} js Unparsed part of js string - * @param {string} q Quote (either `'` or `"`) - */ - function parseString(js, q) { - var start = pos; - - // Read the string until we meet a matching quote: - for (pos = pos + 1; pos < js.length; pos++) { - // Skip escaped quotes: - if (js.charAt(pos) === '\\') pos++; - else if (js.charAt(pos) === q) break; - } - - // Add the string (including quotes) to tokens: - pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, js.substring(start, pos + 1)); - } - - /** - * Parse numbers - * @param {string} js Unparsed part of js string - */ - function parseDecimalNumber(js) { - var start = pos; - - // Read the string until we meet a character that's not a digit: - for (; pos < js.length; pos++) { - if (!isDecimalDigit(js.charAt(pos))) break; - } - - // Add the number to tokens: - pushToken(TokenType.DecimalNumber, js.substring(start, pos)); - pos--; - } - - /** - * Parse identifier - * @param {string} js Unparsed part of js string - */ - function parseIdentifier(js) { - var start = pos; - - // Skip all opening slashes: - while (js.charAt(pos) === '/') pos++; - - // Read the string until we meet a punctuation mark: - for (; pos < js.length; pos++) { - // Skip all '\': - if (js.charAt(pos) === '\\') pos++; - else if (js.charAt(pos) in Punctuation) break; - } - - var ident = js.substring(start, pos); - - // Enter url mode if parsed substring is `url`: - urlMode = urlMode || ident === 'url'; - - // Add identifier to tokens: - pushToken(TokenType.Identifier, ident); - pos--; - } - - /** - * Parse a multiline comment - * @param {string} js Unparsed part of js string - */ - function parseMLComment(js) { - var start = pos; - - // Read the string until we meet `*/`. - // Since we already know first 2 characters (`/*`), start reading - // from `pos + 2`: - for (pos = pos + 2; pos < js.length; pos++) { - if (js.charAt(pos) === '*' && js.charAt(pos + 1) === '/') { - pos++; - break; - } - } - - // Add full comment (including `/*` and `*/`) to the list of tokens: - pushToken(TokenType.CommentML, js.substring(start, pos + 1)); - } - - function parseSLComment(js) { - var start = pos; - - // Read the string until we meet line break. - // Since we already know first 2 characters (`//`), start reading - // from `pos + 2`: - for (pos = pos + 2; pos < js.length; pos++) { - if (js.charAt(pos) === '\n' || js.charAt(pos) === '\r') { - break; - } - } - - // Add comment (including `//` and line break) to the list of tokens: - pushToken(TokenType.CommentSL, js.substring(start, pos)); - pos--; - } - - /** - * Convert a js string to a list of tokens - * @param {string} js js string - * @returns {Array} List of tokens - * @private - */ - function getTokens(js) { - // Parse string, character by character: - for (pos = 0; pos < js.length; pos++) { - c = js.charAt(pos); - cn = js.charAt(pos + 1); - - // If we meet `/*`, it's a start of a multiline comment. - // Parse following characters as a multiline comment: - if (c === '/' && cn === '*') { - parseMLComment(js); - } - - // If we meet `//` and it is not a part of url: - else if (!urlMode && c === '/' && cn === '/') { - // If we're currently inside a block, treat `//` as a start - // of identifier. Else treat `//` as a start of a single-line - // comment: - if (blockMode > 0) parseIdentifier(js); - else parseSLComment(js); - } - - // If current character is a double or single quote, it's a start - // of a string: - else if (c === '"' || c === "'") { - parseString(js, c); - } - - // If current character is a space: - else if (c === ' ') { - parseSpaces(js) - } - - // If current character is a punctuation mark: - else if (c in Punctuation) { - // Add it to the list of tokens: - pushToken(Punctuation[c], c); - if (c === '\n' || c === '\r') ln++; // Go to next line - if (c === ')') urlMode = false; // exit url mode - if (c === '{') blockMode++; // enter a block - if (c === '}') blockMode--; // exit a block - } - - // If current character is a decimal digit: - else if (isDecimalDigit(c)) { - parseDecimalNumber(js); - } - - // If current character is anything else: - else { - parseIdentifier(js); - } - } - - return tokens; - } - - return getTokens(js); -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/mark.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/less/mark.js deleted file mode 100644 index 6d79c0d..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/mark.js +++ /dev/null @@ -1,116 +0,0 @@ -var TokenType = require('../token-types'); - -module.exports = (function() { - /** - * Mark whitespaces and comments - */ - function markSC(tokens) { - var tokensLength = tokens.length, - ws = -1, // flag for whitespaces - sc = -1, // flag for whitespaces and comments - t; // current token - - // For every token in the token list, mark spaces and line breaks - // as spaces (set both `ws` and `sc` flags). Mark multiline comments - // with `sc` flag. - // If there are several spaces or tabs or line breaks or multiline - // comments in a row, group them: take the last one's index number - // and save it to the first token in the group as a reference - // (e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` - // for a group of whitespaces and comments): - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - - if (ws === -1) ws = i; - if (sc === -1) sc = i; - - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - t.sc = true; - - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - } - - /** - * Pair brackets - */ - function markBrackets(tokens) { - var tokensLength = tokens.length; - var ps = [], // parenthesis - sbs = [], // square brackets - cbs = [], // curly brackets - t; // current token - - // For every token in the token list, if we meet an opening (left) - // bracket, push its index number to a corresponding array. - // If we then meet a closing (right) bracket, look at the corresponding - // array. If there are any elements (records about previously met - // left brackets), take a token of the last left bracket (take - // the last index number from the array and find a token with - // this index number) and save right bracket's index as a reference: - for (var i = 0; i < tokens.length; i++) { - t = tokens[i]; - switch(t.type) { - case TokenType.LeftParenthesis: - ps.push(i); - break; - case TokenType.RightParenthesis: - if (ps.length) { - t.left = ps.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftSquareBracket: - sbs.push(i); - break; - case TokenType.RightSquareBracket: - if (sbs.length) { - t.left = sbs.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftCurlyBracket: - cbs.push(i); - break; - case TokenType.RightCurlyBracket: - if (cbs.length) { - t.left = cbs.pop(); - tokens[t.left].right = i; - } - break; - } - } - } - - return function(tokens) { - markBrackets(tokens); - markSC(tokens); - } -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/less/node-types.js deleted file mode 100644 index 5667642..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/node-types.js +++ /dev/null @@ -1,58 +0,0 @@ -module.exports = { - ArgumentsType: 'arguments', - AtkeywordType: 'atkeyword', - AtrulebType: 'atruleb', - AtrulerType: 'atruler', - AtrulerqType: 'atrulerq', - AtrulersType: 'atrulers', - AtrulesType: 'atrules', - AttribType: 'attrib', - AttrselectorType: 'attrselector', - BlockType: 'block', - BracesType: 'braces', - ClassType: 'class', - CombinatorType: 'combinator', - CommentMLType: 'commentML', - CommentSLType: 'commentSL', - ConditionType: 'condition', - DeclarationType: 'declaration', - DeclDelimType: 'declDelim', - DelimType: 'delim', - DimensionType: 'dimension', - EscapedStringType: 'escapedString', - FilterType: 'filter', - FiltervType: 'filterv', - FunctionType: 'function', - FunctionExpressionType: 'functionExpression', - IdentType: 'ident', - ImportantType: 'important', - IncludeType :'include', - InterpolatedVariableType: 'interpolatedVariable', - MixinType: 'mixin', - NamespaceType: 'namespace', - NthType: 'nth', - NthselectorType: 'nthselector', - NumberType: 'number', - OperatorType: 'operator', - ParentSelectorType: 'parentselector', - PercentageType: 'percentage', - ProgidType: 'progid', - PropertyType: 'property', - PropertyDelimType: 'propertyDelim', - PseudocType: 'pseudoc', - PseudoeType: 'pseudoe', - RawType: 'raw', - RulesetType: 'ruleset', - SType: 's', - SelectorType: 'selector', - ShashType: 'shash', - SimpleselectorType: 'simpleselector', - StringType: 'string', - StylesheetType: 'stylesheet', - UnaryType: 'unary', - UriType: 'uri', - ValueType: 'value', - VariableType: 'variable', - VariablesListType: 'variableslist', - VhashType: 'vhash' -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/rules.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/less/rules.js deleted file mode 100644 index bd26b53..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/rules.js +++ /dev/null @@ -1,3120 +0,0 @@ -var TokenType = require('../token-types'); -var NodeType = require('./node-types'); - -module.exports = (function() { - var tokens, tokensLength, pos; - - var rules = { - 'arguments': function() { return checkArguments(pos) && getArguments(); }, - 'atkeyword': function() { return checkAtkeyword(pos) && getAtkeyword(); }, - 'atruleb': function() { return checkAtruleb(pos) && getAtruleb(); }, - 'atruler': function() { return checkAtruler(pos) && getAtruler(); }, - 'atrulerq': function() { return checkAtrulerq(pos) && getAtrulerq(); }, - 'atrulers': function() { return checkAtrulers(pos) && getAtrulers(); }, - 'atrules': function() { return checkAtrules(pos) && getAtrules(); }, - 'attrib': function() { return checkAttrib(pos) && getAttrib(); }, - 'attrselector': function() { return checkAttrselector(pos) && getAttrselector(); }, - 'block': function() { return checkBlock(pos) && getBlock(); }, - 'braces': function() { return checkBraces(pos) && getBraces(); }, - 'class': function() { return checkClass(pos) && getClass(); }, - 'combinator': function() { return checkCombinator(pos) && getCombinator(); }, - 'commentML': function() { return checkCommentML(pos) && getCommentML(); }, - 'commentSL': function() { return checkCommentSL(pos) && getCommentSL(); }, - 'condition': function() { return checkCondition(pos) && getCondition(); }, - 'declaration': function() { return checkDeclaration(pos) && getDeclaration(); }, - 'declDelim': function() { return checkDeclDelim(pos) && getDeclDelim(); }, - 'delim': function() { return checkDelim(pos) && getDelim(); }, - 'dimension': function() { return checkDimension(pos) && getDimension(); }, - 'escapedString': function() { return checkEscapedString(pos) && getEscapedString(); }, - 'filter': function() { return checkFilter(pos) && getFilter(); }, - 'filterv': function() { return checkFilterv(pos) && getFilterv(); }, - 'functionExpression': function() { return checkFunctionExpression(pos) && getFunctionExpression(); }, - 'function': function() { return checkFunction(pos) && getFunction(); }, - 'ident': function() { return checkIdent(pos) && getIdent(); }, - 'important': function() { return checkImportant(pos) && getImportant(); }, - 'include': function() { return checkInclude(pos) && getInclude(); }, - 'interpolatedVariable': function() { return checkInterpolatedVariable(pos) && getInterpolatedVariable(); }, - 'mixin': function() { return checkMixin(pos) && getMixin(); }, - 'namespace': function() { return checkNamespace(pos) && getNamespace(); }, - 'nth': function() { return checkNth(pos) && getNth(); }, - 'nthselector': function() { return checkNthselector(pos) && getNthselector(); }, - 'number': function() { return checkNumber(pos) && getNumber(); }, - 'operator': function() { return checkOperator(pos) && getOperator(); }, - 'parentselector': function() { return checkParentSelector(pos) && getParentSelector(); }, - 'percentage': function() { return checkPercentage(pos) && getPercentage(); }, - 'progid': function() { return checkProgid(pos) && getProgid(); }, - 'property': function() { return checkProperty(pos) && getProperty(); }, - 'propertyDelim': function() { return checkPropertyDelim(pos) && getPropertyDelim(); }, - 'pseudoc': function() { return checkPseudoc(pos) && getPseudoc(); }, - 'pseudoe': function() { return checkPseudoe(pos) && getPseudoe(); }, - 'ruleset': function() { return checkRuleset(pos) && getRuleset(); }, - 's': function() { return checkS(pos) && getS(); }, - 'selector': function() { return checkSelector(pos) && getSelector(); }, - 'shash': function() { return checkShash(pos) && getShash(); }, - 'simpleselector': function() { return checkSimpleSelector(pos) && getSimpleSelector(); }, - 'string': function() { return checkString(pos) && getString(); }, - 'stylesheet': function() { return checkStylesheet(pos) && getStylesheet(); }, - 'unary': function() { return checkUnary(pos) && getUnary(); }, - 'uri': function() { return checkUri(pos) && getUri(); }, - 'value': function() { return checkValue(pos) && getValue(); }, - 'variable': function () { return checkVariable(pos) && getVariable(); }, - 'variableslist': function () { return checkVariablesList(pos) && getVariablesList(); }, - 'vhash': function() { return checkVhash(pos) && getVhash(); } - }; - - /** - * Stop parsing and display error - * @param {Number=} i Token's index number - */ - function throwError(i) { - var ln = i ? tokens[i].ln : tokens[pos].ln; - - throw {line: ln, syntax: 'less'}; - } - - /** - * @param {Object} exclude - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkExcluding(exclude, i) { - var start = i; - - while(i < tokensLength) { - if (exclude[tokens[i++].type]) break; - } - - return i - start - 2; - } - - /** - * @param {Number} start - * @param {Number} finish - * @returns {String} - */ - function joinValues(start, finish) { - var s = ''; - - for (var i = start; i < finish + 1; i++) { - s += tokens[i].value; - } - - return s; - } - - /** - * @param {Number} start - * @param {Number} num - * @returns {String} - */ - function joinValues2(start, num) { - if (start + num - 1 >= tokensLength) return; - - var s = ''; - - for (var i = 0; i < num; i++) { - s += tokens[start + i].value; - } - - return s; - } - - -///////////////////////////////////// -///////////////////////////////////// -///////////////////////////////////// - - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAny(i) { - return checkBraces(i) || - checkString(i) || - checkVariablesList(i) || - checkVariable(i) || - checkPercentage(i) || - checkDimension(i) || - checkNumber(i) || - checkUri(i) || - checkFunctionExpression(i) || - checkFunction(i) || - checkIdent(i) || - checkClass(i) || - checkUnary(i); - } - - /** - * @returns {Array} - */ - function getAny() { - if (checkBraces(pos)) return getBraces(); - else if (checkString(pos)) return getString(); - else if (checkVariablesList(pos)) return getVariablesList(); - else if (checkVariable(pos)) return getVariable(); - else if (checkPercentage(pos)) return getPercentage(); - else if (checkDimension(pos)) return getDimension(); - else if (checkNumber(pos)) return getNumber(); - else if (checkUri(pos)) return getUri(); - else if (checkFunctionExpression(pos)) return getFunctionExpression(); - else if (checkFunction(pos)) return getFunction(); - else if (checkIdent(pos)) return getIdent(); - else if (checkClass(pos)) return getClass(); - else if (checkUnary(pos)) return getUnary(); - } - - /** - * Check if token is part of mixin's arguments. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkArguments(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i++].type !== TokenType.LeftParenthesis) return 0; - - while (i < tokens[start].right) { - if (l = checkArgument(i)) i +=l; - else return 0; - } - - return tokens[start].right - start + 1; - } - - /** - * Check if token is valid to be part of arguments list. - * @param i Token's index number - * @returns {Number} - */ - function checkArgument(i) { - return checkDeclaration(i) || - checkVariablesList(i) || - checkVariable(i) || - checkSC(i) || - checkUnary(i) || - checkOperator(i) || - checkDelim(i) || - checkDeclDelim(i) || - checkString(i) || - checkPercentage(i) || - checkDimension(i) || - checkNumber(i) || - checkUri(i) || - checkFunction(i) || - checkIdent(i) || - checkVhash(i); - } - - /** - * @returns {Array} Node that is part of arguments list. - */ - function getArgument() { - if (checkDeclaration(pos)) return getDeclaration(); - if (checkVariablesList(pos)) return getVariablesList(); - if (checkVariable(pos)) return getVariable(); - if (checkSC(pos)) return getSC(); - if (checkUnary(pos)) return getUnary(); - if (checkOperator(pos)) return getOperator(); - if (checkDelim(pos)) return getDelim(); - if (checkDeclDelim(pos)) return getDeclDelim(); - if (checkString(pos)) return getString(); - if (checkPercentage(pos)) return getPercentage(); - if (checkDimension(pos)) return getDimension(); - if (checkNumber(pos)) return getNumber(); - if (checkUri(pos)) return getUri(); - if (checkFunction(pos)) return getFunction(); - if (checkIdent(pos)) return getIdent(); - if (checkVhash(pos)) return getVhash(); - } - - /** - * Check if token is part of an @-word (e.g. `@import`, `@include`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtkeyword(i) { - var l; - - // Check that token is `@`: - if (i >= tokensLength || - tokens[i++].type !== TokenType.CommercialAt) return 0; - - return (l = checkIdent(i)) ? l + 1 : 0; - } - - /** - * Get node with @-word - * @returns {Array} `['atkeyword', ['ident', x]]` where `x` is - * an identifier without - * `@` (e.g. `import`, `include`) - */ - function getAtkeyword() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AtkeywordType, getIdent()]; - - return x; - } - - /** - * Check if token is part of an attribute selector (e.g. `[attr]`, - * `[attr='panda']`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib(i) { - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftSquareBracket || - !tokens[i].right) return 0; - - return tokens[i].right - i + 1; - } - - /** - * Get node with an attribute selector - * @returns {Array} `['attrib', ['ident', x], ['attrselector', y]*, [z]*]` - * where `x` is attribute's name, `y` is operator (if there is any) - * and `z` is attribute's value (if there is any) - */ - function getAttrib() { - if (checkAttrib1(pos)) return getAttrib1(); - if (checkAttrib2(pos)) return getAttrib2(); - } - - /** - * Check if token is part of an attribute selector of the form `[attr='value']` - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib1(i) { - var start = i, - l; - - if (i++ >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkAttrselector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i) || checkString(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - } - - /** - * Get node with an attribute selector of the form `[attr='value']` - * @returns {Array} `['attrib', ['ident', x], ['attrselector', y], [z]]` - * where `x` is attribute's name, `y` is operator and `z` is attribute's - * value - */ - function getAttrib1() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AttribType] - .concat(getSC()) - .concat([getIdent()]) - .concat(getSC()) - .concat([getAttrselector()]) - .concat(getSC()) - .concat([checkString(pos)? getString() : getIdent()]) - .concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an attribute selector of the form `[attr]` - * Attribute can not be empty, e.g. `[]`. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib2(i) { - var start = i, - l; - - if (i++ >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - } - - /** - * Get node with an attribute selector of the form `[attr]` - * @returns {Array} `['attrib', ['ident', x]]` where `x` is attribute's name - */ - function getAttrib2() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AttribType] - .concat(getSC()) - .concat([getIdent()]) - .concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an attribute selector operator (`=`, `~=`, - * `^=`, `$=`, `*=` or `|=`) - * @param {Number} i Token's index number - * @returns {Number} Length of operator (`0` if token is not part of an - * operator, `1` or `2` if it is). - */ - function checkAttrselector(i) { - if (i >= tokensLength) return 0; - - if (tokens[i].type === TokenType.EqualsSign) return 1; - - // TODO: Add example or remove - if (tokens[i].type === TokenType.VerticalLine && - (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign)) - return 1; - - if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0; - - switch(tokens[i].type) { - case TokenType.Tilde: - case TokenType.CircumflexAccent: - case TokenType.DollarSign: - case TokenType.Asterisk: - case TokenType.VerticalLine: - return 2; - } - - return 0; - } - - /** - * Get node with an attribute selector operator (`=`, `~=`, `^=`, `$=`, - * `*=` or `|=`) - * @returns {Array} `['attrselector', x]` where `x` is an operator. - */ - function getAttrselector() { - var startPos = pos, - s = tokens[pos++].value, - x; - - if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value; - - x = [NodeType.AttrselectorType, s]; - - return x; - } - - /** - * Check if token is a part of an @-rule - * @param {Number} i Token's index number - * @returns {Number} Length of @-rule - */ - function checkAtrule(i) { - var l; - - if (i >= tokensLength) return 0; - - // If token already has a record of being part of an @-rule, - // return the @-rule's length: - if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l; - - // If token is part of an @-rule, save the rule's type to token: - if (l = checkAtruler(i)) tokens[i].atrule_type = 1; // @-rule with ruleset - else if (l = checkAtruleb(i)) tokens[i].atrule_type = 2; // block @-rule - else if (l = checkAtrules(i)) tokens[i].atrule_type = 3; // single-line @-rule - else return 0; - - // If token is part of an @-rule, save the rule's length to token: - tokens[i].atrule_l = l; - - return l; - } - - /** - * Get node with @-rule - * @returns {Array} - */ - function getAtrule() { - switch (tokens[pos].atrule_type) { - case 1: return getAtruler(); // @-rule with ruleset - case 2: return getAtruleb(); // block @-rule - case 3: return getAtrules(); // single-line @-rule - } - } - - /** - * Check if token is part of a block @-rule - * @param {Number} i Token's index number - * @returns {Number} Length of the @-rule - */ - function checkAtruleb(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkTsets(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a block @-rule - * @returns {Array} `['atruleb', ['atkeyword', x], y, ['block', z]]` - */ - function getAtruleb() { - var startPos = pos, - x; - - x = [NodeType.AtrulebType, getAtkeyword()] - .concat(getTsets()) - .concat([getBlock()]); - - return x; - } - - /** - * Check if token is part of an @-rule with ruleset - * @param {Number} i Token's index number - * @returns {Number} Length of the @-rule - */ - function checkAtruler(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkAtrulerq(i)) i += l; - - if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++; - else return 0; - - if (l = checkAtrulers(i)) i += l; - - if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++; - else return 0; - - return i - start; - } - - /** - * Get node with an @-rule with ruleset - * @returns {Array} ['atruler', ['atkeyword', x], y, z] - */ - function getAtruler() { - var startPos = pos, - x; - - x = [NodeType.AtrulerType, getAtkeyword(), getAtrulerq()]; - - pos++; - - x.push(getAtrulers()); - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrulerq(i) { - return checkTsets(i); - } - - /** - * @returns {Array} `['atrulerq', x]` - */ - function getAtrulerq() { - var startPos = pos, - x; - - x = [NodeType.AtrulerqType].concat(getTsets()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrulers(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - while (l = checkRuleset(i) || checkAtrule(i) || checkSC(i)) { - i += l; - } - - tokens[i].atrulers_end = 1; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `['atrulers', x]` - */ - function getAtrulers() { - var startPos = pos, - x; - - x = [NodeType.AtrulersType].concat(getSC()); - - while (!tokens[pos].atrulers_end) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkAtrule(pos)) x.push(getAtrule()); - else if (checkRuleset(pos)) x.push(getRuleset()); - } - - x = x.concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrules(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkTsets(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `['atrules', ['atkeyword', x], y]` - */ - function getAtrules() { - var startPos = pos, - x; - - x = [NodeType.AtrulesType, getAtkeyword()].concat(getTsets()); - - return x; - } - - /** - * Check if token is part of a block (e.g. `{...}`). - * @param {Number} i Token's index number - * @returns {Number} Length of the block - */ - function checkBlock(i) { - return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ? - tokens[i].right - i + 1 : 0; - } - - /** - * Get node with a block - * @returns {Array} `['block', x]` - */ - function getBlock() { - var startPos = pos, - end = tokens[pos].right, - x = [NodeType.BlockType]; - - pos++; - - - while (pos < end) { - if (checkBlockdecl(pos)) x = x.concat(getBlockdecl()); - else throwError(); - } - - pos = end + 1; - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkBlockdecl(i) { - var l; - - if (i >= tokensLength) return 0; - - if (l = checkBlockdecl1(i)) tokens[i].bd_type = 1; - else if (l = checkBlockdecl2(i)) tokens[i].bd_type = 2; - else if (l = checkBlockdecl3(i)) tokens[i].bd_type = 3; - else if (l = checkBlockdecl4(i)) tokens[i].bd_type = 4; - else return 0; - - return l; - } - - /** - * @returns {Array} - */ - function getBlockdecl() { - switch (tokens[pos].bd_type) { - case 1: return getBlockdecl1(); - case 2: return getBlockdecl2(); - case 3: return getBlockdecl3(); - case 4: return getBlockdecl4(); - } - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl1(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = checkFilter(i)) tokens[i].bd_kind = 3; - else if (l = checkDeclaration(i)) tokens[i].bd_kind = 4; - else if (l = checkAtrule(i)) tokens[i].bd_kind = 5; - else if (l = checkRuleset(i)) tokens[i].bd_kind = 6; - else if (l = checkInclude(i)) tokens[i].bd_kind = 2; - else return 0; - - i += l; - - if (i < tokensLength && (l = checkDeclDelim(i))) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - return i - start; - } - - /** - * sc*:s0 (atrule | ruleset | filter | declaration):x declDelim:y sc*:s1 -> concat(s0, [x], [y], s1) - * @returns {Array} - */ - function getBlockdecl1() { - var sc = getSC(), - x; - - switch (tokens[pos].bd_kind) { - case 1: - x = getCondition(); - break; - case 2: - x = getInclude(); - break; - case 3: - x = getFilter(); - break; - case 4: - x = getDeclaration(); - break; - case 5: - x = getAtrule(); - break; - case 6: - x = getRuleset(); - break; - } - - return sc - .concat([x]) - .concat([getDeclDelim()]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl2(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = checkFilter(i)) tokens[i].bd_kind = 3; - else if (l = checkDeclaration(i)) tokens[i].bd_kind = 4; - else if (l = checkAtrule(i)) tokens[i].bd_kind = 5; - else if (l = checkRuleset(i)) tokens[i].bd_kind = 6; - else if (l = checkInclude(i)) tokens[i].bd_kind = 2; - else return 0; - - i += l; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getBlockdecl2() { - var sc = getSC(), - x; - - switch (tokens[pos].bd_kind) { - case 1: - x = getCondition(); - break; - case 2: - x = getInclude(); - break; - case 3: - x = getFilter(); - break; - case 4: - x = getDeclaration(); - break; - case 5: - x = getAtrule(); - break; - case 6: - x = getRuleset(); - break; - } - - return sc - .concat([x]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl3(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkDeclDelim(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `[s0, ['declDelim'], s1]` where `s0` and `s1` are - * are optional whitespaces. - */ - function getBlockdecl3() { - return getSC() - .concat([getDeclDelim()]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl4(i) { - return checkSC(i); - } - - /** - * @returns {Array} - */ - function getBlockdecl4() { - return getSC(); - } - - /** - * Check if token is part of text inside parentheses or square brackets - * (e.g. `(1)`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBraces(i) { - if (i >= tokensLength || - (tokens[i].type !== TokenType.LeftParenthesis && - tokens[i].type !== TokenType.LeftSquareBracket)) return 0; - - return tokens[i].right - i + 1; - } - - /** - * Get node with text inside parentheses or square brackets (e.g. `(1)`) - * @returns {Array} `['braces', l, r, x*]` where `l` is a left bracket - * (e.g. `'('`), `r` is a right bracket (e.g. `')'`) and `x` is - * parsed text inside those brackets (if there is any) - * (e.g. `['number', '1']`) - */ - function getBraces() { - var startPos = pos, - left = pos, - right = tokens[pos].right, - x; - - pos++; - - var tsets = getTsets(); - - pos++; - - x = [NodeType.BracesType, tokens[left].value, tokens[right].value] - .concat(tsets); - - return x; - } - - /** - * Check if token is part of a class selector (e.g. `.abc`) - * @param {Number} i Token's index number - * @returns {Number} Length of the class selector - */ - function checkClass(i) { - var l; - - if (i >= tokensLength) return 0; - - if (tokens[i].class_l) return tokens[i].class_l; - - if (tokens[i++].type === TokenType.FullStop && - (l = checkInterpolatedVariable(i) || checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - - return 0; - } - - /** - * Get node with a class selector - * @returns {Array} `['class', ['ident', x]]` where x is a class's - * identifier (without `.`, e.g. `abc`). - */ - function getClass() { - var startPos = pos, - x = [NodeType.ClassType]; - - pos++; - - x.push(checkInterpolatedVariable(pos) ? getInterpolatedVariable() : getIdent()); - - return x; - } - - /** - * Check if token is a combinator (`+`, `>` or `~`) - * @param {Number} i Token's index number - * @returns {Number} Length of the combinator - */ - function checkCombinator(i) { - if (i >= tokensLength) return 0; - - switch (tokens[i].type) { - case TokenType.PlusSign: - case TokenType.GreaterThanSign: - case TokenType.Tilde: - return 1; - } - - return 0; - } - - /** - * Get node with a combinator (`+`, `>` or `~`) - * @returns {Array} `['combinator', x]` where `x` is a combinator - * converted to string. - */ - function getCombinator() { - var startPos = pos, - x; - - x = [NodeType.CombinatorType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is a multiline comment. - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a multiline comment, otherwise `0` - */ - function checkCommentML(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0; - } - - /** - * Get node with a multiline comment - * @returns {Array} `['commentML', x]` where `x` - * is the comment's text (without `/*` and `* /`). - */ - function getCommentML() { - var startPos = pos, - s = tokens[pos].value.substring(2), - l = s.length, - x; - - if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2); - - pos++; - - x = [NodeType.CommentMLType, s]; - - return x; - } - - /** - * Check if token is part of a single-line comment. - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a single-line comment, otherwise `0` - */ - function checkCommentSL(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - } - - /** - * Get node with a single-line comment. - * @returns {Array} - */ - function getCommentSL() { - var startPos = pos, - x; - - x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)]; - - return x; - } - - /** - * Check if token is part of a condition. - * @param {Number} i Token's index number - * @return {Number} Length of the condition - */ - function checkCondition(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if ((l = checkIdent(i)) && tokens[i].value === 'when') i += l; - else return 0; - - while (i < tokensLength) { - if (l = checkBlock(i)) break; - if (l = checkFunction(i) | - checkBraces(i) || - checkVariable(i) || - checkIdent(i) || - checkSC(i) || - checkNumber(i) || - checkDelim(i) || - checkOperator(i) || - checkCombinator(i) || - checkString(i)) i += l; - else return 0; - } - - return i - start; - } - - /** - * Get node with a condition. - * @returns {Array} `['condition', x]` - */ - function getCondition() { - var startPos = pos, - x = [NodeType.ConditionType]; - - x.push(getIdent()); - - while (pos < tokensLength) { - if (checkBlock(pos)) break; - else if (checkFunction(pos)) x.push(getFunction()); - else if (checkBraces(pos)) x.push(getBraces()); - else if (checkVariable(pos)) x.push(getVariable()); - else if (checkIdent(pos)) x.push(getIdent()); - else if (checkNumber(pos)) x.push(getNumber()); - else if (checkDelim(pos)) x.push(getDelim()); - else if (checkOperator(pos)) x.push(getOperator()); - else if (checkCombinator(pos)) x.push(getCombinator()); - else if (checkSC(pos)) x = x.concat(getSC()); - else if (checkString(pos)) x.push(getString()); - } - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkDeclaration(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkProperty(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkPropertyDelim(i)) i++; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkValue(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a declaration - * @returns {Array} `['declaration', ['property', x], ['propertyDelim'], - * ['value', y]]` - */ - function getDeclaration() { - var startPos = pos, - x = [NodeType.DeclarationType]; - - x.push(getProperty()); - x = x.concat(getSC()); - x.push(getPropertyDelim()); - x = x.concat(getSC()); - x.push(getValue()); - - return x; - } - - /** - * Check if token is a semicolon - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a semicolon, otherwise `0` - */ - function checkDeclDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0; - } - - /** - * Get node with a semicolon - * @returns {Array} `['declDelim']` - */ - function getDeclDelim() { - var startPos = pos, - x = [NodeType.DeclDelimType]; - - pos++; - - return x; - } - - /** - * Check if token is a comma - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a comma, otherwise `0` - */ - function checkDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0; - } - - /** - * Get node with a comma - * @returns {Array} `['delim']` - */ - function getDelim() { - var startPos = pos, - x = [NodeType.DelimType]; - - pos++; - - return x; - } - - /** - * Check if token is part of a number with dimension unit (e.g. `10px`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkDimension(i) { - var ln = checkNumber(i), - li; - - if (i >= tokensLength || - !ln || - i + ln >= tokensLength) return 0; - - return (li = checkNmName2(i + ln)) ? ln + li : 0; - } - - /** - * Get node of a number with dimension unit - * @returns {Array} `['dimension', ['number', x], ['ident', y]]` where - * `x` is a number converted to string (e.g. `'10'`) and `y` is - * a dimension unit (e.g. `'px'`). - */ - function getDimension() { - var startPos = pos, - x = [NodeType.DimensionType, getNumber()], - ident = [NodeType.IdentType, getNmName2()]; - - x.push(ident); - - return x; - } - - /** - * Check if token is part of an escaped string (e.g. `~"ms:something"`). - * @param {Number} i Token's index number - * @returns {Numer} Length of the string (including `~` and quotes) - */ - function checkEscapedString(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[i].type === TokenType.Tilde && (l = checkString(i + 1))) return i + l - start; - else return 0; - } - - /** - * Get node with an escaped string - * @returns {Array} `['escapedString', ['string', x]]` where `x` is a string - * without `~` but with quotes - */ - function getEscapedString() { - var startPos = pos, - x = [NodeType.EscapedStringType]; - - pos++; - - x.push(tokens[pos++].value); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilter(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkFilterp(i)) i += l; - else return 0; - - if (tokens[i].type === TokenType.Colon) i++; - else return 0; - - if (l = checkFilterv(i)) i += l; - else return 0; - - return i - start; - } - - /** - * @returns {Array} `['filter', x, y]` - */ - function getFilter() { - var startPos = pos, - x = [NodeType.FilterType, getFilterp()]; - - pos++; - - x.push(getFilterv()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilterp(i) { - var start = i, - l, - x; - - if (i >= tokensLength) return 0; - - if (tokens[i].value === 'filter') l = 1; - else { - x = joinValues2(i, 2); - - if (x === '-filter' || x === '_filter' || x === '*filter') l = 2; - else { - x = joinValues2(i, 4); - - if (x === '-ms-filter') l = 4; - else return 0; - } - } - - tokens[start].filterp_l = l; - - i += l; - - if (checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getFilterp() { - var startPos = pos, - ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)], - x; - - pos += tokens[pos].filterp_l; - - x = [NodeType.PropertyType, ident].concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilterv(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkProgid(i) || checkEscapedString(i)) i += l; - else return 0; - - while (l = checkProgid(i) || checkEscapedString(i)) { - i += l; - } - - tokens[start].last_progid = i; - - if (i < tokensLength && (l = checkSC(i))) i += l; - - if (i < tokensLength && (l = checkImportant(i))) i += l; - - return i - start; - } - - /** - * progid+:x -> [#filterv].concat(x) - * @returns {Array} - */ - function getFilterv() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - - x = x.concat(getSC()); - - while (pos < last_progid) { - x.push(checkProgid(pos) ? getProgid() : getEscapedString()); - } - - if (checkSC(pos)) x = x.concat(getSC()); - - if (pos < tokensLength && checkImportant(pos)) x.push(getImportant()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunctionExpression(i) { - var start = i; - - if (i >= tokensLength || tokens[i++].value !== 'expression' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; - - return tokens[i].right - start + 1; - } - - /** - * @returns {Array} - */ - function getFunctionExpression() { - var startPos = pos, - x, e; - - pos++; - - e = joinValues(pos + 1, tokens[pos].right - 1); - - pos = tokens[pos].right + 1; - - x = [NodeType.FunctionExpressionType, e]; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunction(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkIdent(i)) i +=l; - else return 0; - - return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ? - tokens[i].right - start + 1 : 0; - } - - /** - * @returns {Array} - */ - function getFunction() { - var startPos = pos, - ident = getIdent(), - x = [NodeType.FunctionType, ident], - body; - - body = ident[1] === 'not' ? getNotArguments() : getArguments(); - - x.push(body); - - return x; - } - - /** - * @returns {Array} - */ - function getArguments() { - var startPos = pos, - x = [NodeType.ArgumentsType], - body; - - pos++; - - while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { - if (checkDeclaration(pos)) x.push(getDeclaration()); - else if (checkArgument(pos)) { - body = getArgument(); - if (typeof body[0] === 'string') x.push(body); - else x = x.concat(body); - } else if (checkClass(pos)) x.push(getClass()); - else throwError(); - } - - pos++; - - return x; - } - - /** - * @returns {Array} - */ - function getNotArguments() { - var startPos = pos, - x = [NodeType.ArgumentsType]; - - pos++; - - while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { - if (checkSimpleSelector(pos)) x.push(getSimpleSelector()); - else throwError(); - } - - pos++; - - return x; - } - - /** - * Check if token is part of an identifier - * @param {Number} i Token's index number - * @returns {Number} Length of the identifier - */ - function checkIdent(i) { - var start = i, - wasIdent, - l; - - if (i >= tokensLength) return 0; - - // Check if token is part of an identifier starting with `_`: - if (tokens[i].type === TokenType.LowLine) return checkIdentLowLine(i); - - // If token is a character, `-`, `$` or `*`, skip it & continue: - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.Asterisk) i++; - else return 0; - - // Remember if previous token's type was identifier: - wasIdent = tokens[i - 1].type === TokenType.Identifier; - - for (; i < tokensLength; i++) { - if (l = checkInterpolatedVariable(i)) i += l; - - if (i >= tokensLength) break; - - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine) { - if (tokens[i].type !== TokenType.Identifier && - (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break; - else wasIdent = true; - } - } - - if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0; - - tokens[start].ident_last = i - 1; - - return i - start; - } - - /** - * Check if token is part of an identifier starting with `_` - * @param {Number} i Token's index number - * @returns {Number} Length of the identifier - */ - function checkIdentLowLine(i) { - var start = i; - - if (i++ >= tokensLength) return 0; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.DecimalNumber && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier) break; - } - - // Save index number of the last token of the identifier: - tokens[start].ident_last = i - 1; - - return i - start; - } - - /** - * Get node with an identifier - * @returns {Array} `['ident', x]` where `x` is identifier's name - */ - function getIdent() { - var startPos = pos, - x = [NodeType.IdentType, joinValues(pos, tokens[pos].ident_last)]; - - pos = tokens[pos].ident_last + 1; - - return x; - } - - /** - * Check if token is part of `!important` word - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkImportant(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].value === 'important' ? i - start + 1 : 0; - } - - /** - * Get node with `!important` word - * @returns {Array} `['important', sc]` where `sc` is optional whitespace - */ - function getImportant() { - var startPos = pos, - x = [NodeType.ImportantType]; - - pos++; - - x = x.concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an include (`@include` or `@extend` directive). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInclude(i) { - var l; - - if (i >= tokensLength) return 0; - - if (l = checkInclude1(i)) tokens[i].include_type = 1; - else if (l = checkInclude2(i)) tokens[i].include_type = 2; - - return l; - } - - /** - * Get node with included mixin - * @returns {Array} `['include', x]` - */ - function getInclude() { - switch (tokens[pos].include_type) { - case 1: return getInclude1(); - case 2: return getInclude2(); - } - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInclude1(i) { - var start = i, - l; - - if (l = checkClass(i) || checkShash(i)) i += l; - else return 0; - - while (i < tokensLength) { - if (l = checkClass(i) || checkShash(i) || checkSC(i)) i += l; - else if (tokens[i].type == TokenType.GreaterThanSign) i++; - else break; - } - - if (l = checkArguments(i)) i += l; - else return 0; - - if (i < tokensLength && (l = checkSC(i))) i += l; - - if (i < tokensLength && (l = checkImportant(i))) i += l; - - return i - start; - } - - /** - * @returns {Array} `['include', x]` - */ - function getInclude1() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(checkClass(pos) ? getClass() : getShash()); - - while (pos < tokensLength) { - if (checkClass(pos)) x.push(getClass()); - else if (checkShash(pos)) x.push(getShash()); - else if (checkSC(pos)) x = x.concat(getSC()); - else if (checkOperator(pos)) x.push(getOperator()); - else break; - } - - x.push(getArguments()); - - x = x.concat(getSC()); - - if (checkImportant(pos)) x.push(getImportant()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInclude2(i) { - var start = i, - l; - - if (l = checkClass(i) || checkShash(i)) i += l; - else return 0; - - while (i < tokensLength) { - if (l = checkClass(i) || checkShash(i) || checkSC(i)) i += l; - else if (tokens[i].type == TokenType.GreaterThanSign) i++; - else break; - } - - return i - start; - } - - /** - * @returns {Array} `['include', x]` - */ - function getInclude2() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(checkClass(pos) ? getClass() : getShash()); - - while (pos < tokensLength) { - if (checkClass(pos)) x.push(getClass()); - else if (checkShash(pos)) x.push(getShash()); - else if (checkSC(pos)) x = x.concat(getSC()); - else if (checkOperator(pos)) x.push(getOperator()); - else break; - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkIncludeSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector2(i)) i += l; - else break; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getIncludeSelector() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - - while (pos < tokensLength && checkSimpleSelector2(pos)) { - t = getSimpleSelector2(); - - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * Check if token is part of LESS interpolated variable - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInterpolatedVariable(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[i].type !== TokenType.CommercialAt || - !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket) return 0; - - i += 2; - - if (l = checkIdent(i)) i += l; - else return 0; - - return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0; - } - - /** - * Get node with LESS interpolated variable - * @returns {Array} `['interpolatedVariable', x]` - */ - function getInterpolatedVariable() { - var startPos = pos, - x = [NodeType.InterpolatedVariableType]; - - // Skip `@{`: - pos += 2; - - x.push(getIdent()); - - // Skip `}`: - pos++; - - return x; - } - - /** - * Check if token is part of a LESS mixin - * @param {Number} i Token's index number - * @returns {Number} Length of the mixin - */ - function checkMixin(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkClass(i) || checkShash(i)) i +=l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkArguments(i)) i += l; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a mixin - * @returns {Array} `['mixin', x]` - */ - function getMixin() { - var startPos = pos, - x = [NodeType.MixinType]; - - x.push(checkClass(pos) ? getClass() : getShash()); - - x = x.concat(getSC()); - - if (checkArguments(pos)) x.push(getArguments()); - - x = x.concat(getSC()); - - if (checkBlock(pos)) x.push(getBlock()); - - return x; - } - - /** - * Check if token is a namespace sign (`|`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is `|`, `0` if not - */ - function checkNamespace(i) { - return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0; - } - - /** - * Get node with a namespace sign - * @returns {Array} `['namespace']` - */ - function getNamespace() { - var startPos = pos, - x = [NodeType.NamespaceType]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNmName(i) { - var start = i; - - if (i >= tokensLength) return 0; - - // start char / word - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.LowLine || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DecimalNumber) i++; - else return 0; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier && - tokens[i].type !== TokenType.DecimalNumber) break; - } - - tokens[start].nm_name_last = i - 1; - - return i - start; - } - - /** - * @returns {String} - */ - function getNmName() { - var s = joinValues(pos, tokens[pos].nm_name_last); - - pos = tokens[pos].nm_name_last + 1; - - return s; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNmName2(i) { - if (tokens[i].type === TokenType.Identifier) return 1; - else if (tokens[i].type !== TokenType.DecimalNumber) return 0; - - i++; - - return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1; - } - - /** - * @returns {String} - */ - function getNmName2() { - var s = tokens[pos].value; - - if (tokens[pos++].type === TokenType.DecimalNumber && - pos < tokensLength && - tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value; - - return s; - } - - /** - * Check if token is part of an nth-selector's identifier (e.g. `2n+1`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth(i) { - if (i >= tokensLength) return 0; - - return checkNth1(i) || checkNth2(i); - } - - /** - * Check if token is part of an nth-selector's identifier in the form of - * sequence of decimals and n-s (e.g. `3`, `n`, `2n+1`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth1(i) { - var start = i; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.DecimalNumber && - tokens[i].value !== 'n') break; - } - - if (i !== start) tokens[start].nth_last = i - 1; - - return i - start; - } - - /** - * Get node for nth-selector's identifier (e.g. `2n+1`) - * @returns {Array} `['nth', x]` where `x` is identifier's text - */ - function getNth() { - var startPos = pos, - x = [NodeType.NthType]; - - if (tokens[pos].nth_last) { - x.push(joinValues(pos, tokens[pos].nth_last)); - pos = tokens[pos].nth_last + 1; - } else { - x.push(tokens[pos++].value); - } - - return x; - } - - /** - * Check if token is part of `even` or `odd` nth-selector's identifier - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth2(i) { - return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNthf(i) { - var start = i, - l = 0; - - if (tokens[i++].type !== TokenType.Colon) return 0; - - // There was `:`: - l++; - - if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0; - - // There was either `nth-` or `last-`: - l += 2; - - if ('child' === tokens[i].value) { - l += 1; - } else if ('last-child' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('last-of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value + - tokens[i + 3].value + - tokens[i + 4].value) { - l += 5; - } else return 0; - - tokens[start + 1].nthf_last = start + l - 1; - - return l; - } - - /** - * @returns {String} - */ - function getNthf() { - pos++; - - var s = joinValues(pos, tokens[pos].nthf_last); - - pos = tokens[pos].nthf_last + 1; - - return s; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNthselector(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkNthf(i)) i += l; - else return 0; - - if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0; - - l++; - - var rp = tokens[i++].right; - - while (i < rp) { - if (l = checkSC(i) || - checkUnary(i) || - checkNth(i)) i += l; - else return 0; - } - - return rp - start + 1; - } - - /** - * @returns {Array} - */ - function getNthselector() { - var startPos = pos, - nthf = [NodeType.IdentType, getNthf()], - x = [NodeType.NthselectorType]; - - x.push(nthf); - - pos++; - - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkUnary(pos)) x.push(getUnary()); - else if (checkNth(pos)) x.push(getNth()); - } - - pos++; - - return x; - } - - /** - * Check if token is part of a number - * @param {Number} i Token's index number - * @returns {Number} Length of number - */ - function checkNumber(i) { - if (i >= tokensLength) return 0; - - if (tokens[i].number_l) return tokens[i].number_l; - - // `10`: - if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && - (!tokens[i + 1] || - (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) - return (tokens[i].number_l = 1, tokens[i].number_l); - - // `10.`: - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber))) - return (tokens[i].number_l = 2, tokens[i].number_l); - - // `.10`: - if (i < tokensLength && - tokens[i].type === TokenType.FullStop && - tokens[i + 1].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 2, tokens[i].number_l); - - // `10.10`: - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 3, tokens[i].number_l); - - return 0; - } - - /** - * Get node with number - * @returns {Array} `['number', x]` where `x` is a number converted - * to string. - */ - function getNumber() { - var s = '', - startPos = pos, - l = tokens[pos].number_l, - x = [NodeType.NumberType]; - - for (var j = 0; j < l; j++) { - s += tokens[pos + j].value; - } - - pos += l; - - x.push(s); - - return x; - } - - /** - * Check if token is an operator (`/`, `,`, `:`, `=`, `>`, `<` or `*`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is an operator, otherwise `0` - */ - function checkOperator(i) { - if (i >= tokensLength) return 0; - - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - case TokenType.LessThanSign: - case TokenType.GreaterThanSign: - case TokenType.Asterisk: - return 1; - } - - return 0; - } - - /** - * Get node with an operator - * @returns {Array} `['operator', x]` where `x` is an operator converted - * to string. - */ - function getOperator() { - var startPos = pos, - x = [NodeType.OperatorType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is a parent selector (`&`). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkParentSelector(i) { - return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0; - } - - /** - * Get node with a parent selector - * @returns {Array} `['parentSelector']` - */ - function getParentSelector() { - var startPos = pos, - x = [NodeType.ParentSelectorType, '&']; - - pos++; - - return x; - } - - /** - * Check if token is part of a number with percent sign (e.g. `10%`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPercentage(i) { - var x; - - if (i >= tokensLength) return 0; - - x = checkNumber(i); - - if (!x || i + x >= tokensLength) return 0; - - return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0; - } - - /** - * Get node of number with percent sign - * @returns {Array} `['percentage', ['number', x]]` where `x` is a number - * (without percent sign) converted to string. - */ - function getPercentage() { - var startPos = pos, - x = [NodeType.PercentageType, getNumber()]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkProgid(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6; - else return 0; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (tokens[i].type === TokenType.LeftParenthesis) { - tokens[start].progid_end = tokens[i].right; - i = tokens[i].right + 1; - } else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getProgid() { - var startPos = pos, - progid_end = tokens[pos].progid_end, - x; - - x = [NodeType.ProgidType] - .concat(getSC()) - .concat([_getProgid(progid_end)]) - .concat(getSC()); - - return x; - } - - /** - * @param {Number} progid_end - * @returns {Array} - */ - function _getProgid(progid_end) { - var startPos = pos, - x = [NodeType.RawType, joinValues(pos, progid_end)]; - - pos = progid_end + 1; - - return x; - } - - /** - * Check if token is part of a property - * @param {Number} i Token's index number - * @returns {Number} Length of the property - */ - function checkProperty(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkVariable(i) || checkIdent(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a property - * @returns {Array} `['property', x]` - */ - function getProperty() { - var startPos = pos, - x = [NodeType.PropertyType]; - - if (checkVariable(pos)) x.push(getVariable()); - else x.push(getIdent()); - - return x; - } - - /** - * Check if token is a colon - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a colon, otherwise `0` - */ - function checkPropertyDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0; - } - - /** - * Get node with a colon - * @returns {Array} `['propertyDelim']` - */ - function getPropertyDelim() { - var startPos = pos, - x = [NodeType.PropertyDelimType]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudo(i) { - return checkPseudoe(i) || - checkPseudoc(i); - } - - /** - * @returns {Array} - */ - function getPseudo() { - if (checkPseudoe(pos)) return getPseudoe(); - if (checkPseudoc(pos)) return getPseudoc(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudoe(i) { - var l; - - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - - return (l = checkInterpolatedVariable(i) || checkIdent(i)) ? l + 2 : 0; - } - - /** - * @returns {Array} - */ - function getPseudoe() { - var startPos = pos, - x = [NodeType.PseudoeType]; - - pos += 2; - - x.push(checkInterpolatedVariable(pos) ? getInterpolatedVariable() : getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudoc(i) { - var l; - - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - - return (l = checkInterpolatedVariable(i) || checkFunction(i) || checkIdent(i)) ? l + 1 : 0; - } - - /** - * @returns {Array} - */ - function getPseudoc() { - var startPos = pos, - x = [NodeType.PseudocType]; - - pos ++; - - if (checkInterpolatedVariable(pos)) x.push(getInterpolatedVariable()); - else if (checkFunction(pos)) x.push(getFunction()); - else x.push(getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkRuleset(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[start].ruleset_l) return tokens[start].ruleset_l; - - while (i < tokensLength) { - if (l = checkBlock(i)) {i += l; break;} - else if (l = checkSelector(i)) i += l; - else return 0; - } - - tokens[start].ruleset_l = i - start; - - return i - start; - } - - /** - * @returns {Array} - */ - function getRuleset() { - var startPos = pos, - x = [NodeType.RulesetType]; - - while (pos < tokensLength) { - if (checkBlock(pos)) {x.push(getBlock()); break;} - else if (checkSelector(pos)) x.push(getSelector()); - else break; - } - - return x; - } - - /** - * Check if token is marked as a space (if it's a space or a tab - * or a line break). - * @param i - * @returns {Number} Number of spaces in a row starting with the given token. - */ - function checkS(i) { - return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0; - } - - /** - * Get node with spaces - * @returns {Array} `['s', x]` where `x` is a string containing spaces - */ - function getS() { - var startPos = pos, - x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)]; - - pos = tokens[pos].ws_last + 1; - - return x; - } - - /** - * Check if token is a space or a comment. - * @param {Number} i Token's index number - * @returns {Number} Number of similar (space or comment) tokens - * in a row starting with the given token. - */ - function checkSC(i) { - if (i >= tokensLength) return 0; - - var l, - lsc = 0, - ln = tokens[i].ln; - - while (i < tokensLength) { - if (!(l = checkS(i)) && - !(l = checkCommentML(i)) && - !(l = checkCommentSL(i))) break; - i += l; - lsc += l; - } - - return lsc || 0; - } - - /** - * Get node with spaces and comments - * @returns {Array} Array containing nodes with spaces (if there are any) - * and nodes with comments (if there are any): - * `[['s', x]*, ['comment', y]*]` where `x` is a string of spaces - * and `y` is a comment's text (without `/*` and `* /`). - */ - function getSC() { - var sc = [], - ln; - - if (pos >= tokensLength) return sc; - - ln = tokens[pos].ln; - - while (pos < tokensLength) { - if (checkS(pos)) sc.push(getS()); - else if (checkCommentML(pos)) sc.push(getCommentML()); - else if (checkCommentSL(pos)) sc.push(getCommentSL()); - else break; - } - - return sc; - } - - /** - * Check if token is part of a selector - * @param {Number} i Token's index number - * @returns {Number} Length of the selector - */ - function checkSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector(i) || checkDelim(i)) i += l; - else break; - } - - if (i !== start) tokens[start].selector_end = i - 1; - - return i - start; - } - - /** - * @returns {Array} - */ - function getSelector() { - var startPos = pos, - x = [NodeType.SelectorType], - selector_end = tokens[pos].selector_end; - - while (pos <= selector_end) { - x.push(checkDelim(pos) ? getDelim() : getSimpleSelector()); - } - - return x; - } - - /** - * Check if token is part of a hexadecimal number (e.g. `#fff`) inside - * a simple selector - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkShash(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - - return (l = checkNmName(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a hexadecimal number (e.g. `#fff`) inside a simple - * selector - * @returns {Array} `['shash', x]` where `x` is a hexadecimal number - * converted to string (without `#`, e.g. `fff`) - */ - function getShash() { - var startPos = pos, - x = [NodeType.ShashType]; - - pos++; - - x.push(getNmName()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector1(i)) i += l; - else break; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getSimpleSelector() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - - while (pos < tokensLength) { - if (!checkSimpleSelector1(pos)) break; - t = getSimpleSelector1(); - - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector1(i) { - return checkParentSelector(i) || - checkNthselector(i) || - checkCombinator(i) || - checkAttrib(i) || - checkPseudo(i) || - checkShash(i) || - checkAny(i) || - checkSC(i) || - checkNamespace(i); - } - - /** - * @returns {Array} - */ - function getSimpleSelector1() { - if (checkParentSelector(pos)) return getParentSelector(); - else if (checkNthselector(pos)) return getNthselector(); - else if (checkCombinator(pos)) return getCombinator(); - else if (checkAttrib(pos)) return getAttrib(); - else if (checkPseudo(pos)) return getPseudo(); - else if (checkShash(pos)) return getShash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkNamespace(pos)) return getNamespace(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector2(i) { - return checkParentSelector(i) || - checkNthselector(i) || - checkAttrib(i) || - checkPseudo(i) || - checkShash(i) || - checkIdent(i) || - checkClass(i); - } - - /** - * @returns {Array} - */ - function getSimpleSelector2() { - if (checkParentSelector(pos)) return getParentSelector(); - else if (checkNthselector(pos)) return getNthselector(); - else if (checkAttrib(pos)) return getAttrib(); - else if (checkPseudo(pos)) return getPseudo(); - else if (checkShash(pos)) return getShash(); - else if (checkIdent(pos)) return getIdent(); - else if (checkClass(pos)) return getClass(); - } - - /** - * Check if token is part of a string (text wrapped in quotes) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is part of a string, `0` if not - */ - function checkString(i) { - return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0; - } - - /** - * Get string's node - * @returns {Array} `['string', x]` where `x` is a string (including - * quotes). - */ - function getString() { - var startPos = pos, - x = [NodeType.StringType, tokens[pos++].value]; - - return x; - } - - /** - * Validate stylesheet: it should consist of any number (0 or more) of - * rulesets (sets of rules with selectors), @-rules, whitespaces or - * comments. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkStylesheet(i) { - var start = i, - l; - - // Check every token: - while (i < tokensLength) { - if (l = checkSC(i) || - checkDeclaration(i) || - checkDeclDelim(i) || - checkInclude(i) || - checkMixin(i) || - checkAtrule(i) || - checkRuleset(i)) i += l; - else throwError(i); - } - - return i - start; - } - - /** - * @returns {Array} `['stylesheet', x]` where `x` is all stylesheet's - * nodes. - */ - function getStylesheet() { - var startPos = pos, - x = [NodeType.StylesheetType]; - - while (pos < tokensLength) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkAtrule(pos)) x.push(getAtrule()); - else if (checkRuleset(pos)) x.push(getRuleset()); - else if (checkInclude(pos)) x.push(getInclude()); - else if (checkMixin(pos)) x.push(getMixin()); - else if (checkDeclaration(pos)) x.push(getDeclaration()); - else if (checkDeclDelim(pos)) x.push(getDeclDelim()); - else throwError(); - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkTset(i) { - return checkVhash(i) || - checkAny(i) || - checkSC(i) || - checkOperator(i); - } - - /** - * @returns {Array} - */ - function getTset() { - if (checkVhash(pos)) return getVhash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkOperator(pos)) return getOperator(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkTsets(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - while (l = checkTset(i)) { - i += l; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getTsets() { - var x = [], - t; - - while (t = getTset()) { - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * Check if token is an unary (arithmetical) sign (`+` or `-`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is an unary sign, `0` if not - */ - function checkUnary(i) { - return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0; - } - - /** - * Get node with an unary (arithmetical) sign (`+` or `-`) - * @returns {Array} `['unary', x]` where `x` is an unary sign - * converted to string. - */ - function getUnary() { - var startPos = pos, - x = [NodeType.UnaryType, tokens[pos++].value]; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkUnknown(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - } - - /** - * @returns {Array} - */ - function getUnknown() { - var startPos = pos, - x = [NodeType.UnknownType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is part of URI (e.g. `url('/css/styles.css')`) - * @param {Number} i Token's index number - * @returns {Number} Length of URI - */ - function checkUri(i) { - var start = i; - - if (i >= tokensLength || tokens[i++].value !== 'url' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) - return 0; - - return tokens[i].right - start + 1; - } - - /** - * Get node with URI - * @returns {Array} `['uri', x]` where `x` is URI's nodes (without `url` - * and braces, e.g. `['string', ''/css/styles.css'']`). - */ - function getUri() { - var startPos = pos, - uriExcluding = {}, - uri, - l, - raw; - - pos += 2; - - uriExcluding[TokenType.Space] = 1; - uriExcluding[TokenType.Tab] = 1; - uriExcluding[TokenType.Newline] = 1; - uriExcluding[TokenType.LeftParenthesis] = 1; - uriExcluding[TokenType.RightParenthesis] = 1; - - if (checkUri1(pos)) { - uri = [NodeType.UriType] - .concat(getSC()) - .concat([getString()]) - .concat(getSC()); - - pos++; - } else { - uri = [NodeType.UriType].concat(getSC()), - l = checkExcluding(uriExcluding, pos), - raw = [NodeType.RawType, joinValues(pos, pos + l)]; - - uri.push(raw); - - pos += l + 1; - - uri = uri.concat(getSC()); - - pos++; - } - - return uri; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkUri1(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0; - - i++; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * Check if token is part of a value - * @param {Number} i Token's index number - * @returns {Number} Length of the value - */ - function checkValue(i) { - var start = i, - l, s, _i; - - while (i < tokensLength) { - s = checkSC(i); - _i = i + s; - - if (l = _checkValue(_i)) i += l + s; - if (!l || checkBlock(_i)) break; - } - - return i - start; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function _checkValue(i) { - return checkEscapedString(i) || - checkInterpolatedVariable(i) || - checkVariable(i) || - checkVhash(i) || - checkBlock(i) || - checkAny(i) || - checkAtkeyword(i) || - checkOperator(i) || - checkImportant(i); - } - - /** - * @returns {Array} - */ - function getValue() { - var startPos = pos, - x = [NodeType.ValueType], - s, _pos; - - while (pos < tokensLength) { - s = checkSC(pos); - _pos = pos + s; - - if (!_checkValue(_pos)) break; - - if (s) x = x.concat(getSC()); - x.push(_getValue()); - } - - return x; - } - - /** - * @returns {Array} - */ - function _getValue() { - if (checkEscapedString(pos)) return getEscapedString(); - else if (checkInterpolatedVariable(pos)) return getInterpolatedVariable(); - else if (checkVariable(pos)) return getVariable(); - else if (checkVhash(pos)) return getVhash(); - else if (checkBlock(pos)) return getBlock(); - else if (checkAny(pos)) return getAny(); - else if (checkAtkeyword(pos)) return getAtkeyword(); - else if (checkOperator(pos)) return getOperator(); - else if (checkImportant(pos)) return getImportant(); - } - - /** - * Check if token is part of LESS variable - * @param {Number} i Token's index number - * @returns {Number} Length of the variable - */ - function checkVariable(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.CommercialAt) return 0; - - if (tokens[i - 1] && - tokens[i - 1].type === TokenType.CommercialAt && - tokens[i - 2] && - tokens[i - 2].type === TokenType.CommercialAt) return 0; - - return (l = checkVariable(i + 1) || checkIdent(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a variable - * @returns {Array} `['variable', ['ident', x]]` where `x` is - * a variable name. - */ - function getVariable() { - var startPos = pos, - x = [NodeType.VariableType]; - - pos++; - - if (checkVariable(pos)) x.push(getVariable()); - else x.push(getIdent()); - - return x; - } - - /** - * Check if token is part of a variables list (e.g. `@rest...`). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkVariablesList(i) { - var d = 0, // number of dots - l; - - if (i >= tokensLength) return 0; - - if (l = checkVariable(i)) i+= l; - else return 0; - - while (tokens[i] && tokens[i].type === TokenType.FullStop) { - d++; - i++; - } - - return d === 3 ? l + d : 0; - } - - /** - * Get node with a variables list - * @returns {Array} `['variableslist', ['variable', ['ident', x]]]` where - * `x` is a variable name. - */ - function getVariablesList() { - var startPos = pos, - x = [NodeType.VariablesListType, getVariable()]; - - pos += 3; - - return x; - } - - /** - * Check if token is part of a hexadecimal number (e.g. `#fff`) inside - * some value - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkVhash(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - - return (l = checkNmName2(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a hexadecimal number (e.g. `#fff`) inside some value - * @returns {Array} `['vhash', x]` where `x` is a hexadecimal number - * converted to string (without `#`, e.g. `'fff'`). - */ - function getVhash() { - var startPos = pos, - x = [NodeType.VhashType]; - - pos++; - - x.push(getNmName2()); - - return x; - } - - return function(_tokens, rule) { - tokens = _tokens; - tokensLength = tokens.length; - pos = 0; - - return rules[rule](); - }; -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/less/stringify.js deleted file mode 100644 index 0e6868a..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/stringify.js +++ /dev/null @@ -1,113 +0,0 @@ -module.exports = function stringify(tree) { - // TODO: Better error message - if (!tree) throw new Error('We need tree to translate'); - - var _m_simple = { - 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1, - 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1 - }, - _m_composite = { - 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, - 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1, - 'ident': 1, 'include': 1, 'mixin': 1, 'selector': 1, 'progid': 1, - 'property': 1, 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, - 'value': 1 - }, - _m_primitive = { - 'declDelim': ';', 'delim': ',', - 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' - }; - - function _t(tree) { - var t = tree[0]; - if (t in _m_primitive) return _m_primitive[t]; - else if (t in _m_simple) return _simple(tree); - else if (t in _m_composite) return _composite(tree); - return _unique[t](tree); - } - - function _composite(t, i) { - var s = ''; - i = i === undefined ? 1 : i; - for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); - return s; - } - - function _simple(t) { - return t[1]; - } - - var _unique = { - 'arguments': function(t) { - return '(' + _composite(t) + ')'; - }, - 'atkeyword': function(t) { - return '@' + _t(t[1]); - }, - 'atruler': function(t) { - return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}'; - }, - 'attrib': function(t) { - return '[' + _composite(t) + ']'; - }, - 'block': function(t) { - return '{' + _composite(t) + '}'; - }, - 'braces': function(t) { - return t[1] + _composite(t, 3) + t[2]; - }, - 'class': function(t) { - return '.' + _t(t[1]); - }, - 'commentML': function (t) { - return '/*' + t[1] + '*/'; - }, - 'commentSL': function (t) { - return '/' + '/' + t[1]; - }, - 'escapedString': function(t) { - return '~' + t[1]; - }, - 'filter': function(t) { - return _t(t[1]) + ':' + _t(t[2]); - }, - 'functionExpression': function(t) { - return 'expression(' + t[1] + ')'; - }, - 'important': function(t) { - return '!' + _composite(t) + 'important'; - }, - 'interpolatedVariable': function(t) { - return '@{' + _t(t[1]) + '}'; - }, - 'nthselector': function(t) { - return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')'; - }, - 'percentage': function(t) { - return _t(t[1]) + '%'; - }, - 'pseudoc': function(t) { - return ':' + _t(t[1]); - }, - 'pseudoe': function(t) { - return '::' + _t(t[1]); - }, - 'shash': function (t) { - return '#' + t[1]; - }, - 'uri': function(t) { - return 'url(' + _composite(t) + ')'; - }, - 'variable': function(t) { - return '@' + _t(t[1]); - }, - 'variableslist': function(t) { - return _t(t[1]) + '...'; - }, - 'vhash': function(t) { - return '#' + t[1]; - } - }; - - return _t(tree); -} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/tokenizer.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/less/tokenizer.js deleted file mode 100644 index e67d138..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/less/tokenizer.js +++ /dev/null @@ -1,252 +0,0 @@ -module.exports = function(css) { - var TokenType = require('../token-types'); - - var tokens = [], - urlMode = false, - blockMode = 0, - c, // current character - cn, // next character - pos = 0, - tn = 0, - ln = 1; - - var Punctuation = { - ' ': TokenType.Space, - '\n': TokenType.Newline, - '\r': TokenType.Newline, - '\t': TokenType.Tab, - '!': TokenType.ExclamationMark, - '"': TokenType.QuotationMark, - '#': TokenType.NumberSign, - '$': TokenType.DollarSign, - '%': TokenType.PercentSign, - '&': TokenType.Ampersand, - '\'': TokenType.Apostrophe, - '(': TokenType.LeftParenthesis, - ')': TokenType.RightParenthesis, - '*': TokenType.Asterisk, - '+': TokenType.PlusSign, - ',': TokenType.Comma, - '-': TokenType.HyphenMinus, - '.': TokenType.FullStop, - '/': TokenType.Solidus, - ':': TokenType.Colon, - ';': TokenType.Semicolon, - '<': TokenType.LessThanSign, - '=': TokenType.EqualsSign, - '>': TokenType.GreaterThanSign, - '?': TokenType.QuestionMark, - '@': TokenType.CommercialAt, - '[': TokenType.LeftSquareBracket, - ']': TokenType.RightSquareBracket, - '^': TokenType.CircumflexAccent, - '_': TokenType.LowLine, - '{': TokenType.LeftCurlyBracket, - '|': TokenType.VerticalLine, - '}': TokenType.RightCurlyBracket, - '~': TokenType.Tilde - }; - - /** - * Add a token to the token list - * @param {string} type - * @param {string} value - */ - function pushToken(type, value) { - tokens.push({ tn: tn++, ln: ln, type: type, value: value }); - } - - /** - * Check if a character is a decimal digit - * @param {string} c Character - * @returns {boolean} - */ - function isDecimalDigit(c) { - return '0123456789'.indexOf(c) >= 0; - } - - /** - * Parse spaces - * @param {string} css Unparsed part of CSS string - */ - function parseSpaces(css) { - var start = pos; - - // Read the string until we meet a non-space character: - for (; pos < css.length; pos++) { - if (css.charAt(pos) !== ' ') break; - } - - // Add a substring containing only spaces to tokens: - pushToken(TokenType.Space, css.substring(start, pos)); - pos--; - } - - /** - * Parse a string within quotes - * @param {string} css Unparsed part of CSS string - * @param {string} q Quote (either `'` or `"`) - */ - function parseString(css, q) { - var start = pos; - - // Read the string until we meet a matching quote: - for (pos = pos + 1; pos < css.length; pos++) { - // Skip escaped quotes: - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) === q) break; - } - - // Add the string (including quotes) to tokens: - pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1)); - } - - /** - * Parse numbers - * @param {string} css Unparsed part of CSS string - */ - function parseDecimalNumber(css) { - var start = pos; - - // Read the string until we meet a character that's not a digit: - for (; pos < css.length; pos++) { - if (!isDecimalDigit(css.charAt(pos))) break; - } - - // Add the number to tokens: - pushToken(TokenType.DecimalNumber, css.substring(start, pos)); - pos--; - } - - /** - * Parse identifier - * @param {string} css Unparsed part of CSS string - */ - function parseIdentifier(css) { - var start = pos; - - // Skip all opening slashes: - while (css.charAt(pos) === '/') pos++; - - // Read the string until we meet a punctuation mark: - for (; pos < css.length; pos++) { - // Skip all '\': - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) in Punctuation) break; - } - - var ident = css.substring(start, pos); - - // Enter url mode if parsed substring is `url`: - urlMode = urlMode || ident === 'url'; - - // Add identifier to tokens: - pushToken(TokenType.Identifier, ident); - pos--; - } - - /** - * Parse a multiline comment - * @param {string} css Unparsed part of CSS string - */ - function parseMLComment(css) { - var start = pos; - - // Read the string until we meet `*/`. - // Since we already know first 2 characters (`/*`), start reading - // from `pos + 2`: - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') { - pos++; - break; - } - } - - // Add full comment (including `/*` and `*/`) to the list of tokens: - pushToken(TokenType.CommentML, css.substring(start, pos + 1)); - } - - /** - * Parse a single line comment - * @param {string} css Unparsed part of CSS string - */ - function parseSLComment(css) { - var start = pos; - - // Read the string until we meet line break. - // Since we already know first 2 characters (`//`), start reading - // from `pos + 2`: - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { - break; - } - } - - // Add comment (including `//` and line break) to the list of tokens: - pushToken(TokenType.CommentSL, css.substring(start, pos)); - pos--; - } - - /** - * Convert a CSS string to a list of tokens - * @param {string} css CSS string - * @returns {Array} List of tokens - * @private - */ - function getTokens(css) { - // Parse string, character by character: - for (pos = 0; pos < css.length; pos++) { - c = css.charAt(pos); - cn = css.charAt(pos + 1); - - // If we meet `/*`, it's a start of a multiline comment. - // Parse following characters as a multiline comment: - if (c === '/' && cn === '*') { - parseMLComment(css); - } - - // If we meet `//` and it is not a part of url: - else if (!urlMode && c === '/' && cn === '/') { - // If we're currently inside a block, treat `//` as a start - // of identifier. Else treat `//` as a start of a single-line - // comment: - parseSLComment(css); - } - - // If current character is a double or single quote, it's a start - // of a string: - else if (c === '"' || c === "'") { - parseString(css, c); - } - - // If current character is a space: - else if (c === ' ') { - parseSpaces(css) - } - - // If current character is a punctuation mark: - else if (c in Punctuation) { - // Add it to the list of tokens: - pushToken(Punctuation[c], c); - if (c === '\n' || c === '\r') ln++; // Go to next line - if (c === ')') urlMode = false; // exit url mode - if (c === '{') blockMode++; // enter a block - if (c === '}') blockMode--; // exit a block - } - - // If current character is a decimal digit: - else if (isDecimalDigit(c)) { - parseDecimalNumber(css); - } - - // If current character is anything else: - else { - parseIdentifier(css); - } - } - - return tokens; - } - - return getTokens(css); -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/mark.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/mark.js deleted file mode 100644 index b70680a..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/mark.js +++ /dev/null @@ -1,181 +0,0 @@ -var TokenType = require('../token-types'); - -module.exports = (function() { - /** - * Mark whitespaces and comments - */ - function markSC(tokens) { - var tokensLength = tokens.length, - ws = -1, // flag for whitespaces - sc = -1, // flag for whitespaces and comments - t; // current token - - // For every token in the token list, mark spaces and line breaks - // as spaces (set both `ws` and `sc` flags). Mark multiline comments - // with `sc` flag. - // If there are several spaces or tabs or line breaks or multiline - // comments in a row, group them: take the last one's index number - // and save it to the first token in the group as a reference - // (e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` - // for a group of whitespaces and comments): - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - t.ws = true; - t.sc = true; - - if (ws === -1) ws = i; - if (sc === -1) sc = i; - - break; - case TokenType.Newline: - t.ws = true; - t.sc = true; - - ws = ws === -1 ? i : ws; - sc = sc === -1 ? i : ws; - - tokens[ws].ws_last = i - 1; - tokens[sc].sc_last = i - 1; - tokens[i].ws_last = i; - tokens[i].sc_last = i; - - ws = -1; - sc = -1; - - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - t.sc = true; - - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - } - - /** - * Pair brackets - */ - function markBrackets(tokens) { - var tokensLength = tokens.length; - var ps = [], // parenthesis - sbs = [], // square brackets - cbs = [], // curly brackets - t; // current token - - // For every token in the token list, if we meet an opening (left) - // bracket, push its index number to a corresponding array. - // If we then meet a closing (right) bracket, look at the corresponding - // array. If there are any elements (records about previously met - // left brackets), take a token of the last left bracket (take - // the last index number from the array and find a token with - // this index number) and save right bracket's index as a reference: - for (var i = 0; i < tokens.length; i++) { - t = tokens[i]; - switch(t.type) { - case TokenType.LeftParenthesis: - ps.push(i); - break; - case TokenType.RightParenthesis: - if (ps.length) { - t.left = ps.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftSquareBracket: - sbs.push(i); - break; - case TokenType.RightSquareBracket: - if (sbs.length) { - t.left = sbs.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftCurlyBracket: - cbs.push(i); - break; - case TokenType.RightCurlyBracket: - if (cbs.length) { - t.left = cbs.pop(); - tokens[t.left].right = i; - } - break; - } - } - } - - function markBlocks(tokens) { - var tokensLength = tokens.length; - var blocks = [], - currentLN = 1, - currentIL = 0, - prevIL = 0, - i = 0, - l = tokens.length, - iw; - - for (; i != l; i++) { - if (!tokens[i - 1]) continue; - - // Skip all tokens on current line: - if (tokens[i].ln == currentLN) continue; - else currentLN = tokens[i].ln; - - // Get indent level: - prevIL = currentIL; - if (tokens[i].type === TokenType.Newline) continue; - else if (tokens[i].type === TokenType.Space && - tokens[i + 1].type === TokenType.Newline) continue; - else if (tokens[i].type !== TokenType.Space) currentIL = 0; - else { - // If we don't know ident width yet, count number of spaces: - if (!iw) iw = tokens[i].value.length; - prevIL = currentIL; - currentIL = tokens[i].value.length / iw; - } - - // Decide whether it's block's start or end: - if (prevIL === currentIL) continue; - else if (currentIL > prevIL) { - blocks.push(i); - continue; - } else { - var il = prevIL; - while (blocks.length > 0 && il !== currentIL) { - tokens[blocks.pop()].block_end = i - 1; - il--; - } - } - } - - while (blocks.length > 0) { - tokens[blocks.pop()].block_end = i - 1; - } - } - - return function(tokens) { - markBrackets(tokens); - markSC(tokens); - markBlocks(tokens); - } -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/node-types.js deleted file mode 100644 index 3118be2..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/node-types.js +++ /dev/null @@ -1,61 +0,0 @@ -module.exports = { - ArgumentsType: 'arguments', - AtkeywordType: 'atkeyword', - AtrulebType: 'atruleb', - AtrulerType: 'atruler', - AtrulerqType: 'atrulerq', - AtrulersType: 'atrulers', - AtrulesType: 'atrules', - AttribType: 'attrib', - AttrselectorType: 'attrselector', - BlockType: 'block', - BracesType: 'braces', - ClassType: 'class', - CombinatorType: 'combinator', - CommentMLType: 'commentML', - CommentSLType: 'commentSL', - ConditionType: 'condition', - ConditionalStatementType: 'conditionalStatement', - DeclarationType: 'declaration', - DeclDelimType: 'declDelim', - DefaultType: 'default', - DelimType: 'delim', - DimensionType: 'dimension', - FilterType: 'filter', - FiltervType: 'filterv', - FunctionType: 'function', - FunctionExpressionType: 'functionExpression', - IdentType: 'ident', - ImportantType: 'important', - IncludeType :'include', - InterpolationType: 'interpolation', - LoopType: 'loop', - MixinType: 'mixin', - NamespaceType: 'namespace', - NthType: 'nth', - NthselectorType: 'nthselector', - NumberType: 'number', - OperatorType: 'operator', - ParentSelectorType: 'parentselector', - PercentageType: 'percentage', - PlaceholderType: 'placeholder', - ProgidType: 'progid', - PropertyType: 'property', - PropertyDelimType: 'propertyDelim', - PseudocType: 'pseudoc', - PseudoeType: 'pseudoe', - RawType: 'raw', - RulesetType: 'ruleset', - SType: 's', - SelectorType: 'selector', - ShashType: 'shash', - SimpleselectorType: 'simpleselector', - StringType: 'string', - StylesheetType: 'stylesheet', - UnaryType: 'unary', - UriType: 'uri', - ValueType: 'value', - VariableType: 'variable', - VariablesListType: 'variableslist', - VhashType: 'vhash' -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/rules.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/rules.js deleted file mode 100644 index 922ff44..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/rules.js +++ /dev/null @@ -1,3829 +0,0 @@ -var TokenType = require('../token-types'); -var NodeType = require('./node-types'); - -module.exports = (function() { - var tokens, tokensLength, pos; - - var rules = { - 'arguments': function() { return checkArguments(pos) && getArguments(); }, - 'atkeyword': function() { return checkAtkeyword(pos) && getAtkeyword(); }, - 'atruleb': function() { return checkAtruleb(pos) && getAtruleb(); }, - 'atruler': function() { return checkAtruler(pos) && getAtruler(); }, - 'atrulerq': function() { return checkAtrulerq(pos) && getAtrulerq(); }, - 'atrulers': function() { return checkAtrulers(pos) && getAtrulers(); }, - 'atrules': function() { return checkAtrules(pos) && getAtrules(); }, - 'attrib': function() { return checkAttrib(pos) && getAttrib(); }, - 'attrselector': function() { return checkAttrselector(pos) && getAttrselector(); }, - 'block': function() { return checkBlock(pos) && getBlock(); }, - 'braces': function() { return checkBraces(pos) && getBraces(); }, - 'class': function() { return checkClass(pos) && getClass(); }, - 'combinator': function() { return checkCombinator(pos) && getCombinator(); }, - 'commentML': function() { return checkCommentML(pos) && getCommentML(); }, - 'commentSL': function() { return checkCommentSL(pos) && getCommentSL(); }, - 'condition': function() { return checkCondition(pos) && getCondition(); }, - 'conditionalStatement': function() { return checkConditionalStatement(pos) && getConditionalStatement(); }, - 'declaration': function() { return checkDeclaration(pos) && getDeclaration(); }, - 'declDelim': function() { return checkDeclDelim(pos) && getDeclDelim(); }, - 'default': function() { return checkDefault(pos) && getDefault(); }, - 'delim': function() { return checkDelim(pos) && getDelim(); }, - 'dimension': function() { return checkDimension(pos) && getDimension(); }, - 'filter': function() { return checkFilter(pos) && getFilter(); }, - 'filterv': function() { return checkFilterv(pos) && getFilterv(); }, - 'functionExpression': function() { return checkFunctionExpression(pos) && getFunctionExpression(); }, - 'function': function() { return checkFunction(pos) && getFunction(); }, - 'ident': function() { return checkIdent(pos) && getIdent(); }, - 'important': function() { return checkImportant(pos) && getImportant(); }, - 'include': function() { return checkInclude(pos) && getInclude(); }, - 'interpolation': function() { return checkInterpolation(pos) && getInterpolation(); }, - 'loop': function() { return checkLoop(pos) && getLoop(); }, - 'mixin': function() { return checkMixin(pos) && getMixin(); }, - 'namespace': function() { return checkNamespace(pos) && getNamespace(); }, - 'nth': function() { return checkNth(pos) && getNth(); }, - 'nthselector': function() { return checkNthselector(pos) && getNthselector(); }, - 'number': function() { return checkNumber(pos) && getNumber(); }, - 'operator': function() { return checkOperator(pos) && getOperator(); }, - 'parentselector': function() { return checkParentSelector(pos) && getParentSelector(); }, - 'percentage': function() { return checkPercentage(pos) && getPercentage(); }, - 'placeholder': function() { return checkPlaceholder(pos) && getPlaceholder(); }, - 'progid': function() { return checkProgid(pos) && getProgid(); }, - 'property': function() { return checkProperty(pos) && getProperty(); }, - 'propertyDelim': function() { return checkPropertyDelim(pos) && getPropertyDelim(); }, - 'pseudoc': function() { return checkPseudoc(pos) && getPseudoc(); }, - 'pseudoe': function() { return checkPseudoe(pos) && getPseudoe(); }, - 'ruleset': function() { return checkRuleset(pos) && getRuleset(); }, - 's': function() { return checkS(pos) && getS(); }, - 'selector': function() { return checkSelector(pos) && getSelector(); }, - 'shash': function() { return checkShash(pos) && getShash(); }, - 'simpleselector': function() { return checkSimpleSelector(pos) && getSimpleSelector(); }, - 'string': function() { return checkString(pos) && getString(); }, - 'stylesheet': function() { return checkStylesheet(pos) && getStylesheet(); }, - 'unary': function() { return checkUnary(pos) && getUnary(); }, - 'uri': function() { return checkUri(pos) && getUri(); }, - 'value': function() { return checkValue(pos) && getValue(); }, - 'variable': function () { return checkVariable(pos) && getVariable(); }, - 'variableslist': function () { return checkVariablesList(pos) && getVariablesList(); }, - 'vhash': function() { return checkVhash(pos) && getVhash(); } - }; - - /** - * Stop parsing and display error - * @param {Number=} i Token's index number - */ - function throwError(i) { - var ln = i ? tokens[i].ln : tokens[pos].ln; - - throw {line: ln, syntax: 'sass'}; - } - - /** - * @param {Object} exclude - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkExcluding(exclude, i) { - var start = i; - - while(i < tokensLength) { - if (exclude[tokens[i++].type]) break; - } - - return i - start - 2; - } - - /** - * @param {Number} start - * @param {Number} finish - * @returns {String} - */ - function joinValues(start, finish) { - var s = ''; - - for (var i = start; i < finish + 1; i++) { - s += tokens[i].value; - } - - return s; - } - - /** - * @param {Number} start - * @param {Number} num - * @returns {String} - */ - function joinValues2(start, num) { - if (start + num - 1 >= tokensLength) return; - - var s = ''; - - for (var i = 0; i < num; i++) { - s += tokens[start + i].value; - } - - return s; - } - - -///////////////////////////////////// -///////////////////////////////////// -///////////////////////////////////// - - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAny(i) { - return checkBraces(i) || - checkString(i) || - checkVariablesList(i) || - checkVariable(i) || - checkPlaceholder(i) || - checkPercentage(i) || - checkDimension(i) || - checkNumber(i) || - checkUri(i) || - checkFunctionExpression(i) || - checkFunction(i) || - checkIdent(i) || - checkClass(i) || - checkUnary(i); - } - - /** - * @returns {Array} - */ - function getAny() { - if (checkBraces(pos)) return getBraces(); - else if (checkString(pos)) return getString(); - else if (checkVariablesList(pos)) return getVariablesList(); - else if (checkVariable(pos)) return getVariable(); - else if (checkPlaceholder(pos)) return getPlaceholder(); - else if (checkPercentage(pos)) return getPercentage(); - else if (checkDimension(pos)) return getDimension(); - else if (checkNumber(pos)) return getNumber(); - else if (checkUri(pos)) return getUri(); - else if (checkFunctionExpression(pos)) return getFunctionExpression(); - else if (checkFunction(pos)) return getFunction(); - else if (checkIdent(pos)) return getIdent(); - else if (checkClass(pos)) return getClass(); - else if (checkUnary(pos)) return getUnary(); - } - - /** - * Check if token is part of mixin's arguments. - * @param {Number} i Token's index number - * @returns {Number} Length of arguments - */ - function checkArguments(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftParenthesis) return 0; - - i++; - - while (i < tokens[start].right) { - if (l = checkArgument(i)) i +=l; - else return 0; - } - - return tokens[start].right - start + 1; - } - - /** - * Check if token is valid to be part of arguments list - * @param i Token's index number - * @returns {Number} Length of argument - */ - function checkArgument(i) { - return checkDeclaration(i) || - checkFunction(i) || - checkVariablesList(i) || - checkVariable(i) || - checkSC(i) || - checkDelim(i) || - checkDeclDelim(i) || - checkString(i) || - checkPercentage(i) || - checkDimension(i) || - checkNumber(i) || - checkUri(i) || - checkInterpolation(i) || - checkIdent(i) || - checkVhash(i) || - checkOperator(i) || - checkUnary(i); - } - - /** - * @returns {Array} Node that is part of arguments list - */ - function getArgument() { - if (checkDeclaration(pos)) return getDeclaration(); - else if (checkFunction(pos)) return getFunction(); - else if (checkVariablesList(pos)) return getVariablesList(); - else if (checkVariable(pos)) return getVariable(); - else if (checkSC(pos)) return getSC(); - else if (checkDelim(pos)) return getDelim(); - else if (checkDeclDelim(pos)) return getDeclDelim(); - else if (checkString(pos)) return getString(); - else if (checkPercentage(pos)) return getPercentage(); - else if (checkDimension(pos)) return getDimension(); - else if (checkNumber(pos)) return getNumber(); - else if (checkUri(pos)) return getUri(); - else if (checkInterpolation(pos)) return getInterpolation(); - else if (checkIdent(pos)) return getIdent(); - else if (checkVhash(pos)) return getVhash(); - else if (checkOperator(pos)) return getOperator(); - else if (checkUnary(pos)) return getUnary(); - } - - /** - * Check if token is part of an @-word (e.g. `@import`, `@include`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtkeyword(i) { - var l; - - // Check that token is `@`: - if (i >= tokensLength || - tokens[i++].type !== TokenType.CommercialAt) return 0; - - return (l = checkIdent(i)) ? l + 1 : 0; - } - - /** - * Get node with @-word - * @returns {Array} `['atkeyword', ['ident', x]]` where `x` is - * an identifier without - * `@` (e.g. `import`, `include`) - */ - function getAtkeyword() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AtkeywordType, getIdent()]; - - return x; - } - - /** - * Check if token is part of an attribute selector (e.g. `[attr]`, - * `[attr='panda']`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib(i) { - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftSquareBracket || - !tokens[i].right) return 0; - - return tokens[i].right - i + 1; - } - - /** - * Get node with an attribute selector - * @returns {Array} `['attrib', ['ident', x], ['attrselector', y]*, [z]*]` - * where `x` is attribute's name, `y` is operator (if there is any) - * and `z` is attribute's value (if there is any) - */ - function getAttrib() { - if (checkAttrib1(pos)) return getAttrib1(); - if (checkAttrib2(pos)) return getAttrib2(); - } - - /** - * Check if token is part of an attribute selector of the form `[attr='value']` - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib1(i) { - var start = i, - l; - - if (i++ >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkAttrselector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i) || checkString(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - } - - /** - * Get node with an attribute selector of the form `[attr='value']` - * @returns {Array} `['attrib', ['ident', x], ['attrselector', y], [z]]` - * where `x` is attribute's name, `y` is operator and `z` is attribute's - * value - */ - function getAttrib1() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AttribType] - .concat(getSC()) - .concat([getIdent()]) - .concat(getSC()) - .concat([getAttrselector()]) - .concat(getSC()) - .concat([checkString(pos)? getString() : getIdent()]) - .concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an attribute selector of the form `[attr]` - * Attribute can not be empty, e.g. `[]`. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib2(i) { - var start = i, - l; - - if (i++ >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - } - - /** - * Get node with an attribute selector of the form `[attr]` - * @returns {Array} `['attrib', ['ident', x]]` where `x` is attribute's name - */ - function getAttrib2() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AttribType] - .concat(getSC()) - .concat([getIdent()]) - .concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an attribute selector operator (`=`, `~=`, - * `^=`, `$=`, `*=` or `|=`) - * @param {Number} i Token's index number - * @returns {Number} Length of operator (`0` if token is not part of an - * operator, `1` or `2` if it is). - */ - function checkAttrselector(i) { - if (i >= tokensLength) return 0; - - if (tokens[i].type === TokenType.EqualsSign) return 1; - - // TODO: Add example or remove - if (tokens[i].type === TokenType.VerticalLine && - (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign)) - return 1; - - if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0; - - switch(tokens[i].type) { - case TokenType.Tilde: - case TokenType.CircumflexAccent: - case TokenType.DollarSign: - case TokenType.Asterisk: - case TokenType.VerticalLine: - return 2; - } - - return 0; - } - - /** - * Get node with an attribute selector operator (`=`, `~=`, `^=`, `$=`, - * `*=` or `|=`) - * @returns {Array} `['attrselector', x]` where `x` is an operator. - */ - function getAttrselector() { - var startPos = pos, - s = tokens[pos++].value, - x; - - if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value; - - x = [NodeType.AttrselectorType, s]; - - return x; - } - - /** - * Check if token is a part of an @-rule - * @param {Number} i Token's index number - * @returns {Number} Length of @-rule - */ - function checkAtrule(i) { - var l; - - if (i >= tokensLength) return 0; - - // If token already has a record of being part of an @-rule, - // return the @-rule's length: - if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l; - - // If token is part of an @-rule, save the rule's type to token: - if (l = checkAtruler(i)) tokens[i].atrule_type = 1; // @-rule with ruleset - else if (l = checkAtruleb(i)) tokens[i].atrule_type = 2; // block @-rule - else if (l = checkAtrules(i)) tokens[i].atrule_type = 3; // single-line @-rule - else return 0; - - // If token is part of an @-rule, save the rule's length to token: - tokens[i].atrule_l = l; - - return l; - } - - /** - * Get node with @-rule - * @returns {Array} - */ - function getAtrule() { - switch (tokens[pos].atrule_type) { - case 1: return getAtruler(); // @-rule with ruleset - case 2: return getAtruleb(); // block @-rule - case 3: return getAtrules(); // single-line @-rule - } - } - - /** - * Check if token is part of a block @-rule - * @param {Number} i Token's index number - * @returns {Number} Length of the @-rule - */ - function checkAtruleb(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkTsets(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a block @-rule - * @returns {Array} `['atruleb', ['atkeyword', x], y, ['block', z]]` - */ - function getAtruleb() { - var startPos = pos, - x; - - x = [NodeType.AtrulebType, getAtkeyword()] - .concat(getTsets()) - .concat([getBlock()]); - - return x; - } - - /** - * Check if token is part of an @-rule with ruleset - * @param {Number} i Token's index number - * @returns {Number} Length of the @-rule - */ - function checkAtruler(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkAtrulerq(i)) i += l; - - if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++; - else return 0; - - if (l = checkAtrulers(i)) i += l; - - if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++; - else return 0; - - return i - start; - } - - /** - * Get node with an @-rule with ruleset - * @returns {Array} ['atruler', ['atkeyword', x], y, z] - */ - function getAtruler() { - var startPos = pos, - x; - - x = [NodeType.AtrulerType, getAtkeyword(), getAtrulerq()]; - - pos++; - - x.push(getAtrulers()); - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrulerq(i) { - return checkTsets(i); - } - - /** - * @returns {Array} `['atrulerq', x]` - */ - function getAtrulerq() { - var startPos = pos, - x; - - x = [NodeType.AtrulerqType].concat(getTsets()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrulers(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - while (l = checkRuleset(i) || checkAtrule(i) || checkSC(i)) { - i += l; - } - - tokens[i].atrulers_end = 1; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `['atrulers', x]` - */ - function getAtrulers() { - var startPos = pos, - x; - - x = [NodeType.AtrulersType].concat(getSC()); - - while (!tokens[pos].atrulers_end) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkAtrule(pos)) x.push(getAtrule()); - else if (checkRuleset(pos)) x.push(getRuleset()); - } - - x = x.concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrules(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkTsets(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `['atrules', ['atkeyword', x], y]` - */ - function getAtrules() { - var startPos = pos, - x; - - x = [NodeType.AtrulesType, getAtkeyword()].concat(getTsets()); - - return x; - } - - /** - * Check if token is part of a block (e.g. `{...}`). - * @param {Number} i Token's index number - * @returns {Number} Length of the block - */ - function checkBlock(i) { - return i < tokensLength && tokens[i].block_end ? - tokens[i].block_end - i + 1 : 0; - } - - /** - * Get node with a block - * @returns {Array} `['block', x]` - */ - function getBlock() { - var startPos = pos, - end = tokens[pos].block_end, - x = [NodeType.BlockType]; - - while (pos < end) { - if (checkBlockdecl(pos)) x = x.concat(getBlockdecl()); - else throwError(); - } - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkBlockdecl(i) { - var l; - - if (i >= tokensLength) return 0; - - if (l = checkBlockdecl1(i)) tokens[i].bd_type = 1; - else if (l = checkBlockdecl2(i)) tokens[i].bd_type = 2; - else if (l = checkBlockdecl3(i)) tokens[i].bd_type = 3; - else if (l = checkBlockdecl4(i)) tokens[i].bd_type = 4; - else return 0; - - return l; - } - - /** - * @returns {Array} - */ - function getBlockdecl() { - switch (tokens[pos].bd_type) { - case 1: return getBlockdecl1(); - case 2: return getBlockdecl2(); - case 3: return getBlockdecl3(); - case 4: return getBlockdecl4(); - } - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl1(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkConditionalStatement(i)) tokens[i].bd_kind = 1; - else if (l = checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = checkLoop(i)) tokens[i].bd_kind = 3; - else if (l = checkFilter(i)) tokens[i].bd_kind = 4; - else if (l = checkDeclaration(i)) tokens[i].bd_kind = 5; - else if (l = checkAtrule(i)) tokens[i].bd_kind = 6; - else if (l = checkRuleset(i)) tokens[i].bd_kind = 7; - else return 0; - - i += l; - - if (i >= tokensLength) return 0; - - while (i < tokensLength) { - if (l = checkDeclDelim(i)) { - i += l; - while (i < tokensLength && - (l = checkS(i)) && - tokens[i].type === 'Newline') i += l; - break; - } else if (l = checkS(i)) i += l; - else if (l = checkCommentSL(i)) i += l; - else return 0; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getBlockdecl1() { - var sc = getSC(), - x; - - switch (tokens[pos].bd_kind) { - case 1: - x = getConditionalStatement(); - break; - case 2: - x = getInclude(); - break; - case 3: - x = getLoop(); - break; - case 4: - x = getFilter(); - break; - case 5: - x = getDeclaration(); - break; - case 6: - x = getAtrule(); - break; - case 7: - x = getRuleset(); - break; - } - - x = sc.concat([x]); - - while (pos < tokensLength) { - if (checkDeclDelim(pos)) { - x.push(getDeclDelim()); - while (pos < tokensLength && - checkS(pos) && - tokens[pos].type === 'Newline') x.push(getS()); - break; - } else if (checkS(pos)) x.push(getS()); - else if (checkCommentSL(pos)) x.push(getCommentSL()); - else break; - } - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl2(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkConditionalStatement(i)) tokens[i].bd_kind = 1; - else if (l = checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = checkLoop(i)) tokens[i].bd_kind = 3; - else if (l = checkFilter(i)) tokens[i].bd_kind = 4; - else if (l = checkDeclaration(i)) tokens[i].bd_kind = 5; - else if (l = checkAtrule(i)) tokens[i].bd_kind = 6; - else if (l = checkRuleset(i)) tokens[i].bd_kind = 7; - else return 0; - - i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getBlockdecl2() { - var sc = getSC(), - x; - - switch (tokens[pos].bd_kind) { - case 1: - x = getConditionalStatement(); - break; - case 2: - x = getInclude(); - break; - case 3: - x = getLoop(); - break; - case 4: - x = getFilter(); - break; - case 5: - x = getDeclaration(); - break; - case 6: - x = getAtrule(); - break; - case 7: - x = getRuleset(); - break; - } - - return sc.concat([x]); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl3(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkDeclDelim(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `[s0, ['declDelim'], s1]` where `s0` and `s1` are - * are optional whitespaces. - */ - function getBlockdecl3() { - return getSC() - .concat([getDeclDelim()]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl4(i) { - return checkSC(i); - } - - /** - * @returns {Array} - */ - function getBlockdecl4() { - return getSC(); - } - - /** - * Check if token is part of text inside parentheses or square brackets - * (e.g. `(1)`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBraces(i) { - if (i >= tokensLength || - (tokens[i].type !== TokenType.LeftParenthesis && - tokens[i].type !== TokenType.LeftSquareBracket)) return 0; - - return tokens[i].right - i + 1; - } - - /** - * Get node with text inside parentheses or square brackets (e.g. `(1)`) - * @returns {Array} `['braces', l, r, x*]` where `l` is a left bracket - * (e.g. `'('`), `r` is a right bracket (e.g. `')'`) and `x` is - * parsed text inside those brackets (if there is any) - * (e.g. `['number', '1']`) - */ - function getBraces() { - var startPos = pos, - left = pos, - right = tokens[pos].right, - x; - - pos++; - - var tsets = getTsets(); - - pos++; - - x = [NodeType.BracesType, tokens[left].value, tokens[right].value] - .concat(tsets); - - return x; - } - - /** - * Check if token is part of a class selector (e.g. `.abc`) - * @param {Number} i Token's index number - * @returns {Number} Length of the class selector - */ - function checkClass(i) { - var l; - - if (i >= tokensLength) return 0; - - if (tokens[i].class_l) return tokens[i].class_l; - - if (tokens[i++].type === TokenType.FullStop && - (l = checkInterpolation(i) || checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - - return 0; - } - - /** - * Get node with a class selector - * @returns {Array} `['class', ['ident', x]]` where x is a class's - * identifier (without `.`, e.g. `abc`). - */ - function getClass() { - var startPos = pos, - x = [NodeType.ClassType]; - - pos++; - - x.push(checkInterpolation(pos) ? getInterpolation() : getIdent()); - - return x; - } - - /** - * Check if token is a combinator (`+`, `>` or `~`) - * @param {Number} i Token's index number - * @returns {Number} Length of the combinator - */ - function checkCombinator(i) { - if (i >= tokensLength) return 0; - - switch (tokens[i].type) { - case TokenType.PlusSign: - case TokenType.GreaterThanSign: - case TokenType.Tilde: - return 1; - } - - return 0; - } - - /** - * Get node with a combinator (`+`, `>` or `~`) - * @returns {Array} `['combinator', x]` where `x` is a combinator - * converted to string. - */ - function getCombinator() { - var startPos = pos, - x; - - x = [NodeType.CombinatorType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is a multiline comment. - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a multiline comment, otherwise `0` - */ - function checkCommentML(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0; - } - - /** - * Get node with a multiline comment - * @returns {Array} `['commentML', x]` where `x` - * is the comment's text (without `/*` and `* /`). - */ - function getCommentML() { - var startPos = pos, - s = tokens[pos].value.substring(2), - l = s.length, - x; - - pos++; - - x = [NodeType.CommentMLType, s]; - - return x; - } - - /** - * Check if token is part of a single-line comment. - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a single-line comment, otherwise `0` - */ - function checkCommentSL(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - } - - /** - * Get node with a single-line comment. - * @returns {Array} `['commentSL', x]` where `x` is comment's message - * (without `//`) - */ - function getCommentSL() { - var startPos = pos, - x; - - x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)]; - - return x; - } - - /** - * Check if token is part of a condition - * (e.g. `@if ...`, `@else if ...` or `@else ...`). - * @param {Number} i Token's index number - * @returns {Number} Length of the condition - */ - function checkCondition(i) { - var start = i, - l, _i, s; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (['if', 'else'].indexOf(tokens[start + 1].value) < 0) return 0; - - while (i < tokensLength) { - if (l = checkBlock(i)) break; - - s = checkSC(i); - _i = i + s; - - if (l = _checkCondition(_i)) i += l + s; - else break; - } - - return i - start; - } - - function _checkCondition(i) { - return checkVariable(i) || - checkNumber(i) || - checkIdent(i) || - checkOperator(i) || - checkCombinator(i) || - checkString(i); - } - - /** - * Get node with a condition. - * @returns {Array} `['condition', x]` - */ - function getCondition() { - var startPos = pos, - x = [NodeType.ConditionType]; - - x.push(getAtkeyword()); - - while (pos < tokensLength) { - if (checkBlock(pos)) break; - - s = checkSC(pos); - _pos = pos + s; - - if (!_checkCondition(_pos)) break; - - if (s) x = x.concat(getSC()); - x.push(_getCondition()); - } - - return x; - } - - function _getCondition() { - if (checkVariable(pos)) return getVariable(); - if (checkNumber(pos)) return getNumber(); - if (checkIdent(pos)) return getIdent(); - if (checkOperator(pos)) return getOperator(); - if (checkCombinator(pos)) return getCombinator(); - if (checkString(pos)) return getString(); - } - - /** - * Check if token is part of a conditional statement - * (e.g. `@if ... {} @else if ... {} @else ... {}`). - * @param {Number} i Token's index number - * @returns {Number} Length of the condition - */ - function checkConditionalStatement(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkCondition(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a condition. - * @returns {Array} `['condition', x]` - */ - function getConditionalStatement() { - var startPos = pos, - x = [NodeType.ConditionalStatementType]; - - x.push(getCondition()); - x = x.concat(getSC()); - x.push(getBlock()); - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkDeclaration(i) { - return checkDeclaration1(i) || checkDeclaration2(i); - } - - /** - * Get node with a declaration - * @returns {Array} `['declaration', ['property', x], ['propertyDelim'], - * ['value', y]]` - */ - function getDeclaration() { - return checkDeclaration1(pos) ? getDeclaration1() : getDeclaration2(); - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkDeclaration1(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkProperty(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkPropertyDelim(i)) i++; - else return 0; - - if (l = checkValue(i)) return i + l - start; - - if (l = checkS(i)) i += l; - - if (l = checkValue(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a declaration - * @returns {Array} `['declaration', ['property', x], ['propertyDelim'], - * ['value', y]]` - */ - function getDeclaration1() { - var startPos = pos, - x = [NodeType.DeclarationType]; - - x.push(getProperty()); - if (checkS(pos)) x.push(getS()); - x.push(getPropertyDelim()); - if (checkS(pos)) x.push(getS()); - x.push(getValue()); - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkDeclaration2(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkPropertyDelim(i)) i++; - else return 0; - - if (l = checkProperty(i)) i += l; - else return 0; - - if (l = checkValue(i)) return i + l - start; - - if (l = checkSC(i)) i += l; - - if (l = checkValue(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a declaration - * @returns {Array} `['declaration', ['propertyDelim'], ['property', x], - * ['value', y]]` - */ - function getDeclaration2() { - var startPos = pos, - x = [NodeType.DeclarationType]; - - x.push(getPropertyDelim()); - x.push(getProperty()); - x = x.concat(getSC()); - x.push(getValue()); - - return x; - } - - /** - * Check if token is a semicolon - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a semicolon, otherwise `0` - */ - function checkDeclDelim(i) { - if (i >= tokensLength) return 0; - - return (tokens[i].type === TokenType.Newline || - tokens[i].type === TokenType.Semicolon) ? 1 : 0; - } - - /** - * Get node with a semicolon - * @returns {Array} `['declDelim']` - */ - function getDeclDelim() { - var startPos = pos, - x = [NodeType.DeclDelimType]; - - pos++; - - return x; - } - - /** - * Check if token if part of `!default` word. - * @param {Number} i Token's index number - * @returns {Number} Length of the `!default` word - */ - function checkDefault(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].value === 'default' ? i - start + 1 : 0; - } - - /** - * Get node with a `!default` word - * @returns {Array} `['default', sc]` where `sc` is optional whitespace - */ - function getDefault() { - var startPos = pos, - x = [NodeType.DefaultType], - sc; - - // Skip `!`: - pos++; - - sc = getSC(); - - // Skip `default`: - pos++; - - x = x.concat(sc); - - return x; - } - - /** - * Check if token is a comma - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a comma, otherwise `0` - */ - function checkDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0; - } - - /** - * Get node with a comma - * @returns {Array} `['delim']` - */ - function getDelim() { - var startPos = pos, - x = [NodeType.DelimType]; - - pos++; - - return x; - } - - /** - * Check if token is part of a number with dimension unit (e.g. `10px`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkDimension(i) { - var ln = checkNumber(i), - li; - - if (i >= tokensLength || - !ln || - i + ln >= tokensLength) return 0; - - return (li = checkNmName2(i + ln)) ? ln + li : 0; - } - - /** - * Get node of a number with dimension unit - * @returns {Array} `['dimension', ['number', x], ['ident', y]]` where - * `x` is a number converted to string (e.g. `'10'`) and `y` is - * a dimension unit (e.g. `'px'`). - */ - function getDimension() { - var startPos = pos, - x = [NodeType.DimensionType, getNumber()], - ident = [NodeType.IdentType, getNmName2()]; - - x.push(ident); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilter(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkFilterp(i)) i += l; - else return 0; - - if (tokens[i].type === TokenType.Colon) i++; - else return 0; - - if (l = checkFilterv(i)) i += l; - else return 0; - - return i - start; - } - - /** - * @returns {Array} `['filter', x, y]` - */ - function getFilter() { - var startPos = pos, - x = [NodeType.FilterType, getFilterp()]; - - pos++; - - x.push(getFilterv()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilterp(i) { - var start = i, - l, - x; - - if (i >= tokensLength) return 0; - - if (tokens[i].value === 'filter') l = 1; - else { - x = joinValues2(i, 2); - - if (x === '-filter' || x === '_filter' || x === '*filter') l = 2; - else { - x = joinValues2(i, 4); - - if (x === '-ms-filter') l = 4; - else return 0; - } - } - - tokens[start].filterp_l = l; - - i += l; - - if (checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getFilterp() { - var startPos = pos, - ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)], - x; - - pos += tokens[pos].filterp_l; - - x = [NodeType.PropertyType, ident].concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilterv(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkProgid(i)) i += l; - else return 0; - - while (l = checkProgid(i)) { - i += l; - } - - tokens[start].last_progid = i; - - if (checkDeclDelim(i)) return i - start; - - if (i < tokensLength && (l = checkSC(i))) i += l; - - if (i < tokensLength && (l = checkImportant(i))) i += l; - - return i - start; - } - - /** - * progid+:x -> [#filterv].concat(x) - * @returns {Array} - */ - function getFilterv() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - - while (pos < last_progid) { - x.push(getProgid()); - } - - if (checkDeclDelim(pos)) return x; - - if (checkSC(pos)) x = x.concat(getSC()); - - if (pos < tokensLength && checkImportant(pos)) x.push(getImportant()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunctionExpression(i) { - var start = i; - - if (i >= tokensLength || tokens[i++].value !== 'expression' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; - - return tokens[i].right - start + 1; - } - - /** - * @returns {Array} - */ - function getFunctionExpression() { - var startPos = pos, - x, e; - - pos++; - - e = joinValues(pos + 1, tokens[pos].right - 1); - - pos = tokens[pos].right + 1; - - x = [NodeType.FunctionExpressionType, e]; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunction(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkIdent(i)) i +=l; - else return 0; - - return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ? - tokens[i].right - start + 1 : 0; - } - - /** - * @returns {Array} - */ - function getFunction() { - var startPos = pos, - ident = getIdent(), - x = [NodeType.FunctionType, ident], - body; - - body = ident[1] === 'not' ? getNotArguments() : getArguments(); - - x.push(body); - - return x; - } - - /** - * @returns {Array} - */ - function getArguments() { - var startPos = pos, - x = [NodeType.ArgumentsType], - body; - - pos++; - - while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { - if (checkDeclaration(pos)) x.push(getDeclaration()); - else if (checkArgument(pos)) { - body = getArgument(); - if (typeof body[0] === 'string') x.push(body); - else x = x.concat(body); - } else if (checkClass(pos)) x.push(getClass()); - else throwError(); - } - - pos++; - - return x; - } - - /** - * @returns {Array} - */ - function getNotArguments() { - var startPos = pos, - x = [NodeType.ArgumentsType]; - - pos++; - - while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { - if (checkSimpleSelector(pos)) x.push(getSimpleSelector()); - else throwError(); - } - - pos++; - - return x; - } - - /** - * Check if token is part of an identifier - * @param {Number} i Token's index number - * @returns {Number} Length of the identifier - */ - function checkIdent(i) { - var start = i, - interpolations = [], - wasIdent, - wasInt = false, - l; - - if (i >= tokensLength) return 0; - - // Check if token is part of an identifier starting with `_`: - if (tokens[i].type === TokenType.LowLine) return checkIdentLowLine(i); - - // If token is a character, `-`, `$` or `*`, skip it & continue: - if (l = _checkIdent(i)) i += l; - else return 0; - - if (l > 1) { - interpolations.push(i - l); - wasInt = true; - } else { - // Remember if previous token's type was identifier: - wasIdent = tokens[i - 1].type === TokenType.Identifier; - } - - while (i < tokensLength) { - l = _checkIdent(i); - - if (!l) break; - - if (l > 1) { - wasInt = true; - interpolations.push(i); - } else { - wasIdent = true; - } - i += l; - } - - if (!wasIdent && !wasInt && tokens[start].type !== TokenType.Asterisk) return 0; - - tokens[start].ident_last = i - 1; - if (interpolations.length) tokens[start].interpolations = interpolations; - - return i - start; - } - - function _checkIdent(i) { - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.LowLine || - tokens[i].type === TokenType.Asterisk) return 1; - if (l = checkInterpolation(i)) return l; - return 0; - } - - /** - * Check if token is part of an identifier starting with `_` - * @param {Number} i Token's index number - * @returns {Number} Length of the identifier - */ - function checkIdentLowLine(i) { - var start = i; - - if (i++ >= tokensLength) return 0; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.DecimalNumber && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier) break; - } - - // Save index number of the last token of the identifier: - tokens[start].ident_last = i - 1; - - return i - start; - } - - /** - * Get node with an identifier - * @returns {Array} `['ident', x]` where `x` is identifier's name - */ - function getIdent() { - var startPos = pos, - interpolations = tokens[pos].interpolations, - x = [NodeType.IdentType]; - - if (interpolations) { - for (var i = 0, l = interpolations.length; i < l; i++) { - var s = joinValues(pos, interpolations[i] - 1); - if (s) x.push(s); - pos = interpolations[i]; - x.push(getInterpolation()); - } - } - - if (pos < tokensLength && pos <= tokens[startPos].ident_last) { - x.push(joinValues(pos, tokens[startPos].ident_last)); - pos = tokens[pos].ident_last + 1; - } - - return x; - } - - /** - * Check if token is part of `!important` word - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkImportant(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].value === 'important' ? i - start + 1 : 0; - } - - /** - * Get node with `!important` word - * @returns {Array} `['important', sc]` where `sc` is optional whitespace - */ - function getImportant() { - var startPos = pos, - x = [NodeType.ImportantType]; - - pos++; - - x = x.concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an included mixin (`@include` or `@extend` - * directive). - * @param {Number} i Token's index number - * @returns {Number} Length of the included mixin - */ - function checkInclude(i) { - var l; - - if (i >= tokensLength) return 0; - - if (l = checkInclude1(i)) tokens[i].include_type = 1; - else if (l = checkInclude2(i)) tokens[i].include_type = 2; - else if (l = checkInclude3(i)) tokens[i].include_type = 3; - else if (l = checkInclude4(i)) tokens[i].include_type = 4; - else if (l = checkInclude5(i)) tokens[i].include_type = 5; - else if (l = checkInclude6(i)) tokens[i].include_type = 6; - else if (l = checkInclude7(i)) tokens[i].include_type = 7; - else if (l = checkInclude8(i)) tokens[i].include_type = 8; - - return l; - } - - /** - * Get node with included mixin - * @returns {Array} `['include', x]` - */ - function getInclude() { - switch (tokens[pos].include_type) { - case 1: return getInclude1(); - case 2: return getInclude2(); - case 3: return getInclude3(); - case 4: return getInclude4(); - case 5: return getInclude5(); - case 6: return getInclude6(); - case 7: return getInclude7(); - case 8: return getInclude8(); - } - } - - /** - * Check if token is part of an included mixin like `@include nani(foo) {...}` - * @param {Number} i Token's index number - * @returns {Number} Length of the include - */ - function checkInclude1(i) { - var start = i, - l; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - // TODO: Check if extends don't take any arguments - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkArguments(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with included mixin like `@include nani(foo) {...}` - * @returns {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, - * ['arguments', z], sc, ['block', q], sc` where `x` is `include` or - * `extend`, `y` is mixin's identifier (selector), `z` are arguments - * passed to the mixin, `q` is block passed to the mixin and `sc` - * are optional whitespaces - */ - function getInclude1() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getAtkeyword()); - - x = x.concat(getSC()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getArguments()); - - x = x.concat(getSC()); - - x.push(getBlock()); - - return x; - } - - /** - * Check if token is part of an included mixin like `@include nani(foo)` - * @param {Number} i Token's index number - * @returns {Number} Length of the include - */ - function checkInclude2(i) { - var start = i, - l; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - // TODO: Check if extends don't take any arguments - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkArguments(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with included mixin like `@include nani(foo)` - * @returns {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, - * ['arguments', z], sc]` where `x` is `include` or `extend`, `y` is - * mixin's identifier (selector), `z` are arguments passed to the - * mixin and `sc` are optional whitespaces - */ - function getInclude2() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getAtkeyword()); - - x = x.concat(getSC()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getArguments()); - - return x; - } - - /** - * Check if token is part of an included mixin with a content block passed - * as an argument (e.g. `@include nani {...}`) - * @param {Number} i Token's index number - * @returns {Number} Length of the mixin - */ - function checkInclude3(i) { - var start = i, - l; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with an included mixin with a content block passed - * as an argument (e.g. `@include nani {...}`) - * @returns {Array} `['include', x]` - */ - function getInclude3() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getAtkeyword()); - - x = x.concat(getSC()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getBlock()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInclude4(i) { - var start = i, - l; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - return i - start; - } - - /** - * @returns {Array} `['include', x]` - */ - function getInclude4() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getAtkeyword()); - - x = x.concat(getSC()); - - x.push(getIncludeSelector()); - - return x; - } - - /** - * Check if token is part of an included mixin like `+nani(foo) {...}` - * @param {Number} i Token's index number - * @returns {Number} Length of the include - */ - function checkInclude5(i) { - var start = i, - l; - - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkArguments(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * Get node with included mixin like `+nani(foo) {...}` - * @returns {Array} `['include', ['operator', '+'], ['selector', x], sc, - * ['arguments', y], sc, ['block', z], sc` where `x` is - * mixin's identifier (selector), `y` are arguments passed to the - * mixin, `z` is block passed to mixin and `sc` are optional whitespaces - */ - function getInclude5() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getOperator()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getArguments()); - - x = x.concat(getSC()); - - x.push(getBlock()); - - x = x.concat(getSC()); - - return x; - } - - /** - * Check if token is part of an included mixin like `+nani(foo)` - * @param {Number} i Token's index number - * @returns {Number} Length of the include - */ - function checkInclude6(i) { - var start = i, - l; - - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkArguments(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * Get node with included mixin like `+nani(foo)` - * @returns {Array} `['include', ['operator', '+'], ['selector', y], sc, - * ['arguments', z], sc]` where `y` is - * mixin's identifier (selector), `z` are arguments passed to the - * mixin and `sc` are optional whitespaces - */ - function getInclude6() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getOperator()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getArguments()); - - x = x.concat(getSC()); - - return x; - } - - /** - * Check if token is part of an included mixin with a content block passed - * as an argument (e.g. `+nani {...}`) - * @param {Number} i Token's index number - * @returns {Number} Length of the mixin - */ - function checkInclude7(i) { - var start = i, - l; - - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * Get node with an included mixin with a content block passed - * as an argument (e.g. `+nani {...}`) - * @returns {Array} `['include', x]` - */ - function getInclude7() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getOperator()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getBlock()); - - x = x.concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInclude8(i) { - var start = i, - l; - - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - return i - start; - } - - /** - * @returns {Array} `['include', x]` - */ - function getInclude8() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getOperator()); - - x.push(getIncludeSelector()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkIncludeSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector2(i)) i += l; - else break; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getIncludeSelector() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - - while (pos < tokensLength && checkSimpleSelector2(pos)) { - t = getSimpleSelector2(); - - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * Check if token is part of an interpolated variable (e.g. `#{$nani}`). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInterpolation(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[i].type !== TokenType.NumberSign || - !tokens[i + 1] || - tokens[i + 1].type !== TokenType.LeftCurlyBracket) return 0; - - i += 2; - - if (l = checkVariable(i)) i += l; - else return 0; - - return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0; - } - - /** - * Get node with an interpolated variable - * @returns {Array} `['interpolation', x]` - */ - function getInterpolation() { - var startPos = pos, - x = [NodeType.InterpolationType]; - - // Skip `#{`: - pos += 2; - - x.push(getVariable()); - - // Skip `}`: - pos++; - - return x; - } - - /** - * Check if token is part of a loop. - * @param {Number} i Token's index number - * @returns {Number} Length of the loop - */ - function checkLoop(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (['for', 'each', 'while'].indexOf(tokens[start + 1].value) < 0) return 0; - - while (i < tokensLength) { - if (l = checkBlock(i)) { - i += l; - break; - } else if (l = checkVariable(i) || - checkNumber(i) || - checkIdent(i) || - checkSC(i) || - checkOperator(i) || - checkCombinator(i) || - checkString(i)) i += l; - else return 0; - } - - return i - start; - } - - /** - * Get node with a loop. - * @returns {Array} `['loop', x]` - */ - function getLoop() { - var startPos = pos, - x = [NodeType.LoopType]; - - x.push(getAtkeyword()); - - while (pos < tokensLength) { - if (checkBlock(pos)) { - x.push(getBlock()); - break; - } - else if (checkVariable(pos)) x.push(getVariable()); - else if (checkNumber(pos)) x.push(getNumber()); - else if (checkIdent(pos)) x.push(getIdent()); - else if (checkOperator(pos)) x.push(getOperator()); - else if (checkCombinator(pos)) x.push(getCombinator()); - else if (checkSC(pos)) x = x.concat(getSC()); - else if (checkString(pos)) x.push(getString()); - } - - return x; - } - - /** - * Check if token is part of a mixin - * @param {Number} i Token's index number - * @returns {Number} Length of the mixin - */ - function checkMixin(i) { - return checkMixin1(i) || checkMixin2(i); - } - - /** - * Get node with a mixin - * @returns {Array} `['mixin', x]` - */ - function getMixin() { - return checkMixin1(pos) ? getMixin1() : getMixin2(); - } - - /** - * Check if token is part of a mixin - * @param {Number} i Token's index number - * @returns {Number} Length of the mixin - */ - function checkMixin1(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if ((l = checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else { - if (l = checkArguments(i)) i += l; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - } - - return i - start; - } - - /** - * Get node with a mixin - * @returns {Array} `['mixin', x]` - */ - function getMixin1() { - var startPos = pos, - x = [NodeType.MixinType, getAtkeyword()]; - - x = x.concat(getSC()); - - if (checkIdent(pos)) x.push(getIdent()); - - x = x.concat(getSC()); - - if (checkBlock(pos)) x.push(getBlock()); - else { - if (checkArguments(pos)) x.push(getArguments()); - - x = x.concat(getSC()); - - x.push(getBlock()); - } - - return x; - } - - /** - * Check if token is part of a mixin - * @param {Number} i Token's index number - * @returns {Number} Length of the mixin - */ - function checkMixin2(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[i].type === TokenType.EqualsSign) i++; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else { - if (l = checkArguments(i)) i += l; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - } - - return i - start; - } - - /** - * Get node with a mixin - * @returns {Array} `['mixin', x]` - */ - function getMixin2() { - var startPos = pos, - x = [NodeType.MixinType, getOperator()]; - - x = x.concat(getSC()); - - if (checkIdent(pos)) x.push(getIdent()); - - x = x.concat(getSC()); - - if (checkBlock(pos)) x.push(getBlock()); - else { - if (checkArguments(pos)) x.push(getArguments()); - - x = x.concat(getSC()); - - x.push(getBlock()); - } - - return x; - } - - /** - * Check if token is a namespace sign (`|`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is `|`, `0` if not - */ - function checkNamespace(i) { - return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0; - } - - /** - * Get node with a namespace sign - * @returns {Array} `['namespace']` - */ - function getNamespace() { - var startPos = pos, - x = [NodeType.NamespaceType]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNmName(i) { - var start = i; - - if (i >= tokensLength) return 0; - - // start char / word - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.LowLine || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DecimalNumber) i++; - else return 0; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier && - tokens[i].type !== TokenType.DecimalNumber) break; - } - - tokens[start].nm_name_last = i - 1; - - return i - start; - } - - /** - * @returns {String} - */ - function getNmName() { - var s = joinValues(pos, tokens[pos].nm_name_last); - - pos = tokens[pos].nm_name_last + 1; - - return s; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNmName2(i) { - if (tokens[i].type === TokenType.Identifier) return 1; - else if (tokens[i].type !== TokenType.DecimalNumber) return 0; - - i++; - - return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1; - } - - /** - * @returns {String} - */ - function getNmName2() { - var s = tokens[pos].value; - - if (tokens[pos++].type === TokenType.DecimalNumber && - pos < tokensLength && - tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value; - - return s; - } - - /** - * Check if token is part of an nth-selector's identifier (e.g. `2n+1`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth(i) { - if (i >= tokensLength) return 0; - - return checkNth1(i) || checkNth2(i); - } - - /** - * Check if token is part of an nth-selector's identifier in the form of - * sequence of decimals and n-s (e.g. `3`, `n`, `2n+1`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth1(i) { - var start = i; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.DecimalNumber && - tokens[i].value !== 'n') break; - } - - if (i !== start) tokens[start].nth_last = i - 1; - - return i - start; - } - - /** - * Get node for nth-selector's identifier (e.g. `2n+1`) - * @returns {Array} `['nth', x]` where `x` is identifier's text - */ - function getNth() { - var startPos = pos, - x = [NodeType.NthType]; - - if (tokens[pos].nth_last) { - x.push(joinValues(pos, tokens[pos].nth_last)); - pos = tokens[pos].nth_last + 1; - } else { - x.push(tokens[pos++].value); - } - - return x; - } - - /** - * Check if token is part of `even` or `odd` nth-selector's identifier - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth2(i) { - return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNthf(i) { - var start = i, - l = 0; - - if (tokens[i++].type !== TokenType.Colon) return 0; - - // There was `:`: - l++; - - if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0; - - // There was either `nth-` or `last-`: - l += 2; - - if ('child' === tokens[i].value) { - l += 1; - } else if ('last-child' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('last-of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value + - tokens[i + 3].value + - tokens[i + 4].value) { - l += 5; - } else return 0; - - tokens[start + 1].nthf_last = start + l - 1; - - return l; - } - - /** - * @returns {String} - */ - function getNthf() { - pos++; - - var s = joinValues(pos, tokens[pos].nthf_last); - - pos = tokens[pos].nthf_last + 1; - - return s; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNthselector(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkNthf(i)) i += l; - else return 0; - - if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0; - - l++; - - var rp = tokens[i++].right; - - while (i < rp) { - if (l = checkSC(i) || - checkUnary(i) || - checkInterpolation(i) || - checkNth(i)) i += l; - else return 0; - } - - return rp - start + 1; - } - - /** - * @returns {Array} - */ - function getNthselector() { - var startPos = pos, - nthf = [NodeType.IdentType, getNthf()], - x = [NodeType.NthselectorType]; - - x.push(nthf); - - pos++; - - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkUnary(pos)) x.push(getUnary()); - else if (checkInterpolation(pos)) x.push(getInterpolation()); - else if (checkNth(pos)) x.push(getNth()); - } - - pos++; - - return x; - } - - /** - * Check if token is part of a number - * @param {Number} i Token's index number - * @returns {Number} Length of number - */ - function checkNumber(i) { - if (i >= tokensLength) return 0; - - if (tokens[i].number_l) return tokens[i].number_l; - - // `10`: - if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && - (!tokens[i + 1] || - (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) - return (tokens[i].number_l = 1, tokens[i].number_l); - - // `10.`: - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber))) - return (tokens[i].number_l = 2, tokens[i].number_l); - - // `.10`: - if (i < tokensLength && - tokens[i].type === TokenType.FullStop && - tokens[i + 1].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 2, tokens[i].number_l); - - // `10.10`: - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 3, tokens[i].number_l); - - return 0; - } - - /** - * Get node with number - * @returns {Array} `['number', x]` where `x` is a number converted - * to string. - */ - function getNumber() { - var s = '', - startPos = pos, - l = tokens[pos].number_l, - x = [NodeType.NumberType]; - - for (var j = 0; j < l; j++) { - s += tokens[pos + j].value; - } - - pos += l; - - x.push(s); - - return x; - } - - /** - * Check if token is an operator (`/`, `,`, `:` or `=`). - * @param {Number} i Token's index number - * @returns {Number} `1` if token is an operator, otherwise `0` - */ - function checkOperator(i) { - if (i >= tokensLength) return 0; - - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - case TokenType.LessThanSign: - case TokenType.GreaterThanSign: - case TokenType.Asterisk: - return 1; - } - - return 0; - } - - /** - * Get node with an operator - * @returns {Array} `['operator', x]` where `x` is an operator converted - * to string. - */ - function getOperator() { - var startPos = pos, - x = [NodeType.OperatorType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is a parent selector (`&`). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkParentSelector(i) { - return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0; - } - - /** - * Get node with a parent selector - * @returns {Array} `['parentSelector']` - */ - function getParentSelector() { - var startPos = pos, - x = [NodeType.ParentSelectorType, '&']; - - pos++; - - return x; - } - - /** - * Check if token is part of a number with percent sign (e.g. `10%`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPercentage(i) { - var x; - - if (i >= tokensLength) return 0; - - x = checkNumber(i); - - if (!x || i + x >= tokensLength) return 0; - - return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0; - } - - /** - * Get node of number with percent sign - * @returns {Array} `['percentage', ['number', x]]` where `x` is a number - * (without percent sign) converted to string. - */ - function getPercentage() { - var startPos = pos, - x = [NodeType.PercentageType, getNumber()]; - - pos++; - - return x; - } - - /** - * Check if token is part of a placeholder selector (e.g. `%abc`). - * @param {Number} i Token's index number - * @returns {Number} Length of the selector - */ - function checkPlaceholder(i) { - var l; - - if (i >= tokensLength) return 0; - - if (tokens[i].placeholder_l) return tokens[i].placeholder_l; - - if (tokens[i].type === TokenType.PercentSign && (l = checkIdent(i + 1))) { - tokens[i].placeholder_l = l + 1; - return l + 1; - } else return 0; - } - - /** - * Get node with a placeholder selector - * @returns {Array} `['placeholder', ['ident', x]]` where x is a placeholder's - * identifier (without `%`, e.g. `abc`). - */ - function getPlaceholder() { - var startPos = pos, - x = [NodeType.PlaceholderType]; - - pos++; - - x.push(getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkProgid(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6; - else return 0; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (tokens[i].type === TokenType.LeftParenthesis) { - tokens[start].progid_end = tokens[i].right; - i = tokens[i].right + 1; - } else return 0; - - return i - start; - } - - /** - * @returns {Array} - */ - function getProgid() { - var startPos = pos, - progid_end = tokens[pos].progid_end, - x; - - x = [NodeType.ProgidType] - .concat(getSC()) - .concat([_getProgid(progid_end)]); - - return x; - } - - /** - * @param {Number} progid_end - * @returns {Array} - */ - function _getProgid(progid_end) { - var startPos = pos, - x = [NodeType.RawType, joinValues(pos, progid_end)]; - - pos = progid_end + 1; - - return x; - } - - /** - * Check if token is part of a property - * @param {Number} i Token's index number - * @returns {Number} Length of the property - */ - function checkProperty(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkVariable(i) || checkIdent(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a property - * @returns {Array} `['property', x]` - */ - function getProperty() { - var startPos = pos, - x = [NodeType.PropertyType]; - - x.push(checkVariable(pos) ? getVariable() : getIdent()); - - return x; - } - - /** - * Check if token is a colon - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a colon, otherwise `0` - */ - function checkPropertyDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0; - } - - /** - * Get node with a colon - * @returns {Array} `['propertyDelim']` - */ - function getPropertyDelim() { - var startPos = pos, - x = [NodeType.PropertyDelimType]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudo(i) { - return checkPseudoe(i) || - checkPseudoc(i); - } - - /** - * @returns {Array} - */ - function getPseudo() { - if (checkPseudoe(pos)) return getPseudoe(); - if (checkPseudoc(pos)) return getPseudoc(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudoe(i) { - var l; - - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - - return (l = checkInterpolation(i) || checkIdent(i)) ? l + 2 : 0; - } - - /** - * @returns {Array} - */ - function getPseudoe() { - var startPos = pos, - x = [NodeType.PseudoeType]; - - pos += 2; - - x.push(checkInterpolation(pos) ? getInterpolation() : getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudoc(i) { - var l; - - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - - return (l = checkInterpolation(i) || checkFunction(i) || checkIdent(i)) ? l + 1 : 0; - } - - /** - * @returns {Array} - */ - function getPseudoc() { - var startPos = pos, - x = [NodeType.PseudocType]; - - pos ++; - - if (checkInterpolation(pos)) x.push(getInterpolation()); - else if (checkFunction(pos)) x.push(getFunction()); - else x.push(getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkRuleset(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[start].ruleset_l) return tokens[start].ruleset_l; - - while (i < tokensLength) { - if (l = checkBlock(i)) {i += l; break;} - else if (l = checkSelector(i)) i += l; - else return 0; - } - - tokens[start].ruleset_l = i - start; - - return i - start; - } - - /** - * @returns {Array} - */ - function getRuleset() { - var startPos = pos, - x = [NodeType.RulesetType]; - - while (pos < tokensLength) { - if (checkBlock(pos)) {x.push(getBlock()); break;} - else if (checkSelector(pos)) x.push(getSelector()); - else break; - } - - return x; - } - - /** - * Check if token is marked as a space (if it's a space or a tab - * or a line break). - * @param i - * @returns {Number} Number of spaces in a row starting with the given token. - */ - function checkS(i) { - return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0; - } - - /** - * Get node with spaces - * @returns {Array} `['s', x]` where `x` is a string containing spaces - */ - function getS() { - var startPos = pos, - x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)]; - - pos = tokens[pos].ws_last + 1; - - return x; - } - - /** - * Check if token is a space or a comment. - * @param {Number} i Token's index number - * @returns {Number} Number of similar (space or comment) tokens - * in a row starting with the given token. - */ - function checkSC(i) { - if (!tokens[i]) return 0; - - var l, - lsc = 0, - ln = tokens[i].ln; - - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - - if (!(l = checkS(i)) && - !(l = checkCommentML(i)) && - !(l = checkCommentSL(i))) break; - - i += l; - lsc += l; - } - - return lsc || 0; - } - - /** - * Get node with spaces and comments - * @returns {Array} Array containing nodes with spaces (if there are any) - * and nodes with comments (if there are any): - * `[['s', x]*, ['comment', y]*]` where `x` is a string of spaces - * and `y` is a comment's text (without `/*` and `* /`). - */ - function getSC() { - var sc = [], - ln; - - if (pos >= tokensLength) return sc; - - ln = tokens[pos].ln; - - while (pos < tokensLength) { - if (tokens[pos].ln !== ln) break; - else if (checkS(pos)) sc.push(getS()); - else if (checkCommentML(pos)) sc.push(getCommentML()); - else if (checkCommentSL(pos)) sc.push(getCommentSL()); - else break; - } - - return sc; - } - - /** - * Check if token is part of a selector - * @param {Number} i Token's index number - * @returns {Number} Length of the selector - */ - function checkSelector(i) { - var start = i, - l, ln; - - if (i >= tokensLength) return 0; - - ln = tokens[i].ln; - - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - - if ((l = checkDeclDelim(i) && checkBlock(i + l)) || checkSC(i)) i += l; - - if (l = checkSimpleSelector(i) || checkDelim(i)) i += l; - else break; - } - - tokens[start].selector_end = i - 1; - - return i - start; - } - - /** - * @returns {Array} - */ - function getSelector() { - var startPos = pos, - x = [NodeType.SelectorType], - selector_end = tokens[pos].selector_end, - ln = tokens[pos].ln; - - while (pos <= selector_end) { - if (tokens[pos].ln !== ln) break; - - if ((l = checkDeclDelim(pos)) && checkBlock(pos + l)) x.push(getDeclDelim()); - else if (checkSC(pos)) x = x.concat(getSC()); - - x.push(checkDelim(pos) ? getDelim() : getSimpleSelector()); - } - - return x; - } - - /** - * Check if token is part of a hexadecimal number (e.g. `#fff`) inside - * a simple selector - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkShash(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - - return (l = checkNmName(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a hexadecimal number (e.g. `#fff`) inside a simple - * selector - * @returns {Array} `['shash', x]` where `x` is a hexadecimal number - * converted to string (without `#`, e.g. `fff`) - */ - function getShash() { - var startPos = pos, - x = [NodeType.ShashType]; - - pos++; - - x.push(getNmName()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector(i) { - if (i >= tokensLength) return 0; - - var start = i, - l, - ln = tokens[i].ln; - - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - - if (l = checkSimpleSelector1(i)) i += l; - else break; - } - - return (i - start) || 0; - } - - /** - * @returns {Array} - */ - function getSimpleSelector() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t, - ln = tokens[pos].ln; - - while (pos < tokensLength) { - if (tokens[pos].ln !== ln || - !checkSimpleSelector1(pos)) break; - - t = getSimpleSelector1(); - - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector1(i) { - return checkParentSelector(i) || - checkNthselector(i) || - checkCombinator(i) || - checkAttrib(i) || - checkPseudo(i) || - checkShash(i) || - checkAny(i) || - checkSC(i) || - checkNamespace(i); - } - - /** - * @returns {Array} - */ - function getSimpleSelector1() { - if (checkParentSelector(pos)) return getParentSelector(); - else if (checkNthselector(pos)) return getNthselector(); - else if (checkCombinator(pos)) return getCombinator(); - else if (checkAttrib(pos)) return getAttrib(); - else if (checkPseudo(pos)) return getPseudo(); - else if (checkShash(pos)) return getShash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkNamespace(pos)) return getNamespace(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector2(i) { - return checkParentSelector(i) || - checkNthselector(i) || - checkAttrib(i) || - checkPseudo(i) || - checkShash(i) || - checkPlaceholder(i) || - checkIdent(i) || - checkClass(i); - } - - /** - * @returns {Array} - */ - function getSimpleSelector2() { - if (checkParentSelector(pos)) return getParentSelector(); - else if (checkNthselector(pos)) return getNthselector(); - else if (checkAttrib(pos)) return getAttrib(); - else if (checkPseudo(pos)) return getPseudo(); - else if (checkShash(pos)) return getShash(); - else if (checkPlaceholder(pos)) return getPlaceholder(); - else if (checkIdent(pos)) return getIdent(); - else if (checkClass(pos)) return getClass(); - } - - /** - * Check if token is part of a string (text wrapped in quotes) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is part of a string, `0` if not - */ - function checkString(i) { - return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0; - } - - /** - * Get string's node - * @returns {Array} `['string', x]` where `x` is a string (including - * quotes). - */ - function getString() { - var startPos = pos, - x = [NodeType.StringType, tokens[pos++].value]; - - return x; - } - - /** - * Validate stylesheet: it should consist of any number (0 or more) of - * rulesets (sets of rules with selectors), @-rules, whitespaces or - * comments. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkStylesheet(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSC(i) || - checkDeclaration(i) || - checkDeclDelim(i) || - checkInclude(i) || - checkMixin(i) || - checkLoop(i) || - checkConditionalStatement(i) || - checkAtrule(i) || - checkRuleset(i)) i += l; - else throwError(i); - } - - return i - start; - } - - /** - * @returns {Array} `['stylesheet', x]` where `x` is all stylesheet's - * nodes. - */ - function getStylesheet() { - var startPos = pos, - x = [NodeType.StylesheetType]; - - while (pos < tokensLength) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkRuleset(pos)) x.push(getRuleset()); - else if (checkInclude(pos)) x.push(getInclude()); - else if (checkMixin(pos)) x.push(getMixin()); - else if (checkLoop(pos)) x.push(getLoop()); - else if (checkConditionalStatement(pos)) x.push(getConditionalStatement()); - else if (checkAtrule(pos)) x.push(getAtrule()); - else if (checkDeclaration(pos)) x.push(getDeclaration()); - else if (checkDeclDelim(pos)) x.push(getDeclDelim()); - else throwError(); - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkTset(i) { - return checkVhash(i) || - checkAny(i) || - checkSC(i) || - checkOperator(i); - } - - /** - * @returns {Array} - */ - function getTset() { - if (checkVhash(pos)) return getVhash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkOperator(pos)) return getOperator(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkTsets(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - while (tokens[i - 1].type !== TokenType.Newline && - (l = checkTset(i))) { - i += l; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getTsets() { - var x = [], - t; - - while (tokens[pos - 1].type !== TokenType.Newline && - (t = getTset())) { - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * Check if token is an unary (arithmetical) sign (`+` or `-`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is an unary sign, `0` if not - */ - function checkUnary(i) { - return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0; - } - - /** - * Get node with an unary (arithmetical) sign (`+` or `-`) - * @returns {Array} `['unary', x]` where `x` is an unary sign - * converted to string. - */ - function getUnary() { - var startPos = pos, - x = [NodeType.UnaryType, tokens[pos++].value]; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkUnknown(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - } - - /** - * @returns {Array} - */ - function getUnknown() { - var startPos = pos, - x = [NodeType.UnknownType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is part of URI (e.g. `url('/css/styles.css')`) - * @param {Number} i Token's index number - * @returns {Number} Length of URI - */ - function checkUri(i) { - var start = i; - - if (i >= tokensLength || tokens[i++].value !== 'url' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) - return 0; - - return tokens[i].right - start + 1; - } - - /** - * Get node with URI - * @returns {Array} `['uri', x]` where `x` is URI's nodes (without `url` - * and braces, e.g. `['string', ''/css/styles.css'']`). - */ - function getUri() { - var startPos = pos, - uriExcluding = {}, - uri, - l, - raw; - - pos += 2; - - uriExcluding[TokenType.Space] = 1; - uriExcluding[TokenType.Tab] = 1; - uriExcluding[TokenType.Newline] = 1; - uriExcluding[TokenType.LeftParenthesis] = 1; - uriExcluding[TokenType.RightParenthesis] = 1; - - if (checkUri1(pos)) { - uri = [NodeType.UriType] - .concat(getSC()) - .concat([getString()]) - .concat(getSC()); - - pos++; - } else { - uri = [NodeType.UriType].concat(getSC()), - l = checkExcluding(uriExcluding, pos), - raw = [NodeType.RawType, joinValues(pos, pos + l)]; - - uri.push(raw); - - pos += l + 1; - - uri = uri.concat(getSC()); - - pos++; - } - - return uri; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkUri1(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0; - - i++; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * Check if token is part of a value - * @param {Number} i Token's index number - * @returns {Number} Length of the value - */ - function checkValue(i) { - var start = i, - l, s, _i; - - while (i < tokensLength) { - if (checkDeclDelim(i)) break; - - if (l = checkBlock(i)) { - i += l; - break; - } - - s = checkS(i); - _i = i + s; - - if (l = _checkValue(_i)) i += l + s; - if (!l || checkBlock(i - l)) break; - } - - return i - start; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function _checkValue(i) { - return checkVhash(i) || - checkAny(i) || - checkOperator(i) || - checkImportant(i) || - checkDefault(i); - } - - /** - * @returns {Array} - */ - function getValue() { - var startPos = pos, - x = [NodeType.ValueType], - t, _pos, s; - - while (pos < tokensLength) { - s = checkS(pos); - _pos = pos + s; - - if (checkDeclDelim(_pos)) break; - - if (checkBlock(pos)) { - x.push(getBlock()); - break; - } - - if (!_checkValue(_pos)) break; - - if (s) x.push(getS()); - x.push(_getValue()); - - if (checkBlock(_pos)) break; - } - - return x; - } - - /** - * @returns {Array} - */ - function _getValue() { - if (checkVhash(pos)) return getVhash(); - if (checkAny(pos)) return getAny(); - if (checkOperator(pos)) return getOperator(); - if (checkImportant(pos)) return getImportant(); - if (checkDefault(pos)) return getDefault(); - } - - /** - * Check if token is part of a variable - * @param {Number} i Token's index number - * @returns {Number} Length of the variable - */ - function checkVariable(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.DollarSign) return 0; - - return (l = checkIdent(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a variable - * @returns {Array} `['variable', ['ident', x]]` where `x` is - * a variable name. - */ - function getVariable() { - var startPos = pos, - x = [NodeType.VariableType]; - - pos++; - - x.push(getIdent()); - - return x; - } - - /** - * Check if token is part of a variables list (e.g. `$values...`). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkVariablesList(i) { - var d = 0, // number of dots - l; - - if (i >= tokensLength) return 0; - - if (l = checkVariable(i)) i+= l; - else return 0; - - while (i < tokensLength && tokens[i].type === TokenType.FullStop) { - d++; - i++; - } - - return d === 3 ? l + d : 0; - } - - /** - * Get node with a variables list - * @returns {Array} `['variableslist', ['variable', ['ident', x]]]` where - * `x` is a variable name. - */ - function getVariablesList() { - var startPos = pos, - x = [NodeType.VariablesListType, getVariable()]; - - pos += 3; - - return x; - } - - /** - * Check if token is part of a hexadecimal number (e.g. `#fff`) inside - * some value - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkVhash(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - - return (l = checkNmName2(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a hexadecimal number (e.g. `#fff`) inside some value - * @returns {Array} `['vhash', x]` where `x` is a hexadecimal number - * converted to string (without `#`, e.g. `'fff'`). - */ - function getVhash() { - var startPos = pos, - x = [NodeType.VhashType]; - - pos++; - - x.push(getNmName2()); - - return x; - } - - return function(_tokens, rule) { - tokens = _tokens; - tokensLength = tokens.length; - pos = 0; - - return rules[rule](); - }; -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/stringify.js deleted file mode 100644 index a1d05c5..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/stringify.js +++ /dev/null @@ -1,117 +0,0 @@ -module.exports = function stringify(tree) { - // TODO: Better error message - if (!tree) throw new Error('We need tree to translate'); - - var _m_simple = { - 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1, - 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1 - }, - _m_composite = { - 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, - 'conditionalStatement': 1, - 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1, - 'ident': 1, 'include': 1, - 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1, - 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 - }, - _m_primitive = { - 'declDelim': '\n', 'delim': ',', - 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' - }; - - function _t(tree) { - var t = tree[0]; - if (t in _m_primitive) return _m_primitive[t]; - else if (t in _m_simple) return _simple(tree); - else if (t in _m_composite) return _composite(tree); - return _unique[t](tree); - } - - function _composite(t, i) { - var s = ''; - i = i === undefined ? 1 : i; - for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); - return s; - } - - function _simple(t) { - return t[1]; - } - - var _unique = { - 'arguments': function(t) { - return '(' + _composite(t) + ')'; - }, - 'atkeyword': function(t) { - return '@' + _t(t[1]); - }, - 'atruler': function(t) { - return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}'; - }, - 'attrib': function(t) { - return '[' + _composite(t) + ']'; - }, - 'block': function(t) { - return _composite(t); - }, - 'braces': function(t) { - return t[1] + _composite(t, 3) + t[2]; - }, - 'class': function(t) { - return '.' + _t(t[1]); - }, - 'commentML': function (t) { - return '/*' + t[1]; - }, - 'commentSL': function (t) { - return '/' + '/' + t[1]; - }, - 'default': function(t) { - return '!' + _composite(t) + 'default'; - }, - 'filter': function(t) { - return _t(t[1]) + ':' + _t(t[2]); - }, - 'functionExpression': function(t) { - return 'expression(' + t[1] + ')'; - }, - 'important': function(t) { - return '!' + _composite(t) + 'important'; - }, - 'interpolation': function(t) { - return '#{' + _t(t[1]) + '}'; - }, - 'nthselector': function(t) { - return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')'; - }, - 'percentage': function(t) { - return _t(t[1]) + '%'; - }, - 'placeholder': function(t) { - return '%' + _t(t[1]); - }, - 'pseudoc': function(t) { - return ':' + _t(t[1]); - }, - 'pseudoe': function(t) { - return '::' + _t(t[1]); - }, - 'shash': function (t) { - return '#' + t[1]; - }, - 'uri': function(t) { - return 'url(' + _composite(t) + ')'; - }, - 'variable': function(t) { - return '$' + _t(t[1]); - }, - 'variableslist': function(t) { - return _t(t[1]) + '...'; - }, - 'vhash': function(t) { - return '#' + t[1]; - } - }; - - return _t(tree); -} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/tokenizer.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/tokenizer.js deleted file mode 100644 index 9416772..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/sass/tokenizer.js +++ /dev/null @@ -1,296 +0,0 @@ -module.exports = function(css) { - var TokenType = require('../token-types'); - - var tokens = [], - urlMode = false, - blockMode = 0, - c, // current character - cn, // next character - pos = 0, - tn = 0, - ln = 1; - - var Punctuation = { - ' ': TokenType.Space, - '\n': TokenType.Newline, - '\r': TokenType.Newline, - '\t': TokenType.Tab, - '!': TokenType.ExclamationMark, - '"': TokenType.QuotationMark, - '#': TokenType.NumberSign, - '$': TokenType.DollarSign, - '%': TokenType.PercentSign, - '&': TokenType.Ampersand, - '\'': TokenType.Apostrophe, - '(': TokenType.LeftParenthesis, - ')': TokenType.RightParenthesis, - '*': TokenType.Asterisk, - '+': TokenType.PlusSign, - ',': TokenType.Comma, - '-': TokenType.HyphenMinus, - '.': TokenType.FullStop, - '/': TokenType.Solidus, - ':': TokenType.Colon, - ';': TokenType.Semicolon, - '<': TokenType.LessThanSign, - '=': TokenType.EqualsSign, - '>': TokenType.GreaterThanSign, - '?': TokenType.QuestionMark, - '@': TokenType.CommercialAt, - '[': TokenType.LeftSquareBracket, - ']': TokenType.RightSquareBracket, - '^': TokenType.CircumflexAccent, - '_': TokenType.LowLine, - '{': TokenType.LeftCurlyBracket, - '|': TokenType.VerticalLine, - '}': TokenType.RightCurlyBracket, - '~': TokenType.Tilde - }; - - /** - * Add a token to the token list - * @param {string} type - * @param {string} value - */ - function pushToken(type, value) { - tokens.push({ tn: tn++, ln: ln, type: type, value: value }); - } - - /** - * Check if a character is a decimal digit - * @param {string} c Character - * @returns {boolean} - */ - function isDecimalDigit(c) { - return '0123456789'.indexOf(c) >= 0; - } - - /** - * Parse spaces - * @param {string} css Unparsed part of CSS string - */ - function parseSpaces(css) { - var start = pos; - - // Read the string until we meet a non-space character: - for (; pos < css.length; pos++) { - if (css.charAt(pos) !== ' ') break; - } - - // Add a substring containing only spaces to tokens: - pushToken(TokenType.Space, css.substring(start, pos)); - pos--; - } - - /** - * Parse a string within quotes - * @param {string} css Unparsed part of CSS string - * @param {string} q Quote (either `'` or `"`) - */ - function parseString(css, q) { - var start = pos; - - // Read the string until we meet a matching quote: - for (pos = pos + 1; pos < css.length; pos++) { - // Skip escaped quotes: - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) === q) break; - } - - // Add the string (including quotes) to tokens: - pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1)); - } - - /** - * Parse numbers - * @param {string} css Unparsed part of CSS string - */ - function parseDecimalNumber(css) { - var start = pos; - - // Read the string until we meet a character that's not a digit: - for (; pos < css.length; pos++) { - if (!isDecimalDigit(css.charAt(pos))) break; - } - - // Add the number to tokens: - pushToken(TokenType.DecimalNumber, css.substring(start, pos)); - pos--; - } - - /** - * Parse identifier - * @param {string} css Unparsed part of CSS string - */ - function parseIdentifier(css) { - var start = pos; - - // Skip all opening slashes: - while (css.charAt(pos) === '/') pos++; - - // Read the string until we meet a punctuation mark: - for (; pos < css.length; pos++) { - // Skip all '\': - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) in Punctuation) break; - } - - var ident = css.substring(start, pos); - - // Enter url mode if parsed substring is `url`: - urlMode = urlMode || ident === 'url'; - - // Add identifier to tokens: - pushToken(TokenType.Identifier, ident); - pos--; - } - - /** - * Parse a multiline comment - * @param {string} css Unparsed part of CSS string - */ - function parseMLComment(css) { - var start = pos; - - // Get current indent level: - var il = 0; - for (var _pos = pos - 1; _pos > -1; _pos--) { - // TODO: Can be tabs: - if (css.charAt(_pos) === ' ') il++; - else break; - } - - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n') { - // Get new line's indent level: - var _il = 0; - for (var _pos = pos + 1; _pos < css.length; _pos++) { - if (css.charAt(_pos) === ' ') _il++; - else break; - } - - if (_il > il) { - pos = _pos; - } else break; - } - } - - // Add full comment (including `/*`) to the list of tokens: - pushToken(TokenType.CommentML, css.substring(start, pos + 1)); - } - - /** - * Parse a single line comment - * @param {string} css Unparsed part of CSS string - */ - function parseSLComment(css) { - var start = pos; - - // Check if comment is the only token on the line, and if so, - // get current indent level: - var il = 0; - var onlyToken = false; - for (var _pos = pos - 1; _pos > -1; _pos--) { - // TODO: Can be tabs: - if (css.charAt(_pos) === ' ') il++; - else if (css.charAt(_pos) === '\n') { - onlyToken = true; - break; - } else break; - } - if (_pos === -1) onlyToken = true; - - // Read the string until we meet comment end. - // Since we already know first 2 characters (`//`), start reading - // from `pos + 2`: - if (!onlyToken) { - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { - break; - } - } - } else { - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n') { - // Get new line's indent level: - var _il = 0; - for (var _pos = pos + 1; _pos < css.length; _pos++) { - if (css.charAt(_pos) === ' ') _il++; - else break; - } - - if (_il > il) { - pos = _pos; - } else break; - } - } - } - - // Add comment (including `//` and line break) to the list of tokens: - pushToken(TokenType.CommentSL, css.substring(start, pos)); - pos--; - } - - /** - * Convert a CSS string to a list of tokens - * @param {string} css CSS string - * @returns {Array} List of tokens - * @private - */ - function getTokens(css) { - // Parse string, character by character: - for (pos = 0; pos < css.length; pos++) { - c = css.charAt(pos); - cn = css.charAt(pos + 1); - - // If we meet `/*`, it's a start of a multiline comment. - // Parse following characters as a multiline comment: - if (c === '/' && cn === '*') { - parseMLComment(css); - } - - // If we meet `//` and it is not a part of url: - else if (!urlMode && c === '/' && cn === '/') { - // If we're currently inside a block, treat `//` as a start - // of identifier. Else treat `//` as a start of a single-line - // comment: - parseSLComment(css); - } - - // If current character is a double or single quote, it's a start - // of a string: - else if (c === '"' || c === "'") { - parseString(css, c); - } - - // If current character is a space: - else if (c === ' ') { - parseSpaces(css) - } - - // If current character is a punctuation mark: - else if (c in Punctuation) { - // Add it to the list of tokens: - pushToken(Punctuation[c], c); - if (c === '\n' || c === '\r') ln++; // Go to next line - if (c === ')') urlMode = false; // exit url mode - if (c === '{') blockMode++; // enter a block - if (c === '}') blockMode--; // exit a block - } - - // If current character is a decimal digit: - else if (isDecimalDigit(c)) { - parseDecimalNumber(css); - } - - // If current character is anything else: - else { - parseIdentifier(css); - } - } - - return tokens; - } - - return getTokens(css); -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/mark.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/mark.js deleted file mode 100644 index 6d79c0d..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/mark.js +++ /dev/null @@ -1,116 +0,0 @@ -var TokenType = require('../token-types'); - -module.exports = (function() { - /** - * Mark whitespaces and comments - */ - function markSC(tokens) { - var tokensLength = tokens.length, - ws = -1, // flag for whitespaces - sc = -1, // flag for whitespaces and comments - t; // current token - - // For every token in the token list, mark spaces and line breaks - // as spaces (set both `ws` and `sc` flags). Mark multiline comments - // with `sc` flag. - // If there are several spaces or tabs or line breaks or multiline - // comments in a row, group them: take the last one's index number - // and save it to the first token in the group as a reference - // (e.g., `ws_last = 7` for a group of whitespaces or `sc_last = 9` - // for a group of whitespaces and comments): - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - - if (ws === -1) ws = i; - if (sc === -1) sc = i; - - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - t.sc = true; - - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - } - - /** - * Pair brackets - */ - function markBrackets(tokens) { - var tokensLength = tokens.length; - var ps = [], // parenthesis - sbs = [], // square brackets - cbs = [], // curly brackets - t; // current token - - // For every token in the token list, if we meet an opening (left) - // bracket, push its index number to a corresponding array. - // If we then meet a closing (right) bracket, look at the corresponding - // array. If there are any elements (records about previously met - // left brackets), take a token of the last left bracket (take - // the last index number from the array and find a token with - // this index number) and save right bracket's index as a reference: - for (var i = 0; i < tokens.length; i++) { - t = tokens[i]; - switch(t.type) { - case TokenType.LeftParenthesis: - ps.push(i); - break; - case TokenType.RightParenthesis: - if (ps.length) { - t.left = ps.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftSquareBracket: - sbs.push(i); - break; - case TokenType.RightSquareBracket: - if (sbs.length) { - t.left = sbs.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftCurlyBracket: - cbs.push(i); - break; - case TokenType.RightCurlyBracket: - if (cbs.length) { - t.left = cbs.pop(); - tokens[t.left].right = i; - } - break; - } - } - } - - return function(tokens) { - markBrackets(tokens); - markSC(tokens); - } -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/node-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/node-types.js deleted file mode 100644 index 3118be2..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/node-types.js +++ /dev/null @@ -1,61 +0,0 @@ -module.exports = { - ArgumentsType: 'arguments', - AtkeywordType: 'atkeyword', - AtrulebType: 'atruleb', - AtrulerType: 'atruler', - AtrulerqType: 'atrulerq', - AtrulersType: 'atrulers', - AtrulesType: 'atrules', - AttribType: 'attrib', - AttrselectorType: 'attrselector', - BlockType: 'block', - BracesType: 'braces', - ClassType: 'class', - CombinatorType: 'combinator', - CommentMLType: 'commentML', - CommentSLType: 'commentSL', - ConditionType: 'condition', - ConditionalStatementType: 'conditionalStatement', - DeclarationType: 'declaration', - DeclDelimType: 'declDelim', - DefaultType: 'default', - DelimType: 'delim', - DimensionType: 'dimension', - FilterType: 'filter', - FiltervType: 'filterv', - FunctionType: 'function', - FunctionExpressionType: 'functionExpression', - IdentType: 'ident', - ImportantType: 'important', - IncludeType :'include', - InterpolationType: 'interpolation', - LoopType: 'loop', - MixinType: 'mixin', - NamespaceType: 'namespace', - NthType: 'nth', - NthselectorType: 'nthselector', - NumberType: 'number', - OperatorType: 'operator', - ParentSelectorType: 'parentselector', - PercentageType: 'percentage', - PlaceholderType: 'placeholder', - ProgidType: 'progid', - PropertyType: 'property', - PropertyDelimType: 'propertyDelim', - PseudocType: 'pseudoc', - PseudoeType: 'pseudoe', - RawType: 'raw', - RulesetType: 'ruleset', - SType: 's', - SelectorType: 'selector', - ShashType: 'shash', - SimpleselectorType: 'simpleselector', - StringType: 'string', - StylesheetType: 'stylesheet', - UnaryType: 'unary', - UriType: 'uri', - ValueType: 'value', - VariableType: 'variable', - VariablesListType: 'variableslist', - VhashType: 'vhash' -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/rules.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/rules.js deleted file mode 100644 index 9c0d7c6..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/rules.js +++ /dev/null @@ -1,3447 +0,0 @@ -var TokenType = require('../token-types'); -var NodeType = require('./node-types'); - -module.exports = (function() { - var tokens, tokensLength, pos; - - var rules = { - 'arguments': function() { return checkArguments(pos) && getArguments(); }, - 'atkeyword': function() { return checkAtkeyword(pos) && getAtkeyword(); }, - 'atruleb': function() { return checkAtruleb(pos) && getAtruleb(); }, - 'atruler': function() { return checkAtruler(pos) && getAtruler(); }, - 'atrulerq': function() { return checkAtrulerq(pos) && getAtrulerq(); }, - 'atrulers': function() { return checkAtrulers(pos) && getAtrulers(); }, - 'atrules': function() { return checkAtrules(pos) && getAtrules(); }, - 'attrib': function() { return checkAttrib(pos) && getAttrib(); }, - 'attrselector': function() { return checkAttrselector(pos) && getAttrselector(); }, - 'block': function() { return checkBlock(pos) && getBlock(); }, - 'braces': function() { return checkBraces(pos) && getBraces(); }, - 'class': function() { return checkClass(pos) && getClass(); }, - 'combinator': function() { return checkCombinator(pos) && getCombinator(); }, - 'commentML': function() { return checkCommentML(pos) && getCommentML(); }, - 'commentSL': function() { return checkCommentSL(pos) && getCommentSL(); }, - 'condition': function() { return checkCondition(pos) && getCondition(); }, - 'conditionalStatement': function() { return checkConditionalStatement(pos) && getConditionalStatement(); }, - 'declaration': function() { return checkDeclaration(pos) && getDeclaration(); }, - 'declDelim': function() { return checkDeclDelim(pos) && getDeclDelim(); }, - 'default': function() { return checkDefault(pos) && getDefault(); }, - 'delim': function() { return checkDelim(pos) && getDelim(); }, - 'dimension': function() { return checkDimension(pos) && getDimension(); }, - 'filter': function() { return checkFilter(pos) && getFilter(); }, - 'filterv': function() { return checkFilterv(pos) && getFilterv(); }, - 'functionExpression': function() { return checkFunctionExpression(pos) && getFunctionExpression(); }, - 'function': function() { return checkFunction(pos) && getFunction(); }, - 'ident': function() { return checkIdent(pos) && getIdent(); }, - 'important': function() { return checkImportant(pos) && getImportant(); }, - 'include': function() { return checkInclude(pos) && getInclude(); }, - 'interpolation': function() { return checkInterpolation(pos) && getInterpolation(); }, - 'loop': function() { return checkLoop(pos) && getLoop(); }, - 'mixin': function() { return checkMixin(pos) && getMixin(); }, - 'namespace': function() { return checkNamespace(pos) && getNamespace(); }, - 'nth': function() { return checkNth(pos) && getNth(); }, - 'nthselector': function() { return checkNthselector(pos) && getNthselector(); }, - 'number': function() { return checkNumber(pos) && getNumber(); }, - 'operator': function() { return checkOperator(pos) && getOperator(); }, - 'parentselector': function() { return checkParentSelector(pos) && getParentSelector(); }, - 'percentage': function() { return checkPercentage(pos) && getPercentage(); }, - 'placeholder': function() { return checkPlaceholder(pos) && getPlaceholder(); }, - 'progid': function() { return checkProgid(pos) && getProgid(); }, - 'property': function() { return checkProperty(pos) && getProperty(); }, - 'propertyDelim': function() { return checkPropertyDelim(pos) && getPropertyDelim(); }, - 'pseudoc': function() { return checkPseudoc(pos) && getPseudoc(); }, - 'pseudoe': function() { return checkPseudoe(pos) && getPseudoe(); }, - 'ruleset': function() { return checkRuleset(pos) && getRuleset(); }, - 's': function() { return checkS(pos) && getS(); }, - 'selector': function() { return checkSelector(pos) && getSelector(); }, - 'shash': function() { return checkShash(pos) && getShash(); }, - 'simpleselector': function() { return checkSimpleSelector(pos) && getSimpleSelector(); }, - 'string': function() { return checkString(pos) && getString(); }, - 'stylesheet': function() { return checkStylesheet(pos) && getStylesheet(); }, - 'unary': function() { return checkUnary(pos) && getUnary(); }, - 'uri': function() { return checkUri(pos) && getUri(); }, - 'value': function() { return checkValue(pos) && getValue(); }, - 'variable': function () { return checkVariable(pos) && getVariable(); }, - 'variableslist': function () { return checkVariablesList(pos) && getVariablesList(); }, - 'vhash': function() { return checkVhash(pos) && getVhash(); } - }; - - /** - * Stop parsing and display error - * @param {Number=} i Token's index number - */ - function throwError(i) { - var ln = i ? tokens[i].ln : tokens[pos].ln; - - throw {line: ln, syntax: 'scss'}; - } - - /** - * @param {Object} exclude - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkExcluding(exclude, i) { - var start = i; - - while(i < tokensLength) { - if (exclude[tokens[i++].type]) break; - } - - return i - start - 2; - } - - /** - * @param {Number} start - * @param {Number} finish - * @returns {String} - */ - function joinValues(start, finish) { - var s = ''; - - for (var i = start; i < finish + 1; i++) { - s += tokens[i].value; - } - - return s; - } - - /** - * @param {Number} start - * @param {Number} num - * @returns {String} - */ - function joinValues2(start, num) { - if (start + num - 1 >= tokensLength) return; - - var s = ''; - - for (var i = 0; i < num; i++) { - s += tokens[start + i].value; - } - - return s; - } - - -///////////////////////////////////// -///////////////////////////////////// -///////////////////////////////////// - - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAny(i) { - return checkBraces(i) || - checkString(i) || - checkVariablesList(i) || - checkVariable(i) || - checkPlaceholder(i) || - checkPercentage(i) || - checkDimension(i) || - checkNumber(i) || - checkUri(i) || - checkFunctionExpression(i) || - checkFunction(i) || - checkIdent(i) || - checkClass(i) || - checkUnary(i); - } - - /** - * @returns {Array} - */ - function getAny() { - if (checkBraces(pos)) return getBraces(); - else if (checkString(pos)) return getString(); - else if (checkVariablesList(pos)) return getVariablesList(); - else if (checkVariable(pos)) return getVariable(); - else if (checkPlaceholder(pos)) return getPlaceholder(); - else if (checkPercentage(pos)) return getPercentage(); - else if (checkDimension(pos)) return getDimension(); - else if (checkNumber(pos)) return getNumber(); - else if (checkUri(pos)) return getUri(); - else if (checkFunctionExpression(pos)) return getFunctionExpression(); - else if (checkFunction(pos)) return getFunction(); - else if (checkIdent(pos)) return getIdent(); - else if (checkClass(pos)) return getClass(); - else if (checkUnary(pos)) return getUnary(); - } - - /** - * Check if token is part of mixin's arguments. - * @param {Number} i Token's index number - * @returns {Number} Length of arguments - */ - function checkArguments(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftParenthesis) return 0; - - i++; - - while (i < tokens[start].right) { - if (l = checkArgument(i)) i +=l; - else return 0; - } - - return tokens[start].right - start + 1; - } - - /** - * Check if token is valid to be part of arguments list - * @param i Token's index number - * @returns {Number} Length of argument - */ - function checkArgument(i) { - return checkDeclaration(i) || - checkFunction(i) || - checkVariablesList(i) || - checkVariable(i) || - checkSC(i) || - checkDelim(i) || - checkDeclDelim(i) || - checkString(i) || - checkPercentage(i) || - checkDimension(i) || - checkNumber(i) || - checkUri(i) || - checkInterpolation(i) || - checkIdent(i) || - checkVhash(i) || - checkOperator(i) || - checkUnary(i); - } - - /** - * @returns {Array} Node that is part of arguments list - */ - function getArgument() { - if (checkDeclaration(pos)) return getDeclaration(); - else if (checkFunction(pos)) return getFunction(); - else if (checkVariablesList(pos)) return getVariablesList(); - else if (checkVariable(pos)) return getVariable(); - else if (checkSC(pos)) return getSC(); - else if (checkDelim(pos)) return getDelim(); - else if (checkDeclDelim(pos)) return getDeclDelim(); - else if (checkString(pos)) return getString(); - else if (checkPercentage(pos)) return getPercentage(); - else if (checkDimension(pos)) return getDimension(); - else if (checkNumber(pos)) return getNumber(); - else if (checkUri(pos)) return getUri(); - else if (checkInterpolation(pos)) return getInterpolation(); - else if (checkIdent(pos)) return getIdent(); - else if (checkVhash(pos)) return getVhash(); - else if (checkOperator(pos)) return getOperator(); - else if (checkUnary(pos)) return getUnary(); - } - - /** - * Check if token is part of an @-word (e.g. `@import`, `@include`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtkeyword(i) { - var l; - - // Check that token is `@`: - if (i >= tokensLength || - tokens[i++].type !== TokenType.CommercialAt) return 0; - - return (l = checkIdent(i)) ? l + 1 : 0; - } - - /** - * Get node with @-word - * @returns {Array} `['atkeyword', ['ident', x]]` where `x` is - * an identifier without - * `@` (e.g. `import`, `include`) - */ - function getAtkeyword() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AtkeywordType, getIdent()]; - - return x; - } - - /** - * Check if token is part of an attribute selector (e.g. `[attr]`, - * `[attr='panda']`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib(i) { - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftSquareBracket || - !tokens[i].right) return 0; - - return tokens[i].right - i + 1; - } - - /** - * Get node with an attribute selector - * @returns {Array} `['attrib', ['ident', x], ['attrselector', y]*, [z]*]` - * where `x` is attribute's name, `y` is operator (if there is any) - * and `z` is attribute's value (if there is any) - */ - function getAttrib() { - if (checkAttrib1(pos)) return getAttrib1(); - if (checkAttrib2(pos)) return getAttrib2(); - } - - /** - * Check if token is part of an attribute selector of the form `[attr='value']` - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib1(i) { - var start = i, - l; - - if (i++ >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkAttrselector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i) || checkString(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - } - - /** - * Get node with an attribute selector of the form `[attr='value']` - * @returns {Array} `['attrib', ['ident', x], ['attrselector', y], [z]]` - * where `x` is attribute's name, `y` is operator and `z` is attribute's - * value - */ - function getAttrib1() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AttribType] - .concat(getSC()) - .concat([getIdent()]) - .concat(getSC()) - .concat([getAttrselector()]) - .concat(getSC()) - .concat([checkString(pos)? getString() : getIdent()]) - .concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an attribute selector of the form `[attr]` - * Attribute can not be empty, e.g. `[]`. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAttrib2(i) { - var start = i, - l; - - if (i++ >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - } - - /** - * Get node with an attribute selector of the form `[attr]` - * @returns {Array} `['attrib', ['ident', x]]` where `x` is attribute's name - */ - function getAttrib2() { - var startPos = pos, - x; - - pos++; - - x = [NodeType.AttribType] - .concat(getSC()) - .concat([getIdent()]) - .concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an attribute selector operator (`=`, `~=`, - * `^=`, `$=`, `*=` or `|=`) - * @param {Number} i Token's index number - * @returns {Number} Length of operator (`0` if token is not part of an - * operator, `1` or `2` if it is). - */ - function checkAttrselector(i) { - if (i >= tokensLength) return 0; - - if (tokens[i].type === TokenType.EqualsSign) return 1; - - // TODO: Add example or remove - if (tokens[i].type === TokenType.VerticalLine && - (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign)) - return 1; - - if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0; - - switch(tokens[i].type) { - case TokenType.Tilde: - case TokenType.CircumflexAccent: - case TokenType.DollarSign: - case TokenType.Asterisk: - case TokenType.VerticalLine: - return 2; - } - - return 0; - } - - /** - * Get node with an attribute selector operator (`=`, `~=`, `^=`, `$=`, - * `*=` or `|=`) - * @returns {Array} `['attrselector', x]` where `x` is an operator. - */ - function getAttrselector() { - var startPos = pos, - s = tokens[pos++].value, - x; - - if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value; - - x = [NodeType.AttrselectorType, s]; - - return x; - } - - /** - * Check if token is a part of an @-rule - * @param {Number} i Token's index number - * @returns {Number} Length of @-rule - */ - function checkAtrule(i) { - var l; - - if (i >= tokensLength) return 0; - - // If token already has a record of being part of an @-rule, - // return the @-rule's length: - if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l; - - // If token is part of an @-rule, save the rule's type to token: - if (l = checkAtruler(i)) tokens[i].atrule_type = 1; // @-rule with ruleset - else if (l = checkAtruleb(i)) tokens[i].atrule_type = 2; // block @-rule - else if (l = checkAtrules(i)) tokens[i].atrule_type = 3; // single-line @-rule - else return 0; - - // If token is part of an @-rule, save the rule's length to token: - tokens[i].atrule_l = l; - - return l; - } - - /** - * Get node with @-rule - * @returns {Array} - */ - function getAtrule() { - switch (tokens[pos].atrule_type) { - case 1: return getAtruler(); // @-rule with ruleset - case 2: return getAtruleb(); // block @-rule - case 3: return getAtrules(); // single-line @-rule - } - } - - /** - * Check if token is part of a block @-rule - * @param {Number} i Token's index number - * @returns {Number} Length of the @-rule - */ - function checkAtruleb(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkTsets(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a block @-rule - * @returns {Array} `['atruleb', ['atkeyword', x], y, ['block', z]]` - */ - function getAtruleb() { - var startPos = pos, - x; - - x = [NodeType.AtrulebType, getAtkeyword()] - .concat(getTsets()) - .concat([getBlock()]); - - return x; - } - - /** - * Check if token is part of an @-rule with ruleset - * @param {Number} i Token's index number - * @returns {Number} Length of the @-rule - */ - function checkAtruler(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkAtrulerq(i)) i += l; - - if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++; - else return 0; - - if (l = checkAtrulers(i)) i += l; - - if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++; - else return 0; - - return i - start; - } - - /** - * Get node with an @-rule with ruleset - * @returns {Array} ['atruler', ['atkeyword', x], y, z] - */ - function getAtruler() { - var startPos = pos, - x; - - x = [NodeType.AtrulerType, getAtkeyword(), getAtrulerq()]; - - pos++; - - x.push(getAtrulers()); - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrulerq(i) { - return checkTsets(i); - } - - /** - * @returns {Array} `['atrulerq', x]` - */ - function getAtrulerq() { - var startPos = pos, - x; - - x = [NodeType.AtrulerqType].concat(getTsets()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrulers(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - while (l = checkRuleset(i) || checkAtrule(i) || checkSC(i)) { - i += l; - } - - tokens[i].atrulers_end = 1; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `['atrulers', x]` - */ - function getAtrulers() { - var startPos = pos, - x; - - x = [NodeType.AtrulersType].concat(getSC()); - - while (!tokens[pos].atrulers_end) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkAtrule(pos)) x.push(getAtrule()); - else if (checkRuleset(pos)) x.push(getRuleset()); - } - - x = x.concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkAtrules(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (l = checkTsets(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `['atrules', ['atkeyword', x], y]` - */ - function getAtrules() { - var startPos = pos, - x; - - x = [NodeType.AtrulesType, getAtkeyword()].concat(getTsets()); - - return x; - } - - /** - * Check if token is part of a block (e.g. `{...}`). - * @param {Number} i Token's index number - * @returns {Number} Length of the block - */ - function checkBlock(i) { - return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ? - tokens[i].right - i + 1 : 0; - } - - /** - * Get node with a block - * @returns {Array} `['block', x]` - */ - function getBlock() { - var startPos = pos, - end = tokens[pos].right, - x = [NodeType.BlockType]; - - pos++; - - - while (pos < end) { - if (checkBlockdecl(pos)) x = x.concat(getBlockdecl()); - else throwError(); - } - - pos = end + 1; - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkBlockdecl(i) { - var l; - - if (i >= tokensLength) return 0; - - if (l = checkBlockdecl1(i)) tokens[i].bd_type = 1; - else if (l = checkBlockdecl2(i)) tokens[i].bd_type = 2; - else if (l = checkBlockdecl3(i)) tokens[i].bd_type = 3; - else if (l = checkBlockdecl4(i)) tokens[i].bd_type = 4; - else return 0; - - return l; - } - - /** - * @returns {Array} - */ - function getBlockdecl() { - switch (tokens[pos].bd_type) { - case 1: return getBlockdecl1(); - case 2: return getBlockdecl2(); - case 3: return getBlockdecl3(); - case 4: return getBlockdecl4(); - } - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl1(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkConditionalStatement(i)) tokens[i].bd_kind = 1; - else if (l = checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = checkLoop(i)) tokens[i].bd_kind = 3; - else if (l = checkFilter(i)) tokens[i].bd_kind = 4; - else if (l = checkAtrule(i)) tokens[i].bd_kind = 6; - else if (l = checkRuleset(i)) tokens[i].bd_kind = 7; - else if (l = checkDeclaration(i)) tokens[i].bd_kind = 5; - else return 0; - - i += l; - - if (i < tokensLength && (l = checkDeclDelim(i))) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getBlockdecl1() { - var sc = getSC(), - x; - - switch (tokens[pos].bd_kind) { - case 1: - x = getConditionalStatement(); - break; - case 2: - x = getInclude(); - break; - case 3: - x = getLoop(); - break; - case 4: - x = getFilter(); - break; - case 5: - x = getDeclaration(); - break; - case 6: - x = getAtrule(); - break; - case 7: - x = getRuleset(); - break; - } - - return sc - .concat([x]) - .concat([getDeclDelim()]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl2(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkConditionalStatement(i)) tokens[i].bd_kind = 1; - else if (l = checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = checkLoop(i)) tokens[i].bd_kind = 3; - else if (l = checkFilter(i)) tokens[i].bd_kind = 4; - else if (l = checkAtrule(i)) tokens[i].bd_kind = 6; - else if (l = checkRuleset(i)) tokens[i].bd_kind = 7; - else if (l = checkDeclaration(i)) tokens[i].bd_kind = 5; - else return 0; - - i += l; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getBlockdecl2() { - var sc = getSC(), - x; - - switch (tokens[pos].bd_kind) { - case 1: - x = getConditionalStatement(); - break; - case 2: - x = getInclude(); - break; - case 3: - x = getLoop(); - break; - case 4: - x = getFilter(); - break; - case 5: - x = getDeclaration(); - break; - case 6: - x = getAtrule(); - break; - case 7: - x = getRuleset(); - break; - } - - return sc - .concat([x]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl3(i) { - var start = i, - l; - - if (l = checkSC(i)) i += l; - - if (l = checkDeclDelim(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} `[s0, ['declDelim'], s1]` where `s0` and `s1` are - * are optional whitespaces. - */ - function getBlockdecl3() { - return getSC() - .concat([getDeclDelim()]) - .concat(getSC()); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBlockdecl4(i) { - return checkSC(i); - } - - /** - * @returns {Array} - */ - function getBlockdecl4() { - return getSC(); - } - - /** - * Check if token is part of text inside parentheses or square brackets - * (e.g. `(1)`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkBraces(i) { - if (i >= tokensLength || - (tokens[i].type !== TokenType.LeftParenthesis && - tokens[i].type !== TokenType.LeftSquareBracket)) return 0; - - return tokens[i].right - i + 1; - } - - /** - * Get node with text inside parentheses or square brackets (e.g. `(1)`) - * @returns {Array} `['braces', l, r, x*]` where `l` is a left bracket - * (e.g. `'('`), `r` is a right bracket (e.g. `')'`) and `x` is - * parsed text inside those brackets (if there is any) - * (e.g. `['number', '1']`) - */ - function getBraces() { - var startPos = pos, - left = pos, - right = tokens[pos].right, - x; - - pos++; - - var tsets = getTsets(); - - pos++; - - x = [NodeType.BracesType, tokens[left].value, tokens[right].value] - .concat(tsets); - - return x; - } - - /** - * Check if token is part of a class selector (e.g. `.abc`) - * @param {Number} i Token's index number - * @returns {Number} Length of the class selector - */ - function checkClass(i) { - var l; - - if (i >= tokensLength) return 0; - - if (tokens[i].class_l) return tokens[i].class_l; - - if (tokens[i++].type === TokenType.FullStop && - (l = checkInterpolation(i) || checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - - return 0; - } - - /** - * Get node with a class selector - * @returns {Array} `['class', ['ident', x]]` where x is a class's - * identifier (without `.`, e.g. `abc`). - */ - function getClass() { - var startPos = pos, - x = [NodeType.ClassType]; - - pos++; - - x.push(checkInterpolation(pos) ? getInterpolation() : getIdent()); - - return x; - } - - /** - * Check if token is a combinator (`+`, `>` or `~`) - * @param {Number} i Token's index number - * @returns {Number} Length of the combinator - */ - function checkCombinator(i) { - if (i >= tokensLength) return 0; - - switch (tokens[i].type) { - case TokenType.PlusSign: - case TokenType.GreaterThanSign: - case TokenType.Tilde: - return 1; - } - - return 0; - } - - /** - * Get node with a combinator (`+`, `>` or `~`) - * @returns {Array} `['combinator', x]` where `x` is a combinator - * converted to string. - */ - function getCombinator() { - var startPos = pos, - x; - - x = [NodeType.CombinatorType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is a multiline comment. - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a multiline comment, otherwise `0` - */ - function checkCommentML(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0; - } - - /** - * Get node with a multiline comment - * @returns {Array} `['commentML', x]` where `x` - * is the comment's text (without `/*` and `* /`). - */ - function getCommentML() { - var startPos = pos, - s = tokens[pos].value.substring(2), - l = s.length, - x; - - if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2); - - pos++; - - x = [NodeType.CommentMLType, s]; - - return x; - } - - /** - * Check if token is part of a single-line comment. - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a single-line comment, otherwise `0` - */ - function checkCommentSL(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - } - - /** - * Get node with a single-line comment. - * @returns {Array} `['commentSL', x]` where `x` is comment's message - * (without `//`) - */ - function getCommentSL() { - var startPos = pos, - x; - - x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)]; - - return x; - } - - /** - * Check if token is part of a condition - * (e.g. `@if ...`, `@else if ...` or `@else ...`). - * @param {Number} i Token's index number - * @returns {Number} Length of the condition - */ - function checkCondition(i) { - var start = i, - l, _i, s; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (['if', 'else'].indexOf(tokens[start + 1].value) < 0) return 0; - - while (i < tokensLength) { - if (l = checkBlock(i)) break; - - s = checkSC(i); - _i = i + s; - - if (l = _checkCondition(_i)) i += l + s; - else break; - } - - return i - start; - } - - function _checkCondition(i) { - return checkVariable(i) || - checkNumber(i) || - checkIdent(i) || - checkOperator(i) || - checkCombinator(i) || - checkString(i); - } - - /** - * Get node with a condition. - * @returns {Array} `['condition', x]` - */ - function getCondition() { - var startPos = pos, - x = [NodeType.ConditionType]; - - x.push(getAtkeyword()); - - while (pos < tokensLength) { - if (checkBlock(pos)) break; - - s = checkSC(pos); - _pos = pos + s; - - if (!_checkCondition(_pos)) break; - - if (s) x = x.concat(getSC()); - x.push(_getCondition()); - } - - return x; - } - - function _getCondition() { - if (checkVariable(pos)) return getVariable(); - if (checkNumber(pos)) return getNumber(); - if (checkIdent(pos)) return getIdent(); - if (checkOperator(pos)) return getOperator(); - if (checkCombinator(pos)) return getCombinator(); - if (checkString(pos)) return getString(); - } - - /** - * Check if token is part of a conditional statement - * (e.g. `@if ... {} @else if ... {} @else ... {}`). - * @param {Number} i Token's index number - * @returns {Number} Length of the condition - */ - function checkConditionalStatement(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkCondition(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a condition. - * @returns {Array} `['condition', x]` - */ - function getConditionalStatement() { - var startPos = pos, - x = [NodeType.ConditionalStatementType]; - - x.push(getCondition()); - x = x.concat(getSC()); - x.push(getBlock()); - - return x; - } - - /** - * Check if token is part of a declaration (property-value pair) - * @param {Number} i Token's index number - * @returns {Number} Length of the declaration - */ - function checkDeclaration(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkProperty(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkPropertyDelim(i)) i++; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkValue(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a declaration - * @returns {Array} `['declaration', ['property', x], ['propertyDelim'], - * ['value', y]]` - */ - function getDeclaration() { - var startPos = pos, - x = [NodeType.DeclarationType]; - - x.push(getProperty()); - x = x.concat(getSC()); - x.push(getPropertyDelim()); - x = x.concat(getSC()); - x.push(getValue()); - - return x; - } - - /** - * Check if token is a semicolon - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a semicolon, otherwise `0` - */ - function checkDeclDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0; - } - - /** - * Get node with a semicolon - * @returns {Array} `['declDelim']` - */ - function getDeclDelim() { - var startPos = pos, - x = [NodeType.DeclDelimType]; - - pos++; - - return x; - } - - /** - * Check if token if part of `!default` word. - * @param {Number} i Token's index number - * @returns {Number} Length of the `!default` word - */ - function checkDefault(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].value === 'default' ? i - start + 1 : 0; - } - - /** - * Get node with a `!default` word - * @returns {Array} `['default', sc]` where `sc` is optional whitespace - */ - function getDefault() { - var startPos = pos, - x = [NodeType.DefaultType], - sc; - - // Skip `!`: - pos++; - - sc = getSC(); - - // Skip `default`: - pos++; - - x = x.concat(sc); - - return x; - } - - /** - * Check if token is a comma - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a comma, otherwise `0` - */ - function checkDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0; - } - - /** - * Get node with a comma - * @returns {Array} `['delim']` - */ - function getDelim() { - var startPos = pos, - x = [NodeType.DelimType]; - - pos++; - - return x; - } - - /** - * Check if token is part of a number with dimension unit (e.g. `10px`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkDimension(i) { - var ln = checkNumber(i), - li; - - if (i >= tokensLength || - !ln || - i + ln >= tokensLength) return 0; - - return (li = checkNmName2(i + ln)) ? ln + li : 0; - } - - /** - * Get node of a number with dimension unit - * @returns {Array} `['dimension', ['number', x], ['ident', y]]` where - * `x` is a number converted to string (e.g. `'10'`) and `y` is - * a dimension unit (e.g. `'px'`). - */ - function getDimension() { - var startPos = pos, - x = [NodeType.DimensionType, getNumber()], - ident = [NodeType.IdentType, getNmName2()]; - - x.push(ident); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilter(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkFilterp(i)) i += l; - else return 0; - - if (tokens[i].type === TokenType.Colon) i++; - else return 0; - - if (l = checkFilterv(i)) i += l; - else return 0; - - return i - start; - } - - /** - * @returns {Array} `['filter', x, y]` - */ - function getFilter() { - var startPos = pos, - x = [NodeType.FilterType, getFilterp()]; - - pos++; - - x.push(getFilterv()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilterp(i) { - var start = i, - l, - x; - - if (i >= tokensLength) return 0; - - if (tokens[i].value === 'filter') l = 1; - else { - x = joinValues2(i, 2); - - if (x === '-filter' || x === '_filter' || x === '*filter') l = 2; - else { - x = joinValues2(i, 4); - - if (x === '-ms-filter') l = 4; - else return 0; - } - } - - tokens[start].filterp_l = l; - - i += l; - - if (checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getFilterp() { - var startPos = pos, - ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)], - x; - - pos += tokens[pos].filterp_l; - - x = [NodeType.PropertyType, ident].concat(getSC()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFilterv(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkProgid(i)) i += l; - else return 0; - - while (l = checkProgid(i)) { - i += l; - } - - tokens[start].last_progid = i; - - if (i < tokensLength && (l = checkSC(i))) i += l; - - if (i < tokensLength && (l = checkImportant(i))) i += l; - - return i - start; - } - - /** - * progid+:x -> [#filterv].concat(x) - * @returns {Array} - */ - function getFilterv() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - - x = x.concat(getSC()); - - while (pos < last_progid) { - x.push(getProgid()); - } - - if (checkSC(pos)) x = x.concat(getSC()); - - if (pos < tokensLength && checkImportant(pos)) x.push(getImportant()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunctionExpression(i) { - var start = i; - - if (i >= tokensLength || tokens[i++].value !== 'expression' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; - - return tokens[i].right - start + 1; - } - - /** - * @returns {Array} - */ - function getFunctionExpression() { - var startPos = pos, - x, e; - - pos++; - - e = joinValues(pos + 1, tokens[pos].right - 1); - - pos = tokens[pos].right + 1; - - x = [NodeType.FunctionExpressionType, e]; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkFunction(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkIdent(i)) i +=l; - else return 0; - - return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ? - tokens[i].right - start + 1 : 0; - } - - /** - * @returns {Array} - */ - function getFunction() { - var startPos = pos, - ident = getIdent(), - x = [NodeType.FunctionType, ident], - body; - - body = ident[1] === 'not' ? getNotArguments() : getArguments(); - - x.push(body); - - return x; - } - - /** - * @returns {Array} - */ - function getArguments() { - var startPos = pos, - x = [NodeType.ArgumentsType], - body; - - pos++; - - while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { - if (checkDeclaration(pos)) x.push(getDeclaration()); - else if (checkArgument(pos)) { - body = getArgument(); - if (typeof body[0] === 'string') x.push(body); - else x = x.concat(body); - } else if (checkClass(pos)) x.push(getClass()); - else throwError(); - } - - pos++; - - return x; - } - - /** - * @returns {Array} - */ - function getNotArguments() { - var startPos = pos, - x = [NodeType.ArgumentsType]; - - pos++; - - while (pos < tokensLength && tokens[pos].type !== TokenType.RightParenthesis) { - if (checkSimpleSelector(pos)) x.push(getSimpleSelector()); - else throwError(); - } - - pos++; - - return x; - } - - /** - * Check if token is part of an identifier - * @param {Number} i Token's index number - * @returns {Number} Length of the identifier - */ - function checkIdent(i) { - var start = i, - interpolations = [], - wasIdent, - wasInt = false, - l; - - if (i >= tokensLength) return 0; - - // Check if token is part of an identifier starting with `_`: - if (tokens[i].type === TokenType.LowLine) return checkIdentLowLine(i); - - // If token is a character, `-`, `$` or `*`, skip it & continue: - if (l = _checkIdent(i)) i += l; - else return 0; - - if (l > 1) { - interpolations.push(i - l); - wasInt = true; - } else { - // Remember if previous token's type was identifier: - wasIdent = tokens[i - 1].type === TokenType.Identifier; - } - - while (i < tokensLength) { - l = _checkIdent(i); - - if (!l) break; - - if (l > 1) { - wasInt = true; - interpolations.push(i); - } else { - wasIdent = true; - } - i += l; - } - - if (!wasIdent && !wasInt && tokens[start].type !== TokenType.Asterisk) return 0; - - tokens[start].ident_last = i - 1; - if (interpolations.length) tokens[start].interpolations = interpolations; - - return i - start; - } - - function _checkIdent(i) { - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.LowLine || - tokens[i].type === TokenType.Asterisk) return 1; - if (l = checkInterpolation(i)) return l; - return 0; - }; - - /** - * Check if token is part of an identifier starting with `_` - * @param {Number} i Token's index number - * @returns {Number} Length of the identifier - */ - function checkIdentLowLine(i) { - var start = i; - - if (i++ >= tokensLength) return 0; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.DecimalNumber && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier) break; - } - - // Save index number of the last token of the identifier: - tokens[start].ident_last = i - 1; - - return i - start; - } - - /** - * Get node with an identifier - * @returns {Array} `['ident', x]` where `x` is identifier's name - */ - function getIdent() { - var startPos = pos, - interpolations = tokens[pos].interpolations, - x = [NodeType.IdentType]; - - if (interpolations) { - for (var i = 0, l = interpolations.length; i < l; i++) { - var s = joinValues(pos, interpolations[i] - 1); - if (s) x.push(s); - pos = interpolations[i]; - x.push(getInterpolation()); - } - } - - if (pos < tokensLength && pos <= tokens[startPos].ident_last) { - x.push(joinValues(pos, tokens[startPos].ident_last)); - pos = tokens[pos].ident_last + 1; - } - - return x; - } - - /** - * Check if token is part of `!important` word - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkImportant(i) { - var start = i, - l; - - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - - if (l = checkSC(i)) i += l; - - return tokens[i].value === 'important' ? i - start + 1 : 0; - } - - /** - * Get node with `!important` word - * @returns {Array} `['important', sc]` where `sc` is optional whitespace - */ - function getImportant() { - var startPos = pos, - x = [NodeType.ImportantType]; - - pos++; - - x = x.concat(getSC()); - - pos++; - - return x; - } - - /** - * Check if token is part of an included mixin (`@include` or `@extend` - * directive). - * @param {Number} i Token's index number - * @returns {Number} Length of the included mixin - */ - function checkInclude(i) { - var l; - - if (i >= tokensLength) return 0; - - if (l = checkInclude1(i)) tokens[i].include_type = 1; - else if (l = checkInclude2(i)) tokens[i].include_type = 2; - else if (l = checkInclude3(i)) tokens[i].include_type = 3; - else if (l = checkInclude4(i)) tokens[i].include_type = 4; - - return l; - } - - /** - * Get node with included mixin - * @returns {Array} `['include', x]` - */ - function getInclude() { - switch (tokens[pos].include_type) { - case 1: return getInclude1(); - case 2: return getInclude2(); - case 3: return getInclude3(); - case 4: return getInclude4(); - } - } - - /** - * Check if token is part of an included mixin like `@include nani(foo) {...}` - * @param {Number} i Token's index number - * @returns {Number} Length of the include - */ - function checkInclude1(i) { - var start = i, - l; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - // TODO: Check if extends don't take any arguments - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkArguments(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with included mixin like `@include nani(foo) {...}` - * @returns {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, - * ['arguments', z], sc, ['block', q], sc` where `x` is `include` or - * `extend`, `y` is mixin's identifier (selector), `z` are arguments - * passed to the mixin, `q` is block passed to the mixin and `sc` - * are optional whitespaces - */ - function getInclude1() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getAtkeyword()); - - x = x.concat(getSC()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getArguments()); - - x = x.concat(getSC()); - - x.push(getBlock()); - - return x; - } - - /** - * Check if token is part of an included mixin like `@include nani(foo)` - * @param {Number} i Token's index number - * @returns {Number} Length of the include - */ - function checkInclude2(i) { - var start = i, - l; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - // TODO: Check if extends don't take any arguments - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkArguments(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with included mixin like `@include nani(foo)` - * @returns {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc, - * ['arguments', z], sc]` where `x` is `include` or `extend`, `y` is - * mixin's identifier (selector), `z` are arguments passed to the - * mixin and `sc` are optional whitespaces - */ - function getInclude2() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getAtkeyword()); - - x = x.concat(getSC()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getArguments()); - - return x; - } - - /** - * Check if token is part of an included mixin with a content block passed - * as an argument (e.g. `@include nani {...}`) - * @param {Number} i Token's index number - * @returns {Number} Length of the mixin - */ - function checkInclude3(i) { - var start = i, - l; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with an included mixin with a content block passed - * as an argument (e.g. `@include nani {...}`) - * @returns {Array} `['include', x]` - */ - function getInclude3() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getAtkeyword()); - - x = x.concat(getSC()); - - x.push(getIncludeSelector()); - - x = x.concat(getSC()); - - x.push(getBlock()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInclude4(i) { - var start = i, - l; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - - if (l = checkSC(i)) i += l; - else return 0; - - if (l = checkIncludeSelector(i)) i += l; - else return 0; - - return i - start; - } - - /** - * @returns {Array} `['include', x]` - */ - function getInclude4() { - var startPos = pos, - x = [NodeType.IncludeType]; - - x.push(getAtkeyword()); - - x = x.concat(getSC()); - - x.push(getIncludeSelector()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkIncludeSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector2(i)) i += l; - else break; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getIncludeSelector() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - - while (pos < tokensLength && checkSimpleSelector2(pos)) { - t = getSimpleSelector2(); - - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * Check if token is part of an interpolated variable (e.g. `#{$nani}`). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkInterpolation(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[i].type !== TokenType.NumberSign || - !tokens[i + 1] || - tokens[i + 1].type !== TokenType.LeftCurlyBracket) return 0; - - i += 2; - - if (l = checkVariable(i)) i += l; - else return 0; - - return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0; - } - - /** - * Get node with an interpolated variable - * @returns {Array} `['interpolation', x]` - */ - function getInterpolation() { - var startPos = pos, - x = [NodeType.InterpolationType]; - - // Skip `#{`: - pos += 2; - - x.push(getVariable()); - - // Skip `}`: - pos++; - - return x; - } - - /** - * Check if token is part of a loop. - * @param {Number} i Token's index number - * @returns {Number} Length of the loop - */ - function checkLoop(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkAtkeyword(i)) i += l; - else return 0; - - if (['for', 'each', 'while'].indexOf(tokens[start + 1].value) < 0) return 0; - - while (i < tokensLength) { - if (l = checkBlock(i)) { - i += l; - break; - } else if (l = checkVariable(i) || - checkNumber(i) || - checkIdent(i) || - checkSC(i) || - checkOperator(i) || - checkCombinator(i) || - checkString(i)) i += l; - else return 0; - } - - return i - start; - } - - /** - * Get node with a loop. - * @returns {Array} `['loop', x]` - */ - function getLoop() { - var startPos = pos, - x = [NodeType.LoopType]; - - x.push(getAtkeyword()); - - while (pos < tokensLength) { - if (checkBlock(pos)) { - x.push(getBlock()); - break; - } - else if (checkVariable(pos)) x.push(getVariable()); - else if (checkNumber(pos)) x.push(getNumber()); - else if (checkIdent(pos)) x.push(getIdent()); - else if (checkOperator(pos)) x.push(getOperator()); - else if (checkCombinator(pos)) x.push(getCombinator()); - else if (checkSC(pos)) x = x.concat(getSC()); - else if (checkString(pos)) x.push(getString()); - } - - return x; - } - - /** - * Check if token is part of a mixin - * @param {Number} i Token's index number - * @returns {Number} Length of the mixin - */ - function checkMixin(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if ((l = checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (l = checkArguments(i)) i += l; - - if (l = checkSC(i)) i += l; - - if (l = checkBlock(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a mixin - * @returns {Array} `['mixin', x]` - */ - function getMixin() { - var startPos = pos, - x = [NodeType.MixinType, getAtkeyword()]; - - x = x.concat(getSC()); - - if (checkIdent(pos)) x.push(getIdent()); - - x = x.concat(getSC()); - - if (checkArguments(pos)) x.push(getArguments()); - - x = x.concat(getSC()); - - if (checkBlock(pos)) x.push(getBlock()); - - return x; - } - - /** - * Check if token is a namespace sign (`|`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is `|`, `0` if not - */ - function checkNamespace(i) { - return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0; - } - - /** - * Get node with a namespace sign - * @returns {Array} `['namespace']` - */ - function getNamespace() { - var startPos = pos, - x = [NodeType.NamespaceType]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNmName(i) { - var start = i; - - if (i >= tokensLength) return 0; - - // start char / word - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.LowLine || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DecimalNumber) i++; - else return 0; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier && - tokens[i].type !== TokenType.DecimalNumber) break; - } - - tokens[start].nm_name_last = i - 1; - - return i - start; - } - - /** - * @returns {String} - */ - function getNmName() { - var s = joinValues(pos, tokens[pos].nm_name_last); - - pos = tokens[pos].nm_name_last + 1; - - return s; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNmName2(i) { - if (tokens[i].type === TokenType.Identifier) return 1; - else if (tokens[i].type !== TokenType.DecimalNumber) return 0; - - i++; - - return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1; - } - - /** - * @returns {String} - */ - function getNmName2() { - var s = tokens[pos].value; - - if (tokens[pos++].type === TokenType.DecimalNumber && - pos < tokensLength && - tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value; - - return s; - } - - /** - * Check if token is part of an nth-selector's identifier (e.g. `2n+1`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth(i) { - if (i >= tokensLength) return 0; - - return checkNth1(i) || checkNth2(i); - } - - /** - * Check if token is part of an nth-selector's identifier in the form of - * sequence of decimals and n-s (e.g. `3`, `n`, `2n+1`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth1(i) { - var start = i; - - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.DecimalNumber && - tokens[i].value !== 'n') break; - } - - if (i !== start) tokens[start].nth_last = i - 1; - - return i - start; - } - - /** - * Get node for nth-selector's identifier (e.g. `2n+1`) - * @returns {Array} `['nth', x]` where `x` is identifier's text - */ - function getNth() { - var startPos = pos, - x = [NodeType.NthType]; - - if (tokens[pos].nth_last) { - x.push(joinValues(pos, tokens[pos].nth_last)); - pos = tokens[pos].nth_last + 1; - } else { - x.push(tokens[pos++].value); - } - - return x; - } - - /** - * Check if token is part of `even` or `odd` nth-selector's identifier - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNth2(i) { - return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNthf(i) { - var start = i, - l = 0; - - if (tokens[i++].type !== TokenType.Colon) return 0; - - // There was `:`: - l++; - - if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0; - - // There was either `nth-` or `last-`: - l += 2; - - if ('child' === tokens[i].value) { - l += 1; - } else if ('last-child' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('last-of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value + - tokens[i + 3].value + - tokens[i + 4].value) { - l += 5; - } else return 0; - - tokens[start + 1].nthf_last = start + l - 1; - - return l; - } - - /** - * @returns {String} - */ - function getNthf() { - pos++; - - var s = joinValues(pos, tokens[pos].nthf_last); - - pos = tokens[pos].nthf_last + 1; - - return s; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkNthselector(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkNthf(i)) i += l; - else return 0; - - if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0; - - l++; - - var rp = tokens[i++].right; - - while (i < rp) { - if (l = checkSC(i) || - checkUnary(i) || - checkInterpolation(i) || - checkNth(i)) i += l; - else return 0; - } - - return rp - start + 1; - } - - /** - * @returns {Array} - */ - function getNthselector() { - var startPos = pos, - nthf = [NodeType.IdentType, getNthf()], - x = [NodeType.NthselectorType]; - - x.push(nthf); - - pos++; - - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkUnary(pos)) x.push(getUnary()); - else if (checkInterpolation(pos)) x.push(getInterpolation()); - else if (checkNth(pos)) x.push(getNth()); - } - - pos++; - - return x; - } - - /** - * Check if token is part of a number - * @param {Number} i Token's index number - * @returns {Number} Length of number - */ - function checkNumber(i) { - if (i >= tokensLength) return 0; - - if (tokens[i].number_l) return tokens[i].number_l; - - // `10`: - if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && - (!tokens[i + 1] || - (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) - return (tokens[i].number_l = 1, tokens[i].number_l); - - // `10.`: - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber))) - return (tokens[i].number_l = 2, tokens[i].number_l); - - // `.10`: - if (i < tokensLength && - tokens[i].type === TokenType.FullStop && - tokens[i + 1].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 2, tokens[i].number_l); - - // `10.10`: - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 3, tokens[i].number_l); - - return 0; - } - - /** - * Get node with number - * @returns {Array} `['number', x]` where `x` is a number converted - * to string. - */ - function getNumber() { - var s = '', - startPos = pos, - l = tokens[pos].number_l, - x = [NodeType.NumberType]; - - for (var j = 0; j < l; j++) { - s += tokens[pos + j].value; - } - - pos += l; - - x.push(s); - - return x; - } - - /** - * Check if token is an operator (`/`, `,`, `:` or `=`). - * @param {Number} i Token's index number - * @returns {Number} `1` if token is an operator, otherwise `0` - */ - function checkOperator(i) { - if (i >= tokensLength) return 0; - - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - case TokenType.LessThanSign: - case TokenType.GreaterThanSign: - case TokenType.Asterisk: - return 1; - } - - return 0; - } - - /** - * Get node with an operator - * @returns {Array} `['operator', x]` where `x` is an operator converted - * to string. - */ - function getOperator() { - var startPos = pos, - x = [NodeType.OperatorType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is a parent selector (`&`). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkParentSelector(i) { - return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0; - } - - /** - * Get node with a parent selector - * @returns {Array} `['parentSelector']` - */ - function getParentSelector() { - var startPos = pos, - x = [NodeType.ParentSelectorType, '&']; - - pos++; - - return x; - } - - /** - * Check if token is part of a number with percent sign (e.g. `10%`) - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPercentage(i) { - var x; - - if (i >= tokensLength) return 0; - - x = checkNumber(i); - - if (!x || i + x >= tokensLength) return 0; - - return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0; - } - - /** - * Get node of number with percent sign - * @returns {Array} `['percentage', ['number', x]]` where `x` is a number - * (without percent sign) converted to string. - */ - function getPercentage() { - var startPos = pos, - x = [NodeType.PercentageType, getNumber()]; - - pos++; - - return x; - } - - /** - * Check if token is part of a placeholder selector (e.g. `%abc`). - * @param {Number} i Token's index number - * @returns {Number} Length of the selector - */ - function checkPlaceholder(i) { - var l; - - if (i >= tokensLength) return 0; - - if (tokens[i].placeholder_l) return tokens[i].placeholder_l; - - if (tokens[i].type === TokenType.PercentSign && (l = checkIdent(i + 1))) { - tokens[i].placeholder_l = l + 1; - return l + 1; - } else return 0; - } - - /** - * Get node with a placeholder selector - * @returns {Array} `['placeholder', ['ident', x]]` where x is a placeholder's - * identifier (without `%`, e.g. `abc`). - */ - function getPlaceholder() { - var startPos = pos, - x = [NodeType.PlaceholderType]; - - pos++; - - x.push(getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkProgid(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6; - else return 0; - - if (l = checkIdent(i)) i += l; - else return 0; - - if (l = checkSC(i)) i += l; - - if (tokens[i].type === TokenType.LeftParenthesis) { - tokens[start].progid_end = tokens[i].right; - i = tokens[i].right + 1; - } else return 0; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * @returns {Array} - */ - function getProgid() { - var startPos = pos, - progid_end = tokens[pos].progid_end, - x; - - x = [NodeType.ProgidType] - .concat(getSC()) - .concat([_getProgid(progid_end)]) - .concat(getSC()); - - return x; - } - - /** - * @param {Number} progid_end - * @returns {Array} - */ - function _getProgid(progid_end) { - var startPos = pos, - x = [NodeType.RawType, joinValues(pos, progid_end)]; - - pos = progid_end + 1; - - return x; - } - - /** - * Check if token is part of a property - * @param {Number} i Token's index number - * @returns {Number} Length of the property - */ - function checkProperty(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkVariable(i) || checkIdent(i)) i += l; - else return 0; - - return i - start; - } - - /** - * Get node with a property - * @returns {Array} `['property', x]` - */ - function getProperty() { - var startPos = pos, - x = [NodeType.PropertyType]; - - x.push(checkVariable(pos) ? getVariable() : getIdent()); - - return x; - } - - /** - * Check if token is a colon - * @param {Number} i Token's index number - * @returns {Number} `1` if token is a colon, otherwise `0` - */ - function checkPropertyDelim(i) { - return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0; - } - - /** - * Get node with a colon - * @returns {Array} `['propertyDelim']` - */ - function getPropertyDelim() { - var startPos = pos, - x = [NodeType.PropertyDelimType]; - - pos++; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudo(i) { - return checkPseudoe(i) || - checkPseudoc(i); - } - - /** - * @returns {Array} - */ - function getPseudo() { - if (checkPseudoe(pos)) return getPseudoe(); - if (checkPseudoc(pos)) return getPseudoc(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudoe(i) { - var l; - - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - - return (l = checkInterpolation(i) || checkIdent(i)) ? l + 2 : 0; - } - - /** - * @returns {Array} - */ - function getPseudoe() { - var startPos = pos, - x = [NodeType.PseudoeType]; - - pos += 2; - - x.push(checkInterpolation(pos) ? getInterpolation() : getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkPseudoc(i) { - var l; - - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - - return (l = checkInterpolation(i) || checkFunction(i) || checkIdent(i)) ? l + 1 : 0; - } - - /** - * @returns {Array} - */ - function getPseudoc() { - var startPos = pos, - x = [NodeType.PseudocType]; - - pos ++; - - if (checkInterpolation(pos)) x.push(getInterpolation()); - else if (checkFunction(pos)) x.push(getFunction()); - else x.push(getIdent()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkRuleset(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (tokens[start].ruleset_l) return tokens[start].ruleset_l; - - while (i < tokensLength) { - if (l = checkBlock(i)) {i += l; break;} - else if (l = checkSelector(i)) i += l; - else return 0; - } - - tokens[start].ruleset_l = i - start; - - return i - start; - } - - /** - * @returns {Array} - */ - function getRuleset() { - var startPos = pos, - x = [NodeType.RulesetType]; - - while (pos < tokensLength) { - if (checkBlock(pos)) {x.push(getBlock()); break;} - else if (checkSelector(pos)) x.push(getSelector()); - else break; - } - - return x; - } - - /** - * Check if token is marked as a space (if it's a space or a tab - * or a line break). - * @param i - * @returns {Number} Number of spaces in a row starting with the given token. - */ - function checkS(i) { - return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0; - } - - /** - * Get node with spaces - * @returns {Array} `['s', x]` where `x` is a string containing spaces - */ - function getS() { - var startPos = pos, - x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)]; - - pos = tokens[pos].ws_last + 1; - - return x; - } - - /** - * Check if token is a space or a comment. - * @param {Number} i Token's index number - * @returns {Number} Number of similar (space or comment) tokens - * in a row starting with the given token. - */ - function checkSC(i) { - if (i >= tokensLength) return 0; - - var l, - lsc = 0, - ln = tokens[i].ln; - - while (i < tokensLength) { - if (!(l = checkS(i)) && - !(l = checkCommentML(i)) && - !(l = checkCommentSL(i))) break; - i += l; - lsc += l; - } - - return lsc || 0; - } - - /** - * Get node with spaces and comments - * @returns {Array} Array containing nodes with spaces (if there are any) - * and nodes with comments (if there are any): - * `[['s', x]*, ['comment', y]*]` where `x` is a string of spaces - * and `y` is a comment's text (without `/*` and `* /`). - */ - function getSC() { - var sc = []; - - if (pos >= tokensLength) return sc; - - while (pos < tokensLength) { - if (checkS(pos)) sc.push(getS()); - else if (checkCommentML(pos)) sc.push(getCommentML()); - else if (checkCommentSL(pos)) sc.push(getCommentSL()); - else break; - } - - return sc; - } - - /** - * Check if token is part of a selector - * @param {Number} i Token's index number - * @returns {Number} Length of the selector - */ - function checkSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector(i) || checkDelim(i)) i += l; - else break; - } - - if (i !== start) tokens[start].selector_end = i - 1; - - return i - start; - } - - /** - * @returns {Array} - */ - function getSelector() { - var startPos = pos, - x = [NodeType.SelectorType], - selector_end = tokens[pos].selector_end; - - while (pos <= selector_end) { - x.push(checkDelim(pos) ? getDelim() : getSimpleSelector()); - } - - return x; - } - - /** - * Check if token is part of a hexadecimal number (e.g. `#fff`) inside - * a simple selector - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkShash(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - - return (l = checkNmName(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a hexadecimal number (e.g. `#fff`) inside a simple - * selector - * @returns {Array} `['shash', x]` where `x` is a hexadecimal number - * converted to string (without `#`, e.g. `fff`) - */ - function getShash() { - var startPos = pos, - x = [NodeType.ShashType]; - - pos++; - - x.push(getNmName()); - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSimpleSelector1(i)) i += l; - else break; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getSimpleSelector() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - - while (pos < tokensLength) { - if (!checkSimpleSelector1(pos)) break; - t = getSimpleSelector1(); - - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector1(i) { - return checkParentSelector(i) || - checkNthselector(i) || - checkCombinator(i) || - checkAttrib(i) || - checkPseudo(i) || - checkShash(i) || - checkAny(i) || - checkSC(i) || - checkNamespace(i); - } - - /** - * @returns {Array} - */ - function getSimpleSelector1() { - if (checkParentSelector(pos)) return getParentSelector(); - else if (checkNthselector(pos)) return getNthselector(); - else if (checkCombinator(pos)) return getCombinator(); - else if (checkAttrib(pos)) return getAttrib(); - else if (checkPseudo(pos)) return getPseudo(); - else if (checkShash(pos)) return getShash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkNamespace(pos)) return getNamespace(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkSimpleSelector2(i) { - return checkParentSelector(i) || - checkNthselector(i) || - checkAttrib(i) || - checkPseudo(i) || - checkShash(i) || - checkPlaceholder(i) || - checkIdent(i) || - checkClass(i); - } - - /** - * @returns {Array} - */ - function getSimpleSelector2() { - if (checkParentSelector(pos)) return getParentSelector(); - else if (checkNthselector(pos)) return getNthselector(); - else if (checkAttrib(pos)) return getAttrib(); - else if (checkPseudo(pos)) return getPseudo(); - else if (checkShash(pos)) return getShash(); - else if (checkPlaceholder(pos)) return getPlaceholder(); - else if (checkIdent(pos)) return getIdent(); - else if (checkClass(pos)) return getClass(); - } - - /** - * Check if token is part of a string (text wrapped in quotes) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is part of a string, `0` if not - */ - function checkString(i) { - return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0; - } - - /** - * Get string's node - * @returns {Array} `['string', x]` where `x` is a string (including - * quotes). - */ - function getString() { - var startPos = pos, - x = [NodeType.StringType, tokens[pos++].value]; - - return x; - } - - /** - * Validate stylesheet: it should consist of any number (0 or more) of - * rulesets (sets of rules with selectors), @-rules, whitespaces or - * comments. - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkStylesheet(i) { - var start = i, - l; - - while (i < tokensLength) { - if (l = checkSC(i) || - checkDeclaration(i) || - checkDeclDelim(i) || - checkInclude(i) || - checkMixin(i) || - checkLoop(i) || - checkConditionalStatement(i) || - checkAtrule(i) || - checkRuleset(i)) i += l; - else throwError(i); - } - - return i - start; - } - - /** - * @returns {Array} `['stylesheet', x]` where `x` is all stylesheet's - * nodes. - */ - function getStylesheet() { - var startPos = pos, - x = [NodeType.StylesheetType]; - - while (pos < tokensLength) { - if (checkSC(pos)) x = x.concat(getSC()); - else if (checkRuleset(pos)) x.push(getRuleset()); - else if (checkInclude(pos)) x.push(getInclude()); - else if (checkMixin(pos)) x.push(getMixin()); - else if (checkLoop(pos)) x.push(getLoop()); - else if (checkConditionalStatement(pos)) x.push(getConditionalStatement()); - else if (checkAtrule(pos)) x.push(getAtrule()); - else if (checkDeclaration(pos)) x.push(getDeclaration()); - else if (checkDeclDelim(pos)) x.push(getDeclDelim()); - else throwError(); - } - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkTset(i) { - return checkVhash(i) || - checkAny(i) || - checkSC(i) || - checkOperator(i); - } - - /** - * @returns {Array} - */ - function getTset() { - if (checkVhash(pos)) return getVhash(); - else if (checkAny(pos)) return getAny(); - else if (checkSC(pos)) return getSC(); - else if (checkOperator(pos)) return getOperator(); - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkTsets(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - while (l = checkTset(i)) { - i += l; - } - - return i - start; - } - - /** - * @returns {Array} - */ - function getTsets() { - var x = [], - t; - - while (t = getTset()) { - if (typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - - return x; - } - - /** - * Check if token is an unary (arithmetical) sign (`+` or `-`) - * @param {Number} i Token's index number - * @returns {Number} `1` if token is an unary sign, `0` if not - */ - function checkUnary(i) { - return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0; - } - - /** - * Get node with an unary (arithmetical) sign (`+` or `-`) - * @returns {Array} `['unary', x]` where `x` is an unary sign - * converted to string. - */ - function getUnary() { - var startPos = pos, - x = [NodeType.UnaryType, tokens[pos++].value]; - - return x; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkUnknown(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - } - - /** - * @returns {Array} - */ - function getUnknown() { - var startPos = pos, - x = [NodeType.UnknownType, tokens[pos++].value]; - - return x; - } - - /** - * Check if token is part of URI (e.g. `url('/css/styles.css')`) - * @param {Number} i Token's index number - * @returns {Number} Length of URI - */ - function checkUri(i) { - var start = i; - - if (i >= tokensLength || tokens[i++].value !== 'url' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) - return 0; - - return tokens[i].right - start + 1; - } - - /** - * Get node with URI - * @returns {Array} `['uri', x]` where `x` is URI's nodes (without `url` - * and braces, e.g. `['string', ''/css/styles.css'']`). - */ - function getUri() { - var startPos = pos, - uriExcluding = {}, - uri, - l, - raw; - - pos += 2; - - uriExcluding[TokenType.Space] = 1; - uriExcluding[TokenType.Tab] = 1; - uriExcluding[TokenType.Newline] = 1; - uriExcluding[TokenType.LeftParenthesis] = 1; - uriExcluding[TokenType.RightParenthesis] = 1; - - if (checkUri1(pos)) { - uri = [NodeType.UriType] - .concat(getSC()) - .concat([getString()]) - .concat(getSC()); - - pos++; - } else { - uri = [NodeType.UriType].concat(getSC()), - l = checkExcluding(uriExcluding, pos), - raw = [NodeType.RawType, joinValues(pos, pos + l)]; - - uri.push(raw); - - pos += l + 1; - - uri = uri.concat(getSC()); - - pos++; - } - - return uri; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkUri1(i) { - var start = i, - l; - - if (i >= tokensLength) return 0; - - if (l = checkSC(i)) i += l; - - if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0; - - i++; - - if (l = checkSC(i)) i += l; - - return i - start; - } - - /** - * Check if token is part of a value - * @param {Number} i Token's index number - * @returns {Number} Length of the value - */ - function checkValue(i) { - var start = i, - l, s, _i; - - while (i < tokensLength) { - if (checkDeclDelim(i)) break; - - s = checkS(i); - _i = i + s; - - if (l = _checkValue(_i)) i += l + s; - if (!l || checkBlock(i - l)) break; - } - - return i - start; - } - - /** - * @param {Number} i Token's index number - * @returns {Number} - */ - function _checkValue(i) { - return checkInterpolation(i) || - checkVariable(i) || - checkVhash(i) || - checkBlock(i) || - checkAny(i) || - checkAtkeyword(i) || - checkOperator(i) || - checkImportant(i) || - checkDefault(i); - } - - /** - * @returns {Array} - */ - function getValue() { - var startPos = pos, - x = [NodeType.ValueType], - t, _pos, s; - - while (pos < tokensLength) { - s = checkS(pos); - _pos = pos + s; - - if (checkDeclDelim(_pos)) break; - - if (!_checkValue(_pos)) break; - - if (s) x.push(getS()); - x.push(_getValue()); - - if (checkBlock(_pos)) break; - } - - return x; - } - - /** - * @returns {Array} - */ - function _getValue() { - if (checkInterpolation(pos)) return getInterpolation(); - else if (checkVariable(pos)) return getVariable(); - else if (checkVhash(pos)) return getVhash(); - else if (checkBlock(pos)) return getBlock(); - else if (checkAny(pos)) return getAny(); - else if (checkAtkeyword(pos)) return getAtkeyword(); - else if (checkOperator(pos)) return getOperator(); - else if (checkImportant(pos)) return getImportant(); - else if (checkDefault(pos)) return getDefault(); - } - - /** - * Check if token is part of a variable - * @param {Number} i Token's index number - * @returns {Number} Length of the variable - */ - function checkVariable(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.DollarSign) return 0; - - return (l = checkIdent(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a variable - * @returns {Array} `['variable', ['ident', x]]` where `x` is - * a variable name. - */ - function getVariable() { - var startPos = pos, - x = [NodeType.VariableType]; - - pos++; - - x.push(getIdent()); - - return x; - } - - /** - * Check if token is part of a variables list (e.g. `$values...`). - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkVariablesList(i) { - var d = 0, // number of dots - l; - - if (i >= tokensLength) return 0; - - if (l = checkVariable(i)) i+= l; - else return 0; - - while (i < tokensLength && tokens[i].type === TokenType.FullStop) { - d++; - i++; - } - - return d === 3 ? l + d : 0; - } - - /** - * Get node with a variables list - * @returns {Array} `['variableslist', ['variable', ['ident', x]]]` where - * `x` is a variable name. - */ - function getVariablesList() { - var startPos = pos, - x = [NodeType.VariablesListType, getVariable()]; - - pos += 3; - - return x; - } - - /** - * Check if token is part of a hexadecimal number (e.g. `#fff`) inside - * some value - * @param {Number} i Token's index number - * @returns {Number} - */ - function checkVhash(i) { - var l; - - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - - return (l = checkNmName2(i + 1)) ? l + 1 : 0; - } - - /** - * Get node with a hexadecimal number (e.g. `#fff`) inside some value - * @returns {Array} `['vhash', x]` where `x` is a hexadecimal number - * converted to string (without `#`, e.g. `'fff'`). - */ - function getVhash() { - var startPos = pos, - x = [NodeType.VhashType]; - - pos++; - - x.push(getNmName2()); - - return x; - } - - return function(_tokens, rule) { - tokens = _tokens; - tokensLength = tokens.length; - pos = 0; - - return rules[rule](); - }; -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/stringify.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/stringify.js deleted file mode 100644 index bed2718..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/stringify.js +++ /dev/null @@ -1,117 +0,0 @@ -module.exports = function stringify(tree) { - // TODO: Better error message - if (!tree) throw new Error('We need tree to translate'); - - var _m_simple = { - 'attrselector': 1, 'combinator': 1, 'nth': 1, 'number': 1, - 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1 - }, - _m_composite = { - 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, - 'conditionalStatement': 1, - 'declaration': 1, 'dimension': 1, 'filterv': 1, 'function': 1, - 'ident': 1, 'include': 1, - 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1, - 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 - }, - _m_primitive = { - 'declDelim': ';', 'delim': ',', - 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' - }; - - function _t(tree) { - var t = tree[0]; - if (t in _m_primitive) return _m_primitive[t]; - else if (t in _m_simple) return _simple(tree); - else if (t in _m_composite) return _composite(tree); - return _unique[t](tree); - } - - function _composite(t, i) { - var s = ''; - i = i === undefined ? 1 : i; - for (; i < t.length; i++) s += typeof t[i] === 'string' ? t[i] : _t(t[i]); - return s; - } - - function _simple(t) { - return t[1]; - } - - var _unique = { - 'arguments': function(t) { - return '(' + _composite(t) + ')'; - }, - 'atkeyword': function(t) { - return '@' + _t(t[1]); - }, - 'atruler': function(t) { - return _t(t[1]) + _t(t[2]) + '{' + _t(t[3]) + '}'; - }, - 'attrib': function(t) { - return '[' + _composite(t) + ']'; - }, - 'block': function(t) { - return '{' + _composite(t) + '}'; - }, - 'braces': function(t) { - return t[1] + _composite(t, 3) + t[2]; - }, - 'class': function(t) { - return '.' + _t(t[1]); - }, - 'commentML': function (t) { - return '/*' + t[1] + '*/'; - }, - 'commentSL': function (t) { - return '/' + '/' + t[1]; - }, - 'default': function(t) { - return '!' + _composite(t) + 'default'; - }, - 'filter': function(t) { - return _t(t[1]) + ':' + _t(t[2]); - }, - 'functionExpression': function(t) { - return 'expression(' + t[1] + ')'; - }, - 'important': function(t) { - return '!' + _composite(t) + 'important'; - }, - 'interpolation': function(t) { - return '#{' + _t(t[1]) + '}'; - }, - 'nthselector': function(t) { - return ':' + _simple(t[1]) + '(' + _composite(t, 2) + ')'; - }, - 'percentage': function(t) { - return _t(t[1]) + '%'; - }, - 'placeholder': function(t) { - return '%' + _t(t[1]); - }, - 'pseudoc': function(t) { - return ':' + _t(t[1]); - }, - 'pseudoe': function(t) { - return '::' + _t(t[1]); - }, - 'shash': function (t) { - return '#' + t[1]; - }, - 'uri': function(t) { - return 'url(' + _composite(t) + ')'; - }, - 'variable': function(t) { - return '$' + _t(t[1]); - }, - 'variableslist': function(t) { - return _t(t[1]) + '...'; - }, - 'vhash': function(t) { - return '#' + t[1]; - } - }; - - return _t(tree); -} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/tokenizer.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/tokenizer.js deleted file mode 100644 index e67d138..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/scss/tokenizer.js +++ /dev/null @@ -1,252 +0,0 @@ -module.exports = function(css) { - var TokenType = require('../token-types'); - - var tokens = [], - urlMode = false, - blockMode = 0, - c, // current character - cn, // next character - pos = 0, - tn = 0, - ln = 1; - - var Punctuation = { - ' ': TokenType.Space, - '\n': TokenType.Newline, - '\r': TokenType.Newline, - '\t': TokenType.Tab, - '!': TokenType.ExclamationMark, - '"': TokenType.QuotationMark, - '#': TokenType.NumberSign, - '$': TokenType.DollarSign, - '%': TokenType.PercentSign, - '&': TokenType.Ampersand, - '\'': TokenType.Apostrophe, - '(': TokenType.LeftParenthesis, - ')': TokenType.RightParenthesis, - '*': TokenType.Asterisk, - '+': TokenType.PlusSign, - ',': TokenType.Comma, - '-': TokenType.HyphenMinus, - '.': TokenType.FullStop, - '/': TokenType.Solidus, - ':': TokenType.Colon, - ';': TokenType.Semicolon, - '<': TokenType.LessThanSign, - '=': TokenType.EqualsSign, - '>': TokenType.GreaterThanSign, - '?': TokenType.QuestionMark, - '@': TokenType.CommercialAt, - '[': TokenType.LeftSquareBracket, - ']': TokenType.RightSquareBracket, - '^': TokenType.CircumflexAccent, - '_': TokenType.LowLine, - '{': TokenType.LeftCurlyBracket, - '|': TokenType.VerticalLine, - '}': TokenType.RightCurlyBracket, - '~': TokenType.Tilde - }; - - /** - * Add a token to the token list - * @param {string} type - * @param {string} value - */ - function pushToken(type, value) { - tokens.push({ tn: tn++, ln: ln, type: type, value: value }); - } - - /** - * Check if a character is a decimal digit - * @param {string} c Character - * @returns {boolean} - */ - function isDecimalDigit(c) { - return '0123456789'.indexOf(c) >= 0; - } - - /** - * Parse spaces - * @param {string} css Unparsed part of CSS string - */ - function parseSpaces(css) { - var start = pos; - - // Read the string until we meet a non-space character: - for (; pos < css.length; pos++) { - if (css.charAt(pos) !== ' ') break; - } - - // Add a substring containing only spaces to tokens: - pushToken(TokenType.Space, css.substring(start, pos)); - pos--; - } - - /** - * Parse a string within quotes - * @param {string} css Unparsed part of CSS string - * @param {string} q Quote (either `'` or `"`) - */ - function parseString(css, q) { - var start = pos; - - // Read the string until we meet a matching quote: - for (pos = pos + 1; pos < css.length; pos++) { - // Skip escaped quotes: - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) === q) break; - } - - // Add the string (including quotes) to tokens: - pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1)); - } - - /** - * Parse numbers - * @param {string} css Unparsed part of CSS string - */ - function parseDecimalNumber(css) { - var start = pos; - - // Read the string until we meet a character that's not a digit: - for (; pos < css.length; pos++) { - if (!isDecimalDigit(css.charAt(pos))) break; - } - - // Add the number to tokens: - pushToken(TokenType.DecimalNumber, css.substring(start, pos)); - pos--; - } - - /** - * Parse identifier - * @param {string} css Unparsed part of CSS string - */ - function parseIdentifier(css) { - var start = pos; - - // Skip all opening slashes: - while (css.charAt(pos) === '/') pos++; - - // Read the string until we meet a punctuation mark: - for (; pos < css.length; pos++) { - // Skip all '\': - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) in Punctuation) break; - } - - var ident = css.substring(start, pos); - - // Enter url mode if parsed substring is `url`: - urlMode = urlMode || ident === 'url'; - - // Add identifier to tokens: - pushToken(TokenType.Identifier, ident); - pos--; - } - - /** - * Parse a multiline comment - * @param {string} css Unparsed part of CSS string - */ - function parseMLComment(css) { - var start = pos; - - // Read the string until we meet `*/`. - // Since we already know first 2 characters (`/*`), start reading - // from `pos + 2`: - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') { - pos++; - break; - } - } - - // Add full comment (including `/*` and `*/`) to the list of tokens: - pushToken(TokenType.CommentML, css.substring(start, pos + 1)); - } - - /** - * Parse a single line comment - * @param {string} css Unparsed part of CSS string - */ - function parseSLComment(css) { - var start = pos; - - // Read the string until we meet line break. - // Since we already know first 2 characters (`//`), start reading - // from `pos + 2`: - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { - break; - } - } - - // Add comment (including `//` and line break) to the list of tokens: - pushToken(TokenType.CommentSL, css.substring(start, pos)); - pos--; - } - - /** - * Convert a CSS string to a list of tokens - * @param {string} css CSS string - * @returns {Array} List of tokens - * @private - */ - function getTokens(css) { - // Parse string, character by character: - for (pos = 0; pos < css.length; pos++) { - c = css.charAt(pos); - cn = css.charAt(pos + 1); - - // If we meet `/*`, it's a start of a multiline comment. - // Parse following characters as a multiline comment: - if (c === '/' && cn === '*') { - parseMLComment(css); - } - - // If we meet `//` and it is not a part of url: - else if (!urlMode && c === '/' && cn === '/') { - // If we're currently inside a block, treat `//` as a start - // of identifier. Else treat `//` as a start of a single-line - // comment: - parseSLComment(css); - } - - // If current character is a double or single quote, it's a start - // of a string: - else if (c === '"' || c === "'") { - parseString(css, c); - } - - // If current character is a space: - else if (c === ' ') { - parseSpaces(css) - } - - // If current character is a punctuation mark: - else if (c in Punctuation) { - // Add it to the list of tokens: - pushToken(Punctuation[c], c); - if (c === '\n' || c === '\r') ln++; // Go to next line - if (c === ')') urlMode = false; // exit url mode - if (c === '{') blockMode++; // enter a block - if (c === '}') blockMode--; // exit a block - } - - // If current character is a decimal digit: - else if (isDecimalDigit(c)) { - parseDecimalNumber(css); - } - - // If current character is anything else: - else { - parseIdentifier(css); - } - } - - return tokens; - } - - return getTokens(css); -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/src-to-ast.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/src-to-ast.js deleted file mode 100644 index 9292d52..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/src-to-ast.js +++ /dev/null @@ -1,75 +0,0 @@ -module.exports = (function() { - function throwError(e, src) { - var line = e.line; - var name = 'Parsing error'; - var version = require('../package.json').version; - var message = formatErrorMessage(src, line, version); - var error = { - line: line, - syntax: e.syntax, - version: version, - name: name, - message: message - } - error.toString = function() {return this.name + ': ' + this.message;}; - throw error; - } - - function formatErrorMessage(text, ln, version) { - var message = ['Please check the validity of the block starting from line #' + ln]; - - message.push(''); - var code = formatCodeFragment(text, ln); - message = message.concat(code); - message.push(''); - - message.push('Gonzales PE version: ' + version); - - return message.join('\n'); - } - - function formatCodeFragment(text, lineNumber) { - var lines = text.split(/\r\n|\r|\n/); - var linesAround = 2; - var result = []; - - for (var i = lineNumber - 1 - linesAround; i < lineNumber + linesAround; i++) { - var line = lines[i]; - if (!line) continue; - var ln = i + 1; - var mark = ln === lineNumber ? '*' : ' '; - result.push(ln + mark + '| ' + line); - } - - return result; - } - - return function(options) { - var src, rule, syntax, getTokens, mark, rules, tokens, ast; - - if (!options || !options.src) throw new Error('Please, pass a string to parse'); - - src = typeof options === 'string' ? options : options.src; - syntax = options.syntax || 'css'; - rule = options.rule || (syntax === 'js' ? 'program' : 'stylesheet'); - - var fs = require('fs'); - if (!fs.existsSync(__dirname + '/' + syntax)) - return console.error('Syntax "' + syntax + '" is not supported yet, sorry'); - - getTokens = require('./' + syntax + '/tokenizer'); - mark = require('./' + syntax + '/mark'); - rules = require('./' + syntax + '/rules'); - - tokens = getTokens(src); - mark(tokens); - - try { - ast = rules(tokens, rule); - } catch (e) { - throwError(e, src); - } - - return ast; - } -})(); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/lib/token-types.js b/node_modules/csscomb/node_modules/gonzales-pe/lib/token-types.js deleted file mode 100644 index 8fa6fb0..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/lib/token-types.js +++ /dev/null @@ -1,45 +0,0 @@ -module.exports = { - StringSQ: 'StringSQ', - StringDQ: 'StringDQ', - CommentML: 'CommentML', - CommentSL: 'CommentSL', - - Newline: 'Newline', - Space: 'Space', - Tab: 'Tab', - - ExclamationMark: 'ExclamationMark', // ! - QuotationMark: 'QuotationMark', // " - NumberSign: 'NumberSign', // # - DollarSign: 'DollarSign', // $ - PercentSign: 'PercentSign', // % - Ampersand: 'Ampersand', // & - Apostrophe: 'Apostrophe', // ' - LeftParenthesis: 'LeftParenthesis', // ( - RightParenthesis: 'RightParenthesis', // ) - Asterisk: 'Asterisk', // * - PlusSign: 'PlusSign', // + - Comma: 'Comma', // , - HyphenMinus: 'HyphenMinus', // - - FullStop: 'FullStop', // . - Solidus: 'Solidus', // / - Colon: 'Colon', // : - Semicolon: 'Semicolon', // ; - LessThanSign: 'LessThanSign', // < - EqualsSign: 'EqualsSign', // = - GreaterThanSign: 'GreaterThanSign', // > - QuestionMark: 'QuestionMark', // ? - CommercialAt: 'CommercialAt', // @ - LeftSquareBracket: 'LeftSquareBracket', // [ - ReverseSolidus: 'ReverseSolidus', // \ - RightSquareBracket: 'RightSquareBracket', // ] - CircumflexAccent: 'CircumflexAccent', // ^ - LowLine: 'LowLine', // _ - LeftCurlyBracket: 'LeftCurlyBracket', // { - VerticalLine: 'VerticalLine', // | - RightCurlyBracket: 'RightCurlyBracket', // } - Tilde: 'Tilde', // ~ - - Identifier: 'Identifier', - DecimalNumber: 'DecimalNumber' -}; diff --git a/node_modules/csscomb/node_modules/gonzales-pe/package.json b/node_modules/csscomb/node_modules/gonzales-pe/package.json index 3c74109..a485f84 100644 --- a/node_modules/csscomb/node_modules/gonzales-pe/package.json +++ b/node_modules/csscomb/node_modules/gonzales-pe/package.json @@ -1,41 +1,112 @@ { - "name": "gonzales-pe", - "description": "Gonzales Preprocessor Edition (fast CSS parser)", - "version": "3.0.0-10", - "homepage": "http://github.com/tonyganch/gonzales-pe", - "bugs": { - "url": "http://github.com/tonyganch/gonzales-pe/issues" + "_args": [ + [ + { + "raw": "gonzales-pe@^3.4.7", + "scope": null, + "escapedName": "gonzales-pe", + "name": "gonzales-pe", + "rawSpec": "^3.4.7", + "spec": ">=3.4.7 <4.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb" + ] + ], + "_from": "gonzales-pe@>=3.4.7 <4.0.0", + "_id": "gonzales-pe@3.4.7", + "_inCache": true, + "_installable": true, + "_location": "/gonzales-pe", + "_nodeVersion": "5.0.0", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/gonzales-pe-3.4.7.tgz_1477171735581_0.0522250987123698" }, - "license": "MIT", + "_npmUser": { + "name": "tonyganch", + "email": "tonyganch+github@gmail.com" + }, + "_npmVersion": "3.3.6", + "_phantomChildren": {}, + "_requested": { + "raw": "gonzales-pe@^3.4.7", + "scope": null, + "escapedName": "gonzales-pe", + "name": "gonzales-pe", + "rawSpec": "^3.4.7", + "spec": ">=3.4.7 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-3.4.7.tgz", + "_shasum": "17c7be67ad6caff6277a3e387ac736e983d280ec", + "_shrinkwrap": null, + "_spec": "gonzales-pe@^3.4.7", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb", "author": { "name": "Tony Ganch", "email": "tonyganch+github@gmail.com", "url": "http://tonyganch.com" }, - "main": "./lib/gonzales", - "repository": { - "type": "git", - "url": "http://github.com/tonyganch/gonzales-pe.git" - }, - "scripts": { - "test": "(mkdir -p log && node ./test/mocha.js) | tee ./log/test.log" - }, "bin": { "gonzales": "./bin/gonzales.js" }, + "bugs": { + "url": "http://github.com/tonyganch/gonzales-pe/issues" + }, + "dependencies": { + "minimist": "1.1.x" + }, + "description": "Gonzales Preprocessor Edition (fast CSS parser)", "devDependencies": { - "benchmark": "~1.0.0", + "babel-loader": "^5.3.2", "coffee-script": "~1.7.1", - "microtime": "~0.3.3", - "mocha": "~1.20.0" + "eslint": "^3.0.0", + "jscs": "2.1.0", + "jshint": "2.8.0", + "json-loader": "^0.5.3", + "mocha": "2.2.x", + "webpack": "^1.12.2", + "webpack-closure-compiler": "^2.0.2" + }, + "directories": {}, + "dist": { + "shasum": "17c7be67ad6caff6277a3e387ac736e983d280ec", + "tarball": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-3.4.7.tgz" }, "engines": { "node": ">=0.6.0" }, - "readme": "Gonzales is a fast CSS parser. \nGonzales PE is a rework with support of preprocessors. \n\nCurrently those are supported: SCSS, Sass, LESS.\n\nFor a plan of future work see [issue #4](https://github.com/tonyganch/gonzales-pe/issues/4).\n\n## Install\n\nTo install globally:\n\n npm install gonzales-pe -g\n\nTo install as a project dependency:\n\n npm install gonzales-pe\n\nTo install dev branch:\n\n npm install git://github.com/tonyganch/gonzales-pe.git#dev\n\nTo clone from github:\n\n git clone git@github.com:tonyganch/gonzales-pe.git\n\n## Build\n\nIf you installed/cloned the repo from GitHub, make sure to build library files\nfirst. \nIt can be done by running `make` in the module's root directory. \n`make` will build both Node.js and web versions (all files are comments-free\nbut not compressed). \nIf you need a minified version for production, feel free to use uglifier of\nyour choice.\n\n## Use\n\nRequire Gonzales in your project:\n\n var gonzales = require('gonzales-pe');\n\nDo something:\n\n var css = 'a { color: tomato }';\n console.log(gonzales.cssToAST(css));\n\nYou can learn more about available methods on [Gonzales usage](doc/Gonzales-Usage.md) page.\n\nAST is described on [Gonzales AST description](doc/AST-Description.md) page.\n\nYou can also invoke gonzales via a shell command (if you globally install it via `npm install gonzales-pe -g`)\n\n```\ngonzales myFile.css\n```\n\nOutputs the AST for that file. Example output:\n\n```\n['stylesheet',\n ['atrules',\n ['atkeyword',\n ['ident', 'import']],\n ['s', '\n']]]\n```\n\n## Test\n\nTo run tests:\n\n npm test\n\nThis command will build library files from sources and run tests on all files\nin syntax directories.\n\nEvery test has 3 files: source stylesheet, expected AST and expected string\ncompiled back from AST to css.\n\nIf some tests fail, you can find information in test logs:\n\n- `log/test.log` contains all information from stdout;\n- `log/expected.txt` contains only expected text;\n- `log/result.txt` contains only result text.\n\nThe last two are made for your convenience: you can use any diff app to see\nthe defference between them.\n\nIf you want to test one specific string or get a general idea of how Gonzales\nworks, you can use `test/ast.js` file. \nSimply change the first two strings (`css` and `syntax` vars) and run:\n\n node test/ast.js\n\nPlease remember to also run `make` every time you modify any source files.\n\n## Report\n\nIf you find a bug or want to add a feature, welcome to [Issues](https://github.com/tonyganch/gonzales-pe/issues).\n\nIf you are shy but have a question, feel free to [drop me a\nline](mailto:tonyganch+gonzales@gmail.com).\n", - "readmeFilename": "README.md", - "gitHead": "8d860d993f2a645644c0e5bc0d59951cdb64990b", - "_id": "gonzales-pe@3.0.0-10", - "_shasum": "6dac1b7e4070118042de92c6ff7a8fc346255dde", - "_from": "gonzales-pe@>=3.0.0-0 <3.1.0-0" + "gitHead": "cad610ef9c7deb510d5edc87141e1788766a273b", + "homepage": "http://github.com/tonyganch/gonzales-pe", + "license": "MIT", + "main": "./lib/gonzales", + "maintainers": [ + { + "name": "tonyganch", + "email": "tonyganch@gmail.com" + } + ], + "name": "gonzales-pe", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/tonyganch/gonzales-pe.git" + }, + "scripts": { + "autofix-tests": "bash ./scripts/build.sh && bash ./scripts/autofix-tests.sh", + "build": "bash ./scripts/build.sh", + "init": "bash ./scripts/init.sh", + "lint": "bash ./scripts/lint.sh", + "log": "bash ./scripts/log.sh", + "postpublish": "bash ./scripts/postpublish.sh", + "prepublish": "bash ./scripts/prepublish.sh", + "test": "bash ./scripts/test.sh", + "watch": "bash ./scripts/watch.sh" + }, + "version": "3.4.7" } diff --git a/node_modules/csscomb/node_modules/gonzales-pe/tags b/node_modules/csscomb/node_modules/gonzales-pe/tags new file mode 100644 index 0000000..730eb83 --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/tags @@ -0,0 +1,19 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.8 // +ISTANBUL node_modules/Base64/Makefile /^ISTANBUL = node_modules\/.bin\/istanbul$/;" m +UGLIFYJS node_modules/Base64/Makefile /^UGLIFYJS = node_modules\/.bin\/uglifyjs$/;" m +XYZ node_modules/Base64/Makefile /^XYZ = node_modules\/.bin\/xyz --message X.Y.Z --tag X.Y.Z$/;" m +SRC node_modules/Base64/Makefile /^SRC = base64.js$/;" m +MIN node_modules/Base64/Makefile /^MIN = $(patsubst %.js,%.min.js,$(SRC))$/;" m +cliWidth node_modules/cli-width/coverage/lcov-report/cli-width/index.js.html /^function cliWidth() {$/;" f +require node_modules/clone/test.html /^ function require(moduleName) {$/;" f +log node_modules/clone/test.html /^ function log(str) {$/;" f +isUndefinedOrNull node_modules/clone/test.html /^ function isUndefinedOrNull(value) {$/;" f +isArguments node_modules/clone/test.html /^ function isArguments(object) {$/;" f +objEquiv node_modules/clone/test.html /^ function objEquiv(a, b) {$/;" f +_deepEqual node_modules/clone/test.html /^ function _deepEqual(actual, expected) {$/;" f +incFinished node_modules/clone/test.html /^ function incFinished() {$/;" f diff --git a/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.ast-to-css.js b/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.ast-to-css.js deleted file mode 100644 index 170b6bf..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.ast-to-css.js +++ /dev/null @@ -1,120 +0,0 @@ -function astToCSS(options) { - var tree, hasInfo, syntax; - if (!options) throw new Error('We need tree to translate'); - tree = typeof options === 'string' ? options : options.ast; - hasInfo = typeof tree[0] === 'object'; - syntax = options.syntax || 'css'; - var _m_simple = { - 'attrselector': 1, 'combinator': 1, 'ident': 1, 'nth': 1, 'number': 1, - 'operator': 1, 'raw': 1, 's': 1, 'string': 1, 'unary': 1, 'unknown': 1 - }, - _m_composite = { - 'atruleb': 1, 'atrulerq': 1, 'atrulers': 1, 'atrules': 1,'condition': 1, - 'declaration': 1, 'dimension': 1, 'filterv': 1, 'include': 1, - 'loop': 1, 'mixin': 1, 'selector': 1, 'progid': 1, 'property': 1, - 'ruleset': 1, 'simpleselector': 1, 'stylesheet': 1, 'value': 1 - }, - _m_primitive = { - 'cdc': 'cdc', 'cdo': 'cdo', - 'declDelim': syntax === 'sass' ? '\n' : ';', - 'delim': ',', - 'namespace': '|', 'parentselector': '&', 'propertyDelim' : ':' - }; - function _t(tree) { - var t = tree[hasInfo? 1 : 0]; - if (t in _m_primitive) return _m_primitive[t]; - else if (t in _m_simple) return _simple(tree); - else if (t in _m_composite) return _composite(tree); - return _unique[t](tree); - } - function _composite(t, i) { - var s = ''; - i = i === undefined ? (hasInfo? 2 : 1) : i; - for (; i < t.length; i++) s += _t(t[i]); - return s; - } - function _simple(t) { - return t[hasInfo? 2 : 1]; - } - var _unique = { - 'arguments': function(t) { - return '(' + _composite(t) + ')'; - }, - 'atkeyword': function(t) { - return '@' + _t(t[hasInfo? 2 : 1]); - }, - 'atruler': function(t) { - return _t(t[hasInfo? 2 : 1]) + _t(t[hasInfo? 3 : 2]) + '{' + _t(t[hasInfo? 4 : 3]) + '}'; - }, - 'attrib': function(t) { - return '[' + _composite(t) + ']'; - }, - 'block': function(t) { - return syntax === 'sass' ? _composite(t) : '{' + _composite(t) + '}'; - }, - 'braces': function(t) { - return t[hasInfo? 2 : 1] + _composite(t, hasInfo? 4 : 3) + t[hasInfo? 3 : 2]; - }, - 'class': function(t) { - return '.' + _t(t[hasInfo? 2 : 1]); - }, - 'commentML': function (t) { - return '/*' + t[hasInfo? 2 : 1] + (syntax === 'sass' ? '' : '*/'); - }, - 'commentSL': function (t) { - return '/' + '/' + t[hasInfo? 2 : 1]; - }, - 'default': function(t) { - return '!' + _composite(t) + 'default'; - }, - 'escapedString': function(t) { - return '~' + t[hasInfo? 2 : 1]; - }, - 'filter': function(t) { - return _t(t[hasInfo? 2 : 1]) + ':' + _t(t[hasInfo? 3 : 2]); - }, - 'functionExpression': function(t) { - return 'expression(' + t[hasInfo? 2 : 1] + ')'; - }, - 'function': function(t) { - return _simple(t[hasInfo? 2 : 1]) + '(' + _composite(t[hasInfo? 3: 2]) + ')'; - }, - 'important': function(t) { - return '!' + _composite(t) + 'important'; - }, - 'interpolatedVariable': function(t) { - return (syntax === 'less' ? '@{' : '#\{$') + _t(t[hasInfo? 2 : 1]) + '}'; - }, - 'nthselector': function(t) { - return ':' + _simple(t[hasInfo? 2 : 1]) + '(' + _composite(t, hasInfo? 3 : 2) + ')'; - }, - 'percentage': function(t) { - return _t(t[hasInfo? 2 : 1]) + '%'; - }, - 'placeholder': function(t) { - return '%' + _t(t[hasInfo? 2 : 1]); - }, - 'pseudoc': function(t) { - return ':' + _t(t[hasInfo? 2 : 1]); - }, - 'pseudoe': function(t) { - return '::' + _t(t[hasInfo? 2 : 1]); - }, - 'shash': function (t) { - return '#' + t[hasInfo? 2 : 1]; - }, - 'uri': function(t) { - return 'url(' + _composite(t) + ')'; - }, - 'variable': function(t) { - return (syntax === 'less' ? '@' : '$') + _t(t[hasInfo? 2 : 1]); - }, - 'variableslist': function(t) { - return _t(t[hasInfo? 2 : 1]) + '...'; - }, - 'vhash': function(t) { - return '#' + t[hasInfo? 2 : 1]; - } - }; - return _t(tree); -} diff --git a/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.css-to-ast.js b/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.css-to-ast.js deleted file mode 100644 index 8309322..0000000 --- a/node_modules/csscomb/node_modules/gonzales-pe/web/gonzales.css-to-ast.js +++ /dev/null @@ -1,3831 +0,0 @@ -var cssToAST = (function() { - var syntaxes = {}, - s, - needInfo, - tokens, - tokensLength, - tn = 0, - ln = 1, - pos = 0; - function pushToken(type, value) { - tokens.push({ tn: tn++, ln: ln, type: type, value: value }); - } - function throwError(i) { - var ln = i ? tokens[i].ln : tokens[pos].ln; - throw new Error('Please check the validity of the CSS block starting from the line #' + ln); - } - function getInfo(i) { - return { ln: tokens[i].ln, tn: tokens[i].tn }; - } - function checkExcluding(exclude, i) { - var start = i; - while(i < tokensLength) { - if (exclude[tokens[i++].type]) break; - } - return i - start - 2; - } - function joinValues(start, finish) { - var s = ''; - for (var i = start; i < finish + 1; i++) { - s += tokens[i].value; - } - return s; - } - function joinValues2(start, num) { - if (start + num - 1 >= tokensLength) return; - var s = ''; - for (var i = 0; i < num; i++) { - s += tokens[start + i].value; - } - return s; - } -var TokenType = { - StringSQ: 'StringSQ', - StringDQ: 'StringDQ', - CommentML: 'CommentML', - CommentSL: 'CommentSL', - Newline: 'Newline', - Space: 'Space', - Tab: 'Tab', - ExclamationMark: 'ExclamationMark', - QuotationMark: 'QuotationMark', - NumberSign: 'NumberSign', - DollarSign: 'DollarSign', - PercentSign: 'PercentSign', - Ampersand: 'Ampersand', - Apostrophe: 'Apostrophe', - LeftParenthesis: 'LeftParenthesis', - RightParenthesis: 'RightParenthesis', - Asterisk: 'Asterisk', - PlusSign: 'PlusSign', - Comma: 'Comma', - HyphenMinus: 'HyphenMinus', - FullStop: 'FullStop', - Solidus: 'Solidus', - Colon: 'Colon', - Semicolon: 'Semicolon', - LessThanSign: 'LessThanSign', - EqualsSign: 'EqualsSign', - GreaterThanSign: 'GreaterThanSign', - QuestionMark: 'QuestionMark', - CommercialAt: 'CommercialAt', - LeftSquareBracket: 'LeftSquareBracket', - ReverseSolidus: 'ReverseSolidus', - RightSquareBracket: 'RightSquareBracket', - CircumflexAccent: 'CircumflexAccent', - LowLine: 'LowLine', - LeftCurlyBracket: 'LeftCurlyBracket', - VerticalLine: 'VerticalLine', - RightCurlyBracket: 'RightCurlyBracket', - Tilde: 'Tilde', - Identifier: 'Identifier', - DecimalNumber: 'DecimalNumber' -}; -var NodeType = { - ArgumentsType: 'arguments', - AtkeywordType: 'atkeyword', - AtrulebType: 'atruleb', - AtrulerType: 'atruler', - AtrulerqType: 'atrulerq', - AtrulersType: 'atrulers', - AtrulesType: 'atrules', - AttribType: 'attrib', - AttrselectorType: 'attrselector', - BlockType: 'block', - BracesType: 'braces', - CdcType: 'cdc', - CdoType: 'cdo', - ClassType: 'class', - CombinatorType: 'combinator', - CommentMLType: 'commentML', - CommentSLType: 'commentSL', - ConditionType: 'condition', - DeclarationType: 'declaration', - DeclDelimType: 'declDelim', - DefaultType: 'default', - DelimType: 'delim', - DimensionType: 'dimension', - EscapedStringType: 'escapedString', - FilterType: 'filter', - FiltervType: 'filterv', - FunctionType: 'function', - FunctionBodyType: 'functionBody', - FunctionExpressionType: 'functionExpression', - IdentType: 'ident', - ImportantType: 'important', - IncludeType :'include', - InterpolatedVariableType: 'interpolatedVariable', - LoopType: 'loop', - MixinType: 'mixin', - NamespaceType: 'namespace', - NthType: 'nth', - NthselectorType: 'nthselector', - NumberType: 'number', - OperatorType: 'operator', - ParentSelectorType: 'parentselector', - PercentageType: 'percentage', - PlaceholderType: 'placeholder', - ProgidType: 'progid', - PropertyType: 'property', - PropertyDelimType: 'propertyDelim', - PseudocType: 'pseudoc', - PseudoeType: 'pseudoe', - RawType: 'raw', - RulesetType: 'ruleset', - SType: 's', - SelectorType: 'selector', - ShashType: 'shash', - SimpleselectorType: 'simpleselector', - StringType: 'string', - StylesheetType: 'stylesheet', - UnaryType: 'unary', - UnknownType: 'unknown', - UriType: 'uri', - ValueType: 'value', - VariableType: 'variable', - VariablesListType: 'variableslist', - VhashType: 'vhash' -}; -var getTokens = (function() { - var Punctuation, - urlMode = false, - blockMode = 0; - Punctuation = { - ' ': TokenType.Space, - '\n': TokenType.Newline, - '\r': TokenType.Newline, - '\t': TokenType.Tab, - '!': TokenType.ExclamationMark, - '"': TokenType.QuotationMark, - '#': TokenType.NumberSign, - '$': TokenType.DollarSign, - '%': TokenType.PercentSign, - '&': TokenType.Ampersand, - '\'': TokenType.Apostrophe, - '(': TokenType.LeftParenthesis, - ')': TokenType.RightParenthesis, - '*': TokenType.Asterisk, - '+': TokenType.PlusSign, - ',': TokenType.Comma, - '-': TokenType.HyphenMinus, - '.': TokenType.FullStop, - '/': TokenType.Solidus, - ':': TokenType.Colon, - ';': TokenType.Semicolon, - '<': TokenType.LessThanSign, - '=': TokenType.EqualsSign, - '>': TokenType.GreaterThanSign, - '?': TokenType.QuestionMark, - '@': TokenType.CommercialAt, - '[': TokenType.LeftSquareBracket, - ']': TokenType.RightSquareBracket, - '^': TokenType.CircumflexAccent, - '_': TokenType.LowLine, - '{': TokenType.LeftCurlyBracket, - '|': TokenType.VerticalLine, - '}': TokenType.RightCurlyBracket, - '~': TokenType.Tilde - }; - function isDecimalDigit(c) { - return '0123456789'.indexOf(c) >= 0; - } - function parseSpaces(css) { - var start = pos; - for (; pos < css.length; pos++) { - if (css.charAt(pos) !== ' ') break; - } - pushToken(TokenType.Space, css.substring(start, pos)); - pos--; - } - function parseString(css, q) { - var start = pos; - for (pos = pos + 1; pos < css.length; pos++) { - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) === q) break; - } - pushToken(q === '"' ? TokenType.StringDQ : TokenType.StringSQ, css.substring(start, pos + 1)); - } - function parseDecimalNumber(css) { - var start = pos; - for (; pos < css.length; pos++) { - if (!isDecimalDigit(css.charAt(pos))) break; - } - pushToken(TokenType.DecimalNumber, css.substring(start, pos)); - pos--; - } - function parseIdentifier(css) { - var start = pos; - while (css.charAt(pos) === '/') pos++; - for (; pos < css.length; pos++) { - if (css.charAt(pos) === '\\') pos++; - else if (css.charAt(pos) in Punctuation) break; - } - var ident = css.substring(start, pos); - urlMode = urlMode || ident === 'url'; - pushToken(TokenType.Identifier, ident); - pos--; - } - function _getTokens(css, syntax) { - var c, - cn; - tokens = []; - pos = 0; - tn = 0; - ln = 1; - for (pos = 0; pos < css.length; pos++) { - c = css.charAt(pos); - cn = css.charAt(pos + 1); - if (c === '/' && cn === '*') { - s.parseMLComment(css); - } - else if (!urlMode && c === '/' && cn === '/') { - if (syntax === 'css' && blockMode > 0) parseIdentifier(css); - else s.parseSLComment && s.parseSLComment(css); - } - else if (c === '"' || c === "'") { - parseString(css, c); - } - else if (c === ' ') { - parseSpaces(css) - } - else if (c in Punctuation) { - pushToken(Punctuation[c], c); - if (c === '\n' || c === '\r') ln++; - if (c === ')') urlMode = false; - if (c === '{') blockMode++; - if (c === '}') blockMode--; - } - else if (isDecimalDigit(c)) { - parseDecimalNumber(css); - } - else { - parseIdentifier(css); - } - } - } - return function(s, syntax) { - return _getTokens(s, syntax); - }; -}()); -var rules = { - 'arguments': function() { if (s.checkArguments(pos)) return s.getArguments() }, - 'atkeyword': function() { if (s.checkAtkeyword(pos)) return s.getAtkeyword() }, - 'atruleb': function() { if (s.checkAtruleb(pos)) return s.getAtruleb() }, - 'atruler': function() { if (s.checkAtruler(pos)) return s.getAtruler() }, - 'atrulerq': function() { if (s.checkAtrulerq(pos)) return s.getAtrulerq() }, - 'atrulers': function() { if (s.checkAtrulers(pos)) return s.getAtrulers() }, - 'atrules': function() { if (s.checkAtrules(pos)) return s.getAtrules() }, - 'attrib': function() { if (s.checkAttrib(pos)) return s.getAttrib() }, - 'attrselector': function() { if (s.checkAttrselector(pos)) return s.getAttrselector() }, - 'block': function() { if (s.checkBlock(pos)) return s.getBlock() }, - 'braces': function() { if (s.checkBraces(pos)) return s.getBraces() }, - 'class': function() { if (s.checkClass(pos)) return s.getClass() }, - 'combinator': function() { if (s.checkCombinator(pos)) return s.getCombinator() }, - 'commentML': function() { if (s.checkCommentML(pos)) return s.getCommentML() }, - 'commentSL': function() { if (s.checkCommentSL(pos)) return s.getCommentSL() }, - 'condition': function() { if (s.checkCondition(pos)) return s.getCondition() }, - 'declaration': function() { if (s.checkDeclaration(pos)) return s.getDeclaration() }, - 'declDelim': function() { if (s.checkDeclDelim(pos)) return s.getDeclDelim() }, - 'default': function () { if (s.checkDefault(pos)) return s.getDefault() }, - 'delim': function() { if (s.checkDelim(pos)) return s.getDelim() }, - 'dimension': function() { if (s.checkDimension(pos)) return s.getDimension() }, - 'escapedString': function() { if (s.checkEscapedString(pos)) return s.getEscapedString() }, - 'filter': function() { if (s.checkFilter(pos)) return s.getFilter() }, - 'filterv': function() { if (s.checkFilterv(pos)) return s.getFilterv() }, - 'functionExpression': function() { if (s.checkFunctionExpression(pos)) return s.getFunctionExpression() }, - 'function': function() { if (s.checkFunction(pos)) return s.getFunction() }, - 'ident': function() { if (s.checkIdent(pos)) return s.getIdent() }, - 'important': function() { if (s.checkImportant(pos)) return s.getImportant() }, - 'include': function () { if (s.checkInclude(pos)) return s.getInclude() }, - 'interpolatedVariable': function () { if (s.checkInterpolatedVariable(pos)) return s.getInterpolatedVariable() }, - 'loop': function() { if (s.checkLoop(pos)) return s.getLoop() }, - 'mixin': function () { if (s.checkMixin(pos)) return s.getMixin() }, - 'namespace': function() { if (s.checkNamespace(pos)) return s.getNamespace() }, - 'nth': function() { if (s.checkNth(pos)) return s.getNth() }, - 'nthselector': function() { if (s.checkNthselector(pos)) return s.getNthselector() }, - 'number': function() { if (s.checkNumber(pos)) return s.getNumber() }, - 'operator': function() { if (s.checkOperator(pos)) return s.getOperator() }, - 'parentselector': function () { if (s.checkParentSelector(pos)) return s.getParentSelector() }, - 'percentage': function() { if (s.checkPercentage(pos)) return s.getPercentage() }, - 'placeholder': function() { if (s.checkPlaceholder(pos)) return s.getPlaceholder() }, - 'progid': function() { if (s.checkProgid(pos)) return s.getProgid() }, - 'property': function() { if (s.checkProperty(pos)) return s.getProperty() }, - 'propertyDelim': function() { if (s.checkPropertyDelim(pos)) return s.getPropertyDelim() }, - 'pseudoc': function() { if (s.checkPseudoc(pos)) return s.getPseudoc() }, - 'pseudoe': function() { if (s.checkPseudoe(pos)) return s.getPseudoe() }, - 'ruleset': function() { if (s.checkRuleset(pos)) return s.getRuleset() }, - 's': function() { if (s.checkS(pos)) return s.getS() }, - 'selector': function() { if (s.checkSelector(pos)) return s.getSelector() }, - 'shash': function() { if (s.checkShash(pos)) return s.getShash() }, - 'simpleselector': function() { if (s.checkSimpleSelector(pos)) return s.getSimpleSelector() }, - 'string': function() { if (s.checkString(pos)) return s.getString() }, - 'stylesheet': function() { if (s.checkStylesheet(pos)) return s.getStylesheet() }, - 'unary': function() { if (s.checkUnary(pos)) return s.getUnary() }, - 'unknown': function() { if (s.checkUnknown(pos)) return s.getUnknown() }, - 'uri': function() { if (s.checkUri(pos)) return s.getUri() }, - 'value': function() { if (s.checkValue(pos)) return s.getValue() }, - 'variable': function () { if (s.checkVariable(pos)) return s.getVariable() }, - 'variableslist': function () { if (s.checkVariablesList(pos)) return s.getVariablesList() }, - 'vhash': function() { if (s.checkVhash(pos)) return s.getVhash() } -}; -syntaxes.css = { - checkAny: function(i) { - return this.checkBraces(i) || - this.checkString(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkFunctionExpression(i) || - this.checkFunction(i) || - this.checkIdent(i) || - this.checkClass(i) || - this.checkUnary(i); - }, - getAny: function() { - if (this.checkBraces(pos)) return this.getBraces(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression(); - else if (this.checkFunction(pos)) return this.getFunction(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - else if (this.checkUnary(pos)) return this.getUnary(); - }, - checkAtkeyword: function(i) { - var l; - if (i >= tokensLength || - tokens[i++].type !== TokenType.CommercialAt) return 0; - return (l = this.checkIdent(i)) ? l + 1 : 0; - }, - getAtkeyword: function() { - var startPos = pos, - x; - pos++; - x = [NodeType.AtkeywordType, this.getIdent()]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAttrib: function(i) { - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftSquareBracket || - !tokens[i].right) return 0; - return tokens[i].right - i + 1; - }, - getAttrib: function() { - if (this.checkAttrib1(pos)) return this.getAttrib1(); - if (this.checkAttrib2(pos)) return this.getAttrib2(); - }, - checkAttrib1: function(i) { - var start = i, - l; - if (i++ >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkAttrselector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i) || this.checkString(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - }, - getAttrib1: function() { - var startPos = pos, - x; - pos++; - x = [NodeType.AttribType] - .concat(this.getSC()) - .concat([this.getIdent()]) - .concat(this.getSC()) - .concat([this.getAttrselector()]) - .concat(this.getSC()) - .concat([this.checkString(pos)? this.getString() : this.getIdent()]) - .concat(this.getSC()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAttrib2: function(i) { - var start = i, - l; - if (i++ >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return tokens[i].type === TokenType.RightSquareBracket ? i - start : 0; - }, - getAttrib2: function() { - var startPos = pos, - x; - pos++; - x = [NodeType.AttribType] - .concat(this.getSC()) - .concat([this.getIdent()]) - .concat(this.getSC()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAttrselector: function(i) { - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.EqualsSign) return 1; - if (tokens[i].type === TokenType.VerticalLine && - (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign)) - return 1; - if (!tokens[i + 1] || tokens[i + 1].type !== TokenType.EqualsSign) return 0; - switch(tokens[i].type) { - case TokenType.Tilde: - case TokenType.CircumflexAccent: - case TokenType.DollarSign: - case TokenType.Asterisk: - case TokenType.VerticalLine: - return 2; - } - return 0; - }, - getAttrselector: function() { - var startPos = pos, - s = tokens[pos++].value, - x; - if (tokens[pos] && tokens[pos].type === TokenType.EqualsSign) s += tokens[pos++].value; - x = [NodeType.AttrselectorType, s]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtrule: function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l; - if (l = this.checkAtruler(i)) tokens[i].atrule_type = 1; - else if (l = this.checkAtruleb(i)) tokens[i].atrule_type = 2; - else if (l = this.checkAtrules(i)) tokens[i].atrule_type = 3; - else return 0; - tokens[i].atrule_l = l; - return l; - }, - getAtrule: function() { - switch (tokens[pos].atrule_type) { - case 1: return this.getAtruler(); - case 2: return this.getAtruleb(); - case 3: return this.getAtrules(); - } - }, - checkAtruleb: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (l = this.checkTsets(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - return i - start; - }, - getAtruleb: function() { - var startPos = pos, - x; - x = [NodeType.AtrulebType, this.getAtkeyword()] - .concat(this.getTsets()) - .concat([this.getBlock()]); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtruler: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (l = this.checkAtrulerq(i)) i += l; - if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++; - else return 0; - if (l = this.checkAtrulers(i)) i += l; - if (i < tokensLength && tokens[i].type === TokenType.RightCurlyBracket) i++; - else return 0; - return i - start; - }, - getAtruler: function() { - var startPos = pos, - x; - x = [NodeType.AtrulerType, this.getAtkeyword(), this.getAtrulerq()]; - pos++; - x.push(this.getAtrulers()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtrulerq: function(i) { - return this.checkTsets(i); - }, - getAtrulerq: function() { - var startPos = pos, - x; - x = [NodeType.AtrulerqType].concat(this.getTsets()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtrulers: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - while (l = this.checkRuleset(i) || this.checkAtrule(i) || this.checkSC(i)) { - i += l; - } - tokens[i].atrulers_end = 1; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getAtrulers: function() { - var startPos = pos, - x; - x = [NodeType.AtrulersType].concat(this.getSC()); - while (!tokens[pos].atrulers_end) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkRuleset(pos)) x.push(this.getRuleset()); - else x.push(this.getAtrule()); - } - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkAtrules: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (l = this.checkTsets(i)) i += l; - return i - start; - }, - getAtrules: function() { - var startPos = pos, - x; - x = [NodeType.AtrulesType, this.getAtkeyword()].concat(this.getTsets()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkBlock: function(i) { - return i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket ? - tokens[i].right - i + 1 : 0; - }, - getBlock: function() { - var startPos = pos, - end = tokens[pos].right, - x = [NodeType.BlockType]; - pos++; - while (pos < end) { - if (this.checkBlockdecl(pos)) x = x.concat(this.getBlockdecl()); - else throwError(); - } - pos = end + 1; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkBlockdecl: function(i) { - var l; - if (i >= tokensLength) return 0; - if (l = this.checkBlockdecl1(i)) tokens[i].bd_type = 1; - else if (l = this.checkBlockdecl2(i)) tokens[i].bd_type = 2; - else if (l = this.checkBlockdecl3(i)) tokens[i].bd_type = 3; - else if (l = this.checkBlockdecl4(i)) tokens[i].bd_type = 4; - else return 0; - return l; - }, - getBlockdecl: function() { - switch (tokens[pos].bd_type) { - case 1: return this.getBlockdecl1(); - case 2: return this.getBlockdecl2(); - case 3: return this.getBlockdecl3(); - case 4: return this.getBlockdecl4(); - } - }, - checkBlockdecl1: function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkFilter(i)) tokens[i].bd_kind = 1; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 2; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 3; - else return 0; - i += l; - if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - return i - start; - }, - getBlockdecl1: function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getFilter(); - break; - case 2: - x = this.getDeclaration(); - break; - case 3: - x = this.getAtrule(); - break; - } - return sc - .concat([x]) - .concat([this.getDeclDelim()]) - .concat(this.getSC()); - }, - checkBlockdecl2: function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkFilter(i)) tokens[i].bd_kind = 1; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 2; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 3; - else return 0; - i += l; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getBlockdecl2: function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getFilter(); - break; - case 2: - x = this.getDeclaration(); - break; - case 3: - x = this.getAtrule(); - break; - } - return sc - .concat([x]) - .concat(this.getSC()); - }, - checkBlockdecl3: function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkDeclDelim(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getBlockdecl3: function() { - return this.getSC() - .concat([this.getDeclDelim()]) - .concat(this.getSC()); - }, - checkBlockdecl4: function(i) { - return this.checkSC(i); - }, - getBlockdecl4: function() { - return this.getSC(); - }, - checkBraces: function(i) { - if (i >= tokensLength || - (tokens[i].type !== TokenType.LeftParenthesis && - tokens[i].type !== TokenType.LeftSquareBracket)) return 0; - return tokens[i].right - i + 1; - }, - getBraces: function() { - var startPos = pos, - left = pos, - right = tokens[pos].right, - x; - pos++; - var tsets = this.getTsets(); - pos++; - x = [NodeType.BracesType, tokens[left].value, tokens[right].value] - .concat(tsets); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkClass: function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].class_l) return tokens[i].class_l; - if (tokens[i++].type === TokenType.FullStop && (l = this.checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - return 0; - }, - getClass: function() { - var startPos = pos, - x = [NodeType.ClassType]; - pos++; - x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkCombinator: function(i) { - if (i >= tokensLength) return 0; - switch (tokens[i].type) { - case TokenType.PlusSign: - case TokenType.GreaterThanSign: - case TokenType.Tilde: - return 1; - } - return 0; - }, - getCombinator: function() { - var startPos = pos, - x; - x = [NodeType.CombinatorType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkCommentML: function(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentML ? 1 : 0; - }, - getCommentML: function() { - var startPos = pos, - s = tokens[pos].value.substring(2), - l = s.length, - x; - if (s.charAt(l - 2) === '*' && s.charAt(l - 1) === '/') s = s.substring(0, l - 2); - pos++; - x = [NodeType.CommentMLType, s]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkDeclaration: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkProperty(i)) i += l; - else return 0; - if (l = this.checkPropertyDelim(i)) i++; - else return 0; - if (l = this.checkValue(i)) i += l; - else return 0; - return i - start; - }, - getDeclaration: function() { - var startPos = pos, - x = [NodeType.DeclarationType]; - x.push(this.getProperty()); - x.push(this.getPropertyDelim()); - x.push(this.getValue()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkDeclDelim: function(i) { - return i < tokensLength && tokens[i].type === TokenType.Semicolon ? 1 : 0; - }, - getDeclDelim: function() { - var startPos = pos, - x = [NodeType.DeclDelimType]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkDelim: function(i) { - return i < tokensLength && tokens[i].type === TokenType.Comma ? 1 : 0; - }, - getDelim: function() { - var startPos = pos, - x = [NodeType.DelimType]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkDimension: function(i) { - var ln = this.checkNumber(i), - li; - if (i >= tokensLength || - !ln || - i + ln >= tokensLength) return 0; - return (li = this.checkNmName2(i + ln)) ? ln + li : 0; - }, - getDimension: function() { - var startPos = pos, - x = [NodeType.DimensionType, this.getNumber()], - ident = [NodeType.IdentType, this.getNmName2()]; - if (needInfo) ident.unshift(getInfo(startPos)); - x.push(ident); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFilter: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkFilterp(i)) i += l; - else return 0; - if (tokens[i].type === TokenType.Colon) i++; - else return 0; - if (l = this.checkFilterv(i)) i += l; - else return 0; - return i - start; - }, - getFilter: function() { - var startPos = pos, - x = [NodeType.FilterType, this.getFilterp()]; - pos++; - x.push(this.getFilterv()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFilterp: function(i) { - var start = i, - l, - x; - if (i >= tokensLength) return 0; - if (tokens[i].value === 'filter') l = 1; - else { - x = joinValues2(i, 2); - if (x === '-filter' || x === '_filter' || x === '*filter') l = 2; - else { - x = joinValues2(i, 4); - if (x === '-ms-filter') l = 4; - else return 0; - } - } - tokens[start].filterp_l = l; - i += l; - if (this.checkSC(i)) i += l; - return i - start; - }, - getFilterp: function() { - var startPos = pos, - ident = [NodeType.IdentType, joinValues2(pos, tokens[pos].filterp_l)], - x; - if (needInfo) ident.unshift(getInfo(startPos)); - pos += tokens[pos].filterp_l; - x = [NodeType.PropertyType, ident].concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFilterv: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkProgid(i)) i += l; - else return 0; - while (l = this.checkProgid(i)) { - i += l; - } - tokens[start].last_progid = i; - if (i < tokensLength && (l = this.checkSC(i))) i += l; - if (i < tokensLength && (l = this.checkImportant(i))) i += l; - return i - start; - }, - getFilterv: function() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - x = x.concat(this.getSC()); - while (pos < last_progid) { - x.push(this.getProgid()); - } - if (this.checkSC(pos)) x = x.concat(this.getSC()); - if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFunctionExpression: function(i) { - var start = i; - if (i >= tokensLength || tokens[i++].value !== 'expression' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) return 0; - return tokens[i].right - start + 1; - }, - getFunctionExpression: function() { - var startPos = pos, - x, e; - pos++; - e = joinValues(pos + 1, tokens[pos].right - 1); - pos = tokens[pos].right + 1; - x = [NodeType.FunctionExpressionType, e]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkFunction: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkIdent(i)) i +=l; - else return 0; - return i < tokensLength && tokens[i].type === TokenType.LeftParenthesis ? - tokens[i].right - start + 1 : 0; - }, - getFunction: function() { - var startPos = pos, - ident = this.getIdent(), - x = [NodeType.FunctionType, ident], - body; - pos++; - body = ident[needInfo ? 2 : 1] === 'not' ? this.getNotFunctionBody() : this.getFunctionBody(); - x.push(body); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - getFunctionBody: function() { - var startPos = pos, - x = [NodeType.FunctionBodyType], - body; - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (this.checkDeclaration(pos)) x.push(this.getDeclaration()); - else if (this.checkTset(pos)) { - body = this.getTset(); - if ((needInfo && typeof body[1] === 'string') || typeof body[0] === 'string') x.push(body); - else x = x.concat(body); - } else if (this.checkClass(pos)) x.push(this.getClass()); - else throwError(); - } - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - getNotFunctionBody: function() { - var startPos = pos, - x = [NodeType.FunctionBodyType]; - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (this.checkSimpleSelector(pos)) x.push(this.getSimpleSelector()); - else throwError(); - } - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkIdent: function(i) { - var start = i, - wasIdent, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i); - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.Asterisk) i++; - else return 0; - wasIdent = tokens[i - 1].type === TokenType.Identifier; - for (; i < tokensLength; i++) { - if (i >= tokensLength) break; - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine) { - if (tokens[i].type !== TokenType.Identifier && - (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break; - else wasIdent = true; - } - } - if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0; - tokens[start].ident_last = i - 1; - return i - start; - }, - checkIdentLowLine: function(i) { - var start = i; - if (i++ >= tokensLength) return 0; - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.DecimalNumber && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier) break; - } - tokens[start].ident_last = i - 1; - return i - start; - }, - getIdent: function() { - var startPos = pos, - x = [NodeType.IdentType, joinValues(pos, tokens[pos].ident_last)]; - pos = tokens[pos].ident_last + 1; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkImportant: function(i) { - var start = i, - l; - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - if (l = this.checkSC(i)) i += l; - return tokens[i].value === 'important' ? i - start + 1 : 0; - }, - getImportant: function() { - var startPos = pos, - x = [NodeType.ImportantType]; - pos++; - x = x.concat(this.getSC()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkNamespace: function(i) { - return i < tokensLength && tokens[i].type === TokenType.VerticalLine ? 1 : 0; - }, - getNamespace: function() { - var startPos = pos, - x = [NodeType.NamespaceType]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkNmName: function(i) { - var start = i; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.LowLine || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DecimalNumber) i++; - else return 0; - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine && - tokens[i].type !== TokenType.Identifier && - tokens[i].type !== TokenType.DecimalNumber) break; - } - tokens[start].nm_name_last = i - 1; - return i - start; - }, - getNmName: function() { - var s = joinValues(pos, tokens[pos].nm_name_last); - pos = tokens[pos].nm_name_last + 1; - return s; - }, - checkNmName2: function(i) { - if (tokens[i].type === TokenType.Identifier) return 1; - else if (tokens[i].type !== TokenType.DecimalNumber) return 0; - i++; - return i < tokensLength && tokens[i].type === TokenType.Identifier ? 2 : 1; - }, - getNmName2: function() { - var s = tokens[pos].value; - if (tokens[pos++].type === TokenType.DecimalNumber && - pos < tokensLength && - tokens[pos].type === TokenType.Identifier) s += tokens[pos++].value; - return s; - }, - checkNth: function(i) { - if (i >= tokensLength) return 0; - return this.checkNth1(i) || this.checkNth2(i); - }, - checkNth1: function(i) { - var start = i; - for (; i < tokensLength; i++) { - if (tokens[i].type !== TokenType.DecimalNumber && - tokens[i].value !== 'n') break; - } - if (i !== start) tokens[start].nth_last = i - 1; - return i - start; - }, - getNth: function() { - var startPos = pos, - x = [NodeType.NthType]; - if (tokens[pos].nth_last) { - x.push(joinValues(pos, tokens[pos].nth_last)); - pos = tokens[pos].nth_last + 1; - } else { - x.push(tokens[pos++].value); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkNth2: function(i) { - return tokens[i].value === 'even' || tokens[i].value === 'odd' ? 1 : 0; - }, - checkNthf: function(i) { - var start = i, - l = 0; - if (tokens[i++].type !== TokenType.Colon) return 0; - l++; - if (tokens[i++].value !== 'nth' || tokens[i++].value !== '-') return 0; - l += 2; - if ('child' === tokens[i].value) { - l += 1; - } else if ('last-child' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value) { - l += 3; - } else if ('last-of-type' === tokens[i].value + - tokens[i + 1].value + - tokens[i + 2].value + - tokens[i + 3].value + - tokens[i + 4].value) { - l += 5; - } else return 0; - tokens[start + 1].nthf_last = start + l - 1; - return l; - }, - getNthf: function() { - pos++; - var s = joinValues(pos, tokens[pos].nthf_last); - pos = tokens[pos].nthf_last + 1; - return s; - }, - checkNthselector: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkNthf(i)) i += l; - else return 0; - if (tokens[i].type !== TokenType.LeftParenthesis || !tokens[i].right) return 0; - l++; - var rp = tokens[i++].right; - while (i < rp) { - if (l = this.checkSC(i) || - this.checkUnary(i) || - this.checkNth(i)) i += l; - else return 0; - } - return rp - start + 1; - }, - getNthselector: function() { - var startPos = pos, - nthf = [NodeType.IdentType, this.getNthf()], - x = [NodeType.NthselectorType]; - if (needInfo) nthf.unshift(getInfo(startPos)); - x.push(nthf); - pos++; - while (tokens[pos].type !== TokenType.RightParenthesis) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkUnary(pos)) x.push(this.getUnary()); - else if (this.checkNth(pos)) x.push(this.getNth()); - } - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkNumber: function(i) { - if (i >= tokensLength) return 0; - if (tokens[i].number_l) return tokens[i].number_l; - if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber && - (!tokens[i + 1] || - (tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) - return (tokens[i].number_l = 1, tokens[i].number_l); - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - (!tokens[i + 2] || (tokens[i + 2].type !== TokenType.DecimalNumber))) - return (tokens[i].number_l = 2, tokens[i].number_l); - if (i < tokensLength && - tokens[i].type === TokenType.FullStop && - tokens[i + 1].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 2, tokens[i].number_l); - if (i < tokensLength && - tokens[i].type === TokenType.DecimalNumber && - tokens[i + 1] && tokens[i + 1].type === TokenType.FullStop && - tokens[i + 2] && tokens[i + 2].type === TokenType.DecimalNumber) - return (tokens[i].number_l = 3, tokens[i].number_l); - return 0; - }, - getNumber: function() { - var s = '', - startPos = pos, - l = tokens[pos].number_l, - x = [NodeType.NumberType]; - for (var j = 0; j < l; j++) { - s += tokens[pos + j].value; - } - pos += l; - x.push(s); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkOperator: function(i) { - if (i >= tokensLength) return 0; - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - return 1; - } - return 0; - }, - getOperator: function() { - var startPos = pos, - x = [NodeType.OperatorType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkPercentage: function(i) { - var x; - if (i >= tokensLength) return 0; - x = this.checkNumber(i); - if (!x || i + x >= tokensLength) return 0; - return tokens[i + x].type === TokenType.PercentSign ? x + 1 : 0; - }, - getPercentage: function() { - var startPos = pos, - x = [NodeType.PercentageType, this.getNumber()]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkProgid: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6; - else return 0; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (tokens[i].type === TokenType.LeftParenthesis) { - tokens[start].progid_end = tokens[i].right; - i = tokens[i].right + 1; - } else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getProgid: function() { - var startPos = pos, - progid_end = tokens[pos].progid_end, - x; - x = [NodeType.ProgidType] - .concat(this.getSC()) - .concat([this._getProgid(progid_end)]) - .concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - _getProgid: function(progid_end) { - var startPos = pos, - x = [NodeType.RawType, joinValues(pos, progid_end)]; - pos = progid_end + 1; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkProperty: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - getProperty: function() { - var startPos = pos, - x = [NodeType.PropertyType]; - x.push(this.getIdent()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkPropertyDelim: function(i) { - return i < tokensLength && tokens[i].type === TokenType.Colon ? 1 : 0; - }, - getPropertyDelim: function() { - var startPos = pos, - x = [NodeType.PropertyDelimType]; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkPseudo: function(i) { - return this.checkPseudoe(i) || - this.checkPseudoc(i); - }, - getPseudo: function() { - if (this.checkPseudoe(pos)) return this.getPseudoe(); - if (this.checkPseudoc(pos)) return this.getPseudoc(); - }, - checkPseudoe: function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkIdent(i)) ? l + 2 : 0; - }, - getPseudoe: function() { - var startPos = pos, - x = [NodeType.PseudoeType]; - pos += 2; - x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkPseudoc: function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0; - }, - getPseudoc: function() { - var startPos = pos, - x = [NodeType.PseudocType]; - pos ++; - x.push(this.checkFunction(pos) ? this.getFunction() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkRuleset: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[start].ruleset_l) return tokens[start].ruleset_l; - while (i < tokensLength) { - if (l = this.checkBlock(i)) {i += l; break;} - else if (l = this.checkSelector(i)) i += l; - else return 0; - } - tokens[start].ruleset_l = i - start; - return i - start; - }, - getRuleset: function() { - var startPos = pos, - x = [NodeType.RulesetType]; - while (pos < tokensLength) { - if (this.checkBlock(pos)) {x.push(this.getBlock()); break;} - else if (this.checkSelector(pos)) x.push(this.getSelector()); - else break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkS: function(i) { - return i < tokensLength && tokens[i].ws ? tokens[i].ws_last - i + 1 : 0; - }, - getS: function() { - var startPos = pos, - x = [NodeType.SType, joinValues(pos, tokens[pos].ws_last)]; - pos = tokens[pos].ws_last + 1; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkSC: function(i) { - var l, - lsc = 0; - while (i < tokensLength) { - if (!(l = this.checkS(i)) && - !(l = this.checkCommentML(i))) break; - i += l; - lsc += l; - } - return lsc || 0; - }, - getSC: function() { - var sc = []; - if (pos >= tokensLength) return sc; - while (pos < tokensLength) { - if (this.checkS(pos)) sc.push(this.getS()); - else if (this.checkCommentML(pos)) sc.push(this.getCommentML()); - else break; - } - return sc; - }, - checkSelector: function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSimpleSelector(i) || this.checkDelim(i)) i += l; - else break; - } - if (i !== start) tokens[start].selector_end = i - 1; - return i - start; - }, - getSelector: function() { - var startPos = pos, - x = [NodeType.SelectorType], - selector_end = tokens[pos].selector_end; - while (pos <= selector_end) { - x.push(this.checkDelim(pos) ? this.getDelim() : this.getSimpleSelector()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkShash: function(i) { - var l; - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - return (l = this.checkNmName(i + 1)) ? l + 1 : 0; - }, - getShash: function() { - var startPos = pos, - x = [NodeType.ShashType]; - pos++; - x.push(this.getNmName()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkSimpleSelector: function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSimpleSelector1(i)) i += l; - else break; - } - return i - start; - }, - getSimpleSelector: function() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - while (pos < tokensLength) { - if (!this.checkSimpleSelector1(pos)) break; - t = this.getSimpleSelector1(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkSimpleSelector1: function(i) { - return this.checkNthselector(i) || - this.checkCombinator(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkAny(i) || - this.checkSC(i) || - this.checkNamespace(i); - }, - getSimpleSelector1: function() { - if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkCombinator(pos)) return this.getCombinator(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkNamespace(pos)) return this.getNamespace(); - }, - checkString: function(i) { - return i < tokensLength && (tokens[i].type === TokenType.StringSQ || tokens[i].type === TokenType.StringDQ) ? 1 : 0; - }, - getString: function() { - var startPos = pos, - x = [NodeType.StringType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkStylesheet: function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSC(i) || - this.checkDeclDelim(i) || - this.checkAtrule(i) || - this.checkRuleset(i) || - this.checkUnknown(i)) i += l; - else throwError(i); - } - return i - start; - }, - getStylesheet: function() { - var startPos = pos, - x = [NodeType.StylesheetType]; - while (pos < tokensLength) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkRuleset(pos)) x.push(this.getRuleset()); - else if (this.checkAtrule(pos)) x.push(this.getAtrule()); - else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim()); - else if (this.checkUnknown(pos)) x.push(this.getUnknown()); - else throwError(); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkTset: function(i) { - return this.checkVhash(i) || - this.checkAny(i) || - this.checkSC(i) || - this.checkOperator(i); - }, - getTset: function() { - if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkOperator(pos)) return this.getOperator(); - }, - checkTsets: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - while (l = this.checkTset(i)) { - i += l; - } - return i - start; - }, - getTsets: function() { - var x = [], - t; - while (t = this.getTset()) { - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return x; - }, - checkUnary: function(i) { - return i < tokensLength && (tokens[i].type === TokenType.HyphenMinus || tokens[i].type === TokenType.PlusSign) ? 1 : 0; - }, - getUnary: function() { - var startPos = pos, - x = [NodeType.UnaryType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkUnknown: function(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - }, - getUnknown: function() { - var startPos = pos, - x = [NodeType.UnknownType, tokens[pos++].value]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - checkUri: function(i) { - var start = i; - if (i >= tokensLength || tokens[i++].value !== 'url' || - i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis) - return 0; - return tokens[i].right - start + 1; - }, - getUri: function() { - var startPos = pos, - uriExcluding = {}, - uri, - l, - raw; - pos += 2; - uriExcluding[TokenType.Space] = 1; - uriExcluding[TokenType.Tab] = 1; - uriExcluding[TokenType.Newline] = 1; - uriExcluding[TokenType.LeftParenthesis] = 1; - uriExcluding[TokenType.RightParenthesis] = 1; - if (this.checkUri1(pos)) { - uri = [NodeType.UriType] - .concat(this.getSC()) - .concat([this.getString()]) - .concat(this.getSC()); - pos++; - } else { - uri = [NodeType.UriType].concat(this.getSC()), - l = checkExcluding(uriExcluding, pos), - raw = [NodeType.RawType, joinValues(pos, pos + l)]; - if (needInfo) raw.unshift(getInfo(startPos)); - uri.push(raw); - pos += l + 1; - uri = uri.concat(this.getSC()); - pos++; - } - return needInfo ? (uri.unshift(getInfo(startPos)), uri) : uri; - }, - checkUri1: function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (tokens[i].type !== TokenType.StringDQ && tokens[i].type !== TokenType.StringSQ) return 0; - i++; - if (l = this.checkSC(i)) i += l; - return i - start; - }, - checkValue: function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this._checkValue(i)) i += l; - else break; - } - return i - start; - }, - _checkValue: function(i) { - return this.checkSC(i) || - this.checkVhash(i) || - this.checkAny(i) || - this.checkOperator(i) || - this.checkImportant(i); - }, - getValue: function() { - var startPos = pos, - x = [NodeType.ValueType], - t, - _pos; - while (pos < tokensLength) { - _pos = pos; - if (!this._checkValue(pos)) break; - t = this._getValue(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - _getValue: function() { - if (this.checkSC(pos)) return this.getSC(); - else if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkOperator(pos)) return this.getOperator(); - else if (this.checkImportant(pos)) return this.getImportant(); - }, - checkVhash: function(i) { - var l; - if (i >= tokensLength || tokens[i].type !== TokenType.NumberSign) return 0; - return (l = this.checkNmName2(i + 1)) ? l + 1 : 0; - }, - getVhash: function() { - var startPos = pos, - x = [NodeType.VhashType]; - pos++; - x.push(this.getNmName2()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - markSC: function() { - var ws = -1, - sc = -1, - t; - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - if (ws === -1) ws = i; - if (sc === -1) sc = i; - break; - case TokenType.CommentML: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - t.sc = true; - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - }, - markBrackets: function() { - var ps = [], - sbs = [], - cbs = [], - t; - for (var i = 0; i < tokens.length; i++) { - t = tokens[i]; - switch(t.type) { - case TokenType.LeftParenthesis: - ps.push(i); - break; - case TokenType.RightParenthesis: - if (ps.length) { - t.left = ps.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftSquareBracket: - sbs.push(i); - break; - case TokenType.RightSquareBracket: - if (sbs.length) { - t.left = sbs.pop(); - tokens[t.left].right = i; - } - break; - case TokenType.LeftCurlyBracket: - cbs.push(i); - break; - case TokenType.RightCurlyBracket: - if (cbs.length) { - t.left = cbs.pop(); - tokens[t.left].right = i; - } - break; - } - } - }, - parseMLComment: function(css) { - var start = pos; - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') { - pos++; - break; - } - } - pushToken(TokenType.CommentML, css.substring(start, pos + 1)); - }, - parseSLComment: function(css) { - var start = pos; - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { - break; - } - } - pushToken(TokenType.CommentSL, css.substring(start, pos)); - pos--; - } -}; -(function() { - var scss = Object.create(syntaxes.css); - scss.checkAny = function(i) { - return this.checkBraces(i) || - this.checkString(i) || - this.checkVariablesList(i) || - this.checkVariable(i) || - this.checkPlaceholder(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkFunctionExpression(i) || - this.checkFunction(i) || - this.checkIdent(i) || - this.checkClass(i) || - this.checkUnary(i); - }; - scss.getAny = function() { - if (this.checkBraces(pos)) return this.getBraces(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkVariablesList(pos)) return this.getVariablesList(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkPlaceholder(pos)) return this.getPlaceholder(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression(); - else if (this.checkFunction(pos)) return this.getFunction(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - else if (this.checkUnary(pos)) return this.getUnary(); - }; - scss.checkArguments = function (i) { - var start = i, - l; - if (i >= tokensLength || - tokens[i].type !== TokenType.LeftParenthesis) return 0; - i++; - while (i < tokens[start].right) { - if (l = this.checkArgument(i)) i +=l; - else return 0; - } - return tokens[start].right - start + 1; - }; - scss.getArguments = function() { - var startPos = pos, - arguments = [], - x; - pos++; - while (x = this.getArgument()) { - if ((needInfo && typeof x[1] === 'string') || typeof x[0] === 'string') arguments.push(x); - else arguments = arguments.concat(x); - } - pos++; - x = [NodeType.ArgumentsType].concat(arguments); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkArgument = function(i) { - return this.checkDeclaration(i) || - this.checkVariablesList(i) || - this.checkVariable(i) || - this.checkSC(i) || - this.checkDelim(i) || - this.checkDeclDelim(i) || - this.checkString(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkIdent(i) || - this.checkVhash(i); - }; - scss.getArgument = function() { - if (this.checkDeclaration(pos)) return this.getDeclaration(); - else if (this.checkVariablesList(pos)) return this.getVariablesList(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkDelim(pos)) return this.getDelim(); - else if (this.checkDeclDelim(pos)) return this.getDeclDelim(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkVhash(pos)) return this.getVhash(); - }; - scss.checkBlockdecl1 = function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = this.checkLoop(i)) tokens[i].bd_kind = 3; - else if (l = this.checkFilter(i)) tokens[i].bd_kind = 4; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 5; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 6; - else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 7; - else return 0; - i += l; - if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - return i - start; - }; - scss.getBlockdecl1 = function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getCondition(); - break; - case 2: - x = this.getInclude(); - break; - case 3: - x = this.getLoop(); - break; - case 4: - x = this.getFilter(); - break; - case 5: - x = this.getDeclaration(); - break; - case 6: - x = this.getAtrule(); - break; - case 7: - x = this.getRuleset(); - break; - } - return sc - .concat([x]) - .concat([this.getDeclDelim()]) - .concat(this.getSC()); - }; - scss.checkBlockdecl2 = function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = this.checkLoop(i)) tokens[i].bd_kind = 3; - else if (l = this.checkFilter(i)) tokens[i].bd_kind = 4; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 5; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 6; - else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 7; - else return 0; - i += l; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getBlockdecl2 = function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getCondition(); - break; - case 2: - x = this.getInclude(); - break; - case 3: - x = this.getLoop(); - break; - case 4: - x = this.getFilter(); - break; - case 5: - x = this.getDeclaration(); - break; - case 6: - x = this.getAtrule(); - break; - case 7: - x = this.getRuleset(); - break; - } - return sc - .concat([x]) - .concat(this.getSC()); - }; - scss.checkClass = function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].class_l) return tokens[i].class_l; - if (tokens[i++].type === TokenType.FullStop && - (l = this.checkInterpolatedVariable(i) || this.checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - return 0; - }; - scss.getClass = function() { - var startPos = pos, - x = [NodeType.ClassType]; - pos++; - x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkCommentSL = function(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - }; - scss.getCommentSL = function() { - var startPos = pos, - x; - x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkCondition = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['if', 'else'].indexOf(tokens[start + 1].value) < 0) return 0; - while (i < tokensLength) { - if (l = this.checkBlock(i)) break; - else if (l = this.checkVariable(i) || - this.checkIdent(i) || - this.checkSC(i) || - this.checkNumber(i) || - this.checkOperator(i) || - this.checkCombinator(i) || - this.checkString(i)) i += l; - else return 0; - } - return i - start; - }; - scss.getCondition = function() { - var startPos = pos, - x = [NodeType.ConditionType]; - x.push(this.getAtkeyword()); - while (pos < tokensLength) { - if (this.checkBlock(pos)) break; - else if (this.checkVariable(pos)) x.push(this.getVariable()); - else if (this.checkIdent(pos)) x.push(this.getIdent()); - else if (this.checkNumber(pos)) x.push(this.getNumber()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else if (this.checkCombinator(pos)) x.push(this.getCombinator()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkString(pos)) x.push(this.getString()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkDefault = function(i) { - var start = i, - l; - if (i >= tokensLength || - tokens[i++].type !== TokenType.ExclamationMark) return 0; - if (l = this.checkSC(i)) i += l; - return tokens[i].value === 'default' ? i - start + 1 : 0; - }; - scss.getDefault = function() { - var startPos = pos, - x = [NodeType.DefaultType], - sc; - pos++; - sc = this.getSC(); - pos++; - x = x.concat(sc); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkIdent = function(i) { - var start = i, - wasIdent, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i); - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.Asterisk) i++; - else return 0; - wasIdent = tokens[i - 1].type === TokenType.Identifier; - for (; i < tokensLength; i++) { - if (l = this.checkInterpolatedVariable(i)) i += l; - if (i >= tokensLength) break; - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine) { - if (tokens[i].type !== TokenType.Identifier && - (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break; - else wasIdent = true; - } - } - if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0; - tokens[start].ident_last = i - 1; - return i - start; - }; - scss.checkInclude = function(i) { - var l; - if (i >= tokensLength) return 0; - if (l = this.checkInclude1(i)) tokens[i].include_type = 1; - else if (l = this.checkInclude2(i)) tokens[i].include_type = 2; - else if (l = this.checkInclude3(i)) tokens[i].include_type = 3; - else if (l = this.checkInclude4(i)) tokens[i].include_type = 4; - return l; - }; - scss.getInclude = function() { - switch (tokens[pos].include_type) { - case 1: return this.getInclude1(); - case 2: return this.getInclude2(); - case 3: return this.getInclude3(); - case 4: return this.getInclude4(); - } - }; - scss.checkInclude1 = function(i) { - var start = i, - l; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getInclude1 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getAtkeyword()); - x = x.concat(this.getSC()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getArguments()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkInclude2 = function(i) { - var start = i, - l; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getInclude2 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getAtkeyword()); - x = x.concat(this.getSC()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getArguments()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkInclude3 = function(i) { - var start = i, - l; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getInclude3 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getAtkeyword()); - x = x.concat(this.getSC()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkInclude4 = function(i) { - var start = i, - l; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['include', 'extend'].indexOf(tokens[start + 1].value) < 0) return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getInclude4 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getAtkeyword()); - x = x.concat(this.getSC()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkIncludeSelector = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSimpleSelector2(i)) i += l; - else break; - } - return i - start; - }; - scss.getIncludeSelector = function() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - while (pos < tokensLength && this.checkSimpleSelector2(pos)) { - t = this.getSimpleSelector2(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkInterpolatedVariable = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type !== TokenType.NumberSign || - !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket || - !tokens[i + 2] || tokens[i + 2].type !== TokenType.DollarSign) return 0; - i += 3; - if (l = this.checkIdent(i)) i += l; - else return 0; - return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0; - }; - scss.getInterpolatedVariable = function() { - var startPos = pos, - x = [NodeType.InterpolatedVariableType]; - pos += 3; - x.push(this.getIdent()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkLoop = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkAtkeyword(i)) i += l; - else return 0; - if (['for', 'each', 'while'].indexOf(tokens[start + 1].value) < 0) return 0; - while (i < tokensLength) { - if (l = this.checkBlock(i)) { - i += l; - break; - } else if (l = this.checkVariable(i) || - this.checkIdent(i) || - this.checkSC(i) || - this.checkNumber(i) || - this.checkOperator(i) || - this.checkCombinator(i) || - this.checkString(i)) i += l; - else return 0; - } - return i - start; - }; - scss.getLoop = function() { - var startPos = pos, - x = [NodeType.LoopType]; - x.push(this.getAtkeyword()); - while (pos < tokensLength) { - if (this.checkBlock(pos)) { - x.push(this.getBlock()); - break; - } - else if (this.checkVariable(pos)) x.push(this.getVariable()); - else if (this.checkIdent(pos)) x.push(this.getIdent()); - else if (this.checkNumber(pos)) x.push(this.getNumber()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else if (this.checkCombinator(pos)) x.push(this.getCombinator()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkString(pos)) x.push(this.getString()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkMixin = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if ((l = this.checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - return i - start; - }; - scss.getMixin = function() { - var startPos = pos, - x = [NodeType.MixinType, this.getAtkeyword()]; - x = x.concat(this.getSC()); - if (this.checkIdent(pos)) x.push(this.getIdent()); - x = x.concat(this.getSC()); - if (this.checkArguments(pos)) x.push(this.getArguments()); - x = x.concat(this.getSC()); - if (this.checkBlock(pos)) x.push(this.getBlock()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkOperator = function(i) { - if (i >= tokensLength) return 0; - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - case TokenType.LessThanSign: - case TokenType.GreaterThanSign: - case TokenType.Asterisk: - return 1; - } - return 0; - }; - scss.checkParentSelector = function(i) { - return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0; - }; - scss.getParentSelector = function() { - var startPos = pos, - x = [NodeType.ParentSelectorType, '&']; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkPlaceholder = function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].placeholder_l) return tokens[i].placeholder_l; - if (tokens[i].type === TokenType.PercentSign && (l = this.checkIdent(i + 1))) { - tokens[i].placeholder_l = l + 1; - return l + 1; - } else return 0; - }; - scss.getPlaceholder = function() { - var startPos = pos, - x = [NodeType.PlaceholderType]; - pos++; - x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkProperty = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkVariable(i) || this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - scss.getProperty = function() { - var startPos = pos, - x = [NodeType.PropertyType]; - x.push(this.checkVariable(pos) ? this.getVariable() : this.getIdent()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkPseudoe = function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkInterpolatedVariable(i) || this.checkIdent(i)) ? l + 2 : 0; - }; - scss.getPseudoe = function() { - var startPos = pos, - x = [NodeType.PseudoeType]; - pos += 2; - x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkPseudoc = function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkInterpolatedVariable(i) || this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0; - }; - scss.getPseudoc = function() { - var startPos = pos, - x = [NodeType.PseudocType]; - pos ++; - if (this.checkInterpolatedVariable(pos)) x.push(this.getInterpolatedVariable()); - else if (this.checkFunction(pos)) x.push(this.getFunction()); - else x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkSC = function(i) { - if (i >= tokensLength) return 0; - var l, - lsc = 0, - ln = tokens[i].ln; - while (i < tokensLength) { - if (!(l = this.checkS(i)) && - !(l = this.checkCommentML(i)) && - !(l = this.checkCommentSL(i))) break; - i += l; - lsc += l; - } - return lsc || 0; - }; - scss.getSC = function() { - var sc = []; - if (pos >= tokensLength) return sc; - while (pos < tokensLength) { - if (this.checkS(pos)) sc.push(this.getS()); - else if (this.checkCommentML(pos)) sc.push(this.getCommentML()); - else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL()); - else break; - } - return sc; - }; - scss.checkSimpleSelector1 = function(i) { - return this.checkParentSelector(i) || - this.checkNthselector(i) || - this.checkCombinator(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkAny(i) || - this.checkSC(i) || - this.checkNamespace(i); - }; - scss.getSimpleSelector1 = function() { - if (this.checkParentSelector(pos)) return this.getParentSelector(); - else if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkCombinator(pos)) return this.getCombinator(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkNamespace(pos)) return this.getNamespace(); - }; - scss.checkSimpleSelector2 = function(i) { - return this.checkParentSelector(i) || - this.checkNthselector(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkPlaceholder(i) || - this.checkIdent(i) || - this.checkClass(i); - }; - scss.getSimpleSelector2 = function() { - if (this.checkParentSelector(pos)) return this.getParentSelector(); - else if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkPlaceholder(pos)) return this.getPlaceholder(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - }; - scss.checkStylesheet = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSC(i) || - this.checkDeclaration(i) || - this.checkDeclDelim(i) || - this.checkInclude(i) || - this.checkMixin(i) || - this.checkLoop(i) || - this.checkAtrule(i) || - this.checkRuleset(i)) i += l; - else throwError(i); - } - return i - start; - }; - scss.getStylesheet = function() { - var startPos = pos, - x = [NodeType.StylesheetType]; - while (pos < tokensLength) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkRuleset(pos)) x.push(this.getRuleset()); - else if (this.checkInclude(pos)) x.push(this.getInclude()); - else if (this.checkMixin(pos)) x.push(this.getMixin()); - else if (this.checkLoop(pos)) x.push(this.getLoop()); - else if (this.checkAtrule(pos)) x.push(this.getAtrule()); - else if (this.checkDeclaration(pos)) x.push(this.getDeclaration()); - else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim()); - else throwError(); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkValue = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this._checkValue(i)) i += l; - if (!l || this.checkBlock(i - l)) break; - } - return i - start; - }; - scss._checkValue = function(i) { - return this.checkSC(i) || - this.checkInterpolatedVariable(i) || - this.checkVariable(i) || - this.checkVhash(i) || - this.checkBlock(i) || - this.checkAny(i) || - this.checkAtkeyword(i) || - this.checkOperator(i) || - this.checkImportant(i) || - this.checkDefault(i); - }; - scss.getValue = function() { - var startPos = pos, - x = [NodeType.ValueType], - t, _pos; - while (pos < tokensLength) { - _pos = pos; - if (!this._checkValue(pos)) break; - t = this._getValue(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - if (this.checkBlock(_pos)) break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss._getValue = function() { - if (this.checkSC(pos)) return this.getSC(); - else if (this.checkInterpolatedVariable(pos)) return this.getInterpolatedVariable(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkBlock(pos)) return this.getBlock(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkAtkeyword(pos)) return this.getAtkeyword(); - else if (this.checkOperator(pos)) return this.getOperator(); - else if (this.checkImportant(pos)) return this.getImportant(); - else if (this.checkDefault(pos)) return this.getDefault(); - }; - scss.checkVariable = function(i) { - var l; - if (i >= tokensLength || tokens[i].type !== TokenType.DollarSign) return 0; - return (l = this.checkIdent(i + 1)) ? l + 1 : 0; - }; - scss.getVariable = function() { - var startPos = pos, - x = [NodeType.VariableType]; - pos++; - x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.checkVariablesList = function(i) { - var d = 0, - l; - if (i >= tokensLength) return 0; - if (l = this.checkVariable(i)) i+= l; - else return 0; - while (i < tokensLength && tokens[i].type === TokenType.FullStop) { - d++; - i++; - } - return d === 3 ? l + d : 0; - }; - scss.getVariablesList = function() { - var startPos = pos, - x = [NodeType.VariablesListType, this.getVariable()]; - pos += 3; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - scss.markSC = function() { - var ws = -1, - sc = -1, - t; - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - if (ws === -1) ws = i; - if (sc === -1) sc = i; - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - t.sc = true; - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - }; - syntaxes.scss = scss; -})(); -(function() { - var sass = Object.create(syntaxes.scss); - sass.checkBlock = function(i) { - return i < tokensLength && tokens[i].block_end ? - tokens[i].block_end - i + 1 : 0; - }; - sass.getBlock = function() { - var startPos = pos, - end = tokens[pos].block_end, - x = [NodeType.BlockType]; - while (pos < end) { - if (this.checkBlockdecl(pos)) x = x.concat(this.getBlockdecl()); - else throwError(); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.getCommentML = function() { - var startPos = pos, - s = tokens[pos].value.substring(2), - l = s.length, - x; - pos++; - x = [NodeType.CommentMLType, s]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkDeclaration = function(i) { - return this.checkDeclaration1(i) || this.checkDeclaration2(i); - }; - sass.getDeclaration = function() { - return this.checkDeclaration1(pos) ? this.getDeclaration1() : this.getDeclaration2(); - }; - sass.checkDeclaration1 = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkProperty(i)) i += l; - else return 0; - if (l = this.checkPropertyDelim(i)) i++; - else return 0; - if (l = this.checkValue(i)) i += l; - else return 0; - return i - start; - }; - sass.getDeclaration1 = function() { - var startPos = pos, - x = [NodeType.DeclarationType]; - x.push(this.getProperty()); - x.push(this.getPropertyDelim()); - x.push(this.getValue()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkDeclaration2 = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkPropertyDelim(i)) i++; - else return 0; - if (l = this.checkProperty(i)) i += l; - else return 0; - if (l = this.checkValue(i)) i += l; - else return 0; - return i - start; - }; - sass.getDeclaration2 = function() { - var startPos = pos, - x = [NodeType.DeclarationType]; - x.push(this.getPropertyDelim()); - x.push(this.getProperty()); - x.push(this.getValue()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkDeclDelim = function(i) { - if (i >= tokensLength) return 0; - return (tokens[i].type === TokenType.Newline || - tokens[i].type === TokenType.Semicolon) ? 1 : 0; - }; - sass.checkFilterv = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkProgid(i)) i += l; - else return 0; - while (l = this.checkProgid(i)) { - i += l; - } - tokens[start].last_progid = i; - if (this.checkDeclDelim(i)) return i - start; - if (i < tokensLength && (l = this.checkSC(i))) i += l; - if (i < tokensLength && (l = this.checkImportant(i))) i += l; - return i - start; - }; - sass.getFilterv = function() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - while (pos < last_progid) { - x.push(this.getProgid()); - } - if (this.checkDeclDelim(pos)) return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - if (this.checkSC(pos)) x = x.concat(this.getSC()); - if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkInclude = function(i) { - var l; - if (i >= tokensLength) return 0; - if (l = this.checkInclude1(i)) tokens[i].include_type = 1; - else if (l = this.checkInclude2(i)) tokens[i].include_type = 2; - else if (l = this.checkInclude3(i)) tokens[i].include_type = 3; - else if (l = this.checkInclude4(i)) tokens[i].include_type = 4; - else if (l = this.checkInclude5(i)) tokens[i].include_type = 5; - else if (l = this.checkInclude6(i)) tokens[i].include_type = 6; - else if (l = this.checkInclude7(i)) tokens[i].include_type = 7; - else if (l = this.checkInclude8(i)) tokens[i].include_type = 8; - return l; - }; - sass.getInclude = function() { - switch (tokens[pos].include_type) { - case 1: return this.getInclude1(); - case 2: return this.getInclude2(); - case 3: return this.getInclude3(); - case 4: return this.getInclude4(); - case 5: return this.getInclude5(); - case 6: return this.getInclude6(); - case 7: return this.getInclude7(); - case 8: return this.getInclude8(); - } - }; - sass.checkInclude5 = function(i) { - var start = i, - l; - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - sass.getInclude5 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getOperator()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getArguments()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkInclude6 = function(i) { - var start = i, - l; - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - sass.getInclude6 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getOperator()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getArguments()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkInclude7 = function(i) { - var start = i, - l; - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - sass.getInclude7 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getOperator()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkInclude8 = function(i) { - var start = i, - l; - if (tokens[i].type === TokenType.PlusSign) i++; - else return 0; - if (l = this.checkIncludeSelector(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - sass.getInclude8 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.getOperator()); - x.push(this.getIncludeSelector()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkMixin = function(i) { - return this.checkMixin1(i) || this.checkMixin2(i); - }; - sass.getMixin = function() { - return this.checkMixin1(pos) ? this.getMixin1() : this.getMixin2(); - }; - sass.checkMixin1 = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if ((l = this.checkAtkeyword(i)) && tokens[i + 1].value === 'mixin') i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else { - if (l = this.checkArguments(i)) i += l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - } - return i - start; - }; - sass.getMixin1 = function() { - var startPos = pos, - x = [NodeType.MixinType, this.getAtkeyword()]; - x = x.concat(this.getSC()); - if (this.checkIdent(pos)) x.push(this.getIdent()); - x = x.concat(this.getSC()); - if (this.checkBlock(pos)) x.push(this.getBlock()); - else { - if (this.checkArguments(pos)) x.push(this.getArguments()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkMixin2 = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.EqualsSign) i++; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else { - if (l = this.checkArguments(i)) i += l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - } - return i - start; - }; - sass.getMixin2 = function() { - var startPos = pos, - x = [NodeType.MixinType, this.getOperator()]; - x = x.concat(this.getSC()); - if (this.checkIdent(pos)) x.push(this.getIdent()); - x = x.concat(this.getSC()); - if (this.checkBlock(pos)) x.push(this.getBlock()); - else { - if (this.checkArguments(pos)) x.push(this.getArguments()); - x = x.concat(this.getSC()); - x.push(this.getBlock()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkProgid = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (joinValues2(i, 6) === 'progid:DXImageTransform.Microsoft.') i += 6; - else return 0; - if (l = this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (tokens[i].type === TokenType.LeftParenthesis) { - tokens[start].progid_end = tokens[i].right; - i = tokens[i].right + 1; - } else return 0; - return i - start; - }; - sass.getProgid = function() { - var startPos = pos, - progid_end = tokens[pos].progid_end, - x; - x = [NodeType.ProgidType] - .concat(this.getSC()) - .concat([this._getProgid(progid_end)]); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkSC = function(i) { - if (!tokens[i]) return 0; - var l, - lsc = 0, - ln = tokens[i].ln; - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - if (!(l = this.checkS(i)) && - !(l = this.checkCommentML(i)) && - !(l = this.checkCommentSL(i))) break; - i += l; - lsc += l; - } - return lsc || 0; - }; - sass.getSC = function() { - var sc = [], - ln; - if (pos >= tokensLength) return sc; - ln = tokens[pos].ln; - while (pos < tokensLength) { - if (tokens[pos].ln !== ln) break; - else if (this.checkS(pos)) sc.push(this.getS()); - else if (this.checkCommentML(pos)) sc.push(this.getCommentML()); - else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL()); - else break; - } - return sc; - }; - sass.checkSelector = function(i) { - var start = i, - l, ln; - if (i >= tokensLength) return 0; - ln = tokens[i].ln; - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - if ((l = this.checkDeclDelim(i) && this.checkBlock(i + l)) || this.checkSC(i)) i += l; - if (l = this.checkSimpleSelector(i) || this.checkDelim(i)) i += l; - else break; - } - tokens[start].selector_end = i - 1; - return i - start; - }; - sass.getSelector = function() { - var startPos = pos, - x = [NodeType.SelectorType], - selector_end = tokens[pos].selector_end, - ln = tokens[pos].ln; - while (pos <= selector_end) { - if (tokens[pos].ln !== ln) break; - if ((l = this.checkDeclDelim(pos)) && this.checkBlock(pos + l)) x.push(this.getDeclDelim()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - x.push(this.checkDelim(pos) ? this.getDelim() : this.getSimpleSelector()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkSimpleSelector = function(i) { - if (i >= tokensLength) return 0; - var start = i, - l, - ln = tokens[i].ln; - while (i < tokensLength) { - if (tokens[i].ln !== ln) break; - if (l = this.checkSimpleSelector1(i)) i += l; - else break; - } - return (i - start) || 0; - }; - sass.getSimpleSelector = function() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t, - ln = tokens[pos].ln; - while (pos < tokensLength) { - if (tokens[pos].ln !== ln || - !this.checkSimpleSelector1(pos)) break; - t = this.getSimpleSelector1(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass.checkValue = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (this.checkDeclDelim(i)) break; - if (l = this._checkValue(i)) i += l; - if (!l || this.checkBlock(i - l)) break; - } - return i - start; - }; - sass.getValue = function() { - var startPos = pos, - x = [NodeType.ValueType], - t, _pos; - while (pos < tokensLength) { - _pos = pos; - if (this.checkDeclDelim(pos)) break; - if (!this._checkValue(pos)) break; - t = this._getValue(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - if (this.checkBlock(_pos)) break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - sass._checkValue = function(i) { - return this.checkS(i) || - this.checkCommentML(i) || - this.checkCommentSL(i) || - this.checkVhash(i) || - this.checkAny(i) || - this.checkOperator(i) || - this.checkImportant(i); - }; - sass._getValue = function() { - if (this.checkS(pos)) return this.getS(); - if (this.checkCommentML(pos)) return this.getCommentML(); - if (this.checkCommentSL(pos)) return this.getCommentSL(); - else if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkOperator(pos)) return this.getOperator(); - else if (this.checkImportant(pos)) return this.getImportant(); - }; - sass.markSC = function() { - var ws = -1, - sc = -1, - t; - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - t.ws = true; - t.sc = true; - if (ws === -1) ws = i; - if (sc === -1) sc = i; - break; - case TokenType.Newline: - t.ws = true; - t.sc = true; - ws = ws === -1 ? i : ws; - sc = sc === -1 ? i : ws; - tokens[ws].ws_last = i; - tokens[sc].sc_last = i; - ws = -1; - sc = -1; - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - t.sc = true; - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - }; - sass.markBlocks = function() { - var blocks = [], - currentLN = 1, - currentIL = 0, - prevIL = 0, - i = 0, - l = tokens.length, - iw; - for (; i != l; i++) { - if (!tokens[i - 1]) continue; - if (tokens[i].ln == currentLN) continue; - else currentLN = tokens[i].ln; - prevIL = currentIL; - if (tokens[i].type !== TokenType.Space) currentIL = 0; - else { - if (!iw) iw = tokens[i].value.length; - prevIL = currentIL; - currentIL = tokens[i].value.length / iw; - } - if (prevIL === currentIL) continue; - else if (currentIL > prevIL) { - blocks.push(i); - continue; - } else { - var il = prevIL; - while (blocks.length > 0 && il !== currentIL) { - tokens[blocks.pop()].block_end = i - 1; - il--; - } - } - } - while (blocks.length > 0) { - tokens[blocks.pop()].block_end = i - 1; - } - }; - sass.parseMLComment = function(css) { - var start = pos; - var il = 0; - for (var _pos = pos - 1; _pos > -1; _pos--) { - if (css.charAt(_pos) === ' ') il++; - else break; - } - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n') { - var _il = 0; - for (var _pos = pos + 1; _pos < css.length; _pos++) { - if (css.charAt(_pos) === ' ') _il++; - else break; - } - if (_il > il) { - pos = _pos; - } else break; - } - } - pushToken(TokenType.CommentML, css.substring(start, pos + 1)); - }; - sass.parseSLComment = function(css) { - var start = pos; - var il = 0; - var onlyToken = false; - for (var _pos = pos - 1; _pos > -1; _pos--) { - if (css.charAt(_pos) === ' ') il++; - else if (css.charAt(_pos) === '\n') { - onlyToken = true; - break; - } else break; - } - if (_pos === -1) onlyToken = true; - if (!onlyToken) { - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') { - break; - } - } - } else { - for (pos = pos + 2; pos < css.length; pos++) { - if (css.charAt(pos) === '\n') { - var _il = 0; - for (var _pos = pos + 1; _pos < css.length; _pos++) { - if (css.charAt(_pos) === ' ') _il++; - else break; - } - if (_il > il) { - pos = _pos; - } else break; - } - } - } - pushToken(TokenType.CommentSL, css.substring(start, pos)); - pos--; - }; - syntaxes.sass = sass; -})(); -(function() { - var less = Object.create(syntaxes.css); - less.checkAny = function(i) { - return this.checkBraces(i) || - this.checkString(i) || - this.checkVariablesList(i) || - this.checkVariable(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkFunctionExpression(i) || - this.checkFunction(i) || - this.checkIdent(i) || - this.checkClass(i) || - this.checkUnary(i); - }; - less.getAny = function() { - if (this.checkBraces(pos)) return this.getBraces(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkVariablesList(pos)) return this.getVariablesList(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkFunctionExpression(pos)) return this.getFunctionExpression(); - else if (this.checkFunction(pos)) return this.getFunction(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - else if (this.checkUnary(pos)) return this.getUnary(); - }; - less.checkArguments = function (i) { - var start = i, - l; - if (i >= tokensLength || - tokens[i++].type !== TokenType.LeftParenthesis) return 0; - while (i < tokens[start].right) { - if (l = this.checkArgument(i)) i +=l; - else return 0; - } - return tokens[start].right - start + 1; - }; - less.getArguments = function() { - var startPos = pos, - arguments = [], - x; - pos++; - while (x = this.getArgument()) { - if ((needInfo && typeof x[1] === 'string') || typeof x[0] === 'string') arguments.push(x); - else arguments = arguments.concat(x); - } - pos++; - x = [NodeType.ArgumentsType].concat(arguments); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkArgument = function(i) { - return this.checkDeclaration(i) || - this.checkVariablesList(i) || - this.checkVariable(i) || - this.checkSC(i) || - this.checkDelim(i) || - this.checkDeclDelim(i) || - this.checkString(i) || - this.checkPercentage(i) || - this.checkDimension(i) || - this.checkNumber(i) || - this.checkUri(i) || - this.checkIdent(i) || - this.checkVhash(i); - }; - less.getArgument = function() { - if (this.checkDeclaration(pos)) return this.getDeclaration(); - else if (this.checkVariablesList(pos)) return this.getVariablesList(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkDelim(pos)) return this.getDelim(); - else if (this.checkDeclDelim(pos)) return this.getDeclDelim(); - else if (this.checkString(pos)) return this.getString(); - else if (this.checkPercentage(pos)) return this.getPercentage(); - else if (this.checkDimension(pos)) return this.getDimension(); - else if (this.checkNumber(pos)) return this.getNumber(); - else if (this.checkUri(pos)) return this.getUri(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkVhash(pos)) return this.getVhash(); - }; - less.checkBlockdecl1 = function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = this.checkFilter(i)) tokens[i].bd_kind = 3; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 4; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 5; - else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 6; - else return 0; - i += l; - if (i < tokensLength && (l = this.checkDeclDelim(i))) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - else return 0; - return i - start; - } - less.getBlockdecl1 = function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getCondition(); - break; - case 2: - x = this.getInclude(); - break; - case 3: - x = this.getFilter(); - break; - case 4: - x = this.getDeclaration(); - break; - case 5: - x = this.getAtrule(); - break; - case 6: - x = this.getRuleset(); - break; - } - return sc - .concat([x]) - .concat([this.getDeclDelim()]) - .concat(this.getSC()); - }; - less.checkBlockdecl2 = function(i) { - var start = i, - l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkCondition(i)) tokens[i].bd_kind = 1; - else if (l = this.checkInclude(i)) tokens[i].bd_kind = 2; - else if (l = this.checkFilter(i)) tokens[i].bd_kind = 3; - else if (l = this.checkDeclaration(i)) tokens[i].bd_kind = 4; - else if (l = this.checkAtrule(i)) tokens[i].bd_kind = 5; - else if (l = this.checkRuleset(i)) tokens[i].bd_kind = 6; - else return 0; - i += l; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - less.getBlockdecl2 = function() { - var sc = this.getSC(), - x; - switch (tokens[pos].bd_kind) { - case 1: - x = this.getCondition(); - break; - case 2: - x = this.getInclude(); - break; - case 3: - x = this.getFilter(); - break; - case 4: - x = this.getDeclaration(); - break; - case 5: - x = this.getAtrule(); - break; - case 6: - x = this.getRuleset(); - break; - } - return sc - .concat([x]) - .concat(this.getSC()); - }; - less.checkClass = function(i) { - var l; - if (i >= tokensLength) return 0; - if (tokens[i].class_l) return tokens[i].class_l; - if (tokens[i++].type === TokenType.FullStop && - (l = this.checkInterpolatedVariable(i) || this.checkIdent(i))) { - tokens[i].class_l = l + 1; - return l + 1; - } - return 0; - }; - less.getClass = function() { - var startPos = pos, - x = [NodeType.ClassType]; - pos++; - x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkCommentSL = function(i) { - return i < tokensLength && tokens[i].type === TokenType.CommentSL ? 1 : 0; - }; - less.getCommentSL = function() { - var startPos = pos, - x; - x = [NodeType.CommentSLType, tokens[pos++].value.substring(2)]; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkCondition = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if ((l = this.checkIdent(i)) && tokens[i].value === 'when') i += l; - else return 0; - while (i < tokensLength) { - if (l = this.checkBlock(i)) break; - if (l = this.checkFunction(i) | - this.checkBraces(i) || - this.checkVariable(i) || - this.checkIdent(i) || - this.checkSC(i) || - this.checkNumber(i) || - this.checkDelim(i) || - this.checkOperator(i) || - this.checkCombinator(i) || - this.checkString(i)) i += l; - else return 0; - } - return i - start; - }; - less.getCondition = function() { - var startPos = pos, - x = [NodeType.ConditionType]; - x.push(this.getIdent()); - while (pos < tokensLength) { - if (this.checkBlock(pos)) break; - else if (this.checkFunction(pos)) x.push(this.getFunction()); - else if (this.checkBraces(pos)) x.push(this.getBraces()); - else if (this.checkVariable(pos)) x.push(this.getVariable()); - else if (this.checkIdent(pos)) x.push(this.getIdent()); - else if (this.checkNumber(pos)) x.push(this.getNumber()); - else if (this.checkDelim(pos)) x.push(this.getDelim()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else if (this.checkCombinator(pos)) x.push(this.getCombinator()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkString(pos)) x.push(this.getString()); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkEscapedString = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.Tilde && (l = this.checkString(i + 1))) return i + l - start; - else return 0; - }; - less.getEscapedString = function() { - var startPos = pos, - x = [NodeType.EscapedStringType]; - pos++; - x.push(tokens[pos++].value); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkFilterv = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkProgid(i) || this.checkEscapedString(i)) i += l; - else return 0; - while (l = this.checkProgid(i) || this.checkEscapedString(i)) { - i += l; - } - tokens[start].last_progid = i; - if (i < tokensLength && (l = this.checkSC(i))) i += l; - if (i < tokensLength && (l = this.checkImportant(i))) i += l; - return i - start; - }; - less.getFilterv = function() { - var startPos = pos, - x = [NodeType.FiltervType], - last_progid = tokens[pos].last_progid; - x = x.concat(this.getSC()); - while (pos < last_progid) { - x.push(this.checkProgid(pos) ? this.getProgid() : this.getEscapedString()); - } - if (this.checkSC(pos)) x = x.concat(this.getSC()); - if (pos < tokensLength && this.checkImportant(pos)) x.push(this.getImportant()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }, - less.checkIdent = function(i) { - var start = i, - wasIdent, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type === TokenType.LowLine) return this.checkIdentLowLine(i); - if (tokens[i].type === TokenType.HyphenMinus || - tokens[i].type === TokenType.Identifier || - tokens[i].type === TokenType.DollarSign || - tokens[i].type === TokenType.Asterisk) i++; - else return 0; - wasIdent = tokens[i - 1].type === TokenType.Identifier; - for (; i < tokensLength; i++) { - if (l = this.checkInterpolatedVariable(i)) i += l; - if (i >= tokensLength) break; - if (tokens[i].type !== TokenType.HyphenMinus && - tokens[i].type !== TokenType.LowLine) { - if (tokens[i].type !== TokenType.Identifier && - (tokens[i].type !== TokenType.DecimalNumber || !wasIdent)) break; - else wasIdent = true; - } - } - if (!wasIdent && tokens[start].type !== TokenType.Asterisk) return 0; - tokens[start].ident_last = i - 1; - return i - start; - }; - less.checkInclude = function(i) { - var l; - if (i >= tokensLength) return 0; - if (l = this.checkInclude1(i)) tokens[i].include_type = 1; - else if (l = this.checkInclude2(i)) tokens[i].include_type = 2; - return l; - }; - less.getInclude = function() { - switch (tokens[pos].include_type) { - case 1: return this.getInclude1(); - case 2: return this.getInclude2(); - } - }; - less.checkInclude1 = function(i) { - var start = i, - l; - if (l = this.checkClass(i) || this.checkShash(i)) i += l; - else return 0; - while (i < tokensLength) { - if (l = this.checkClass(i) || this.checkShash(i) || this.checkSC(i)) i += l; - else if (tokens[i].type == TokenType.GreaterThanSign) i++; - else break; - } - if (l = this.checkArguments(i)) i += l; - else return 0; - if (i < tokensLength && (l = this.checkSC(i))) i += l; - if (i < tokensLength && (l = this.checkImportant(i))) i += l; - return i - start; - }; - less.getInclude1 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.checkClass(pos) ? this.getClass() : this.getShash()); - while (pos < tokensLength) { - if (this.checkClass(pos)) x.push(this.getClass()); - else if (this.checkShash(pos)) x.push(this.getShash()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else break; - } - x.push(this.getArguments()); - x = x.concat(this.getSC()); - if (this.checkImportant(pos)) x.push(this.getImportant()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkInclude2 = function(i) { - var start = i, - l; - if (l = this.checkClass(i) || this.checkShash(i)) i += l; - else return 0; - while (i < tokensLength) { - if (l = this.checkClass(i) || this.checkShash(i) || this.checkSC(i)) i += l; - else if (tokens[i].type == TokenType.GreaterThanSign) i++; - else break; - } - return i - start; - }; - less.getInclude2 = function() { - var startPos = pos, - x = [NodeType.IncludeType]; - x.push(this.checkClass(pos) ? this.getClass() : this.getShash()); - while (pos < tokensLength) { - if (this.checkClass(pos)) x.push(this.getClass()); - else if (this.checkShash(pos)) x.push(this.getShash()); - else if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkOperator(pos)) x.push(this.getOperator()); - else break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkIncludeSelector = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSimpleSelector2(i)) i += l; - else break; - } - return i - start; - }; - less.getIncludeSelector = function() { - var startPos = pos, - x = [NodeType.SimpleselectorType], - t; - while (pos < tokensLength && this.checkSimpleSelector2(pos)) { - t = this.getSimpleSelector2(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkInterpolatedVariable = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (tokens[i].type !== TokenType.CommercialAt || - !tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket) return 0; - i += 2; - if (l = this.checkIdent(i)) i += l; - else return 0; - return tokens[i].type === TokenType.RightCurlyBracket ? i - start + 1 : 0; - }; - less.getInterpolatedVariable = function() { - var startPos = pos, - x = [NodeType.InterpolatedVariableType]; - pos += 2; - x.push(this.getIdent()); - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkMixin = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkClass(i) || this.checkShash(i)) i +=l; - else return 0; - if (l = this.checkSC(i)) i += l; - if (l = this.checkArguments(i)) i += l; - if (l = this.checkSC(i)) i += l; - if (l = this.checkBlock(i)) i += l; - else return 0; - return i - start; - }; - less.getMixin = function() { - var startPos = pos, - x = [NodeType.MixinType]; - x.push(this.checkClass(pos) ? this.getClass() : this.getShash()); - x = x.concat(this.getSC()); - if (this.checkArguments(pos)) x.push(this.getArguments()); - x = x.concat(this.getSC()); - if (this.checkBlock(pos)) x.push(this.getBlock()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkOperator = function(i) { - if (i >= tokensLength) return 0; - switch(tokens[i].type) { - case TokenType.Solidus: - case TokenType.Comma: - case TokenType.Colon: - case TokenType.EqualsSign: - case TokenType.LessThanSign: - case TokenType.GreaterThanSign: - case TokenType.Asterisk: - return 1; - } - return 0; - }; - less.checkParentSelector = function(i) { - return i < tokensLength && tokens[i].type === TokenType.Ampersand ? 1 : 0; - }; - less.getParentSelector = function() { - var startPos = pos, - x = [NodeType.ParentSelectorType, '&']; - pos++; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkProperty = function(i) { - var start = i, - l; - if (i >= tokensLength) return 0; - if (l = this.checkVariable(i) || this.checkIdent(i)) i += l; - else return 0; - if (l = this.checkSC(i)) i += l; - return i - start; - }; - less.getProperty = function() { - var startPos = pos, - x = [NodeType.PropertyType]; - if (this.checkVariable(pos)) x.push(this.getVariable()); - else x.push(this.getIdent()); - x = x.concat(this.getSC()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkPseudoe = function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon || - i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkInterpolatedVariable(i) || this.checkIdent(i)) ? l + 2 : 0; - }; - less.getPseudoe = function() { - var startPos = pos, - x = [NodeType.PseudoeType]; - pos += 2; - x.push(this.checkInterpolatedVariable(pos) ? this.getInterpolatedVariable() : this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkPseudoc = function(i) { - var l; - if (i >= tokensLength || tokens[i++].type !== TokenType.Colon) return 0; - return (l = this.checkInterpolatedVariable(i) || this.checkFunction(i) || this.checkIdent(i)) ? l + 1 : 0; - }; - less.getPseudoc = function() { - var startPos = pos, - x = [NodeType.PseudocType]; - pos ++; - if (this.checkInterpolatedVariable(pos)) x.push(this.getInterpolatedVariable()); - else if (this.checkFunction(pos)) x.push(this.getFunction()); - else x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkSC = function(i) { - if (i >= tokensLength) return 0; - var l, - lsc = 0, - ln = tokens[i].ln; - while (i < tokensLength) { - if (!(l = this.checkS(i)) && - !(l = this.checkCommentML(i)) && - !(l = this.checkCommentSL(i))) break; - i += l; - lsc += l; - } - return lsc || 0; - }; - less.getSC = function() { - var sc = [], - ln; - if (pos >= tokensLength) return sc; - ln = tokens[pos].ln; - while (pos < tokensLength) { - if (this.checkS(pos)) sc.push(this.getS()); - else if (this.checkCommentML(pos)) sc.push(this.getCommentML()); - else if (this.checkCommentSL(pos)) sc.push(this.getCommentSL()); - else break; - } - return sc; - }; - less.checkSimpleSelector1 = function(i) { - return this.checkParentSelector(i) || - this.checkNthselector(i) || - this.checkCombinator(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkAny(i) || - this.checkSC(i) || - this.checkNamespace(i); - }; - less.getSimpleSelector1 = function() { - if (this.checkParentSelector(pos)) return this.getParentSelector(); - else if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkCombinator(pos)) return this.getCombinator(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkSC(pos)) return this.getSC(); - else if (this.checkNamespace(pos)) return this.getNamespace(); - }; - less.checkSimpleSelector2 = function(i) { - return this.checkParentSelector(i) || - this.checkNthselector(i) || - this.checkAttrib(i) || - this.checkPseudo(i) || - this.checkShash(i) || - this.checkIdent(i) || - this.checkClass(i); - }; - less.getSimpleSelector2 = function() { - if (this.checkParentSelector(pos)) return this.getParentSelector(); - else if (this.checkNthselector(pos)) return this.getNthselector(); - else if (this.checkAttrib(pos)) return this.getAttrib(); - else if (this.checkPseudo(pos)) return this.getPseudo(); - else if (this.checkShash(pos)) return this.getShash(); - else if (this.checkIdent(pos)) return this.getIdent(); - else if (this.checkClass(pos)) return this.getClass(); - }; - less.checkStylesheet = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this.checkSC(i) || - this.checkDeclaration(i) || - this.checkDeclDelim(i) || - this.checkInclude(i) || - this.checkMixin(i) || - this.checkAtrule(i) || - this.checkRuleset(i)) i += l; - else throwError(i); - } - return i - start; - }; - less.getStylesheet = function() { - var startPos = pos, - x = [NodeType.StylesheetType]; - while (pos < tokensLength) { - if (this.checkSC(pos)) x = x.concat(this.getSC()); - else if (this.checkRuleset(pos)) x.push(this.getRuleset()); - else if (this.checkInclude(pos)) x.push(this.getInclude()); - else if (this.checkMixin(pos)) x.push(this.getMixin()); - else if (this.checkAtrule(pos)) x.push(this.getAtrule()); - else if (this.checkDeclaration(pos)) x.push(this.getDeclaration()); - else if (this.checkDeclDelim(pos)) x.push(this.getDeclDelim()); - else throwError(); - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkValue = function(i) { - var start = i, - l; - while (i < tokensLength) { - if (l = this._checkValue(i)) i += l; - if (!l || this.checkBlock(i - l)) break; - } - return i - start; - }; - less._checkValue = function(i) { - return this.checkSC(i) || - this.checkEscapedString(i) || - this.checkInterpolatedVariable(i) || - this.checkVariable(i) || - this.checkVhash(i) || - this.checkBlock(i) || - this.checkAny(i) || - this.checkAtkeyword(i) || - this.checkOperator(i) || - this.checkImportant(i); - }; - less.getValue = function() { - var startPos = pos, - x = [NodeType.ValueType], - t, _pos; - while (pos < tokensLength) { - _pos = pos; - if (!this._checkValue(pos)) break; - t = this._getValue(); - if ((needInfo && typeof t[1] === 'string') || typeof t[0] === 'string') x.push(t); - else x = x.concat(t); - if (this.checkBlock(_pos)) break; - } - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less._getValue = function() { - if (this.checkSC(pos)) return this.getSC(); - else if (this.checkEscapedString(pos)) return this.getEscapedString(); - else if (this.checkInterpolatedVariable(pos)) return this.getInterpolatedVariable(); - else if (this.checkVariable(pos)) return this.getVariable(); - else if (this.checkVhash(pos)) return this.getVhash(); - else if (this.checkBlock(pos)) return this.getBlock(); - else if (this.checkAny(pos)) return this.getAny(); - else if (this.checkAtkeyword(pos)) return this.getAtkeyword(); - else if (this.checkOperator(pos)) return this.getOperator(); - else if (this.checkImportant(pos)) return this.getImportant(); - }; - less.checkVariable = function(i) { - var l; - if (i >= tokensLength || tokens[i].type !== TokenType.CommercialAt) return 0; - if (tokens[i - 1] && - tokens[i - 1].type === TokenType.CommercialAt && - tokens[i - 2] && - tokens[i - 2].type === TokenType.CommercialAt) return 0; - return (l = this.checkVariable(i + 1) || this.checkIdent(i + 1)) ? l + 1 : 0; - }; - less.getVariable = function() { - var startPos = pos, - x = [NodeType.VariableType]; - pos++; - if (this.checkVariable(pos)) x.push(this.getVariable()); - else x.push(this.getIdent()); - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.checkVariablesList = function(i) { - var d = 0, - l; - if (i >= tokensLength) return 0; - if (l = this.checkVariable(i)) i+= l; - else return 0; - while (tokens[i] && tokens[i].type === TokenType.FullStop) { - d++; - i++; - } - return d === 3 ? l + d : 0; - }; - less.getVariablesList = function() { - var startPos = pos, - x = [NodeType.VariablesListType, this.getVariable()]; - pos += 3; - return needInfo ? (x.unshift(getInfo(startPos)), x) : x; - }; - less.markSC = function() { - var ws = -1, - sc = -1, - t; - for (var i = 0; i < tokensLength; i++) { - t = tokens[i]; - switch (t.type) { - case TokenType.Space: - case TokenType.Tab: - case TokenType.Newline: - t.ws = true; - t.sc = true; - if (ws === -1) ws = i; - if (sc === -1) sc = i; - break; - case TokenType.CommentML: - case TokenType.CommentSL: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - t.sc = true; - break; - default: - if (ws !== -1) { - tokens[ws].ws_last = i - 1; - ws = -1; - } - if (sc !== -1) { - tokens[sc].sc_last = i - 1; - sc = -1; - } - } - } - if (ws !== -1) tokens[ws].ws_last = i - 1; - if (sc !== -1) tokens[sc].sc_last = i - 1; - }; - syntaxes.less = less; -})(); - return function(options) { - var css, rule, syntax; - if (!options) throw new Error('Please, pass a string to parse'); - css = typeof options === 'string'? options : options.css; - if (!css) throw new Error('String can not be empty'); - rule = options.rule || 'stylesheet'; - needInfo = options.needInfo || false; - syntax = options.syntax || 'css'; - if (!syntaxes[syntax]) throw new Error('Syntax "' + _syntax + - '" is not currently supported, sorry'); - s = syntaxes[syntax]; - getTokens(css, syntax); - tokensLength = tokens.length; - pos = 0; - s.markBrackets(); - s.markSC(); - s.markBlocks && s.markBlocks(); - return rules[rule](); - } -}()); diff --git a/node_modules/csscomb/node_modules/gonzales-pe/webpack.config.js b/node_modules/csscomb/node_modules/gonzales-pe/webpack.config.js new file mode 100644 index 0000000..9b52d0f --- /dev/null +++ b/node_modules/csscomb/node_modules/gonzales-pe/webpack.config.js @@ -0,0 +1,24 @@ +module.exports = { + entry: { + gonzales: './src/gonzales' + }, + output: { + filename: 'gonzales.js', + library: 'gonzales', + libraryTarget: 'umd', + path: __dirname + '/lib' + }, + module: { + loaders: [ + { + test: /\.js?$/, + exclude: /node_modules/, + loader: 'babel', + query: { + loose: 'all', + blacklist: 'spec.functionName' + } + } + ] + } +}; diff --git a/node_modules/csscomb/node_modules/inflight/LICENSE b/node_modules/csscomb/node_modules/inflight/LICENSE new file mode 100644 index 0000000..05eeeb8 --- /dev/null +++ b/node_modules/csscomb/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/csscomb/node_modules/inflight/README.md b/node_modules/csscomb/node_modules/inflight/README.md new file mode 100644 index 0000000..6dc8929 --- /dev/null +++ b/node_modules/csscomb/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/node_modules/csscomb/node_modules/inflight/inflight.js b/node_modules/csscomb/node_modules/inflight/inflight.js new file mode 100644 index 0000000..48202b3 --- /dev/null +++ b/node_modules/csscomb/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/node_modules/csscomb/node_modules/inflight/package.json b/node_modules/csscomb/node_modules/inflight/package.json new file mode 100644 index 0000000..bef0a75 --- /dev/null +++ b/node_modules/csscomb/node_modules/inflight/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "inflight@^1.0.4", + "scope": null, + "escapedName": "inflight", + "name": "inflight", + "rawSpec": "^1.0.4", + "spec": ">=1.0.4 <2.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob" + ] + ], + "_from": "inflight@>=1.0.4 <2.0.0", + "_id": "inflight@1.0.6", + "_inCache": true, + "_installable": true, + "_location": "/inflight", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inflight-1.0.6.tgz_1476330807696_0.10388551792129874" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "inflight@^1.0.4", + "scope": null, + "escapedName": "inflight", + "name": "inflight", + "rawSpec": "^1.0.4", + "spec": ">=1.0.4 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "_shrinkwrap": null, + "_spec": "inflight@^1.0.4", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "description": "Add callbacks to requests in flight to avoid async duplication", + "devDependencies": { + "tap": "^7.1.2" + }, + "directories": {}, + "dist": { + "shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" + }, + "files": [ + "inflight.js" + ], + "gitHead": "a547881738c8f57b27795e584071d67cf6ac1a57", + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "main": "inflight.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "name": "inflight", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/inflight.git" + }, + "scripts": { + "test": "tap test.js --100" + }, + "version": "1.0.6" +} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/LICENSE b/node_modules/csscomb/node_modules/inherits/LICENSE similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/LICENSE rename to node_modules/csscomb/node_modules/inherits/LICENSE diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/README.md b/node_modules/csscomb/node_modules/inherits/README.md similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/README.md rename to node_modules/csscomb/node_modules/inherits/README.md diff --git a/node_modules/csscomb/node_modules/inherits/inherits.js b/node_modules/csscomb/node_modules/inherits/inherits.js new file mode 100644 index 0000000..3b94763 --- /dev/null +++ b/node_modules/csscomb/node_modules/inherits/inherits.js @@ -0,0 +1,7 @@ +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/inherits_browser.js b/node_modules/csscomb/node_modules/inherits/inherits_browser.js similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/glob/node_modules/inherits/inherits_browser.js rename to node_modules/csscomb/node_modules/inherits/inherits_browser.js diff --git a/node_modules/csscomb/node_modules/inherits/package.json b/node_modules/csscomb/node_modules/inherits/package.json new file mode 100644 index 0000000..53eeedd --- /dev/null +++ b/node_modules/csscomb/node_modules/inherits/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "inherits@2", + "scope": null, + "escapedName": "inherits", + "name": "inherits", + "rawSpec": "2", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob" + ] + ], + "_from": "inherits@>=2.0.0 <3.0.0", + "_id": "inherits@2.0.3", + "_inCache": true, + "_installable": true, + "_location": "/inherits", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "inherits@2", + "scope": null, + "escapedName": "inherits", + "name": "inherits", + "rawSpec": "2", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", + "_shrinkwrap": null, + "_spec": "inherits@2", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "dependencies": {}, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": { + "tap": "^7.1.0" + }, + "directories": {}, + "dist": { + "shasum": "633c2c83e3da42a502f52466022480f4208261de", + "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f", + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "inherits", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "node test" + }, + "version": "2.0.3" +} diff --git a/node_modules/csscomb/node_modules/minimatch/LICENSE b/node_modules/csscomb/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/csscomb/node_modules/minimatch/README.md b/node_modules/csscomb/node_modules/minimatch/README.md new file mode 100644 index 0000000..ad72b81 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimatch/README.md @@ -0,0 +1,209 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/csscomb/node_modules/minimatch/minimatch.js b/node_modules/csscomb/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..830a272 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimatch/minimatch.js @@ -0,0 +1,924 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var plType + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + plType = stateChar + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + re += ')' + var pl = patternListStack.pop() + plType = pl.type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case '!': + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length + break + case '?': + case '+': + case '*': + re += plType + break + case '@': break // the default anyway + } + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/csscomb/node_modules/minimatch/package.json b/node_modules/csscomb/node_modules/minimatch/package.json new file mode 100644 index 0000000..c9dd6a9 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimatch/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "minimatch@3.0.2", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "3.0.2", + "spec": "3.0.2", + "type": "version" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb" + ] + ], + "_from": "minimatch@3.0.2", + "_id": "minimatch@3.0.2", + "_inCache": true, + "_installable": true, + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.2.tgz_1466194379770_0.11417287751100957" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.9.1", + "_phantomChildren": {}, + "_requested": { + "raw": "minimatch@3.0.2", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "3.0.2", + "spec": "3.0.2", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz", + "_shasum": "0f398a7300ea441e9c348c83d98ab8c9dbf9c40a", + "_shrinkwrap": null, + "_spec": "minimatch@3.0.2", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "dependencies": { + "brace-expansion": "^1.0.0" + }, + "description": "a glob matcher in javascript", + "devDependencies": { + "standard": "^3.7.2", + "tap": "^5.6.0" + }, + "directories": {}, + "dist": { + "shasum": "0f398a7300ea441e9c348c83d98ab8c9dbf9c40a", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "minimatch.js" + ], + "gitHead": "81edb7c763abd31ba981c87ec5e835f178786be0", + "homepage": "https://github.com/isaacs/minimatch#readme", + "license": "ISC", + "main": "minimatch.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "version": "3.0.2" +} diff --git a/node_modules/csscomb/node_modules/minimist/.travis.yml b/node_modules/csscomb/node_modules/minimist/.travis.yml new file mode 100644 index 0000000..74c57bf --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" +before_install: + - npm install -g npm@~1.4.6 diff --git a/node_modules/csscomb/node_modules/minimist/LICENSE b/node_modules/csscomb/node_modules/minimist/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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. diff --git a/node_modules/csscomb/node_modules/minimist/example/parse.js b/node_modules/csscomb/node_modules/minimist/example/parse.js new file mode 100644 index 0000000..abff3e8 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.dir(argv); diff --git a/node_modules/csscomb/node_modules/minimist/index.js b/node_modules/csscomb/node_modules/minimist/index.js new file mode 100644 index 0000000..de61285 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/index.js @@ -0,0 +1,230 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {}, unknownFn: null }; + + if (typeof opts['unknown'] === 'function') { + flags.unknownFn = opts['unknown']; + } + + if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { + flags.allBools = true; + } else { + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + } + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + flags.strings[aliases[key]] = true; + } + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function argDefined(key, arg) { + return (flags.allBools && /^--[^=]+$/.test(arg)) || + flags.strings[key] || flags.bools[key] || aliases[key]; + } + + function setArg (key, val, arg) { + if (arg && flags.unknownFn && !argDefined(key, arg)) { + if (flags.unknownFn(arg) === false) return; + } + + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } + } + + function aliasIsBoolean(key) { + return aliases[key].some(function (x) { + return flags.bools[x]; + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + var key = m[1]; + var value = m[2]; + if (flags.bools[key]) { + value = value !== 'false'; + } + setArg(key, value, arg); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false, arg); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && !flags.allBools + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, next, arg); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next, arg) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next, arg); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2), arg); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, args[i+1], arg); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + } + else { + if (!flags.unknownFn || flags.unknownFn(arg) !== false) { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + if (opts.stopEarly) { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + if (opts['--']) { + argv['--'] = new Array(); + notFlags.forEach(function(key) { + argv['--'].push(key); + }); + } + else { + notFlags.forEach(function(key) { + argv._.push(key); + }); + } + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + diff --git a/node_modules/csscomb/node_modules/minimist/package.json b/node_modules/csscomb/node_modules/minimist/package.json new file mode 100644 index 0000000..cfde521 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/package.json @@ -0,0 +1,107 @@ +{ + "_args": [ + [ + { + "raw": "minimist@1.1.x", + "scope": null, + "escapedName": "minimist", + "name": "minimist", + "rawSpec": "1.1.x", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb" + ] + ], + "_from": "minimist@>=1.1.0 <1.2.0", + "_id": "minimist@1.1.3", + "_inCache": true, + "_installable": true, + "_location": "/minimist", + "_nodeVersion": "2.4.0", + "_npmUser": { + "name": "substack", + "email": "substack@gmail.com" + }, + "_npmVersion": "3.2.0", + "_phantomChildren": {}, + "_requested": { + "raw": "minimist@1.1.x", + "scope": null, + "escapedName": "minimist", + "name": "minimist", + "rawSpec": "1.1.x", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/gonzales-pe" + ], + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", + "_shasum": "3bedfd91a92d39016fcfaa1c681e8faa1a1efda8", + "_shrinkwrap": null, + "_spec": "minimist@1.1.x", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "dependencies": {}, + "description": "parse argument options", + "devDependencies": { + "covert": "^1.0.0", + "tap": "~0.4.0", + "tape": "^3.5.0" + }, + "directories": {}, + "dist": { + "shasum": "3bedfd91a92d39016fcfaa1c681e8faa1a1efda8", + "tarball": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz" + }, + "gitHead": "8a5d94cf17fb8b126cf6c8fbf2a7713df76d16cd", + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "minimist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "version": "1.1.3" +} diff --git a/node_modules/csscomb/node_modules/minimist/readme.markdown b/node_modules/csscomb/node_modules/minimist/readme.markdown new file mode 100644 index 0000000..30a74cf --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/readme.markdown @@ -0,0 +1,91 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) + +[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.dir(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a boolean, string or array of strings to always treat as +booleans. if `true` will treat all double hyphenated arguments without equal signs +as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values +* `opts.stopEarly` - when true, populate `argv._` with everything after the +first non-option +* `opts['--']` - when true, populate `argv._` with everything before the `--` +and `argv['--']` with everything after the `--`. Here's an example: +* `opts.unknown` - a function which is invoked with a command line parameter not +defined in the `opts` configuration object. If the function returns `false`, the +unknown option is not added to `argv`. + +``` +> require('./')('one two three -- four five --six'.split(' '), { '--': true }) +{ _: [ 'one', 'two', 'three' ], + '--': [ 'four', 'five', '--six' ] } +``` + +Note that with `opts['--']` set, parsing for arguments still stops after the +`--`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/node_modules/csscomb/node_modules/minimist/test/all_bool.js b/node_modules/csscomb/node_modules/minimist/test/all_bool.js new file mode 100644 index 0000000..ac83548 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/all_bool.js @@ -0,0 +1,32 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean true (default all --args to boolean)', function (t) { + var argv = parse(['moo', '--honk', 'cow'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); + +test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { + var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + tacos: 'good', + p: 55, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/bool.js b/node_modules/csscomb/node_modules/minimist/test/bool.js new file mode 100644 index 0000000..14b0717 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/bool.js @@ -0,0 +1,166 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias array with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var alt = [ '--harp', 'derp' ]; + var opts = { + alias: { 'h': ['herp', 'harp'] }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var altPropertyArgv = parse(alt, opts); + var expected = { + harp: true, + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.same(altPropertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); + +test('boolean --boool=true', function (t) { + var parsed = parse(['--boool=true'], { + default: { + boool: false + }, + boolean: ['boool'] + }); + + t.same(parsed.boool, true); + t.end(); +}); + +test('boolean --boool=false', function (t) { + var parsed = parse(['--boool=false'], { + default: { + boool: true + }, + boolean: ['boool'] + }); + + t.same(parsed.boool, false); + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/dash.js b/node_modules/csscomb/node_modules/minimist/test/dash.js new file mode 100644 index 0000000..5a4fa5b --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/dash.js @@ -0,0 +1,31 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); + +test('move arguments after the -- into their own `--` array', function(t) { + t.plan(1); + t.deepEqual( + parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), + { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/default_bool.js b/node_modules/csscomb/node_modules/minimist/test/default_bool.js new file mode 100644 index 0000000..780a311 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/default_bool.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); + +test('boolean default to null', function (t) { + var argv = parse([], { + boolean: 'maybe', + default: { maybe: null } + }); + t.equal(argv.maybe, null); + var argv = parse(['--maybe'], { + boolean: 'maybe', + default: { maybe: null } + }); + t.equal(argv.maybe, true); + t.end(); + +}) diff --git a/node_modules/csscomb/node_modules/minimist/test/dotted.js b/node_modules/csscomb/node_modules/minimist/test/dotted.js new file mode 100644 index 0000000..d8b3e85 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/dotted.js @@ -0,0 +1,22 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); + +test('dotted default with no alias', function (t) { + var argv = parse('', {default: {'a.b': 11}}); + t.equal(argv.a.b, 11); + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/long.js b/node_modules/csscomb/node_modules/minimist/test/long.js new file mode 100644 index 0000000..5d3a1e0 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/num.js b/node_modules/csscomb/node_modules/minimist/test/num.js new file mode 100644 index 0000000..2cc77f4 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/num.js @@ -0,0 +1,36 @@ +var parse = require('../'); +var test = require('tape'); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('already a number', function (t) { + var argv = parse([ '-x', 1234, 789 ]); + t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/parse.js b/node_modules/csscomb/node_modules/minimist/test/parse.js new file mode 100644 index 0000000..7b4a2a1 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/parse.js @@ -0,0 +1,197 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('empty strings', function(t) { + var s = parse([ '-s' ], { string: 's' }).s; + t.equal(s, ''); + t.equal(typeof s, 'string'); + + var str = parse([ '--str' ], { string: 'str' }).str; + t.equal(str, ''); + t.equal(typeof str, 'string'); + + var letters = parse([ '-art' ], { + string: [ 'a', 't' ] + }); + + t.equal(letters.a, ''); + t.equal(letters.r, true); + t.equal(letters.t, ''); + + t.end(); +}); + + +test('string and alias', function(t) { + var x = parse([ '--str', '000123' ], { + string: 's', + alias: { s: 'str' } + }); + + t.equal(x.str, '000123'); + t.equal(typeof x.str, 'string'); + t.equal(x.s, '000123'); + t.equal(typeof x.s, 'string'); + + var y = parse([ '-s', '000123' ], { + string: 'str', + alias: { str: 's' } + }); + + t.equal(y.str, '000123'); + t.equal(typeof y.str, 'string'); + t.equal(y.s, '000123'); + t.equal(typeof y.s, 'string'); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/parse_modified.js b/node_modules/csscomb/node_modules/minimist/test/parse_modified.js new file mode 100644 index 0000000..ab620dc --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: [123] }); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/short.js b/node_modules/csscomb/node_modules/minimist/test/short.js new file mode 100644 index 0000000..d513a1c --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/stop_early.js b/node_modules/csscomb/node_modules/minimist/test/stop_early.js new file mode 100644 index 0000000..bdf9fbc --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/stop_early.js @@ -0,0 +1,15 @@ +var parse = require('../'); +var test = require('tape'); + +test('stops parsing on the first non-option when stopEarly is set', function (t) { + var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { + stopEarly: true + }); + + t.deepEqual(argv, { + aaa: 'bbb', + _: ['ccc', '--ddd'] + }); + + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/unknown.js b/node_modules/csscomb/node_modules/minimist/test/unknown.js new file mode 100644 index 0000000..462a36b --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/unknown.js @@ -0,0 +1,102 @@ +var parse = require('../'); +var test = require('tape'); + +test('boolean and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'true', '--derp', 'true' ]; + var regular = [ '--herp', 'true', '-d', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h', + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('flag boolean true any double hyphen argument is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { + boolean: true, + unknown: unknownFn + }); + t.same(unknown, ['--tacos=good', 'cow', '-p']); + t.same(argv, { + honk: true, + _: [] + }); + t.end(); +}); + +test('string and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; + var regular = [ '--herp', 'hello', '-d', 'moon' ]; + var opts = { + alias: { h: 'herp' }, + string: 'h', + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('default and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'hello' ]; + var regular = [ '--herp', 'hello' ]; + var opts = { + default: { 'h': 'bar' }, + alias: { 'h': 'herp' }, + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, []); + t.end(); + unknownFn(); // exercise fn for 100% coverage +}); + +test('value following -- is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '--bad', '--', 'good', 'arg' ]; + var opts = { + '--': true, + unknown: unknownFn + }; + var argv = parse(aliased, opts); + + t.same(unknown, ['--bad']); + t.same(argv, { + '--': ['good', 'arg'], + '_': [] + }) + t.end(); +}); diff --git a/node_modules/csscomb/node_modules/minimist/test/whitespace.js b/node_modules/csscomb/node_modules/minimist/test/whitespace.js new file mode 100644 index 0000000..8a52a58 --- /dev/null +++ b/node_modules/csscomb/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/node_modules/csscomb/node_modules/once/LICENSE b/node_modules/csscomb/node_modules/once/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/csscomb/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/csscomb/node_modules/once/README.md b/node_modules/csscomb/node_modules/once/README.md new file mode 100644 index 0000000..1f1ffca --- /dev/null +++ b/node_modules/csscomb/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/node_modules/csscomb/node_modules/once/once.js b/node_modules/csscomb/node_modules/once/once.js new file mode 100644 index 0000000..2354067 --- /dev/null +++ b/node_modules/csscomb/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/node_modules/csscomb/node_modules/once/package.json b/node_modules/csscomb/node_modules/once/package.json new file mode 100644 index 0000000..dad788b --- /dev/null +++ b/node_modules/csscomb/node_modules/once/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + { + "raw": "once@^1.3.0", + "scope": null, + "escapedName": "once", + "name": "once", + "rawSpec": "^1.3.0", + "spec": ">=1.3.0 <2.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob" + ] + ], + "_from": "once@>=1.3.0 <2.0.0", + "_id": "once@1.4.0", + "_inCache": true, + "_installable": true, + "_location": "/once", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/once-1.4.0.tgz_1473196269128_0.537820661207661" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "once@^1.3.0", + "scope": null, + "escapedName": "once", + "name": "once", + "rawSpec": "^1.3.0", + "spec": ">=1.3.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob", + "/inflight" + ], + "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "_shrinkwrap": null, + "_spec": "once@^1.3.0", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/once/issues" + }, + "dependencies": { + "wrappy": "1" + }, + "description": "Run a function exactly one time", + "devDependencies": { + "tap": "^7.0.1" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "tarball": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + }, + "files": [ + "once.js" + ], + "gitHead": "0e614d9f5a7e6f0305c625f6b581f6d80b33b8a6", + "homepage": "https://github.com/isaacs/once#readme", + "keywords": [ + "once", + "function", + "one", + "single" + ], + "license": "ISC", + "main": "once.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "once", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.4.0" +} diff --git a/node_modules/csscomb/node_modules/path-is-absolute/index.js b/node_modules/csscomb/node_modules/path-is-absolute/index.js new file mode 100644 index 0000000..22aa6c3 --- /dev/null +++ b/node_modules/csscomb/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/node_modules/csscomb/node_modules/path-is-absolute/license b/node_modules/csscomb/node_modules/path-is-absolute/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/csscomb/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +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. diff --git a/node_modules/csscomb/node_modules/path-is-absolute/package.json b/node_modules/csscomb/node_modules/path-is-absolute/package.json new file mode 100644 index 0000000..3e17831 --- /dev/null +++ b/node_modules/csscomb/node_modules/path-is-absolute/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "path-is-absolute@^1.0.0", + "scope": null, + "escapedName": "path-is-absolute", + "name": "path-is-absolute", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob" + ] + ], + "_from": "path-is-absolute@>=1.0.0 <2.0.0", + "_id": "path-is-absolute@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/path-is-absolute", + "_nodeVersion": "6.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/path-is-absolute-1.0.1.tgz_1475210523565_0.9876507974695414" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "3.10.3", + "_phantomChildren": {}, + "_requested": { + "raw": "path-is-absolute@^1.0.0", + "scope": null, + "escapedName": "path-is-absolute", + "name": "path-is-absolute", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "_shrinkwrap": null, + "_spec": "path-is-absolute@^1.0.0", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/glob", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "dependencies": {}, + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "devDependencies": { + "xo": "^0.16.0" + }, + "directories": {}, + "dist": { + "shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "edc91d348b21dac2ab65ea2fbec2868e2eff5eb6", + "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "path-is-absolute", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "scripts": { + "test": "xo && node test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/csscomb/node_modules/path-is-absolute/readme.md b/node_modules/csscomb/node_modules/path-is-absolute/readme.md new file mode 100644 index 0000000..8dbdf5f --- /dev/null +++ b/node_modules/csscomb/node_modules/path-is-absolute/readme.md @@ -0,0 +1,59 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +const pathIsAbsolute = require('path-is-absolute'); + +// Running on Linux +pathIsAbsolute('/home/foo'); +//=> true +pathIsAbsolute('C:/Users/foo'); +//=> false + +// Running on Windows +pathIsAbsolute('C:/Users/foo'); +//=> true +pathIsAbsolute('/home/foo'); +//=> false + +// Running on any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +POSIX specific version. + +### pathIsAbsolute.win32(path) + +Windows specific version. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/csscomb/node_modules/regenerator-runtime/.npmignore b/node_modules/csscomb/node_modules/regenerator-runtime/.npmignore new file mode 100644 index 0000000..e216ae5 --- /dev/null +++ b/node_modules/csscomb/node_modules/regenerator-runtime/.npmignore @@ -0,0 +1,2 @@ +/node_modules +/test diff --git a/node_modules/csscomb/node_modules/regenerator-runtime/README.md b/node_modules/csscomb/node_modules/regenerator-runtime/README.md new file mode 100644 index 0000000..d93386a --- /dev/null +++ b/node_modules/csscomb/node_modules/regenerator-runtime/README.md @@ -0,0 +1,31 @@ +# regenerator-runtime + +Standalone runtime for +[Regenerator](https://github.com/facebook/regenerator)-compiled generator +and `async` functions. + +To import the runtime as a module (recommended), either of the following +import styles will work: +```js +// CommonJS +const regeneratorRuntime = require("regenerator-runtime"); + +// ECMAScript 2015 +import regeneratorRuntime from "regenerator-runtime"; +``` + +To ensure that `regeneratorRuntime` is defined globally, either of the +following styles will work: +```js +// CommonJS +require("regenerator-runtime/runtime"); + +// ECMAScript 2015 +import "regenerator-runtime/runtime"; +``` + +To get the absolute file system path of `runtime.js`, evaluate the +following expression: +```js +require("regenerator-runtime/path").path +``` diff --git a/node_modules/csscomb/node_modules/regenerator-runtime/package.json b/node_modules/csscomb/node_modules/regenerator-runtime/package.json new file mode 100644 index 0000000..6191d35 --- /dev/null +++ b/node_modules/csscomb/node_modules/regenerator-runtime/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + { + "raw": "regenerator-runtime@^0.10.0", + "scope": null, + "escapedName": "regenerator-runtime", + "name": "regenerator-runtime", + "rawSpec": "^0.10.0", + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/babel-polyfill" + ] + ], + "_from": "regenerator-runtime@>=0.10.0 <0.11.0", + "_id": "regenerator-runtime@0.10.5", + "_inCache": true, + "_installable": true, + "_location": "/regenerator-runtime", + "_nodeVersion": "7.7.4", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/regenerator-runtime-0.10.5.tgz_1493390833247_0.5373470620252192" + }, + "_npmUser": { + "name": "benjamn", + "email": "bn@cs.stanford.edu" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "regenerator-runtime@^0.10.0", + "scope": null, + "escapedName": "regenerator-runtime", + "name": "regenerator-runtime", + "rawSpec": "^0.10.0", + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "_requiredBy": [ + "/babel-polyfill" + ], + "_resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "_shasum": "336c3efc1220adcedda2c9fab67b5a7955a33658", + "_shrinkwrap": null, + "_spec": "regenerator-runtime@^0.10.0", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/babel-polyfill", + "author": { + "name": "Ben Newman", + "email": "bn@cs.stanford.edu" + }, + "dependencies": {}, + "description": "Runtime for Regenerator-compiled generator and async functions.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "336c3efc1220adcedda2c9fab67b5a7955a33658", + "tarball": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz" + }, + "keywords": [ + "regenerator", + "runtime", + "generator", + "async" + ], + "license": "MIT", + "main": "runtime-module.js", + "maintainers": [ + { + "name": "benjamn", + "email": "bn@cs.stanford.edu" + } + ], + "name": "regenerator-runtime", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime" + }, + "scripts": {}, + "version": "0.10.5" +} diff --git a/node_modules/csscomb/node_modules/regenerator-runtime/path.js b/node_modules/csscomb/node_modules/regenerator-runtime/path.js new file mode 100644 index 0000000..a450a75 --- /dev/null +++ b/node_modules/csscomb/node_modules/regenerator-runtime/path.js @@ -0,0 +1,4 @@ +exports.path = require("path").join( + __dirname, + "runtime.js" +); diff --git a/node_modules/csscomb/node_modules/regenerator-runtime/runtime-module.js b/node_modules/csscomb/node_modules/regenerator-runtime/runtime-module.js new file mode 100644 index 0000000..8e7e2e4 --- /dev/null +++ b/node_modules/csscomb/node_modules/regenerator-runtime/runtime-module.js @@ -0,0 +1,31 @@ +// This method of obtaining a reference to the global object needs to be +// kept identical to the way it is obtained in runtime.js +var g = + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this; + +// Use `getOwnPropertyNames` because not all browsers support calling +// `hasOwnProperty` on the global `self` object in a worker. See #183. +var hadRuntime = g.regeneratorRuntime && + Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; + +// Save the old regeneratorRuntime in case it needs to be restored later. +var oldRuntime = hadRuntime && g.regeneratorRuntime; + +// Force reevalutation of runtime.js. +g.regeneratorRuntime = undefined; + +module.exports = require("./runtime"); + +if (hadRuntime) { + // Restore the original runtime. + g.regeneratorRuntime = oldRuntime; +} else { + // Remove the global property added by runtime.js. + try { + delete g.regeneratorRuntime; + } catch(e) { + g.regeneratorRuntime = undefined; + } +} diff --git a/node_modules/csscomb/node_modules/regenerator-runtime/runtime.js b/node_modules/csscomb/node_modules/regenerator-runtime/runtime.js new file mode 100644 index 0000000..5b08c4d --- /dev/null +++ b/node_modules/csscomb/node_modules/regenerator-runtime/runtime.js @@ -0,0 +1,736 @@ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + if (typeof global.process === "object" && global.process.domain) { + invoke = global.process.domain.bind(invoke); + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + runtime.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/.npmignore b/node_modules/csscomb/node_modules/uuid/.npmignore similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/.npmignore rename to node_modules/csscomb/node_modules/uuid/.npmignore diff --git a/node_modules/csscomb/node_modules/uuid/.travis.yml b/node_modules/csscomb/node_modules/uuid/.travis.yml new file mode 100644 index 0000000..9400c11 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.6" + - "0.8" + - "0.10" diff --git a/node_modules/csscomb/node_modules/uuid/LICENSE.md b/node_modules/csscomb/node_modules/uuid/LICENSE.md new file mode 100644 index 0000000..f039427 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/LICENSE.md @@ -0,0 +1,2 @@ +Copyright (c) 2010-2012 Robert Kieffer +MIT License - http://opensource.org/licenses/mit-license.php diff --git a/node_modules/csscomb/node_modules/uuid/README.md b/node_modules/csscomb/node_modules/uuid/README.md new file mode 100644 index 0000000..c04bf89 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/README.md @@ -0,0 +1,205 @@ +# uuid [![Build Status](https://secure.travis-ci.org/defunctzombie/node-uuid.svg?branch=master)](http://travis-ci.org/defunctzombie/node-uuid) # + +[![browser support](https://ci.testling.com/defunctzombie/node-uuid.png)](https://ci.testling.com/defunctzombie/node-uuid) + +Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. + +Features: + +* Generate RFC4122 version 1 or version 4 UUIDs +* Runs in node.js and all browsers. +* Cryptographically strong random # generation on supporting platforms +* 1185 bytes minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) +* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) + +## Getting Started + +Install it in your browser: + +```html + +``` + +Or in node.js: + +``` +npm install uuid +``` + +```javascript +var uuid = require('uuid'); + +// Generate a v1 (time-based) id +uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' + +// Generate a v4 (random) id +uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' +``` + +## API + +### uuid.v1([`options` [, `buffer` [, `offset`]]]) + +Generate and return a RFC4122 v1 (timestamp-based) UUID. + +* `options` - (Object) Optional uuid state to apply. Properties may include: + + * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. + * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. + * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. + * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. + +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Notes: + +1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) + +Example: Generate string UUID with fully-specified options + +```javascript +uuid.v1({ + node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678 +}); // -> "710b962e-041c-11e1-9234-0123456789ab" +``` + +Example: In-place generation of two binary IDs + +```javascript +// Generate two ids in an array +var arr = new Array(32); // -> [] +uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] +uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] + +// Optionally use uuid.unparse() to get stringify the ids +uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' +uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' +``` + +### uuid.v4([`options` [, `buffer` [, `offset`]]]) + +Generate and return a RFC4122 v4 UUID. + +* `options` - (Object) Optional uuid state to apply. Properties may include: + + * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values + * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. + +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: Generate string UUID with fully-specified options + +```javascript +uuid.v4({ + random: [ + 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, + 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 + ] +}); +// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" +``` + +Example: Generate two IDs in a single buffer + +```javascript +var buffer = new Array(32); // (or 'new Buffer' in node.js) +uuid.v4(null, buffer, 0); +uuid.v4(null, buffer, 16); +``` + +### uuid.parse(id[, buffer[, offset]]) +### uuid.unparse(buffer[, offset]) + +Parse and unparse UUIDs + + * `id` - (String) UUID(-like) string + * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used + * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 + +Example parsing and unparsing a UUID string + +```javascript +var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> +var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' +``` + +### uuid.noConflict() + +(Browsers only) Set `uuid` property back to it's previous value. + +Returns the uuid object. + +Example: + +```javascript +var myUuid = uuid.noConflict(); +myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' +``` + +## Deprecated APIs + +Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. + +### uuid([format [, buffer [, offset]]]) + +uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). + +## Testing + +In node.js + +``` +> cd test +> node test.js +``` + +In Browser + +``` +open test/test.html +``` + +### Benchmarking + +Requires node.js + +``` +cd benchmark/ +npm install +node benchmark.js +``` + +For a more complete discussion of uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/uuid/wiki/Benchmark) + +For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). + +## Release notes + +### 2.0.0 + +* Removed uuid.BufferClass + +### 1.4.0 + +* Improved module context detection +* Removed public RNG functions + +### 1.3.2 + +* Improve tests and handling of v1() options (Issue #24) +* Expose RNG option to allow for perf testing with different generators + +### 1.3.0 + +* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! +* Support for node.js crypto API +* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/README.md b/node_modules/csscomb/node_modules/uuid/benchmark/README.md similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/README.md rename to node_modules/csscomb/node_modules/uuid/benchmark/README.md diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/bench.gnu b/node_modules/csscomb/node_modules/uuid/benchmark/bench.gnu similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/bench.gnu rename to node_modules/csscomb/node_modules/uuid/benchmark/bench.gnu diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/bench.sh b/node_modules/csscomb/node_modules/uuid/benchmark/bench.sh similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/bench.sh rename to node_modules/csscomb/node_modules/uuid/benchmark/bench.sh diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/benchmark-native.c b/node_modules/csscomb/node_modules/uuid/benchmark/benchmark-native.c similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/benchmark-native.c rename to node_modules/csscomb/node_modules/uuid/benchmark/benchmark-native.c diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/benchmark.js b/node_modules/csscomb/node_modules/uuid/benchmark/benchmark.js similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/node-uuid/benchmark/benchmark.js rename to node_modules/csscomb/node_modules/uuid/benchmark/benchmark.js diff --git a/node_modules/csscomb/node_modules/uuid/benchmark/package.json b/node_modules/csscomb/node_modules/uuid/benchmark/package.json new file mode 100644 index 0000000..94e0b59 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/benchmark/package.json @@ -0,0 +1,9 @@ +{ + "name": "benchmark-uuid", + "private": true, + "description": "Benchmarks for node-uuid", + "dependencies": { + "uuid": "1.4.1", + "uuid-js": "0.7.4" + } +} diff --git a/node_modules/csscomb/node_modules/uuid/misc/compare.js b/node_modules/csscomb/node_modules/uuid/misc/compare.js new file mode 100644 index 0000000..3de3415 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/misc/compare.js @@ -0,0 +1,62 @@ +var assert = require('assert'), + nodeuuid = require('../'), + uuidjs = require('uuid-js'), + util = require('util'), + exec = require('child_process').exec, + os = require('os'); + +// On Mac Os X / macports there's only the ossp-uuid package that provides uuid +// On Linux there's uuid-runtime which provides uuidgen +var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; + +function compare(ids) { + console.log(ids); + for (var i = 0; i < ids.length; i++) { + var id = ids[i].split('-'); + id = [id[2], id[1], id[0]].join(''); + ids[i] = id; + } + var sorted = ([].concat(ids)).sort(); + + if (sorted.toString() !== ids.toString()) { + console.log('Warning: sorted !== ids'); + } else { + console.log('everything in order!'); + } +} + +// Test time order of v1 uuids +var ids = []; +while (ids.length < 10e3) ids.push(nodeuuid.v1()); + +var max = 10; +console.log('node-uuid:'); +ids = []; +for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); +compare(ids); + +console.log(''); +console.log('uuidjs:'); +ids = []; +for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); +compare(ids); + +console.log(''); +console.log('libuuid:'); +ids = []; +var count = 0; +var last = function() { + compare(ids); +} +var cb = function(err, stdout, stderr) { + ids.push(stdout.substring(0, stdout.length-1)); + count++; + if (count < max) { + return next(); + } + last(); +}; +var next = function() { + exec(uuidCmd, cb); +}; +next(); diff --git a/node_modules/csscomb/node_modules/uuid/misc/perf.js b/node_modules/csscomb/node_modules/uuid/misc/perf.js new file mode 100644 index 0000000..bdc9eb4 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/misc/perf.js @@ -0,0 +1,102 @@ +var assert = require('assert'); + +var uuid = require('../'); + +var log = console.log; + +var generators = { + v1: uuid.v1, + v4: uuid.v4 +}; + +var UUID_FORMAT = { + v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i, + v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i +}; + +var N = 1e4; + +// Get %'age an actual value differs from the ideal value +function divergence(actual, ideal) { + return Math.round(100*100*(actual - ideal)/ideal)/100; +} + +function rate(msg, t) { + log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second'); +} + +for (var version in generators) { + var counts = {}, max = 0; + var generator = generators[version]; + var format = UUID_FORMAT[version]; + + log('\nSanity check ' + N + ' ' + version + ' uuids'); + for (var i = 0, ok = 0; i < N; i++) { + id = generator(); + if (!format.test(id)) { + throw Error(id + ' is not a valid UUID string'); + } + + if (id != uuid.unparse(uuid.parse(id))) { + assert(fail, id + ' is not a valid id'); + } + + // Count digits for our randomness check + if (version == 'v4') { + var digits = id.replace(/-/g, '').split(''); + for (var j = digits.length-1; j >= 0; j--) { + var c = digits[j]; + max = Math.max(max, counts[c] = (counts[c] || 0) + 1); + } + } + } + + // Check randomness for v4 UUIDs + if (version == 'v4') { + // Limit that we get worried about randomness. (Purely empirical choice, this!) + var limit = 2*100*Math.sqrt(1/N); + + log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)'); + + for (var i = 0; i < 16; i++) { + var c = i.toString(16); + var bar = '', n = counts[c], p = Math.round(n/max*100|0); + + // 1-3,5-8, and D-F: 1:16 odds over 30 digits + var ideal = N*30/16; + if (i == 4) { + // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits + ideal = N*(1 + 30/16); + } else if (i >= 8 && i <= 11) { + // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits + ideal = N*(1/4 + 30/16); + } else { + // Otherwise: 1:16 odds on 30 digits + ideal = N*30/16; + } + var d = divergence(n, ideal); + + // Draw bar using UTF squares (just for grins) + var s = n/max*50 | 0; + while (s--) bar += '='; + + assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)'); + } + } +} + +// Perf tests +for (var version in generators) { + log('\nPerformance testing ' + version + ' UUIDs'); + var generator = generators[version]; + var buf = new uuid.BufferClass(16); + + for (var i = 0, t = Date.now(); i < N; i++) generator(); + rate('uuid.' + version + '()', t); + + for (var i = 0, t = Date.now(); i < N; i++) generator('binary'); + rate('uuid.' + version + '(\'binary\')', t); + + for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf); + rate('uuid.' + version + '(\'binary\', buffer)', t); +} diff --git a/node_modules/csscomb/node_modules/uuid/package.json b/node_modules/csscomb/node_modules/uuid/package.json new file mode 100644 index 0000000..2a9135f --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/package.json @@ -0,0 +1,127 @@ +{ + "_args": [ + [ + { + "raw": "uuid@^2.0.2", + "scope": null, + "escapedName": "uuid", + "name": "uuid", + "rawSpec": "^2.0.2", + "spec": ">=2.0.2 <3.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/vow-fs" + ] + ], + "_from": "uuid@>=2.0.2 <3.0.0", + "_id": "uuid@2.0.3", + "_inCache": true, + "_installable": true, + "_location": "/uuid", + "_nodeVersion": "6.2.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/uuid-2.0.3.tgz_1474232617862_0.6578061426989734" + }, + "_npmUser": { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + }, + "_npmVersion": "3.8.9", + "_phantomChildren": {}, + "_requested": { + "raw": "uuid@^2.0.2", + "scope": null, + "escapedName": "uuid", + "name": "uuid", + "rawSpec": "^2.0.2", + "spec": ">=2.0.2 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/vow-fs" + ], + "_resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", + "_shasum": "67e2e863797215530dff318e5bf9dcebfd47b21a", + "_shrinkwrap": null, + "_spec": "uuid@^2.0.2", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/vow-fs", + "author": { + "name": "Robert Kieffer", + "email": "robert@broofa.com" + }, + "browser": { + "./rng.js": "./rng-browser.js" + }, + "bugs": { + "url": "https://github.com/defunctzombie/node-uuid/issues" + }, + "contributors": [ + { + "name": "Christoph Tavan", + "email": "dev@tavan.de" + }, + { + "name": "Vincent Voyer", + "email": "vincent@zeroload.net" + } + ], + "dependencies": {}, + "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", + "devDependencies": { + "mocha": "1.8.0" + }, + "directories": {}, + "dist": { + "shasum": "67e2e863797215530dff318e5bf9dcebfd47b21a", + "tarball": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz" + }, + "gitHead": "3f44acd0e722e965c14af816e2f658361a6b15f9", + "homepage": "https://github.com/defunctzombie/node-uuid#readme", + "keywords": [ + "uuid", + "guid", + "rfc4122" + ], + "license": "MIT", + "main": "./uuid.js", + "maintainers": [ + { + "name": "broofa", + "email": "robert@broofa.com" + }, + { + "name": "tim-smart", + "email": "tim@fostle.com" + }, + { + "name": "vvo", + "email": "vincent.voyer@gmail.com" + }, + { + "name": "defunctzombie", + "email": "shtylman@gmail.com" + } + ], + "name": "uuid", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/defunctzombie/node-uuid.git" + }, + "scripts": { + "test": "mocha test/test.js" + }, + "testling": { + "browsers": [ + "ie6..latest", + "firefox/3.6..latest", + "chrome/22..latest", + "safari/5.1..latest" + ], + "harness": "mocha-tdd", + "files": "test/*.js" + }, + "version": "2.0.3" +} diff --git a/node_modules/csscomb/node_modules/uuid/rng-browser.js b/node_modules/csscomb/node_modules/uuid/rng-browser.js new file mode 100644 index 0000000..82ffaf6 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/rng-browser.js @@ -0,0 +1,32 @@ + +var rng; + +var crypto = global.crypto || global.msCrypto; // for IE 11 +if (crypto && crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // Moderately fast, high quality + var _rnds8 = new Uint8Array(16); + rng = function whatwgRNG() { + crypto.getRandomValues(_rnds8); + return _rnds8; + }; +} + +if (!rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; +} + +module.exports = rng; + diff --git a/node_modules/csscomb/node_modules/uuid/rng.js b/node_modules/csscomb/node_modules/uuid/rng.js new file mode 100644 index 0000000..3977f79 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/rng.js @@ -0,0 +1,4 @@ +var rb = require('crypto').randomBytes; +module.exports = function() { + return rb(16); +}; diff --git a/node_modules/csscomb/node_modules/uuid/test/mocha.opts b/node_modules/csscomb/node_modules/uuid/test/mocha.opts new file mode 100644 index 0000000..e2bfcc5 --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/test/mocha.opts @@ -0,0 +1 @@ +--ui qunit diff --git a/node_modules/csscomb/node_modules/uuid/test/test.js b/node_modules/csscomb/node_modules/uuid/test/test.js new file mode 100644 index 0000000..4c9872f --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/test/test.js @@ -0,0 +1,105 @@ +var assert = require('assert'); + +var uuid = require('../'); + +// Verify ordering of v1 ids created with explicit times +var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00 + +function compare(name, ids) { + test(name, function() { + // avoid .map for older browsers + for (var i=0 ; i 10k ids created in 1ms', function() { + // Verify throw if too many ids created + var thrown = false; + try { + uuid.v1({msecs: TIME, nsecs: 10000}); + } catch (e) { + thrown = true; + } + assert(thrown, 'Exception thrown when > 10K ids created in 1 ms'); +}); + +test('clock regression by msec', function() { + // Verify clock regression bumps clockseq + var uidt = uuid.v1({msecs: TIME}); + var uidtb = uuid.v1({msecs: TIME - 1}); + assert( + parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1, + 'Clock regression by msec increments the clockseq' + ); +}); + +test('clock regression by nsec', function() { + // Verify clock regression bumps clockseq + var uidtn = uuid.v1({msecs: TIME, nsecs: 10}); + var uidtnb = uuid.v1({msecs: TIME, nsecs: 9}); + assert( + parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1, + 'Clock regression by nsec increments the clockseq' + ); +}); + +test('explicit options product expected id', function() { + // Verify explicit options produce expected id + var id = uuid.v1({ + msecs: 1321651533573, + nsecs: 5432, + clockseq: 0x385c, + node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ] + }); + assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id'); +}); + +test('ids spanning 1ms boundary are 100ns apart', function() { + // Verify adjacent ids across a msec boundary are 1 time unit apart + var u0 = uuid.v1({msecs: TIME, nsecs: 9999}); + var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0}); + + var before = u0.split('-')[0], after = u1.split('-')[0]; + var dt = parseInt(after, 16) - parseInt(before, 16); + assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart'); +}); + +test('parse/unparse', function() { + var id = '00112233445566778899aabbccddeeff'; + assert(uuid.unparse(uuid.parse(id.substr(0,10))) == + '00112233-4400-0000-0000-000000000000', 'Short parse'); + assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) == + '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse'); +}); + diff --git a/node_modules/csscomb/node_modules/uuid/uuid.js b/node_modules/csscomb/node_modules/uuid/uuid.js new file mode 100644 index 0000000..be5bfed --- /dev/null +++ b/node_modules/csscomb/node_modules/uuid/uuid.js @@ -0,0 +1,183 @@ +// uuid.js +// +// Copyright (c) 2010-2012 Robert Kieffer +// MIT License - http://opensource.org/licenses/mit-license.php + +// Unique ID creation requires a high quality random # generator. We feature +// detect to determine the best RNG source, normalizing to a function that +// returns 128-bits of randomness, since that's what's usually required +var _rng = require('./rng'); + +// Maps for number <-> hex string conversion +var _byteToHex = []; +var _hexToByte = {}; +for (var i = 0; i < 256; i++) { + _byteToHex[i] = (i + 0x100).toString(16).substr(1); + _hexToByte[_byteToHex[i]] = i; +} + +// **`parse()` - Parse a UUID into it's component bytes** +function parse(s, buf, offset) { + var i = (buf && offset) || 0, ii = 0; + + buf = buf || []; + s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { + if (ii < 16) { // Don't overflow! + buf[i + ii++] = _hexToByte[oct]; + } + }); + + // Zero out remaining bytes if string was short + while (ii < 16) { + buf[i + ii++] = 0; + } + + return buf; +} + +// **`unparse()` - Convert UUID byte array (ala parse()) into a string** +function unparse(buf, offset) { + var i = offset || 0, bth = _byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; +} + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +// random #'s we need to init node and clockseq +var _seedBytes = _rng(); + +// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) +var _nodeId = [ + _seedBytes[0] | 0x01, + _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] +]; + +// Per 4.2.2, randomize (14 bit) clockseq +var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; + +// Previous uuid creation time +var _lastMSecs = 0, _lastNSecs = 0; + +// See https://github.com/broofa/node-uuid for API details +function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + var node = options.node || _nodeId; + for (var n = 0; n < 6; n++) { + b[i + n] = node[n]; + } + + return buf ? buf : unparse(b); +} + +// **`v4()` - Generate random UUID** + +// See https://github.com/broofa/node-uuid for API details +function v4(options, buf, offset) { + // Deprecated - 'format' argument, as supported in v1.2 + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options == 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || _rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ii++) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || unparse(rnds); +} + +// Export public API +var uuid = v4; +uuid.v1 = v1; +uuid.v4 = v4; +uuid.parse = parse; +uuid.unparse = unparse; + +module.exports = uuid; diff --git a/node_modules/csscomb/node_modules/vow-fs/LICENSE b/node_modules/csscomb/node_modules/vow-fs/LICENSE new file mode 100644 index 0000000..7d2215e --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-fs/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Dmitry Filatov + +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. diff --git a/node_modules/csscomb/node_modules/vow-fs/README.md b/node_modules/csscomb/node_modules/vow-fs/README.md new file mode 100644 index 0000000..0b1115e --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-fs/README.md @@ -0,0 +1,70 @@ +vow-fs [![NPM version](https://badge.fury.io/js/vow-fs.png)](http://badge.fury.io/js/vow-fs) [![Build Status](https://secure.travis-ci.org/dfilatov/vow-fs.png)](http://travis-ci.org/dfilatov/vow-fs) +====== + +[Vow](https://github.com/dfilatov/vow)-based file I/O for Node.js + +Requirements +------------ +Vow-fs works with Node.js 0.6 and above. + +Getting Started +--------------- +You can install vow-fs using Node Package Manager (npm): + + npm install vow-fs + +####Usage#### +````javascript +var fs = require('vow-fs'); +```` + +API +--- +####read(path, [encoding])#### +Returns a promise for the file's content at a given ````path````. +####write(path, data, [encoding])#### +Writes ````data```` to file at a given ````path````. Returns a promise for the completion of the operation. +####append(path, data, [encoding])#### +Appends````data```` to file's content at a given ````path````. Returns a promise for the completion of the operation. +####remove(path)#### +Removes a file at a given ````path````. Returns a promise for the completion of the operation. +####copy(sourcePath, targetPath)#### +Copies a file from ````sourcePath```` to ````targetPath````. Returns a promise for the completion of the operation. +####move(sourcePath, targetPath)#### +Moves a file or directory from ````sourcePath```` to ````targetPath````. Returns a promise for the completion of the operation. +####stat(path)#### +Returns a promise for the metadata about the given ````path```` as a [Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats) object. +####exists(path)#### +Returns a promise for whether the given ````path```` exists. +####link(sourcePath, targetPath)#### +Creates a hard link from the ````sourcePath```` to ````targetPath````. +####symLink(sourcePath, targetPath, [type=file])#### +Creates a symbolic link from the ````sourcePath```` to ````targetPath````. +####chown(path, uid, gid)#### +Changes the owner of a given ````path````. +####chmod(path, mode)#### +Changes the mode of a given ````path```` to ````mode````. +####absolute(path)#### +####isFile(path)#### +Returns a promise for whether the given ````path```` is a file. +####isDir(path)#### +Returns a promise for whether the given ````path```` is a directory. +####isSocket(path)#### +Returns a promise for whether the given ````path```` is a socket. +####isSymLink(path)#### +Returns a promise for whether the given ````path```` is a symbolic link. +####makeTmpFile([options])#### +Makes a temporary file. Returns a promise with generated path to file. +The ````options````: + * prefix (absent by default) + * dir (operating system's directory for temp files by default) + * ext (````.tmp```` by default) + +####listDir(path)#### +Returns a promise for a list of files and directories in directory at the given ````path````. +####makeDir(path, [mode=0777], [failIfExist=false])#### +Makes a directory at a given ````path```` and any necessary subdirectories (like ````mkdir -p````). Returns a promise for the completion of the operation. +####removeDir(path)#### +Recursively removes a directory at a given path (like ````remove -rf````). Returns a promise for the completion of the operation. +####glob(pattern, [options])#### +Matches files using the patterns. See https://github.com/isaacs/node-glob for details. diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/lib/fs.js b/node_modules/csscomb/node_modules/vow-fs/lib/fs.js similarity index 97% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/lib/fs.js rename to node_modules/csscomb/node_modules/vow-fs/lib/fs.js index 973a589..e346697 100644 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/lib/fs.js +++ b/node_modules/csscomb/node_modules/vow-fs/lib/fs.js @@ -1,7 +1,7 @@ /** * @module vow-fs * @author Filatov Dmitry - * @version 0.3.2 + * @version 0.3.6 * @license * Dual licensed under the MIT and GPL licenses: * * http://www.opensource.org/licenses/mit-license.php @@ -14,7 +14,7 @@ var vow = require('vow'), fs = require('fs'), path = require('path'), os = require('os'), - uuid = require('node-uuid'), + uuid = require('uuid'), glob = require('glob'), slice = Array.prototype.slice, promisify = function(nodeFn) { @@ -68,7 +68,7 @@ var vfs = module.exports = { /** * Reads file by given path * @param {String} path - * @param {String} [encoding=utf8] + * @param {String} [encoding] * @returns {vow:Promise} */ read : emfileFixWrapper(promisify(fs.readFile)), @@ -77,7 +77,7 @@ var vfs = module.exports = { * Writes data to file by given path * @param {String} path * @param {String|Buffer} data - * @param {String} [encoding=utf8] + * @param {String} [encoding] * @returns {vow:Promise} */ write : emfileFixWrapper(promisify(fs.writeFile)), @@ -86,7 +86,7 @@ var vfs = module.exports = { * Appends data to file by given path * @param {String} path * @param {String|Buffer} data - * @param {String} [encoding=utf8] + * @param {String} [encoding] * @returns {vow:Promise} */ append : emfileFixWrapper(promisify(fs.appendFile)), @@ -356,7 +356,7 @@ var vfs = module.exports = { options : function(opts) { if(typeof opts.openFileLimit !== 'undefined') { - openFilesQueue.params({ weightLimit : opts.openFileLimit }); + openFilesQueue.setParams({ weightLimit : opts.openFileLimit }); } } }; diff --git a/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/CHANGELOG.md b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/CHANGELOG.md new file mode 100644 index 0000000..0b6e99b --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/CHANGELOG.md @@ -0,0 +1,134 @@ +Changelog +========= +0.4.15 +----- + * Fixed an issue with double emit of PromiseRejectionEvent [#113] (https://github.com/dfilatov/vow/issues/113) + +0.4.14 +----- + * Added support of unhandled rejection event [#111] (https://github.com/dfilatov/vow/issues/111) + +0.4.13 +----- + * Added workaround to avoid bug with `Array.prototype.push` in Opera 41 + +0.4.12 +----- + * Wrong propagation of progress state fixed + +0.4.11 +----- + * Now global object (`window`, `global`) is passed properly + +0.4.10 +----- + * Now `MutationObserver` is used for internal "next tick" operations + +0.4.9 +----- + * `vow.cast` method was fixed to properly work with external promises [#88](https://github.com/dfilatov/vow/issues/88) + +0.4.8 +----- + * Detection of ymaps modular system was improved [#82](https://github.com/dfilatov/vow/issues/82) + +0.4.7 +----- + * `vow.all` had wrong behaviour in case of passing of another promise implementation [#77](https://github.com/dfilatov/vow/issues/77) + * `vow.timeout` rejects with `vow.TimedOutError` instead of `Error` reason in case of timeout [#76](https://github.com/dfilatov/vow/issues/76) + +0.4.6 +----- + * `defer.reject` had wrong behaviour in case of already rejected promise was passed [#72](https://github.com/dfilatov/vow/issues/72) + * CommonJS environment detection became more accurate [#74](https://github.com/dfilatov/vow/issues/74) + +0.4.5 +----- + * Throwing exceptions inside `vow.reject` was removed [#69](https://github.com/dfilatov/vow/issues/69) + * `promise.isFulfilled`/`promise.isRejected` immediately return proper state of promise got from `vow.fulfill(value)`/`reject(value`) [#68](https://github.com/dfilatov/vow/issues/68) + * Minor optimizations were added + +0.4.4 +----- + * ENB sources were added + +0.4.3 +----- + * Some optimizations for V8 were added [#60](https://github.com/dfilatov/vow/issues/60). Thanks to [B-Vladi](https://github.com/B-Vladi). + +0.4.2 +----- + * Pass progress state from items in all arrays/objects methods [#58](https://github.com/dfilatov/vow/issues/58) + +0.4.1 +----- + * Improve detection of vow-compatible promises + +0.4.0 +----- + * Implement [DOM Promise](http://dom.spec.whatwg.org/#promises) specification + * Implement [new Promise A+](https://github.com/promises-aplus/promises-spec) specification + * Remove `promise.fulfill`, `promise.reject`, `promise.notify` methods + * Add `vow.anyResolved` method [#53](https://github.com/dfilatov/vow/issues/53) + * Add `vow.cast` method [#53](https://github.com/dfilatov/vow/issues/56) + +0.3.12 +------ + * Make `Promise` class accessible from outside + +0.3.11 +------ + * Fix bug with inner timer in `delay` method [#45](https://github.com/dfilatov/jspromise/issues/45) + +0.3.10 +------ + * Use `setImmediate` instead of `process.nextTick` in Node.js >= 0.10.x [#40](https://github.com/dfilatov/jspromise/issues/40) + * Up Promises/A+ Compliance Test Suite to 1.3.2 + +0.3.9 +----- + * Fix for propagation of progress state [#37](https://github.com/dfilatov/jspromise/issues/37) + +0.3.8 +----- + * Fix for ignoring callback's context in always method [#35](https://github.com/dfilatov/jspromise/issues/35) + * Callback in `Vow.invoke` called in global context now + * bower.json added [#34](https://github.com/dfilatov/jspromise/issues/34) + +0.3.7 +----- + * `Vow.allPatiently` method added [#32](https://github.com/dfilatov/jspromise/issues/32) + +0.3.6 +----- + * Fix for properly work in mocha/phantomjs environment [#31](https://github.com/dfilatov/jspromise/issues/31) + +0.3.5 +----- + * Fix for synchronize `onProgress` callback in `promise.sync` method [#30](https://github.com/dfilatov/jspromise/issues/30) + +0.3.4 +----- + * Add ability to use multiple modules system simultaneously [#26](https://github.com/dfilatov/jspromise/issues/26) + * Add callbacks to `promise.done` method [#29](https://github.com/dfilatov/jspromise/issues/29) + +0.3.3 +----- + * Use `Vow` instead `this` in all static methods + * Speed up optimizations + +0.3.2 +----- + * Ability to specify context for callbacks [#28](https://github.com/dfilatov/jspromise/issues/28) + +0.3.1 +----- + * Add support for [ym module's system](https://github.com/ymaps/modules) [#24](https://github.com/dfilatov/jspromise/issues/24) + +0.3.0 +----- + * Add support for `progress/notify` [#23](https://github.com/dfilatov/jspromise/issues/23) + +0.2.6 +----- + * `promise.always` doesn't pass the return value of `onResolved` [#19](https://github.com/dfilatov/jspromise/issues/19) diff --git a/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/LICENSE b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/LICENSE new file mode 100644 index 0000000..afaa3a0 --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012 Dmitry Filatov + +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. diff --git a/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/README.md b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/README.md new file mode 100644 index 0000000..05261d1 --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/README.md @@ -0,0 +1,70 @@ + +Vow [![NPM version](https://badge.fury.io/js/vow.png)](http://badge.fury.io/js/vow) [![Build Status](https://secure.travis-ci.org/dfilatov/vow.png)](http://travis-ci.org/dfilatov/vow) +========= + +Vow is a [Promises/A+](http://promisesaplus.com/) implementation. +It also supports [ES6 Promises](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) specification. + +Full API reference can be found at http://dfilatov.github.io/vow/. + +Getting Started +--------------- +### In Node.js ### +You can install using Node Package Manager (npm): + + npm install vow + +### In Browsers ### +```html + +``` +It also supports RequireJS module format and [YM module](https://github.com/ymaps/modules) format. + +Vow has been tested in IE6+, Mozilla Firefox 3+, Chrome 5+, Safari 5+, Opera 10+. + +Usage +----- +### Creating a promise ### +There are two possible ways to create a promise. +#### 1. Using a deferred #### +```js +function doSomethingAsync() { + var deferred = vow.defer(); + + // now you can resolve, reject, notify corresponging promise within `deferred` + // e.g. `defer.resolve('ok');` + + return deferred.promise(); // and return corresponding promise to subscribe to reactions +} + +doSomethingAsync().then( + function() {}, // onFulfilled reaction + function() {}, // onRejected reaction + function() {} // onNotified reaction + ); +``` +The difference between `deferred` and `promise` is that `deferred` contains methods to resolve, reject and notify corresponding promise, but the `promise` by itself allows only to subscribe on these actions. + +#### 2. ES6-compatible way #### +```js +function doSomethingAsync() { + return new vow.Promise(function(resolve, reject, notify) { + // now you can resolve, reject, notify the promise + }); +} + +doSomethingAsync().then( + function() {}, // onFulfilled reaction + function() {}, // onRejected reaction + function() {} // onNotified reaction + ); +``` + +Extensions and related projects +------------------------------- + * [vow-fs](https://github.com/dfilatov/vow-fs) — vow-based file I/O for Node.js + * [vow-node](https://github.com/dfilatov/vow-node) — extension for vow to work with nodejs-style callbacks + * [vow-queue](https://github.com/dfilatov/vow-queue) — vow-based task queue with weights and priorities + * [vow-asker](https://github.com/nodules/vow-asker) — wraps [asker](https://github.com/nodules/asker) API in the vow promises implementation + +**NOTE**. Documentation for old versions of the library can be found at https://github.com/dfilatov/vow/blob/0.3.x/README.md. diff --git a/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/lib/vow.js b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/lib/vow.js new file mode 100644 index 0000000..0283967 --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/lib/vow.js @@ -0,0 +1,1373 @@ +/** + * @module vow + * @author Filatov Dmitry + * @version 0.4.16 + * @license + * Dual licensed under the MIT and GPL licenses: + * * http://www.opensource.org/licenses/mit-license.php + * * http://www.gnu.org/licenses/gpl.html + */ + +(function(global) { + +var undef, + nextTick = (function() { + var fns = [], + enqueueFn = function(fn) { + fns.push(fn); + return fns.length === 1; + }, + callFns = function() { + var fnsToCall = fns, i = 0, len = fns.length; + fns = []; + while(i < len) { + fnsToCall[i++](); + } + }; + + if(typeof setImmediate === 'function') { // ie10, nodejs >= 0.10 + return function(fn) { + enqueueFn(fn) && setImmediate(callFns); + }; + } + + if(typeof process === 'object' && process.nextTick) { // nodejs < 0.10 + return function(fn) { + enqueueFn(fn) && process.nextTick(callFns); + }; + } + + var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; // modern browsers + if(MutationObserver) { + var num = 1, + node = document.createTextNode(''); + + new MutationObserver(callFns).observe(node, { characterData : true }); + + return function(fn) { + enqueueFn(fn) && (node.data = (num *= -1)); + }; + } + + if(global.postMessage) { + var isPostMessageAsync = true; + if(global.attachEvent) { + var checkAsync = function() { + isPostMessageAsync = false; + }; + global.attachEvent('onmessage', checkAsync); + global.postMessage('__checkAsync', '*'); + global.detachEvent('onmessage', checkAsync); + } + + if(isPostMessageAsync) { + var msg = '__promise' + Math.random() + '_' +new Date, + onMessage = function(e) { + if(e.data === msg) { + e.stopPropagation && e.stopPropagation(); + callFns(); + } + }; + + global.addEventListener? + global.addEventListener('message', onMessage, true) : + global.attachEvent('onmessage', onMessage); + + return function(fn) { + enqueueFn(fn) && global.postMessage(msg, '*'); + }; + } + } + + var doc = global.document; + if('onreadystatechange' in doc.createElement('script')) { // ie6-ie8 + var createScript = function() { + var script = doc.createElement('script'); + script.onreadystatechange = function() { + script.parentNode.removeChild(script); + script = script.onreadystatechange = null; + callFns(); + }; + (doc.documentElement || doc.body).appendChild(script); + }; + + return function(fn) { + enqueueFn(fn) && createScript(); + }; + } + + return function(fn) { // old browsers + enqueueFn(fn) && setTimeout(callFns, 0); + }; + })(), + throwException = function(e) { + nextTick(function() { + throw e; + }); + }, + isFunction = function(obj) { + return typeof obj === 'function'; + }, + isObject = function(obj) { + return obj !== null && typeof obj === 'object'; + }, + toStr = Object.prototype.toString, + isArray = Array.isArray || function(obj) { + return toStr.call(obj) === '[object Array]'; + }, + getArrayKeys = function(arr) { + var res = [], + i = 0, len = arr.length; + while(i < len) { + res.push(i++); + } + return res; + }, + getObjectKeys = Object.keys || function(obj) { + var res = []; + for(var i in obj) { + obj.hasOwnProperty(i) && res.push(i); + } + return res; + }, + defineCustomErrorType = function(name) { + var res = function(message) { + this.name = name; + this.message = message; + }; + + res.prototype = new Error(); + + return res; + }, + wrapOnFulfilled = function(onFulfilled, idx) { + return function(val) { + onFulfilled.call(this, val, idx); + }; + }, + emitUnhandledRejection = global.PromiseRejectionEvent? + function(reason, promise) { + new global.PromiseRejectionEvent( + 'unhandledrejection', + { + promise : promise, + reason : reason + }); + } : + typeof process === 'object' && process.emit? + function(reason, promise) { + process.emit('unhandledRejection', reason, promise); + } : + function() {}; + +/** + * @class Deferred + * @exports vow:Deferred + * @description + * The `Deferred` class is used to encapsulate newly-created promise object along with functions that resolve, reject or notify it. + */ + +/** + * @constructor + * @description + * You can use `vow.defer()` instead of using this constructor. + * + * `new vow.Deferred()` gives the same result as `vow.defer()`. + */ +var Deferred = function() { + this._promise = new Promise(); +}; + +Deferred.prototype = /** @lends Deferred.prototype */{ + /** + * Returns the corresponding promise. + * + * @returns {vow:Promise} + */ + promise : function() { + return this._promise; + }, + + /** + * Resolves the corresponding promise with the given `value`. + * + * @param {*} value + * + * @example + * ```js + * var defer = vow.defer(), + * promise = defer.promise(); + * + * promise.then(function(value) { + * // value is "'success'" here + * }); + * + * defer.resolve('success'); + * ``` + */ + resolve : function(value) { + this._promise.isResolved() || this._promise._resolve(value); + }, + + /** + * Rejects the corresponding promise with the given `reason`. + * + * @param {*} reason + * + * @example + * ```js + * var defer = vow.defer(), + * promise = defer.promise(); + * + * promise.fail(function(reason) { + * // reason is "'something is wrong'" here + * }); + * + * defer.reject('something is wrong'); + * ``` + */ + reject : function(reason) { + if(this._promise.isResolved()) { + return; + } + + if(vow.isPromise(reason)) { + reason = reason.then(function(val) { + var defer = vow.defer(); + defer.reject(val); + return defer.promise(); + }); + this._promise._resolve(reason); + } + else { + this._promise._reject(reason); + } + }, + + /** + * Notifies the corresponding promise with the given `value`. + * + * @param {*} value + * + * @example + * ```js + * var defer = vow.defer(), + * promise = defer.promise(); + * + * promise.progress(function(value) { + * // value is "'20%'", "'40%'" here + * }); + * + * defer.notify('20%'); + * defer.notify('40%'); + * ``` + */ + notify : function(value) { + this._promise.isResolved() || this._promise._notify(value); + } +}; + +var PROMISE_STATUS = { + PENDING : 0, + RESOLVED : 1, + FULFILLED : 2, + REJECTED : 3 +}; + +/** + * @class Promise + * @exports vow:Promise + * @description + * The `Promise` class is used when you want to give to the caller something to subscribe to, + * but not the ability to resolve or reject the deferred. + */ + +/** + * @constructor + * @param {Function} resolver See https://github.com/domenic/promises-unwrapping/blob/master/README.md#the-promise-constructor for details. + * @description + * You should use this constructor directly only if you are going to use `vow` as DOM Promises implementation. + * In other case you should use `vow.defer()` and `defer.promise()` methods. + * @example + * ```js + * function fetchJSON(url) { + * return new vow.Promise(function(resolve, reject, notify) { + * var xhr = new XMLHttpRequest(); + * xhr.open('GET', url); + * xhr.responseType = 'json'; + * xhr.send(); + * xhr.onload = function() { + * if(xhr.response) { + * resolve(xhr.response); + * } + * else { + * reject(new TypeError()); + * } + * }; + * }); + * } + * ``` + */ +var Promise = function(resolver) { + this._value = undef; + this._status = PROMISE_STATUS.PENDING; + this._shouldEmitUnhandledRejection = true; + + this._fulfilledCallbacks = []; + this._rejectedCallbacks = []; + this._progressCallbacks = []; + + if(resolver) { // NOTE: see https://github.com/domenic/promises-unwrapping/blob/master/README.md + var _this = this, + resolverFnLen = resolver.length; + + try { + resolver( + function(val) { + _this.isResolved() || _this._resolve(val); + }, + resolverFnLen > 1? + function(reason) { + _this.isResolved() || _this._reject(reason); + } : + undef, + resolverFnLen > 2? + function(val) { + _this.isResolved() || _this._notify(val); + } : + undef); + } + catch(e) { + this._reject(e); + } + } +}; + +Promise.prototype = /** @lends Promise.prototype */ { + /** + * Returns the value of the fulfilled promise or the reason in case of rejection. + * + * @returns {*} + */ + valueOf : function() { + return this._value; + }, + + /** + * Returns `true` if the promise is resolved. + * + * @returns {Boolean} + */ + isResolved : function() { + return this._status !== PROMISE_STATUS.PENDING; + }, + + /** + * Returns `true` if the promise is fulfilled. + * + * @returns {Boolean} + */ + isFulfilled : function() { + return this._status === PROMISE_STATUS.FULFILLED; + }, + + /** + * Returns `true` if the promise is rejected. + * + * @returns {Boolean} + */ + isRejected : function() { + return this._status === PROMISE_STATUS.REJECTED; + }, + + /** + * Adds reactions to the promise. + * + * @param {Function} [onFulfilled] Callback that will be invoked with a provided value after the promise has been fulfilled + * @param {Function} [onRejected] Callback that will be invoked with a provided reason after the promise has been rejected + * @param {Function} [onProgress] Callback that will be invoked with a provided value after the promise has been notified + * @param {Object} [ctx] Context of the callbacks execution + * @returns {vow:Promise} A new promise, see https://github.com/promises-aplus/promises-spec for details + */ + then : function(onFulfilled, onRejected, onProgress, ctx) { + this._shouldEmitUnhandledRejection = false; + var defer = new Deferred(); + this._addCallbacks(defer, onFulfilled, onRejected, onProgress, ctx); + return defer.promise(); + }, + + /** + * Adds only a rejection reaction. This method is a shorthand for `promise.then(undefined, onRejected)`. + * + * @param {Function} onRejected Callback that will be called with a provided 'reason' as argument after the promise has been rejected + * @param {Object} [ctx] Context of the callback execution + * @returns {vow:Promise} + */ + 'catch' : function(onRejected, ctx) { + return this.then(undef, onRejected, ctx); + }, + + /** + * Adds only a rejection reaction. This method is a shorthand for `promise.then(null, onRejected)`. It's also an alias for `catch`. + * + * @param {Function} onRejected Callback to be called with the value after promise has been rejected + * @param {Object} [ctx] Context of the callback execution + * @returns {vow:Promise} + */ + fail : function(onRejected, ctx) { + return this.then(undef, onRejected, ctx); + }, + + /** + * Adds a resolving reaction (for both fulfillment and rejection). + * + * @param {Function} onResolved Callback that will be invoked with the promise as an argument, after the promise has been resolved. + * @param {Object} [ctx] Context of the callback execution + * @returns {vow:Promise} + */ + always : function(onResolved, ctx) { + var _this = this, + cb = function() { + return onResolved.call(this, _this); + }; + + return this.then(cb, cb, ctx); + }, + + /** + * Adds a progress reaction. + * + * @param {Function} onProgress Callback that will be called with a provided value when the promise has been notified + * @param {Object} [ctx] Context of the callback execution + * @returns {vow:Promise} + */ + progress : function(onProgress, ctx) { + return this.then(undef, undef, onProgress, ctx); + }, + + /** + * Like `promise.then`, but "spreads" the array into a variadic value handler. + * It is useful with the `vow.all` and the `vow.allResolved` methods. + * + * @param {Function} [onFulfilled] Callback that will be invoked with a provided value after the promise has been fulfilled + * @param {Function} [onRejected] Callback that will be invoked with a provided reason after the promise has been rejected + * @param {Object} [ctx] Context of the callbacks execution + * @returns {vow:Promise} + * + * @example + * ```js + * var defer1 = vow.defer(), + * defer2 = vow.defer(); + * + * vow.all([defer1.promise(), defer2.promise()]).spread(function(arg1, arg2) { + * // arg1 is "1", arg2 is "'two'" here + * }); + * + * defer1.resolve(1); + * defer2.resolve('two'); + * ``` + */ + spread : function(onFulfilled, onRejected, ctx) { + return this.then( + function(val) { + return onFulfilled.apply(this, val); + }, + onRejected, + ctx); + }, + + /** + * Like `then`, but terminates a chain of promises. + * If the promise has been rejected, this method throws it's "reason" as an exception in a future turn of the event loop. + * + * @param {Function} [onFulfilled] Callback that will be invoked with a provided value after the promise has been fulfilled + * @param {Function} [onRejected] Callback that will be invoked with a provided reason after the promise has been rejected + * @param {Function} [onProgress] Callback that will be invoked with a provided value after the promise has been notified + * @param {Object} [ctx] Context of the callbacks execution + * + * @example + * ```js + * var defer = vow.defer(); + * defer.reject(Error('Internal error')); + * defer.promise().done(); // exception to be thrown + * ``` + */ + done : function(onFulfilled, onRejected, onProgress, ctx) { + this + .then(onFulfilled, onRejected, onProgress, ctx) + .fail(throwException); + }, + + /** + * Returns a new promise that will be fulfilled in `delay` milliseconds if the promise is fulfilled, + * or immediately rejected if the promise is rejected. + * + * @param {Number} delay + * @returns {vow:Promise} + */ + delay : function(delay) { + var timer, + promise = this.then(function(val) { + var defer = new Deferred(); + timer = setTimeout( + function() { + defer.resolve(val); + }, + delay); + + return defer.promise(); + }); + + promise.always(function() { + clearTimeout(timer); + }); + + return promise; + }, + + /** + * Returns a new promise that will be rejected in `timeout` milliseconds + * if the promise is not resolved beforehand. + * + * @param {Number} timeout + * @returns {vow:Promise} + * + * @example + * ```js + * var defer = vow.defer(), + * promiseWithTimeout1 = defer.promise().timeout(50), + * promiseWithTimeout2 = defer.promise().timeout(200); + * + * setTimeout( + * function() { + * defer.resolve('ok'); + * }, + * 100); + * + * promiseWithTimeout1.fail(function(reason) { + * // promiseWithTimeout to be rejected in 50ms + * }); + * + * promiseWithTimeout2.then(function(value) { + * // promiseWithTimeout to be fulfilled with "'ok'" value + * }); + * ``` + */ + timeout : function(timeout) { + var defer = new Deferred(), + timer = setTimeout( + function() { + defer.reject(new vow.TimedOutError('timed out')); + }, + timeout); + + this.then( + function(val) { + defer.resolve(val); + }, + function(reason) { + defer.reject(reason); + }); + + defer.promise().always(function() { + clearTimeout(timer); + }); + + return defer.promise(); + }, + + _vow : true, + + _resolve : function(val) { + if(this._status > PROMISE_STATUS.RESOLVED) { + return; + } + + if(val === this) { + this._reject(TypeError('Can\'t resolve promise with itself')); + return; + } + + this._status = PROMISE_STATUS.RESOLVED; + + if(val && !!val._vow) { // shortpath for vow.Promise + if(val.isFulfilled()) { + this._fulfill(val.valueOf()); + } + else if(val.isRejected()) { + val._shouldEmitUnhandledRejection = false; + this._reject(val.valueOf()); + } + else { + val.then( + this._fulfill, + this._reject, + this._notify, + this); + } + + return; + } + + if(isObject(val) || isFunction(val)) { + var then; + try { + then = val.then; + } + catch(e) { + this._reject(e); + return; + } + + if(isFunction(then)) { + var _this = this, + isResolved = false; + + try { + then.call( + val, + function(val) { + if(isResolved) { + return; + } + + isResolved = true; + _this._resolve(val); + }, + function(err) { + if(isResolved) { + return; + } + + isResolved = true; + _this._reject(err); + }, + function(val) { + _this._notify(val); + }); + } + catch(e) { + isResolved || this._reject(e); + } + + return; + } + } + + this._fulfill(val); + }, + + _fulfill : function(val) { + if(this._status > PROMISE_STATUS.RESOLVED) { + return; + } + + this._status = PROMISE_STATUS.FULFILLED; + this._value = val; + + this._callCallbacks(this._fulfilledCallbacks, val); + this._fulfilledCallbacks = this._rejectedCallbacks = this._progressCallbacks = undef; + }, + + _reject : function(reason) { + if(this._status > PROMISE_STATUS.RESOLVED) { + return; + } + + this._status = PROMISE_STATUS.REJECTED; + this._value = reason; + + this._callCallbacks(this._rejectedCallbacks, reason); + + if(!this._rejectedCallbacks.length) { + var _this = this; + nextTick(function() { + if(_this._shouldEmitUnhandledRejection) { + emitUnhandledRejection(reason, _this); + } + }); + } + + this._fulfilledCallbacks = this._rejectedCallbacks = this._progressCallbacks = undef; + }, + + _notify : function(val) { + this._callCallbacks(this._progressCallbacks, val); + }, + + _addCallbacks : function(defer, onFulfilled, onRejected, onProgress, ctx) { + if(onRejected && !isFunction(onRejected)) { + ctx = onRejected; + onRejected = undef; + } + else if(onProgress && !isFunction(onProgress)) { + ctx = onProgress; + onProgress = undef; + } + + if(onRejected) { + this._shouldEmitUnhandledRejection = false; + } + + var cb; + + if(!this.isRejected()) { + cb = { defer : defer, fn : isFunction(onFulfilled)? onFulfilled : undef, ctx : ctx }; + this.isFulfilled()? + this._callCallbacks([cb], this._value) : + this._fulfilledCallbacks.push(cb); + } + + if(!this.isFulfilled()) { + cb = { defer : defer, fn : onRejected, ctx : ctx }; + this.isRejected()? + this._callCallbacks([cb], this._value) : + this._rejectedCallbacks.push(cb); + } + + if(this._status <= PROMISE_STATUS.RESOLVED) { + this._progressCallbacks.push({ defer : defer, fn : onProgress, ctx : ctx }); + } + }, + + _callCallbacks : function(callbacks, arg) { + var len = callbacks.length; + if(!len) { + return; + } + + var isResolved = this.isResolved(), + isFulfilled = this.isFulfilled(), + isRejected = this.isRejected(); + + nextTick(function() { + var i = 0, cb, defer, fn; + while(i < len) { + cb = callbacks[i++]; + defer = cb.defer; + fn = cb.fn; + + if(fn) { + var ctx = cb.ctx, + res; + try { + res = ctx? fn.call(ctx, arg) : fn(arg); + } + catch(e) { + defer.reject(e); + continue; + } + + isResolved? + defer.resolve(res) : + defer.notify(res); + } + else if(isFulfilled) { + defer.resolve(arg); + } + else if(isRejected) { + defer.reject(arg); + } + else { + defer.notify(arg); + } + } + }); + } +}; + +/** @lends Promise */ +var staticMethods = { + /** + * Coerces the given `value` to a promise, or returns the `value` if it's already a promise. + * + * @param {*} value + * @returns {vow:Promise} + */ + cast : function(value) { + return vow.cast(value); + }, + + /** + * Returns a promise, that will be fulfilled only after all the items in `iterable` are fulfilled. + * If any of the `iterable` items gets rejected, then the returned promise will be rejected. + * + * @param {Array|Object} iterable + * @returns {vow:Promise} + */ + all : function(iterable) { + return vow.all(iterable); + }, + + /** + * Returns a promise, that will be fulfilled only when any of the items in `iterable` are fulfilled. + * If any of the `iterable` items gets rejected, then the returned promise will be rejected. + * + * @param {Array} iterable + * @returns {vow:Promise} + */ + race : function(iterable) { + return vow.anyResolved(iterable); + }, + + /** + * Returns a promise that has already been resolved with the given `value`. + * If `value` is a promise, the returned promise will have `value`'s state. + * + * @param {*} value + * @returns {vow:Promise} + */ + resolve : function(value) { + return vow.resolve(value); + }, + + /** + * Returns a promise that has already been rejected with the given `reason`. + * + * @param {*} reason + * @returns {vow:Promise} + */ + reject : function(reason) { + return vow.reject(reason); + } +}; + +for(var prop in staticMethods) { + staticMethods.hasOwnProperty(prop) && + (Promise[prop] = staticMethods[prop]); +} + +var vow = /** @exports vow */ { + Deferred : Deferred, + + Promise : Promise, + + /** + * Creates a new deferred. This method is a factory method for `vow:Deferred` class. + * It's equivalent to `new vow.Deferred()`. + * + * @returns {vow:Deferred} + */ + defer : function() { + return new Deferred(); + }, + + /** + * Static equivalent to `promise.then`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @param {Function} [onFulfilled] Callback that will be invoked with a provided value after the promise has been fulfilled + * @param {Function} [onRejected] Callback that will be invoked with a provided reason after the promise has been rejected + * @param {Function} [onProgress] Callback that will be invoked with a provided value after the promise has been notified + * @param {Object} [ctx] Context of the callbacks execution + * @returns {vow:Promise} + */ + when : function(value, onFulfilled, onRejected, onProgress, ctx) { + return vow.cast(value).then(onFulfilled, onRejected, onProgress, ctx); + }, + + /** + * Static equivalent to `promise.fail`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @param {Function} onRejected Callback that will be invoked with a provided reason after the promise has been rejected + * @param {Object} [ctx] Context of the callback execution + * @returns {vow:Promise} + */ + fail : function(value, onRejected, ctx) { + return vow.when(value, undef, onRejected, ctx); + }, + + /** + * Static equivalent to `promise.always`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @param {Function} onResolved Callback that will be invoked with the promise as an argument, after the promise has been resolved. + * @param {Object} [ctx] Context of the callback execution + * @returns {vow:Promise} + */ + always : function(value, onResolved, ctx) { + return vow.when(value).always(onResolved, ctx); + }, + + /** + * Static equivalent to `promise.progress`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @param {Function} onProgress Callback that will be invoked with a provided value after the promise has been notified + * @param {Object} [ctx] Context of the callback execution + * @returns {vow:Promise} + */ + progress : function(value, onProgress, ctx) { + return vow.when(value).progress(onProgress, ctx); + }, + + /** + * Static equivalent to `promise.spread`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @param {Function} [onFulfilled] Callback that will be invoked with a provided value after the promise has been fulfilled + * @param {Function} [onRejected] Callback that will be invoked with a provided reason after the promise has been rejected + * @param {Object} [ctx] Context of the callbacks execution + * @returns {vow:Promise} + */ + spread : function(value, onFulfilled, onRejected, ctx) { + return vow.when(value).spread(onFulfilled, onRejected, ctx); + }, + + /** + * Static equivalent to `promise.done`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @param {Function} [onFulfilled] Callback that will be invoked with a provided value after the promise has been fulfilled + * @param {Function} [onRejected] Callback that will be invoked with a provided reason after the promise has been rejected + * @param {Function} [onProgress] Callback that will be invoked with a provided value after the promise has been notified + * @param {Object} [ctx] Context of the callbacks execution + */ + done : function(value, onFulfilled, onRejected, onProgress, ctx) { + vow.when(value).done(onFulfilled, onRejected, onProgress, ctx); + }, + + /** + * Checks whether the given `value` is a promise-like object + * + * @param {*} value + * @returns {Boolean} + * + * @example + * ```js + * vow.isPromise('something'); // returns false + * vow.isPromise(vow.defer().promise()); // returns true + * vow.isPromise({ then : function() { }); // returns true + * ``` + */ + isPromise : function(value) { + return isObject(value) && isFunction(value.then); + }, + + /** + * Coerces the given `value` to a promise, or returns the `value` if it's already a promise. + * + * @param {*} value + * @returns {vow:Promise} + */ + cast : function(value) { + return value && !!value._vow? + value : + vow.resolve(value); + }, + + /** + * Static equivalent to `promise.valueOf`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @returns {*} + */ + valueOf : function(value) { + return value && isFunction(value.valueOf)? value.valueOf() : value; + }, + + /** + * Static equivalent to `promise.isFulfilled`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @returns {Boolean} + */ + isFulfilled : function(value) { + return value && isFunction(value.isFulfilled)? value.isFulfilled() : true; + }, + + /** + * Static equivalent to `promise.isRejected`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @returns {Boolean} + */ + isRejected : function(value) { + return value && isFunction(value.isRejected)? value.isRejected() : false; + }, + + /** + * Static equivalent to `promise.isResolved`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @returns {Boolean} + */ + isResolved : function(value) { + return value && isFunction(value.isResolved)? value.isResolved() : true; + }, + + /** + * Returns a promise that has already been resolved with the given `value`. + * If `value` is a promise, the returned promise will have `value`'s state. + * + * @param {*} value + * @returns {vow:Promise} + */ + resolve : function(value) { + var res = vow.defer(); + res.resolve(value); + return res.promise(); + }, + + /** + * Returns a promise that has already been fulfilled with the given `value`. + * If `value` is a promise, the returned promise will be fulfilled with the fulfill/rejection value of `value`. + * + * @param {*} value + * @returns {vow:Promise} + */ + fulfill : function(value) { + var defer = vow.defer(), + promise = defer.promise(); + + defer.resolve(value); + + return promise.isFulfilled()? + promise : + promise.then(null, function(reason) { + return reason; + }); + }, + + /** + * Returns a promise that has already been rejected with the given `reason`. + * If `reason` is a promise, the returned promise will be rejected with the fulfill/rejection value of `reason`. + * + * @param {*} reason + * @returns {vow:Promise} + */ + reject : function(reason) { + var defer = vow.defer(); + defer.reject(reason); + return defer.promise(); + }, + + /** + * Invokes the given function `fn` with arguments `args` + * + * @param {Function} fn + * @param {...*} [args] + * @returns {vow:Promise} + * + * @example + * ```js + * var promise1 = vow.invoke(function(value) { + * return value; + * }, 'ok'), + * promise2 = vow.invoke(function() { + * throw Error(); + * }); + * + * promise1.isFulfilled(); // true + * promise1.valueOf(); // 'ok' + * promise2.isRejected(); // true + * promise2.valueOf(); // instance of Error + * ``` + */ + invoke : function(fn, args) { + var len = Math.max(arguments.length - 1, 0), + callArgs; + if(len) { // optimization for V8 + callArgs = Array(len); + var i = 0; + while(i < len) { + callArgs[i++] = arguments[i]; + } + } + + try { + return vow.resolve(callArgs? + fn.apply(global, callArgs) : + fn.call(global)); + } + catch(e) { + return vow.reject(e); + } + }, + + /** + * Returns a promise, that will be fulfilled only after all the items in `iterable` are fulfilled. + * If any of the `iterable` items gets rejected, the promise will be rejected. + * + * @param {Array|Object} iterable + * @returns {vow:Promise} + * + * @example + * with array: + * ```js + * var defer1 = vow.defer(), + * defer2 = vow.defer(); + * + * vow.all([defer1.promise(), defer2.promise(), 3]) + * .then(function(value) { + * // value is "[1, 2, 3]" here + * }); + * + * defer1.resolve(1); + * defer2.resolve(2); + * ``` + * + * @example + * with object: + * ```js + * var defer1 = vow.defer(), + * defer2 = vow.defer(); + * + * vow.all({ p1 : defer1.promise(), p2 : defer2.promise(), p3 : 3 }) + * .then(function(value) { + * // value is "{ p1 : 1, p2 : 2, p3 : 3 }" here + * }); + * + * defer1.resolve(1); + * defer2.resolve(2); + * ``` + */ + all : function(iterable) { + var defer = new Deferred(), + isPromisesArray = isArray(iterable), + keys = isPromisesArray? + getArrayKeys(iterable) : + getObjectKeys(iterable), + len = keys.length, + res = isPromisesArray? [] : {}; + + if(!len) { + defer.resolve(res); + return defer.promise(); + } + + var i = len; + vow._forEach( + iterable, + function(value, idx) { + res[keys[idx]] = value; + if(!--i) { + defer.resolve(res); + } + }, + defer.reject, + defer.notify, + defer, + keys); + + return defer.promise(); + }, + + /** + * Returns a promise, that will be fulfilled only after all the items in `iterable` are resolved. + * + * @param {Array|Object} iterable + * @returns {vow:Promise} + * + * @example + * ```js + * var defer1 = vow.defer(), + * defer2 = vow.defer(); + * + * vow.allResolved([defer1.promise(), defer2.promise()]).spread(function(promise1, promise2) { + * promise1.isRejected(); // returns true + * promise1.valueOf(); // returns "'error'" + * promise2.isFulfilled(); // returns true + * promise2.valueOf(); // returns "'ok'" + * }); + * + * defer1.reject('error'); + * defer2.resolve('ok'); + * ``` + */ + allResolved : function(iterable) { + var defer = new Deferred(), + isPromisesArray = isArray(iterable), + keys = isPromisesArray? + getArrayKeys(iterable) : + getObjectKeys(iterable), + i = keys.length, + res = isPromisesArray? [] : {}; + + if(!i) { + defer.resolve(res); + return defer.promise(); + } + + var onResolved = function() { + --i || defer.resolve(iterable); + }; + + vow._forEach( + iterable, + onResolved, + onResolved, + defer.notify, + defer, + keys); + + return defer.promise(); + }, + + allPatiently : function(iterable) { + return vow.allResolved(iterable).then(function() { + var isPromisesArray = isArray(iterable), + keys = isPromisesArray? + getArrayKeys(iterable) : + getObjectKeys(iterable), + rejectedPromises, fulfilledPromises, + len = keys.length, i = 0, key, promise; + + if(!len) { + return isPromisesArray? [] : {}; + } + + while(i < len) { + key = keys[i++]; + promise = iterable[key]; + if(vow.isRejected(promise)) { + rejectedPromises || (rejectedPromises = isPromisesArray? [] : {}); + isPromisesArray? + rejectedPromises.push(promise.valueOf()) : + rejectedPromises[key] = promise.valueOf(); + } + else if(!rejectedPromises) { + (fulfilledPromises || (fulfilledPromises = isPromisesArray? [] : {}))[key] = vow.valueOf(promise); + } + } + + if(rejectedPromises) { + throw rejectedPromises; + } + + return fulfilledPromises; + }); + }, + + /** + * Returns a promise, that will be fulfilled if any of the items in `iterable` is fulfilled. + * If all of the `iterable` items get rejected, the promise will be rejected (with the reason of the first rejected item). + * + * @param {Array} iterable + * @returns {vow:Promise} + */ + any : function(iterable) { + var defer = new Deferred(), + len = iterable.length; + + if(!len) { + defer.reject(Error()); + return defer.promise(); + } + + var i = 0, reason; + vow._forEach( + iterable, + defer.resolve, + function(e) { + i || (reason = e); + ++i === len && defer.reject(reason); + }, + defer.notify, + defer); + + return defer.promise(); + }, + + /** + * Returns a promise, that will be fulfilled only when any of the items in `iterable` is fulfilled. + * If any of the `iterable` items gets rejected, the promise will be rejected. + * + * @param {Array} iterable + * @returns {vow:Promise} + */ + anyResolved : function(iterable) { + var defer = new Deferred(), + len = iterable.length; + + if(!len) { + defer.reject(Error()); + return defer.promise(); + } + + vow._forEach( + iterable, + defer.resolve, + defer.reject, + defer.notify, + defer); + + return defer.promise(); + }, + + /** + * Static equivalent to `promise.delay`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @param {Number} delay + * @returns {vow:Promise} + */ + delay : function(value, delay) { + return vow.resolve(value).delay(delay); + }, + + /** + * Static equivalent to `promise.timeout`. + * If `value` is not a promise, then `value` is treated as a fulfilled promise. + * + * @param {*} value + * @param {Number} timeout + * @returns {vow:Promise} + */ + timeout : function(value, timeout) { + return vow.resolve(value).timeout(timeout); + }, + + _forEach : function(promises, onFulfilled, onRejected, onProgress, ctx, keys) { + var len = keys? keys.length : promises.length, + i = 0; + + while(i < len) { + vow.when( + promises[keys? keys[i] : i], + wrapOnFulfilled(onFulfilled, i), + onRejected, + onProgress, + ctx); + ++i; + } + }, + + TimedOutError : defineCustomErrorType('TimedOut') +}; + +var defineAsGlobal = true; +if(typeof module === 'object' && typeof module.exports === 'object') { + module.exports = vow; + defineAsGlobal = false; +} + +if(typeof modules === 'object' && isFunction(modules.define)) { + modules.define('vow', function(provide) { + provide(vow); + }); + defineAsGlobal = false; +} + +if(typeof define === 'function') { + define(function(require, exports, module) { + module.exports = vow; + }); + defineAsGlobal = false; +} + +defineAsGlobal && (global.vow = vow); + +})(typeof window !== 'undefined'? window : global); diff --git a/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/package.json b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/package.json new file mode 100644 index 0000000..c65f5ce --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "vow@^0.4.7", + "scope": null, + "escapedName": "vow", + "name": "vow", + "rawSpec": "^0.4.7", + "spec": ">=0.4.7 <0.5.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/vow-fs" + ] + ], + "_from": "vow@>=0.4.7 <0.5.0", + "_id": "vow@0.4.16", + "_inCache": true, + "_installable": true, + "_location": "/vow-fs/vow", + "_nodeVersion": "6.10.1", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/vow-0.4.16.tgz_1495089840586_0.2674150194507092" + }, + "_npmUser": { + "name": "dfilatov", + "email": "dfilatov@yandex-team.ru" + }, + "_npmVersion": "3.10.10", + "_phantomChildren": {}, + "_requested": { + "raw": "vow@^0.4.7", + "scope": null, + "escapedName": "vow", + "name": "vow", + "rawSpec": "^0.4.7", + "spec": ">=0.4.7 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/vow-fs" + ], + "_resolved": "https://registry.npmjs.org/vow/-/vow-0.4.16.tgz", + "_shasum": "bb9d54d938d5f80520d658a740e7a895e30feeeb", + "_shrinkwrap": null, + "_spec": "vow@^0.4.7", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/vow-fs", + "author": { + "name": "Dmitry Filatov", + "email": "dfilatov@yandex-team.ru" + }, + "bugs": { + "url": "https://github.com/dfilatov/vow/issues" + }, + "contributors": [ + { + "name": "Dmitry Filatov", + "email": "dfilatov@yandex-team.ru" + } + ], + "dependencies": {}, + "description": "DOM Promise and Promises/A+ implementation for Node.js and browsers", + "devDependencies": { + "bem-jsd": "1.3.1", + "highlight.js": "7.5.0", + "istanbul": "", + "jspath": "0.2.11", + "marked": "0.2.10", + "nodeunit": "", + "promises-aplus-tests": "2.1.0", + "uglify-js": "1.3.4", + "yate": "0.0.65" + }, + "directories": {}, + "dist": { + "shasum": "bb9d54d938d5f80520d658a740e7a895e30feeeb", + "tarball": "https://registry.npmjs.org/vow/-/vow-0.4.16.tgz" + }, + "enb": { + "sources": [ + "lib/vow.js" + ] + }, + "engines": { + "node": ">= 0.4.0" + }, + "gitHead": "9328511db7bc7d56408ef61198df6ba1e0834038", + "homepage": "http://dfilatov.github.io/vow/", + "keywords": [ + "nodejs", + "browser", + "async", + "promise", + "dom", + "a+" + ], + "license": "MIT", + "main": "lib/vow", + "maintainers": [ + { + "name": "dfilatov", + "email": "dfilatov@yandex-team.ru" + } + ], + "name": "vow", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/dfilatov/vow.git" + }, + "scripts": { + "test": "./node_modules/istanbul/lib/cli.js test test/utils/runner.js" + }, + "version": "0.4.16" +} diff --git a/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/vow.min.js b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/vow.min.js new file mode 100644 index 0000000..ca5bce1 --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-fs/node_modules/vow/vow.min.js @@ -0,0 +1,9 @@ +/** + * @module vow + * @author Filatov Dmitry + * @version 0.4.16 + * @license + * Dual licensed under the MIT and GPL licenses: + * * http://www.opensource.org/licenses/mit-license.php + * * http://www.gnu.org/licenses/gpl.html + */(function(e){var t,n=function(){var t=[],n=function(e){return t.push(e),t.length===1},r=function(){var e=t,n=0,r=t.length;t=[];while(n1?function(e){n.isResolved()||n._reject(e)}:t,r>2?function(e){n.isResolved()||n._notify(e)}:t)}catch(i){this._reject(i)}}};v.prototype={valueOf:function(){return this._value},isResolved:function(){return this._status!==d.PENDING},isFulfilled:function(){return this._status===d.FULFILLED},isRejected:function(){return this._status===d.REJECTED},then:function(e,t,n,r){this._shouldEmitUnhandledRejection=!1;var i=new p;return this._addCallbacks(i,e,t,n,r),i.promise()},"catch":function(e,n){return this.then(t,e,n)},fail:function(e,n){return this.then(t,e,n)},always:function(e,t){var n=this,r=function(){return e.call(this,n)};return this.then(r,r,t)},progress:function(e,n){return this.then(t,t,e,n)},spread:function(e,t,n){return this.then(function(t){return e.apply(this,t)},t,n)},done:function(e,t,n,i){this.then(e,t,n,i).fail(r)},delay:function(e){var t,n=this.then(function(n){var r=new p;return t=setTimeout(function(){r.resolve(n)},e),r.promise()});return n.always(function(){clearTimeout(t)}),n},timeout:function(e){var t=new p,n=setTimeout(function(){t.reject(new y.TimedOutError("timed out"))},e);return this.then(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise().always(function(){clearTimeout(n)}),t.promise()},_vow:!0,_resolve:function(e){if(this._status>d.RESOLVED)return;if(e===this){this._reject(TypeError("Can't resolve promise with itself"));return}this._status=d.RESOLVED;if(e&&!!e._vow){e.isFulfilled()?this._fulfill(e.valueOf()):e.isRejected()?(e._shouldEmitUnhandledRejection=!1,this._reject(e.valueOf())):e.then(this._fulfill,this._reject,this._notify,this);return}if(s(e)||i(e)){var t;try{t=e.then}catch(n){this._reject(n);return}if(i(t)){var r=this,o=!1;try{t.call(e,function(e){if(o)return;o=!0,r._resolve(e)},function(e){if(o)return;o=!0,r._reject(e)},function(e){r._notify(e)})}catch(n){o||this._reject(n)}return}}this._fulfill(e)},_fulfill:function(e){if(this._status>d.RESOLVED)return;this._status=d.FULFILLED,this._value=e,this._callCallbacks(this._fulfilledCallbacks,e),this._fulfilledCallbacks=this._rejectedCallbacks=this._progressCallbacks=t},_reject:function(e){if(this._status>d.RESOLVED)return;this._status=d.REJECTED,this._value=e,this._callCallbacks(this._rejectedCallbacks,e);if(!this._rejectedCallbacks.length){var r=this;n(function(){r._shouldEmitUnhandledRejection&&h(e,r)})}this._fulfilledCallbacks=this._rejectedCallbacks=this._progressCallbacks=t},_notify:function(e){this._callCallbacks(this._progressCallbacks,e)},_addCallbacks:function(e,n,r,s,o){r&&!i(r)?(o=r,r=t):s&&!i(s)&&(o=s,s=t),r&&(this._shouldEmitUnhandledRejection=!1);var u;this.isRejected()||(u={defer:e,fn:i(n)?n:t,ctx:o},this.isFulfilled()?this._callCallbacks([u],this._value):this._fulfilledCallbacks.push(u)),this.isFulfilled()||(u={defer:e,fn:r,ctx:o},this.isRejected()?this._callCallbacks([u],this._value):this._rejectedCallbacks.push(u)),this._status<=d.RESOLVED&&this._progressCallbacks.push({defer:e,fn:s,ctx:o})},_callCallbacks:function(e,t){var r=e.length;if(!r)return;var i=this.isResolved(),s=this.isFulfilled(),o=this.isRejected();n(function(){var n=0,u,a,f;while(n= 0.6.0" + }, + "files": [ + "lib" + ], + "gitHead": "88d6f49aac47b35b242c56730ac8f53c8fa1c2f3", + "homepage": "https://github.com/dfilatov/vow-fs", + "keywords": [ + "vow", + "promise", + "file system" + ], + "license": "MIT", + "main": "lib/fs", + "maintainers": [ + { + "name": "dfilatov", + "email": "dfilatov@yandex-team.ru" + } + ], + "name": "vow-fs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/dfilatov/vow-fs.git" + }, + "scripts": { + "test": "istanbul test test/runner.js" + }, + "version": "0.3.6" +} diff --git a/node_modules/csscomb/node_modules/vow-queue/.jscs.json b/node_modules/csscomb/node_modules/vow-queue/.jscs.json new file mode 100644 index 0000000..3bcb82e --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-queue/.jscs.json @@ -0,0 +1,20 @@ +{ + "requireMultipleVarDecl": true, + "requireCurlyBraces": ["if", "else", "for", "while", "do"], + "disallowLeftStickedOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "requireRightStickedOperators": ["!"], + "requireLeftStickedOperators": [","], + "disallowKeywords": ["with"], + "disallowMultipleLineBreaks": true, + "requireAlignedObjectValues": "skipWithLineBreak", + "validateJSDoc": { + "checkParamNames": true, + "requireParamTypes": true + }, + "excludeFiles": [ + "node_modules", + "lib-cov", + "html-report" + ] +} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jshintignore b/node_modules/csscomb/node_modules/vow-queue/.jshintignore similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jshintignore rename to node_modules/csscomb/node_modules/vow-queue/.jshintignore diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jshintrc b/node_modules/csscomb/node_modules/vow-queue/.jshintrc similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.jshintrc rename to node_modules/csscomb/node_modules/vow-queue/.jshintrc diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.npmignore b/node_modules/csscomb/node_modules/vow-queue/.npmignore similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/.npmignore rename to node_modules/csscomb/node_modules/vow-queue/.npmignore diff --git a/node_modules/csscomb/node_modules/vow-queue/.travis.yml b/node_modules/csscomb/node_modules/vow-queue/.travis.yml new file mode 100644 index 0000000..55837a1 --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-queue/.travis.yml @@ -0,0 +1,4 @@ +language: node_js + +node_js: + - "0.10" diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/CHANGELOG.md b/node_modules/csscomb/node_modules/vow-queue/CHANGELOG.md similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/CHANGELOG.md rename to node_modules/csscomb/node_modules/vow-queue/CHANGELOG.md diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/CONTRIBUTION.md b/node_modules/csscomb/node_modules/vow-queue/CONTRIBUTION.md similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/CONTRIBUTION.md rename to node_modules/csscomb/node_modules/vow-queue/CONTRIBUTION.md diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/LICENSE b/node_modules/csscomb/node_modules/vow-queue/LICENSE similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/LICENSE rename to node_modules/csscomb/node_modules/vow-queue/LICENSE diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/Makefile b/node_modules/csscomb/node_modules/vow-queue/Makefile similarity index 100% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/Makefile rename to node_modules/csscomb/node_modules/vow-queue/Makefile diff --git a/node_modules/csscomb/node_modules/vow-queue/README.md b/node_modules/csscomb/node_modules/vow-queue/README.md new file mode 100644 index 0000000..aed1b30 --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-queue/README.md @@ -0,0 +1,80 @@ +vow-queue [![NPM version](https://badge.fury.io/js/vow-queue.png)](http://badge.fury.io/js/vow-queue) [![Build Status](https://secure.travis-ci.org/dfilatov/vow-queue.png)](http://travis-ci.org/dfilatov/vow-queue) +=============== + +vow-queue is a module for task queue with weights and priorities + +Installation +------------ + +Module can be installed using `npm`: + +``` +npm install vow-queue +``` + +or `bower`: + +``` +bower install vow-queue +``` + +Usage +----- + +````javascript +var Queue = require('vow-queue'), + queue = new Queue({ weightLimit : 10 }); + +queue.enqueue(function() { // simple function + return 2 * 2; +}); + +queue.enqueue(function() { // function returns a promise + // do job + return promise; +}); + +queue.enqueue( // task with custom priority and weight + function() { + // do job + }, + { + priority : 3, // this task will be started before the previous two + weight : 5 + }); + +queue.start(); // starts tasks processing + +queue.enqueue(function() { }); // and enqueue yet another task +```` + +API +----- +### Creating queue +####new Queue([params]) + * `params.weightLimit=100` limit of summary tasks weight which can be processed concurrently + +### Methods of queue +####Promise enqueue(taskFn, [taskParams]) +Enqueue given task in queue + * `taskFn` task function which can return either a promise or a value + * `taskParams.weight=1` weight of given task + * `taskParams.priority=1` priority of given task + +Returns promise which will be resolved when given task is done + +####void start() +Starts processing of tasks in queue + +####void stop() +Stops processing of tasks in queue + +####Boolean isStarted() +Returns whether processing is started + +####void setParams(params) +Sets queue params +* `params.weightLimit=100` limit of summary tasks weight which can be processed concurrently + +####Object getStats() +Returns statistics about queue diff --git a/node_modules/csscomb/node_modules/vow-queue/bower.json b/node_modules/csscomb/node_modules/vow-queue/bower.json new file mode 100644 index 0000000..69433f0 --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-queue/bower.json @@ -0,0 +1,6 @@ +{ + "name" : "vow-queue", + "version" : "0.4.1", + "main" : "lib/queue.js", + "ignore" : ["**/.*", "node_modules", "test", "utils", "Makefile", ".jshintrc", "package.json", "jscs.json"] +} diff --git a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/lib/queue.js b/node_modules/csscomb/node_modules/vow-queue/lib/queue.js similarity index 97% rename from node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/lib/queue.js rename to node_modules/csscomb/node_modules/vow-queue/lib/queue.js index 8c9c562..a538168 100644 --- a/node_modules/csscomb/node_modules/csscomb-core/node_modules/vow-fs/node_modules/vow-queue/lib/queue.js +++ b/node_modules/csscomb/node_modules/vow-queue/lib/queue.js @@ -1,7 +1,7 @@ /** * @module vow-queue * @author Filatov Dmitry - * @version 0.3.1 + * @version 0.4.1 * @license * Dual licensed under the MIT and GPL licenses: * * http://www.opensource.org/licenses/mit-license.php @@ -135,7 +135,7 @@ Queue.prototype = /** @lends Queue.prototype */ { * @param {Object} params * @param {Number} [params.weightLimit] */ - params : function(params) { + setParams : function(params) { if(typeof params.weightLimit !== 'undefined') { this._params.weightLimit = params.weightLimit; this._scheduleRun(); @@ -170,7 +170,7 @@ Queue.prototype = /** @lends Queue.prototype */ { i--; } - pendingTasks.push(task); + pendingTasks.unshift(task); }, _scheduleRun : function() { @@ -242,7 +242,8 @@ if(typeof modules !== 'undefined') { provide(getModule(vow, nextTick)); }); } -else if(typeof exports === 'object') { + +if(typeof module === 'object' && typeof module.exports === 'object') { module.exports = getModule(require('vow'), nextTick); } diff --git a/node_modules/csscomb/node_modules/vow-queue/package.json b/node_modules/csscomb/node_modules/vow-queue/package.json new file mode 100644 index 0000000..b899c8e --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-queue/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "vow-queue@^0.4.1", + "scope": null, + "escapedName": "vow-queue", + "name": "vow-queue", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/vow-fs" + ] + ], + "_from": "vow-queue@>=0.4.1 <0.5.0", + "_id": "vow-queue@0.4.2", + "_inCache": true, + "_installable": true, + "_location": "/vow-queue", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "dfilatov", + "email": "dfilatov@yandex-team.ru" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "raw": "vow-queue@^0.4.1", + "scope": null, + "escapedName": "vow-queue", + "name": "vow-queue", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/vow-fs" + ], + "_resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.4.2.tgz", + "_shasum": "e7fe17160e15c7c4184d1b666a9bc64e18e30184", + "_shrinkwrap": null, + "_spec": "vow-queue@^0.4.1", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/vow-fs", + "author": { + "name": "Dmitry Filatov", + "email": "dfilatov@yandex-team.ru" + }, + "bugs": { + "url": "https://github.com/dfilatov/vow-queue/issues" + }, + "contributors": [ + { + "name": "Dmitry Filatov", + "email": "dfilatov@yandex-team.ru" + } + ], + "dependencies": { + "vow": "~0.4.0" + }, + "description": "Vow-based task queue", + "devDependencies": { + "chai": "*", + "istanbul": "0.1.39", + "jscs": "1.0.0", + "jshint": "2.1.3", + "mocha": "1.11.0", + "mocha-istanbul": "*" + }, + "directories": {}, + "dist": { + "shasum": "e7fe17160e15c7c4184d1b666a9bc64e18e30184", + "tarball": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.4.2.tgz" + }, + "engines": { + "node": ">= 0.8.0" + }, + "gitHead": "a64739cf166a4f4077685091adb83eaba745c4b2", + "homepage": "https://github.com/dfilatov/vow-queue", + "main": "lib/queue", + "maintainers": [ + { + "name": "dfilatov", + "email": "dfilatov@yandex-team.ru" + } + ], + "name": "vow-queue", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/dfilatov/vow-queue.git" + }, + "scripts": { + "clean": "make clean", + "coverage": "make coverage", + "lint": "make lint", + "test": "make validate" + }, + "version": "0.4.2" +} diff --git a/node_modules/csscomb/node_modules/vow-queue/test.js b/node_modules/csscomb/node_modules/vow-queue/test.js new file mode 100644 index 0000000..a4f6a5a --- /dev/null +++ b/node_modules/csscomb/node_modules/vow-queue/test.js @@ -0,0 +1,34 @@ +var Queue = require('./lib/queue'), + vow = require('vow'), + + queue = new Queue({ weightLimit : 2 }), + d1 = vow.defer(), + d2 = vow.defer(), + d3 = vow.defer(), + callCount = 0, + p1task = queue.enqueue(function() { + callCount++; + return d1.promise(); + }); + +queue.enqueue(function() { + callCount++; + return d2.promise(); +}); + +queue.enqueue(function() { + callCount++; + return d3.promise(); +}); + +queue.enqueue(function() { + callCount++; + return d3.promise(); +}); + +d1.resolve(); +p1task.then(function() { + console.log(callCount); +}); + +queue.start(); diff --git a/node_modules/csscomb/node_modules/vow/package.json b/node_modules/csscomb/node_modules/vow/package.json index 58f1c76..ab2186b 100644 --- a/node_modules/csscomb/node_modules/vow/package.json +++ b/node_modules/csscomb/node_modules/vow/package.json @@ -1,76 +1,111 @@ { - "name": "vow", - "version": "0.4.4", - "description": "DOM Promise and Promises/A+ implementation for Node.js and browsers", - "homepage": "https://github.com/dfilatov/vow", - "keywords": [ - "nodejs", - "browser", - "async", - "promise", - "dom", - "a+" + "_args": [ + [ + { + "raw": "vow@0.4.4", + "scope": null, + "escapedName": "vow", + "name": "vow", + "rawSpec": "0.4.4", + "spec": "0.4.4", + "type": "version" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb" + ] ], + "_from": "vow@0.4.4", + "_id": "vow@0.4.4", + "_inCache": true, + "_installable": true, + "_location": "/vow", + "_npmUser": { + "name": "dfilatov", + "email": "dfilatov@yandex-team.ru" + }, + "_npmVersion": "1.3.21", + "_phantomChildren": {}, + "_requested": { + "raw": "vow@0.4.4", + "scope": null, + "escapedName": "vow", + "name": "vow", + "rawSpec": "0.4.4", + "spec": "0.4.4", + "type": "version" + }, + "_requiredBy": [ + "/", + "/vow-queue" + ], + "_resolved": "https://registry.npmjs.org/vow/-/vow-0.4.4.tgz", + "_shasum": "c9fe4609129d7f5aa621508ebe64b51c95bc7b98", + "_shrinkwrap": null, + "_spec": "vow@0.4.4", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb", "author": { "name": "Dmitry Filatov", "email": "dfilatov@yandex-team.ru" }, + "bugs": { + "url": "https://github.com/dfilatov/vow/issues" + }, "contributors": [ { "name": "Dmitry Filatov", "email": "dfilatov@yandex-team.ru" } ], - "repository": { - "type": "git", - "url": "http://github.com/dfilatov/vow.git" - }, "dependencies": {}, + "description": "DOM Promise and Promises/A+ implementation for Node.js and browsers", "devDependencies": { - "nodeunit": "", + "bem-jsd": "1.3.1", + "highlight.js": "7.5.0", "istanbul": "", - "uglify-js": "1.3.4", - "promises-aplus-tests": "2.0.3", - "marked": "0.2.10", "jspath": "0.2.11", - "yate": "0.0.65", - "highlight.js": "7.5.0", - "bem-jsd": "1.3.1" - }, - "main": "lib/vow", - "engines": { - "node": ">= 0.4.0" + "marked": "0.2.10", + "nodeunit": "", + "promises-aplus-tests": "2.0.3", + "uglify-js": "1.3.4", + "yate": "0.0.65" }, - "scripts": { - "test": "./node_modules/istanbul/lib/cli.js test test/utils/runner.js" + "directories": {}, + "dist": { + "shasum": "c9fe4609129d7f5aa621508ebe64b51c95bc7b98", + "tarball": "https://registry.npmjs.org/vow/-/vow-0.4.4.tgz" }, "enb": { "sources": [ "lib/vow.js" ] }, - "bugs": { - "url": "https://github.com/dfilatov/vow/issues" - }, - "_id": "vow@0.4.4", - "dist": { - "shasum": "c9fe4609129d7f5aa621508ebe64b51c95bc7b98", - "tarball": "http://registry.npmjs.org/vow/-/vow-0.4.4.tgz" - }, - "_from": "vow@0.4.4", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "dfilatov", - "email": "dfilatov@yandex-team.ru" + "engines": { + "node": ">= 0.4.0" }, + "homepage": "https://github.com/dfilatov/vow", + "keywords": [ + "nodejs", + "browser", + "async", + "promise", + "dom", + "a+" + ], + "main": "lib/vow", "maintainers": [ { "name": "dfilatov", "email": "dfilatov@yandex-team.ru" } ], - "directories": {}, - "_shasum": "c9fe4609129d7f5aa621508ebe64b51c95bc7b98", - "_resolved": "https://registry.npmjs.org/vow/-/vow-0.4.4.tgz", - "readme": "ERROR: No README data found!" + "name": "vow", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/dfilatov/vow.git" + }, + "scripts": { + "test": "./node_modules/istanbul/lib/cli.js test test/utils/runner.js" + }, + "version": "0.4.4" } diff --git a/node_modules/csscomb/node_modules/wrappy/LICENSE b/node_modules/csscomb/node_modules/wrappy/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/csscomb/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/csscomb/node_modules/wrappy/README.md b/node_modules/csscomb/node_modules/wrappy/README.md new file mode 100644 index 0000000..98eab25 --- /dev/null +++ b/node_modules/csscomb/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/node_modules/csscomb/node_modules/wrappy/package.json b/node_modules/csscomb/node_modules/wrappy/package.json new file mode 100644 index 0000000..b10cf6e --- /dev/null +++ b/node_modules/csscomb/node_modules/wrappy/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + { + "raw": "wrappy@1", + "scope": null, + "escapedName": "wrappy", + "name": "wrappy", + "rawSpec": "1", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/inflight" + ] + ], + "_from": "wrappy@>=1.0.0 <2.0.0", + "_id": "wrappy@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/wrappy", + "_nodeVersion": "5.10.1", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/wrappy-1.0.2.tgz_1463527848281_0.037129373755306005" + }, + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "_npmVersion": "3.9.1", + "_phantomChildren": {}, + "_requested": { + "raw": "wrappy@1", + "scope": null, + "escapedName": "wrappy", + "name": "wrappy", + "rawSpec": "1", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/inflight", + "/once" + ], + "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", + "_shrinkwrap": null, + "_spec": "wrappy@1", + "_where": "/Users/loring-hover/sublime-csscomb/node_modules/csscomb/node_modules/inflight", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "dependencies": {}, + "description": "Callback wrapping utility", + "devDependencies": { + "tap": "^2.3.1" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", + "tarball": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + }, + "files": [ + "wrappy.js" + ], + "gitHead": "71d91b6dc5bdeac37e218c2cf03f9ab55b60d214", + "homepage": "https://github.com/npm/wrappy", + "license": "ISC", + "main": "wrappy.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "name": "wrappy", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/wrappy.git" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "version": "1.0.2" +} diff --git a/node_modules/csscomb/node_modules/wrappy/wrappy.js b/node_modules/csscomb/node_modules/wrappy/wrappy.js new file mode 100644 index 0000000..bb7e7d6 --- /dev/null +++ b/node_modules/csscomb/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/node_modules/csscomb/package.json b/node_modules/csscomb/package.json index 9983399..1a81b70 100644 --- a/node_modules/csscomb/package.json +++ b/node_modules/csscomb/package.json @@ -1,81 +1,116 @@ { - "name": "csscomb", - "description": "CSS coding style formatter", - "version": "3.0.0", - "homepage": "http://csscomb.com/", + "_args": [ + [ + { + "raw": "csscomb@4.2.0", + "scope": null, + "escapedName": "csscomb", + "name": "csscomb", + "rawSpec": "4.2.0", + "spec": "4.2.0", + "type": "version" + }, + "/Users/loring-hover/sublime-csscomb" + ] + ], + "_from": "csscomb@4.2.0", + "_id": "csscomb@4.2.0", + "_inCache": true, + "_installable": true, + "_location": "/csscomb", + "_nodeVersion": "7.10.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/csscomb-4.2.0.tgz_1497301225519_0.9311209069564939" + }, + "_npmUser": { + "name": "tonyganch", + "email": "tonyganch+github@gmail.com" + }, + "_npmVersion": "5.0.3", + "_phantomChildren": {}, + "_requested": { + "raw": "csscomb@4.2.0", + "scope": null, + "escapedName": "csscomb", + "name": "csscomb", + "rawSpec": "4.2.0", + "spec": "4.2.0", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/csscomb/-/csscomb-4.2.0.tgz", + "_shasum": "5f948bc94afa61c033c3984e4192f0e6fef67fdb", + "_shrinkwrap": null, + "_spec": "csscomb@4.2.0", + "_where": "/Users/loring-hover/sublime-csscomb", "author": { "name": "Mikhail Troshev", "email": "mishanga@yandex-team.ru" }, - "repository": { - "type": "git", - "url": "https://github.com/csscomb/csscomb.js" + "bin": { + "csscomb": "./bin/csscomb" }, - "maintainers": [ - { - "name": "Mikhail Troshev", - "email": "mishanga@yandex-team.ru", - "url": "http://mishanga.pro/" - }, - { - "name": "Tony Ganch", - "email": "tonyganch+github@gmail.com", - "url": "http://tonyganch.com/" - }, - { - "name": "Slava Oliyanchuk", - "email": "miripiruni@gmail.com", - "url": "http://miripiruni.org/" - } - ], - "contributors": [ - { - "name": "Sergey Puzankov", - "email": "puzankov@yandex-team.ru" - }, - { - "name": "Denis Payase", - "email": "lostsoul@yandex-team.ru" - }, - { - "name": "Igor Novak", - "email": "bezengi@gmail.com" - }, - { - "name": "Roman Komarov", - "email": "kizmarh@ya.ru" - } - ], - "engines": { - "node": ">= 0.10.0" + "bugs": { + "url": "https://github.com/csscomb/csscomb.js/issues" }, "dependencies": { - "commander": "2.0.0", - "csscomb-core": "~2.0.0", - "gonzales-pe": "~3.0.0", - "vow": "0.4.4" + "babel-polyfill": "6.23.0", + "glob": "latest", + "gonzales-pe": "^3.4.7", + "minimatch": "3.0.2", + "minimist": "1.1.x", + "vow": "0.4.4", + "vow-fs": "0.3.6" }, + "description": "CSS coding style formatter", "devDependencies": { - "jshint-groups": "0.5.3", - "jshint": "2.3.0", - "jscs": "1.4.5", - "mocha": "1.14.0" + "babel-cli": "^6.11.4", + "babel-plugin-transform-es2015-destructuring": "^6.9.0", + "babel-plugin-transform-strict-mode": "^6.11.3", + "jscs": "2.1.0", + "jshint": "2.8.0", + "mocha": "1.20.1" + }, + "directories": {}, + "dist": { + "integrity": "sha512-HXXCSVTpHck64PUMIn/2I8auBGmIpx+cD/Hs+KnYH+p9iaMTN0cd38l22qYVp8vEp6v9w+Bbi0SD8iN8fgrINg==", + "shasum": "5f948bc94afa61c033c3984e4192f0e6fef67fdb", + "tarball": "https://registry.npmjs.org/csscomb/-/csscomb-4.2.0.tgz" }, + "engines": { + "node": ">= 0.10.0" + }, + "files": [ + "bin", + "config", + "lib" + ], + "gitHead": "82c54ed744e9596ef04fcedda6b2d215eb578449", + "homepage": "http://csscomb.com/", + "license": "MIT", "main": "./lib/csscomb.js", - "bin": { - "csscomb": "./bin/csscomb" + "maintainers": [ + { + "name": "tonyganch", + "email": "tonyganch+github@gmail.com" + } + ], + "name": "csscomb", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/csscomb/csscomb.js.git" }, "scripts": { - "test": "jshint-groups && ./node_modules/.bin/jscs . && node test/mocha", - "test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true node test/mocha > ./test/test-coverage.html" - }, - "readme": "# CSScomb [![CSSComb](logo.png)](http://csscomb.com/)\n[![Build Status](https://travis-ci.org/csscomb/csscomb.js.svg?branch=master)](http://travis-ci.org/csscomb/csscomb.js)\n[![NPM version](https://badge.fury.io/js/csscomb.svg)](http://badge.fury.io/js/csscomb)\n[![Dependency Status](https://david-dm.org/csscomb/csscomb.js.svg)](https://david-dm.org/csscomb/csscomb.js)\n[![devDependency Status](https://david-dm.org/csscomb/csscomb.js/dev-status.svg)](https://david-dm.org/csscomb/csscomb.js#info=devDependencies)\n\nCSScomb is a coding style formatter for CSS.\nYou can easily write your own [configuration](doc/configuration.md) to make\nyour style sheets beautiful and consistent.\n\nThe main feature is [sorting properties](doc/options.md#sort-order) in a specific order.\nIt was inspired by [@miripiruni](https://github.com/miripiruni)'s\n[PHP-based tool](https://github.com/csscomb/csscomb) of the same name.\nThis is the new JavaScript version, based on the powerful CSS parser\n[Gonzales PE](https://github.com/tonyganch/gonzales-pe).\n\n## 1. Install\n\nGlobal installation (for use as a command-line tool):\n\n```bash\nnpm install csscomb -g\n```\n\nLocal installation (for use as a command-line tool within current directory):\n\n```bash\nnpm install csscomb\n```\n\nTo install as a project dependency (the package will appear in your dependencies):\n\n```bash\nnpm install csscomb --save\n```\n\nTo install as a dev dependency (the package will appear in your devDependencies):\n\n```bash\nnpm install csscomb --save-dev\n```\n\n## 2. [Configure](doc/configuration.md)\n\nThere are a number of ways to configure CSScomb:\n\n- Use one of [predefined configs](config)\n- Put `.csscomb.json` file in the project root.\n- Set path to config's file\n- Use `*.css` file as a template\n\n## 3. Use\n\n### [Command Line](doc/usage-cli.md)\n\n```bash\ncsscomb assets/css\n```\n\n### [Node.js module](doc/usage-node.md)\n\n```js\nvar Comb = require('csscomb');\nvar comb = new Comb('zen');\ncomb.processPath('assets/css');\n```\n\n## 4. Contribute\n\nAnyone and everyone is welcome to contribute.\nPlease take a moment to review the [guidelines for contributing](CONTRIBUTE.md).\n\n## Authors\n\n[@mishanga](https://github.com/mishanga),\n[@tonyganch](https://github.com/tonyganch)\n\nThanks for assistance and contributions:\n\n[@miripiruni](https://github.com/miripiruni),\n[@anton-rudeshko](https://github.com/anton-rudeshko),\n[@cvrebert](https://github.com/cvrebert),\n[@filtercake](https://github.com/filtercake),\n[@ignovak](https://github.com/ignovak),\n[@kizu](https://github.com/kizu),\n[@lefoy](https://github.com/lefoy),\n[@L0stSoul](https://github.com/L0stSoul),\n[@mishaberezin](https://github.com/mishaberezin),\n[@puzankov](https://github.com/puzankov),\n[@schneyra](https://github.com/schneyra),\n[@thejameskyle](https://github.com/thejameskyle),\n[@vecmezoni](https://github.com/vecmezoni)\n\n## License\n\nThis software is released under the terms of the\n[MIT license](https://github.com/csscomb/csscomb.js/blob/master/LICENSE).\n\n## Other projects\n* https://github.com/senchalabs/cssbeautify\n* https://github.com/css/gonzales\n* https://github.com/tonyganch/gonzales-pe\n* https://github.com/css/csso\n* https://github.com/nzakas/parser-lib\n", - "readmeFilename": "README.md", - "gitHead": "2875c43992c0100704b5b9ced52b1973eb253503", - "bugs": { - "url": "https://github.com/csscomb/csscomb.js/issues" + "build": "./scripts/build.sh", + "coverage": "./scripts/coverage.sh", + "prepublish": "./scripts/build.sh", + "test": "./scripts/build.sh && ./scripts/test.sh", + "watch": "./scripts/watch.sh" }, - "_id": "csscomb@3.0.0", - "_shasum": "6c156c622bcd6b48c3ba9cb7a529227704e0e55a", - "_from": "csscomb@3.0.0" + "version": "4.2.0" } diff --git a/node_modules/csscomb/test/core/configure.js b/node_modules/csscomb/test/core/configure.js deleted file mode 100644 index 77d9fe5..0000000 --- a/node_modules/csscomb/test/core/configure.js +++ /dev/null @@ -1,48 +0,0 @@ -var Comb = process.env.TEST_COV ? require('../../lib-cov/csscomb') : require('../../lib/csscomb'); -var assert = require('assert'); - -describe('csscomb methods', function() { - var comb; - var input; - var output; - var expected; - - it('Passing no config to constructor should not configure anything', function() { - comb = new Comb(); - assert.equal(undefined, comb._handlers); - }); - - it('Passing valid config name to constructor should configure using correct config', function() { - comb = new Comb('zen'); - input = 'a { color: tomato; top: 0; }'; - expected = 'a {top: 0; color: tomato; }'; - output = comb.processString(input); - - assert.equal(expected, output); - }); - - it('Passing config object to constructor should configure using that object', function() { - comb = new Comb({ 'always-semicolon': true }); - input = 'a { color: tomato }'; - expected = 'a { color: tomato; }'; - output = comb.processString(input); - - assert.equal(expected, output); - }); - - it('new Comb() should be chainable', function() { - input = 'a { color: tomato; top: 0; }'; - expected = 'a {top: 0; color: tomato; }'; - output = new Comb('zen').processString(input); - - assert.equal(expected, output); - }); - - it('configure() should be chainable', function() { - input = 'a { color: tomato }'; - expected = 'a { color: tomato; }'; - output = new Comb().configure({ 'always-semicolon': true }).processString(input); - - assert.equal(expected, output); - }); -}); diff --git a/node_modules/csscomb/test/core/get-config.js b/node_modules/csscomb/test/core/get-config.js deleted file mode 100644 index e562ea8..0000000 --- a/node_modules/csscomb/test/core/get-config.js +++ /dev/null @@ -1,51 +0,0 @@ -var assert = require('assert'); - -describe('csscomb methods', function() { - it('getConfig()', function() { - var config = require('../../config/csscomb.json'); - - assert.equal(this.Comb.getConfig(), config); - }); - - it('getConfig(number)', function() { - assert.throws(function() { - this.Comb.getConfig(16); - }); - }); - - it('getConfig(boolean)', function() { - assert.throws(function() { - this.Comb.getConfig(true); - }); - }); - - it('getConfig(empty string)', function() { - var config = require('../../config/csscomb.json'); - - assert.equal(this.Comb.getConfig(''), config); - }); - - it('getConfig(invalid string)', function() { - assert.throws(function() { - this.Comb.getConfig('nani'); - }); - }); - - it('getConfig(csscomb)', function() { - var config = require('../../config/csscomb.json'); - - assert.equal(this.Comb.getConfig('csscomb'), config); - }); - - it('getConfig(zen)', function() { - var config = require('../../config/zen.json'); - - assert.equal(this.Comb.getConfig('zen'), config); - }); - - it('getConfig(yandex)', function() { - var config = require('../../config/yandex.json'); - - assert.equal(this.Comb.getConfig('yandex'), config); - }); -}); diff --git a/node_modules/csscomb/test/core/less.js b/node_modules/csscomb/test/core/less.js deleted file mode 100644 index dc5fefe..0000000 --- a/node_modules/csscomb/test/core/less.js +++ /dev/null @@ -1,42 +0,0 @@ -describe('LESS', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({}); - }); - - it('Should parse nested rules', function() { - this.shouldBeEqual('nested-rule.less'); - }); - - it('Should parse operations', function() { - this.shouldBeEqual('operation.less'); - }); - - it('Should parse parent selector &', function() { - this.shouldBeEqual('parent-selector.less'); - }); - - it('Should parse variables', function() { - this.shouldBeEqual('variable.less'); - }); - - it('Should parse interpolated variables inside selectors', function() { - this.shouldBeEqual('interpolated-variable-1.less'); - }); - - it('Should parse interpolated variables inside values', function() { - this.shouldBeEqual('interpolated-variable-2.less'); - }); - - it('Should parse @import', function() { - this.shouldBeEqual('import.less'); - }); - - it('Should parse included mixins', function() { - this.shouldBeEqual('mixin.less'); - }); - - it('Should parse nested @media', function() { - this.shouldBeEqual('nested-media.less'); - }); -}); diff --git a/node_modules/csscomb/test/core/less/import.less b/node_modules/csscomb/test/core/less/import.less deleted file mode 100644 index 8faa126..0000000 --- a/node_modules/csscomb/test/core/less/import.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - @import "foo.css"; - top: 0; -} diff --git a/node_modules/csscomb/test/core/less/interpolated-variable-1.less b/node_modules/csscomb/test/core/less/interpolated-variable-1.less deleted file mode 100644 index b0bc314..0000000 --- a/node_modules/csscomb/test/core/less/interpolated-variable-1.less +++ /dev/null @@ -1,4 +0,0 @@ -div.@{nani} { - color:tomato; - top:0; -} diff --git a/node_modules/csscomb/test/core/less/interpolated-variable-2.less b/node_modules/csscomb/test/core/less/interpolated-variable-2.less deleted file mode 100644 index 18a66ed..0000000 --- a/node_modules/csscomb/test/core/less/interpolated-variable-2.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: @{tomato}; - top:0; -} diff --git a/node_modules/csscomb/test/core/less/mixin.less b/node_modules/csscomb/test/core/less/mixin.less deleted file mode 100644 index 7e95951..0000000 --- a/node_modules/csscomb/test/core/less/mixin.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - .mixin; - top: 0; -} diff --git a/node_modules/csscomb/test/core/less/nested-media.less b/node_modules/csscomb/test/core/less/nested-media.less deleted file mode 100644 index 346ddbf..0000000 --- a/node_modules/csscomb/test/core/less/nested-media.less +++ /dev/null @@ -1,6 +0,0 @@ -div { - @media screen and (orientation: landscape) { - color: tomato; - } - top: 0; -} diff --git a/node_modules/csscomb/test/core/less/nested-rule.less b/node_modules/csscomb/test/core/less/nested-rule.less deleted file mode 100644 index 5f74a2d..0000000 --- a/node_modules/csscomb/test/core/less/nested-rule.less +++ /dev/null @@ -1,6 +0,0 @@ -div { - color: tomato; - a { - top: 0; - } -} diff --git a/node_modules/csscomb/test/core/less/operation.less b/node_modules/csscomb/test/core/less/operation.less deleted file mode 100644 index a3711aa..0000000 --- a/node_modules/csscomb/test/core/less/operation.less +++ /dev/null @@ -1,8 +0,0 @@ -div { - @base: 5%; - @filler: @base * 2; - @other: @base + @filler; - color: #888 / 4; - background-color: @base-color + #111; - height: 100% / 2 + @filler; -} diff --git a/node_modules/csscomb/test/core/less/parent-selector.less b/node_modules/csscomb/test/core/less/parent-selector.less deleted file mode 100644 index 6176030..0000000 --- a/node_modules/csscomb/test/core/less/parent-selector.less +++ /dev/null @@ -1,8 +0,0 @@ -div { - color: tomato; - &.top { - color: nani; - top: 0; - } - left: 0; -} diff --git a/node_modules/csscomb/test/core/less/variable.less b/node_modules/csscomb/test/core/less/variable.less deleted file mode 100644 index 8eba0cc..0000000 --- a/node_modules/csscomb/test/core/less/variable.less +++ /dev/null @@ -1,5 +0,0 @@ -@red: tomato; -div { - color: @tomato; - top: @@foo; -} diff --git a/node_modules/csscomb/test/core/scss.js b/node_modules/csscomb/test/core/scss.js deleted file mode 100644 index 925a116..0000000 --- a/node_modules/csscomb/test/core/scss.js +++ /dev/null @@ -1,107 +0,0 @@ -describe('SCSS', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({}); - }); - - it('Should parse nested rules', function() { - this.shouldBeEqual('nested-rule.scss'); - }); - - it('Should parse parent selector &', function() { - this.shouldBeEqual('parent-selector.scss'); - }); - - it('Should parse nested properties', function() { - this.shouldBeEqual('nested-property.scss'); - }); - - it('Should parse variables', function() { - this.shouldBeEqual('variable.scss'); - }); - - it('Should parse interpolated variables inside selectors', function() { - this.shouldBeEqual('interpolated-variable-1.scss'); - }); - - it('Should parse interpolated variables inside values', function() { - this.shouldBeEqual('interpolated-variable-2.scss'); - }); - - it('Should parse defaults', function() { - this.shouldBeEqual('default.scss'); - }); - - it('Should parse @import', function() { - this.shouldBeEqual('import.scss'); - }); - - it('Should parse @include', function() { - this.shouldBeEqual('include.scss'); - }); - - it('Should parse nested @media', function() { - this.shouldBeEqual('nested-media.scss'); - }); - - it('Should parse @extend with classes', function() { - this.shouldBeEqual('extend-1.scss'); - }); - - it('Should parse @extend with placeholders', function() { - this.shouldBeEqual('extend-2.scss'); - }); - - it('Should parse @warn', function() { - this.shouldBeEqual('warn.scss'); - }); - - it('Should parse @if', function() { - this.shouldBeEqual('if.scss'); - }); - - it('Should parse @if and @else', function() { - this.shouldBeEqual('if-else.scss'); - }); - - it('Should parse @if and @else if', function() { - this.shouldBeEqual('if-else-if.scss'); - }); - - it('Should parse @for', function() { - this.shouldBeEqual('for.scss'); - }); - - it('Should parse @each', function() { - this.shouldBeEqual('each.scss'); - }); - - it('Should parse @while', function() { - this.shouldBeEqual('while.scss'); - }); - - it('Should parse mixins', function() { - this.shouldBeEqual('mixin-1.scss'); - }); - - it('Should parse passing several variables to a mixin', function() { - this.shouldBeEqual('mixin-2.scss'); - }); - - it('Should parse passing a list of variables to a mixin', function() { - this.shouldBeEqual('mixin-3.scss'); - }); - - it('Should parse passing a content block to a mixin', function() { - this.shouldBeEqual('mixin-4.scss'); - }); - - it('Should parse @content', function() { - this.shouldBeEqual('content.scss'); - }); - - it('Should parse functions', function() { - this.shouldBeEqual('function.scss'); - }); -}); - diff --git a/node_modules/csscomb/test/core/scss/content.scss b/node_modules/csscomb/test/core/scss/content.scss deleted file mode 100644 index 6852bcc..0000000 --- a/node_modules/csscomb/test/core/scss/content.scss +++ /dev/null @@ -1,5 +0,0 @@ -@mixin nani { - a { - @content; - } -} diff --git a/node_modules/csscomb/test/core/scss/default.scss b/node_modules/csscomb/test/core/scss/default.scss deleted file mode 100644 index 12c10f9..0000000 --- a/node_modules/csscomb/test/core/scss/default.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato !default; - top: 0; -} diff --git a/node_modules/csscomb/test/core/scss/each.scss b/node_modules/csscomb/test/core/scss/each.scss deleted file mode 100644 index af596e6..0000000 --- a/node_modules/csscomb/test/core/scss/each.scss +++ /dev/null @@ -1,7 +0,0 @@ -div { - @each $animal in puma, sea-slug, erget { - .#{$animal}-icon { - background-image: url("/images/#{$animal}.png"); - } - } -} diff --git a/node_modules/csscomb/test/core/scss/extend-1.scss b/node_modules/csscomb/test/core/scss/extend-1.scss deleted file mode 100644 index c72afea..0000000 --- a/node_modules/csscomb/test/core/scss/extend-1.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - @extend .nani; - top: 0; -} diff --git a/node_modules/csscomb/test/core/scss/extend-2.scss b/node_modules/csscomb/test/core/scss/extend-2.scss deleted file mode 100644 index c7bf3b5..0000000 --- a/node_modules/csscomb/test/core/scss/extend-2.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - @extend %nani; - top: 0; -} diff --git a/node_modules/csscomb/test/core/scss/for.scss b/node_modules/csscomb/test/core/scss/for.scss deleted file mode 100644 index 64ff25a..0000000 --- a/node_modules/csscomb/test/core/scss/for.scss +++ /dev/null @@ -1,7 +0,0 @@ -div { - @for $i from 1 through 3 { - .item-#{$i} { - width: 2em * 1; - } - } -} diff --git a/node_modules/csscomb/test/core/scss/function.scss b/node_modules/csscomb/test/core/scss/function.scss deleted file mode 100644 index 8fcce43..0000000 --- a/node_modules/csscomb/test/core/scss/function.scss +++ /dev/null @@ -1,3 +0,0 @@ -@function nani($n) { - @return $n * 2; -} diff --git a/node_modules/csscomb/test/core/scss/if-else-if.scss b/node_modules/csscomb/test/core/scss/if-else-if.scss deleted file mode 100644 index f16e287..0000000 --- a/node_modules/csscomb/test/core/scss/if-else-if.scss +++ /dev/null @@ -1,7 +0,0 @@ -div { - @if $type == ocean { - top: 0; - } @else if $type == monster { - left: 0; - } -} diff --git a/node_modules/csscomb/test/core/scss/if-else.scss b/node_modules/csscomb/test/core/scss/if-else.scss deleted file mode 100644 index 236a621..0000000 --- a/node_modules/csscomb/test/core/scss/if-else.scss +++ /dev/null @@ -1,7 +0,0 @@ -div { - @if $type == ocean { - top: 0; - } @else { - left: 0; - } -} diff --git a/node_modules/csscomb/test/core/scss/if.scss b/node_modules/csscomb/test/core/scss/if.scss deleted file mode 100644 index af9f485..0000000 --- a/node_modules/csscomb/test/core/scss/if.scss +++ /dev/null @@ -1,5 +0,0 @@ -div { - @if $type == ocean { - top: 0; - } -} diff --git a/node_modules/csscomb/test/core/scss/import.scss b/node_modules/csscomb/test/core/scss/import.scss deleted file mode 100644 index 8faa126..0000000 --- a/node_modules/csscomb/test/core/scss/import.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - @import "foo.css"; - top: 0; -} diff --git a/node_modules/csscomb/test/core/scss/include.scss b/node_modules/csscomb/test/core/scss/include.scss deleted file mode 100644 index 2c91880..0000000 --- a/node_modules/csscomb/test/core/scss/include.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - @include nani($panda); - top: 0; -} diff --git a/node_modules/csscomb/test/core/scss/interpolated-variable-1.scss b/node_modules/csscomb/test/core/scss/interpolated-variable-1.scss deleted file mode 100644 index a6c28cf..0000000 --- a/node_modules/csscomb/test/core/scss/interpolated-variable-1.scss +++ /dev/null @@ -1,4 +0,0 @@ -div.#{$nani} { - color: tomato; - top:0; -} diff --git a/node_modules/csscomb/test/core/scss/interpolated-variable-2.scss b/node_modules/csscomb/test/core/scss/interpolated-variable-2.scss deleted file mode 100644 index a19498f..0000000 --- a/node_modules/csscomb/test/core/scss/interpolated-variable-2.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: #{$tomato}; - top: 0; -} diff --git a/node_modules/csscomb/test/core/scss/mixin-1.scss b/node_modules/csscomb/test/core/scss/mixin-1.scss deleted file mode 100644 index 32a7715..0000000 --- a/node_modules/csscomb/test/core/scss/mixin-1.scss +++ /dev/null @@ -1,6 +0,0 @@ -@mixin nani { - color: tomato; -} -.foo { - @include nani; -} diff --git a/node_modules/csscomb/test/core/scss/mixin-2.scss b/node_modules/csscomb/test/core/scss/mixin-2.scss deleted file mode 100644 index b779b6d..0000000 --- a/node_modules/csscomb/test/core/scss/mixin-2.scss +++ /dev/null @@ -1,6 +0,0 @@ -@mixin nani($tomato) { - color: $tomato; -} -.foo { - @include nani(red); -} diff --git a/node_modules/csscomb/test/core/scss/mixin-3.scss b/node_modules/csscomb/test/core/scss/mixin-3.scss deleted file mode 100644 index 2c19b35..0000000 --- a/node_modules/csscomb/test/core/scss/mixin-3.scss +++ /dev/null @@ -1,6 +0,0 @@ -@mixin nani($shadows...) { - box-shadow: $shadows; -} -.foo { - @include nani(0px 4px 5px #666, 2px 6px 10px #999); -} diff --git a/node_modules/csscomb/test/core/scss/mixin-4.scss b/node_modules/csscomb/test/core/scss/mixin-4.scss deleted file mode 100644 index 4e46ffe..0000000 --- a/node_modules/csscomb/test/core/scss/mixin-4.scss +++ /dev/null @@ -1,6 +0,0 @@ -.foo { - @include nani { - color: tomato; - top: 0 - } -} diff --git a/node_modules/csscomb/test/core/scss/nested-media.scss b/node_modules/csscomb/test/core/scss/nested-media.scss deleted file mode 100644 index 346ddbf..0000000 --- a/node_modules/csscomb/test/core/scss/nested-media.scss +++ /dev/null @@ -1,6 +0,0 @@ -div { - @media screen and (orientation: landscape) { - color: tomato; - } - top: 0; -} diff --git a/node_modules/csscomb/test/core/scss/nested-property.scss b/node_modules/csscomb/test/core/scss/nested-property.scss deleted file mode 100644 index 2f6384a..0000000 --- a/node_modules/csscomb/test/core/scss/nested-property.scss +++ /dev/null @@ -1,8 +0,0 @@ -div { - color: tomato; - font: 2px/3px { - family: fantasy; - size: 30em; - } - left: 0; -} diff --git a/node_modules/csscomb/test/core/scss/nested-rule.scss b/node_modules/csscomb/test/core/scss/nested-rule.scss deleted file mode 100644 index 5f74a2d..0000000 --- a/node_modules/csscomb/test/core/scss/nested-rule.scss +++ /dev/null @@ -1,6 +0,0 @@ -div { - color: tomato; - a { - top: 0; - } -} diff --git a/node_modules/csscomb/test/core/scss/parent-selector.scss b/node_modules/csscomb/test/core/scss/parent-selector.scss deleted file mode 100644 index 6176030..0000000 --- a/node_modules/csscomb/test/core/scss/parent-selector.scss +++ /dev/null @@ -1,8 +0,0 @@ -div { - color: tomato; - &.top { - color: nani; - top: 0; - } - left: 0; -} diff --git a/node_modules/csscomb/test/core/scss/variable.scss b/node_modules/csscomb/test/core/scss/variable.scss deleted file mode 100644 index d553b92..0000000 --- a/node_modules/csscomb/test/core/scss/variable.scss +++ /dev/null @@ -1,4 +0,0 @@ -$red: tomato; -div { - color: $tomato; -} diff --git a/node_modules/csscomb/test/core/scss/warn.scss b/node_modules/csscomb/test/core/scss/warn.scss deleted file mode 100644 index c7961a1..0000000 --- a/node_modules/csscomb/test/core/scss/warn.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - @warn "nani"; - top: 0; -} diff --git a/node_modules/csscomb/test/core/scss/while.scss b/node_modules/csscomb/test/core/scss/while.scss deleted file mode 100644 index 89c6cfa..0000000 --- a/node_modules/csscomb/test/core/scss/while.scss +++ /dev/null @@ -1,8 +0,0 @@ -div { - @while $i > 6 { - .item { - width: 2em * $i; - } - $i: $i - 2; - } -} diff --git a/node_modules/csscomb/test/core/use.js b/node_modules/csscomb/test/core/use.js deleted file mode 100644 index e14f43c..0000000 --- a/node_modules/csscomb/test/core/use.js +++ /dev/null @@ -1,41 +0,0 @@ -var assert = require('assert'); - -describe('.use()', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should set predefined options in correct order', function() { - var config = this.Comb.getConfig('csscomb'); - this.comb.configure(config); - var options = this.comb.getOptionsOrder(); - var expected = [ - 'always-semicolon', - 'remove-empty-rulesets', - 'color-case', - 'color-shorthand', - 'element-case', - 'eof-newline', - 'leading-zero', - 'quotes', - 'sort-order-fallback', - 'space-after-colon', - 'space-after-combinator', - 'space-after-opening-brace', - 'space-after-selector-delimiter', - 'space-before-colon', - 'space-before-combinator', - 'space-before-opening-brace', - 'space-before-selector-delimiter', - 'space-between-declarations', - 'block-indent', - 'sort-order', - 'strip-spaces', - 'space-before-closing-brace', - 'unitless-zero', - 'tab-size', - 'vendor-prefix-align' - ]; - assert.deepEqual(options, expected); - }); -}); diff --git a/node_modules/csscomb/test/mocha.js b/node_modules/csscomb/test/mocha.js deleted file mode 100644 index 5f5fb7a..0000000 --- a/node_modules/csscomb/test/mocha.js +++ /dev/null @@ -1,93 +0,0 @@ -var Comb = process.env.TEST_COV ? - require('../lib-cov/csscomb') : require('../lib/csscomb'); -var Mocha = require('mocha'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); - -var mocha = new Mocha(); -if (process.env.TEST_COV) mocha.reporter('html-cov'); - -// Tell mocha which tests to run: -['test/core', 'test/options'].forEach(function(dirname) { - fs.readdirSync(dirname).forEach(function(file) { - mocha.addFile(path.join(dirname, file)); - }); -}); - -// Add helpers (see tests for usage examples): -mocha.suite.beforeEach(function() { - this.Comb = Comb; - this.comb = new Comb(); - this.filename = ''; - - /** - * Read css file from test suite's directory. - * If run inside `test/core/cli.js` file, `this.readFile('nani.css')` will - * return content of `test/core/cli/nani.css` file. - * `this.filename = __filename` is required if this helper is used in a test - * case (see tests for examples). - * @param {String} filename Name of file that is located in test folder - * @returns {String} File's content - */ - this.readFile = function(filename) { - // Remove `.js` from test suite's name: - var dirname = this.filename.slice(0, -3); - return fs.readFileSync(dirname + '/' + filename, 'utf8'); - }; - - /** - * Comb a file and compare the result with expected. - * If `expected` is not defined, check that file's content does not change - * after combing. - * File names should be relative to test suite's folder. - * @param {String} input Name of file that should be combed - * @param {String} [expected] Name of file with expected content - */ - this.shouldBeEqual = function(input, expected) { - var syntax = input.split('.').pop(); - input = this.readFile(input); - expected = expected ? this.readFile(expected) : input; - assert.equal(this.comb.processString(input, { syntax: syntax }), expected); - }; - - /** - * Detect options in a file and compare result with expected. - * File names should be relative to test suite's folder. - * @param {Array} options List of options that should be detected - * @param {String} input Name of template file - * @param {Object} expected Expected config with detected options - */ - this.shouldDetect = function(options, input, expected) { - // We need to “sort” the input and expected objects, as their order may vary - function sortObject(o) { - var sorted = {}; - var key = []; - var a = []; - - for (key in o) { - if (o.hasOwnProperty(key)) { - a.push(key); - } - } - - a.sort(); - - for (key = 0; key < a.length; key++) { - sorted[a[key]] = o[a[key]]; - } - return sorted; - } - assert.equal( - JSON.stringify(sortObject(Comb.detectInString(input, options))), - JSON.stringify(sortObject(expected)) - ); - }; -}); - -mocha.run(function(failures) { - process.on('exit', function() { - process.exit(failures); - }); -}); - diff --git a/node_modules/csscomb/test/options/always-semicolon-less.js b/node_modules/csscomb/test/options/always-semicolon-less.js deleted file mode 100644 index b366c12..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less.js +++ /dev/null @@ -1,54 +0,0 @@ -describe('options/always-semicolon (scss)', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({ 'always-semicolon': true }); - }); - - it('Should not add semicolon to condition (single-line style)', function() { - this.shouldBeEqual('condition.less'); - }); - - it('Should not add semicolon to condition (multi-line style)', function() { - this.shouldBeEqual('condition-multiline.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 1 (single-line style)', function() { - this.shouldBeEqual('include-1.less', 'include-1.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 1 (multi-line style)', function() { - this.shouldBeEqual('include-1-multiline.less', 'include-1-multiline.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 2 (single-line style)', function() { - this.shouldBeEqual('include-2.less', 'include-2.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 2 (multi-line style)', function() { - this.shouldBeEqual('include-2-multiline.less', 'include-2-multiline.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 3 (single-line style)', function() { - this.shouldBeEqual('include-3.less', 'include-3.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 3 (multi-line style)', function() { - this.shouldBeEqual('include-3-multiline.less', 'include-3-multiline.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 4 (single-line style)', function() { - this.shouldBeEqual('include-4.less', 'include-4.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 4 (multi-line style)', function() { - this.shouldBeEqual('include-4-multiline.less', 'include-4-multiline.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 5 (single-line style)', function() { - this.shouldBeEqual('include-5.less', 'include-5.expected.less'); - }); - - it('Should add semicolon to last included mixin if missing. Test 5 (multi-line style)', function() { - this.shouldBeEqual('include-5-multiline.less', 'include-5-multiline.expected.less'); - }); -}); diff --git a/node_modules/csscomb/test/options/always-semicolon-less/condition-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/condition-multiline.less deleted file mode 100644 index b307117..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/condition-multiline.less +++ /dev/null @@ -1,6 +0,0 @@ -div { - @color: tomato; - when (@color = tomato) { - top: 0; - } - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/condition.less b/node_modules/csscomb/test/options/always-semicolon-less/condition.less deleted file mode 100644 index c0c4950..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/condition.less +++ /dev/null @@ -1 +0,0 @@ -div { @color: tomato; when (@color = tomato) { top: 0; } } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.expected.less deleted file mode 100644 index 77cf666..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.expected.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - .nani; - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.less deleted file mode 100644 index 9daab17..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-1-multiline.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - .nani - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-1.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-1.expected.less deleted file mode 100644 index 9058edc..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-1.expected.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; .nani; } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-1.less b/node_modules/csscomb/test/options/always-semicolon-less/include-1.less deleted file mode 100644 index 4e47017..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-1.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; .nani } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.expected.less deleted file mode 100644 index 6877e14..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.expected.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - .nani(2px); - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.less deleted file mode 100644 index c419ae5..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-2-multiline.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - .nani(2px) - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-2.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-2.expected.less deleted file mode 100644 index 3fb4335..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-2.expected.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; .nani(2px); } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-2.less b/node_modules/csscomb/test/options/always-semicolon-less/include-2.less deleted file mode 100644 index 1ed55fe..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-2.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; .nani(2px) } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.expected.less deleted file mode 100644 index d51df78..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.expected.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - .nani(2px) !important; - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.less deleted file mode 100644 index 4d628b8..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-3-multiline.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - .nani(2px) !important - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-3.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-3.expected.less deleted file mode 100644 index 117678f..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-3.expected.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; .nani(2px) !important; } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-3.less b/node_modules/csscomb/test/options/always-semicolon-less/include-3.less deleted file mode 100644 index 3098898..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-3.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; .nani(2px) !important } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.expected.less deleted file mode 100644 index 1efba9e..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.expected.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - #bundle > .button; - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.less deleted file mode 100644 index f16812d..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-4-multiline.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - #bundle > .button - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-4.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-4.expected.less deleted file mode 100644 index 1b3c6d8..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-4.expected.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; #bundle > .button; } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-4.less b/node_modules/csscomb/test/options/always-semicolon-less/include-4.less deleted file mode 100644 index 9221814..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-4.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; #bundle > .button } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.expected.less deleted file mode 100644 index 4c15e42..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.expected.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - @color: tomato; - #bundle > .button (@color); - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.less b/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.less deleted file mode 100644 index 15d03fc..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-5-multiline.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - @color: tomato; - #bundle > .button (@color) - } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-5.expected.less b/node_modules/csscomb/test/options/always-semicolon-less/include-5.expected.less deleted file mode 100644 index 718c5c5..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-5.expected.less +++ /dev/null @@ -1 +0,0 @@ -div { @color: tomato; #bundle > .button (@color); } diff --git a/node_modules/csscomb/test/options/always-semicolon-less/include-5.less b/node_modules/csscomb/test/options/always-semicolon-less/include-5.less deleted file mode 100644 index 6bf447c..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-less/include-5.less +++ /dev/null @@ -1 +0,0 @@ -div { @color: tomato; #bundle > .button (@color) } diff --git a/node_modules/csscomb/test/options/always-semicolon-sass.js b/node_modules/csscomb/test/options/always-semicolon-sass.js deleted file mode 100644 index 3b96922..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-sass.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('options/always-semicolon (scss)', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({ 'always-semicolon': true }); - }); - - it('Should not add semicolon', function() { - this.shouldBeEqual('test.sass'); - }); -}); diff --git a/node_modules/csscomb/test/options/always-semicolon-sass/test.sass b/node_modules/csscomb/test/options/always-semicolon-sass/test.sass deleted file mode 100644 index 6284097..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-sass/test.sass +++ /dev/null @@ -1,7 +0,0 @@ -a - color: tomato - top: 0 - - p - a: b - c:d diff --git a/node_modules/csscomb/test/options/always-semicolon-scss.js b/node_modules/csscomb/test/options/always-semicolon-scss.js deleted file mode 100644 index 48ec6ec..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss.js +++ /dev/null @@ -1,62 +0,0 @@ -describe('options/always-semicolon (scss)', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({ 'always-semicolon': true }); - }); - - it('Should not add semicolon if last value is block (singl-line style)', function() { - this.shouldBeEqual('block-value.scss'); - }); - - it('Should not add semicolon if last value is block (multi-line style)', function() { - this.shouldBeEqual('block-value-multiline.scss'); - }); - - it('Should add semicolon to last included mixin if missing. Test 1 (single-line style)', function() { - this.shouldBeEqual('include-1.scss', 'include-1.expected.scss'); - }); - - it('Should add semicolon to last included mixin if missing. Test 1 (multi-line style)', function() { - this.shouldBeEqual('include-1-multiline.scss', 'include-1-multiline.expected.scss'); - }); - - it('Should add semicolon to last included mixin if missing. Test 2 (single-line style)', function() { - this.shouldBeEqual('include-2.scss', 'include-2.expected.scss'); - }); - - it('Should add semicolon to last included mixin if missing. Test 2 (multi-line style)', function() { - this.shouldBeEqual('include-2-multiline.scss', 'include-2-multiline.expected.scss'); - }); - - it('Should not add semicolon to last included mixin if there is a block (single-line style)', function() { - this.shouldBeEqual('block-include.scss'); - }); - - it('Should not add semicolon to last included mixin if there is a block (multi-line style)', function() { - this.shouldBeEqual('block-include-multiline.scss'); - }); - - it('Should add semicolon to last extend if missing (single-line style)', function() { - this.shouldBeEqual('extend.scss', 'extend.expected.scss'); - }); - - it('Should add semicolon to last extend if missing (multi-line style)', function() { - this.shouldBeEqual('extend-multiline.scss', 'extend-multiline.expected.scss'); - }); - - it('Should not add semicolon to condition (single-line style)', function() { - this.shouldBeEqual('condition.scss'); - }); - - it('Should not add semicolon to condition (multi-line style)', function() { - this.shouldBeEqual('condition-multiline.scss'); - }); - - it('Should not add semicolon to loop (single-line style)', function() { - this.shouldBeEqual('loop.scss'); - }); - - it('Should not add semicolon to loop (multi-line style)', function() { - this.shouldBeEqual('loop-multiline.scss'); - }); -}); diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/block-include-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/block-include-multiline.scss deleted file mode 100644 index a9e5aa9..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/block-include-multiline.scss +++ /dev/null @@ -1,7 +0,0 @@ -div { - color: tomato; - @include nani { - top: 0; - content: ''; - } - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/block-include.scss b/node_modules/csscomb/test/options/always-semicolon-scss/block-include.scss deleted file mode 100644 index 251fa78..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/block-include.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @include nani { top: 0; content: ''; } } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/block-value-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/block-value-multiline.scss deleted file mode 100644 index f654043..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/block-value-multiline.scss +++ /dev/null @@ -1,7 +0,0 @@ -div { - color: tomato; - font: { - family: fantasy; - size: 16px; - } - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/block-value.scss b/node_modules/csscomb/test/options/always-semicolon-scss/block-value.scss deleted file mode 100644 index 15f19e2..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/block-value.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; font: { family: fantasy; size: 16px; } } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/condition-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/condition-multiline.scss deleted file mode 100644 index 7aeb8af..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/condition-multiline.scss +++ /dev/null @@ -1,6 +0,0 @@ -div { - $color: tomato; - @if $color == tomato { - top: 0; - } - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/condition.scss b/node_modules/csscomb/test/options/always-semicolon-scss/condition.scss deleted file mode 100644 index 692cbca..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/condition.scss +++ /dev/null @@ -1 +0,0 @@ -div { $color: tomato; @if $color == tomato { top: 0; } } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.expected.scss deleted file mode 100644 index eaaa0c7..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.expected.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - @extend .nani; - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.scss deleted file mode 100644 index 6493e72..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/extend-multiline.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - @extend .nani - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/extend.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/extend.expected.scss deleted file mode 100644 index ec45b2e..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/extend.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @extend .nani; } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/extend.scss b/node_modules/csscomb/test/options/always-semicolon-scss/extend.scss deleted file mode 100644 index 8f545cc..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/extend.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @extend .nani } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.expected.scss deleted file mode 100644 index d8db3e3..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.expected.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - @include nani; - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.scss deleted file mode 100644 index bf95505..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/include-1-multiline.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - @include nani - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-1.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-1.expected.scss deleted file mode 100644 index 2feaaec..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/include-1.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @include nani; } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-1.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-1.scss deleted file mode 100644 index 204e35d..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/include-1.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @include nani } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.expected.scss deleted file mode 100644 index e0c3600..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.expected.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - @include nani(10); - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.scss deleted file mode 100644 index ad05456..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/include-2-multiline.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - @include nani(10) - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-2.expected.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-2.expected.scss deleted file mode 100644 index 8771956..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/include-2.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @include nani(10); } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/include-2.scss b/node_modules/csscomb/test/options/always-semicolon-scss/include-2.scss deleted file mode 100644 index f5bccc9..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/include-2.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @include nani(10) } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/loop-multiline.scss b/node_modules/csscomb/test/options/always-semicolon-scss/loop-multiline.scss deleted file mode 100644 index 5768e29..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/loop-multiline.scss +++ /dev/null @@ -1,6 +0,0 @@ -div { - color: tomato; - @while 1 > 2 { - top: 0; - } - } diff --git a/node_modules/csscomb/test/options/always-semicolon-scss/loop.scss b/node_modules/csscomb/test/options/always-semicolon-scss/loop.scss deleted file mode 100644 index afb46f9..0000000 --- a/node_modules/csscomb/test/options/always-semicolon-scss/loop.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @while 1 > 2 { top: 0; } } diff --git a/node_modules/csscomb/test/options/always-semicolon.js b/node_modules/csscomb/test/options/always-semicolon.js deleted file mode 100644 index a20f8d3..0000000 --- a/node_modules/csscomb/test/options/always-semicolon.js +++ /dev/null @@ -1,125 +0,0 @@ -var assert = require('assert'); - -describe('options/always-semicolon', function() { - it('Should add semicolon for last property if missing. Test 1', function() { - this.comb.configure({ 'always-semicolon': true }); - assert.equal( - this.comb.processString( - 'div { height: 0 }' - ), - 'div { height: 0; }' - ); - }); - - it('Should add semicolon for last property if missing. Test 2', function() { - this.comb.configure({ 'always-semicolon': true }); - assert.equal( - this.comb.processString( - 'div {\nheight: 0\n}' - ), - 'div {\nheight: 0;\n}' - ); - }); - - it('Should add semicolon for last property if missing. Test 3', function() { - this.comb.configure({ 'always-semicolon': true }); - assert.equal( - this.comb.processString( - 'div {height: 0}' - ), - 'div {height: 0;}' - ); - }); - - it('Should add semicolon for last property if missing. Test 4', function() { - this.comb.configure({ 'always-semicolon': true }); - assert.equal( - this.comb.processString( - 'div {\nheight: 0 /* Comment */\n}' - ), - 'div {\nheight: 0; /* Comment */\n}' - ); - }); - - it('Should add semicolon for last property if missing. Test 5', function() { - this.comb.configure({ 'always-semicolon': true }); - assert.equal( - this.comb.processString( - 'div {\ntop: 1px;\nheight: 0 /* 1comment */ /* 2comment */\n}' - ), - 'div {\ntop: 1px;\nheight: 0; /* 1comment */ /* 2comment */\n}' - ); - }); - - it('Should detect semicolon for last property. Test 1', function() { - this.shouldDetect( - ['always-semicolon'], - 'div { height: 0 }', - { - 'always-semicolon': false - } - ); - }); - - it('Should detect semicolon for last property. Test 2', function() { - this.shouldDetect( - ['always-semicolon'], - 'div { height: 0; }', - { - 'always-semicolon': true - } - ); - }); - - it('Should detect semicolon for last property. Test 3', function() { - this.shouldDetect( - ['always-semicolon'], - 'div { height: 0; } div { height: 0 }', - { - 'always-semicolon': true - } - ); - }); - - it('Should detect semicolon for last property. Test 4', function() { - this.shouldDetect( - ['always-semicolon'], - 'div { height: 0 } div { height: 0; } div { height: 0 }', - { - 'always-semicolon': false - } - ); - }); - - it('Should detect semicolon for last property. Test 5', function() { - this.shouldDetect( - ['always-semicolon'], - 'div {\nheight: 0 /* Comment */\n} ' + - 'div { height: 0; }' + - 'div {\ntop: 1px;\nheight: 0 /* 1comment */ /* 2comment */\n}', - { - 'always-semicolon': false - } - ); - }); - - - it('Should detect semicolon for last property. Test 6', function() { - this.shouldDetect( - ['always-semicolon'], - 'a{\n border:0;\n}', - { - 'always-semicolon': true - } - ); - }); - - it('Should not detect semicolon for last property if there are no properties', function() { - this.shouldDetect( - ['always-semicolon'], - 'div {}', - {} - ); - }); - -}); diff --git a/node_modules/csscomb/test/options/block-indent-sass.js b/node_modules/csscomb/test/options/block-indent-sass.js deleted file mode 100644 index 33b6add..0000000 --- a/node_modules/csscomb/test/options/block-indent-sass.js +++ /dev/null @@ -1,21 +0,0 @@ -describe('options/block-indent (sass):', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('First level ruleset\'s block', function() { - this.comb.configure({ 'block-indent': 2 }); - this.shouldBeEqual('block.sass', 'block.expected.sass'); - }); - - it('Nested ruleset', function() { - this.comb.configure({ 'block-indent': 2 }); - this.shouldBeEqual('nested-ruleset.sass', 'nested-ruleset.expected.sass'); - }); - - it('Mixin', function() { - this.comb.configure({ 'block-indent': 4 }); - this.shouldBeEqual('mixin.sass', 'mixin.expected.sass'); - }); -}); - diff --git a/node_modules/csscomb/test/options/block-indent-sass/block.expected.sass b/node_modules/csscomb/test/options/block-indent-sass/block.expected.sass deleted file mode 100644 index ddae383..0000000 --- a/node_modules/csscomb/test/options/block-indent-sass/block.expected.sass +++ /dev/null @@ -1,6 +0,0 @@ -a - color: tomato - top: 0 - -p - bottom: 0 diff --git a/node_modules/csscomb/test/options/block-indent-sass/block.sass b/node_modules/csscomb/test/options/block-indent-sass/block.sass deleted file mode 100644 index 9be6816..0000000 --- a/node_modules/csscomb/test/options/block-indent-sass/block.sass +++ /dev/null @@ -1,6 +0,0 @@ -a - color: tomato - top: 0 - -p - bottom: 0 diff --git a/node_modules/csscomb/test/options/block-indent-sass/mixin.expected.sass b/node_modules/csscomb/test/options/block-indent-sass/mixin.expected.sass deleted file mode 100644 index f935113..0000000 --- a/node_modules/csscomb/test/options/block-indent-sass/mixin.expected.sass +++ /dev/null @@ -1,8 +0,0 @@ -@mixin sexy-border($color, $width: 1px) - border: - color: $color - width: $width - style: dashed - -p - +sexy-border(blue) diff --git a/node_modules/csscomb/test/options/block-indent-sass/mixin.sass b/node_modules/csscomb/test/options/block-indent-sass/mixin.sass deleted file mode 100644 index d25771d..0000000 --- a/node_modules/csscomb/test/options/block-indent-sass/mixin.sass +++ /dev/null @@ -1,8 +0,0 @@ -@mixin sexy-border($color, $width: 1px) - border: - color: $color - width: $width - style: dashed - -p - +sexy-border(blue) diff --git a/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.expected.sass b/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.expected.sass deleted file mode 100644 index 2c7edc6..0000000 --- a/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.expected.sass +++ /dev/null @@ -1,9 +0,0 @@ -a - color: tomato - top: 0 - - p - bottom: 0 - - &:hover - color: yellow diff --git a/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.sass b/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.sass deleted file mode 100644 index 8567d2e..0000000 --- a/node_modules/csscomb/test/options/block-indent-sass/nested-ruleset.sass +++ /dev/null @@ -1,9 +0,0 @@ -a - color: tomato - top: 0 - - p - bottom: 0 - - &:hover - color: yellow diff --git a/node_modules/csscomb/test/options/block-indent-scss.js b/node_modules/csscomb/test/options/block-indent-scss.js deleted file mode 100644 index 34130dc..0000000 --- a/node_modules/csscomb/test/options/block-indent-scss.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('options/block-indent (scss):', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Issue 213', function() { - this.comb.configure({ 'block-indent': 2 }); - this.shouldBeEqual('nested-include.scss', 'nested-include.expected.scss'); - }); -}); diff --git a/node_modules/csscomb/test/options/block-indent-scss/nested-include.expected.scss b/node_modules/csscomb/test/options/block-indent-scss/nested-include.expected.scss deleted file mode 100644 index c419883..0000000 --- a/node_modules/csscomb/test/options/block-indent-scss/nested-include.expected.scss +++ /dev/null @@ -1,5 +0,0 @@ -li{ - @include respond-to(mobile){ float: none; } - float: left; - width: 25%; - } diff --git a/node_modules/csscomb/test/options/block-indent-scss/nested-include.scss b/node_modules/csscomb/test/options/block-indent-scss/nested-include.scss deleted file mode 100644 index 93504be..0000000 --- a/node_modules/csscomb/test/options/block-indent-scss/nested-include.scss +++ /dev/null @@ -1,5 +0,0 @@ -li{ - @include respond-to(mobile){ float: none; } - float: left; - width: 25%; -} diff --git a/node_modules/csscomb/test/options/block-indent.js b/node_modules/csscomb/test/options/block-indent.js deleted file mode 100644 index 9123961..0000000 --- a/node_modules/csscomb/test/options/block-indent.js +++ /dev/null @@ -1,66 +0,0 @@ -describe('options/block-indent:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'block-indent': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'block-indent': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'block-indent': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper number of spaces', function() { - this.comb.configure({ 'block-indent': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value => should set proper number of spaces', function() { - this.comb.configure({ 'block-indent': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Should detect nothing with an empty block, test 1', function() { - this.shouldDetect( - ['block-indent'], - 'a{ }', - {} - ); - }); - - it('Should detect nothing with an empty block, test 2', function() { - this.shouldDetect( - ['block-indent'], - 'a{}', - {} - ); - }); - - it('Should detect correct number of spaces', function() { - this.shouldDetect( - ['block-indent'], - 'a{\n top: 0;\n color: tomato;\n}', - { 'block-indent': ' ' } - ); - }); - - it('Should detect no indent for one-line code', function() { - this.shouldDetect( - ['block-indent'], - 'a{ top: 0; color: tomato; }', - {} - ); - }); - it('Valid string value => should set proper space after combnator', function() { - this.comb.configure({ 'block-indent': ' ', 'space-before-closing-brace': '\n' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); -}); diff --git a/node_modules/csscomb/test/options/block-indent/test-2.expected.css b/node_modules/csscomb/test/options/block-indent/test-2.expected.css deleted file mode 100644 index 467a932..0000000 --- a/node_modules/csscomb/test/options/block-indent/test-2.expected.css +++ /dev/null @@ -1,30 +0,0 @@ -a {color: tomato; top: 0;} - -a { color: tomato; - top: 0; } - -a { color: tomato; - top: 0; } - -a { - color: tomato; - top: 0; } - -a { - color: tomato; - top: 0; - } - -a { - color: tomato; - top: 0; - } - -@media print { a {color: tomato; top: 0; } } - -@media print { - a { - color: tomato; - top: 0; - } - } diff --git a/node_modules/csscomb/test/options/block-indent/test-3.expected.css b/node_modules/csscomb/test/options/block-indent/test-3.expected.css deleted file mode 100644 index 684ff98..0000000 --- a/node_modules/csscomb/test/options/block-indent/test-3.expected.css +++ /dev/null @@ -1,36 +0,0 @@ -a {color: tomato; top: 0; -} - -a { color: tomato; - top: 0; -} - -a { color: tomato; - top: 0; -} - -a { - color: tomato; - top: 0; -} - -a { - color: tomato; - top: 0; -} - -a { - color: tomato; - top: 0; -} - -@media print { a {color: tomato; top: 0; - } -} - -@media print { - a { - color: tomato; - top: 0; - } -} diff --git a/node_modules/csscomb/test/options/block-indent/test.css b/node_modules/csscomb/test/options/block-indent/test.css deleted file mode 100644 index b1b52eb..0000000 --- a/node_modules/csscomb/test/options/block-indent/test.css +++ /dev/null @@ -1,30 +0,0 @@ -a {color: tomato; top: 0;} - -a { color: tomato; -top: 0; } - -a { color: tomato; - top: 0; } - -a { -color: tomato; -top: 0; } - -a { -color: tomato; -top: 0; -} - - a { - color: tomato; - top: 0; - } - -@media print { a {color: tomato; top: 0; } } - - @media print { -a { - color: tomato; - top: 0; - } - } diff --git a/node_modules/csscomb/test/options/block-indent/test.expected.css b/node_modules/csscomb/test/options/block-indent/test.expected.css deleted file mode 100644 index 0c684ec..0000000 --- a/node_modules/csscomb/test/options/block-indent/test.expected.css +++ /dev/null @@ -1,30 +0,0 @@ -a {color: tomato; top: 0;} - -a { color: tomato; -top: 0; } - -a { color: tomato; -top: 0; } - -a { -color: tomato; -top: 0; } - -a { -color: tomato; -top: 0; -} - -a { -color: tomato; -top: 0; -} - -@media print { a {color: tomato; top: 0; } } - -@media print { -a { -color: tomato; -top: 0; -} -} diff --git a/node_modules/csscomb/test/options/color-case.js b/node_modules/csscomb/test/options/color-case.js deleted file mode 100644 index e94af2f..0000000 --- a/node_modules/csscomb/test/options/color-case.js +++ /dev/null @@ -1,102 +0,0 @@ -var assert = require('assert'); - -describe('options/color-case', function() { - it('Should switch colors to upper case', function() { - this.comb.configure({ 'color-case': 'upper' }); - assert.equal( - this.comb.processString( - 'div { color: #fff }' - ), - 'div { color: #FFF }' - ); - }); - - it('Should switch colors to lower case', function() { - this.comb.configure({ 'color-case': 'lower' }); - assert.equal( - this.comb.processString( - 'div { color: #FFF }' - ), - 'div { color: #fff }' - ); - }); - - it('Should switch color-case in complex rules', function() { - this.comb.configure({ 'color-case': 'lower' }); - assert.equal( - this.comb.processString( - 'div { background: url(img.png#RND) #E3E3E3 0 100% no-repeat;' + - ' box-shadow: 1px 2px 3px 4px #F0F0F0 inset; }' - ), - 'div { background: url(img.png#RND) #e3e3e3 0 100% no-repeat;' + - ' box-shadow: 1px 2px 3px 4px #f0f0f0 inset; }' - ); - }); - - it('Should not switch selector case', function() { - this.comb.configure({ 'color-case': 'lower' }); - assert.equal( - this.comb.processString( - '#Header { color: #FFF }' - ), - '#Header { color: #fff }' - ); - }); - - it('Should detect uppercase color', function() { - this.shouldDetect( - ['color-case'], - 'a { color: #F3F3F3 }', - { - 'color-case': 'upper' - } - ); - }); - - it('Should detect lowercase color', function() { - this.shouldDetect( - ['color-case'], - 'a { color: #f6f6f6 }', - { - 'color-case': 'lower' - } - ); - }); - - it('Should detect uppercase color in a shorthand', function() { - this.shouldDetect( - ['color-case'], - 'a { color: #FFF }', - { - 'color-case': 'upper' - } - ); - }); - - it('Should detect lowercase color in a shorthand', function() { - this.shouldDetect( - ['color-case'], - 'a { color: #fff }', - { - 'color-case': 'lower' - } - ); - }); - - it('Shouldn’t detect color case if it contains only digits', function() { - this.shouldDetect( - ['color-case'], - 'a { color: #333 }', - {} - ); - }); - - it('Shouldn’t detect color case if it is in mixed case', function() { - this.shouldDetect( - ['color-case'], - 'a { color: #fFfFfF }', - {} - ); - }); - -}); diff --git a/node_modules/csscomb/test/options/color-shorthand.js b/node_modules/csscomb/test/options/color-shorthand.js deleted file mode 100644 index d1708c0..0000000 --- a/node_modules/csscomb/test/options/color-shorthand.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require('assert'); - -describe('options/color-shorthand', function() { - it('Should shrink hexadecimal colors to 3 symbols', function() { - this.comb.configure({ 'color-shorthand': true }); - assert.equal( - this.comb.processString( - 'div { color: #aabbcc }' - ), - 'div { color: #abc }' - ); - }); - - it('Should expand hexadecimal colors to 6 symbols', function() { - this.comb.configure({ 'color-shorthand': false }); - assert.equal( - this.comb.processString( - 'div { color: #7ad }' - ), - 'div { color: #77aadd }' - ); - }); - - it('Should save case while processing', function() { - this.comb.configure({ 'color-shorthand': true }); - assert.equal( - this.comb.processString( - 'div { color: #fFAafF }' - ), - 'div { color: #fAf }' - ); - }); - - - it('Should detect non-shorthanded color', function() { - this.shouldDetect( - ['color-shorthand'], - 'a { color: #FF33EE }', - { - 'color-shorthand': false - } - ); - }); - - it('Should detect shorthanded color', function() { - this.shouldDetect( - ['color-shorthand'], - 'a { color: #fff }', - { - 'color-shorthand': true - } - ); - }); - - it('Shouldn’t detect if a color is shorthanded if it can’t be shorthanded', function() { - this.shouldDetect( - ['color-shorthand'], - 'a { color: #F3F3F3 }', - {} - ); - }); - - it('Shouldn’t detect if a color is shorthanded if it is not a vhash', function() { - this.shouldDetect( - ['color-shorthand'], - 'a { color: rgba(0,0,0,0.5) }', - {} - ); - }); -}); diff --git a/node_modules/csscomb/test/options/element-case-scss.js b/node_modules/csscomb/test/options/element-case-scss.js deleted file mode 100644 index 468ffe2..0000000 --- a/node_modules/csscomb/test/options/element-case-scss.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('options/element-case (scss):', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should not touch mixin names', function() { - this.comb.configure({ 'element-case': 'lower' }); - this.shouldBeEqual('mixin.scss', 'mixin.expected.scss'); - }); -}); diff --git a/node_modules/csscomb/test/options/element-case-scss/mixin.expected.scss b/node_modules/csscomb/test/options/element-case-scss/mixin.expected.scss deleted file mode 100644 index 8700a0e..0000000 --- a/node_modules/csscomb/test/options/element-case-scss/mixin.expected.scss +++ /dev/null @@ -1,3 +0,0 @@ -a { - @include boxSizingContent(); -} diff --git a/node_modules/csscomb/test/options/element-case-scss/mixin.scss b/node_modules/csscomb/test/options/element-case-scss/mixin.scss deleted file mode 100644 index d2b5c33..0000000 --- a/node_modules/csscomb/test/options/element-case-scss/mixin.scss +++ /dev/null @@ -1,3 +0,0 @@ -A { - @include boxSizingContent(); -} diff --git a/node_modules/csscomb/test/options/element-case.js b/node_modules/csscomb/test/options/element-case.js deleted file mode 100644 index fb95287..0000000 --- a/node_modules/csscomb/test/options/element-case.js +++ /dev/null @@ -1,99 +0,0 @@ -var assert = require('assert'); - -describe('options/element-case', function() { - it('Invalid String should not change case of elements', function() { - this.comb.configure({ 'element-case': 'foobar' }); - assert.equal( - this.comb.processString( - 'LI a { color : red }' - ), - 'LI a { color : red }' - ); - }); - - it('Should switch tag name to upper case', function() { - this.comb.configure({ 'element-case': 'upper' }); - assert.equal( - this.comb.processString( - 'div { color: #fff }' - ), - 'DIV { color: #fff }' - ); - }); - - it('Should switch tag name to lower case', function() { - this.comb.configure({ 'element-case': 'lower' }); - assert.equal( - this.comb.processString( - 'DIV { color: #FFF }' - ), - 'div { color: #FFF }' - ); - }); - - it('Should switch element-case in complex rules', function() { - this.comb.configure({ 'element-case': 'lower' }); - assert.equal( - this.comb.processString( - 'UL > LI > .foo:not(A) { color: red }' - ), - 'ul > li > .foo:not(a) { color: red }' - ); - }); - - it('Should detect lowercase elements', function() { - this.shouldDetect( - ['element-case'], - 'a { color: red }', - { - 'element-case': 'lower' - } - ); - }); - - it('Should detect uppercase elements', function() { - this.shouldDetect( - ['element-case'], - 'A { color: red }', - { - 'element-case': 'upper' - } - ); - }); - - it('Should detect lowercase elements in a long selector', function() { - this.shouldDetect( - ['element-case'], - 'ul li:not(:hover) A { color: red }', - { - 'element-case': 'lower' - } - ); - }); - - it('Should detect uppercase elements in a long selector', function() { - this.shouldDetect( - ['element-case'], - 'ul .lol:not(LI) A { color: red }', - { - 'element-case': 'upper' - } - ); - }); - - it('Shouldn’t detect case of elements in a mixed case', function() { - this.shouldDetect( - ['element-case'], - 'aRtIcLe { color: red }', - {} - ); - }); - - it('Shouldn’t detect case of elements when there are no such', function() { - this.shouldDetect( - ['element-case'], - '*.lol { color: red }', - {} - ); - }); -}); diff --git a/node_modules/csscomb/test/options/eof-newline.js b/node_modules/csscomb/test/options/eof-newline.js deleted file mode 100644 index ead5fcf..0000000 --- a/node_modules/csscomb/test/options/eof-newline.js +++ /dev/null @@ -1,69 +0,0 @@ -var assert = require('assert'); - -describe('options/eof-newline', function() { - it('Invalid value should not change trim trailing brac', function() { - this.comb.configure({ 'eof-newline': 'foobar' }); - assert.equal( - this.comb.processString('a { color: red } \n'), - 'a { color: red } \n' - ); - }); - it('Boolean true value should insert line-break at eof', function() { - this.comb.configure({ 'eof-newline': true }); - assert.equal( - this.comb.processString( - 'a {color:red} ' - ), - 'a {color:red} \n' - ); - }); - it('Boolean false value should remove line-break from eof', function() { - this.comb.configure({ 'eof-newline': false }); - assert.equal( - this.comb.processString( - 'a {color:red} \n' - ), - 'a {color:red} ' - ); - }); - - it('Shouldn’t detect eof newline', function() { - this.shouldDetect( - ['eof-newline'], - 'a { color: red }', - { - 'eof-newline': false - } - ); - }); - - it('Should detect eof newline', function() { - this.shouldDetect( - ['eof-newline'], - 'a { color: red }\n', - { - 'eof-newline': true - } - ); - }); - - it('Shouldn’t detect eof newline with spaces at the end', function() { - this.shouldDetect( - ['eof-newline'], - 'a { color: red } ', - { - 'eof-newline': false - } - ); - }); - - it('Should detect eof newline with mixed spaces at the end', function() { - this.shouldDetect( - ['eof-newline'], - 'a { color: red } \n ', - { - 'eof-newline': true - } - ); - }); -}); diff --git a/node_modules/csscomb/test/options/integral.js b/node_modules/csscomb/test/options/integral.js deleted file mode 100644 index 624598d..0000000 --- a/node_modules/csscomb/test/options/integral.js +++ /dev/null @@ -1,28 +0,0 @@ -var assert = require('assert'); - -describe('integral test', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Process result must be equal to expected.css', function() { - var config = this.Comb.getConfig('csscomb'); - this.comb.configure(config); - this.shouldBeEqual('integral.css', 'integral.expected.css'); - }); - - it('Issue 252', function() { - var config = this.Comb.getConfig('csscomb'); - this.comb.configure(config); - this.shouldBeEqual('issue-252.sass', 'issue-252.expected.sass'); - }); - - it('Should detect everything in integral test', function() { - var input = this.readFile('integral.expected.css'); - // Clone the required config object, otherwise other tests would fail - var expected = JSON.parse(JSON.stringify(this.Comb.getConfig('csscomb'))); - delete expected['sort-order']; - delete expected['exclude']; - this.shouldDetect(undefined, input, expected); - }); -}); diff --git a/node_modules/csscomb/test/options/integral/integral.css b/node_modules/csscomb/test/options/integral/integral.css deleted file mode 100644 index cb280a3..0000000 --- a/node_modules/csscomb/test/options/integral/integral.css +++ /dev/null @@ -1,129 +0,0 @@ -/* foobar */ -@media all and (min-width:0px) {.radio-button_theme_normal .radio-button__radio:before - { - background: rgba(0,0,0,0.4); - background: -webkit-linear-gradient(top, rgba(0,0,0,0.2) 0,rgba(0,0,0,0.4) 100%); - background: -moz-linear-gradient(top, rgba(0,0,0,0.2) 0, rgba(0,0,0,0.4) 100%); - background: -o-linear-gradient(top, rgba(0,0,0,0.2) 0,rgba(0,0,0,0.4) 100%); - background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0,rgba(0,0,0,0.4) 100%); - - -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 1px 0 rgba(0,0,0,.07); - } - - /* :after — фон */ - .radio-button_theme_normal .radio-button__radio[class^="radio"]:after - { - background: #fFf; - background: -webkit-linear-gradient(top, #FffFff 0,#eeeeEe 100%); - background: -moz-linear-gradient(top, #fff 0, #eEe 100%); - background: -o-linear-gradient(top, #fff 0,#eee 100%); - background: linear-gradient(to bottom, #ffffff 0,#eeEeee 100%); - content: "it's something different"; - } - - /* _focused_yes */ - .radio-button_theme_normal .radio-button__radio_focused_yes:before - { - content: "hello"; - -moz-box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0px 1px 0px rgba(0,0,0,.07); - box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0px 1px 0px rgba(0,0,0,.07); - } - -} - -/* Фигурные скобки. Вариант 1 */ -a, b, i /* foobar */ { - padding:0; - margin:0; - } - div p{ - font-size:1px; - top:0; - } - div p em{ - font-style:italic; - border-bottom:1px solid red; -} - -@media all and (min-width:0px){ - /* В нажатом состоянии смещается вниз на 1px вся кнопка, текст не смещается */ - .button_pressed_yes.button_shadow_yes - { - top: 1px; - } - - .button_pressed_yes.button_shadow_yes .button__text - { - top: 0; - } -} - -@media all /* media */ - { /* foobar */ -.input__control -{ - color: #000; - font-size: 100%; - margin: 0; - position: relative; - width: 100%; - z-index: 3; -}} - -@media screen and (min-width: 35em) /* screen */, - print and (min-width: 40em) /* print */ { /* foobar */ -.input__control -{ - -moz-box-sizing: border-box; - background: none; - border: 0; - box-sizing: border-box; - outline: 0; - padding: 0.4em 0; -} -}.empty-rule{} - -/* Фигурные скобки. Вариант 2 */ -div -{ - padding:0; - margin:0; -} - div p - { - font-size:1px; - top:0; - } - div p em - { - font-style:italic;/* inline comment*/ - border-bottom:1px solid red; - } - -/* Фигурные скобки. Вариант 3 */ -div { - padding:0; - margin:0; -} -/* foo */ div~p { - font-size:1px; - top:0 - } - div> P +EM { - /* upline comment*/ - font-style:italic; - - border-bottom:1px solid red /* trololo */ /* trololo */ - } - - a:not(B){ -top: 0;/* ololo */margin :0;} - b - { -top :0/* trololo */;margin : 0} -.empty-rule{} - - - - diff --git a/node_modules/csscomb/test/options/integral/integral.expected.css b/node_modules/csscomb/test/options/integral/integral.expected.css deleted file mode 100644 index f59d0a2..0000000 --- a/node_modules/csscomb/test/options/integral/integral.expected.css +++ /dev/null @@ -1,151 +0,0 @@ -/* foobar */ -@media all and (min-width:0) -{ - .radio-button_theme_normal .radio-button__radio:before - { - background: rgba(0,0,0,.4); - background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%); - background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 1px 0 rgba(0,0,0,.07); - } - - /* :after — фон */ - .radio-button_theme_normal .radio-button__radio[class^='radio']:after - { - content: 'it\'s something different'; - - background: #fff; - background: -webkit-linear-gradient(top, #fff 0,#eee 100%); - background: -moz-linear-gradient(top, #fff 0, #eee 100%); - background: -o-linear-gradient(top, #fff 0,#eee 100%); - background: linear-gradient(to bottom, #fff 0,#eee 100%); - } - - /* _focused_yes */ - .radio-button_theme_normal .radio-button__radio_focused_yes:before - { - content: 'hello'; - - -moz-box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07); - } -} - -/* Фигурные скобки. Вариант 1 */ -a, -b, -i /* foobar */ -{ - margin: 0; - padding: 0; -} -div p -{ - font-size: 1px; - - top: 0; -} -div p em -{ - font-style: italic; - - border-bottom: 1px solid red; -} - -@media all and (min-width:0) -{ - /* В нажатом состоянии смещается вниз на 1px вся кнопка, текст не смещается */ - .button_pressed_yes.button_shadow_yes - { - top: 1px; - } - - .button_pressed_yes.button_shadow_yes .button__text - { - top: 0; - } -} - -@media all /* media */ -{ - /* foobar */ - .input__control - { - font-size: 100%; - - position: relative; - z-index: 3; - - width: 100%; - margin: 0; - - color: #000; - } -} - -@media screen and (min-width: 35em) /* screen */, - print and (min-width: 40em) /* print */ -{ - /* foobar */ - .input__control - { - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: .4em 0; - - border: 0; - outline: 0; - background: none; - } -} - -/* Фигурные скобки. Вариант 2 */ -div -{ - margin: 0; - padding: 0; -} -div p -{ - font-size: 1px; - - top: 0; -} -div p em -{ - font-style: italic;/* inline comment*/ - - border-bottom: 1px solid red; -} - -/* Фигурные скобки. Вариант 3 */ -div -{ - margin: 0; - padding: 0; -} -/* foo */ div ~ p -{ - font-size: 1px; - - top: 0; -} -div > p + em -{ - /* upline comment*/ - font-style: italic; - - border-bottom: 1px solid red; /* trololo */ /* trololo */ -} - -a:not(b) -{ - top: 0;/* ololo */margin: 0; -} -b -{ - top: 0/* trololo */;margin: 0; -} diff --git a/node_modules/csscomb/test/options/integral/issue-252.expected.sass b/node_modules/csscomb/test/options/integral/issue-252.expected.sass deleted file mode 100644 index f3fb55f..0000000 --- a/node_modules/csscomb/test/options/integral/issue-252.expected.sass +++ /dev/null @@ -1,11 +0,0 @@ -.partner - font-size: 0 - - color: transparent - - +inline-block - &--motor - background-image: url('/i/partners1.png') - &--motor - background-image: url('/i/partners2.png') - diff --git a/node_modules/csscomb/test/options/integral/issue-252.sass b/node_modules/csscomb/test/options/integral/issue-252.sass deleted file mode 100644 index 6369eef..0000000 --- a/node_modules/csscomb/test/options/integral/issue-252.sass +++ /dev/null @@ -1,8 +0,0 @@ -.partner - +inline-block - font-size: 0 - color: transparent - &--motor - background-image: url('/i/partners1.png') - &--motor - background-image: url('/i/partners2.png') diff --git a/node_modules/csscomb/test/options/leading-zero.js b/node_modules/csscomb/test/options/leading-zero.js deleted file mode 100644 index dbd5c2b..0000000 --- a/node_modules/csscomb/test/options/leading-zero.js +++ /dev/null @@ -1,51 +0,0 @@ -var assert = require('assert'); - -describe('options/leading-zero', function() { - it('Should add leading zero in dimensions', function() { - this.comb.configure({ 'leading-zero': true }); - assert.equal( - this.comb.processString( - 'div { margin: .5em }' - ), - 'div { margin: 0.5em }' - ); - }); - - it('Should remove leading zero in dimensions', function() { - this.comb.configure({ 'leading-zero': false }); - assert.equal( - this.comb.processString( - 'div { margin: 0.5em }' - ), - 'div { margin: .5em }' - ); - }); - - it('Should detect leading zero option', function() { - this.shouldDetect( - ['leading-zero'], - 'a { width: 0.5em }', - { - 'leading-zero': true - } - ); - }); - - it('Should detect leading zero option set to false', function() { - this.shouldDetect( - ['leading-zero'], - 'a { width: .5em }', - { - 'leading-zero': false - } - ); - }); - - it('Shouldn’t detect leading zero option', function() { - this.shouldDetect( - ['leading-zero'], - 'a { width: 10.5em }', - {} - ); - }); -}); diff --git a/node_modules/csscomb/test/options/quotes.js b/node_modules/csscomb/test/options/quotes.js deleted file mode 100644 index 5ed3a89..0000000 --- a/node_modules/csscomb/test/options/quotes.js +++ /dev/null @@ -1,120 +0,0 @@ -var assert = require('assert'); - -describe('options/quotes', function() { - it('Invalid String should not change quotes', function() { - this.comb.configure({ quotes: 3 }); - assert.equal( - this.comb.processString( - 'a { content: "" }' + - 'b { content: \'\' }' - ), - 'a { content: "" }' + - 'b { content: \'\' }' - ); - }); - - it('`single` value should set the quotes to single', function() { - this.comb.configure({ quotes: 'single' }); - assert.equal( - this.comb.processString( - 'a { content: "" }' + - 'b { content: \'\' }' - ), - 'a { content: \'\' }' + - 'b { content: \'\' }' - ); - }); - - it('`double` value should set the quotes to double', function() { - this.comb.configure({ quotes: 'double' }); - assert.equal( - this.comb.processString( - 'a { content: "" }' + - 'b { content: \'\' }' - ), - 'a { content: "" }' + - 'b { content: "" }' - ); - }); - - it('`double` value should set the quotes to double in attrs and urls', function() { - this.comb.configure({ quotes: 'double' }); - assert.equal( - this.comb.processString( - 'a[class^=\'foo\'] { background: url(\'foo.png\') }' - ), - 'a[class^="foo"] { background: url("foo.png") }' - ); - }); - - it('`double` value should escape the unescaped double quotes on change', function() { - this.comb.configure({ quotes: 'double' }); - assert.equal( - this.comb.processString( - 'a { content: "\\"" }' + - 'b { content: \'"\' }' - ), - 'a { content: "\\"" }' + - 'b { content: "\\"" }' - ); - }); - - - it('`single` value should unescape the escaped double quotes on change', function() { - this.comb.configure({ quotes: 'single' }); - assert.equal( - this.comb.processString( - 'a { content: "\\"" }' - ), - 'a { content: \'"\' }' - ); - }); - - it('Should not detect quotes when there are none', function() { - this.shouldDetect( - ['quotes'], - 'a { color:red }', - {} - ); - }); - - it('Should detect double quotes', function() { - this.shouldDetect( - ['quotes'], - 'a { content: "foo" }', - { - quotes: 'double' - } - ); - }); - - it('Should detect single quotes', function() { - this.shouldDetect( - ['quotes'], - 'a { content: \'foo\' }', - { - quotes: 'single' - } - ); - }); - - it('Should detect single quotes in attribute', function() { - this.shouldDetect( - ['quotes'], - 'a[class^=\'foo\'] { color: red }', - { - quotes: 'single' - } - ); - }); - - it('Should detect double quotes in url', function() { - this.shouldDetect( - ['quotes'], - 'a { background: url("foo.png") }', - { - quotes: 'double' - } - ); - }); -}); diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-less.js b/node_modules/csscomb/test/options/remove-empty-rulesets-less.js deleted file mode 100644 index 8cf54fc..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-less.js +++ /dev/null @@ -1,27 +0,0 @@ -var assert = require('assert'); - -describe('options/remove-empty-rulesets (less):', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Issue 201. Test 1', function() { - this.comb.configure({ 'remove-empty-rulesets': true }); - this.shouldBeEqual('1.less', '1.expected.less'); - }); - - it('Issue 201. Test 2', function() { - this.comb.configure({ 'remove-empty-rulesets': true }); - var string = '#a {#b {} #d {}}'; - assert.equal(this.comb.processString(string, { syntax: 'less' }), ''); - }); - - it('Issue 201. Test 3', function() { - this.comb.configure({ - 'remove-empty-rulesets': false, - 'always-semicolon': true - }); - var string = '#a {#b {} #d {}}'; - assert.equal(this.comb.processString(string, { syntax: 'less' }), string); - }); -}); diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.expected.less b/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.expected.less deleted file mode 100644 index fbb7651..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.expected.less +++ /dev/null @@ -1,14 +0,0 @@ -#a { - - #b { - text-align: right; - } - - - - #d { - .e { - text-align: center; - } - } -} diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.less b/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.less deleted file mode 100644 index 6abc247..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-less/1.less +++ /dev/null @@ -1,14 +0,0 @@ -#a { - - #b { - text-align: right; - } - - #c { } - - #d { - .e { - text-align: center; - } - } -} diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss.js b/node_modules/csscomb/test/options/remove-empty-rulesets-scss.js deleted file mode 100644 index 237b0e3..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss.js +++ /dev/null @@ -1,22 +0,0 @@ -describe('options/remove-empty-rulesets (scss)', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({ 'remove-empty-rulesets': true }); - }); - - it('Should not remove rulesets which contain only includes', function() { - this.shouldBeEqual('include.scss'); - }); - - it('Should remove rulesets with contain only empty nested rules', function() { - this.shouldBeEqual('empty-nested-rule.scss', 'empty-nested-rule.expected.scss'); - }); - - it('Should not remove rulesets with non-empty nested rules. Test 1', function() { - this.shouldBeEqual('nested-rule-1.scss'); - }); - - it('Should not remove rulesets with non-empty nested rules. Test 2', function() { - this.shouldBeEqual('nested-rule-2.scss', 'nested-rule-2.expected.scss'); - }); -}); diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.expected.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.expected.scss deleted file mode 100644 index 8b13789..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.expected.scss +++ /dev/null @@ -1 +0,0 @@ - diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.scss deleted file mode 100644 index 89b0d97..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/empty-nested-rule.scss +++ /dev/null @@ -1,5 +0,0 @@ -.parent { - .child { - .grandchild { } - } -} diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/include.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/include.scss deleted file mode 100644 index 70d39a5..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/include.scss +++ /dev/null @@ -1,4 +0,0 @@ -.parent { - @include mix-all; - @include mix-top; -} diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-1.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-1.scss deleted file mode 100644 index f69f70a..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-1.scss +++ /dev/null @@ -1,6 +0,0 @@ -.parent { - .child { - @include mix-all; - @include mix-top; - } -} diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.expected.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.expected.scss deleted file mode 100644 index b020e30..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.expected.scss +++ /dev/null @@ -1,7 +0,0 @@ -.parent { - .child1 { - @include mix-all; - @include mix-top; - } - -} diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.scss b/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.scss deleted file mode 100644 index f5eedd4..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets-scss/nested-rule-2.scss +++ /dev/null @@ -1,9 +0,0 @@ -.parent { - .child1 { - @include mix-all; - @include mix-top; - } - .child2 { - .grandchild { } - } -} diff --git a/node_modules/csscomb/test/options/remove-empty-rulesets.js b/node_modules/csscomb/test/options/remove-empty-rulesets.js deleted file mode 100644 index a516227..0000000 --- a/node_modules/csscomb/test/options/remove-empty-rulesets.js +++ /dev/null @@ -1,112 +0,0 @@ -var assert = require('assert'); - -describe('options/remove-empty-rulesets', function() { - it('Configured with invalid value, should not remove empty ruleset', function() { - this.comb.configure({ 'remove-empty-rulesets': 'foobar' }); - assert.equal(this.comb.processString('a { width: 10px; } b {}'), 'a { width: 10px; } b {}'); - }); - - describe('configured with Boolean "true" value', function() { - beforeEach(function() { - this.comb.configure({ 'remove-empty-rulesets': true }); - }); - - it('should remove empty ruleset', function() { - assert.equal(this.comb.processString(' b {} '), ' '); - }); - - it('should remove ruleset with spaces', function() { - assert.equal(this.comb.processString(' b { } '), ' '); - }); - - it('should leave ruleset with declarations', function() { - assert.equal(this.comb.processString('a { width: 10px; }\nb {} '), 'a { width: 10px; }\n '); - }); - - it('should leave ruleset with comments', function() { - assert.equal(this.comb.processString('a { /* comment */ }\nb {} '), 'a { /* comment */ }\n '); - }); - }); - - describe('detecting the value', function() { - it('Should detect this option set to `true`', function() { - this.shouldDetect( - ['remove-empty-rulesets'], - 'a { color: red }', - { - 'remove-empty-rulesets': true - } - ); - }); - - it('Should detect this option set to `false` with empty block', function() { - this.shouldDetect( - ['remove-empty-rulesets'], - 'a {}', - { - 'remove-empty-rulesets': false - } - ); - }); - - it('Should detect this option set to `false` with block containing whitespace', function() { - this.shouldDetect( - ['remove-empty-rulesets'], - 'a { }', - { - 'remove-empty-rulesets': false - } - ); - }); - - it('Should detect this option set to `true` with block containing comment', function() { - this.shouldDetect( - ['remove-empty-rulesets'], - 'a { /* Hello */ }', - { - 'remove-empty-rulesets': true - } - ); - }); - - it('Should detect this option set to `true` with media query containing block', function() { - this.shouldDetect( - ['remove-empty-rulesets'], - '@media all and (min-width:0) { a { /* Hello */ } }', - { - 'remove-empty-rulesets': true - } - ); - }); - - it('Should detect this option set to `true` with media query containing comment', function() { - this.shouldDetect( - ['remove-empty-rulesets'], - '@media all and (min-width:0) {/* Hello */}', - { - 'remove-empty-rulesets': true - } - ); - }); - - it('Should detect this option set to `false` with empty media query', function() { - this.shouldDetect( - ['remove-empty-rulesets'], - '@media all and (min-width:0) {}', - { - 'remove-empty-rulesets': false - } - ); - }); - - it('Should detect this option set to `false` with media query containing whitespace', function() { - this.shouldDetect( - ['remove-empty-rulesets'], - '@media all and (min-width:0) { \n }', - { - 'remove-empty-rulesets': false - } - ); - }); - }); -}); diff --git a/node_modules/csscomb/test/options/sass.js b/node_modules/csscomb/test/options/sass.js deleted file mode 100644 index 1593c33..0000000 --- a/node_modules/csscomb/test/options/sass.js +++ /dev/null @@ -1,108 +0,0 @@ -describe('Sass', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({}); - }); - - it('Should parse nested rules', function() { - this.shouldBeEqual('nested-rule.sass'); - }); - - it('Should parse parent selector &', function() { - this.shouldBeEqual('parent-selector.sass'); - }); - - it('Should parse nested properties', function() { - this.shouldBeEqual('nested-property.sass'); - }); - - it('Should parse variables', function() { - this.shouldBeEqual('variable.sass'); - }); - - it('Should parse interpolated variables inside selectors', function() { - this.shouldBeEqual('interpolated-variable-1.sass'); - }); - - it('Should parse interpolated variables inside values', function() { - this.shouldBeEqual('interpolated-variable-2.sass'); - }); - - it('Should parse defaults', function() { - this.shouldBeEqual('default.sass'); - }); - - it('Should parse @import', function() { - this.shouldBeEqual('import.sass'); - }); - - it('Should parse @include', function() { - this.shouldBeEqual('include.sass'); - }); - - it('Should parse nested @media', function() { - this.shouldBeEqual('nested-media.sass'); - }); - - it('Should parse @extend with classes', function() { - this.shouldBeEqual('extend-1.sass'); - }); - - it('Should parse @extend with placeholders', function() { - this.shouldBeEqual('extend-2.sass'); - }); - - it('Should parse @warn', function() { - this.shouldBeEqual('warn.sass'); - }); - - it('Should parse @if', function() { - this.shouldBeEqual('if.sass'); - }); - - it('Should parse @if and @else', function() { - this.shouldBeEqual('if-else.sass'); - }); - - it('Should parse @if and @else if', function() { - this.shouldBeEqual('if-else-if.sass'); - }); - - it('Should parse @for', function() { - this.shouldBeEqual('for.sass'); - }); - - it('Should parse @each', function() { - this.shouldBeEqual('each.sass'); - }); - - it('Should parse @while', function() { - this.shouldBeEqual('while.sass'); - }); - - it('Should parse mixins', function() { - this.shouldBeEqual('mixin-1.sass'); - }); - - it('Should parse passing several variables to a mixin', function() { - this.shouldBeEqual('mixin-2.sass'); - }); - - it('Should parse passing a list of variables to a mixin', function() { - this.shouldBeEqual('mixin-3.sass'); - }); - - it('Should parse passing a content block to a mixin', function() { - this.shouldBeEqual('mixin-4.sass'); - }); - - it('Should parse @content', function() { - this.shouldBeEqual('content.sass'); - }); - - it('Should parse functions', function() { - this.shouldBeEqual('function.sass'); - }); -}); - - diff --git a/node_modules/csscomb/test/options/sass/content.sass b/node_modules/csscomb/test/options/sass/content.sass deleted file mode 100644 index e1bb2b9..0000000 --- a/node_modules/csscomb/test/options/sass/content.sass +++ /dev/null @@ -1,3 +0,0 @@ -@mixin nani - a - @content diff --git a/node_modules/csscomb/test/options/sass/default.sass b/node_modules/csscomb/test/options/sass/default.sass deleted file mode 100644 index 3c10834..0000000 --- a/node_modules/csscomb/test/options/sass/default.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - $color: tomato !default - top: 0 diff --git a/node_modules/csscomb/test/options/sass/each.sass b/node_modules/csscomb/test/options/sass/each.sass deleted file mode 100644 index 477c5de..0000000 --- a/node_modules/csscomb/test/options/sass/each.sass +++ /dev/null @@ -1,4 +0,0 @@ -div - @each $animal in puma, sea-slug, erget - .#{$animal}-icon - background-image: url("/images/#{$animal}.png") diff --git a/node_modules/csscomb/test/options/sass/extend-1.sass b/node_modules/csscomb/test/options/sass/extend-1.sass deleted file mode 100644 index ef4beac..0000000 --- a/node_modules/csscomb/test/options/sass/extend-1.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - @extend .nani - top: 0 diff --git a/node_modules/csscomb/test/options/sass/extend-2.sass b/node_modules/csscomb/test/options/sass/extend-2.sass deleted file mode 100644 index 8da2b0d..0000000 --- a/node_modules/csscomb/test/options/sass/extend-2.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - @extend %nani - top: 0 diff --git a/node_modules/csscomb/test/options/sass/for.sass b/node_modules/csscomb/test/options/sass/for.sass deleted file mode 100644 index 9449c47..0000000 --- a/node_modules/csscomb/test/options/sass/for.sass +++ /dev/null @@ -1,4 +0,0 @@ -div - @for $i from 1 through 3 - .item-#{$i} - width: 2em * 1 diff --git a/node_modules/csscomb/test/options/sass/function.sass b/node_modules/csscomb/test/options/sass/function.sass deleted file mode 100644 index 33901cb..0000000 --- a/node_modules/csscomb/test/options/sass/function.sass +++ /dev/null @@ -1,2 +0,0 @@ -@function nani($n) - @return $n * 2 diff --git a/node_modules/csscomb/test/options/sass/if-else-if.sass b/node_modules/csscomb/test/options/sass/if-else-if.sass deleted file mode 100644 index 91648b8..0000000 --- a/node_modules/csscomb/test/options/sass/if-else-if.sass +++ /dev/null @@ -1,5 +0,0 @@ -div - @if $type == ocean - top: 0 - @else if $type == monster - left: 0 diff --git a/node_modules/csscomb/test/options/sass/if-else.sass b/node_modules/csscomb/test/options/sass/if-else.sass deleted file mode 100644 index 2863d4d..0000000 --- a/node_modules/csscomb/test/options/sass/if-else.sass +++ /dev/null @@ -1,5 +0,0 @@ -div - @if $type == ocean - top: 0 - @else - left: 0 diff --git a/node_modules/csscomb/test/options/sass/if.sass b/node_modules/csscomb/test/options/sass/if.sass deleted file mode 100644 index ab29f15..0000000 --- a/node_modules/csscomb/test/options/sass/if.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - @if $type == ocean - top: 0 diff --git a/node_modules/csscomb/test/options/sass/import.sass b/node_modules/csscomb/test/options/sass/import.sass deleted file mode 100644 index ed47208..0000000 --- a/node_modules/csscomb/test/options/sass/import.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - @import "foo.css" - top: 0 diff --git a/node_modules/csscomb/test/options/sass/include.sass b/node_modules/csscomb/test/options/sass/include.sass deleted file mode 100644 index 3b753a7..0000000 --- a/node_modules/csscomb/test/options/sass/include.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - @include nani($panda) - top: 0 diff --git a/node_modules/csscomb/test/options/sass/interpolated-variable-1.sass b/node_modules/csscomb/test/options/sass/interpolated-variable-1.sass deleted file mode 100644 index 3ba50e5..0000000 --- a/node_modules/csscomb/test/options/sass/interpolated-variable-1.sass +++ /dev/null @@ -1,3 +0,0 @@ -div.#{$nani} - color: tomato - top:0 diff --git a/node_modules/csscomb/test/options/sass/interpolated-variable-2.sass b/node_modules/csscomb/test/options/sass/interpolated-variable-2.sass deleted file mode 100644 index 3f134b4..0000000 --- a/node_modules/csscomb/test/options/sass/interpolated-variable-2.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - color: #{$tomato} - top: 0 diff --git a/node_modules/csscomb/test/options/sass/mixin-1.sass b/node_modules/csscomb/test/options/sass/mixin-1.sass deleted file mode 100644 index f633d80..0000000 --- a/node_modules/csscomb/test/options/sass/mixin-1.sass +++ /dev/null @@ -1,4 +0,0 @@ -@mixin nani - color: tomato -.foo - @include nani diff --git a/node_modules/csscomb/test/options/sass/mixin-2.sass b/node_modules/csscomb/test/options/sass/mixin-2.sass deleted file mode 100644 index 0e3513e..0000000 --- a/node_modules/csscomb/test/options/sass/mixin-2.sass +++ /dev/null @@ -1,4 +0,0 @@ -@mixin nani($tomato) - color: $tomato -.foo - @include nani(red) diff --git a/node_modules/csscomb/test/options/sass/mixin-3.sass b/node_modules/csscomb/test/options/sass/mixin-3.sass deleted file mode 100644 index cf20ed5..0000000 --- a/node_modules/csscomb/test/options/sass/mixin-3.sass +++ /dev/null @@ -1,4 +0,0 @@ -@mixin nani($shadows...) - box-shadow: $shadows -.foo - @include nani(0px 4px 5px #666, 2px 6px 10px #999) diff --git a/node_modules/csscomb/test/options/sass/mixin-4.sass b/node_modules/csscomb/test/options/sass/mixin-4.sass deleted file mode 100644 index d22987c..0000000 --- a/node_modules/csscomb/test/options/sass/mixin-4.sass +++ /dev/null @@ -1,4 +0,0 @@ -.foo - @include nani - color: tomato - top: 0 diff --git a/node_modules/csscomb/test/options/sass/nested-media.sass b/node_modules/csscomb/test/options/sass/nested-media.sass deleted file mode 100644 index 244755f..0000000 --- a/node_modules/csscomb/test/options/sass/nested-media.sass +++ /dev/null @@ -1,4 +0,0 @@ -div - @media screen and (orientation: landscape) - color: tomato - top: 0 diff --git a/node_modules/csscomb/test/options/sass/nested-property.sass b/node_modules/csscomb/test/options/sass/nested-property.sass deleted file mode 100644 index 84af654..0000000 --- a/node_modules/csscomb/test/options/sass/nested-property.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - color: tomato - font: 2px/3px - family: fantasy - size: 30em - left: 0 diff --git a/node_modules/csscomb/test/options/sass/nested-rule.sass b/node_modules/csscomb/test/options/sass/nested-rule.sass deleted file mode 100644 index 8e90913..0000000 --- a/node_modules/csscomb/test/options/sass/nested-rule.sass +++ /dev/null @@ -1,4 +0,0 @@ -div - color: tomato - a - top: 0 diff --git a/node_modules/csscomb/test/options/sass/parent-selector.sass b/node_modules/csscomb/test/options/sass/parent-selector.sass deleted file mode 100644 index 388fecd..0000000 --- a/node_modules/csscomb/test/options/sass/parent-selector.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - color: tomato - &.top - color: nani - top: 0 - left: 0 diff --git a/node_modules/csscomb/test/options/sass/variable.sass b/node_modules/csscomb/test/options/sass/variable.sass deleted file mode 100644 index 24f437d..0000000 --- a/node_modules/csscomb/test/options/sass/variable.sass +++ /dev/null @@ -1,3 +0,0 @@ -$red: tomato -div - color: $tomato diff --git a/node_modules/csscomb/test/options/sass/warn.sass b/node_modules/csscomb/test/options/sass/warn.sass deleted file mode 100644 index ebf821b..0000000 --- a/node_modules/csscomb/test/options/sass/warn.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - @warn "nani" - top: 0 diff --git a/node_modules/csscomb/test/options/sass/while.sass b/node_modules/csscomb/test/options/sass/while.sass deleted file mode 100644 index 8b07b31..0000000 --- a/node_modules/csscomb/test/options/sass/while.sass +++ /dev/null @@ -1,5 +0,0 @@ -div - @while $i > 6 - .item - width: 2em * $i - $i: $i - 2 diff --git a/node_modules/csscomb/test/options/sort-order-fallback.js b/node_modules/csscomb/test/options/sort-order-fallback.js deleted file mode 100644 index 418fcfd..0000000 --- a/node_modules/csscomb/test/options/sort-order-fallback.js +++ /dev/null @@ -1,36 +0,0 @@ -describe('options/sort-order-fallback', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should sort leftovers alphabetically if `sort-order-fallback` is set', function() { - var config = { - 'sort-order-fallback': 'abc', - 'sort-order': [ - ['top', 'left'], - ['...'], - ['color'] - ] - }; - this.comb.configure(config); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Should sort unknown properties alphabetically if `sort-order-fallback` is set', function() { - var config = { - 'sort-order-fallback': 'abc', - 'sort-order': ['top', 'left'] - }; - this.comb.configure(config); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Should leave leftovers as is if `sort-order-fallback` is not set', function() { - var config = { - 'sort-order': ['top', 'left'] - }; - this.comb.configure(config); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); -}); - diff --git a/node_modules/csscomb/test/options/sort-order-fallback/test-2.expected.css b/node_modules/csscomb/test/options/sort-order-fallback/test-2.expected.css deleted file mode 100644 index dd35868..0000000 --- a/node_modules/csscomb/test/options/sort-order-fallback/test-2.expected.css +++ /dev/null @@ -1,11 +0,0 @@ -a { - top: 0; - left: 0; - - -moz-color: zebra; - color: tomato; - -webkit-float: left; - float: right; - font-size: 1em; - position: absolute; - } diff --git a/node_modules/csscomb/test/options/sort-order-fallback/test-3.expected.css b/node_modules/csscomb/test/options/sort-order-fallback/test-3.expected.css deleted file mode 100644 index 8e31298..0000000 --- a/node_modules/csscomb/test/options/sort-order-fallback/test-3.expected.css +++ /dev/null @@ -1,11 +0,0 @@ -a { - top: 0; - left: 0; - - color: tomato; - font-size: 1em; - position: absolute; - -webkit-float: left; - -moz-color: zebra; - float: right; - } diff --git a/node_modules/csscomb/test/options/sort-order-fallback/test.css b/node_modules/csscomb/test/options/sort-order-fallback/test.css deleted file mode 100644 index d57de84..0000000 --- a/node_modules/csscomb/test/options/sort-order-fallback/test.css +++ /dev/null @@ -1,10 +0,0 @@ -a { - color: tomato; - font-size: 1em; - top: 0; - position: absolute; - left: 0; - -webkit-float: left; - -moz-color: zebra; - float: right; - } diff --git a/node_modules/csscomb/test/options/sort-order-fallback/test.expected.css b/node_modules/csscomb/test/options/sort-order-fallback/test.expected.css deleted file mode 100644 index ec1c2a8..0000000 --- a/node_modules/csscomb/test/options/sort-order-fallback/test.expected.css +++ /dev/null @@ -1,12 +0,0 @@ -a { - top: 0; - left: 0; - - -moz-color: zebra; - -webkit-float: left; - float: right; - font-size: 1em; - position: absolute; - - color: tomato; - } diff --git a/node_modules/csscomb/test/options/sort-order-less.js b/node_modules/csscomb/test/options/sort-order-less.js deleted file mode 100644 index f0c36a5..0000000 --- a/node_modules/csscomb/test/options/sort-order-less.js +++ /dev/null @@ -1,96 +0,0 @@ -describe('options/sort-order (less)', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should sort properties inside rules', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('rule.less', 'rule.expected.less'); - }); - - it('Should sort properties inside nested rules', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('nested-rule-1.less', 'nested-rule-1.expected.less'); - }); - - it('Should sort properties divided by nested rules', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'left', 'color'] - ] }); - this.shouldBeEqual('nested-rule-2.less', 'nested-rule-2.expected.less'); - }); - - it('Should group declarations with proper comments and spaces (single line)', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('comments-1.less', 'comments-1.expected.less'); - }); - - it('Should group declarations with proper comments and spaces (multiple lines). Test 1', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('comments-2.less', 'comments-2.expected.less'); - }); - - it('Should group declarations with proper comments and spaces (multiple lines). Test 2', function() { - this.comb.configure({ 'sort-order': [ - ['$variable', 'color'] - ] }); - this.shouldBeEqual('comments-3.less', 'comments-3.expected.less'); - }); - - it('Should group declarations with proper comments and spaces (multiple lines). Test 3', function() { - this.comb.configure({ 'sort-order': [ - ['$variable', 'color'] - ] }); - this.shouldBeEqual('comments-3.less', 'comments-3.expected.less'); - }); - - it('Should divide properties from different groups with an empty line', function() { - this.comb.configure({ 'sort-order': [ - ['top'], ['color'] - ] }); - this.shouldBeEqual('different-groups.less', 'different-groups.expected.less'); - }); - - it('Should sort variables', function() { - this.comb.configure({ 'sort-order': [ - ['$variable', 'color'] - ] }); - this.shouldBeEqual('variable.less', 'variable.expected.less'); - }); - - it('Should sort imports', function() { - this.comb.configure({ 'sort-order': [ - ['$import', 'color'] - ] }); - this.shouldBeEqual('import.less', 'import.expected.less'); - }); - - it('Should sort included mixins. Test 1', function() { - this.comb.configure({ 'sort-order': [ - ['$include', 'color', 'border-top', 'border-bottom'] - ] }); - this.shouldBeEqual('mixin-1.less', 'mixin-1.expected.less'); - }); - - it('Should sort included mixins. Test 2', function() { - this.comb.configure({ 'sort-order': [ - ['$include', 'top', 'color'] - ] }); - this.shouldBeEqual('mixin-2.less', 'mixin-2.expected.less'); - }); - - it('Should sort included mixins. Test 3', function() { - this.comb.configure({ 'sort-order': [ - ['$include', 'border', 'color'] - ] }); - this.shouldBeEqual('mixin-3.less', 'mixin-3.expected.less'); - }); -}); diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-1.expected.less b/node_modules/csscomb/test/options/sort-order-less/comments-1.expected.less deleted file mode 100644 index a9b2976..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/comments-1.expected.less +++ /dev/null @@ -1 +0,0 @@ -div {top: 0; /* 3 */ /* 4 *//* 1 */ color: tomato; /* 2 */ } diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-1.less b/node_modules/csscomb/test/options/sort-order-less/comments-1.less deleted file mode 100644 index 617d4fd..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/comments-1.less +++ /dev/null @@ -1 +0,0 @@ -div {/* 1 */ color: tomato; /* 2 */ top: 0; /* 3 */ /* 4 */} diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-2.expected.less b/node_modules/csscomb/test/options/sort-order-less/comments-2.expected.less deleted file mode 100644 index 0aa257a..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/comments-2.expected.less +++ /dev/null @@ -1,7 +0,0 @@ -div { - /* 2 */ - /* 3 */ - top: 0; /* 4 */ - color: tomato; /* 1 */ - /* 5 */ -} diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-2.less b/node_modules/csscomb/test/options/sort-order-less/comments-2.less deleted file mode 100644 index 18e6319..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/comments-2.less +++ /dev/null @@ -1,7 +0,0 @@ -div { - color: tomato; /* 1 */ - /* 2 */ - /* 3 */ - top: 0; /* 4 */ - /* 5 */ -} diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-3.expected.less b/node_modules/csscomb/test/options/sort-order-less/comments-3.expected.less deleted file mode 100644 index 7bf0938..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/comments-3.expected.less +++ /dev/null @@ -1,6 +0,0 @@ -p { - // Get in line! - @var: white; - /* One hell of a comment */ - color: tomato; -} diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-3.less b/node_modules/csscomb/test/options/sort-order-less/comments-3.less deleted file mode 100644 index c7f0a84..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/comments-3.less +++ /dev/null @@ -1,6 +0,0 @@ -p { - /* One hell of a comment */ - color: tomato; - // Get in line! - @var: white; -} diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-4.expected.less b/node_modules/csscomb/test/options/sort-order-less/comments-4.expected.less deleted file mode 100644 index 349b770..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/comments-4.expected.less +++ /dev/null @@ -1,4 +0,0 @@ -p { - @var: white; // Get in line! - color: tomato; /* One hell of a comment */ - } diff --git a/node_modules/csscomb/test/options/sort-order-less/comments-4.less b/node_modules/csscomb/test/options/sort-order-less/comments-4.less deleted file mode 100644 index b1db838..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/comments-4.less +++ /dev/null @@ -1,4 +0,0 @@ -p { - color: tomato; /* One hell of a comment */ - @var: white; // Get in line! - } diff --git a/node_modules/csscomb/test/options/sort-order-less/different-groups.expected.less b/node_modules/csscomb/test/options/sort-order-less/different-groups.expected.less deleted file mode 100644 index dddc16f..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/different-groups.expected.less +++ /dev/null @@ -1,5 +0,0 @@ -div { - top: 0; - - color: tomato; -} diff --git a/node_modules/csscomb/test/options/sort-order-less/different-groups.less b/node_modules/csscomb/test/options/sort-order-less/different-groups.less deleted file mode 100644 index 7ffa908..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/different-groups.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - top: 0; -} diff --git a/node_modules/csscomb/test/options/sort-order-less/import.expected.less b/node_modules/csscomb/test/options/sort-order-less/import.expected.less deleted file mode 100644 index 9c403df..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/import.expected.less +++ /dev/null @@ -1 +0,0 @@ -div {@import "foo.css"; color: tomato; } diff --git a/node_modules/csscomb/test/options/sort-order-less/import.less b/node_modules/csscomb/test/options/sort-order-less/import.less deleted file mode 100644 index 681ccd0..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/import.less +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @import "foo.css"; } diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-1.expected.less b/node_modules/csscomb/test/options/sort-order-less/mixin-1.expected.less deleted file mode 100644 index 11ac5fa..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/mixin-1.expected.less +++ /dev/null @@ -1,12 +0,0 @@ -.bordered { - border-top: dotted 1px black; - border-bottom: solid 2px black; -} -#menu a { - .bordered; - color: #111; - } -.post a { - .bordered; - color: red; - } diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-1.less b/node_modules/csscomb/test/options/sort-order-less/mixin-1.less deleted file mode 100644 index e5d5ad0..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/mixin-1.less +++ /dev/null @@ -1,12 +0,0 @@ -.bordered { - border-bottom: solid 2px black; - border-top: dotted 1px black; -} -#menu a { - color: #111; - .bordered; - } -.post a { - color: red; - .bordered; - } diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-2.expected.less b/node_modules/csscomb/test/options/sort-order-less/mixin-2.expected.less deleted file mode 100644 index 1535db1..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/mixin-2.expected.less +++ /dev/null @@ -1,6 +0,0 @@ -.test { - .test1(); - .test2(); - top: 0; - color: tomato; - } diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-2.less b/node_modules/csscomb/test/options/sort-order-less/mixin-2.less deleted file mode 100644 index cbd0c8e..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/mixin-2.less +++ /dev/null @@ -1,6 +0,0 @@ -.test { - .test1(); - color: tomato; - .test2(); - top: 0; - } diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-3.expected.less b/node_modules/csscomb/test/options/sort-order-less/mixin-3.expected.less deleted file mode 100644 index 0e4c018..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/mixin-3.expected.less +++ /dev/null @@ -1,5 +0,0 @@ -.foo { - .linear-gradient(#fff; #000); - border: 1px solid #f00; - color: #0f0; -} diff --git a/node_modules/csscomb/test/options/sort-order-less/mixin-3.less b/node_modules/csscomb/test/options/sort-order-less/mixin-3.less deleted file mode 100644 index fce214a..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/mixin-3.less +++ /dev/null @@ -1,5 +0,0 @@ -.foo { - color: #0f0; - border: 1px solid #f00; - .linear-gradient(#fff; #000); -} diff --git a/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.expected.less b/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.expected.less deleted file mode 100644 index e85581f..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.expected.less +++ /dev/null @@ -1,6 +0,0 @@ -div { - color: tomato; a { - top: 0; - color: nani; - } -} diff --git a/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.less b/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.less deleted file mode 100644 index af11594..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/nested-rule-1.less +++ /dev/null @@ -1,6 +0,0 @@ -div { - color: tomato; a { - color: nani; - top: 0; - } -} diff --git a/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.expected.less b/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.expected.less deleted file mode 100644 index 30c8b65..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.expected.less +++ /dev/null @@ -1,7 +0,0 @@ -div { - left: 0; - color: tomato; a { - top: 0; - color: nani; - } -} diff --git a/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.less b/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.less deleted file mode 100644 index 52df599..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/nested-rule-2.less +++ /dev/null @@ -1,7 +0,0 @@ -div { - color: tomato; a { - color: nani; - top: 0; - } - left: 0; -} diff --git a/node_modules/csscomb/test/options/sort-order-less/rule.expected.less b/node_modules/csscomb/test/options/sort-order-less/rule.expected.less deleted file mode 100644 index 918bd37..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/rule.expected.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - top: 0; - color: tomato; -} diff --git a/node_modules/csscomb/test/options/sort-order-less/rule.less b/node_modules/csscomb/test/options/sort-order-less/rule.less deleted file mode 100644 index 7ffa908..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/rule.less +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - top: 0; -} diff --git a/node_modules/csscomb/test/options/sort-order-less/variable.expected.less b/node_modules/csscomb/test/options/sort-order-less/variable.expected.less deleted file mode 100644 index e391754..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/variable.expected.less +++ /dev/null @@ -1 +0,0 @@ -div {@red: tomato; color: @red; } diff --git a/node_modules/csscomb/test/options/sort-order-less/variable.less b/node_modules/csscomb/test/options/sort-order-less/variable.less deleted file mode 100644 index 5c6756b..0000000 --- a/node_modules/csscomb/test/options/sort-order-less/variable.less +++ /dev/null @@ -1 +0,0 @@ -div { color: @red; @red: tomato; } diff --git a/node_modules/csscomb/test/options/sort-order-sass.js b/node_modules/csscomb/test/options/sort-order-sass.js deleted file mode 100644 index d6997e5..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass.js +++ /dev/null @@ -1,89 +0,0 @@ -describe('options/sort-order (sass)', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should sort properties inside rules', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('rule.sass', 'rule.expected.sass'); - }); - - it('Should sort properties inside nested rules', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('nested-rule-1.sass', 'nested-rule-1.expected.sass'); - }); - - it('Should sort properties divided by nested rules', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'left', 'color'] - ] }); - this.shouldBeEqual('nested-rule-2.sass', 'nested-rule-2.expected.sass'); - }); - - it('Should group declarations with proper comments and spaces (multiple lines)', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('comments.sass', 'comments.expected.sass'); - }); - - it('Should divide properties from different groups with an empty line', function() { - this.comb.configure({ 'sort-order': [ - ['top'], ['color'] - ] }); - this.shouldBeEqual('different-groups.sass', 'different-groups.expected.sass'); - }); - - it('Should sort variables', function() { - this.comb.configure({ 'sort-order': [ - ['$variable', 'color'] - ] }); - this.shouldBeEqual('variable.sass', 'variable.expected.sass'); - }); - - it('Should sort imports', function() { - this.comb.configure({ 'sort-order': [ - ['$import', 'color'] - ] }); - this.shouldBeEqual('import.sass', 'import.expected.sass'); - }); - - it('Should sort @include-s', function() { - this.comb.configure({ 'sort-order': [ - ['$include', 'color'] - ] }); - this.shouldBeEqual('include.sass', 'include.expected.sass'); - }); - - it('Should sort @extend-s', function() { - this.comb.configure({ 'sort-order': [ - ['$include', 'color'] - ] }); - this.shouldBeEqual('extend.sass', 'extend.expected.sass'); - }); - - it('Should sort properties inside blocks passed to mixins', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('mixin.sass', 'mixin.expected.sass'); - }); - - it('Should handle properties preceeding rulesets', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'left', 'color'] - ] }); - this.shouldBeEqual('ruleset.sass', 'ruleset.expected.sass'); - }); - - it('Should handle properties preceeding conditions', function() { - this.comb.configure({ 'sort-order': [ - ['font-size', 'display', 'top', 'color'] - ] }); - this.shouldBeEqual('condition.sass', 'condition.expected.sass'); - }); -}); diff --git a/node_modules/csscomb/test/options/sort-order-sass/comments.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/comments.expected.sass deleted file mode 100644 index a798642..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/comments.expected.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - /* 2 */ - /* 3 */ - top: 0 // 4 - color: tomato // 1 - /* 5 */ diff --git a/node_modules/csscomb/test/options/sort-order-sass/comments.sass b/node_modules/csscomb/test/options/sort-order-sass/comments.sass deleted file mode 100644 index 5f3f7cc..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/comments.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - color: tomato // 1 - /* 2 */ - /* 3 */ - top: 0 // 4 - /* 5 */ diff --git a/node_modules/csscomb/test/options/sort-order-sass/condition.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/condition.expected.sass deleted file mode 100644 index 8ffeb9f..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/condition.expected.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - top: 0 - color: tomato - @if $color == tomato - font-size: 2px - display: block diff --git a/node_modules/csscomb/test/options/sort-order-sass/condition.sass b/node_modules/csscomb/test/options/sort-order-sass/condition.sass deleted file mode 100644 index 66379ee..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/condition.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - color: tomato - @if $color == tomato - display: block - font-size: 2px - top: 0 diff --git a/node_modules/csscomb/test/options/sort-order-sass/different-groups.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/different-groups.expected.sass deleted file mode 100644 index 2ffd199..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/different-groups.expected.sass +++ /dev/null @@ -1,4 +0,0 @@ -div - top: 0 - - color: tomato diff --git a/node_modules/csscomb/test/options/sort-order-sass/different-groups.sass b/node_modules/csscomb/test/options/sort-order-sass/different-groups.sass deleted file mode 100644 index 6d835e2..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/different-groups.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - color: tomato - top: 0 diff --git a/node_modules/csscomb/test/options/sort-order-sass/extend.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/extend.expected.sass deleted file mode 100644 index a0ba2c9..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/extend.expected.sass +++ /dev/null @@ -1,3 +0,0 @@ - div - @extend %nani - color: tomato diff --git a/node_modules/csscomb/test/options/sort-order-sass/extend.sass b/node_modules/csscomb/test/options/sort-order-sass/extend.sass deleted file mode 100644 index fe9c177..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/extend.sass +++ /dev/null @@ -1,3 +0,0 @@ - div - color: tomato - @extend %nani diff --git a/node_modules/csscomb/test/options/sort-order-sass/import.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/import.expected.sass deleted file mode 100644 index f1f2c6a..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/import.expected.sass +++ /dev/null @@ -1,3 +0,0 @@ - div - @import "foo.css" - color: tomato diff --git a/node_modules/csscomb/test/options/sort-order-sass/import.sass b/node_modules/csscomb/test/options/sort-order-sass/import.sass deleted file mode 100644 index 659f76e..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/import.sass +++ /dev/null @@ -1,3 +0,0 @@ - div - color: tomato - @import "foo.css" diff --git a/node_modules/csscomb/test/options/sort-order-sass/include.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/include.expected.sass deleted file mode 100644 index f7a50a7..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/include.expected.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - @include .nani - color: tomato diff --git a/node_modules/csscomb/test/options/sort-order-sass/include.sass b/node_modules/csscomb/test/options/sort-order-sass/include.sass deleted file mode 100644 index 9c7ac8b..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/include.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - color: tomato - @include .nani diff --git a/node_modules/csscomb/test/options/sort-order-sass/mixin.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/mixin.expected.sass deleted file mode 100644 index e441062..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/mixin.expected.sass +++ /dev/null @@ -1,4 +0,0 @@ -.foo - @include nani - top: 0 - color: tomato diff --git a/node_modules/csscomb/test/options/sort-order-sass/mixin.sass b/node_modules/csscomb/test/options/sort-order-sass/mixin.sass deleted file mode 100644 index d22987c..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/mixin.sass +++ /dev/null @@ -1,4 +0,0 @@ -.foo - @include nani - color: tomato - top: 0 diff --git a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.expected.sass deleted file mode 100644 index 101521f..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.expected.sass +++ /dev/null @@ -1,5 +0,0 @@ -div - color: tomato - a - top: 0 - color: nani diff --git a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.sass b/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.sass deleted file mode 100644 index 3394a7c..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-1.sass +++ /dev/null @@ -1,5 +0,0 @@ -div - color: tomato - a - color: nani - top: 0 diff --git a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.expected.sass deleted file mode 100644 index 54a0fb8..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.expected.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - left: 0 - color: tomato - a - top: 0 - color: nani diff --git a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.sass b/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.sass deleted file mode 100644 index 9815840..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/nested-rule-2.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - color: tomato - a - color: nani - top: 0 - left: 0 diff --git a/node_modules/csscomb/test/options/sort-order-sass/rule.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/rule.expected.sass deleted file mode 100644 index c6e1f54..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/rule.expected.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - top: 0 - color: tomato diff --git a/node_modules/csscomb/test/options/sort-order-sass/rule.sass b/node_modules/csscomb/test/options/sort-order-sass/rule.sass deleted file mode 100644 index 6d835e2..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/rule.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - color: tomato - top: 0 diff --git a/node_modules/csscomb/test/options/sort-order-sass/ruleset.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/ruleset.expected.sass deleted file mode 100644 index 54a0fb8..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/ruleset.expected.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - left: 0 - color: tomato - a - top: 0 - color: nani diff --git a/node_modules/csscomb/test/options/sort-order-sass/ruleset.sass b/node_modules/csscomb/test/options/sort-order-sass/ruleset.sass deleted file mode 100644 index 9815840..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/ruleset.sass +++ /dev/null @@ -1,6 +0,0 @@ -div - color: tomato - a - color: nani - top: 0 - left: 0 diff --git a/node_modules/csscomb/test/options/sort-order-sass/variable.expected.sass b/node_modules/csscomb/test/options/sort-order-sass/variable.expected.sass deleted file mode 100644 index c7c3634..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/variable.expected.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - $red: tomato - color: $tomato diff --git a/node_modules/csscomb/test/options/sort-order-sass/variable.sass b/node_modules/csscomb/test/options/sort-order-sass/variable.sass deleted file mode 100644 index 31bc5a3..0000000 --- a/node_modules/csscomb/test/options/sort-order-sass/variable.sass +++ /dev/null @@ -1,3 +0,0 @@ -div - color: $tomato - $red: tomato diff --git a/node_modules/csscomb/test/options/sort-order-scss.js b/node_modules/csscomb/test/options/sort-order-scss.js deleted file mode 100644 index 517724d..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss.js +++ /dev/null @@ -1,116 +0,0 @@ -describe('options/sort-order (scss)', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should sort properties inside rules (single line)', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('rule.scss', 'rule.expected.scss'); - }); - - it('Should sort properties inside rules (multiple lines)', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('rule.scss', 'rule.expected.scss'); - }); - - it('Should sort properties inside nested rules', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('nested-rule-1.scss', 'nested-rule-1.expected.scss'); - }); - - it('Should sort properties divided by nested rules', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'left', 'color'] - ] }); - this.shouldBeEqual('nested-rule-2.scss', 'nested-rule-2.expected.scss'); - }); - - it('Should group declarations with proper comments and spaces (multiple lines)', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('comments-1.scss', 'comments-1.expected.scss'); - }); - - it('Should group declarations with proper comments and spaces (single line)', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('comments-2.scss', 'comments-2.expected.scss'); - }); - - it('Should divide properties from different groups with an empty line', function() { - this.comb.configure({ 'sort-order': [ - ['top'], ['color'] - ] }); - this.shouldBeEqual('different-groups.scss', 'different-groups.expected.scss'); - }); - - it('Should sort variables', function() { - this.comb.configure({ 'sort-order': [ - ['$variable', 'color'] - ] }); - this.shouldBeEqual('variable.scss', 'variable.expected.scss'); - }); - - it('Should sort imports', function() { - this.comb.configure({ 'sort-order': [ - ['$import', 'color'] - ] }); - this.shouldBeEqual('import.scss', 'import.expected.scss'); - }); - - it('Should sort @include-s', function() { - this.comb.configure({ 'sort-order': [ - ['$include', 'color'] - ] }); - this.shouldBeEqual('include.scss', 'include.expected.scss'); - }); - - it('Should sort @extend-s', function() { - this.comb.configure({ 'sort-order': [ - ['$include', 'color'] - ] }); - this.shouldBeEqual('extend.scss', 'extend.expected.scss'); - }); - - it('Should sort properties inside blocks passed to mixins', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'color'] - ] }); - this.shouldBeEqual('mixin.scss', 'mixin.expected.scss'); - }); - - it('Should handle properties preceeding rulesets', function() { - this.comb.configure({ 'sort-order': [ - ['top', 'left', 'color'] - ] }); - this.shouldBeEqual('ruleset.scss', 'ruleset.expected.scss'); - }); - - it('Should handle properties preceeding conditions', function() { - this.comb.configure({ 'sort-order': [ - ['font-size', 'display', 'top', 'color'] - ] }); - this.shouldBeEqual('condition.scss', 'condition.expected.scss'); - }); - - it('Should sort complex case with leftovers', function() { - this.comb.configure({ - "sort-order": [ - ["$variable"], - ["position"], - ["...", "border"], - ["$include"], - ["font"] - ] - }); - this.shouldBeEqual('leftovers.scss', 'leftovers.expected.scss'); - }); -}); diff --git a/node_modules/csscomb/test/options/sort-order-scss/comments-1.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/comments-1.expected.scss deleted file mode 100644 index 0aa257a..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/comments-1.expected.scss +++ /dev/null @@ -1,7 +0,0 @@ -div { - /* 2 */ - /* 3 */ - top: 0; /* 4 */ - color: tomato; /* 1 */ - /* 5 */ -} diff --git a/node_modules/csscomb/test/options/sort-order-scss/comments-1.scss b/node_modules/csscomb/test/options/sort-order-scss/comments-1.scss deleted file mode 100644 index 18e6319..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/comments-1.scss +++ /dev/null @@ -1,7 +0,0 @@ -div { - color: tomato; /* 1 */ - /* 2 */ - /* 3 */ - top: 0; /* 4 */ - /* 5 */ -} diff --git a/node_modules/csscomb/test/options/sort-order-scss/comments-2.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/comments-2.expected.scss deleted file mode 100644 index a9b2976..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/comments-2.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div {top: 0; /* 3 */ /* 4 *//* 1 */ color: tomato; /* 2 */ } diff --git a/node_modules/csscomb/test/options/sort-order-scss/comments-2.scss b/node_modules/csscomb/test/options/sort-order-scss/comments-2.scss deleted file mode 100644 index 617d4fd..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/comments-2.scss +++ /dev/null @@ -1 +0,0 @@ -div {/* 1 */ color: tomato; /* 2 */ top: 0; /* 3 */ /* 4 */} diff --git a/node_modules/csscomb/test/options/sort-order-scss/condition.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/condition.expected.scss deleted file mode 100644 index e56af51..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/condition.expected.scss +++ /dev/null @@ -1,8 +0,0 @@ -div { - top: 0; - color: tomato; - @if @color == tomato { - font-size: 2px; - display: block; - } - } diff --git a/node_modules/csscomb/test/options/sort-order-scss/condition.scss b/node_modules/csscomb/test/options/sort-order-scss/condition.scss deleted file mode 100644 index 9211813..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/condition.scss +++ /dev/null @@ -1,8 +0,0 @@ -div { - color: tomato; - @if @color == tomato { - display: block; - font-size: 2px; - } - top: 0; - } diff --git a/node_modules/csscomb/test/options/sort-order-scss/different-groups.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/different-groups.expected.scss deleted file mode 100644 index dddc16f..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/different-groups.expected.scss +++ /dev/null @@ -1,5 +0,0 @@ -div { - top: 0; - - color: tomato; -} diff --git a/node_modules/csscomb/test/options/sort-order-scss/different-groups.scss b/node_modules/csscomb/test/options/sort-order-scss/different-groups.scss deleted file mode 100644 index 7ffa908..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/different-groups.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - top: 0; -} diff --git a/node_modules/csscomb/test/options/sort-order-scss/extend.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/extend.expected.scss deleted file mode 100644 index a1ac4c7..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/extend.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div {@extend %nani; color: tomato; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/extend.scss b/node_modules/csscomb/test/options/sort-order-scss/extend.scss deleted file mode 100644 index 381bc92..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/extend.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @extend %nani; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/import.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/import.expected.scss deleted file mode 100644 index 9c403df..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/import.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div {@import "foo.css"; color: tomato; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/import.scss b/node_modules/csscomb/test/options/sort-order-scss/import.scss deleted file mode 100644 index 681ccd0..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/import.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @import "foo.css"; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/include.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/include.expected.scss deleted file mode 100644 index ea381a7..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/include.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div {@include .nani; color: tomato; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/include.scss b/node_modules/csscomb/test/options/sort-order-scss/include.scss deleted file mode 100644 index c0ed134..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/include.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; @include .nani; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/leftovers.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/leftovers.expected.scss deleted file mode 100644 index bac4c99..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/leftovers.expected.scss +++ /dev/null @@ -1,36 +0,0 @@ -a { - $red: tomato; - - position: $tomato; - - leftover: yay; - border: 1px solid; - - @include .nani; - - font: 20px/16px Arial, sans-serif; -} -b { - $red: tomato; - - position: $tomato; - - leftover: yay; - border: 1px solid; - - @include .nani; - - font: 20px/16px Arial, sans-serif; -} -c { - $red: tomato; - - position: $tomato; - - leftover: yay; - border: 1px solid; - - @include .nani; - - font: 20px/16px Arial, sans-serif; -} diff --git a/node_modules/csscomb/test/options/sort-order-scss/leftovers.scss b/node_modules/csscomb/test/options/sort-order-scss/leftovers.scss deleted file mode 100644 index 0068e54..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/leftovers.scss +++ /dev/null @@ -1,24 +0,0 @@ -a { - leftover: yay; - border: 1px solid; - @include .nani; - font: 20px/16px Arial, sans-serif; - position: $tomato; - $red: tomato; -} -b { - border: 1px solid; - @include .nani; - position: $tomato; - leftover: yay; - font: 20px/16px Arial, sans-serif; - $red: tomato; -} -c { - border: 1px solid; - @include .nani; - font: 20px/16px Arial, sans-serif; - position: $tomato; - $red: tomato; - leftover: yay; -} diff --git a/node_modules/csscomb/test/options/sort-order-scss/mixin.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/mixin.expected.scss deleted file mode 100644 index abfbef4..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/mixin.expected.scss +++ /dev/null @@ -1 +0,0 @@ -.foo { @include nani {top: 0; color: tomato; } } diff --git a/node_modules/csscomb/test/options/sort-order-scss/mixin.scss b/node_modules/csscomb/test/options/sort-order-scss/mixin.scss deleted file mode 100644 index b174d3b..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/mixin.scss +++ /dev/null @@ -1 +0,0 @@ -.foo { @include nani { color: tomato; top: 0; } } diff --git a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.expected.scss deleted file mode 100644 index 54dada6..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; a {top: 0; color: nani; } } diff --git a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.scss b/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.scss deleted file mode 100644 index ee50453..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-1.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; a { color: nani; top: 0; } } diff --git a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.expected.scss deleted file mode 100644 index f5c2e9f..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div { left: 0; color: tomato; a {top: 0; color: nani; }} diff --git a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.scss b/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.scss deleted file mode 100644 index 0bc6212..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/nested-rule-2.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; a { color: nani; top: 0; } left: 0; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.expected.scss deleted file mode 100644 index 5f6d5e3..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.expected.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - top: 0; - color: tomato; - } diff --git a/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.scss b/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.scss deleted file mode 100644 index 8ae2931..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/rule-multiline.scss +++ /dev/null @@ -1,4 +0,0 @@ -div { - color: tomato; - top: 0; - } diff --git a/node_modules/csscomb/test/options/sort-order-scss/rule.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/rule.expected.scss deleted file mode 100644 index a7669bd..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/rule.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div {top: 0; color: tomato; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/rule.scss b/node_modules/csscomb/test/options/sort-order-scss/rule.scss deleted file mode 100644 index 561b980..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/rule.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: tomato; top: 0; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/ruleset.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/ruleset.expected.scss deleted file mode 100644 index 194ff87..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/ruleset.expected.scss +++ /dev/null @@ -1,8 +0,0 @@ -div { - left: 0; - color: tomato; - a { - top: 0; - color: nani; - } -} diff --git a/node_modules/csscomb/test/options/sort-order-scss/ruleset.scss b/node_modules/csscomb/test/options/sort-order-scss/ruleset.scss deleted file mode 100644 index d7ed641..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/ruleset.scss +++ /dev/null @@ -1,8 +0,0 @@ -div { - color: tomato; - a { - color: nani; - top: 0; - } - left: 0; -} diff --git a/node_modules/csscomb/test/options/sort-order-scss/variable.expected.scss b/node_modules/csscomb/test/options/sort-order-scss/variable.expected.scss deleted file mode 100644 index c17c634..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/variable.expected.scss +++ /dev/null @@ -1 +0,0 @@ -div {$red: tomato; color: $tomato; } diff --git a/node_modules/csscomb/test/options/sort-order-scss/variable.scss b/node_modules/csscomb/test/options/sort-order-scss/variable.scss deleted file mode 100644 index f759f22..0000000 --- a/node_modules/csscomb/test/options/sort-order-scss/variable.scss +++ /dev/null @@ -1 +0,0 @@ -div { color: $tomato; $red: tomato; } diff --git a/node_modules/csscomb/test/options/sort-order.js b/node_modules/csscomb/test/options/sort-order.js deleted file mode 100644 index c8f7077..0000000 --- a/node_modules/csscomb/test/options/sort-order.js +++ /dev/null @@ -1,115 +0,0 @@ -var assert = require('assert'); - -describe('options/sort-order', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should be in expected order in case properties are not grouped', function() { - this.comb.configure({ 'sort-order': ['position', 'z-index'] }); - this.shouldBeEqual('single-group.css', 'single-group.expected.css'); - }); - - it('Should be in expected order in case of 1 group', function() { - this.comb.configure({ 'sort-order': [ - ['position', 'z-index'] - ] }); - this.shouldBeEqual('single-group.css', 'single-group.expected.css'); - }); - - it('Shuld be in expected order in case of multiple groups', function() { - this.comb.configure({ 'sort-order': [ - ['position', 'z-index'], - ['width', 'height'] - ] }); - this.shouldBeEqual('multiple-groups.css', 'multiple-groups.expected.css'); - - }); - - it('Should work correctly with comments in case of 1 group', function() { - this.comb.configure({ 'sort-order': [ - ['border-bottom', 'font-style'], - ] }); - this.shouldBeEqual('single-group-comments.css', 'single-group-comments.expected.css'); - }); - - it('Should work correctly with comments in case of multiple groups', function() { - this.comb.configure({ 'sort-order': [ - ['margin'], - ['padding'] - ] }); - this.shouldBeEqual('multiple-groups-comments.css', 'multiple-groups-comments.expected.css'); - }); - - it('Should parse semicolons inside data uri correctly', function() { - this.comb.configure({ - 'sort-order': [ - ['position', 'background', 'color'] - ] - }); - this.shouldBeEqual('data-uri.css', 'data-uri.expected.css'); - }); - - it('Should not add more than 1 line between groups', function() { - var input = this.readFile('multiple-groups-2.css'); - var expected = this.readFile('multiple-groups-2.expected.css'); - this.comb.configure({ - 'sort-order': [ - ['top'], ['color'] - ] - }); - - for (var i = 6; i--;) { - input = this.comb.processString(input); - } - assert.equal(input, expected); - }); - - it('Issue 94. Test 1', function() { - var config = this.Comb.getConfig('csscomb'); - this.comb.configure(config); - this.shouldBeEqual('issue-94-1.css', 'issue-94-1.expected.css'); - }); - - it('Issue 94. Test 2', function() { - var config = this.Comb.getConfig('csscomb'); - this.comb.configure(config); - this.shouldBeEqual('issue-94-2.css', 'issue-94-2.expected.css'); - }); - - it('Issue 94. Test 3', function() { - var config = this.Comb.getConfig('csscomb'); - this.comb.configure(config); - this.shouldBeEqual('issue-94-3.css', 'issue-94-3.expected.css'); - }); - - it('Should place the leftovers in the end', function() { - var config = this.Comb.getConfig('csscomb'); - this.comb.configure(config); - this.shouldBeEqual('leftovers-1.css', 'leftovers-1.expected.css'); - }); - - it('Should place the leftovers in the beginning', function() { - var config = this.Comb.getConfig('csscomb'); - config['sort-order'][0].unshift(['...']); - this.comb.configure(config); - this.shouldBeEqual('leftovers-2.css', 'leftovers-2.expected.css'); - config['sort-order'][0].shift(); - }); - - it('Should place the leftovers in the beginning of its group', function() { - var config = this.Comb.getConfig('csscomb'); - config['sort-order'][1].unshift('...'); - this.comb.configure(config); - this.shouldBeEqual('leftovers-3.css', 'leftovers-3.expected.css'); - config['sort-order'][1].shift(); - }); - - it('Should place the leftovers in the middle of its group', function() { - var config = this.Comb.getConfig('csscomb'); - config['sort-order'][1].splice(1, 0, '...'); - this.comb.configure(config); - this.shouldBeEqual('leftovers-4.css', 'leftovers-4.expected.css'); - config['sort-order'][1].splice(1, 1); - }); -}); diff --git a/node_modules/csscomb/test/options/sort-order/data-uri.css b/node_modules/csscomb/test/options/sort-order/data-uri.css deleted file mode 100644 index 3552dfe..0000000 --- a/node_modules/csscomb/test/options/sort-order/data-uri.css +++ /dev/null @@ -1,7 +0,0 @@ -a -{ - color: tomato; - background: #D2D2D2 no-repeat url('data:image/svg+xml;charset=US-ASCII.naninani'); - position: absolute; -} - diff --git a/node_modules/csscomb/test/options/sort-order/data-uri.expected.css b/node_modules/csscomb/test/options/sort-order/data-uri.expected.css deleted file mode 100644 index 74b14a2..0000000 --- a/node_modules/csscomb/test/options/sort-order/data-uri.expected.css +++ /dev/null @@ -1,7 +0,0 @@ -a -{ - position: absolute; - background: #D2D2D2 no-repeat url('data:image/svg+xml;charset=US-ASCII.naninani'); - color: tomato; -} - diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-1.css b/node_modules/csscomb/test/options/sort-order/issue-94-1.css deleted file mode 100644 index 54131c5..0000000 --- a/node_modules/csscomb/test/options/sort-order/issue-94-1.css +++ /dev/null @@ -1,18 +0,0 @@ -.test -{ - position: absolute; - top: -1px; - right: -1px; - bottom: -1px; - left: -1px; - - border: 1px solid transparent; - border-color: rgba(0,0,0,0.38) rgba(0,0,0,0.27) rgba(0,0,0,0.16); - - background: -webkit-linear-gradient(#fff, #fff); - background: linear-gradient(#fff, #fff); - background-clip: padding-box; - background-size: 16px 16px; - - -webkit-appearance: textfield; -} diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-1.expected.css b/node_modules/csscomb/test/options/sort-order/issue-94-1.expected.css deleted file mode 100644 index 0943808..0000000 --- a/node_modules/csscomb/test/options/sort-order/issue-94-1.expected.css +++ /dev/null @@ -1,17 +0,0 @@ -.test -{ - position: absolute; - top: -1px; - right: -1px; - bottom: -1px; - left: -1px; - - border: 1px solid transparent; - border-color: rgba(0,0,0,.38) rgba(0,0,0,.27) rgba(0,0,0,.16); - background: -webkit-linear-gradient(#fff, #fff); - background: linear-gradient(#fff, #fff); - background-clip: padding-box; - background-size: 16px 16px; - - -webkit-appearance: textfield; -} diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-2.css b/node_modules/csscomb/test/options/sort-order/issue-94-2.css deleted file mode 100644 index 0365913..0000000 --- a/node_modules/csscomb/test/options/sort-order/issue-94-2.css +++ /dev/null @@ -1,19 +0,0 @@ -.test -{ - width: 0; - width: 100%; - height: 0; - - background: #fff; - color: #000; - - display: -moz-inline-stack; - display: inline-block; - - position: absolute; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; -} diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-2.expected.css b/node_modules/csscomb/test/options/sort-order/issue-94-2.expected.css deleted file mode 100644 index 85e618d..0000000 --- a/node_modules/csscomb/test/options/sort-order/issue-94-2.expected.css +++ /dev/null @@ -1,19 +0,0 @@ -.test -{ - position: absolute; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - - display: -moz-inline-stack; - display: inline-block; - - width: 0; - width: 100%; - height: 0; - - color: #000; - background: #fff; -} diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-3.css b/node_modules/csscomb/test/options/sort-order/issue-94-3.css deleted file mode 100644 index 872eddc..0000000 --- a/node_modules/csscomb/test/options/sort-order/issue-94-3.css +++ /dev/null @@ -1,21 +0,0 @@ -.input-view { - position: absolute; - -webkit-appearance: none; - right: -1px; - bottom: -1px; - left: -1px; - - border: 1px solid transparent; - - top: -1px; - - background: -webkit-linear-gradient(#FFF, #FFF); - background: linear-gradient(#FFF, #FFF); - background-clip: padding-box; - background-size: 16px 16px; - box-shadow: 0 1px 0 rgba(255,255,255,0.2), inset 0 1px 1px rgba(0,0,0,0.1); - - border-color: rgba(0,0,0,0.27); - border-top-color: rgba(0,0,0,0.38); - border-bottom-color: rgba(0,0,0,0.16); -} diff --git a/node_modules/csscomb/test/options/sort-order/issue-94-3.expected.css b/node_modules/csscomb/test/options/sort-order/issue-94-3.expected.css deleted file mode 100644 index 92f2943..0000000 --- a/node_modules/csscomb/test/options/sort-order/issue-94-3.expected.css +++ /dev/null @@ -1,20 +0,0 @@ -.input-view -{ - position: absolute; - top: -1px; - right: -1px; - bottom: -1px; - left: -1px; - - border: 1px solid transparent; - border-color: rgba(0,0,0,.27); - border-top-color: rgba(0,0,0,.38); - border-bottom-color: rgba(0,0,0,.16); - background: -webkit-linear-gradient(#fff, #fff); - background: linear-gradient(#fff, #fff); - background-clip: padding-box; - background-size: 16px 16px; - box-shadow: 0 1px 0 rgba(255,255,255,.2), inset 0 1px 1px rgba(0,0,0,.1); - - -webkit-appearance: none; -} diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-1.css b/node_modules/csscomb/test/options/sort-order/leftovers-1.css deleted file mode 100644 index d559d4e..0000000 --- a/node_modules/csscomb/test/options/sort-order/leftovers-1.css +++ /dev/null @@ -1,20 +0,0 @@ -a -{ - leftover: yay; - z-index: 1; - position: absolute; -} - -b -{ - z-index: 2; - leftover: yay; - position: absolute; -} - -c -{ - z-index: 3; - position: absolute; - leftover: yay; -} diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-1.expected.css b/node_modules/csscomb/test/options/sort-order/leftovers-1.expected.css deleted file mode 100644 index 145b83d..0000000 --- a/node_modules/csscomb/test/options/sort-order/leftovers-1.expected.css +++ /dev/null @@ -1,23 +0,0 @@ -a -{ - position: absolute; - z-index: 1; - - leftover: yay; -} - -b -{ - position: absolute; - z-index: 2; - - leftover: yay; -} - -c -{ - position: absolute; - z-index: 3; - - leftover: yay; -} diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-2.css b/node_modules/csscomb/test/options/sort-order/leftovers-2.css deleted file mode 100644 index d559d4e..0000000 --- a/node_modules/csscomb/test/options/sort-order/leftovers-2.css +++ /dev/null @@ -1,20 +0,0 @@ -a -{ - leftover: yay; - z-index: 1; - position: absolute; -} - -b -{ - z-index: 2; - leftover: yay; - position: absolute; -} - -c -{ - z-index: 3; - position: absolute; - leftover: yay; -} diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-2.expected.css b/node_modules/csscomb/test/options/sort-order/leftovers-2.expected.css deleted file mode 100644 index 05c8292..0000000 --- a/node_modules/csscomb/test/options/sort-order/leftovers-2.expected.css +++ /dev/null @@ -1,23 +0,0 @@ -a -{ - leftover: yay; - - position: absolute; - z-index: 1; -} - -b -{ - leftover: yay; - - position: absolute; - z-index: 2; -} - -c -{ - leftover: yay; - - position: absolute; - z-index: 3; -} diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-3.css b/node_modules/csscomb/test/options/sort-order/leftovers-3.css deleted file mode 100644 index d559d4e..0000000 --- a/node_modules/csscomb/test/options/sort-order/leftovers-3.css +++ /dev/null @@ -1,20 +0,0 @@ -a -{ - leftover: yay; - z-index: 1; - position: absolute; -} - -b -{ - z-index: 2; - leftover: yay; - position: absolute; -} - -c -{ - z-index: 3; - position: absolute; - leftover: yay; -} diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-3.expected.css b/node_modules/csscomb/test/options/sort-order/leftovers-3.expected.css deleted file mode 100644 index 9522dc5..0000000 --- a/node_modules/csscomb/test/options/sort-order/leftovers-3.expected.css +++ /dev/null @@ -1,20 +0,0 @@ -a -{ - leftover: yay; - position: absolute; - z-index: 1; -} - -b -{ - leftover: yay; - position: absolute; - z-index: 2; -} - -c -{ - leftover: yay; - position: absolute; - z-index: 3; -} diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-4.css b/node_modules/csscomb/test/options/sort-order/leftovers-4.css deleted file mode 100644 index d559d4e..0000000 --- a/node_modules/csscomb/test/options/sort-order/leftovers-4.css +++ /dev/null @@ -1,20 +0,0 @@ -a -{ - leftover: yay; - z-index: 1; - position: absolute; -} - -b -{ - z-index: 2; - leftover: yay; - position: absolute; -} - -c -{ - z-index: 3; - position: absolute; - leftover: yay; -} diff --git a/node_modules/csscomb/test/options/sort-order/leftovers-4.expected.css b/node_modules/csscomb/test/options/sort-order/leftovers-4.expected.css deleted file mode 100644 index 874c72a..0000000 --- a/node_modules/csscomb/test/options/sort-order/leftovers-4.expected.css +++ /dev/null @@ -1,20 +0,0 @@ -a -{ - position: absolute; - leftover: yay; - z-index: 1; -} - -b -{ - position: absolute; - leftover: yay; - z-index: 2; -} - -c -{ - position: absolute; - leftover: yay; - z-index: 3; -} diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups-2.css b/node_modules/csscomb/test/options/sort-order/multiple-groups-2.css deleted file mode 100644 index 79291ab..0000000 --- a/node_modules/csscomb/test/options/sort-order/multiple-groups-2.css +++ /dev/null @@ -1,6 +0,0 @@ -a -{ - color: tomato; - top: 0; -} - diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups-2.expected.css b/node_modules/csscomb/test/options/sort-order/multiple-groups-2.expected.css deleted file mode 100644 index 96a0ec2..0000000 --- a/node_modules/csscomb/test/options/sort-order/multiple-groups-2.expected.css +++ /dev/null @@ -1,7 +0,0 @@ -a -{ - top: 0; - - color: tomato; -} - diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.css b/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.css deleted file mode 100644 index 5012f20..0000000 --- a/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.css +++ /dev/null @@ -1,5 +0,0 @@ -a, b, i /* foobar */ -{ - padding: 0; - margin: 0; - } diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.expected.css b/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.expected.css deleted file mode 100644 index 49a1ba8..0000000 --- a/node_modules/csscomb/test/options/sort-order/multiple-groups-comments.expected.css +++ /dev/null @@ -1,6 +0,0 @@ -a, b, i /* foobar */ -{ - margin: 0; - - padding: 0; - } diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups.css b/node_modules/csscomb/test/options/sort-order/multiple-groups.css deleted file mode 100644 index a16d45e..0000000 --- a/node_modules/csscomb/test/options/sort-order/multiple-groups.css +++ /dev/null @@ -1,7 +0,0 @@ -a -{ - z-index: 2; - position: absolute; - height: 2px; - width: 2px; -} diff --git a/node_modules/csscomb/test/options/sort-order/multiple-groups.expected.css b/node_modules/csscomb/test/options/sort-order/multiple-groups.expected.css deleted file mode 100644 index 3f27b45..0000000 --- a/node_modules/csscomb/test/options/sort-order/multiple-groups.expected.css +++ /dev/null @@ -1,8 +0,0 @@ -a -{ - position: absolute; - z-index: 2; - - width: 2px; - height: 2px; -} diff --git a/node_modules/csscomb/test/options/sort-order/single-group-comments.css b/node_modules/csscomb/test/options/sort-order/single-group-comments.css deleted file mode 100644 index dc78ba3..0000000 --- a/node_modules/csscomb/test/options/sort-order/single-group-comments.css +++ /dev/null @@ -1,5 +0,0 @@ -div p em { - /* upline comment */ - font-style:italic; - border-bottom:1px solid red; /* trololo */ /* trololo */ -} diff --git a/node_modules/csscomb/test/options/sort-order/single-group-comments.expected.css b/node_modules/csscomb/test/options/sort-order/single-group-comments.expected.css deleted file mode 100644 index ca4e166..0000000 --- a/node_modules/csscomb/test/options/sort-order/single-group-comments.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -div p em { - border-bottom:1px solid red; /* trololo */ /* trololo */ - /* upline comment */ - font-style:italic; -} diff --git a/node_modules/csscomb/test/options/sort-order/single-group.css b/node_modules/csscomb/test/options/sort-order/single-group.css deleted file mode 100644 index ed8925d..0000000 --- a/node_modules/csscomb/test/options/sort-order/single-group.css +++ /dev/null @@ -1,5 +0,0 @@ -a -{ - z-index: 2; - position: absolute; -} diff --git a/node_modules/csscomb/test/options/sort-order/single-group.expected.css b/node_modules/csscomb/test/options/sort-order/single-group.expected.css deleted file mode 100644 index 5bcb46c..0000000 --- a/node_modules/csscomb/test/options/sort-order/single-group.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a -{ - position: absolute; - z-index: 2; -} diff --git a/node_modules/csscomb/test/options/space-after-colon-sass.js b/node_modules/csscomb/test/options/space-after-colon-sass.js deleted file mode 100644 index 98f14be..0000000 --- a/node_modules/csscomb/test/options/space-after-colon-sass.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('options/space-after-colon (sass):', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should set proper space if colon is after property name', function() { - this.comb.configure({ 'space-after-colon': 2 }); - this.shouldBeEqual('colon-after-property-name.sass', 'colon-after-property-name.expected.sass'); - }); - - it('Should not change space after colon which is before property name', function() { - this.comb.configure({ 'space-after-colon': 1 }); - this.shouldBeEqual('colon-before-property-name.sass', 'colon-before-property-name.expected.sass'); - }); -}); diff --git a/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.expected.sass b/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.expected.sass deleted file mode 100644 index 9b55f4a..0000000 --- a/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.expected.sass +++ /dev/null @@ -1,3 +0,0 @@ -a - color: panda - top: 0 diff --git a/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.sass b/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.sass deleted file mode 100644 index 5e4e236..0000000 --- a/node_modules/csscomb/test/options/space-after-colon-sass/colon-after-property-name.sass +++ /dev/null @@ -1,3 +0,0 @@ -a - color: panda - top:0 diff --git a/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.expected.sass b/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.expected.sass deleted file mode 100644 index a8a5e3e..0000000 --- a/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.expected.sass +++ /dev/null @@ -1,3 +0,0 @@ -a - :color panda - :top 0 diff --git a/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.sass b/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.sass deleted file mode 100644 index a8a5e3e..0000000 --- a/node_modules/csscomb/test/options/space-after-colon-sass/colon-before-property-name.sass +++ /dev/null @@ -1,3 +0,0 @@ -a - :color panda - :top 0 diff --git a/node_modules/csscomb/test/options/space-after-colon-scss.js b/node_modules/csscomb/test/options/space-after-colon-scss.js deleted file mode 100644 index 5a9f83b..0000000 --- a/node_modules/csscomb/test/options/space-after-colon-scss.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('options/space-after-colon (scss):', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Space after colon should not affect pseudo elements', function() { - this.comb.configure({ 'space-after-colon': 1 }); - this.shouldBeEqual('pseudo-elements.scss', 'pseudo-elements.expected.scss'); - }); -}); diff --git a/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.expected.scss b/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.expected.scss deleted file mode 100644 index 46b16d2..0000000 --- a/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.expected.scss +++ /dev/null @@ -1,11 +0,0 @@ -li{ - float: left; - - a:hover{ - text-decoration: underline; - } -} - -li:before { - color: tomato; -} diff --git a/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.scss b/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.scss deleted file mode 100644 index dbb4ace..0000000 --- a/node_modules/csscomb/test/options/space-after-colon-scss/pseudo-elements.scss +++ /dev/null @@ -1,11 +0,0 @@ -li{ - float:left; - - a:hover{ - text-decoration:underline; - } -} - -li:before { - color:tomato; -} diff --git a/node_modules/csscomb/test/options/space-after-colon.js b/node_modules/csscomb/test/options/space-after-colon.js deleted file mode 100644 index a0abb4f..0000000 --- a/node_modules/csscomb/test/options/space-after-colon.js +++ /dev/null @@ -1,68 +0,0 @@ -describe('options/space-after-colon:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-after-colon': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-after-colon': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-after-colon': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space after colon', function() { - this.comb.configure({ 'space-after-colon': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only)=> should set proper space after colon', function() { - this.comb.configure({ 'space-after-colon': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spacesand newlines)=> should set proper space after colon', function() { - this.comb.configure({ 'space-after-colon': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Should detect no whitespaces', function() { - this.shouldDetect( - ['space-after-colon'], - 'a { color:red }', - { 'space-after-colon': '' } - ); - }); - - it('Should detect space from two variants', function() { - this.shouldDetect( - ['space-after-colon'], - 'a { color: red; color :red }', - { 'space-after-colon': ' ' } - ); - }); - - it('Should detect no whitespaces along three variants', function() { - this.shouldDetect( - ['space-after-colon'], - 'a { color: red; background :red } b { width:10px }', - { 'space-after-colon': '' } - ); - }); - - it('Should detect space', function() { - this.shouldDetect( - ['space-after-colon'], - 'a { color : red; background :red } b { width: 10px }', - { 'space-after-colon': ' ' } - ); - }); -}); - diff --git a/node_modules/csscomb/test/options/space-after-colon/test-2.expected.css b/node_modules/csscomb/test/options/space-after-colon/test-2.expected.css deleted file mode 100644 index c1355f3..0000000 --- a/node_modules/csscomb/test/options/space-after-colon/test-2.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a { color: red } -a{color: red} -a {color : red} -a {color : /* foo */ red } -a {color /* bar */ : red } diff --git a/node_modules/csscomb/test/options/space-after-colon/test-3.expected.css b/node_modules/csscomb/test/options/space-after-colon/test-3.expected.css deleted file mode 100644 index 63d57dc..0000000 --- a/node_modules/csscomb/test/options/space-after-colon/test-3.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -a { color: - red } -a{color: - red} -a {color : - red} -a {color : - /* foo */ red } -a {color /* bar */ : - red } diff --git a/node_modules/csscomb/test/options/space-after-colon/test.css b/node_modules/csscomb/test/options/space-after-colon/test.css deleted file mode 100644 index 637656f..0000000 --- a/node_modules/csscomb/test/options/space-after-colon/test.css +++ /dev/null @@ -1,5 +0,0 @@ -a { color: red } -a{color:red} -a {color : red} -a {color : /* foo */ red } -a {color /* bar */ : red } diff --git a/node_modules/csscomb/test/options/space-after-colon/test.expected.css b/node_modules/csscomb/test/options/space-after-colon/test.expected.css deleted file mode 100644 index 2d13781..0000000 --- a/node_modules/csscomb/test/options/space-after-colon/test.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a { color:red } -a{color:red} -a {color :red} -a {color :/* foo */ red } -a {color /* bar */ :red } diff --git a/node_modules/csscomb/test/options/space-after-combinator.js b/node_modules/csscomb/test/options/space-after-combinator.js deleted file mode 100644 index 8088bca..0000000 --- a/node_modules/csscomb/test/options/space-after-combinator.js +++ /dev/null @@ -1,84 +0,0 @@ -describe('options/space-after-combinator:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-after-combinator': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-after-combinator': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-after-combinator': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space after combinator', function() { - this.comb.configure({ 'space-after-combinator': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space after combinator', function() { - this.comb.configure({ 'space-after-combinator': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space after combinator', function() { - this.comb.configure({ 'space-after-combinator': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Should detect no whitespaces after combinator', function() { - this.shouldDetect( - ['space-after-combinator'], - 'a+b { color:red }', - { 'space-after-combinator': '' } - ); - }); - - it('Should detect a space after combinator', function() { - this.shouldDetect( - ['space-after-combinator'], - 'a + \n b { color:red }', - { 'space-after-combinator': ' \n ' } - ); - }); - - it('Should detect a space after combinator in long selector', function() { - this.shouldDetect( - ['space-after-combinator'], - 'a + b ~ c>d { color:red }', - { 'space-after-combinator': ' ' } - ); - }); - - it('Should detect a space after combinator in long selector, test 2', function() { - this.shouldDetect( - ['space-after-combinator'], - 'a>b + c + d { color:red }', - { 'space-after-combinator': ' ' } - ); - }); - - it('Should detect no whitespaces after combinator in long selector', function() { - this.shouldDetect( - ['space-after-combinator'], - 'a+b ~ c+d { color:red }', - { 'space-after-combinator': '' } - ); - }); - - it('Shouldn’t detect whitespaces after combinator in selector without combinators', function() { - this.shouldDetect( - ['space-after-combinator'], - 'a { color:red }', - {} - ); - }); -}); - diff --git a/node_modules/csscomb/test/options/space-after-combinator/test-2.expected.css b/node_modules/csscomb/test/options/space-after-combinator/test-2.expected.css deleted file mode 100644 index 32df439..0000000 --- a/node_modules/csscomb/test/options/space-after-combinator/test-2.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -a> b { color: red } -a> b { color: red } -a > b { color: red } -a+ b { color: red } -a+ b { color: red } -a + b { color: red } -a~ b { color: red } -a~ b { color: red } -a ~ b { color: red } -a ~ b+ c> d { color: red } diff --git a/node_modules/csscomb/test/options/space-after-combinator/test-3.expected.css b/node_modules/csscomb/test/options/space-after-combinator/test-3.expected.css deleted file mode 100644 index 9d34666..0000000 --- a/node_modules/csscomb/test/options/space-after-combinator/test-3.expected.css +++ /dev/null @@ -1,22 +0,0 @@ -a> - b { color: red } -a> - b { color: red } -a > - b { color: red } -a+ - b { color: red } -a+ - b { color: red } -a + - b { color: red } -a~ - b { color: red } -a~ - b { color: red } -a ~ - b { color: red } -a ~ - b+ - c> - d { color: red } diff --git a/node_modules/csscomb/test/options/space-after-combinator/test.css b/node_modules/csscomb/test/options/space-after-combinator/test.css deleted file mode 100644 index 4ad8d86..0000000 --- a/node_modules/csscomb/test/options/space-after-combinator/test.css +++ /dev/null @@ -1,10 +0,0 @@ -a>b { color: red } -a> b { color: red } -a >b { color: red } -a+b { color: red } -a+ b { color: red } -a +b { color: red } -a~b { color: red } -a~ b { color: red } -a ~b { color: red } -a ~b+ c>d { color: red } diff --git a/node_modules/csscomb/test/options/space-after-combinator/test.expected.css b/node_modules/csscomb/test/options/space-after-combinator/test.expected.css deleted file mode 100644 index 186958d..0000000 --- a/node_modules/csscomb/test/options/space-after-combinator/test.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -a>b { color: red } -a>b { color: red } -a >b { color: red } -a+b { color: red } -a+b { color: red } -a +b { color: red } -a~b { color: red } -a~b { color: red } -a ~b { color: red } -a ~b+c>d { color: red } diff --git a/node_modules/csscomb/test/options/space-after-opening-brace.js b/node_modules/csscomb/test/options/space-after-opening-brace.js deleted file mode 100644 index 06176f3..0000000 --- a/node_modules/csscomb/test/options/space-after-opening-brace.js +++ /dev/null @@ -1,84 +0,0 @@ -describe('options/space-after-opening-brace:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-after-opening-brace': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-after-opening-brace': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-after-opening-brace': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space after {', function() { - this.comb.configure({ 'space-after-opening-brace': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space after {', function() { - this.comb.configure({ 'space-after-opening-brace': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space after {', function() { - this.comb.configure({ 'space-after-opening-brace': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Should detect no whitespace', function() { - this.shouldDetect( - ['space-after-opening-brace'], - 'a{top:0}', - { 'space-after-opening-brace': '' } - ); - }); - - it('Should detect whitespace', function() { - this.shouldDetect( - ['space-after-opening-brace'], - 'a{\n\ttop:0}', - { 'space-after-opening-brace': '\n\t' } - ); - }); - - it('Should detect no whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-after-opening-brace'], - 'a{top:0} b{\n left:0}', - { 'space-after-opening-brace': '' } - ); - }); - - it('Should detect whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-after-opening-brace'], - 'a{ top:0 } b{left:0}', - { 'space-after-opening-brace': ' ' } - ); - }); - - it('Should detect no whitespace (3 blocks)', function() { - this.shouldDetect( - ['space-after-opening-brace'], - 'a{top:0} b { left: 0 } c{\n\tright:0}', - { 'space-after-opening-brace': '' } - ); - }); - - it('Should detect whitespace (3 blocks)', function() { - this.shouldDetect( - ['space-after-opening-brace'], - 'a{\ntop:0} b{\nleft:0} c{\n right:0}', - { 'space-after-opening-brace': '\n' } - ); - }); -}); - diff --git a/node_modules/csscomb/test/options/space-after-opening-brace/test-2.expected.css b/node_modules/csscomb/test/options/space-after-opening-brace/test-2.expected.css deleted file mode 100644 index a34ef36..0000000 --- a/node_modules/csscomb/test/options/space-after-opening-brace/test-2.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a{ top: 0} -a { top: 0 } - -@media print{ a{ top: 0}} -@media print { a { top: 0 } } diff --git a/node_modules/csscomb/test/options/space-after-opening-brace/test-3.expected.css b/node_modules/csscomb/test/options/space-after-opening-brace/test-3.expected.css deleted file mode 100644 index 4c044b4..0000000 --- a/node_modules/csscomb/test/options/space-after-opening-brace/test-3.expected.css +++ /dev/null @@ -1,11 +0,0 @@ -a{ - top: 0} -a { - top: 0 } - -@media print{ - a{ - top: 0}} -@media print { - a { - top: 0 } } diff --git a/node_modules/csscomb/test/options/space-after-opening-brace/test.css b/node_modules/csscomb/test/options/space-after-opening-brace/test.css deleted file mode 100644 index 7c71281..0000000 --- a/node_modules/csscomb/test/options/space-after-opening-brace/test.css +++ /dev/null @@ -1,5 +0,0 @@ -a{top: 0} -a { top: 0 } - -@media print{a{top: 0}} -@media print { a { top: 0 } } diff --git a/node_modules/csscomb/test/options/space-after-opening-brace/test.expected.css b/node_modules/csscomb/test/options/space-after-opening-brace/test.expected.css deleted file mode 100644 index fa761a5..0000000 --- a/node_modules/csscomb/test/options/space-after-opening-brace/test.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a{top: 0} -a {top: 0 } - -@media print{a{top: 0}} -@media print {a {top: 0 } } diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass.js b/node_modules/csscomb/test/options/space-after-selector-delimiter-sass.js deleted file mode 100644 index 0c98282..0000000 --- a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('options/space-after-selector-delimiter (sass):', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Issue 238', function() { - this.comb.configure({ 'space-after-selector-delimiter': '\n' }); - this.shouldBeEqual('issue-238.sass', 'issue-238.expected.sass'); - }); -}); diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.expected.sass b/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.expected.sass deleted file mode 100644 index 1857160..0000000 --- a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.expected.sass +++ /dev/null @@ -1,5 +0,0 @@ -html, -body, -p - background: #fff - color: #000 diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.sass b/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.sass deleted file mode 100644 index 5fc2e13..0000000 --- a/node_modules/csscomb/test/options/space-after-selector-delimiter-sass/issue-238.sass +++ /dev/null @@ -1,4 +0,0 @@ -html, -body, p - background: #fff - color: #000 diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter.js b/node_modules/csscomb/test/options/space-after-selector-delimiter.js deleted file mode 100644 index 8d82ae1..0000000 --- a/node_modules/csscomb/test/options/space-after-selector-delimiter.js +++ /dev/null @@ -1,83 +0,0 @@ -describe('options/space-after-selector-delimiter:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-after-selector-delimiter': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-after-selector-delimiter': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-after-selector-delimiter': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space after selector delimiter', function() { - this.comb.configure({ 'space-after-selector-delimiter': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space after selector delimiter', function() { - this.comb.configure({ 'space-after-selector-delimiter': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space after selector delimiter', function() { - this.comb.configure({ 'space-after-selector-delimiter': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Should detect no whitespace', function() { - this.shouldDetect( - ['space-after-selector-delimiter'], - 'a,b{top:0}', - { 'space-after-selector-delimiter': '' } - ); - }); - - it('Should detect whitespace', function() { - this.shouldDetect( - ['space-after-selector-delimiter'], - 'a, \n b {top:0}', - { 'space-after-selector-delimiter': ' \n ' } - ); - }); - - it('Should detect no whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-after-selector-delimiter'], - 'a,b{top:0} a, b{left:0}', - { 'space-after-selector-delimiter': '' } - ); - }); - - it('Should detect whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-after-selector-delimiter'], - 'a, b {top:0} b,a{left:0}', - { 'space-after-selector-delimiter': ' ' } - ); - }); - - it('Should detect no whitespace (3 blocks)', function() { - this.shouldDetect( - ['space-after-selector-delimiter'], - 'a, b{top:0} b,c{left:0} c,d{right:0}', - { 'space-after-selector-delimiter': '' } - ); - }); - - it('Should detect whitespace (3 blocks)', function() { - this.shouldDetect( - ['space-after-selector-delimiter'], - 'a,b{top:0} b, c{left:0} c, sd{right:0}', - { 'space-after-selector-delimiter': ' ' } - ); - }); -}); diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter/test-2.expected.css b/node_modules/csscomb/test/options/space-after-selector-delimiter/test-2.expected.css deleted file mode 100644 index 92d1ece..0000000 --- a/node_modules/csscomb/test/options/space-after-selector-delimiter/test-2.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a, b { color: red } -a, b { color: red } -a , b { color: red } -a, b { color: red } -a+b, c>d, e{ color: red } \ No newline at end of file diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter/test-3.expected.css b/node_modules/csscomb/test/options/space-after-selector-delimiter/test-3.expected.css deleted file mode 100644 index 6a19848..0000000 --- a/node_modules/csscomb/test/options/space-after-selector-delimiter/test-3.expected.css +++ /dev/null @@ -1,11 +0,0 @@ -a, - b { color: red } -a, - b { color: red } -a , - b { color: red } -a, - b { color: red } -a+b, - c>d, - e{ color: red } \ No newline at end of file diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter/test.css b/node_modules/csscomb/test/options/space-after-selector-delimiter/test.css deleted file mode 100644 index cd8e7d7..0000000 --- a/node_modules/csscomb/test/options/space-after-selector-delimiter/test.css +++ /dev/null @@ -1,6 +0,0 @@ -a,b { color: red } -a, b { color: red } -a ,b { color: red } -a, -b { color: red } -a+b,c>d,e{ color: red } \ No newline at end of file diff --git a/node_modules/csscomb/test/options/space-after-selector-delimiter/test.expected.css b/node_modules/csscomb/test/options/space-after-selector-delimiter/test.expected.css deleted file mode 100644 index b0d4fd2..0000000 --- a/node_modules/csscomb/test/options/space-after-selector-delimiter/test.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a,b { color: red } -a,b { color: red } -a ,b { color: red } -a,b { color: red } -a+b,c>d,e{ color: red } \ No newline at end of file diff --git a/node_modules/csscomb/test/options/space-before-closing-brace.js b/node_modules/csscomb/test/options/space-before-closing-brace.js deleted file mode 100644 index a9d9a6c..0000000 --- a/node_modules/csscomb/test/options/space-before-closing-brace.js +++ /dev/null @@ -1,76 +0,0 @@ -describe('options/space-before-closing-brace:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-before-closing-brace': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-before-closing-brace': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-before-closing-brace': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space before }', function() { - this.comb.configure({ 'space-before-closing-brace': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space before }', function() { - this.comb.configure({ 'space-before-closing-brace': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space before }', function() { - this.comb.configure({ 'space-before-closing-brace': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Should detect no whitespace', function() { - this.shouldDetect( - ['space-before-closing-brace'], - 'a{top:0}', - { 'space-before-closing-brace': '' } - ); - }); - - it('Should detect no whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-before-closing-brace'], - 'a{top:0} b { color: tomato; }', - { 'space-before-closing-brace': '' } - ); - }); - - it('Should detect whitespace', function() { - this.shouldDetect( - ['space-before-closing-brace'], - 'a { top:0 }', - { 'space-before-closing-brace': ' ' } - ); - }); - - it('Should detect whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-before-closing-brace'], - 'a { top:0 } b{color:tomato;}', - { 'space-before-closing-brace': ' ' } - ); - }); - - it('Should detect whitespace (mix with block indent)', function() { - this.shouldDetect( - ['space-before-closing-brace', 'block-indent'], - 'a {\n top:0\n }\nb{\n color:tomato;\n }', - { 'block-indent': ' ', 'space-before-closing-brace': '\n ' } - ); - }); -}); - diff --git a/node_modules/csscomb/test/options/space-before-closing-brace/test-2.expected.css b/node_modules/csscomb/test/options/space-before-closing-brace/test-2.expected.css deleted file mode 100644 index 86ba267..0000000 --- a/node_modules/csscomb/test/options/space-before-closing-brace/test-2.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a{top: 0 } -a {top: 0 } - -@media print{a{top: 0 } } -@media print { a { top: 0 } } diff --git a/node_modules/csscomb/test/options/space-before-closing-brace/test-3.expected.css b/node_modules/csscomb/test/options/space-before-closing-brace/test-3.expected.css deleted file mode 100644 index 9868eaa..0000000 --- a/node_modules/csscomb/test/options/space-before-closing-brace/test-3.expected.css +++ /dev/null @@ -1,11 +0,0 @@ -a{top: 0 - } -a {top: 0 - } - -@media print{a{top: 0 - } - } -@media print { a { top: 0 - } - } diff --git a/node_modules/csscomb/test/options/space-before-closing-brace/test.css b/node_modules/csscomb/test/options/space-before-closing-brace/test.css deleted file mode 100644 index 2c0a59c..0000000 --- a/node_modules/csscomb/test/options/space-before-closing-brace/test.css +++ /dev/null @@ -1,5 +0,0 @@ -a{top: 0} -a {top: 0 } - -@media print{a{top: 0}} -@media print { a { top: 0 } } diff --git a/node_modules/csscomb/test/options/space-before-closing-brace/test.expected.css b/node_modules/csscomb/test/options/space-before-closing-brace/test.expected.css deleted file mode 100644 index 9a2f633..0000000 --- a/node_modules/csscomb/test/options/space-before-closing-brace/test.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a{top: 0} -a {top: 0} - -@media print{a{top: 0}} -@media print { a { top: 0}} diff --git a/node_modules/csscomb/test/options/space-before-colon-sass.js b/node_modules/csscomb/test/options/space-before-colon-sass.js deleted file mode 100644 index ede13e3..0000000 --- a/node_modules/csscomb/test/options/space-before-colon-sass.js +++ /dev/null @@ -1,16 +0,0 @@ -describe('options/space-before-colon-sass:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Should correct space', function() { - this.comb.configure({ 'space-before-colon': 1 }); - this.shouldBeEqual('test.sass', 'test.expected.sass'); - }); - - it('Should not correct space', function() { - this.comb.configure({ 'space-before-colon': 1 }); - this.shouldBeEqual('test2.sass'); - }); -}); - diff --git a/node_modules/csscomb/test/options/space-before-colon-sass/test.expected.sass b/node_modules/csscomb/test/options/space-before-colon-sass/test.expected.sass deleted file mode 100644 index a61746f..0000000 --- a/node_modules/csscomb/test/options/space-before-colon-sass/test.expected.sass +++ /dev/null @@ -1,3 +0,0 @@ -a - color : tomato - top : 0 diff --git a/node_modules/csscomb/test/options/space-before-colon-sass/test.sass b/node_modules/csscomb/test/options/space-before-colon-sass/test.sass deleted file mode 100644 index f38512b..0000000 --- a/node_modules/csscomb/test/options/space-before-colon-sass/test.sass +++ /dev/null @@ -1,3 +0,0 @@ -a - color: tomato - top: 0 diff --git a/node_modules/csscomb/test/options/space-before-colon-sass/test2.sass b/node_modules/csscomb/test/options/space-before-colon-sass/test2.sass deleted file mode 100644 index 3a5df0b..0000000 --- a/node_modules/csscomb/test/options/space-before-colon-sass/test2.sass +++ /dev/null @@ -1,3 +0,0 @@ -a - :color tomato - :top 0 diff --git a/node_modules/csscomb/test/options/space-before-colon.js b/node_modules/csscomb/test/options/space-before-colon.js deleted file mode 100644 index 1b9d7f8..0000000 --- a/node_modules/csscomb/test/options/space-before-colon.js +++ /dev/null @@ -1,68 +0,0 @@ -describe('options/space-before-colon:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-before-colon': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-before-colon': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-before-colon': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space before colon', function() { - this.comb.configure({ 'space-before-colon': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space before colon', function() { - this.comb.configure({ 'space-before-colon': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space before colon', function() { - this.comb.configure({ 'space-before-colon': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Should detect no whitespaces', function() { - this.shouldDetect( - ['space-before-colon'], - 'a { color:red }', - { 'space-before-colon': '' } - ); - }); - - it('Should detect no space from two variants', function() { - this.shouldDetect( - ['space-before-colon'], - 'a { color: red; color :red }', - { 'space-before-colon': '' } - ); - }); - - it('Should detect no whitespaces along three variants', function() { - this.shouldDetect( - ['space-before-colon'], - 'a { color: red; background :red } b { width:10px }', - { 'space-before-colon': '' } - ); - }); - - it('Should detect space', function() { - this.shouldDetect( - ['space-before-colon'], - 'a { color : red; background :red } b { width:10px }', - { 'space-before-colon': ' ' } - ); - }); -}); - diff --git a/node_modules/csscomb/test/options/space-before-colon/test-2.expected.css b/node_modules/csscomb/test/options/space-before-colon/test-2.expected.css deleted file mode 100644 index 8491cff..0000000 --- a/node_modules/csscomb/test/options/space-before-colon/test-2.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a { color : red } -a{color :red} -a {color : red} -a {color : /* foo */ red } -a {color /* bar */ : red } diff --git a/node_modules/csscomb/test/options/space-before-colon/test-3.expected.css b/node_modules/csscomb/test/options/space-before-colon/test-3.expected.css deleted file mode 100644 index 2d951a7..0000000 --- a/node_modules/csscomb/test/options/space-before-colon/test-3.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -a { color - : red } -a{color - :red} -a {color - : red} -a {color - : /* foo */ red } -a {color /* bar */ - : red } diff --git a/node_modules/csscomb/test/options/space-before-colon/test.css b/node_modules/csscomb/test/options/space-before-colon/test.css deleted file mode 100644 index 637656f..0000000 --- a/node_modules/csscomb/test/options/space-before-colon/test.css +++ /dev/null @@ -1,5 +0,0 @@ -a { color: red } -a{color:red} -a {color : red} -a {color : /* foo */ red } -a {color /* bar */ : red } diff --git a/node_modules/csscomb/test/options/space-before-colon/test.expected.css b/node_modules/csscomb/test/options/space-before-colon/test.expected.css deleted file mode 100644 index 9ffc1c4..0000000 --- a/node_modules/csscomb/test/options/space-before-colon/test.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a { color: red } -a{color:red} -a {color: red} -a {color: /* foo */ red } -a {color /* bar */: red } diff --git a/node_modules/csscomb/test/options/space-before-combinator.js b/node_modules/csscomb/test/options/space-before-combinator.js deleted file mode 100644 index a9eccf0..0000000 --- a/node_modules/csscomb/test/options/space-before-combinator.js +++ /dev/null @@ -1,84 +0,0 @@ -describe('options/space-before-combinator:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-before-combinator': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-before-combinator': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-before-combinator': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space before combinator', function() { - this.comb.configure({ 'space-before-combinator': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space before combinator', function() { - this.comb.configure({ 'space-before-combinator': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space before combinator', function() { - this.comb.configure({ 'space-before-combinator': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Should detect no whitespaces before combinator', function() { - this.shouldDetect( - ['space-before-combinator'], - 'a+b { color:red }', - { 'space-before-combinator': '' } - ); - }); - - it('Should detect a space before combinator', function() { - this.shouldDetect( - ['space-before-combinator'], - 'a + b { color:red }', - { 'space-before-combinator': ' ' } - ); - }); - - it('Should detect a space before combinator in long selector', function() { - this.shouldDetect( - ['space-before-combinator'], - 'a + b ~ c>d { color:red }', - { 'space-before-combinator': ' ' } - ); - }); - - it('Should detect a space before combinator in long selector, test 2', function() { - this.shouldDetect( - ['space-before-combinator'], - 'a>b + c + d { color:red }', - { 'space-before-combinator': ' ' } - ); - }); - - it('Should detect no whitespaces before combinator in long selector', function() { - this.shouldDetect( - ['space-before-combinator'], - 'a+b ~ c+d { color:red }', - { 'space-before-combinator': '' } - ); - }); - - it('Shouldn’t detect whitespaces before combinator in selector without combinators', function() { - this.shouldDetect( - ['space-before-combinator'], - 'a { color:red }', - {} - ); - }); -}); - diff --git a/node_modules/csscomb/test/options/space-before-combinator/test-2.expected.css b/node_modules/csscomb/test/options/space-before-combinator/test-2.expected.css deleted file mode 100644 index d1320b1..0000000 --- a/node_modules/csscomb/test/options/space-before-combinator/test-2.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -a >b { color: red } -a > b { color: red } -a >b { color: red } -a +b { color: red } -a + b { color: red } -a +b { color: red } -a ~b { color: red } -a ~ b { color: red } -a ~b { color: red } -a ~b + c >d { color: red } diff --git a/node_modules/csscomb/test/options/space-before-combinator/test-3.expected.css b/node_modules/csscomb/test/options/space-before-combinator/test-3.expected.css deleted file mode 100644 index 2a7f317..0000000 --- a/node_modules/csscomb/test/options/space-before-combinator/test-3.expected.css +++ /dev/null @@ -1,22 +0,0 @@ -a - >b { color: red } -a - > b { color: red } -a - >b { color: red } -a - +b { color: red } -a - + b { color: red } -a - +b { color: red } -a - ~b { color: red } -a - ~ b { color: red } -a - ~b { color: red } -a - ~b - + c - >d { color: red } diff --git a/node_modules/csscomb/test/options/space-before-combinator/test.css b/node_modules/csscomb/test/options/space-before-combinator/test.css deleted file mode 100644 index 4ad8d86..0000000 --- a/node_modules/csscomb/test/options/space-before-combinator/test.css +++ /dev/null @@ -1,10 +0,0 @@ -a>b { color: red } -a> b { color: red } -a >b { color: red } -a+b { color: red } -a+ b { color: red } -a +b { color: red } -a~b { color: red } -a~ b { color: red } -a ~b { color: red } -a ~b+ c>d { color: red } diff --git a/node_modules/csscomb/test/options/space-before-combinator/test.expected.css b/node_modules/csscomb/test/options/space-before-combinator/test.expected.css deleted file mode 100644 index 920bd51..0000000 --- a/node_modules/csscomb/test/options/space-before-combinator/test.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -a>b { color: red } -a> b { color: red } -a>b { color: red } -a+b { color: red } -a+ b { color: red } -a+b { color: red } -a~b { color: red } -a~ b { color: red } -a~b { color: red } -a~b+ c>d { color: red } diff --git a/node_modules/csscomb/test/options/space-before-opening-brace-scss.js b/node_modules/csscomb/test/options/space-before-opening-brace-scss.js deleted file mode 100644 index 3e40c5f..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace-scss.js +++ /dev/null @@ -1,10 +0,0 @@ -describe('options/space-before-opening-brace (scss):', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Issue 231', function() { - this.comb.configure({ 'space-before-opening-brace': 1 }); - this.shouldBeEqual('issue-231.scss', 'issue-231.expected.scss'); - }); -}); diff --git a/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.expected.scss b/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.expected.scss deleted file mode 100644 index 917eb73..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.expected.scss +++ /dev/null @@ -1,8 +0,0 @@ -li { - float: left; - @include respond-to(mobile) { - float: none; - width: $width; - $width: 100%; - } -} diff --git a/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.scss b/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.scss deleted file mode 100644 index f0abf87..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace-scss/issue-231.scss +++ /dev/null @@ -1,8 +0,0 @@ -li{ - float: left; - @include respond-to(mobile){ - float: none; - width: $width; - $width: 100%; - } -} diff --git a/node_modules/csscomb/test/options/space-before-opening-brace.js b/node_modules/csscomb/test/options/space-before-opening-brace.js deleted file mode 100644 index f5eb60d..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace.js +++ /dev/null @@ -1,89 +0,0 @@ -describe('options/space-before-opening-brace:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-before-opening-brace': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-before-opening-brace': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-before-opening-brace': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space before {', function() { - this.comb.configure({ 'space-before-opening-brace': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space before {', function() { - this.comb.configure({ 'space-before-opening-brace': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space before {', function() { - this.comb.configure({ 'space-before-opening-brace': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Issue 232', function() { - this.comb.configure({ 'space-before-opening-brace': 1 }); - this.shouldBeEqual('issue-232.css', 'issue-232.expected.css'); - }); - - it('Should detect no whitespace', function() { - this.shouldDetect( - ['space-before-opening-brace'], - 'a{top:0}', - { 'space-before-opening-brace': '' } - ); - }); - - it('Should detect whitespace', function() { - this.shouldDetect( - ['space-before-opening-brace'], - 'a \n {top:0}', - { 'space-before-opening-brace': ' \n ' } - ); - }); - - it('Should detect no whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-before-opening-brace'], - 'a{top:0} b {left:0}', - { 'space-before-opening-brace': '' } - ); - }); - - it('Should detect whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-before-opening-brace'], - 'a {top:0} b{left:0}', - { 'space-before-opening-brace': ' ' } - ); - }); - - it('Should detect no whitespace (3 blocks)', function() { - this.shouldDetect( - ['space-before-opening-brace'], - 'a {top:0} b{left:0} c{right:0}', - { 'space-before-opening-brace': '' } - ); - }); - - it('Should detect whitespace (3 blocks)', function() { - this.shouldDetect( - ['space-before-opening-brace'], - 'a{top:0} b {left:0} c {right:0}', - { 'space-before-opening-brace': ' ' } - ); - }); -}); - diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.css b/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.css deleted file mode 100644 index bc99e74..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.css +++ /dev/null @@ -1,13 +0,0 @@ -@font-face -{ - font-family: Panda; - src: url(panda.ttf); -} - -@media screen and (max-width: 400px) -{ - @-ms-viewport - { - width: 320px; - } -} diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.expected.css b/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.expected.css deleted file mode 100644 index 04d76f3..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace/issue-232.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -@font-face { - font-family: Panda; - src: url(panda.ttf); -} - -@media screen and (max-width: 400px) { - @-ms-viewport { - width: 320px; - } -} diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/test-2.expected.css b/node_modules/csscomb/test/options/space-before-opening-brace/test-2.expected.css deleted file mode 100644 index 68a688a..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace/test-2.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a {top: 0} -a {top: 0} - -@media print {a {top: 0}} -@media print { a { top: 0 } } diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/test-3.expected.css b/node_modules/csscomb/test/options/space-before-opening-brace/test-3.expected.css deleted file mode 100644 index 8efc4e9..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace/test-3.expected.css +++ /dev/null @@ -1,11 +0,0 @@ -a - {top: 0} -a - {top: 0} - -@media print - {a - {top: 0}} -@media print - { a - { top: 0 } } diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/test.css b/node_modules/csscomb/test/options/space-before-opening-brace/test.css deleted file mode 100644 index 0f8fadc..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace/test.css +++ /dev/null @@ -1,5 +0,0 @@ -a{top: 0} -a {top: 0} - -@media print{a{top: 0}} -@media print { a { top: 0 } } diff --git a/node_modules/csscomb/test/options/space-before-opening-brace/test.expected.css b/node_modules/csscomb/test/options/space-before-opening-brace/test.expected.css deleted file mode 100644 index 32014dd..0000000 --- a/node_modules/csscomb/test/options/space-before-opening-brace/test.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -a{top: 0} -a{top: 0} - -@media print{a{top: 0}} -@media print{ a{ top: 0 } } diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter.js b/node_modules/csscomb/test/options/space-before-selector-delimiter.js deleted file mode 100644 index 3770c75..0000000 --- a/node_modules/csscomb/test/options/space-before-selector-delimiter.js +++ /dev/null @@ -1,83 +0,0 @@ -describe('options/space-before-selector-delimiter:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-before-selector-delimiter': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-before-selector-delimiter': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-before-selector-delimiter': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space before selector delimiter', function() { - this.comb.configure({ 'space-before-selector-delimiter': 0 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space before selector delimiter', function() { - this.comb.configure({ 'space-before-selector-delimiter': ' ' }); - this.shouldBeEqual('test.css', 'test-2.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space before selector delimiter', function() { - this.comb.configure({ 'space-before-selector-delimiter': '\n ' }); - this.shouldBeEqual('test.css', 'test-3.expected.css'); - }); - - it('Should detect no whitespace', function() { - this.shouldDetect( - ['space-before-selector-delimiter'], - 'a,b{top:0}', - { 'space-before-selector-delimiter': '' } - ); - }); - - it('Should detect whitespace', function() { - this.shouldDetect( - ['space-before-selector-delimiter'], - 'a \n ,b {top:0}', - { 'space-before-selector-delimiter': ' \n ' } - ); - }); - - it('Should detect no whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-before-selector-delimiter'], - 'a,b{top:0} a ,b{left:0}', - { 'space-before-selector-delimiter': '' } - ); - }); - - it('Should detect whitespace (2 blocks)', function() { - this.shouldDetect( - ['space-before-selector-delimiter'], - 'a ,b {top:0} b,a{left:0}', - { 'space-before-selector-delimiter': ' ' } - ); - }); - - it('Should detect no whitespace (3 blocks)', function() { - this.shouldDetect( - ['space-before-selector-delimiter'], - 'a ,b{top:0} b,c{left:0} c,d{right:0}', - { 'space-before-selector-delimiter': '' } - ); - }); - - it('Should detect whitespace (3 blocks)', function() { - this.shouldDetect( - ['space-before-selector-delimiter'], - 'a,b{top:0} b ,c{left:0} c ,d{right:0}', - { 'space-before-selector-delimiter': ' ' } - ); - }); -}); diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter/test-2.expected.css b/node_modules/csscomb/test/options/space-before-selector-delimiter/test-2.expected.css deleted file mode 100644 index 90b232e..0000000 --- a/node_modules/csscomb/test/options/space-before-selector-delimiter/test-2.expected.css +++ /dev/null @@ -1,6 +0,0 @@ -a ,b { color: red } -a , b { color: red } -a ,b { color: red } -a , -b { color: red } -a+b ,c>d ,e{ color: red } \ No newline at end of file diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter/test-3.expected.css b/node_modules/csscomb/test/options/space-before-selector-delimiter/test-3.expected.css deleted file mode 100644 index 1b454c8..0000000 --- a/node_modules/csscomb/test/options/space-before-selector-delimiter/test-3.expected.css +++ /dev/null @@ -1,12 +0,0 @@ -a - ,b { color: red } -a - , b { color: red } -a - ,b { color: red } -a - , -b { color: red } -a+b - ,c>d - ,e{ color: red } \ No newline at end of file diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter/test.css b/node_modules/csscomb/test/options/space-before-selector-delimiter/test.css deleted file mode 100644 index cd8e7d7..0000000 --- a/node_modules/csscomb/test/options/space-before-selector-delimiter/test.css +++ /dev/null @@ -1,6 +0,0 @@ -a,b { color: red } -a, b { color: red } -a ,b { color: red } -a, -b { color: red } -a+b,c>d,e{ color: red } \ No newline at end of file diff --git a/node_modules/csscomb/test/options/space-before-selector-delimiter/test.expected.css b/node_modules/csscomb/test/options/space-before-selector-delimiter/test.expected.css deleted file mode 100644 index 3c566c5..0000000 --- a/node_modules/csscomb/test/options/space-before-selector-delimiter/test.expected.css +++ /dev/null @@ -1,6 +0,0 @@ -a,b { color: red } -a, b { color: red } -a,b { color: red } -a, -b { color: red } -a+b,c>d,e{ color: red } \ No newline at end of file diff --git a/node_modules/csscomb/test/options/space-between-declarations.js b/node_modules/csscomb/test/options/space-between-declarations.js deleted file mode 100644 index 9f02e54..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations.js +++ /dev/null @@ -1,45 +0,0 @@ -describe('options/space-between-declarations:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Array value => should not change anything', function() { - this.comb.configure({ 'space-between-declarations': ['', ' '] }); - this.shouldBeEqual('test.css'); - }); - - it('Invalid string value => should not change anything', function() { - this.comb.configure({ 'space-between-declarations': ' nani ' }); - this.shouldBeEqual('test.css'); - }); - - it('Float number value => should not change anything', function() { - this.comb.configure({ 'space-between-declarations': 3.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Integer value => should set proper space after declaration', function() { - this.comb.configure({ 'space-between-declarations': 0 }); - this.shouldBeEqual('integer-value.css', 'integer-value.expected.css'); - }); - - it('Valid string value (spaces only) => should set proper space after declaration', function() { - this.comb.configure({ 'space-between-declarations': ' ' }); - this.shouldBeEqual('space-value.css', 'space-value.expected.css'); - }); - - it('Valid string value (spaces and newlines) => should set proper space after declaration', function() { - this.comb.configure({ 'space-between-declarations': '\n ' }); - this.shouldBeEqual('space-newline-value.css', 'space-newline-value.expected.css'); - }); - - it('Should leave comments as is', function() { - this.comb.configure({ 'space-between-declarations': 1 }); - this.shouldBeEqual('comments.css', 'comments.expected.css'); - }); - - it('Issue 239', function() { - this.comb.configure({ 'space-between-declarations': '\n ' }); - this.shouldBeEqual('issue-239.css', 'issue-239.expected.css'); - }); -}); diff --git a/node_modules/csscomb/test/options/space-between-declarations/comments.css b/node_modules/csscomb/test/options/space-between-declarations/comments.css deleted file mode 100644 index 0d8b931..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/comments.css +++ /dev/null @@ -1,8 +0,0 @@ -a { - color: tomato; - /* comment */ - top: 0; /* comment */ - left: 10px; - right: 0; - /* comment */ - } diff --git a/node_modules/csscomb/test/options/space-between-declarations/comments.expected.css b/node_modules/csscomb/test/options/space-between-declarations/comments.expected.css deleted file mode 100644 index 5903c20..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/comments.expected.css +++ /dev/null @@ -1,6 +0,0 @@ -a { - color: tomato; - /* comment */ - top: 0; /* comment */ left: 10px; right: 0; - /* comment */ - } diff --git a/node_modules/csscomb/test/options/space-between-declarations/integer-value.css b/node_modules/csscomb/test/options/space-between-declarations/integer-value.css deleted file mode 100644 index de2c649..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/integer-value.css +++ /dev/null @@ -1,6 +0,0 @@ -a { - color: tomato; - - top: 0; - left: 10px - } diff --git a/node_modules/csscomb/test/options/space-between-declarations/integer-value.expected.css b/node_modules/csscomb/test/options/space-between-declarations/integer-value.expected.css deleted file mode 100644 index 5d12017..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/integer-value.expected.css +++ /dev/null @@ -1,3 +0,0 @@ -a { - color: tomato;top: 0;left: 10px - } diff --git a/node_modules/csscomb/test/options/space-between-declarations/issue-239.css b/node_modules/csscomb/test/options/space-between-declarations/issue-239.css deleted file mode 100644 index ccf6ba7..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/issue-239.css +++ /dev/null @@ -1,2 +0,0 @@ -html{ - color:#444;font-family:proxima-nova;font-size:62.5%;font-weight:300;line-height:1.5;} diff --git a/node_modules/csscomb/test/options/space-between-declarations/issue-239.expected.css b/node_modules/csscomb/test/options/space-between-declarations/issue-239.expected.css deleted file mode 100644 index ab145f7..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/issue-239.expected.css +++ /dev/null @@ -1,6 +0,0 @@ -html{ - color:#444; - font-family:proxima-nova; - font-size:62.5%; - font-weight:300; - line-height:1.5;} diff --git a/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.css b/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.css deleted file mode 100644 index ff86611..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.css +++ /dev/null @@ -1,4 +0,0 @@ -a { - color: tomato;top: 0; left: 10px; - right: 0; width: 100% \9; -} diff --git a/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.expected.css b/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.expected.css deleted file mode 100644 index 17c237a..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/space-newline-value.expected.css +++ /dev/null @@ -1,7 +0,0 @@ -a { - color: tomato; - top: 0; - left: 10px; - right: 0; - width: 100% \9; -} diff --git a/node_modules/csscomb/test/options/space-between-declarations/space-value.css b/node_modules/csscomb/test/options/space-between-declarations/space-value.css deleted file mode 100644 index de2c649..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/space-value.css +++ /dev/null @@ -1,6 +0,0 @@ -a { - color: tomato; - - top: 0; - left: 10px - } diff --git a/node_modules/csscomb/test/options/space-between-declarations/space-value.expected.css b/node_modules/csscomb/test/options/space-between-declarations/space-value.expected.css deleted file mode 100644 index 6795d9c..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/space-value.expected.css +++ /dev/null @@ -1,3 +0,0 @@ -a { - color: tomato; top: 0; left: 10px - } diff --git a/node_modules/csscomb/test/options/space-between-declarations/test.css b/node_modules/csscomb/test/options/space-between-declarations/test.css deleted file mode 100644 index 7a75e51..0000000 --- a/node_modules/csscomb/test/options/space-between-declarations/test.css +++ /dev/null @@ -1,2 +0,0 @@ -a { - animal: panda;color: tomato; top: 0; } diff --git a/node_modules/csscomb/test/options/strip-spaces.js b/node_modules/csscomb/test/options/strip-spaces.js deleted file mode 100644 index b8f19b3..0000000 --- a/node_modules/csscomb/test/options/strip-spaces.js +++ /dev/null @@ -1,113 +0,0 @@ -var assert = require('assert'); - -describe('options/strip-spaces', function() { - it('Invalid value should not trim trailing spaces', function() { - this.comb.configure({ 'strip-spaces': 'foobar' }); - assert.equal( - this.comb.processString('a { color: red } \n'), - 'a { color: red } \n' - ); - }); - it('Boolean true value should trim all trailing spaces', function() { - this.comb.configure({ 'strip-spaces': true }); - assert.equal( - this.comb.processString( - 'a { color: red } \n' + - 'a{color:red}\t /* foobar */\t \n' + - 'a {color:red} \n \n' - ), - 'a { color: red }\n' + - 'a{color:red}\t /* foobar */\n' + - 'a {color:red}\n' - ); - }); - it('Boolean true value should trim trailing spaces at eof', function() { - this.comb.configure({ 'strip-spaces': true }); - assert.equal( - this.comb.processString( - 'a {color:red} ' - ), - 'a {color:red}' - ); - }); - - it('Should detect strip-spaces option set to `true`', function() { - this.shouldDetect( - ['strip-spaces'], - 'a { color: red }', - { - 'strip-spaces': true - } - ); - }); - - it('Should detect strip-spaces option set to `false`', function() { - this.shouldDetect( - ['strip-spaces'], - 'a { color: red } ', - { - 'strip-spaces': false - } - ); - }); - - it('Should detect strip-spaces option set to `true` with newline', function() { - this.shouldDetect( - ['strip-spaces'], - 'a { color: red }\nb { color: blue }', - { - 'strip-spaces': true - } - ); - }); - - it('Should detect strip-spaces option set to `false` with newline', function() { - this.shouldDetect( - ['strip-spaces'], - 'a { color: red } \nb { color: blue }', - { - 'strip-spaces': false - } - ); - }); - - it('Should detect strip-spaces option set to `true` inside a value', function() { - this.shouldDetect( - ['strip-spaces'], - 'a {\n color:\n red }', - { - 'strip-spaces': true - } - ); - }); - - it('Should detect strip-spaces option set to `false` inside a value', function() { - this.shouldDetect( - ['strip-spaces'], - 'a {\n color: \n red }', - { - 'strip-spaces': false - } - ); - }); - - it('Should detect strip-spaces option set to `true` if the only trailing space is the last newline', function() { - this.shouldDetect( - ['strip-spaces'], - 'a { color: red }\n', - { - 'strip-spaces': true - } - ); - }); - - it('Should detect strip-spaces option set to `false` if there is more than one newline at the end', function() { - this.shouldDetect( - ['strip-spaces'], - 'a { color: red }\n\n', - { - 'strip-spaces': false - } - ); - }); -}); diff --git a/node_modules/csscomb/test/options/tab-size.js b/node_modules/csscomb/test/options/tab-size.js deleted file mode 100644 index 59bb9f0..0000000 --- a/node_modules/csscomb/test/options/tab-size.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('options/tab-size:', function() { - beforeEach(function() { - this.filename = __filename; - }); - - it('Test 1: String value => should not change anything', function() { - this.comb.configure({ 'tab-size': ' ' }); - this.shouldBeEqual('test.css'); - }); - - it('Test 2: Float value => should not change anything', function() { - this.comb.configure({ 'tab-size': 4.5 }); - this.shouldBeEqual('test.css'); - }); - - it('Test 3: Integer value => should replace tabs with proper number of spaces', function() { - this.comb.configure({ 'tab-size': 4 }); - this.shouldBeEqual('test.css', 'test.expected.css'); - }); -}); diff --git a/node_modules/csscomb/test/options/tab-size/test.css b/node_modules/csscomb/test/options/tab-size/test.css deleted file mode 100644 index a5ff8ef..0000000 --- a/node_modules/csscomb/test/options/tab-size/test.css +++ /dev/null @@ -1,4 +0,0 @@ -a { - color: tomato; - top: 0; - } diff --git a/node_modules/csscomb/test/options/tab-size/test.expected.css b/node_modules/csscomb/test/options/tab-size/test.expected.css deleted file mode 100644 index 248453a..0000000 --- a/node_modules/csscomb/test/options/tab-size/test.expected.css +++ /dev/null @@ -1,4 +0,0 @@ -a { - color: tomato; - top: 0; - } diff --git a/node_modules/csscomb/test/options/unitless-zero.js b/node_modules/csscomb/test/options/unitless-zero.js deleted file mode 100644 index f47be91..0000000 --- a/node_modules/csscomb/test/options/unitless-zero.js +++ /dev/null @@ -1,103 +0,0 @@ -var assert = require('assert'); - -describe('options/unitless-zero', function() { - it('Should remove units in zero-valued dimensions', function() { - this.comb.configure({ 'unitless-zero': true }); - assert.equal( - this.comb.processString( - 'div { margin: 0em; padding: 0px }' - ), - 'div { margin: 0; padding: 0 }' - ); - assert.equal( - this.comb.processString( - 'div { margin: 0% }' - ), - 'div { margin: 0 }' - ); - }); - - it('Should remove units in zero-valued media-query params', function() { - this.comb.configure({ 'unitless-zero': true }); - assert.equal( - this.comb.processString('@media all and (min-width: 0px) { div { margin: 0em; padding: 0px } }'), - '@media all and (min-width: 0) { div { margin: 0; padding: 0 } }' - ); - }); - - it('Should not remove units (degs) in rotate property', function() { - this.comb.configure({ 'unitless-zero': true }); - assert.equal( - this.comb.processString( - 'div { -webkit-transform: rotate(0deg); }' - ), - 'div { -webkit-transform: rotate(0deg); }' - ); - }); - - it('Should detect unitless zero option', function() { - this.shouldDetect( - ['unitless-zero'], - 'a { width: 0 }', - { - 'unitless-zero': true - } - ); - }); - - it('Should detect zero with unit', function() { - this.shouldDetect( - ['unitless-zero'], - 'a { width: 0px }', - { - 'unitless-zero': false - } - ); - }); - - it('Should detect unitless zero option with multiple values', function() { - this.shouldDetect( - ['unitless-zero'], - 'a { padding: 0px 0 0 }', - { - 'unitless-zero': true - } - ); - }); - - it('Should detect zero with unit and multiple values', function() { - this.shouldDetect( - ['unitless-zero'], - 'a { padding: 0px 0 0em }', - { - 'unitless-zero': false - } - ); - }); - - it('Shouldn’t detect unitless zero option if there is no unit', function() { - this.shouldDetect( - ['unitless-zero'], - 'a { color: red }', - {} - ); - }); - - it('Shouldn’t detect unitless zero option if there is `deg` unit', function() { - this.shouldDetect( - ['unitless-zero'], - 'a { transform: rotate(0deg) }', - {} - ); - }); - - it('Should detect unitless zero option with percents', function() { - this.shouldDetect( - ['unitless-zero'], - 'a { padding: 0% 0 0 }', - { - 'unitless-zero': true - } - ); - }); -}); diff --git a/node_modules/csscomb/test/options/vendor-prefix-align-sass.js b/node_modules/csscomb/test/options/vendor-prefix-align-sass.js deleted file mode 100644 index 4e3a746..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align-sass.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('options/vendor-prefix-align', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({ 'vendor-prefix-align': true }); - }); - - it('Should align prexied values', function() { - this.shouldBeEqual('value.sass', 'value.expected.sass'); - }); - - it('Should not align prefixed property names', function() { - this.shouldBeEqual('property.sass'); - }); -}); diff --git a/node_modules/csscomb/test/options/vendor-prefix-align-sass/property.sass b/node_modules/csscomb/test/options/vendor-prefix-align-sass/property.sass deleted file mode 100644 index b488c7a..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align-sass/property.sass +++ /dev/null @@ -1,4 +0,0 @@ -a - -webkit-color: panda - color: panda - -moz-color: panda diff --git a/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.expected.sass b/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.expected.sass deleted file mode 100644 index 4df59da..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.expected.sass +++ /dev/null @@ -1,4 +0,0 @@ -a - color: panda - color: -webkit-panda - color: -moz-panda diff --git a/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.sass b/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.sass deleted file mode 100644 index e3cff56..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align-sass/value.sass +++ /dev/null @@ -1,4 +0,0 @@ -a - color: panda - color: -webkit-panda - color: -moz-panda diff --git a/node_modules/csscomb/test/options/vendor-prefix-align.js b/node_modules/csscomb/test/options/vendor-prefix-align.js deleted file mode 100644 index 353b3e1..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align.js +++ /dev/null @@ -1,156 +0,0 @@ -describe('options/vendor-prefix-align', function() { - beforeEach(function() { - this.filename = __filename; - this.comb.configure({ 'vendor-prefix-align': true }); - }); - - it('Should correctly work when there is comment before property name', function() { - this.shouldBeEqual('with-comment-property.css', 'with-comment-property.expected.css'); - }); - - it('Should correctly work when there is comment before property name. Test 2', function() { - this.shouldBeEqual('with-comment-property-2.css', 'with-comment-property-2.expected.css'); - }); - - it('Should correctly work when there is comment before property name. Test 3', function() { - this.shouldBeEqual('multiline-comments.css', 'multiline-comments.expected.css'); - }); - - it('Should correctly align prefixes in properties', function() { - this.shouldBeEqual('property-align.css', 'property-align.expected.css'); - }); - - it('Should correctly align prefixes in values', function() { - this.shouldBeEqual('value-align.css', 'value-align.expected.css'); - }); - - it('Should not touch already align prefixes', function() { - this.shouldBeEqual('already-aligned.css', 'already-aligned.expected.css'); - }); - - it('Should correctly align prefixes in properties and values at the same time', function() { - this.shouldBeEqual('both.css', 'both.expected.css'); - }); - - it('Should correctly work when value and property names are the same', function() { - this.shouldBeEqual('same-name.css', 'same-name.expected.css'); - }); - - it('Should correctly work when there is no whitespace after colon', function() { - this.shouldBeEqual('without-space.css', 'without-space.expected.css'); - }); - - it('Should correctly work when there is comment after colon', function() { - this.shouldBeEqual('with-comment.css', 'with-comment.expected.css'); - }); - - it('Should not do anything with oneliners', function() { - this.shouldBeEqual('one-line.css', 'one-line.expected.css'); - }); - - it('Should not do anything with oneliners. Test 2', function() { - this.shouldBeEqual('one-line-2.css', 'one-line-2.expected.css'); - }); - - it('Should always correctly align prefixes', function() { - this.shouldBeEqual('complex.css', 'complex.expected.css'); - }); - - it('Issue 193: should handle declarations without preceding spaces', function() { - this.shouldBeEqual('issue-193.css', 'issue-193.expected.css'); - }); - - it('Issue 241: should not break tabs', function() { - this.comb.configure({ - 'block-indent': '\t', - 'vendor-prefix-align': true - }); - this.shouldBeEqual('issue-241.css', 'issue-241.expected.css'); - }); - - it('Shouldn not detect anything if there are no prefixed groups', function() { - this.shouldDetect( - ['vendor-prefix-align'], - 'a{ color: red }a{ -webkit-transform: translateZ(0) }', - {} - ); - }); - - it('Shouldn detect vendor-prefix-align as false in properties', function() { - this.shouldDetect( - ['vendor-prefix-align'], - this.readFile('property-align.css'), - { - 'vendor-prefix-align': false - } - ); - }); - - it('Shouldn detect vendor-prefix-align as true in properties', function() { - this.shouldDetect( - ['vendor-prefix-align'], - this.readFile('property-align.expected.css'), - { - 'vendor-prefix-align': true - } - ); - }); - - it('Shouldn detect vendor-prefix-align as false in values', function() { - this.shouldDetect( - ['vendor-prefix-align'], - this.readFile('value-align.css'), - { - 'vendor-prefix-align': false - } - ); - }); - - it('Shouldn detect vendor-prefix-align as true in values', function() { - this.shouldDetect( - ['vendor-prefix-align'], - this.readFile('value-align.expected.css'), - { - 'vendor-prefix-align': true - } - ); - }); - - it('Shouldn detect vendor-prefix-align as true, test 1', function() { - this.shouldDetect( - ['vendor-prefix-align'], - this.readFile('already-aligned.css'), - { - 'vendor-prefix-align': true - } - ); - }); - - it('Shouldn detect vendor-prefix-align as true, test 2', function() { - this.shouldDetect( - ['vendor-prefix-align'], - this.readFile('complex.expected.css'), - { - 'vendor-prefix-align': true - } - ); - }); - - it('Shouldn detect vendor-prefix-align as false', function() { - this.shouldDetect( - ['vendor-prefix-align'], - this.readFile('complex.css'), - { - 'vendor-prefix-align': false - } - ); - }); - - it('Should not detect anything in simple case', function() { - this.shouldDetect( - ['vendor-prefix-align'], - 'a{border:0;}', - {} - ); - }); -}); diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.css b/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.css deleted file mode 100644 index 35b7eee..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.css +++ /dev/null @@ -1,11 +0,0 @@ -.radio-button_theme_normal .radio-button__radio:before -{ - background: rgba(0,0,0,.4); - background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%); - background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - - -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 1px 0 rgba(0,0,0,.07); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.expected.css deleted file mode 100644 index 35b7eee..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/already-aligned.expected.css +++ /dev/null @@ -1,11 +0,0 @@ -.radio-button_theme_normal .radio-button__radio:before -{ - background: rgba(0,0,0,.4); - background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%); - background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - - -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 1px 0 rgba(0,0,0,.07); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/both.css b/node_modules/csscomb/test/options/vendor-prefix-align/both.css deleted file mode 100644 index 3791d29..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/both.css +++ /dev/null @@ -1,5 +0,0 @@ -.serp-block__head_animation_yes -{ - -webkit-transition: -webkit-transform 150ms linear; - transition: transform 150ms linear; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/both.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/both.expected.css deleted file mode 100644 index f58aa02..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/both.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -.serp-block__head_animation_yes -{ - -webkit-transition: -webkit-transform 150ms linear; - transition: transform 150ms linear; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/complex.css b/node_modules/csscomb/test/options/vendor-prefix-align/complex.css deleted file mode 100644 index 3f896df..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/complex.css +++ /dev/null @@ -1,30 +0,0 @@ -@media all and (min-width:0) -{ - .radio-button_theme_normal .radio-button__radio:before - { - background: rgba(0,0,0,.4); - background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%); - background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 1px 0 rgba(0,0,0,.07); - } - - /* :after — фон */ - .radio-button_theme_normal .radio-button__radio:after - { - background: #fff; - background: -webkit-linear-gradient(top, #fff 0,#eee 100%); - background: -moz-linear-gradient(top, #fff 0, #eee 100%); - background: -o-linear-gradient(top, #fff 0,#eee 100%); - background: linear-gradient(to bottom, #fff 0,#eee 100%); - } - - /* _focused_yes */ - .radio-button_theme_normal .radio-button__radio_focused_yes:before - { - -moz-box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07); - } -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/complex.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/complex.expected.css deleted file mode 100644 index 688ecd6..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/complex.expected.css +++ /dev/null @@ -1,30 +0,0 @@ -@media all and (min-width:0) -{ - .radio-button_theme_normal .radio-button__radio:before - { - background: rgba(0,0,0,.4); - background: -webkit-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: -moz-linear-gradient(top, rgba(0,0,0,.2) 0, rgba(0,0,0,.4) 100%); - background: -o-linear-gradient(top, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - background: linear-gradient(to bottom, rgba(0,0,0,.2) 0,rgba(0,0,0,.4) 100%); - -moz-box-shadow: 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 1px 0 rgba(0,0,0,.07); - } - - /* :after — фон */ - .radio-button_theme_normal .radio-button__radio:after - { - background: #fff; - background: -webkit-linear-gradient(top, #fff 0,#eee 100%); - background: -moz-linear-gradient(top, #fff 0, #eee 100%); - background: -o-linear-gradient(top, #fff 0,#eee 100%); - background: linear-gradient(to bottom, #fff 0,#eee 100%); - } - - /* _focused_yes */ - .radio-button_theme_normal .radio-button__radio_focused_yes:before - { - -moz-box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07); - box-shadow: 0 0 6px 2px rgba(255,204,0,.7), 0 1px 0 rgba(0,0,0,.07); - } -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.css b/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.css deleted file mode 100644 index e0047dd..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.css +++ /dev/null @@ -1,2 +0,0 @@ -li {color: #7799c8; - font-size: 10px;} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.expected.css deleted file mode 100644 index e0047dd..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/issue-193.expected.css +++ /dev/null @@ -1,2 +0,0 @@ -li {color: #7799c8; - font-size: 10px;} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.css b/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.css deleted file mode 100644 index e562a61..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.css +++ /dev/null @@ -1,6 +0,0 @@ -* -{ - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.expected.css deleted file mode 100644 index bbc0e34..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/issue-241.expected.css +++ /dev/null @@ -1,6 +0,0 @@ -* -{ - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.css b/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.css deleted file mode 100644 index 33c66c5..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.css +++ /dev/null @@ -1,9 +0,0 @@ -a -{ - -webkit-color: panda; - /* - * /\_/\ - * ( o.o ) - * > ^ < - */ -moz-color: panda; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.expected.css deleted file mode 100644 index 6bc01b3..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/multiline-comments.expected.css +++ /dev/null @@ -1,9 +0,0 @@ -a -{ - -webkit-color: panda; - /* - * /\_/\ - * ( o.o ) - * > ^ < - */ -moz-color: panda; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.css b/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.css deleted file mode 100644 index 6050079..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.css +++ /dev/null @@ -1 +0,0 @@ -a{top:0} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.expected.css deleted file mode 100644 index 6050079..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/one-line-2.expected.css +++ /dev/null @@ -1 +0,0 @@ -a{top:0} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/one-line.css b/node_modules/csscomb/test/options/vendor-prefix-align/one-line.css deleted file mode 100644 index 3426596..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/one-line.css +++ /dev/null @@ -1 +0,0 @@ -a{ -webkit-color:tomato; -moz-color:tomato; top:0 } diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/one-line.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/one-line.expected.css deleted file mode 100644 index 3426596..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/one-line.expected.css +++ /dev/null @@ -1 +0,0 @@ -a{ -webkit-color:tomato; -moz-color:tomato; top:0 } diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/property-align.css b/node_modules/csscomb/test/options/vendor-prefix-align/property-align.css deleted file mode 100644 index b19d6b7..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/property-align.css +++ /dev/null @@ -1,8 +0,0 @@ -a -{ - color: #fff; - - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/property-align.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/property-align.expected.css deleted file mode 100644 index 2580857..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/property-align.expected.css +++ /dev/null @@ -1,8 +0,0 @@ -a -{ - color: #fff; - - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/same-name.css b/node_modules/csscomb/test/options/vendor-prefix-align/same-name.css deleted file mode 100644 index dbdc5c4..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/same-name.css +++ /dev/null @@ -1,7 +0,0 @@ -.test -{ - -webkit-transition: -webkit-transform .6s; - transition: transform .6s; - -webkit-transform: scale(.6, .6); - transform: scale(.6, .6); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/same-name.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/same-name.expected.css deleted file mode 100644 index 9059807..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/same-name.expected.css +++ /dev/null @@ -1,7 +0,0 @@ -.test -{ - -webkit-transition: -webkit-transform .6s; - transition: transform .6s; - -webkit-transform: scale(.6, .6); - transform: scale(.6, .6); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/value-align.css b/node_modules/csscomb/test/options/vendor-prefix-align/value-align.css deleted file mode 100644 index f15a362..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/value-align.css +++ /dev/null @@ -1,10 +0,0 @@ -b -{ - color: #fff; - - background: -webkit-linear-gradient(linear, left top, right top, color-stop(0,rgba(255,255,255,0)), color-stop(20%, #fff)); - background: -moz-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%); - background: -o-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%); - background: -ms-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%); - background: linear-gradient(to right, rgba(255,255,255,0) 0, #fff 20%); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/value-align.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/value-align.expected.css deleted file mode 100644 index 60aba2e..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/value-align.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -b -{ - color: #fff; - - background: -webkit-linear-gradient(linear, left top, right top, color-stop(0,rgba(255,255,255,0)), color-stop(20%, #fff)); - background: -moz-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%); - background: -o-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%); - background: -ms-linear-gradient(left, rgba(255,255,255,0) 0, #fff 20%); - background: linear-gradient(to right, rgba(255,255,255,0) 0, #fff 20%); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.css deleted file mode 100644 index 113d334..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.css +++ /dev/null @@ -1,3 +0,0 @@ -a -{ - top: 0;/* ololo */margin: 0;} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.expected.css deleted file mode 100644 index 113d334..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property-2.expected.css +++ /dev/null @@ -1,3 +0,0 @@ -a -{ - top: 0;/* ololo */margin: 0;} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.css deleted file mode 100644 index 9e3bea3..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.css +++ /dev/null @@ -1,5 +0,0 @@ -body -{ - -webkit-transition: transform 150ms linear; - /* comment */ transition: transform 150ms linear; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.expected.css deleted file mode 100644 index b65b210..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment-property.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -body -{ - -webkit-transition: transform 150ms linear; - /* comment */ transition: transform 150ms linear; -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.css deleted file mode 100644 index f792a8c..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.css +++ /dev/null @@ -1,5 +0,0 @@ -body -{ - background: -webkit-linear-gradient(nani); - background: /* comment */ -moz-linear-gradient(nani); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.expected.css deleted file mode 100644 index 9d5d161..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/with-comment.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -body -{ - background: -webkit-linear-gradient(nani); - background: /* comment */ -moz-linear-gradient(nani); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/without-space.css b/node_modules/csscomb/test/options/vendor-prefix-align/without-space.css deleted file mode 100644 index 09bd955..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/without-space.css +++ /dev/null @@ -1,5 +0,0 @@ -body -{ - background:-webkit-linear-gradient(nani); - background:-moz-linear-gradient(nani); -} diff --git a/node_modules/csscomb/test/options/vendor-prefix-align/without-space.expected.css b/node_modules/csscomb/test/options/vendor-prefix-align/without-space.expected.css deleted file mode 100644 index 1be5389..0000000 --- a/node_modules/csscomb/test/options/vendor-prefix-align/without-space.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -body -{ - background:-webkit-linear-gradient(nani); - background: -moz-linear-gradient(nani); -} diff --git a/package.json b/package.json index d4ef808..29061b7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "sublime-csscomb", "version": "1.2.0", "dependencies": { - "csscomb": "3.0.4" + "csscomb": "4.2.0" }, "license": "MIT" }