(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;iref;i=0<=ref?++j:--j){mapping[Escaper.LIST_ESCAPEES[i]]=Escaper.LIST_ESCAPED[i]}return mapping}();Escaper.PATTERN_CHARACTERS_TO_ESCAPE=new Pattern("[\\x00-\\x1f]|…| |
|
");Escaper.PATTERN_MAPPING_ESCAPEES=new Pattern(Escaper.LIST_ESCAPEES.join("|").split("\\").join("\\\\"));Escaper.PATTERN_SINGLE_QUOTING=new Pattern("[\\s'\":{}[\\],&*#?]|^[-?|<>=!%@`]");Escaper.requiresDoubleQuoting=function(value){return this.PATTERN_CHARACTERS_TO_ESCAPE.test(value)};Escaper.escapeWithDoubleQuotes=function(value){var result;result=this.PATTERN_MAPPING_ESCAPEES.replace(value,function(_this){return function(str){return _this.MAPPING_ESCAPEES_TO_ESCAPED[str]}}(this));return'"'+result+'"'};Escaper.requiresSingleQuoting=function(value){return this.PATTERN_SINGLE_QUOTING.test(value)};Escaper.escapeWithSingleQuotes=function(value){return"'"+value.replace(/'/g,"''")+"'"};return Escaper}();module.exports=Escaper},{"./Pattern":8}],3:[function(require,module,exports){var DumpException,extend=function(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child},hasProp={}.hasOwnProperty;DumpException=function(superClass){extend(DumpException,superClass);function DumpException(message,parsedLine,snippet){DumpException.__super__.constructor.call(this,message);this.message=message;this.parsedLine=parsedLine;this.snippet=snippet}DumpException.prototype.toString=function(){if(this.parsedLine!=null&&this.snippet!=null){return" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')"}else{return" "+this.message}};return DumpException}(Error);module.exports=DumpException},{}],4:[function(require,module,exports){var ParseException,extend=function(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child},hasProp={}.hasOwnProperty;ParseException=function(superClass){extend(ParseException,superClass);function ParseException(message,parsedLine,snippet){ParseException.__super__.constructor.call(this,message);this.message=message;this.parsedLine=parsedLine;this.snippet=snippet}ParseException.prototype.toString=function(){if(this.parsedLine!=null&&this.snippet!=null){return" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')"}else{return" "+this.message}};return ParseException}(Error);module.exports=ParseException},{}],5:[function(require,module,exports){var ParseMore,extend=function(child,parent){for(var key in parent){if(hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child},hasProp={}.hasOwnProperty;ParseMore=function(superClass){extend(ParseMore,superClass);function ParseMore(message,parsedLine,snippet){ParseMore.__super__.constructor.call(this,message);this.message=message;this.parsedLine=parsedLine;this.snippet=snippet}ParseMore.prototype.toString=function(){if(this.parsedLine!=null&&this.snippet!=null){return" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')"}else{return" "+this.message}};return ParseMore}(Error);module.exports=ParseMore},{}],6:[function(require,module,exports){var DumpException,Escaper,Inline,ParseException,ParseMore,Pattern,Unescaper,Utils,indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i=0){output=this.parseQuotedScalar(scalar,context);i=context.i;if(delimiters!=null){tmp=Utils.ltrim(scalar.slice(i)," ");if(!(ref1=tmp.charAt(0),indexOf.call(delimiters,ref1)>=0)){throw new ParseException("Unexpected characters ("+scalar.slice(i)+").")}}}else{if(!delimiters){output=scalar.slice(i);i+=output.length;strpos=output.indexOf(" #");if(strpos!==-1){output=Utils.rtrim(output.slice(0,strpos))}}else{joinedDelimiters=delimiters.join("|");pattern=this.PATTERN_SCALAR_BY_DELIMITERS[joinedDelimiters];if(pattern==null){pattern=new Pattern("^(.+?)("+joinedDelimiters+")");this.PATTERN_SCALAR_BY_DELIMITERS[joinedDelimiters]=pattern}if(match=pattern.exec(scalar.slice(i))){output=match[1];i+=output.length}else{throw new ParseException("Malformed inline YAML string ("+scalar+").")}}if(evaluate){output=this.evaluateScalar(output,context)}}context.i=i;return output};Inline.parseQuotedScalar=function(scalar,context){var i,match,output;i=context.i;if(!(match=this.PATTERN_QUOTED_SCALAR.exec(scalar.slice(i)))){throw new ParseMore("Malformed inline YAML string ("+scalar.slice(i)+").")}output=match[0].substr(1,match[0].length-2);if('"'===scalar.charAt(i)){output=Unescaper.unescapeDoubleQuotedString(output)}else{output=Unescaper.unescapeSingleQuotedString(output)}i+=match[0].length;context.i=i;return output};Inline.parseSequence=function(sequence,context){var e,error,i,isQuoted,len,output,ref,value;output=[];len=sequence.length;i=context.i;i+=1;while(i0)){subValue=null}return objectDecoder(trimmedScalar.slice(0,firstSpace),subValue)}}if(exceptionOnInvalidType){throw new ParseException("Custom object support when parsing a YAML file has been disabled.")}return null}break;case"0":if("0x"===scalar.slice(0,2)){return Utils.hexDec(scalar)}else if(Utils.isDigits(scalar)){return Utils.octDec(scalar)}else if(Utils.isNumeric(scalar)){return parseFloat(scalar)}else{return scalar}break;case"+":if(Utils.isDigits(scalar)){raw=scalar;cast=parseInt(raw);if(raw===String(cast)){return cast}else{return raw}}else if(Utils.isNumeric(scalar)){return parseFloat(scalar)}else if(this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)){return parseFloat(scalar.replace(",",""))}return scalar;case"-":if(Utils.isDigits(scalar.slice(1))){if("0"===scalar.charAt(1)){return-Utils.octDec(scalar.slice(1))}else{raw=scalar.slice(1);cast=parseInt(raw);if(raw===String(cast)){return-cast}else{return-raw}}}else if(Utils.isNumeric(scalar)){return parseFloat(scalar)}else if(this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)){return parseFloat(scalar.replace(",",""))}return scalar;default:if(date=Utils.stringToDate(scalar)){return date}else if(Utils.isNumeric(scalar)){return parseFloat(scalar)}else if(this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(scalar)){return parseFloat(scalar.replace(",",""))}return scalar}}};return Inline}();module.exports=Inline},{"./Escaper":2,"./Exception/DumpException":3,"./Exception/ParseException":4,"./Exception/ParseMore":5,"./Pattern":8,"./Unescaper":9,"./Utils":10}],7:[function(require,module,exports){var Inline,ParseException,ParseMore,Parser,Pattern,Utils;Inline=require("./Inline");Pattern=require("./Pattern");Utils=require("./Utils");ParseException=require("./Exception/ParseException");ParseMore=require("./Exception/ParseMore");Parser=function(){Parser.prototype.PATTERN_FOLDED_SCALAR_ALL=new Pattern("^(?:(?![^\\|>]*)\\s+)?(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$");Parser.prototype.PATTERN_FOLDED_SCALAR_END=new Pattern("(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$");Parser.prototype.PATTERN_SEQUENCE_ITEM=new Pattern("^\\-((?\\s+)(?.+?))?\\s*$");Parser.prototype.PATTERN_ANCHOR_VALUE=new Pattern("^&(?[^ ]+) *(?.*)");Parser.prototype.PATTERN_COMPACT_NOTATION=new Pattern("^(?"+Inline.REGEX_QUOTED_STRING+"|[^ '\"\\{\\[].*?) *\\:(\\s+(?.+?))?\\s*$");Parser.prototype.PATTERN_MAPPING_ITEM=new Pattern("^(?"+Inline.REGEX_QUOTED_STRING+"|[^ '\"\\[\\{].*?) *\\:(\\s+(?.+?))?\\s*$");Parser.prototype.PATTERN_DECIMAL=new Pattern("\\d+");Parser.prototype.PATTERN_INDENT_SPACES=new Pattern("^ +");Parser.prototype.PATTERN_TRAILING_LINES=new Pattern("(\n*)$");Parser.prototype.PATTERN_YAML_HEADER=new Pattern("^\\%YAML[: ][\\d\\.]+.*\n","m");Parser.prototype.PATTERN_LEADING_COMMENTS=new Pattern("^(\\#.*?\n)+","m");Parser.prototype.PATTERN_DOCUMENT_MARKER_START=new Pattern("^\\-\\-\\-.*?\n","m");Parser.prototype.PATTERN_DOCUMENT_MARKER_END=new Pattern("^\\.\\.\\.\\s*$","m");Parser.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION={};Parser.prototype.CONTEXT_NONE=0;Parser.prototype.CONTEXT_SEQUENCE=1;Parser.prototype.CONTEXT_MAPPING=2;function Parser(offset){this.offset=offset!=null?offset:0;this.lines=[];this.currentLineNb=-1;this.currentLine="";this.refs={}}Parser.prototype.parse=function(value,exceptionOnInvalidType,objectDecoder){var alias,allowOverwrite,block,c,context,data,e,error,error1,error2,first,i,indent,isRef,j,k,key,l,lastKey,len,len1,len2,len3,lineCount,m,matches,mergeNode,n,name,parsed,parsedItem,parser,ref,ref1,ref2,refName,refValue,val,values;if(exceptionOnInvalidType==null){exceptionOnInvalidType=false}if(objectDecoder==null){objectDecoder=null}this.currentLineNb=-1;this.currentLine="";this.lines=this.cleanup(value).split("\n");data=null;context=this.CONTEXT_NONE;allowOverwrite=false;while(this.moveToNextLine()){if(this.isCurrentLineEmpty()){continue}if("\t"===this.currentLine[0]){throw new ParseException("A YAML file cannot contain tabs as indentation.",this.getRealCurrentLineNb()+1,this.currentLine)}isRef=mergeNode=false;if(values=this.PATTERN_SEQUENCE_ITEM.exec(this.currentLine)){if(this.CONTEXT_MAPPING===context){throw new ParseException("You cannot define a sequence item when in a mapping")}context=this.CONTEXT_SEQUENCE;if(data==null){data=[]}if(values.value!=null&&(matches=this.PATTERN_ANCHOR_VALUE.exec(values.value))){isRef=matches.ref;values.value=matches.value}if(!(values.value!=null)||""===Utils.trim(values.value," ")||Utils.ltrim(values.value," ").indexOf("#")===0){if(this.currentLineNb=newIndent){data.push(this.currentLine.slice(newIndent))}else if(Utils.ltrim(this.currentLine).charAt(0)==="#"){}else if(0===indent){this.moveToPreviousLine();break}else{throw new ParseException("Indentation problem.",this.getRealCurrentLineNb()+1,this.currentLine)}}return data.join("\n")};Parser.prototype.moveToNextLine=function(){if(this.currentLineNb>=this.lines.length-1){return false}this.currentLine=this.lines[++this.currentLineNb];return true};Parser.prototype.moveToPreviousLine=function(){this.currentLine=this.lines[--this.currentLineNb]};Parser.prototype.parseValue=function(value,exceptionOnInvalidType,objectDecoder){var e,error,foldedIndent,matches,modifiers,pos,ref,ref1,val;if(0===value.indexOf("*")){pos=value.indexOf("#");if(pos!==-1){value=value.substr(1,pos-2)}else{value=value.slice(1)}if(this.refs[value]===void 0){throw new ParseException('Reference "'+value+'" does not exist.',this.currentLine)}return this.refs[value]}if(matches=this.PATTERN_FOLDED_SCALAR_ALL.exec(value)){modifiers=(ref=matches.modifiers)!=null?ref:"";foldedIndent=Math.abs(parseInt(modifiers));if(isNaN(foldedIndent)){foldedIndent=0}val=this.parseFoldedScalar(matches.separator,this.PATTERN_DECIMAL.replace(modifiers,""),foldedIndent);if(matches.type!=null){Inline.configure(exceptionOnInvalidType,objectDecoder);return Inline.parseScalar(matches.type+" "+val)}else{return val}}if((ref1=value.charAt(0))==="["||ref1==="{"||ref1==='"'||ref1==="'"){while(true){try{return Inline.parse(value,exceptionOnInvalidType,objectDecoder)}catch(error){e=error;if(e instanceof ParseMore&&this.moveToNextLine()){value+="\n"+Utils.trim(this.currentLine," ")}else{e.parsedLine=this.getRealCurrentLineNb()+1;e.snippet=this.currentLine;throw e}}}}else{if(this.isNextLineIndented()){value+="\n"+this.getNextEmbedBlock()}return Inline.parse(value,exceptionOnInvalidType,objectDecoder)}};Parser.prototype.parseFoldedScalar=function(separator,indicator,indentation){var isCurrentLineBlank,j,len,line,matches,newText,notEOF,pattern,ref,text;if(indicator==null){indicator=""}if(indentation==null){indentation=0}notEOF=this.moveToNextLine();if(!notEOF){return""}isCurrentLineBlank=this.isCurrentLineBlank();text="";while(notEOF&&isCurrentLineBlank){if(notEOF=this.moveToNextLine()){text+="\n";isCurrentLineBlank=this.isCurrentLineBlank()}}if(0===indentation){if(matches=this.PATTERN_INDENT_SPACES.exec(this.currentLine)){indentation=matches[0].length}}if(indentation>0){pattern=this.PATTERN_FOLDED_SCALAR_BY_INDENTATION[indentation];if(pattern==null){pattern=new Pattern("^ {"+indentation+"}(.*)$");Parser.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION[indentation]=pattern}while(notEOF&&(isCurrentLineBlank||(matches=pattern.exec(this.currentLine)))){if(isCurrentLineBlank){text+=this.currentLine.slice(indentation)}else{text+=matches[1]}if(notEOF=this.moveToNextLine()){text+="\n";isCurrentLineBlank=this.isCurrentLineBlank()}}}else if(notEOF){text+="\n"}if(notEOF){this.moveToPreviousLine()}if(">"===separator){newText="";ref=text.split("\n");for(j=0,len=ref.length;jcurrentIndentation){ret=true}this.moveToPreviousLine();return ret};Parser.prototype.isCurrentLineEmpty=function(){var trimmedLine;trimmedLine=Utils.trim(this.currentLine," ");return trimmedLine.length===0||trimmedLine.charAt(0)==="#"};Parser.prototype.isCurrentLineBlank=function(){return""===Utils.trim(this.currentLine," ")};Parser.prototype.isCurrentLineComment=function(){var ltrimmedLine;ltrimmedLine=Utils.ltrim(this.currentLine," ");return ltrimmedLine.charAt(0)==="#"};Parser.prototype.cleanup=function(value){var count,i,indent,j,l,len,len1,line,lines,ref,ref1,ref2,smallestIndent,trimmedValue;if(value.indexOf("\r")!==-1){value=value.split("\r\n").join("\n").split("\r").join("\n")}count=0;ref=this.PATTERN_YAML_HEADER.replaceAll(value,""),value=ref[0],count=ref[1];this.offset+=count;ref1=this.PATTERN_LEADING_COMMENTS.replaceAll(value,"",1),trimmedValue=ref1[0],count=ref1[1];if(count===1){this.offset+=Utils.subStrCount(value,"\n")-Utils.subStrCount(trimmedValue,"\n");value=trimmedValue}ref2=this.PATTERN_DOCUMENT_MARKER_START.replaceAll(value,"",1),trimmedValue=ref2[0],count=ref2[1];if(count===1){this.offset+=Utils.subStrCount(value,"\n")-Utils.subStrCount(trimmedValue,"\n");value=trimmedValue;value=this.PATTERN_DOCUMENT_MARKER_END.replace(value,"")}lines=value.split("\n");smallestIndent=-1;for(j=0,len=lines.length;j0){for(i=l=0,len1=lines.length;l"){cleanedRegex+="(";i++;if(name.length>0){if(mapping==null){mapping={}}mapping[name]=capturingBracketNumber}break}else{name+=subChar}i++}}else{cleanedRegex+=_char;capturingBracketNumber++}}else{cleanedRegex+=_char}}else{cleanedRegex+=_char}i++}this.rawRegex=rawRegex;this.cleanedRegex=cleanedRegex;this.regex=new RegExp(this.cleanedRegex,"g"+modifiers.replace("g",""));this.mapping=mapping}Pattern.prototype.exec=function(str){var index,matches,name,ref;this.regex.lastIndex=0;matches=this.regex.exec(str);if(matches==null){return null}if(this.mapping!=null){ref=this.mapping;for(name in ref){index=ref[name];matches[name]=matches[index]}}return matches};Pattern.prototype.test=function(str){this.regex.lastIndex=0;return this.regex.test(str)};Pattern.prototype.replace=function(str,replacement){this.regex.lastIndex=0;return str.replace(this.regex,replacement)};Pattern.prototype.replaceAll=function(str,replacement,limit){var count;if(limit==null){limit=0}this.regex.lastIndex=0;count=0;while(this.regex.test(str)&&(limit===0||count[0-9][0-9][0-9][0-9])"+"-(?[0-9][0-9]?)"+"-(?[0-9][0-9]?)"+"(?:(?:[Tt]|[ \t]+)"+"(?[0-9][0-9]?)"+":(?[0-9][0-9])"+":(?[0-9][0-9])"+"(?:.(?[0-9]*))?"+"(?:[ \t]*(?Z|(?[-+])(?[0-9][0-9]?)"+"(?::(?[0-9][0-9]))?))?)?"+"$","i");Utils.LOCAL_TIMEZONE_OFFSET=(new Date).getTimezoneOffset()*60*1e3;Utils.trim=function(str,_char){var regexLeft,regexRight;if(_char==null){_char="\\s"}regexLeft=this.REGEX_LEFT_TRIM_BY_CHAR[_char];if(regexLeft==null){this.REGEX_LEFT_TRIM_BY_CHAR[_char]=regexLeft=new RegExp("^"+_char+""+_char+"*")}regexLeft.lastIndex=0;regexRight=this.REGEX_RIGHT_TRIM_BY_CHAR[_char];if(regexRight==null){this.REGEX_RIGHT_TRIM_BY_CHAR[_char]=regexRight=new RegExp(_char+""+_char+"*$")}regexRight.lastIndex=0;return str.replace(regexLeft,"").replace(regexRight,"")};Utils.ltrim=function(str,_char){var regexLeft;if(_char==null){_char="\\s"}regexLeft=this.REGEX_LEFT_TRIM_BY_CHAR[_char];if(regexLeft==null){this.REGEX_LEFT_TRIM_BY_CHAR[_char]=regexLeft=new RegExp("^"+_char+""+_char+"*")}regexLeft.lastIndex=0;return str.replace(regexLeft,"")};Utils.rtrim=function(str,_char){var regexRight;if(_char==null){_char="\\s"}regexRight=this.REGEX_RIGHT_TRIM_BY_CHAR[_char];if(regexRight==null){this.REGEX_RIGHT_TRIM_BY_CHAR[_char]=regexRight=new RegExp(_char+""+_char+"*$")}regexRight.lastIndex=0;return str.replace(regexRight,"")};Utils.isEmpty=function(value){return!value||value===""||value==="0"||value instanceof Array&&value.length===0||this.isEmptyObject(value)};Utils.isEmptyObject=function(value){var k;return value instanceof Object&&function(){var results;results=[];for(k in value){if(!hasProp.call(value,k))continue;results.push(k)}return results}().length===0};Utils.subStrCount=function(string,subString,start,length){var c,i,j,len,ref,sublen;c=0;string=""+string;subString=""+subString;if(start!=null){string=string.slice(start)}if(length!=null){string=string.slice(0,length)}len=string.length;sublen=subString.length;for(i=j=0,ref=len;0<=ref?jref;i=0<=ref?++j:--j){if(subString===string.slice(i,sublen)){c++;i+=sublen-1}}return c};Utils.isDigits=function(input){this.REGEX_DIGITS.lastIndex=0;return this.REGEX_DIGITS.test(input)};Utils.octDec=function(input){this.REGEX_OCTAL.lastIndex=0;return parseInt((input+"").replace(this.REGEX_OCTAL,""),8)};Utils.hexDec=function(input){this.REGEX_HEXADECIMAL.lastIndex=0;input=this.trim(input);if((input+"").slice(0,2)==="0x"){input=(input+"").slice(2)}return parseInt((input+"").replace(this.REGEX_HEXADECIMAL,""),16)};Utils.utf8chr=function(c){var ch;ch=String.fromCharCode;if(128>(c%=2097152)){return ch(c)}if(2048>c){return ch(192|c>>6)+ch(128|c&63)}if(65536>c){return ch(224|c>>12)+ch(128|c>>6&63)+ch(128|c&63)}return ch(240|c>>18)+ch(128|c>>12&63)+ch(128|c>>6&63)+ch(128|c&63)};Utils.parseBoolean=function(input,strict){var lowerInput;if(strict==null){strict=true}if(typeof input==="string"){lowerInput=input.toLowerCase();if(!strict){if(lowerInput==="no"){return false}}if(lowerInput==="0"){return false}if(lowerInput==="false"){return false}if(lowerInput===""){return false}return true}return!!input};Utils.isNumeric=function(input){this.REGEX_SPACES.lastIndex=0;return typeof input==="number"||typeof input==="string"&&!isNaN(input)&&input.replace(this.REGEX_SPACES,"")!==""};Utils.stringToDate=function(str){var date,day,fraction,hour,info,minute,month,second,tz_hour,tz_minute,tz_offset,year;if(!(str!=null?str.length:void 0)){return null}info=this.PATTERN_DATE.exec(str);if(!info){return null}year=parseInt(info.year,10);month=parseInt(info.month,10)-1;day=parseInt(info.day,10);if(info.hour==null){date=new Date(Date.UTC(year,month,day));return date}hour=parseInt(info.hour,10);minute=parseInt(info.minute,10);second=parseInt(info.second,10);if(info.fraction!=null){fraction=info.fraction.slice(0,3);while(fraction.length<3){fraction+="0"}fraction=parseInt(fraction,10)}else{fraction=0}if(info.tz!=null){tz_hour=parseInt(info.tz_hour,10);if(info.tz_minute!=null){tz_minute=parseInt(info.tz_minute,10)}else{tz_minute=0}tz_offset=(tz_hour*60+tz_minute)*6e4;if("-"===info.tz_sign){tz_offset*=-1}}date=new Date(Date.UTC(year,month,day,hour,minute,second,fraction));if(tz_offset){date.setTime(date.getTime()-tz_offset)}return date};Utils.strRepeat=function(str,number){var i,res;res="";i=0;while(i