(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){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])
return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded=true;return module.exports;}
__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.p="";return __webpack_require__(0);})
([function(module,exports,__webpack_require__){'use strict';var Node=__webpack_require__(1);var parse=__webpack_require__(7);module.exports={createNode:function createNode(options){return new Node(options);},parse:parse};},function(module,exports,__webpack_require__){'use strict';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;}
Node.prototype.contains=function contains(type){return this.content.some(function(node){return node.type===type;});};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;};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;};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;};Node.prototype.get=function get(index){if(!Array.isArray(this.content))return null;var node=this.content[index];return node?node:null;};Node.prototype.insert=function insert(index,node){if(!Array.isArray(this.content))return;this.content.splice(index,0,node);};Node.prototype.is=function is(type){return this.type===type;};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;};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=void 0;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);};Node.prototype.traverse=function traverse(callback,index){var level=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var parent=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;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(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 get(){if(!Array.isArray(this.content))return 0;return this.content.length;}}]);return Node;}();module.exports=Node;},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;},function(module,exports){'use strict';module.exports=function stringify(tree){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 _arguments(t){return'('+_composite(t.content)+')';},'atkeyword':function atkeyword(t){return'@'+_composite(t.content);},'attributeSelector':function attributeSelector(t){return'['+_composite(t.content)+']';},'block':function block(t){return'{'+_composite(t.content)+'}';},'brackets':function brackets(t){return'['+_composite(t.content)+']';},'class':function _class(t){return'.'+_composite(t.content);},'color':function color(t){return'#'+t.content;},'expression':function expression(t){return'expression('+t.content+')';},'id':function id(t){return'#'+_composite(t.content);},'multilineComment':function multilineComment(t){return'/*'+t.content+'*/';},'nthSelector':function nthSelector(t){return':'+_t(t.content[0])+'('+_composite(t.content.slice(1))+')';},'parentheses':function parentheses(t){return'('+_composite(t.content)+')';},'percentage':function percentage(t){return _composite(t.content)+'%';},'pseudoClass':function pseudoClass(t){return':'+_composite(t.content);},'pseudoElement':function pseudoElement(t){return'::'+_composite(t.content);},'universalSelector':function universalSelector(t){return _composite(t.content)+'*';},'uri':function uri(t){return'url('+_composite(t.content)+')';}};return _t(tree);};},function(module,exports){'use strict';module.exports=function stringify(tree){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 _arguments(t){return'('+_composite(t.content)+')';},'atkeyword':function atkeyword(t){return'@'+_composite(t.content);},'attributeSelector':function attributeSelector(t){return'['+_composite(t.content)+']';},'block':function block(t){return'{'+_composite(t.content)+'}';},'brackets':function brackets(t){return'['+_composite(t.content)+']';},'class':function _class(t){return'.'+_composite(t.content);},'color':function color(t){return'#'+t.content;},'escapedString':function escapedString(t){return'~'+t.content;},'expression':function expression(t){return'expression('+t.content+')';},'id':function id(t){return'#'+_composite(t.content);},'interpolatedVariable':function interpolatedVariable(t){return'@{'+_composite(t.content)+'}';},'multilineComment':function multilineComment(t){return'/*'+t.content+'*/';},'nthSelector':function nthSelector(t){return':'+_t(t.content[0])+'('+_composite(t.content.slice(1))+')';},'parentheses':function parentheses(t){return'('+_composite(t.content)+')';},'percentage':function percentage(t){return _composite(t.content)+'%';},'pseudoClass':function pseudoClass(t){return':'+_composite(t.content);},'pseudoElement':function pseudoElement(t){return'::'+_composite(t.content);},'singlelineComment':function singlelineComment(t){return'/'+'/'+t.content;},'universalSelector':function universalSelector(t){return _composite(t.content)+'*';},'uri':function uri(t){return'url('+_composite(t.content)+')';},'variable':function variable(t){return'@'+_composite(t.content);},'variablesList':function variablesList(t){return _composite(t.content)+'...';}};return _t(tree);};},function(module,exports){'use strict';module.exports=function stringify(tree){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 _arguments(t){return'('+_composite(t.content)+')';},'atkeyword':function atkeyword(t){return'@'+_composite(t.content);},'attributeSelector':function attributeSelector(t){return'['+_composite(t.content)+']';},'block':function block(t){return _composite(t.content);},'brackets':function brackets(t){return'['+_composite(t.content)+']';},'class':function _class(t){return'.'+_composite(t.content);},'color':function color(t){return'#'+t.content;},'expression':function expression(t){return'expression('+t.content+')';},'id':function id(t){return'#'+_composite(t.content);},'interpolation':function interpolation(t){return'#{'+_composite(t.content)+'}';},'multilineComment':function multilineComment(t){var lines=t.content.split('\n');var close='';if(lines.length>1){var lastLine=lines[lines.length-1];if(lastLine.length<t.end.column){close='*/';}}else if(t.content.length+4===t.end.column-t.start.column+1){close='*/';}
return'/*'+t.content+close;},'nthSelector':function nthSelector(t){return':'+_t(t.content[0])+'('+_composite(t.content.slice(1))+')';},'parentheses':function parentheses(t){return'('+_composite(t.content)+')';},'percentage':function percentage(t){return _composite(t.content)+'%';},'placeholder':function placeholder(t){return'%'+_composite(t.content);},'pseudoClass':function pseudoClass(t){return':'+_composite(t.content);},'pseudoElement':function pseudoElement(t){return'::'+_composite(t.content);},'singlelineComment':function singlelineComment(t){return'/'+'/'+t.content;},'universalSelector':function universalSelector(t){return _composite(t.content)+'*';},'uri':function uri(t){return'url('+_composite(t.content)+')';},'variable':function variable(t){return'$'+_composite(t.content);},'variablesList':function variablesList(t){return _composite(t.content)+'...';}};return _t(tree);};},function(module,exports){'use strict';module.exports=function stringify(tree){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 _arguments(t){return'('+_composite(t.content)+')';},'atkeyword':function atkeyword(t){return'@'+_composite(t.content);},'attributeSelector':function attributeSelector(t){return'['+_composite(t.content)+']';},'block':function block(t){return'{'+_composite(t.content)+'}';},'brackets':function brackets(t){return'['+_composite(t.content)+']';},'class':function _class(t){return'.'+_composite(t.content);},'color':function color(t){return'#'+t.content;},'expression':function expression(t){return'expression('+t.content+')';},'id':function id(t){return'#'+_composite(t.content);},'interpolation':function interpolation(t){return'#{'+_composite(t.content)+'}';},'multilineComment':function multilineComment(t){return'/*'+t.content+'*/';},'nthSelector':function nthSelector(t){return':'+_t(t.content[0])+'('+_composite(t.content.slice(1))+')';},'parentheses':function parentheses(t){return'('+_composite(t.content)+')';},'percentage':function percentage(t){return _composite(t.content)+'%';},'placeholder':function placeholder(t){return'%'+_composite(t.content);},'pseudoClass':function pseudoClass(t){return':'+_composite(t.content);},'pseudoElement':function pseudoElement(t){return'::'+_composite(t.content);},'singlelineComment':function singlelineComment(t){return'/'+'/'+t.content;},'universalSelector':function universalSelector(t){return _composite(t.content)+'*';},'uri':function uri(t){return'url('+_composite(t.content)+')';},'variable':function variable(t){return'$'+_composite(t.content);},'variablesList':function variablesList(t){return _composite(t.content)+'...';}};return _t(tree);};},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;};function parser(css,options){if(typeof css!=='string')throw new Error('Please, pass a string to parse');else if(!css)return __webpack_require__(21)();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;},function(module,exports,__webpack_require__){'use strict';var parserPackage=__webpack_require__(9);function ParsingError(e,css){this.line=e.line;this.syntax=e.syntax;this.css_=css;}
ParsingError.prototype={customMessage_:'',line:null,name:'Parsing error',syntax:null,version:parserPackage.version,get context(){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');},get message(){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 message(message){this.customMessage_=message;},toString:function toString(){return[this.name+': '+this.message,'',this.context,'','Syntax: '+this.syntax,'Gonzales PE version: '+this.version].join('\n');}};module.exports=ParsingError;},function(module,exports){module.exports={"name":"gonzales-pe","description":"Gonzales Preprocessor Edition (fast CSS parser)","version":"4.0.3","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-core":"^6.18.2","babel-loader":"^6.2.7","babel-plugin-add-module-exports":"^0.2.1","babel-preset-es2015":"^6.18.0","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"}};},function(module,exports,__webpack_require__){'use strict';module.exports={css:__webpack_require__(11),scss:__webpack_require__(17)};},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'];},function(module,exports,__webpack_require__){'use strict';var TokenType=__webpack_require__(13);function markSpacesAndComments(tokens){var tokensLength=tokens.length;var spaces=[-1,-1];var type;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;}}
function markBrackets(tokens){var tokensLength=tokens.length;var ps=[];var sbs=[];var cbs=[];var t=void 0;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;}}}}
function markTokens(tokens){markBrackets(tokens);markSpacesAndComments(tokens);}
module.exports=markTokens;},function(module,exports){'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'};},function(module,exports,__webpack_require__){'use strict';var Node=__webpack_require__(1);var NodeType=__webpack_require__(15);var TokenType=__webpack_require__(13);var tokens;var tokensLength;var pos;var contexts={'atkeyword':function atkeyword(){return checkAtkeyword(pos)&&getAtkeyword();},'atrule':function atrule(){return checkAtrule(pos)&&getAtrule();},'block':function block(){return checkBlock(pos)&&getBlock();},'brackets':function brackets(){return checkBrackets(pos)&&getBrackets();},'class':function _class(){return checkClass(pos)&&getClass();},'combinator':function combinator(){return checkCombinator(pos)&&getCombinator();},'commentML':function commentML(){return checkCommentML(pos)&&getCommentML();},'declaration':function declaration(){return checkDeclaration(pos)&&getDeclaration();},'declDelim':function declDelim(){return checkDeclDelim(pos)&&getDeclDelim();},'delim':function delim(){return checkDelim(pos)&&getDelim();},'dimension':function dimension(){return checkDimension(pos)&&getDimension();},'expression':function expression(){return checkExpression(pos)&&getExpression();},'function':function _function(){return checkFunction(pos)&&getFunction();},'ident':function ident(){return checkIdent(pos)&&getIdent();},'important':function important(){return checkImportant(pos)&&getImportant();},'namespace':function namespace(){return checkNamespace(pos)&&getNamespace();},'number':function number(){return checkNumber(pos)&&getNumber();},'operator':function operator(){return checkOperator(pos)&&getOperator();},'parentheses':function parentheses(){return checkParentheses(pos)&&getParentheses();},'percentage':function percentage(){return checkPercentage(pos)&&getPercentage();},'progid':function progid(){return checkProgid(pos)&&getProgid();},'property':function property(){return checkProperty(pos)&&getProperty();},'propertyDelim':function propertyDelim(){return checkPropertyDelim(pos)&&getPropertyDelim();},'pseudoc':function pseudoc(){return checkPseudoc(pos)&&getPseudoc();},'pseudoe':function pseudoe(){return checkPseudoe(pos)&&getPseudoe();},'ruleset':function ruleset(){return checkRuleset(pos)&&getRuleset();},'s':function s(){return checkS(pos)&&getS();},'selector':function selector(){return checkSelector(pos)&&getSelector();},'shash':function shash(){return checkShash(pos)&&getShash();},'string':function string(){return checkString(pos)&&getString();},'stylesheet':function stylesheet(){return checkStylesheet(pos)&&getStylesheet();},'unary':function unary(){return checkUnary(pos)&&getUnary();},'unicodeRange':function unicodeRange(){return checkUnicodeRange(pos)&&getUnicodeRange();},'universalSelector':function universalSelector(){return checkUniversalSelector(pos)&&getUniversalSelector();},'urange':function urange(){return checkUrange(pos)&&getUrange();},'uri':function uri(){return checkUri(pos)&&getUri();},'value':function value(){return checkValue(pos)&&getValue();},'vhash':function vhash(){return checkVhash(pos)&&getVhash();}};function throwError(i){var ln=tokens[i].ln;throw{line:ln,syntax:'css'};}
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;}
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;var offset=endsWithLinebreak?linebreaksCount-1:linebreaksCount;position[0]=line+offset;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]&&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'});}
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;}
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();}
function checkAtkeyword(i){var l;if(i>=tokensLength||tokens[i++].type!==TokenType.CommercialAt)return 0;return(l=checkIdent(i))?l+1:0;}
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);}
function checkAtrule(i){var l;if(i>=tokensLength)return 0;if(tokens[i].atrule_l!==undefined)return tokens[i].atrule_l;if(l=checkKeyframesRule(i))tokens[i].atrule_type=4;else if(l=checkAtruler(i))tokens[i].atrule_type=1;else if(l=checkAtruleb(i))tokens[i].atrule_type=2;else if(l=checkAtrules(i))tokens[i].atrule_type=3;else return 0;tokens[i].atrule_l=l;return l;}
function getAtrule(){switch(tokens[pos].atrule_type){case 1:return getAtruler();case 2:return getAtruleb();case 3:return getAtrules();case 4:return getKeyframesRule();}}
function checkAtruleb(i){var start=i;var l=void 0;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;}
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);}
function checkAtruler(i){var start=i;var l=void 0;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;}
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);}
function checkAtrulers(i){var start=i;var l=void 0;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;}
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);}
function checkAtrules(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;if(l=checkAtkeyword(i))i+=l;else return 0;if(l=checkTsets(i))i+=l;return i-start;}
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);}
function checkBlock(i){return i<tokensLength&&tokens[i].type===TokenType.LeftCurlyBracket?tokens[i].right-i+1:0;}
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_);}
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;}
function getBlockdecl(){switch(tokens[pos].bd_type){case 1:return getBlockdecl1();case 2:return getBlockdecl2();case 3:return getBlockdecl3();case 4:return getBlockdecl4();}}
function checkBlockdecl1(i){var start=i;var l=void 0;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;}
function getBlockdecl1(){var sc=getSC();var x=void 0;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());}
function checkBlockdecl2(i){var start=i;var l=void 0;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;}
function getBlockdecl2(){var sc=getSC();var x=void 0;switch(tokens[pos].bd_kind){case 1:x=getDeclaration();break;case 2:x=getAtrule();break;}
return sc.concat([x]).concat(getSC());}
function checkBlockdecl3(i){var start=i;var l=void 0;if(l=checkSC(i))i+=l;if(l=checkDeclDelim(i))i+=l;else return 0;if(l=checkSC(i))i+=l;return i-start;}
function getBlockdecl3(){return getSC().concat([getDeclDelim()]).concat(getSC());}
function checkBlockdecl4(i){return checkSC(i);}
function getBlockdecl4(){return getSC();}
function checkBrackets(i){if(i>=tokensLength)return 0;var start=i;if(tokens[i].type===TokenType.LeftSquareBracket)i++;else return 0;if(i<tokens[start].right){var l=checkTsets(i);if(l)i+=l;else return 0;}
i++;return i-start;}
function getBrackets(){var type=NodeType.BracketsType;var token=tokens[pos];var line=token.ln;var column=token.col;var tsets=[];var right=token.right;pos++;if(pos<right){tsets=getTsets();}
var end=getLastPosition(tsets,line,column,1);pos++;return newNode(type,tsets,line,column,end);}
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;}
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=void 0;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();}
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);}
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);}
function checkCombinator3(i){var start=i;if(tokens[i].type===TokenType.Solidus)i++;else return 0;var l=void 0;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;pos++;var ident=getIdent();pos++;var content='/'+ident.content+'/';return newNode(type,content,line,column);}
function checkCommentML(i){return i<tokensLength&&tokens[i].type===TokenType.CommentML?1:0;}
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);}
function checkDeclaration(i){var start=i;var l=void 0;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;}
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);}
function checkDeclDelim(i){return i<tokensLength&&tokens[i].type===TokenType.Semicolon?1:0;}
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);}
function checkDelim(i){return i<tokensLength&&tokens[i].type===TokenType.Comma?1:0;}
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);}
function checkDimension(i){var ln=checkNumber(i);var li=void 0;if(i>=tokensLength||!ln||i+ln>=tokensLength)return 0;return(li=checkUnit(i+ln))?ln+li:0;}
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);}
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;}
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);}
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;}
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);}
function checkFunction(i){var start=i;var l=void 0;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;}
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);}
function getArguments(){var type=NodeType.ArgumentsType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];var body=void 0;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);}
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;}
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();}
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;}
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);}
function checkImportant(i){var start=i;var l=void 0;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;}}
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);}
function checkKeyframesBlock(i){var start=i;var l=void 0;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;}
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);}
function checkKeyframesBlocks(i){var start=i;var l=void 0;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;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);pos++;return newNode(type,content,line,column,end);}
function checkKeyframesRule(i){var start=i;var l=void 0;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;}
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=void 0;if(i>=tokensLength)return 0;if(l=checkIdent(i)){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);}
function checkKeyframesSelectorsGroup(i){var start=i;var l=void 0;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;}
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;}
function checkNamespace(i){return i<tokensLength&&tokens[i].type===TokenType.VerticalLine?1:0;}
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);}
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;}
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;}
function checkNumber(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)){tokens[i].number_l=1;return 1;}
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;}
if(i<tokensLength&&tokens[i].type===TokenType.FullStop&&tokens[i+1].type===TokenType.DecimalNumber){tokens[i].number_l=2;return 2;}
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;}
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);}
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;}
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);}
function checkParentheses(i){if(i>=tokensLength)return 0;var start=i;var right=tokens[i].right;if(tokens[i].type===TokenType.LeftParenthesis)i++;else return 0;if(i<right){var l=checkTsets(i);if(l)i+=l;else return 0;}
i++;return i-start;}
function getParentheses(){var type=NodeType.ParenthesesType;var token=tokens[pos];var line=token.ln;var column=token.col;var tsets=[];var right=token.right;pos++;if(pos<right){tsets=getTsets();}
var end=getLastPosition(tsets,line,column,1);pos++;return newNode(type,tsets,line,column,end);}
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;}
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);}
function checkProgid(i){var start=i;var l=void 0;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;}
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);}
function checkProperty(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;if(l=checkIdent(i))i+=l;else return 0;return i-start;}
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);}
function checkPropertyDelim(i){return i<tokensLength&&tokens[i].type===TokenType.Colon?1:0;}
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);}
function checkPseudo(i){return checkPseudoe(i)||checkPseudoc(i);}
function getPseudo(){if(checkPseudoe(pos))return getPseudoe();if(checkPseudoc(pos))return getPseudoc();}
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;}
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);}
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;}
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();}
function checkPseudoClass1(i){var start=i;i++;var l=void 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;i++;if(l=checkSelectorsGroup(i))i+=l;else return 0;if(i!==right)return 0;return i-start+1;}
function getPseudoClass1(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];pos++;content.push(getIdent());{var _type=NodeType.ArgumentsType;var _token=tokens[pos];var _line=_token.ln;var _column=_token.col;pos++;var selectors=getSelectorsGroup();var end=getLastPosition(selectors,_line,_column,1);var args=newNode(_type,selectors,_line,_column,end);content.push(args);pos++;}
return newNode(type,content,line,column);}
function checkPseudoClass2(i){var start=i;var l=0;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;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=[];pos++;var ident=getIdent();content.push(ident);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);pos++;return newNode(type,content,line,column);}
function checkPseudoClass3(i){var start=i;var l=0;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;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=[];pos++;var ident=getIdent();content.push(ident);var l=tokens[pos].ln;var c=tokens[pos].col;var value=[];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);pos++;return newNode(type,content,line,column);}
function checkPseudoClass4(i){var start=i;var l=0;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;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=[];pos++;var ident=getIdent();content.push(ident);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);pos++;return newNode(type,content,line,column);}
function checkPseudoClass5(i){var start=i;var l=0;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;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=[];pos++;var ident=getIdent();content.push(ident);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);pos++;return newNode(type,content,line,column);}
function checkPseudoClass6(i){var start=i;var l=0;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=[];pos++;var ident=getIdent();content.push(ident);return newNode(type,content,line,column);}
function checkRuleset(i){var start=i;var l=void 0;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);}
function checkS(i){return i<tokensLength&&tokens[i].ws?tokens[i].ws_last-i+1:0;}
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);}
function checkSC(i){var l=void 0;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;}
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;}
function checkShash(i){var l;if(i>=tokensLength||tokens[i].type!==TokenType.NumberSign)return 0;return(l=checkIdent(i+1))?l+1:0;}
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);}
function checkString(i){if(i>=tokensLength){return 0;}
if(tokens[i].type===TokenType.StringSQ||tokens[i].type===TokenType.StringDQ){return 1;}
return 0;}
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);}
function checkStylesheet(i){var start=i;var l=void 0;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;}
function getStylesheet(){var type=NodeType.StylesheetType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];var childType=void 0;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);}
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;}
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();}
function checkTsets(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;while(l=checkTset(i)){i+=l;}
return i-start;}
function getTsets(){var x=[];var t=void 0;while(checkTset(pos)){t=getTset();if(typeof t.content==='string')x.push(t);else x=x.concat(t);}
return x;}
function checkUnary(i){if(i>=tokensLength){return 0;}
if(tokens[i].type===TokenType.HyphenMinus||tokens[i].type===TokenType.PlusSign){return 1;}
return 0;}
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);}
function checkUnicodeRange(i){var start=i;var l=void 0;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;}
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);}
function checkUrange(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;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;}
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);}
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;}
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;}
function getUri(){var startPos=pos;var uriExcluding={};var uri=void 0;var l=void 0;var raw=void 0;var rawContent=void 0;var t=void 0;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);}
function checkUri1(i){var start=i;var l=void 0;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;}
function checkValue(i){var start=i;var l=void 0;var s=void 0;var _i=void 0;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;}
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);}
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;}
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();}
function checkVhash(i){var l;if(i>=tokensLength||tokens[i].type!==TokenType.NumberSign)return 0;return(l=checkNmName2(i+1))?l+1:0;}
function getVhash(){var type=NodeType.VhashType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=void 0;pos++;content=getNmName2();var end=getLastPosition(content,line,column+1);return newNode(type,content,line,column,end);}
function checkSelectorsGroup(i){if(i>=tokensLength)return 0;var start=i;var l=void 0;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=void 0;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=void 0;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=void 0;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=void 0;if(l=checkUniversalSelector(i)||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;if(checkUniversalSelector(pos))sequence.push(getUniversalSelector());else 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 checkUniversalSelector(i){if(i>=tokensLength)return 0;var start=i;var l=void 0;if(l=checkNamePrefix(i))i+=l;if(tokens[i].type===TokenType.Asterisk)i++;else return 0;return i-start;}
function getUniversalSelector(){var type=NodeType.UniversalSelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];var end=void 0;if(checkNamePrefix(pos)){content.push(getNamePrefix());end=getLastPosition(content,line,column,1);}
pos++;return newNode(type,content,line,column,end);}
function checkTypeSelector(i){if(i>=tokensLength)return 0;var start=i;var l=void 0;if(l=checkNamePrefix(i))i+=l;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());content.push(getIdent());return newNode(type,content,line,column);}
function checkAttributeSelector(i){var l=void 0;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();}
function checkAttributeSelector1(i){var start=i;if(tokens[i].type===TokenType.LeftSquareBracket)i++;else return 0;var l=void 0;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=[];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());}
pos++;var end=getLastPosition(content,line,column,1);return newNode(type,content,line,column,end);}
function checkAttributeSelector2(i){var start=i;if(tokens[i].type===TokenType.LeftSquareBracket)i++;else return 0;var l=void 0;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=[];pos++;content=content.concat(getSC());content.push(getAttributeName());content=content.concat(getSC());pos++;var end=getLastPosition(content,line,column,1);return newNode(type,content,line,column,end);}
function checkAttributeName(i){var start=i;var l=void 0;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=void 0;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=void 0;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();}
function checkNamePrefix1(i){var start=i;var l=void 0;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);}
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);}
function checkNamespacePrefix(i){if(i>=tokensLength)return 0;var l=void 0;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);}
function checkNamespaceSeparator(i){if(i>=tokensLength)return 0;if(tokens[i].type!==TokenType.VerticalLine)return 0;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);}
module.exports=function(_tokens,context){tokens=_tokens;tokensLength=tokens.length;pos=0;return contexts[context]();};},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',UniversalSelectorType:'universalSelector',UriType:'uri',UrangeType:'urange',ValueType:'value',VariableType:'variable',VariablesListType:'variablesList',VhashType:'color'};},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};function pushToken(type,value,column){tokens.push({tn:tn++,ln:ln,col:column,type:type,value:value});}
function isDecimalDigit(c){return'0123456789'.indexOf(c)>=0;}
function parseSpaces(css){var start=pos;for(;pos<cssLength;pos++){if(css.charAt(pos)!==' ')break;}
pushToken(TokenType.Space,css.substring(start,pos--),col);col+=pos-start;}
function parseString(css,q){var start=pos;for(pos++;pos<cssLength;pos++){if(css.charAt(pos)==='\\')pos++;else if(css.charAt(pos)===q)break;}
pushToken(q==='"'?TokenType.StringDQ:TokenType.StringSQ,css.substring(start,pos+1),col);col+=pos-start;}
function parseDecimalNumber(css){var start=pos;for(;pos<cssLength;pos++){if(!isDecimalDigit(css.charAt(pos)))break;}
pushToken(TokenType.DecimalNumber,css.substring(start,pos--),col);col+=pos-start;}
function parseIdentifier(css){var start=pos;while(css.charAt(pos)==='/'){pos++;}
for(;pos<cssLength;pos++){if(css.charAt(pos)==='\\')pos++;else if(Punctuation[css.charAt(pos)])break;}
var ident=css.substring(start,pos--);urlMode=urlMode||ident==='url';pushToken(TokenType.Identifier,ident,col);col+=pos-start;}
function parseMLComment(css){var start=pos;for(pos=pos+2;pos<cssLength;pos++){if(css.charAt(pos)==='*'&&css.charAt(pos+1)==='/'){pos++;break;}}
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;for(pos+=2;pos<cssLength;pos++){if(css.charAt(pos)==='\n'||css.charAt(pos)==='\r'){break;}}
pushToken(TokenType.CommentSL,css.substring(start,pos--),col);col+=pos-start;}
function getTokens(css){var c;var cn;cssLength=css.length;for(pos=0;pos<cssLength;col++,pos++){c=css.charAt(pos);cn=css.charAt(pos+1);if(c==='/'&&cn==='*'){parseMLComment(css);}
else if(!urlMode&&c==='/'&&cn==='/'){if(blockMode>0)parseIdentifier(css);else parseSLComment(css);}
else if(c==='"'||c==="'"){parseString(css,c);}
else if(c===' '){parseSpaces(css);}
else if(Punctuation[c]){pushToken(Punctuation[c],c,col);if(c==='\n'||c==='\r'){ln++;col=0;}
else if(c===')')urlMode=false;else if(c==='{')blockMode++;else if(c==='}')blockMode--;else if(c==='\t'&&tabSize>1)col+=tabSize-1;}
else if(isDecimalDigit(c)){parseDecimalNumber(css);}
else{parseIdentifier(css);}}
return tokens;}
return getTokens(css);};},function(module,exports,__webpack_require__){'use strict';exports.__esModule=true;exports.default={mark:__webpack_require__(18),parse:__webpack_require__(19),stringify:__webpack_require__(6),tokenizer:__webpack_require__(20)};module.exports=exports['default'];},function(module,exports,__webpack_require__){'use strict';var TokenType=__webpack_require__(13);module.exports=function(){function markSC(tokens){var tokensLength=tokens.length;var ws=-1;var sc=-1;var t=void 0;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;}
function markBrackets(tokens){var tokensLength=tokens.length;var ps=[];var sbs=[];var cbs=[];var t=void 0;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);};}();},function(module,exports,__webpack_require__){'use strict';var Node=__webpack_require__(1);var NodeType=__webpack_require__(15);var TokenType=__webpack_require__(13);var tokens=void 0;var tokensLength=void 0;var pos=void 0;var contexts={'arguments':function _arguments(){return checkArguments(pos)&&getArguments();},'atkeyword':function atkeyword(){return checkAtkeyword(pos)&&getAtkeyword();},'atrule':function atrule(){return checkAtrule(pos)&&getAtrule();},'block':function block(){return checkBlock(pos)&&getBlock();},'brackets':function brackets(){return checkBrackets(pos)&&getBrackets();},'class':function _class(){return checkClass(pos)&&getClass();},'combinator':function combinator(){return checkCombinator(pos)&&getCombinator();},'commentML':function commentML(){return checkCommentML(pos)&&getCommentML();},'commentSL':function commentSL(){return checkCommentSL(pos)&&getCommentSL();},'condition':function condition(){return checkCondition(pos)&&getCondition();},'conditionalStatement':function conditionalStatement(){return checkConditionalStatement(pos)&&getConditionalStatement();},'declaration':function declaration(){return checkDeclaration(pos)&&getDeclaration();},'declDelim':function declDelim(){return checkDeclDelim(pos)&&getDeclDelim();},'default':function _default(){return checkDefault(pos)&&getDefault();},'delim':function delim(){return checkDelim(pos)&&getDelim();},'dimension':function dimension(){return checkDimension(pos)&&getDimension();},'expression':function expression(){return checkExpression(pos)&&getExpression();},'extend':function extend(){return checkExtend(pos)&&getExtend();},'function':function _function(){return checkFunction(pos)&&getFunction();},'global':function global(){return checkGlobal(pos)&&getGlobal();},'ident':function ident(){return checkIdent(pos)&&getIdent();},'important':function important(){return checkImportant(pos)&&getImportant();},'include':function include(){return checkInclude(pos)&&getInclude();},'interpolation':function interpolation(){return checkInterpolation(pos)&&getInterpolation();},'loop':function loop(){return checkLoop(pos)&&getLoop();},'mixin':function mixin(){return checkMixin(pos)&&getMixin();},'namespace':function namespace(){return checkNamespace(pos)&&getNamespace();},'number':function number(){return checkNumber(pos)&&getNumber();},'operator':function operator(){return checkOperator(pos)&&getOperator();},'optional':function optional(){return checkOptional(pos)&&getOptional();},'parentheses':function parentheses(){return checkParentheses(pos)&&getParentheses();},'parentselector':function parentselector(){return checkParentSelector(pos)&&getParentSelector();},'percentage':function percentage(){return checkPercentage(pos)&&getPercentage();},'placeholder':function placeholder(){return checkPlaceholder(pos)&&getPlaceholder();},'progid':function progid(){return checkProgid(pos)&&getProgid();},'property':function property(){return checkProperty(pos)&&getProperty();},'propertyDelim':function propertyDelim(){return checkPropertyDelim(pos)&&getPropertyDelim();},'pseudoc':function pseudoc(){return checkPseudoc(pos)&&getPseudoc();},'pseudoe':function pseudoe(){return checkPseudoe(pos)&&getPseudoe();},'ruleset':function ruleset(){return checkRuleset(pos)&&getRuleset();},'s':function s(){return checkS(pos)&&getS();},'selector':function selector(){return checkSelector(pos)&&getSelector();},'shash':function shash(){return checkShash(pos)&&getShash();},'string':function string(){return checkString(pos)&&getString();},'stylesheet':function stylesheet(){return checkStylesheet(pos)&&getStylesheet();},'typeSelector':function typeSelector(){return checkTypeSelector(pos)&&getTypeSelector();},'unary':function unary(){return checkUnary(pos)&&getUnary();},'unicodeRange':function unicodeRange(){return checkUnicodeRange(pos)&&getUnicodeRange();},'universalSelector':function universalSelector(){return checkUniversalSelector(pos)&&getUniversalSelector();},'urange':function urange(){return checkUrange(pos)&&getUrange();},'uri':function uri(){return checkUri(pos)&&getUri();},'value':function value(){return checkValue(pos)&&getValue();},'variable':function variable(){return checkVariable(pos)&&getVariable();},'variableslist':function variableslist(){return checkVariablesList(pos)&&getVariablesList();},'vhash':function vhash(){return checkVhash(pos)&&getVhash();}};function throwError(i){var ln=i?tokens[i].ln:tokens[pos].ln;throw{line:ln,syntax:'scss'};}
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;}
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;var offset=endsWithLinebreak?linebreaksCount-1:linebreaksCount;position[0]=line+offset;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]&&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'});}
function checkAny(i){var l=void 0;if(l=checkBrackets(i))tokens[i].any_type=1;else if(l=checkParentheses(i))tokens[i].any_type=2;else if(l=checkString(i))tokens[i].any_type=3;else if(l=checkVariablesList(i))tokens[i].any_type=4;else if(l=checkVariable(i))tokens[i].any_type=5;else if(l=checkPlaceholder(i))tokens[i].any_type=6;else if(l=checkPercentage(i))tokens[i].any_type=7;else if(l=checkDimension(i))tokens[i].any_type=8;else if(l=checkUnicodeRange(i))tokens[i].any_type=9;else if(l=checkNumber(i))tokens[i].any_type=10;else if(l=checkUri(i))tokens[i].any_type=11;else if(l=checkExpression(i))tokens[i].any_type=12;else if(l=checkFunction(i))tokens[i].any_type=13;else if(l=checkInterpolation(i))tokens[i].any_type=14;else if(l=checkIdent(i))tokens[i].any_type=15;else if(l=checkClass(i))tokens[i].any_type=16;else if(l=checkUnary(i))tokens[i].any_type=17;return l;}
function getAny(){var type=tokens[pos].any_type;if(type===1)return getBrackets();if(type===2)return getParentheses();if(type===3)return getString();if(type===4)return getVariablesList();if(type===5)return getVariable();if(type===6)return getPlaceholder();if(type===7)return getPercentage();if(type===8)return getDimension();if(type===9)return getUnicodeRange();if(type===10)return getNumber();if(type===11)return getUri();if(type===12)return getExpression();if(type===13)return getFunction();if(type===14)return getInterpolation();if(type===15)return getIdent();if(type===16)return getClass();if(type===17)return getUnary();}
function checkArguments(i){var start=i;var l=void 0;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;}
function checkArgument(i){return checkBrackets(i)||checkParentheses(i)||checkSingleValueDeclaration(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)||checkGlobal(i)||checkDefault(i)||checkOptional(i)||checkParentSelector(i);}
function getArgument(){if(checkBrackets(pos))return getBrackets();else if(checkParentheses(pos))return getParentheses();else if(checkSingleValueDeclaration(pos))return getSingleValueDeclaration();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(checkGlobal(pos))return getGlobal();else if(checkDefault(pos))return getDefault();else if(checkOptional(pos))return getOptional();else if(checkParentSelector(pos))return getParentSelector();}
function checkAtkeyword(i){var l;if(i>=tokensLength||tokens[i++].type!==TokenType.CommercialAt)return 0;return(l=checkIdentOrInterpolation(i))?l+1:0;}
function getAtkeyword(){var startPos=pos;var x=void 0;pos++;x=getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.AtkeywordType,x,token.ln,token.col);}
function checkAtrule(i){var l;if(i>=tokensLength)return 0;if(tokens[i].atrule_l!==undefined)return tokens[i].atrule_l;if(l=checkKeyframesRule(i))tokens[i].atrule_type=4;else if(l=checkAtruler(i))tokens[i].atrule_type=1;else if(l=checkAtruleb(i))tokens[i].atrule_type=2;else if(l=checkAtrules(i))tokens[i].atrule_type=3;else return 0;tokens[i].atrule_l=l;return l;}
function getAtrule(){switch(tokens[pos].atrule_type){case 1:return getAtruler();case 2:return getAtruleb();case 3:return getAtrules();case 4:return getKeyframesRule();}}
function checkAtruleb(i){var start=i;var l=void 0;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;}
function getAtruleb(){var startPos=pos;var x=void 0;x=[getAtkeyword()].concat(getTsets()).concat([getBlock()]);var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);}
function checkAtruler(i){var start=i;var l=void 0;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;}
function getAtruler(){var startPos=pos;var x=void 0;x=[getAtkeyword()].concat(getTsets());x.push(getAtrulers());var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);}
function checkAtrulers(i){var start=i;var l=void 0;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;}
function getAtrulers(){var startPos=pos;var x=void 0;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);}
function checkAtrules(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;if(l=checkAtkeyword(i))i+=l;else return 0;if(l=checkTsets(i))i+=l;return i-start;}
function getAtrules(){var startPos=pos;var x=void 0;x=[getAtkeyword()].concat(getTsets());var token=tokens[startPos];return newNode(NodeType.AtruleType,x,token.ln,token.col);}
function checkBlock(i){return i<tokensLength&&tokens[i].type===TokenType.LeftCurlyBracket?tokens[i].right-i+1:0;}
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_);}
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;}
function getBlockdecl(){switch(tokens[pos].bd_type){case 1:return getBlockdecl1();case 2:return getBlockdecl2();case 3:return getBlockdecl3();case 4:return getBlockdecl4();}}
function checkBlockdecl1(i){var start=i;var l=void 0;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;}
function getBlockdecl1(){var sc=getSC();var x=void 0;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());}
function checkBlockdecl2(i){var start=i;var l=void 0;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;}
function getBlockdecl2(){var sc=getSC();var x=void 0;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());}
function checkBlockdecl3(i){var start=i;var l=void 0;if(l=checkSC(i))i+=l;if(l=checkDeclDelim(i))i+=l;else return 0;if(l=checkSC(i))i+=l;return i-start;}
function getBlockdecl3(){return getSC().concat([getDeclDelim()]).concat(getSC());}
function checkBlockdecl4(i){return checkSC(i);}
function getBlockdecl4(){return getSC();}
function checkBrackets(i){if(i>=tokensLength)return 0;var start=i;if(tokens[i].type===TokenType.LeftSquareBracket)i++;else return 0;if(i<tokens[start].right){var l=checkTsets(i);if(l)i+=l;else return 0;}
i++;return i-start;}
function getBrackets(){var startPos=pos;var token=tokens[startPos];var line=token.ln;var column=token.col;var tsets=[];var right=token.right;pos++;if(pos<right){tsets=getTsets();}
var end=getLastPosition(tsets,line,column,1);pos++;return newNode(NodeType.BracketsType,tsets,token.ln,token.col,end);}
function checkClass(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;if(tokens[i].class_l)return tokens[i].class_l;if(tokens[i++].type!==TokenType.FullStop)return 0;if(l=checkIdentOrInterpolation(i))i+=l;else return 0;while(i<tokensLength){if(l=checkIdentOrInterpolation(i))i+=l;else break;}
tokens[start].classEnd=i;return i-start;}
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;pos++;while(pos<end){if(checkIdentOrInterpolation(pos)){content=content.concat(getIdentOrInterpolation());}else break;}
return newNode(type,content,line,column);}
function checkCombinator(i){if(i>=tokensLength)return 0;var l=void 0;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();}
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);}
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);}
function checkCombinator3(i){var start=i;if(tokens[i].type===TokenType.Solidus)i++;else return 0;var l=void 0;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;pos++;var ident=getIdent();pos++;var content='/'+ident.content+'/';return newNode(type,content,line,column);}
function checkCommentML(i){return i<tokensLength&&tokens[i].type===TokenType.CommentML?1:0;}
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);}
function checkCommentSL(i){return i<tokensLength&&tokens[i].type===TokenType.CommentSL?1:0;}
function getCommentSL(){var startPos=pos;var x=void 0;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);}
function checkCondition(i){var start=i;var l=void 0;var _i=void 0;var s=void 0;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);}
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();}
function checkConditionalStatement(i){var start=i;var l=void 0;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;}
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);}
function checkDeclaration(i){var start=i;var l=void 0;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;}
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);}
function checkSingleValueDeclaration(i){var start=i;var l=void 0;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=checkSingleValue(i))i+=l;else return 0;return i-start;}
function getSingleValueDeclaration(){var startPos=pos;var x=[];x.push(getProperty());x=x.concat(getSC());x.push(getPropertyDelim());x=x.concat(getSC());x.push(getSingleValue());var token=tokens[startPos];return newNode(NodeType.DeclarationType,x,token.ln,token.col);}
function checkDeclDelim(i){return i<tokensLength&&tokens[i].type===TokenType.Semicolon?1:0;}
function getDeclDelim(){var startPos=pos++;var token=tokens[startPos];return newNode(NodeType.DeclDelimType,';',token.ln,token.col);}
function checkDefault(i){var start=i;var l=void 0;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;}}
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);}
function checkDelim(i){return i<tokensLength&&tokens[i].type===TokenType.Comma?1:0;}
function getDelim(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.DelimType,',',token.ln,token.col);}
function checkDimension(i){var ln=checkNumber(i);var li=void 0;if(i>=tokensLength||!ln||i+ln>=tokensLength)return 0;return(li=checkUnit(i+ln))?ln+li:0;}
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);}
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;}
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);}
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;}
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();}
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);}
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);}
function checkFunction(i){var start=i;var l=void 0;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;}
function getFunction(){var startPos=pos;var x=getIdentOrInterpolation();var body=void 0;body=getArguments();x.push(body);var token=tokens[startPos];return newNode(NodeType.FunctionType,x,token.ln,token.col);}
function getArguments(){var startPos=pos;var x=[];var body=void 0;var token=tokens[startPos];var line=token.ln;var column=token.col;pos++;while(pos<tokensLength&&tokens[pos].type!==TokenType.RightParenthesis){if(checkSingleValueDeclaration(pos))x.push(getSingleValueDeclaration());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);}
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(checkInterpolation(i)){tokens[start].ident_last=i-1;return i-start;}
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;}
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);}
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=void 0;var prevIsInterpolation=false;while(i<tokensLength){if(l=checkInterpolation(i)){tokens[i].ii_type=1;i+=l;prevIsInterpolation=true;}else if(l=checkIdent(i)){tokens[i].ii_type=2;i+=l;prevIsInterpolation=false;}else if(prevIsInterpolation&&(l=checkPartialIdent(i))){tokens[i].ii_type=3;i+=l;prevIsInterpolation=false;}else break;}
return i-start;}
function getIdentOrInterpolation(){var x=[];while(pos<tokensLength){var tokenType=tokens[pos].ii_type;if(tokenType===1){x.push(getInterpolation());}else if(tokenType===2||tokenType===3){x.push(getIdent());}else break;}
return x;}
function checkImportant(i){var start=i;var l=void 0;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;}}
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);}
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;}
function checkGlobal(i){var start=i;var l=void 0;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;}}
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);}
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();}}
function checkInclude1(i){var start=i;var l=void 0;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;}
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);}
function checkInclude2(i){var start=i;var l=void 0;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;}
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);}
function checkInclude3(i){var start=i;var l=void 0;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;}
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);}
function checkInclude4(i){var start=i;var l=void 0;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;}
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);}
function checkInclude5(i){var start=i;var l=void 0;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;}
function getInclude5(){var startPos=pos;var x=[].concat(getAtkeyword(),getSC(),getIdentOrInterpolation());var token=tokens[startPos];return newNode(NodeType.IncludeType,x,token.ln,token.col);}
function checkInterpolation(i){var start=i;var l=void 0;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;}
function getInterpolation(){var startPos=pos;var x=[];var token=tokens[startPos];var line=token.ln;var column=token.col;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);pos++;return newNode(NodeType.InterpolationType,x,token.ln,token.col,end);}
function checkKeyframesBlock(i){var start=i;var l=void 0;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;}
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);}
function checkKeyframesBlocks(i){var start=i;var l=void 0;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;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());else break;}
var end=getLastPosition(content,line,column,1);pos++;return newNode(type,content,line,column,end);}
function checkKeyframesRule(i){var start=i;var l=void 0;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;}
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);}
function checkKeyframesSelector(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;if(l=checkIdent(i)){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;}
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);}
function checkKeyframesSelectorsGroup(i){var start=i;var l=void 0;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;}
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;}
function checkLoop(i){var start=i;var l=void 0;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;}
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);}
function checkMixin(i){var start=i;var l=void 0;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;}
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);}
function checkNamespace(i){return i<tokensLength&&tokens[i].type===TokenType.VerticalLine?1:0;}
function getNamespace(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.NamespaceType,'|',token.ln,token.col);}
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;}
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;}
function checkNumber(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)){tokens[i].number_l=1;return 1;}
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;}
if(i<tokensLength&&tokens[i].type===TokenType.FullStop&&tokens[i+1].type===TokenType.DecimalNumber){tokens[i].number_l=2;return 2;}
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;}
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);}
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;}
function getOperator(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.OperatorType,x,token.ln,token.col);}
function checkOptional(i){var start=i;var l=void 0;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;}}
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);}
function checkParentheses(i){if(i>=tokensLength)return 0;var start=i;var right=tokens[i].right;if(tokens[i].type===TokenType.LeftParenthesis)i++;else return 0;if(i<right){var l=checkTsets(i);if(l)i+=l;else return 0;}
i++;return i-start;}
function getParentheses(){var type=NodeType.ParenthesesType;var token=tokens[pos];var line=token.ln;var column=token.col;var tsets=[];var right=token.right;pos++;if(pos<right){tsets=getTsets();}
var end=getLastPosition(tsets,line,column,1);pos++;return newNode(type,tsets,line,column,end);}
function checkParentSelector(i){return i<tokensLength&&tokens[i].type===TokenType.Ampersand?1:0;}
function getParentSelector(){var startPos=pos;var token=tokens[startPos];pos++;return newNode(NodeType.ParentSelectorType,'&',token.ln,token.col);}
function checkParentSelectorExtension(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;while(i<tokensLength){if(l=checkIdentOrInterpolation(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(checkIdentOrInterpolation(pos)){content=content.concat(getIdentOrInterpolation());}else if(checkPartialIdent(pos)){content.push(getIdent());}else break;}
return newNode(type,content,line,column);}
function checkParentSelectorWithExtension(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;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;}
function checkPercentage(i){var start=i;var l=void 0;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;}
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);pos++;return newNode(NodeType.PercentageType,content,token.ln,token.col,end);}
function checkNumberOrInterpolation(i){var start=i;var l=void 0;while(i<tokensLength){if(l=checkInterpolation(i)||checkNumber(i))i+=l;else break;}
return i-start;}
function getNumberOrInterpolation(){var content=[];while(pos<tokensLength){if(checkInterpolation(pos))content.push(getInterpolation());else if(checkNumber(pos))content.push(getNumber());else break;}
return content;}
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;}
function getPlaceholder(){var startPos=pos;pos++;var x=getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.PlaceholderType,x,token.ln,token.col);}
function checkProgid(i){var start=i;var l=void 0;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;}
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);}
function checkProperty(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;if(l=checkVariable(i)||checkIdentOrInterpolation(i))i+=l;else return 0;return i-start;}
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);}
function checkPropertyDelim(i){return i<tokensLength&&tokens[i].type===TokenType.Colon?1:0;}
function getPropertyDelim(){var startPos=pos;pos++;var token=tokens[startPos];return newNode(NodeType.PropertyDelimType,':',token.ln,token.col);}
function checkPseudo(i){return checkPseudoe(i)||checkPseudoc(i);}
function getPseudo(){if(checkPseudoe(pos))return getPseudoe();if(checkPseudoc(pos))return getPseudoc();}
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;}
function getPseudoe(){var startPos=pos;pos+=2;var x=getIdentOrInterpolation();var token=tokens[startPos];return newNode(NodeType.PseudoeType,x,token.ln,token.col);}
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();}
function checkPseudoClass1(i){var start=i;i++;if(i>=tokensLength)return 0;var l=void 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;i++;if(l=checkSelectorsGroup(i))i+=l;else return 0;if(i!==right)return 0;return right-start+1;}
function getPseudoClass1(){var type=NodeType.PseudocType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];pos++;content=content.concat(getIdentOrInterpolation());{var _type=NodeType.ArgumentsType;var _token=tokens[pos];var _line=_token.ln;var _column=_token.col;pos++;var selectors=getSelectorsGroup();var end=getLastPosition(selectors,_line,_column,1);var args=newNode(_type,selectors,_line,_column,end);content.push(args);pos++;}
return newNode(type,content,line,column);}
function checkPseudoClass2(i){var start=i;var l=0;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;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=[];pos++;content=content.concat(getIdentOrInterpolation());var l=tokens[pos].ln;var c=tokens[pos].col;var value=[];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);pos++;return newNode(type,content,line,column);}
function checkPseudoClass3(i){var start=i;var l=0;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;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;pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[];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);pos++;return newNode(type,content,line,column);}
function checkPseudoClass4(i){var start=i;var l=0;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;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;pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[];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);pos++;return newNode(type,content,line,column);}
function checkPseudoClass5(i){var start=i;var l=0;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;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;pos++;var content=getIdentOrInterpolation();var l=tokens[pos].ln;var c=tokens[pos].col;var value=[];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);pos++;return newNode(type,content,line,column);}
function checkPseudoClass6(i){var start=i;var l=0;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;pos++;var content=getIdentOrInterpolation();return newNode(type,content,line,column);}
function checkRuleset(i){var start=i;var l=void 0;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);}
function checkS(i){return i<tokensLength&&tokens[i].ws?tokens[i].ws_last-i+1:0;}
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);}
function checkSC(i){if(i>=tokensLength)return 0;var l=void 0;var lsc=0;while(i<tokensLength){if(!(l=checkS(i))&&!(l=checkCommentML(i))&&!(l=checkCommentSL(i)))break;i+=l;lsc+=l;}
return lsc||0;}
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;}
function checkShash(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;if(tokens[i].type===TokenType.NumberSign)i++;else return 0;if(l=checkIdentOrInterpolation(i)||checkPartialIdent(i))i+=l;else return 0;while(i<tokensLength){if(l=checkIdentOrInterpolation(i)||checkPartialIdent(i))i+=l;else break;}
tokens[start].shashEnd=i;return i-start;}
function getShash(){var startPos=pos;var type=NodeType.ShashType;var token=tokens[startPos];var line=token.ln;var column=token.col;var end=token.shashEnd;var content=[];pos++;while(pos<end){if(checkIdentOrInterpolation(pos)){content=content.concat(getIdentOrInterpolation());}else if(checkPartialIdent(pos)){content.push(getIdent());}else break;}
return newNode(type,content,line,column);}
function checkString(i){if(i>=tokensLength)return 0;if(tokens[i].type===TokenType.StringSQ||tokens[i].type===TokenType.StringDQ){return 1;}
return 0;}
function getString(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.StringType,x,token.ln,token.col);}
function checkStylesheet(i){var start=i;var l=void 0;while(i<tokensLength){if(l=checkSC(i))tokens[i].ss_child=1;else if(l=checkRuleset(i))tokens[i].ss_child=2;else if(l=checkInclude(i))tokens[i].ss_child=3;else if(l=checkExtend(i))tokens[i].ss_child=4;else if(l=checkMixin(i))tokens[i].ss_child=5;else if(l=checkLoop(i))tokens[i].ss_child=6;else if(l=checkConditionalStatement(i))tokens[i].ss_child=7;else if(l=checkAtrule(i))tokens[i].ss_child=8;else if(l=checkDeclaration(i))tokens[i].ss_child=9;else if(l=checkDeclDelim(i))tokens[i].ss_child=10;else throwError(i);i+=l;}
return i-start;}
function getStylesheet(){var startPos=pos;var x=[];while(pos<tokensLength){var childType=tokens[pos].ss_child;if(childType===1)x=x.concat(getSC());else if(childType===2)x.push(getRuleset());else if(childType===3)x.push(getInclude());else if(childType===4)x.push(getExtend());else if(childType===5)x.push(getMixin());else if(childType===6)x.push(getLoop());else if(childType===7)x.push(getConditionalStatement());else if(childType===8)x.push(getAtrule());else if(childType===9)x.push(getDeclaration());else if(childType===10)x.push(getDeclDelim());}
var token=tokens[startPos];return newNode(NodeType.StylesheetType,x,token.ln,token.col);}
function checkTset(i){var l;if(l=checkVhash(i))tokens[i].tset_type=1;else if(l=checkOperator(i))tokens[i].tset_type=2;else if(l=checkAny(i))tokens[i].tset_type=3;else if(l=checkSC(i))tokens[i].tset_type=4;else if(l=checkInterpolation(i))tokens[i].tset_type=5;return l;}
function getTset(){var tsetType=tokens[pos].tset_type;if(tsetType===1)return getVhash();else if(tsetType===2)return getOperator();else if(tsetType===3)return getAny();else if(tsetType===4)return getSC();else if(tsetType===5)return getInterpolation();}
function checkTsets(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;while(l=checkTset(i)){i+=l;}
tokens[start].tsets_end=i;return i-start;}
function getTsets(){var x=[];var t=void 0;if(pos>=tokensLength)return x;var end=tokens[pos].tsets_end;while(pos<end){t=getTset();if(typeof t.content==='string')x.push(t);else x=x.concat(t);}
return x;}
function checkUnary(i){if(i>=tokensLength){return 0;}
if(tokens[i].type===TokenType.HyphenMinus||tokens[i].type===TokenType.PlusSign){return 1;}
return 0;}
function getUnary(){var startPos=pos;var x=tokens[pos++].value;var token=tokens[startPos];return newNode(NodeType.OperatorType,x,token.ln,token.col);}
function checkUnicodeRange(i){var start=i;var l=void 0;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;}
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);}
function checkUrange(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;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;}
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);}
function _checkUnicodeWildcard(i){var start=i;if(i>=tokensLength)return 0;while(i<tokensLength){if(tokens[i].type===TokenType.QuestionMark)i+=1;else break;}
tokens[start].uri_raw_end=i;return i-start;}
function checkUri(i){var start=i;var l=void 0;if(i>=tokensLength||tokens[i].value!=='url')return 0;i++;if(i>=tokensLength||tokens[i].type!==TokenType.LeftParenthesis)return 0;var leftParenthesis=tokens[i];i++;while(i<leftParenthesis.right){if(l=checkUri1(i)){i+=l;tokens[start].uriType=1;}else if(l=checkUri2(i)){i+=l;tokens[start].uriType=2;}else return 0;}
return i-start;}
function getUri(){var uriType=tokens[pos].uriType;if(uriType===1)return getUri1();if(uriType===2)return getUri2();}
function checkUriRawCharacters(i){var start=i;var l=void 0;if(l=checkIdent(i))i+=l;else if(l=checkNumber(i))i+=l;else{switch(tokens[i].type){case TokenType.ExclamationMark:case TokenType.NumberSign:case TokenType.DollarSign:case TokenType.PercentSign:case TokenType.Ampersand:case TokenType.Asterisk:case TokenType.PlusSign:case TokenType.Comma:case TokenType.HyphenMinus:case TokenType.FullStop:case TokenType.Solidus:case TokenType.Colon:case TokenType.Semicolon:case TokenType.LessThanSign:case TokenType.EqualsSign:case TokenType.GreaterThanSign:case TokenType.QuotationMark:case TokenType.CommercialAt:case TokenType.LeftSquareBracket:case TokenType.RightSquareBracket:case TokenType.CircumflexAccent:case TokenType.LowLine:case TokenType.LeftCurlyBracket:case TokenType.VerticalLine:case TokenType.RightCurlyBracket:case TokenType.Tilde:i+=1;break;default:return 0;}}
return i-start;}
function checkUriRaw(i){var start=i;var l=void 0;while(i<tokensLength){if(checkInterpolation(i)||checkVariable(i))break;else if(l=checkUriRawCharacters(i))i+=l;else break;}
tokens[start].uri_raw_end=i;return i-start;}
function getUriRaw(){var startPos=pos;var type=NodeType.RawType;var token=tokens[startPos];var line=token.ln;var column=token.col;var content=[];var l=void 0;while(pos<tokens[startPos].uri_raw_end){if(checkInterpolation(pos)||checkVariable(pos))break;else if(l=checkUriRawCharacters(pos))pos+=l;else break;}
content=joinValues(startPos,pos-1);return newNode(type,content,line,column);}
function checkUri1(i){var start=i;var l=void 0;if(l=checkSC(i))i+=l;while(i<tokensLength){if(l=checkInterpolation(i)||checkUriRaw(i))i+=l;else break;}
if(l=checkSC(i))i+=l;if(i<tokens[start-1].right)return 0;tokens[start].uri_end=i;return i-start;}
function getUri1(){var startPos=pos;var type=NodeType.UriType;var token=tokens[startPos];var line=token.ln;var column=token.col;var content=[];var end=void 0;pos+=2;if(checkSC(pos))content=content.concat(getSC());while(pos<tokens[startPos+2].uri_end){if(checkInterpolation(pos))content.push(getInterpolation());else if(checkUriRaw(pos))content.push(getUriRaw());else break;}
if(checkSC(pos))content=content.concat(getSC());if(pos<tokens[startPos+1].right)return 0;end=getLastPosition(content,line,column,1);pos++;return newNode(type,content,line,column,end);}
function checkUri2(i){var start=i;var l=void 0;while(i<tokensLength){if(l=checkSC(i))i+=l;else if(l=checkString(i))i+=l;else if(l=checkFunction(i))i+=l;else if(l=checkUnary(i))i+=l;else if(l=checkIdentOrInterpolation(i))i+=l;else if(l=checkVariable(i))i+=l;else break;}
tokens[start].uri_end=i;return i-start;}
function getUri2(){var startPos=pos;var token=tokens[startPos];var line=token.ln;var column=token.col;var content=[];var end=void 0;pos+=2;while(pos<tokens[startPos+2].uri_end){if(checkSC(pos))content=content.concat(getSC());else if(checkUnary(pos))content.push(getUnary());else if(_checkValue(pos))content.push(_getValue());else break;}
end=getLastPosition(content,line,column,1);pos++;return newNode(NodeType.UriType,content,line,column,end);}
function checkValue(i){var start=i;var l=void 0;var s=void 0;var _i=void 0;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;}
function getValue(){var startPos=pos;var x=[];var _pos=void 0;var s=void 0;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);}
function checkSingleValue(i){var start=i;var l=void 0;var s=void 0;var _i=void 0;while(i<tokensLength){if(checkDeclDelim(i)||checkDelim(i))break;s=checkSC(i);_i=i+s;if(l=_checkValue(_i))i+=l+s;if(!l||checkBlock(i-l))break;}
return i-start;}
function getSingleValue(){var startPos=pos;var x=[];var _pos=void 0;var s=void 0;while(pos<tokensLength){s=checkSC(pos);_pos=pos+s;if(checkDeclDelim(_pos)||checkDelim(_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);}
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);}
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();}
function checkVariable(i){var l;if(i>=tokensLength||tokens[i].type!==TokenType.DollarSign)return 0;return(l=checkIdent(i+1))?l+1:0;}
function getVariable(){var startPos=pos;var x=[];pos++;x.push(getIdent());var token=tokens[startPos];return newNode(NodeType.VariableType,x,token.ln,token.col);}
function checkVariablesList(i){var d=0;var l=void 0;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;}
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);}
function checkVhash(i){var l;if(i>=tokensLength||tokens[i].type!==TokenType.NumberSign)return 0;return(l=checkNmName2(i+1))?l+1:0;}
function getVhash(){var startPos=pos;var x=void 0;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);}
function checkSelectorsGroup(i){if(i>=tokensLength)return 0;var start=i;var l=void 0;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();}
function checkSelector1(i){if(i>=tokensLength)return 0;var start=i;var l=void 0;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);}
function checkSelector2(i){if(i>=tokensLength)return 0;var start=i;var l=void 0;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=void 0;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=void 0;if(l=checkUniversalSelector(i)||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;}
function getCompoundSelector1(){var sequence=[];var compoundSelectorEnd=tokens[pos].compoundSelectorEnd;if(checkUniversalSelector(pos))sequence.push(getUniversalSelector());else 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;}
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;}
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 checkUniversalSelector(i){if(i>=tokensLength)return 0;var start=i;var l=void 0;if(l=checkNamePrefix(i))i+=l;if(tokens[i].type===TokenType.Asterisk)i++;else return 0;return i-start;}
function getUniversalSelector(){var type=NodeType.UniversalSelectorType;var token=tokens[pos];var line=token.ln;var column=token.col;var content=[];var end=void 0;if(checkNamePrefix(pos)){content.push(getNamePrefix());end=getLastPosition(content,line,column,1);}
pos++;return newNode(type,content,line,column,end);}
function checkTypeSelector(i){var start=i;var l=void 0;if(i>=tokensLength)return 0;if(l=checkNamePrefix(i))i+=l;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());content=content.concat(getIdentOrInterpolation());return newNode(type,content,line,column);}
function checkAttributeSelector(i){var l=void 0;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();}
function checkAttributeSelector1(i){var start=i;if(tokens[i].type===TokenType.LeftSquareBracket)i++;else return 0;var l=void 0;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=[];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());}
pos++;var end=getLastPosition(content,line,column,1);return newNode(type,content,line,column,end);}
function checkAttributeSelector2(i){var start=i;if(tokens[i].type===TokenType.LeftSquareBracket)i++;else return 0;var l=void 0;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=[];pos++;content=content.concat(getSC());content.push(getAttributeName());content=content.concat(getSC());pos++;var end=getLastPosition(content,line,column,1);return newNode(type,content,line,column,end);}
function checkAttributeName(i){var start=i;var l=void 0;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=void 0;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=void 0;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();}
function checkNamePrefix1(i){var start=i;var l=void 0;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);}
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);}
function checkNamespacePrefix(i){if(i>=tokensLength)return 0;var l=void 0;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);}
function checkNamespaceSeparator(i){if(i>=tokensLength)return 0;if(tokens[i].type!==TokenType.VerticalLine)return 0;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);}
module.exports=function(_tokens,context){tokens=_tokens;tokensLength=tokens.length;pos=0;return contexts[context]();};},function(module,exports,__webpack_require__){'use strict';module.exports=function(css,tabSize){var TokenType=__webpack_require__(13);var tokens=[];var urlMode=false;var c=void 0;var cn=void 0;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,'`':TokenType.Backtick};function pushToken(type,value,column){tokens.push({tn:tn++,ln:ln,col:column,type:type,value:value});}
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--),col);col+=pos-start;}
function parseString(css,q){var start=pos;for(pos++;pos<css.length;pos++){if(css.charAt(pos)==='\\')pos++;else if(css.charAt(pos)===q)break;}
var type=q==='"'?TokenType.StringDQ:TokenType.StringSQ;pushToken(type,css.substring(start,pos+1),col);col+=pos-start;}
function parseDecimalNumber(css){var start=pos;for(;pos<css.length;pos++){if(!isDecimalDigit(css.charAt(pos)))break;}
pushToken(TokenType.DecimalNumber,css.substring(start,pos--),col);col+=pos-start;}
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--);if(!urlMode&&ident==='url'&&css.charAt(pos+1)==='('){urlMode=true;}
pushToken(TokenType.Identifier,ident,col);col+=pos-start;}
function parseEquality(){pushToken(TokenType.EqualitySign,'==',col);pos++;col++;}
function parseInequality(){pushToken(TokenType.InequalitySign,'!=',col);pos++;col++;}
function parseMLComment(css){var start=pos;for(pos+=2;pos<css.length;pos++){if(css.charAt(pos)==='*'&&css.charAt(pos+1)==='/'){pos++;break;}}
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;for(pos+=2;pos<css.length;pos++){if(css.charAt(pos)==='\n'||css.charAt(pos)==='\r'){break;}}
pushToken(TokenType.CommentSL,css.substring(start,pos--),col);col+=pos-start;}
function getTokens(css){for(pos=0;pos<css.length;col++,pos++){c=css.charAt(pos);cn=css.charAt(pos+1);if(c==='/'&&cn==='*'){parseMLComment(css);}
else if(!urlMode&&c==='/'&&cn==='/'){parseSLComment(css);}
else if(c==='"'||c==="'"){parseString(css,c);}
else if(c===' '){parseSpaces(css);}
else if(c==='='&&cn==='='){parseEquality(css);}
else if(c==='!'&&cn==='='){parseInequality(css);}
else if(c in Punctuation){if(c==='\r'&&cn==='\n'||c==='\n'){if(c==='\r'){pushToken(TokenType.Newline,'\r\n',col);pos++;}else if(c==='\n'){pushToken(Punctuation[c],c,col);}
ln++;col=0;}else if(c!=='\r'&&c!=='\n'){pushToken(Punctuation[c],c,col);}
if(c===')')urlMode=false;else if(c==='\t'&&tabSize>1)col+=tabSize-1;}
else if(isDecimalDigit(c)){parseDecimalNumber(css);}
else{parseIdentifier(css);}}
return tokens;}
return getTokens(css);};},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]});};}])});;;Gonzales.SCSSParser=class{parse(content){var ast=null;try{ast=gonzales.parse(content,{syntax:'scss'});}catch(e){return[];}
var rootBlock={properties:[],node:ast};var blocks=[rootBlock];ast.selectors=[];Gonzales.SCSSParser.extractNodes(ast,blocks,rootBlock);var rules=[];for(var block of blocks)
this._handleBlock(block,rules);return rules;}
_handleBlock(block,output){var selectors=block.node.selectors.map(Gonzales.SCSSParser.rangeFromNode);var properties=[];var styleRange=Gonzales.SCSSParser.rangeFromNode(block.node);styleRange.startColumn+=1;styleRange.endColumn-=1;for(var node of block.properties){if(node.type==='declaration')
this._handleDeclaration(node,properties);else if(node.type==='include')
this._handleInclude(node,properties);else if(node.type==='multilineComment'&&node.start.line===node.end.line)
this._handleComment(node,properties);}
if(!selectors.length&&!properties.length)
return;var rule=new Gonzales.SCSSParser.Rule(selectors,properties,styleRange);output.push(rule);}
_handleDeclaration(node,output){var propertyNode=node.content.find(node=>node.type==='property');var valueNode=node.content.find(node=>node.type==='value');if(!propertyNode||!valueNode)
return;var nameRange=Gonzales.SCSSParser.rangeFromNode(propertyNode);var valueRange=Gonzales.SCSSParser.rangeFromNode(valueNode);var range=(node.declarationRange);var property=new Gonzales.SCSSParser.Property(range,nameRange,valueRange,false);output.push(property);}
_handleInclude(node,output){var mixinName=node.content.find(node=>node.type==='ident');if(!mixinName)
return;var nameRange=Gonzales.SCSSParser.rangeFromNode(mixinName);var mixinArguments=node.content.find(node=>node.type==='arguments');if(!mixinArguments)
return;var parameters=mixinArguments.content.filter(node=>node.type!=='delimiter'&&node.type!=='space');for(var parameter of parameters){var range=Gonzales.SCSSParser.rangeFromNode(node);var valueRange=Gonzales.SCSSParser.rangeFromNode(parameter);var property=new Gonzales.SCSSParser.Property(range,nameRange,valueRange,false);output.push(property);}}
_handleComment(node,output){if(node.start.line!==node.end.line)
return;var innerText=(node.content);var innerResult=this.parse(innerText);if(innerResult.length!==1||innerResult[0].properties.length!==1)
return;var property=innerResult[0].properties[0];var disabledProperty=property.rebaseInsideOneLineComment(node);output.push(disabledProperty);}};Gonzales.SCSSParser.rangeFromNode=function(node){return new Gonzales.TextRange(node.start.line-1,node.start.column-1,node.end.line-1,node.end.column);};Gonzales.SCSSParser.Property=class{constructor(range,nameRange,valueRange,disabled){this.range=range;this.name=nameRange;this.value=valueRange;this.disabled=disabled;}
rebaseInsideOneLineComment(commentNode){var lineOffset=commentNode.start.line-1;var columnOffset=commentNode.start.column-1+2;var range=Gonzales.SCSSParser.rangeFromNode(commentNode);var name=rebaseRange(this.name,lineOffset,columnOffset);var value=rebaseRange(this.value,lineOffset,columnOffset);return new Gonzales.SCSSParser.Property(range,name,value,true);function rebaseRange(range,lineOffset,columnOffset){return new Gonzales.TextRange(range.startLine+lineOffset,range.startColumn+columnOffset,range.endLine+lineOffset,range.endColumn+columnOffset);}}};Gonzales.SCSSParser.Rule=class{constructor(selectors,properties,styleRange){this.selectors=selectors;this.properties=properties;this.styleRange=styleRange;}};Gonzales.SCSSParser.extractNodes=function(node,blocks,lastBlock){if(!Array.isArray(node.content))
return;if(node.type==='block'){lastBlock={node:node,properties:[]};blocks.push(lastBlock);}
var lastDeclaration=null;var selectors=[];for(var i=0;i<node.content.length;++i){var child=node.content[i];if(child.type==='declarationDelimiter'&&lastDeclaration){lastDeclaration.declarationRange.endLine=child.end.line-1;lastDeclaration.declarationRange.endColumn=child.end.column;lastDeclaration=null;}else if(child.type==='selector'){selectors.push(child);}else if(child.type==='block'){child.selectors=selectors;selectors=[];}
if(child.type==='include'||child.type==='declaration'||child.type==='multilineComment')
lastBlock.properties.push(child);if(child.type==='declaration'){lastDeclaration=child;const line=child.start.line-1;const column=child.start.column-1;lastDeclaration.declarationRange=new Gonzales.TextRange(line,column,line,column);}
Gonzales.SCSSParser.extractNodes(child,blocks,lastBlock);}
if(lastDeclaration){lastDeclaration.declarationRange.endLine=node.end.line-1;lastDeclaration.declarationRange.endColumn=node.end.column-1;}};Gonzales.TextRange=class{constructor(startLine,startColumn,endLine,endColumn){this.startLine=startLine;this.startColumn=startColumn;this.endLine=endLine;this.endColumn=endColumn;}};;