(function e(t,n,i){function r(l,u){if(!n[l]){if(!t[l]){var a=typeof require=="function"&&require;if(!u&&a)return a(l,!0);if(s)return s(l,!0);var o=new Error("Cannot find module '"+l+"'");throw o.code="MODULE_NOT_FOUND",o}var f=n[l]={exports:{}};t[l][0].call(f.exports,function(e){var n=t[l][1][e];return r(n?n:e)},f,f.exports,e,t,n,i)}return n[l].exports}var s=typeof require=="function"&&require;for(var l=0;lr;e=0<=r?++n:--n){i[t.LIST_ESCAPEES[e]]=t.LIST_ESCAPED[e]}return i}();t.PATTERN_CHARACTERS_TO_ESCAPE=new r("[\\x00-\\x1f]|…| |
|
");t.PATTERN_MAPPING_ESCAPEES=new r(t.LIST_ESCAPEES.join("|").split("\\").join("\\\\"));t.PATTERN_SINGLE_QUOTING=new r("[\\s'\":{}[\\],&*#?]|^[-?|<>=!%@`]");t.requiresDoubleQuoting=function(e){return this.PATTERN_CHARACTERS_TO_ESCAPE.test(e)};t.escapeWithDoubleQuotes=function(e){var t;t=this.PATTERN_MAPPING_ESCAPEES.replace(e,function(e){return function(t){return e.MAPPING_ESCAPEES_TO_ESCAPED[t]}}(this));return'"'+t+'"'};t.requiresSingleQuoting=function(e){return this.PATTERN_SINGLE_QUOTING.test(e)};t.escapeWithSingleQuotes=function(e){return"'"+e.replace(/'/g,"''")+"'"};return t}();t.exports=i},{"./Pattern":8}],3:[function(e,t,n){var i,r=function(e,t){for(var n in t){if(s.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},s={}.hasOwnProperty;i=function(e){r(t,e);function t(e,t,n){this.message=e;this.parsedLine=t;this.snippet=n}t.prototype.toString=function(){if(this.parsedLine!=null&&this.snippet!=null){return" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')"}else{return" "+this.message}};return t}(Error);t.exports=i},{}],4:[function(e,t,n){var i,r=function(e,t){for(var n in t){if(s.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},s={}.hasOwnProperty;i=function(e){r(t,e);function t(e,t,n){this.message=e;this.parsedLine=t;this.snippet=n}t.prototype.toString=function(){if(this.parsedLine!=null&&this.snippet!=null){return" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')"}else{return" "+this.message}};return t}(Error);t.exports=i},{}],5:[function(e,t,n){var i,r=function(e,t){for(var n in t){if(s.call(t,n))e[n]=t[n]}function i(){this.constructor=e}i.prototype=t.prototype;e.prototype=new i;e.__super__=t.prototype;return e},s={}.hasOwnProperty;i=function(e){r(t,e);function t(e,t,n){this.message=e;this.parsedLine=t;this.snippet=n}t.prototype.toString=function(){if(this.parsedLine!=null&&this.snippet!=null){return" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')"}else{return" "+this.message}};return t}(Error);t.exports=i},{}],6:[function(e,t,n){var i,r,s,l,u,a,o,f,c=[].indexOf||function(e){for(var t=0,n=this.length;t=0){h=this.parseQuotedScalar(e,i);s=i.i;if(t!=null){A=f.ltrim(e.slice(s)," ");if(!(T=A.charAt(0),c.call(t,T)>=0)){throw new l("Unexpected characters ("+e.slice(s)+").")}}}else{if(!t){h=e.slice(s);s+=h.length;_=h.indexOf(" #");if(_!==-1){h=f.rtrim(h.slice(0,_))}}else{u=t.join("|");p=this.PATTERN_SCALAR_BY_DELIMITERS[u];if(p==null){p=new a("^(.+?)("+u+")");this.PATTERN_SCALAR_BY_DELIMITERS[u]=p}if(o=p.exec(e.slice(s))){h=o[1];s+=h.length}else{throw new l("Malformed inline YAML string ("+e+").")}}if(r){h=this.evaluateScalar(h,i)}}i.i=s;return h};e.parseQuotedScalar=function(e,t){var n,i,r;n=t.i;if(!(i=this.PATTERN_QUOTED_SCALAR.exec(e.slice(n)))){throw new u("Malformed inline YAML string ("+e.slice(n)+").")}r=i[0].substr(1,i[0].length-2);if('"'===e.charAt(n)){r=o.unescapeDoubleQuotedString(r)}else{r=o.unescapeSingleQuotedString(r)}n+=i[0].length;t.i=n;return r};e.parseSequence=function(e,t){var n,i,r,s,l,a,o,f;a=[];l=e.length;r=t.i;r+=1;while(r0)){p=null}return o(E.slice(0,u),p)}}if(r){throw new l("Custom object support when parsing a YAML file has been disabled.")}return null}break;case"0":if("0x"===e.slice(0,2)){return f.hexDec(e)}else if(f.isDigits(e)){return f.octDec(e)}else if(f.isNumeric(e)){return parseFloat(e)}else{return e}break;case"+":if(f.isDigits(e)){c=e;n=parseInt(c);if(c===String(n)){return n}else{return c}}else if(f.isNumeric(e)){return parseFloat(e)}else if(this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(e)){return parseFloat(e.replace(",",""))}return e;case"-":if(f.isDigits(e.slice(1))){if("0"===e.charAt(1)){return-f.octDec(e.slice(1))}else{c=e.slice(1);n=parseInt(c);if(c===String(n)){return-n}else{return-c}}}else if(f.isNumeric(e)){return parseFloat(e)}else if(this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(e)){return parseFloat(e.replace(",",""))}return e;default:if(i=f.stringToDate(e)){return i}else if(f.isNumeric(e)){return parseFloat(e)}else if(this.PATTERN_THOUSAND_NUMERIC_SCALAR.test(e)){return parseFloat(e.replace(",",""))}return e}}};return e}();t.exports=s},{"./Escaper":2,"./Exception/DumpException":3,"./Exception/ParseException":4,"./Exception/ParseMore":5,"./Pattern":8,"./Unescaper":9,"./Utils":10}],7:[function(e,t,n){var i,r,s,l,u,a;i=e("./Inline");u=e("./Pattern");a=e("./Utils");r=e("./Exception/ParseException");s=e("./Exception/ParseMore");l=function(){e.prototype.PATTERN_FOLDED_SCALAR_ALL=new u("^(?:(?![^\\|>]*)\\s+)?(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$");e.prototype.PATTERN_FOLDED_SCALAR_END=new u("(?\\||>)(?\\+|\\-|\\d+|\\+\\d+|\\-\\d+|\\d+\\+|\\d+\\-)?(? +#.*)?$");e.prototype.PATTERN_SEQUENCE_ITEM=new u("^\\-((?\\s+)(?.+?))?\\s*$");e.prototype.PATTERN_ANCHOR_VALUE=new u("^&(?[^ ]+) *(?.*)");e.prototype.PATTERN_COMPACT_NOTATION=new u("^(?"+i.REGEX_QUOTED_STRING+"|[^ '\"\\{\\[].*?) *\\:(\\s+(?.+?))?\\s*$");e.prototype.PATTERN_MAPPING_ITEM=new u("^(?"+i.REGEX_QUOTED_STRING+"|[^ '\"\\[\\{].*?) *\\:(\\s+(?.+?))?\\s*$");e.prototype.PATTERN_DECIMAL=new u("\\d+");e.prototype.PATTERN_INDENT_SPACES=new u("^ +");e.prototype.PATTERN_TRAILING_LINES=new u("(\n*)$");e.prototype.PATTERN_YAML_HEADER=new u("^\\%YAML[: ][\\d\\.]+.*\n","m");e.prototype.PATTERN_LEADING_COMMENTS=new u("^(\\#.*?\n)+","m");e.prototype.PATTERN_DOCUMENT_MARKER_START=new u("^\\-\\-\\-.*?\n","m");e.prototype.PATTERN_DOCUMENT_MARKER_END=new u("^\\.\\.\\.\\s*$","m");e.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION={};e.prototype.CONTEXT_NONE=0;e.prototype.CONTEXT_SEQUENCE=1;e.prototype.CONTEXT_MAPPING=2;function e(e){this.offset=e!=null?e:0;this.lines=[];this.currentLineNb=-1;this.currentLine="";this.refs={}}e.prototype.parse=function(t,n,s){var l,u,o,f,c,h,p,E,T,_,A,L,d,N,g,R,x,C,I,m,S,w,v,y,P,b,D,O,M,G,U,X,F,k,H,j,Y,B,Q;if(n==null){n=false}if(s==null){s=null}this.currentLineNb=-1;this.currentLine="";this.lines=this.cleanup(t).split("\n");h=null;c=this.CONTEXT_NONE;u=false;while(this.moveToNextLine()){if(this.isCurrentLineEmpty()){continue}if("\t"===this.currentLine[0]){throw new r("A YAML file cannot contain tabs as indentation.",this.getRealCurrentLineNb()+1,this.currentLine)}N=D=false;if(Q=this.PATTERN_SEQUENCE_ITEM.exec(this.currentLine)){if(this.CONTEXT_MAPPING===c){throw new r("You cannot define a sequence item when in a mapping")}c=this.CONTEXT_SEQUENCE;if(h==null){h=[]}if(Q.value!=null&&(b=this.PATTERN_ANCHOR_VALUE.exec(Q.value))){N=b.ref;Q.value=b.value}if(!(Q.value!=null)||""===a.trim(Q.value," ")||a.ltrim(Q.value," ").indexOf("#")===0){if(this.currentLineNb=l){n.push(this.currentLine.slice(l))}else if(a.ltrim(this.currentLine).charAt(0)==="#"){}else if(0===i){this.moveToPreviousLine();break}else{throw new r("Indentation problem.",this.getRealCurrentLineNb()+1,this.currentLine)}}return n.join("\n")};e.prototype.moveToNextLine=function(){if(this.currentLineNb>=this.lines.length-1){return false}this.currentLine=this.lines[++this.currentLineNb];return true};e.prototype.moveToPreviousLine=function(){this.currentLine=this.lines[--this.currentLineNb]};e.prototype.parseValue=function(e,t,n){var l,u,o,f,c,h,p,E,T;if(0===e.indexOf("*")){h=e.indexOf("#");if(h!==-1){e=e.substr(1,h-2)}else{e=e.slice(1)}if(this.refs[e]===void 0){throw new r('Reference "'+e+'" does not exist.',this.currentLine)}return this.refs[e]}if(f=this.PATTERN_FOLDED_SCALAR_ALL.exec(e)){c=(p=f.modifiers)!=null?p:"";o=Math.abs(parseInt(c));if(isNaN(o)){o=0}T=this.parseFoldedScalar(f.separator,this.PATTERN_DECIMAL.replace(c,""),o);if(f.type!=null){i.configure(t,n);return i.parseScalar(f.type+" "+T)}else{return T}}if((E=e.charAt(0))==="["||E==="{"||E==='"'||E==="'"){while(true){try{return i.parse(e,t,n)}catch(u){l=u;if(l instanceof s&&this.moveToNextLine()){e+="\n"+a.trim(this.currentLine," ")}else{l.parsedLine=this.getRealCurrentLineNb()+1;l.snippet=this.currentLine;throw l}}}}else{if(this.isNextLineIndented()){e+="\n"+this.getNextEmbedBlock()}return i.parse(e,t,n)}};e.prototype.parseFoldedScalar=function(t,n,i){var r,s,l,o,f,c,h,p,E,T;if(n==null){n=""}if(i==null){i=0}h=this.moveToNextLine();if(!h){return""}r=this.isCurrentLineBlank();T="";while(h&&r){if(h=this.moveToNextLine()){T+="\n";r=this.isCurrentLineBlank()}}if(0===i){if(f=this.PATTERN_INDENT_SPACES.exec(this.currentLine)){i=f[0].length}}if(i>0){p=this.PATTERN_FOLDED_SCALAR_BY_INDENTATION[i];if(p==null){p=new u("^ {"+i+"}(.*)$");e.prototype.PATTERN_FOLDED_SCALAR_BY_INDENTATION[i]=p}while(h&&(r||(f=p.exec(this.currentLine)))){if(r){T+=this.currentLine.slice(i)}else{T+=f[1]}if(h=this.moveToNextLine()){T+="\n";r=this.isCurrentLineBlank()}}}else if(h){T+="\n"}if(h){this.moveToPreviousLine()}if(">"===t){c="";E=T.split("\n");for(s=0,l=E.length;sn){i=true}this.moveToPreviousLine();return i};e.prototype.isCurrentLineEmpty=function(){var e;e=a.trim(this.currentLine," ");return e.length===0||e.charAt(0)==="#"};e.prototype.isCurrentLineBlank=function(){return""===a.trim(this.currentLine," ")};e.prototype.isCurrentLineComment=function(){var e;e=a.ltrim(this.currentLine," ");return e.charAt(0)==="#"};e.prototype.cleanup=function(e){var t,n,i,r,s,l,u,o,f,c,h,p,E,T;if(e.indexOf("\r")!==-1){e=e.split("\r\n").join("\n").split("\r").join("\n")}t=0;c=this.PATTERN_YAML_HEADER.replaceAll(e,""),e=c[0],t=c[1];this.offset+=t;h=this.PATTERN_LEADING_COMMENTS.replaceAll(e,"",1),T=h[0],t=h[1];if(t===1){this.offset+=a.subStrCount(e,"\n")-a.subStrCount(T,"\n");e=T}p=this.PATTERN_DOCUMENT_MARKER_START.replaceAll(e,"",1),T=p[0],t=p[1];if(t===1){this.offset+=a.subStrCount(e,"\n")-a.subStrCount(T,"\n");e=T;e=this.PATTERN_DOCUMENT_MARKER_END.replace(e,"")}f=e.split("\n");E=-1;for(r=0,l=f.length;r0){for(n=s=0,u=f.length;s"){r+="(";s++;if(a.length>0){if(u==null){u={}}u[a]=i}break}else{a+=f}s++}}else{r+=n;i++}}else{r+=n}}else{r+=n}s++}this.rawRegex=e;this.cleanedRegex=r;this.regex=new RegExp(this.cleanedRegex,"g"+t.replace("g",""));this.mapping=u}e.prototype.exec=function(e){var t,n,i,r;this.regex.lastIndex=0;n=this.regex.exec(e);if(n==null){return null}if(this.mapping!=null){r=this.mapping;for(i in r){t=r[i];n[i]=n[t]}}return n};e.prototype.test=function(e){this.regex.lastIndex=0;return this.regex.test(e)};e.prototype.replace=function(e,t){this.regex.lastIndex=0;return e.replace(this.regex,t)};e.prototype.replaceAll=function(e,t,n){var i;if(n==null){n=0}this.regex.lastIndex=0;i=0;while(this.regex.test(e)&&(n===0||i[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");t.LOCAL_TIMEZONE_OFFSET=(new Date).getTimezoneOffset()*60*1e3;t.trim=function(e,t){var n,i;if(t==null){t="\\s"}n=this.REGEX_LEFT_TRIM_BY_CHAR[t];if(n==null){this.REGEX_LEFT_TRIM_BY_CHAR[t]=n=new RegExp("^"+t+""+t+"*")}n.lastIndex=0;i=this.REGEX_RIGHT_TRIM_BY_CHAR[t];if(i==null){this.REGEX_RIGHT_TRIM_BY_CHAR[t]=i=new RegExp(t+""+t+"*$")}i.lastIndex=0;return e.replace(n,"").replace(i,"")};t.ltrim=function(e,t){var n;if(t==null){t="\\s"}n=this.REGEX_LEFT_TRIM_BY_CHAR[t];if(n==null){this.REGEX_LEFT_TRIM_BY_CHAR[t]=n=new RegExp("^"+t+""+t+"*")}n.lastIndex=0;return e.replace(n,"")};t.rtrim=function(e,t){var n;if(t==null){t="\\s"}n=this.REGEX_RIGHT_TRIM_BY_CHAR[t];if(n==null){this.REGEX_RIGHT_TRIM_BY_CHAR[t]=n=new RegExp(t+""+t+"*$")}n.lastIndex=0;return e.replace(n,"")};t.isEmpty=function(e){return!e||e===""||e==="0"||e instanceof Array&&e.length===0||this.isEmptyObject(e)};t.isEmptyObject=function(e){var t;return e instanceof Object&&function(){var n;n=[];for(t in e){if(!s.call(e,t))continue;n.push(t)}return n}().length===0};t.subStrCount=function(e,t,n,i){var r,s,l,u,a,o;r=0;e=""+e;t=""+t;if(n!=null){e=e.slice(n)}if(i!=null){e=e.slice(0,i)}u=e.length;o=t.length;for(s=l=0,a=u;0<=a?la;s=0<=a?++l:--l){if(t===e.slice(s,o)){r++;s+=o-1}}return r};t.isDigits=function(e){this.REGEX_DIGITS.lastIndex=0;return this.REGEX_DIGITS.test(e)};t.octDec=function(e){this.REGEX_OCTAL.lastIndex=0;return parseInt((e+"").replace(this.REGEX_OCTAL,""),8)};t.hexDec=function(e){this.REGEX_HEXADECIMAL.lastIndex=0;e=this.trim(e);if((e+"").slice(0,2)==="0x"){e=(e+"").slice(2)}return parseInt((e+"").replace(this.REGEX_HEXADECIMAL,""),16)};t.utf8chr=function(e){var t;t=String.fromCharCode;if(128>(e%=2097152)){return t(e)}if(2048>e){return t(192|e>>6)+t(128|e&63)}if(65536>e){return t(224|e>>12)+t(128|e>>6&63)+t(128|e&63)}return t(240|e>>18)+t(128|e>>12&63)+t(128|e>>6&63)+t(128|e&63)};t.parseBoolean=function(e,t){var n;if(t==null){t=true}if(typeof e==="string"){n=e.toLowerCase();if(!t){if(n==="no"){return false}}if(n==="0"){return false}if(n==="false"){return false}if(n===""){return false}return true}return!!e};t.isNumeric=function(e){this.REGEX_SPACES.lastIndex=0;return typeof e==="number"||typeof e==="string"&&!isNaN(e)&&e.replace(this.REGEX_SPACES,"")!==""};t.stringToDate=function(e){var t,n,i,r,s,l,u,a,o,f,c,h;if(!(e!=null?e.length:void 0)){return null}s=this.PATTERN_DATE.exec(e);if(!s){return null}h=parseInt(s.year,10);u=parseInt(s.month,10)-1;n=parseInt(s.day,10);if(s.hour==null){t=new Date(Date.UTC(h,u,n));return t}r=parseInt(s.hour,10);l=parseInt(s.minute,10);a=parseInt(s.second,10);if(s.fraction!=null){i=s.fraction.slice(0,3);while(i.length<3){i+="0"}i=parseInt(i,10)}else{i=0}if(s.tz!=null){o=parseInt(s.tz_hour,10);if(s.tz_minute!=null){f=parseInt(s.tz_minute,10)}else{f=0}c=(o*60+f)*6e4;if("-"===s.tz_sign){c*=-1}}t=new Date(Date.UTC(h,u,n,r,l,a,i));if(c){t.setTime(t.getTime()-c)}return t};t.strRepeat=function(e,t){var n,i;i="";n=0;while(n