!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o0?subject>>>0:0;else if("string"===type)"base64"===encoding&&(subject=base64clean(subject)),length=Buffer.byteLength(subject,encoding);else{if("object"!==type||null===subject)throw new TypeError("must start with number, buffer, array or string");"Buffer"===subject.type&&isArray(subject.data)&&(subject=subject.data),length=+subject.length>0?Math.floor(+subject.length):0}if(this.length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength.toString(16)+" bytes");var buf;Buffer.TYPED_ARRAY_SUPPORT?buf=Buffer._augment(new Uint8Array(length)):(buf=this,buf.length=length,buf._isBuffer=!0);var i;if(Buffer.TYPED_ARRAY_SUPPORT&&"number"==typeof subject.byteLength)buf._set(subject);else if(isArrayish(subject))if(Buffer.isBuffer(subject))for(i=0;length>i;i++)buf[i]=subject.readUInt8(i);else for(i=0;length>i;i++)buf[i]=(subject[i]%256+256)%256;else if("string"===type)buf.write(subject,0,encoding);else if("number"===type&&!Buffer.TYPED_ARRAY_SUPPORT&&!noZero)for(i=0;length>i;i++)buf[i]=0;return buf}function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;length?(length=Number(length),length>remaining&&(length=remaining)):length=remaining;var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;length>i;i++){var byte=parseInt(string.substr(2*i,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string),buf,offset,length);return charsWritten}function base64Slice(buf,start,end){return base64.fromByteArray(0===start&&end===buf.length?buf:buf.slice(start,end))}function utf8Slice(buf,start,end){var res="",tmp="";end=Math.min(buf.length,end);for(var i=start;end>i;i++)buf[i]<=127?(res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]),tmp=""):tmp+="%"+buf[i].toString(16);return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;end>i;i++)ret+=String.fromCharCode(buf[i]);return ret}function binarySlice(buf,start,end){return asciiSlice(buf,start,end)}function hexSlice(buf,start,end){var len=buf.length;(!start||0>start)&&(start=0),(!end||0>end||end>len)&&(end=len);for(var out="",i=start;end>i;i++)out+=toHex(buf[i]);return out}function utf16leSlice(buf,start,end){for(var bytes=buf.slice(start,end),res="",i=0;ioffset)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||min>value)throw new TypeError("value is out of bounds");if(offset+ext>buf.length)throw new TypeError("index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){0>value&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);j>i;i++)buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){0>value&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);j>i;i++)buf[offset+i]=value>>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||min>value)throw new TypeError("value is out of bounds");if(offset+ext>buf.length)throw new TypeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){for(str=stringtrim(str).replace(INVALID_BASE64_RE,"");str.length%4!==0;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&"object"==typeof subject&&"number"==typeof subject.length}function toHex(n){return 16>n?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(str){for(var byteArray=[],i=0;i=b)byteArray.push(b);else{var start=i;b>=55296&&57343>=b&&i++;for(var h=encodeURIComponent(str.slice(start,i+1)).substr(1).split("%"),j=0;j>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(str)}function blitBuffer(src,dst,offset,length){for(var i=0;length>i&&!(i+offset>=dst.length||i>=src.length);i++)dst[i+offset]=src[i];return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}var base64=require("base64-js"),ieee754=require("ieee754"),isArray=require("is-array");exports.Buffer=Buffer,exports.SlowBuffer=Buffer,exports.INSPECT_MAX_BYTES=50,Buffer.poolSize=8192;var kMaxLength=1073741823;Buffer.TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0),arr=new Uint8Array(buf);return arr.foo=function(){return 42},42===arr.foo()&&"function"==typeof arr.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(e){return!1}}(),Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);len>i&&a[i]===b[i];i++);return i!==len&&(x=a[i],y=b[i]),y>x?-1:x>y?1:0},Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(list,totalLength){if(!isArray(list))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===list.length)return new Buffer(0);if(1===list.length)return list[0];var i;if(void 0===totalLength)for(totalLength=0,i=0;i>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret},Buffer.prototype.length=void 0,Buffer.prototype.parent=void 0,Buffer.prototype.toString=function(encoding,start,end){var loweredCase=!1;if(start>>>=0,end=void 0===end||1/0===end?this.length:end>>>0,encoding||(encoding="utf8"),0>start&&(start=0),end>this.length&&(end=this.length),start>=end)return"";for(;;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}},Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return 0===Buffer.compare(this,b)},Buffer.prototype.inspect=function(){var str="",max=exports.INSPECT_MAX_BYTES;return this.length>0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),""},Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)},Buffer.prototype.get=function(offset){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(offset)},Buffer.prototype.set=function(v,offset){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(v,offset)},Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset))isFinite(length)||(encoding=length,length=void 0);else{var swap=encoding;encoding=offset,offset=length,length=swap}offset=Number(offset)||0;var remaining=this.length-offset;length?(length=Number(length),length>remaining&&(length=remaining)):length=remaining,encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.slice=function(start,end){var len=this.length;if(start=~~start,end=void 0===end?len:~~end,0>start?(start+=len,0>start&&(start=0)):start>len&&(start=len),0>end?(end+=len,0>end&&(end=0)):end>len&&(end=len),start>end&&(end=start),Buffer.TYPED_ARRAY_SUPPORT)return Buffer._augment(this.subarray(start,end));for(var sliceLen=end-start,newBuf=new Buffer(sliceLen,void 0,!0),i=0;sliceLen>i;i++)newBuf[i]=this[i+start];return newBuf},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?-1*(255-this[offset]+1):this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),0>value&&(value=255+value+1),this[offset]=value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset>>>=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),0>value&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(start||(start=0),end||0===end||(end=this.length),target_start||(target_start=0),end!==start&&0!==target.length&&0!==source.length){if(start>end)throw new TypeError("sourceEnd < sourceStart");if(0>target_start||target_start>=target.length)throw new TypeError("targetStart out of bounds");if(0>start||start>=source.length)throw new TypeError("sourceStart out of bounds");if(0>end||end>source.length)throw new TypeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-target_startlen||!Buffer.TYPED_ARRAY_SUPPORT)for(var i=0;len>i;i++)target[i+target_start]=this[i+start];else target._set(this.subarray(start,start+len),target_start)}},Buffer.prototype.fill=function(value,start,end){if(value||(value=0),start||(start=0),end||(end=this.length),start>end)throw new TypeError("end < start");if(end!==start&&0!==this.length){if(0>start||start>=this.length)throw new TypeError("start out of bounds");if(0>end||end>this.length)throw new TypeError("end out of bounds");var i;if("number"==typeof value)for(i=start;end>i;i++)this[i]=value;else{var bytes=utf8ToBytes(value.toString()),len=bytes.length;for(i=start;end>i;i++)this[i]=bytes[i%len]}return this}},Buffer.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(Buffer.TYPED_ARRAY_SUPPORT)return new Buffer(this).buffer;for(var buf=new Uint8Array(this.length),i=0,len=buf.length;len>i;i+=1)buf[i]=this[i];return buf.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var BP=Buffer.prototype;Buffer._augment=function(arr){return arr._isBuffer=!0,arr._get=arr.get,arr._set=arr.set,arr.get=BP.get,arr.set=BP.set,arr.write=BP.write,arr.toString=BP.toString,arr.toLocaleString=BP.toString,arr.toJSON=BP.toJSON,arr.equals=BP.equals,arr.compare=BP.compare,arr.copy=BP.copy,arr.slice=BP.slice,arr.readUInt8=BP.readUInt8,arr.readUInt16LE=BP.readUInt16LE,arr.readUInt16BE=BP.readUInt16BE,arr.readUInt32LE=BP.readUInt32LE,arr.readUInt32BE=BP.readUInt32BE,arr.readInt8=BP.readInt8,arr.readInt16LE=BP.readInt16LE,arr.readInt16BE=BP.readInt16BE,arr.readInt32LE=BP.readInt32LE,arr.readInt32BE=BP.readInt32BE,arr.readFloatLE=BP.readFloatLE,arr.readFloatBE=BP.readFloatBE,arr.readDoubleLE=BP.readDoubleLE,arr.readDoubleBE=BP.readDoubleBE,arr.writeUInt8=BP.writeUInt8,arr.writeUInt16LE=BP.writeUInt16LE,arr.writeUInt16BE=BP.writeUInt16BE,arr.writeUInt32LE=BP.writeUInt32LE,arr.writeUInt32BE=BP.writeUInt32BE,arr.writeInt8=BP.writeInt8,arr.writeInt16LE=BP.writeInt16LE,arr.writeInt16BE=BP.writeInt16BE,arr.writeInt32LE=BP.writeInt32LE,arr.writeInt32BE=BP.writeInt32BE,arr.writeFloatLE=BP.writeFloatLE,arr.writeFloatBE=BP.writeFloatBE,arr.writeDoubleLE=BP.writeDoubleLE,arr.writeDoubleBE=BP.writeDoubleBE,arr.fill=BP.fill,arr.inspect=BP.inspect,arr.toArrayBuffer=BP.toArrayBuffer,arr};var INVALID_BASE64_RE=/[^+\/0-9A-z]/g},{"base64-js":2,ieee754:3,"is-array":4}],2:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(exports){"use strict";function decode(elt){var code=elt.charCodeAt(0);return code===PLUS?62:code===SLASH?63:NUMBER>code?-1:NUMBER+10>code?code-NUMBER+26+26:UPPER+26>code?code-UPPER:LOWER+26>code?code-LOWER+26:void 0}function b64ToByteArray(b64){function push(v){arr[L++]=v}var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0,arr=new Arr(3*b64.length/4-placeHolders),l=placeHolders>0?b64.length-4:b64.length;var L=0;for(i=0,j=0;l>i;i+=4,j+=3)tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3)),push((16711680&tmp)>>16),push((65280&tmp)>>8),push(255&tmp);return 2===placeHolders?(tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4,push(255&tmp)):1===placeHolders&&(tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2,push(tmp>>8&255),push(255&tmp)),arr}function uint8ToBase64(uint8){function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(63&num)}var i,temp,length,extraBytes=uint8.length%3,output="";for(i=0,length=uint8.length-extraBytes;length>i;i+=3)temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2],output+=tripletToBase64(temp);switch(extraBytes){case 1:temp=uint8[uint8.length-1],output+=encode(temp>>2),output+=encode(temp<<4&63),output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1],output+=encode(temp>>10),output+=encode(temp>>4&63),output+=encode(temp<<2&63),output+="="}return output}var Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,PLUS="+".charCodeAt(0),SLASH="/".charCodeAt(0),NUMBER="0".charCodeAt(0),LOWER="a".charCodeAt(0),UPPER="A".charCodeAt(0);exports.toByteArray=b64ToByteArray,exports.fromByteArray=uint8ToBase64}("undefined"==typeof exports?this.base64js={}:exports)},{}],3:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?0/0:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=0>value||0===value&&0>1/value?1:0;for(value=Math.abs(value),isNaN(value)||1/0===value?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},{}],4:[function(require,module){var isArray=Array.isArray,str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],5:[function(require,module){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;throw TypeError('Uncaught, unspecified "error" event.')}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:for(len=arguments.length,args=new Array(len-1),i=1;len>i;i++)args[i-1]=arguments[i];handler.apply(this,args)}else if(isObject(handler)){for(len=arguments.length,args=new Array(len-1),i=1;len>i;i++)args[i-1]=arguments[i];for(listeners=handler.slice(),len=listeners.length,i=0;len>i;i++)listeners[i].apply(this,args)}return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned){var m;m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace())}return this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-->0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.listenerCount=function(emitter,type){var ret;return ret=emitter._events&&emitter._events[type]?isFunction(emitter._events[type])?1:emitter._events[type].length:0}},{}],6:[function(require,module){module.exports="function"==typeof Object.create?function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:function(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},{}],7:[function(require,module){module.exports=Array.isArray||function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}},{}],8:[function(require,module){function noop(){}var process=module.exports={};process.nextTick=function(){var canSetImmediate="undefined"!=typeof window&&window.setImmediate,canMutationObserver="undefined"!=typeof window&&window.MutationObserver,canPost="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(canSetImmediate)return function(f){return window.setImmediate(f)};var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div"),observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0,queueList.forEach(function(fn){fn()})});return observer.observe(hiddenDiv,{attributes:!0}),function(fn){queue.length||hiddenDiv.setAttribute("yes","no"),queue.push(fn)}}return canPost?(window.addEventListener("message",function(ev){var source=ev.source;if((source===window||null===source)&&"process-tick"===ev.data&&(ev.stopPropagation(),queue.length>0)){var fn=queue.shift();fn()}},!0),function(fn){queue.push(fn),window.postMessage("process-tick","*")}):function(fn){setTimeout(fn,0)}}(),process.title="browser",process.browser=!0,process.env={},process.argv=[],process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(){throw new Error("process.chdir is not supported")}},{}],9:[function(require,module){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":10}],10:[function(require,module){(function(process){function Duplex(options){return this instanceof Duplex?(Readable.call(this,options),Writable.call(this,options),options&&options.readable===!1&&(this.readable=!1),options&&options.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,options&&options.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",onend)):new Duplex(options)}function onend(){this.allowHalfOpen||this._writableState.ended||process.nextTick(this.end.bind(this))}function forEach(xs,f){for(var i=0,l=xs.length;l>i;i++)f(xs[i],i)}module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable"),Writable=require("./_stream_writable");util.inherits(Duplex,Readable),forEach(objectKeys(Writable.prototype),function(method){Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])})}).call(this,require("_process"))},{"./_stream_readable":12,"./_stream_writable":14,_process:8,"core-util-is":15,inherits:6}],11:[function(require,module){function PassThrough(options){return this instanceof PassThrough?void Transform.call(this,options):new PassThrough(options)}module.exports=PassThrough;var Transform=require("./_stream_transform"),util=require("core-util-is");util.inherits=require("inherits"),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":13,"core-util-is":15,inherits:6}],12:[function(require,module){(function(process){function ReadableState(options){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||0===hwm?hwm:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!options.objectMode,this.defaultEncoding=options.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding) }function Readable(options){return this instanceof Readable?(this._readableState=new ReadableState(options,this),this.readable=!0,void Stream.call(this)):new Readable(options)}function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er)stream.emit("error",er);else if(null===chunk||void 0===chunk)state.reading=!1,state.ended||onEofChunk(stream,state);else if(state.objectMode||chunk&&chunk.length>0)if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else!state.decoder||addToFront||encoding||(chunk=state.decoder.write(chunk)),state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):(state.reading=!1,state.buffer.push(chunk)),state.needReadable&&emitReadable(stream),maybeReadMore(stream,state);else addToFront||(state.reading=!1);return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM)n=MAX_HWM;else{n--;for(var p=1;32>p;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){return 0===state.length&&state.ended?0:state.objectMode?0===n?0:1:null===n||isNaN(n)?state.flowing&&state.buffer.length?state.buffer[0].length:state.length:0>=n?0:(n>state.highWaterMark&&(state.highWaterMark=roundUpToNextPowerOf2(n)),n>state.length?state.ended?state.length:(state.needReadable=!0,0):n)}function chunkInvalid(state,chunk){var er=null;return Buffer.isBuffer(chunk)||"string"==typeof chunk||null===chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,state.length>0?emitReadable(stream):endReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(state.emittedReadable=!0,state.sync?process.nextTick(function(){emitReadable_(stream)}):emitReadable_(stream))}function emitReadable_(stream){stream.emit("readable")}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,process.nextTick(function(){maybeReadMore_(stream,state)}))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length0)return;return 0===state.pipesCount?(state.flowing=!1,void(EE.listenerCount(src,"data")>0&&emitDataEvents(src))):void(state.ranOut=!0)}function pipeOnReadable(){this._readableState.ranOut&&(this._readableState.ranOut=!1,flow(this))}function emitDataEvents(stream,startPaused){var state=stream._readableState;if(state.flowing)throw new Error("Cannot switch to old mode now.");var paused=startPaused||!1,readable=!1;stream.readable=!0,stream.pipe=Stream.prototype.pipe,stream.on=stream.addListener=Stream.prototype.on,stream.on("readable",function(){readable=!0;for(var c;!paused&&null!==(c=stream.read());)stream.emit("data",c);null===c&&(readable=!1,stream._readableState.needReadable=!0)}),stream.pause=function(){paused=!0,this.emit("pause")},stream.resume=function(){paused=!1,readable?process.nextTick(function(){stream.emit("readable")}):this.read(0),this.emit("resume")},stream.emit("readable")}function fromList(n,state){var ret,list=state.buffer,length=state.length,stringMode=!!state.decoder,objectMode=!!state.objectMode;if(0===list.length)return null;if(0===length)ret=null;else if(objectMode)ret=list.shift();else if(!n||n>=length)ret=stringMode?list.join(""):Buffer.concat(list,length),list.length=0;else if(ni&&n>c;i++){var buf=list[0],cpy=Math.min(n-c,buf.length);stringMode?ret+=buf.slice(0,cpy):buf.copy(ret,c,0,cpy),cpy0)throw new Error("endReadable called on non-empty stream");!state.endEmitted&&state.calledRead&&(state.ended=!0,process.nextTick(function(){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}))}function forEach(xs,f){for(var i=0,l=xs.length;l>i;i++)f(xs[i],i)}function indexOf(xs,x){for(var i=0,l=xs.length;l>i;i++)if(xs[i]===x)return i;return-1}module.exports=Readable;var isArray=require("isarray"),Buffer=require("buffer").Buffer;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;EE.listenerCount||(EE.listenerCount=function(emitter,type){return emitter.listeners(type).length});var Stream=require("stream"),util=require("core-util-is");util.inherits=require("inherits");var StringDecoder;util.inherits(Readable,Stream),Readable.prototype.push=function(chunk,encoding){var state=this._readableState;return"string"!=typeof chunk||state.objectMode||(encoding=encoding||state.defaultEncoding,encoding!==state.encoding&&(chunk=new Buffer(chunk,encoding),encoding="")),readableAddChunk(this,state,chunk,encoding,!1)},Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,"",!0)},Readable.prototype.setEncoding=function(enc){StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc};var MAX_HWM=8388608;Readable.prototype.read=function(n){var state=this._readableState;state.calledRead=!0;var ret,nOrig=n;if(("number"!=typeof n||n>0)&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return emitReadable(this),null;if(n=howMuchToRead(n,state),0===n&&state.ended)return ret=null,state.length>0&&state.decoder&&(ret=fromList(n,state),state.length-=ret.length),0===state.length&&endReadable(this),ret;var doRead=state.needReadable;return state.length-n<=state.highWaterMark&&(doRead=!0),(state.ended||state.reading)&&(doRead=!1),doRead&&(state.reading=!0,state.sync=!0,0===state.length&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1),doRead&&!state.reading&&(n=howMuchToRead(nOrig,state)),ret=n>0?fromList(n,state):null,null===ret&&(state.needReadable=!0,n=0),state.length-=n,0!==state.length||state.ended||(state.needReadable=!0),state.ended&&!state.endEmitted&&0===state.length&&endReadable(this),ret},Readable.prototype._read=function(){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable){readable===src&&cleanup()}function onend(){dest.end()}function cleanup(){dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",cleanup),(!dest._writableState||dest._writableState.needDrain)&&ondrain()}function onerror(er){unpipe(),dest.removeListener("error",onerror),0===EE.listenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){dest.removeListener("close",onclose),unpipe()}function unpipe(){src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1;var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:cleanup;state.endEmitted?process.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);return dest.on("drain",ondrain),dest._events&&dest._events.error?isArray(dest._events.error)?dest._events.error.unshift(onerror):dest._events.error=[onerror,dest._events.error]:dest.on("error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(this.on("readable",pipeOnReadable),state.flowing=!0,process.nextTick(function(){flow(src)})),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState;if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,this.removeListener("readable",pipeOnReadable),state.flowing=!1,dest&&dest.emit("unpipe",this),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,this.removeListener("readable",pipeOnReadable),state.flowing=!1;for(var i=0;len>i;i++)dests[i].emit("unpipe",this);return this}var i=indexOf(state.pipes,dest);return-1===i?this:(state.pipes.splice(i,1),state.pipesCount-=1,1===state.pipesCount&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this),this)},Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if("data"!==ev||this._readableState.flowing||emitDataEvents(this),"readable"===ev&&this.readable){var state=this._readableState;state.readableListening||(state.readableListening=!0,state.emittedReadable=!1,state.needReadable=!0,state.reading?state.length&&emitReadable(this,state):this.read(0))}return res},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){emitDataEvents(this),this.read(0),this.emit("resume")},Readable.prototype.pause=function(){emitDataEvents(this,!0),this.emit("pause")},Readable.prototype.wrap=function(stream){var state=this._readableState,paused=!1,self=this;stream.on("end",function(){if(state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&self.push(chunk)}self.push(null)}),stream.on("data",function(chunk){if(state.decoder&&(chunk=state.decoder.write(chunk)),(!state.objectMode||null!==chunk&&void 0!==chunk)&&(state.objectMode||chunk&&chunk.length)){var ret=self.push(chunk);ret||(paused=!0,stream.pause())}});for(var i in stream)"function"==typeof stream[i]&&"undefined"==typeof this[i]&&(this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i));var events=["error","close","destroy","pause","resume"];return forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev))}),self._read=function(){paused&&(paused=!1,stream.resume())},self},Readable._fromList=fromList}).call(this,require("_process"))},{_process:8,buffer:1,"core-util-is":15,events:5,inherits:6,isarray:7,stream:20,"string_decoder/":21}],13:[function(require,module){function TransformState(options,stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null,ts.writecb=null,null!==data&&void 0!==data&&stream.push(data),cb&&cb(er);var rs=stream._readableState;rs.reading=!1,(rs.needReadable||rs.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;if(buffer.copy(this.charBuffer,this.charReceived,0,available),this.charReceived+=available,this.charReceived=55296&&56319>=charCode)){if(this.charReceived=this.charLength=0,0===buffer.length)return charStr;break}this.charLength+=this.surrogateSize,charStr=""}this.detectIncompleteChar(buffer);var end=buffer.length;this.charLength&&(buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end),end-=this.charReceived),charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1,charCode=charStr.charCodeAt(end);if(charCode>=55296&&56319>=charCode){var size=this.surrogateSize;return this.charLength+=size,this.charReceived+=size,this.charBuffer.copy(this.charBuffer,size,0,size),buffer.copy(this.charBuffer,0,0,size),charStr.substring(0,end)}return charStr},StringDecoder.prototype.detectIncompleteChar=function(buffer){for(var i=buffer.length>=3?3:buffer.length;i>0;i--){var c=buffer[buffer.length-i];if(1==i&&c>>5==6){this.charLength=2;break}if(2>=i&&c>>4==14){this.charLength=3;break}if(3>=i&&c>>3==30){this.charLength=4;break}}this.charReceived=i},StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length&&(res=this.write(buffer)),this.charReceived){var cr=this.charReceived,buf=this.charBuffer,enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res}},{buffer:1}],22:[function(require,module,exports){(function(){var root=this,previousUnderscore=root._,ArrayProto=Array.prototype,ObjProto=Object.prototype,FuncProto=Function.prototype,push=ArrayProto.push,slice=ArrayProto.slice,concat=ArrayProto.concat,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeBind=FuncProto.bind,_=function(obj){return obj instanceof _?obj:this instanceof _?void(this._wrapped=obj):new _(obj)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=_),exports._=_):root._=_,_.VERSION="1.7.0";var createCallback=function(func,context,argCount){if(void 0===context)return func;switch(null==argCount?3:argCount){case 1:return function(value){return func.call(context,value)};case 2:return function(value,other){return func.call(context,value,other)};case 3:return function(value,index,collection){return func.call(context,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(context,accumulator,value,index,collection)}}return function(){return func.apply(context,arguments)}};_.iteratee=function(value,context,argCount){return null==value?_.identity:_.isFunction(value)?createCallback(value,context,argCount):_.isObject(value)?_.matches(value):_.property(value)},_.each=_.forEach=function(obj,iteratee,context){if(null==obj)return obj;iteratee=createCallback(iteratee,context);var i,length=obj.length;if(length===+length)for(i=0;length>i;i++)iteratee(obj[i],i,obj);else{var keys=_.keys(obj);for(i=0,length=keys.length;length>i;i++)iteratee(obj[keys[i]],keys[i],obj)}return obj},_.map=_.collect=function(obj,iteratee,context){if(null==obj)return[];iteratee=_.iteratee(iteratee,context);for(var currentKey,keys=obj.length!==+obj.length&&_.keys(obj),length=(keys||obj).length,results=Array(length),index=0;length>index;index++)currentKey=keys?keys[index]:index,results[index]=iteratee(obj[currentKey],currentKey,obj);return results};var reduceError="Reduce of empty array with no initial value";_.reduce=_.foldl=_.inject=function(obj,iteratee,memo,context){null==obj&&(obj=[]),iteratee=createCallback(iteratee,context,4);var currentKey,keys=obj.length!==+obj.length&&_.keys(obj),length=(keys||obj).length,index=0;if(arguments.length<3){if(!length)throw new TypeError(reduceError);memo=obj[keys?keys[index++]:index++]}for(;length>index;index++)currentKey=keys?keys[index]:index,memo=iteratee(memo,obj[currentKey],currentKey,obj);return memo},_.reduceRight=_.foldr=function(obj,iteratee,memo,context){null==obj&&(obj=[]),iteratee=createCallback(iteratee,context,4);var currentKey,keys=obj.length!==+obj.length&&_.keys(obj),index=(keys||obj).length;if(arguments.length<3){if(!index)throw new TypeError(reduceError);memo=obj[keys?keys[--index]:--index]}for(;index--;)currentKey=keys?keys[index]:index,memo=iteratee(memo,obj[currentKey],currentKey,obj);return memo},_.find=_.detect=function(obj,predicate,context){var result;return predicate=_.iteratee(predicate,context),_.some(obj,function(value,index,list){return predicate(value,index,list)?(result=value,!0):void 0}),result},_.filter=_.select=function(obj,predicate,context){var results=[];return null==obj?results:(predicate=_.iteratee(predicate,context),_.each(obj,function(value,index,list){predicate(value,index,list)&&results.push(value)}),results)},_.reject=function(obj,predicate,context){return _.filter(obj,_.negate(_.iteratee(predicate)),context)},_.every=_.all=function(obj,predicate,context){if(null==obj)return!0;predicate=_.iteratee(predicate,context);var index,currentKey,keys=obj.length!==+obj.length&&_.keys(obj),length=(keys||obj).length;for(index=0;length>index;index++)if(currentKey=keys?keys[index]:index,!predicate(obj[currentKey],currentKey,obj))return!1;return!0},_.some=_.any=function(obj,predicate,context){if(null==obj)return!1;predicate=_.iteratee(predicate,context);var index,currentKey,keys=obj.length!==+obj.length&&_.keys(obj),length=(keys||obj).length;for(index=0;length>index;index++)if(currentKey=keys?keys[index]:index,predicate(obj[currentKey],currentKey,obj))return!0;return!1},_.contains=_.include=function(obj,target){return null==obj?!1:(obj.length!==+obj.length&&(obj=_.values(obj)),_.indexOf(obj,target)>=0)},_.invoke=function(obj,method){var args=slice.call(arguments,2),isFunc=_.isFunction(method);return _.map(obj,function(value){return(isFunc?method:value[method]).apply(value,args)})},_.pluck=function(obj,key){return _.map(obj,_.property(key))},_.where=function(obj,attrs){return _.filter(obj,_.matches(attrs))},_.findWhere=function(obj,attrs){return _.find(obj,_.matches(attrs))},_.max=function(obj,iteratee,context){var value,computed,result=-1/0,lastComputed=-1/0;if(null==iteratee&&null!=obj){obj=obj.length===+obj.length?obj:_.values(obj);for(var i=0,length=obj.length;length>i;i++)value=obj[i],value>result&&(result=value)}else iteratee=_.iteratee(iteratee,context),_.each(obj,function(value,index,list){computed=iteratee(value,index,list),(computed>lastComputed||computed===-1/0&&result===-1/0)&&(result=value,lastComputed=computed)});return result},_.min=function(obj,iteratee,context){var value,computed,result=1/0,lastComputed=1/0;if(null==iteratee&&null!=obj){obj=obj.length===+obj.length?obj:_.values(obj);for(var i=0,length=obj.length;length>i;i++)value=obj[i],result>value&&(result=value)}else iteratee=_.iteratee(iteratee,context),_.each(obj,function(value,index,list){computed=iteratee(value,index,list),(lastComputed>computed||1/0===computed&&1/0===result)&&(result=value,lastComputed=computed)});return result},_.shuffle=function(obj){for(var rand,set=obj&&obj.length===+obj.length?obj:_.values(obj),length=set.length,shuffled=Array(length),index=0;length>index;index++)rand=_.random(0,index),rand!==index&&(shuffled[index]=shuffled[rand]),shuffled[rand]=set[index];return shuffled},_.sample=function(obj,n,guard){return null==n||guard?(obj.length!==+obj.length&&(obj=_.values(obj)),obj[_.random(obj.length-1)]):_.shuffle(obj).slice(0,Math.max(0,n))},_.sortBy=function(obj,iteratee,context){return iteratee=_.iteratee(iteratee,context),_.pluck(_.map(obj,function(value,index,list){return{value:value,index:index,criteria:iteratee(value,index,list)}}).sort(function(left,right){var a=left.criteria,b=right.criteria; if(a!==b){if(a>b||void 0===a)return 1;if(b>a||void 0===b)return-1}return left.index-right.index}),"value")};var group=function(behavior){return function(obj,iteratee,context){var result={};return iteratee=_.iteratee(iteratee,context),_.each(obj,function(value,index){var key=iteratee(value,index,obj);behavior(result,value,key)}),result}};_.groupBy=group(function(result,value,key){_.has(result,key)?result[key].push(value):result[key]=[value]}),_.indexBy=group(function(result,value,key){result[key]=value}),_.countBy=group(function(result,value,key){_.has(result,key)?result[key]++:result[key]=1}),_.sortedIndex=function(array,obj,iteratee,context){iteratee=_.iteratee(iteratee,context,1);for(var value=iteratee(obj),low=0,high=array.length;high>low;){var mid=low+high>>>1;iteratee(array[mid])n?[]:slice.call(array,0,n)},_.initial=function(array,n,guard){return slice.call(array,0,Math.max(0,array.length-(null==n||guard?1:n)))},_.last=function(array,n,guard){return null==array?void 0:null==n||guard?array[array.length-1]:slice.call(array,Math.max(array.length-n,0))},_.rest=_.tail=_.drop=function(array,n,guard){return slice.call(array,null==n||guard?1:n)},_.compact=function(array){return _.filter(array,_.identity)};var flatten=function(input,shallow,strict,output){if(shallow&&_.every(input,_.isArray))return concat.apply(output,input);for(var i=0,length=input.length;length>i;i++){var value=input[i];_.isArray(value)||_.isArguments(value)?shallow?push.apply(output,value):flatten(value,shallow,strict,output):strict||output.push(value)}return output};_.flatten=function(array,shallow){return flatten(array,shallow,!1,[])},_.without=function(array){return _.difference(array,slice.call(arguments,1))},_.uniq=_.unique=function(array,isSorted,iteratee,context){if(null==array)return[];_.isBoolean(isSorted)||(context=iteratee,iteratee=isSorted,isSorted=!1),null!=iteratee&&(iteratee=_.iteratee(iteratee,context));for(var result=[],seen=[],i=0,length=array.length;length>i;i++){var value=array[i];if(isSorted)i&&seen===value||result.push(value),seen=value;else if(iteratee){var computed=iteratee(value,i,array);_.indexOf(seen,computed)<0&&(seen.push(computed),result.push(value))}else _.indexOf(result,value)<0&&result.push(value)}return result},_.union=function(){return _.uniq(flatten(arguments,!0,!0,[]))},_.intersection=function(array){if(null==array)return[];for(var result=[],argsLength=arguments.length,i=0,length=array.length;length>i;i++){var item=array[i];if(!_.contains(result,item)){for(var j=1;argsLength>j&&_.contains(arguments[j],item);j++);j===argsLength&&result.push(item)}}return result},_.difference=function(array){var rest=flatten(slice.call(arguments,1),!0,!0,[]);return _.filter(array,function(value){return!_.contains(rest,value)})},_.zip=function(array){if(null==array)return[];for(var length=_.max(arguments,"length").length,results=Array(length),i=0;length>i;i++)results[i]=_.pluck(arguments,i);return results},_.object=function(list,values){if(null==list)return{};for(var result={},i=0,length=list.length;length>i;i++)values?result[list[i]]=values[i]:result[list[i][0]]=list[i][1];return result},_.indexOf=function(array,item,isSorted){if(null==array)return-1;var i=0,length=array.length;if(isSorted){if("number"!=typeof isSorted)return i=_.sortedIndex(array,item),array[i]===item?i:-1;i=0>isSorted?Math.max(0,length+isSorted):isSorted}for(;length>i;i++)if(array[i]===item)return i;return-1},_.lastIndexOf=function(array,item,from){if(null==array)return-1;var idx=array.length;for("number"==typeof from&&(idx=0>from?idx+from+1:Math.min(idx,from+1));--idx>=0;)if(array[idx]===item)return idx;return-1},_.range=function(start,stop,step){arguments.length<=1&&(stop=start||0,start=0),step=step||1;for(var length=Math.max(Math.ceil((stop-start)/step),0),range=Array(length),idx=0;length>idx;idx++,start+=step)range[idx]=start;return range};var Ctor=function(){};_.bind=function(func,context){var args,bound;if(nativeBind&&func.bind===nativeBind)return nativeBind.apply(func,slice.call(arguments,1));if(!_.isFunction(func))throw new TypeError("Bind must be called on a function");return args=slice.call(arguments,2),bound=function(){if(!(this instanceof bound))return func.apply(context,args.concat(slice.call(arguments)));Ctor.prototype=func.prototype;var self=new Ctor;Ctor.prototype=null;var result=func.apply(self,args.concat(slice.call(arguments)));return _.isObject(result)?result:self}},_.partial=function(func){var boundArgs=slice.call(arguments,1);return function(){for(var position=0,args=boundArgs.slice(),i=0,length=args.length;length>i;i++)args[i]===_&&(args[i]=arguments[position++]);for(;position=length)throw new Error("bindAll must be passed function names");for(i=1;length>i;i++)key=arguments[i],obj[key]=_.bind(obj[key],obj);return obj},_.memoize=function(func,hasher){var memoize=function(key){var cache=memoize.cache,address=hasher?hasher.apply(this,arguments):key;return _.has(cache,address)||(cache[address]=func.apply(this,arguments)),cache[address]};return memoize.cache={},memoize},_.delay=function(func,wait){var args=slice.call(arguments,2);return setTimeout(function(){return func.apply(null,args)},wait)},_.defer=function(func){return _.delay.apply(_,[func,1].concat(slice.call(arguments,1)))},_.throttle=function(func,wait,options){var context,args,result,timeout=null,previous=0;options||(options={});var later=function(){previous=options.leading===!1?0:_.now(),timeout=null,result=func.apply(context,args),timeout||(context=args=null)};return function(){var now=_.now();previous||options.leading!==!1||(previous=now);var remaining=wait-(now-previous);return context=this,args=arguments,0>=remaining||remaining>wait?(clearTimeout(timeout),timeout=null,previous=now,result=func.apply(context,args),timeout||(context=args=null)):timeout||options.trailing===!1||(timeout=setTimeout(later,remaining)),result}},_.debounce=function(func,wait,immediate){var timeout,args,context,timestamp,result,later=function(){var last=_.now()-timestamp;wait>last&&last>0?timeout=setTimeout(later,wait-last):(timeout=null,immediate||(result=func.apply(context,args),timeout||(context=args=null)))};return function(){context=this,args=arguments,timestamp=_.now();var callNow=immediate&&!timeout;return timeout||(timeout=setTimeout(later,wait)),callNow&&(result=func.apply(context,args),context=args=null),result}},_.wrap=function(func,wrapper){return _.partial(wrapper,func)},_.negate=function(predicate){return function(){return!predicate.apply(this,arguments)}},_.compose=function(){var args=arguments,start=args.length-1;return function(){for(var i=start,result=args[start].apply(this,arguments);i--;)result=args[i].call(this,result);return result}},_.after=function(times,func){return function(){return--times<1?func.apply(this,arguments):void 0}},_.before=function(times,func){var memo;return function(){return--times>0?memo=func.apply(this,arguments):func=null,memo}},_.once=_.partial(_.before,2),_.keys=function(obj){if(!_.isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);var keys=[];for(var key in obj)_.has(obj,key)&&keys.push(key);return keys},_.values=function(obj){for(var keys=_.keys(obj),length=keys.length,values=Array(length),i=0;length>i;i++)values[i]=obj[keys[i]];return values},_.pairs=function(obj){for(var keys=_.keys(obj),length=keys.length,pairs=Array(length),i=0;length>i;i++)pairs[i]=[keys[i],obj[keys[i]]];return pairs},_.invert=function(obj){for(var result={},keys=_.keys(obj),i=0,length=keys.length;length>i;i++)result[obj[keys[i]]]=keys[i];return result},_.functions=_.methods=function(obj){var names=[];for(var key in obj)_.isFunction(obj[key])&&names.push(key);return names.sort()},_.extend=function(obj){if(!_.isObject(obj))return obj;for(var source,prop,i=1,length=arguments.length;length>i;i++){source=arguments[i];for(prop in source)hasOwnProperty.call(source,prop)&&(obj[prop]=source[prop])}return obj},_.pick=function(obj,iteratee,context){var key,result={};if(null==obj)return result;if(_.isFunction(iteratee)){iteratee=createCallback(iteratee,context);for(key in obj){var value=obj[key];iteratee(value,key,obj)&&(result[key]=value)}}else{var keys=concat.apply([],slice.call(arguments,1));obj=new Object(obj);for(var i=0,length=keys.length;length>i;i++)key=keys[i],key in obj&&(result[key]=obj[key])}return result},_.omit=function(obj,iteratee,context){if(_.isFunction(iteratee))iteratee=_.negate(iteratee);else{var keys=_.map(concat.apply([],slice.call(arguments,1)),String);iteratee=function(value,key){return!_.contains(keys,key)}}return _.pick(obj,iteratee,context)},_.defaults=function(obj){if(!_.isObject(obj))return obj;for(var i=1,length=arguments.length;length>i;i++){var source=arguments[i];for(var prop in source)void 0===obj[prop]&&(obj[prop]=source[prop])}return obj},_.clone=function(obj){return _.isObject(obj)?_.isArray(obj)?obj.slice():_.extend({},obj):obj},_.tap=function(obj,interceptor){return interceptor(obj),obj};var eq=function(a,b,aStack,bStack){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof _&&(a=a._wrapped),b instanceof _&&(b=b._wrapped);var className=toString.call(a);if(className!==toString.call(b))return!1;switch(className){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}if("object"!=typeof a||"object"!=typeof b)return!1;for(var length=aStack.length;length--;)if(aStack[length]===a)return bStack[length]===b;var aCtor=a.constructor,bCtor=b.constructor;if(aCtor!==bCtor&&"constructor"in a&&"constructor"in b&&!(_.isFunction(aCtor)&&aCtor instanceof aCtor&&_.isFunction(bCtor)&&bCtor instanceof bCtor))return!1;aStack.push(a),bStack.push(b);var size,result;if("[object Array]"===className){if(size=a.length,result=size===b.length)for(;size--&&(result=eq(a[size],b[size],aStack,bStack)););}else{var key,keys=_.keys(a);if(size=keys.length,result=_.keys(b).length===size)for(;size--&&(key=keys[size],result=_.has(b,key)&&eq(a[key],b[key],aStack,bStack)););}return aStack.pop(),bStack.pop(),result};_.isEqual=function(a,b){return eq(a,b,[],[])},_.isEmpty=function(obj){if(null==obj)return!0;if(_.isArray(obj)||_.isString(obj)||_.isArguments(obj))return 0===obj.length;for(var key in obj)if(_.has(obj,key))return!1;return!0},_.isElement=function(obj){return!(!obj||1!==obj.nodeType)},_.isArray=nativeIsArray||function(obj){return"[object Array]"===toString.call(obj)},_.isObject=function(obj){var type=typeof obj;return"function"===type||"object"===type&&!!obj},_.each(["Arguments","Function","String","Number","Date","RegExp"],function(name){_["is"+name]=function(obj){return toString.call(obj)==="[object "+name+"]"}}),_.isArguments(arguments)||(_.isArguments=function(obj){return _.has(obj,"callee")}),"function"!=typeof/./&&(_.isFunction=function(obj){return"function"==typeof obj||!1}),_.isFinite=function(obj){return isFinite(obj)&&!isNaN(parseFloat(obj))},_.isNaN=function(obj){return _.isNumber(obj)&&obj!==+obj},_.isBoolean=function(obj){return obj===!0||obj===!1||"[object Boolean]"===toString.call(obj)},_.isNull=function(obj){return null===obj},_.isUndefined=function(obj){return void 0===obj},_.has=function(obj,key){return null!=obj&&hasOwnProperty.call(obj,key)},_.noConflict=function(){return root._=previousUnderscore,this},_.identity=function(value){return value},_.constant=function(value){return function(){return value}},_.noop=function(){},_.property=function(key){return function(obj){return obj[key]}},_.matches=function(attrs){var pairs=_.pairs(attrs),length=pairs.length;return function(obj){if(null==obj)return!length;obj=new Object(obj);for(var i=0;length>i;i++){var pair=pairs[i],key=pair[0];if(pair[1]!==obj[key]||!(key in obj))return!1}return!0}},_.times=function(n,iteratee,context){var accum=Array(Math.max(0,n));iteratee=createCallback(iteratee,context,1);for(var i=0;n>i;i++)accum[i]=iteratee(i);return accum},_.random=function(min,max){return null==max&&(max=min,min=0),min+Math.floor(Math.random()*(max-min+1))},_.now=Date.now||function(){return(new Date).getTime()};var escapeMap={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},unescapeMap=_.invert(escapeMap),createEscaper=function(map){var escaper=function(match){return map[match]},source="(?:"+_.keys(map).join("|")+")",testRegexp=RegExp(source),replaceRegexp=RegExp(source,"g");return function(string){return string=null==string?"":""+string,testRegexp.test(string)?string.replace(replaceRegexp,escaper):string}};_.escape=createEscaper(escapeMap),_.unescape=createEscaper(unescapeMap),_.result=function(object,property){if(null==object)return void 0;var value=object[property];return _.isFunction(value)?object[property]():value};var idCounter=0;_.uniqueId=function(prefix){var id=++idCounter+"";return prefix?prefix+id:id},_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escaper=/\\|'|\r|\n|\u2028|\u2029/g,escapeChar=function(match){return"\\"+escapes[match]};_.template=function(text,settings,oldSettings){!settings&&oldSettings&&(settings=oldSettings),settings=_.defaults({},settings,_.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g"),index=0,source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){return source+=text.slice(index,offset).replace(escaper,escapeChar),index=offset+match.length,escape?source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'":interpolate?source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'":evaluate&&(source+="';\n"+evaluate+"\n__p+='"),match}),source+="';\n",settings.variable||(source="with(obj||{}){\n"+source+"}\n"),source="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+source+"return __p;\n";try{var render=new Function(settings.variable||"obj","_",source)}catch(e){throw e.source=source,e}var template=function(data){return render.call(this,data,_)},argument=settings.variable||"obj";return template.source="function("+argument+"){\n"+source+"}",template},_.chain=function(obj){var instance=_(obj);return instance._chain=!0,instance};var result=function(obj){return this._chain?_(obj).chain():obj};_.mixin=function(obj){_.each(_.functions(obj),function(name){var func=_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];return push.apply(args,arguments),result.call(this,func.apply(_,args))}})},_.mixin(_),_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;return method.apply(obj,arguments),"shift"!==name&&"splice"!==name||0!==obj.length||delete obj[0],result.call(this,obj)}}),_.each(["concat","join","slice"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){return result.call(this,method.apply(this._wrapped,arguments))}}),_.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return _})}).call(this)},{}],23:[function(require,module,exports){(function(){var xml2js;xml2js=require("../lib/xml2js"),exports.stripBOM=function(str){return""===str[0]?str.substring(1):str}}).call(this)},{"../lib/xml2js":25}],24:[function(require,module,exports){(function(){var prefixMatch;prefixMatch=new RegExp(/(?!xmlns)^.*:/),exports.normalize=function(str){return str.toLowerCase()},exports.firstCharLowerCase=function(str){return str.charAt(0).toLowerCase()+str.slice(1)},exports.stripPrefix=function(str){return str.replace(prefixMatch,"")}}).call(this)},{}],25:[function(require,module,exports){(function(process){(function(){var bom,builder,events,isEmpty,processName,processors,sax,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child},__bind=function(fn,me){return function(){return fn.apply(me,arguments)}};sax=require("sax"),events=require("events"),builder=require("xmlbuilder"),bom=require("./bom"),processors=require("./processors"),isEmpty=function(thing){return"object"==typeof thing&&null!=thing&&0===Object.keys(thing).length},processName=function(processors,processedName){var process,_i,_len;for(_i=0,_len=processors.length;_len>_i;_i++)process=processors[_i],processedName=process(processedName);return processedName},exports.processors=processors,exports.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,async:!1,strict:!0,attrNameProcessors:null,tagNameProcessors:null},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,childkey:"$$",charsAsChildren:!1,async:!1,strict:!0,attrNameProcessors:null,tagNameProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1}},exports.ValidationError=function(_super){function ValidationError(message){this.message=message}return __extends(ValidationError,_super),ValidationError}(Error),exports.Builder=function(){function Builder(opts){var key,value,_ref;this.options={},_ref=exports.defaults[.2];for(key in _ref)__hasProp.call(_ref,key)&&(value=_ref[key],this.options[key]=value);for(key in opts)__hasProp.call(opts,key)&&(value=opts[key],this.options[key]=value)}return Builder.prototype.buildObject=function(rootObj){var attrkey,charkey,render,rootElement,rootName;return attrkey=this.options.attrkey,charkey=this.options.charkey,1===Object.keys(rootObj).length&&this.options.rootName===exports.defaults[.2].rootName?(rootName=Object.keys(rootObj)[0],rootObj=rootObj[rootName]):rootName=this.options.rootName,render=function(element,obj){var attr,child,entry,index,key,value,_ref,_ref1;if("object"!=typeof obj)element.txt(obj);else for(key in obj)if(__hasProp.call(obj,key))if(child=obj[key],key===attrkey){if("object"==typeof child)for(attr in child)value=child[attr],element=element.att(attr,value)}else if(key===charkey)element=element.txt(child);else if("object"==typeof child&&null!=(null!=child?child.constructor:void 0)&&null!=(null!=child&&null!=(_ref=child.constructor)?_ref.name:void 0)&&"Array"===(null!=child&&null!=(_ref1=child.constructor)?_ref1.name:void 0))for(index in child)__hasProp.call(child,index)&&(entry=child[index],element="string"==typeof entry?element.ele(key,entry).up():arguments.callee(element.ele(key),entry).up());else element="object"==typeof child?arguments.callee(element.ele(key),child).up():element.ele(key,child.toString()).up();return element},rootElement=builder.create(rootName,this.options.xmldec,this.options.doctype,{headless:this.options.headless}),render(rootElement,rootObj).end(this.options.renderOpts)},Builder}(),exports.Parser=function(_super){function Parser(opts){this.parseString=__bind(this.parseString,this),this.reset=__bind(this.reset,this),this.assignOrPush=__bind(this.assignOrPush,this);var key,value,_ref;if(!(this instanceof exports.Parser))return new exports.Parser(opts);this.options={},_ref=exports.defaults[.2];for(key in _ref)__hasProp.call(_ref,key)&&(value=_ref[key],this.options[key]=value);for(key in opts)__hasProp.call(opts,key)&&(value=opts[key],this.options[key]=value);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(processors.normalize)),this.reset()}return __extends(Parser,_super),Parser.prototype.assignOrPush=function(obj,key,newValue){return key in obj?(obj[key]instanceof Array||(obj[key]=[obj[key]]),obj[key].push(newValue)):obj[key]=this.options.explicitArray?[newValue]:newValue},Parser.prototype.reset=function(){var attrkey,charkey,ontext,stack;return this.removeAllListeners(),this.saxParser=sax.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(_this){return function(error){return _this.saxParser.resume(),_this.saxParser.errThrown?void 0:(_this.saxParser.errThrown=!0,_this.emit("error",error))}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,stack=[],attrkey=this.options.attrkey,charkey=this.options.charkey,this.saxParser.onopentag=function(_this){return function(node){var key,newValue,obj,processedKey,_ref;if(obj={},obj[charkey]="",!_this.options.ignoreAttrs){_ref=node.attributes;for(key in _ref)__hasProp.call(_ref,key)&&(attrkey in obj||_this.options.mergeAttrs||(obj[attrkey]={}),newValue=node.attributes[key],processedKey=_this.options.attrNameProcessors?processName(_this.options.attrNameProcessors,key):key,_this.options.mergeAttrs?_this.assignOrPush(obj,processedKey,newValue):obj[attrkey][processedKey]=newValue)}return obj["#name"]=_this.options.tagNameProcessors?processName(_this.options.tagNameProcessors,node.name):node.name,_this.options.xmlns&&(obj[_this.options.xmlnskey]={uri:node.uri,local:node.local}),stack.push(obj)}}(this),this.saxParser.onclosetag=function(_this){return function(){var cdata,emptyStr,err,node,nodeName,obj,old,s,xpath;if(obj=stack.pop(),nodeName=obj["#name"],delete obj["#name"],cdata=obj.cdata,delete obj.cdata,s=stack[stack.length-1],obj[charkey].match(/^\s*$/)&&!cdata?(emptyStr=obj[charkey],delete obj[charkey]):(_this.options.trim&&(obj[charkey]=obj[charkey].trim()),_this.options.normalize&&(obj[charkey]=obj[charkey].replace(/\s{2,}/g," ").trim()),1===Object.keys(obj).length&&charkey in obj&&!_this.EXPLICIT_CHARKEY&&(obj=obj[charkey])),isEmpty(obj)&&(obj=void 0!==_this.options.emptyTag?_this.options.emptyTag:emptyStr),null!=_this.options.validator){xpath="/"+function(){var _i,_len,_results;for(_results=[],_i=0,_len=stack.length;_len>_i;_i++)node=stack[_i],_results.push(node["#name"]);return _results}().concat(nodeName).join("/");try{obj=_this.options.validator(xpath,s&&s[nodeName],obj)}catch(_error){err=_error,_this.emit("error",err)}}return _this.options.explicitChildren&&!_this.options.mergeAttrs&&"object"==typeof obj&&(node={},_this.options.attrkey in obj&&(node[_this.options.attrkey]=obj[_this.options.attrkey],delete obj[_this.options.attrkey]),!_this.options.charsAsChildren&&_this.options.charkey in obj&&(node[_this.options.charkey]=obj[_this.options.charkey],delete obj[_this.options.charkey]),Object.getOwnPropertyNames(obj).length>0&&(node[_this.options.childkey]=obj),obj=node),stack.length>0?_this.assignOrPush(s,nodeName,obj):(_this.options.explicitRoot&&(old=obj,obj={},obj[nodeName]=old),_this.resultObject=obj,_this.saxParser.ended=!0,_this.emit("end",_this.resultObject))}}(this),ontext=function(){return function(text){var s;return s=stack[stack.length-1],s?(s[charkey]+=text,s):void 0}}(this),this.saxParser.ontext=ontext,this.saxParser.oncdata=function(){return function(text){var s;return s=ontext(text),s?s.cdata=!0:void 0}}(this)},Parser.prototype.parseString=function(str,cb){var err;if(null!=cb&&"function"==typeof cb&&(this.on("end",function(result){return this.reset(),this.options.async?process.nextTick(function(){return cb(null,result)}):cb(null,result)}),this.on("error",function(err){return this.reset(),this.options.async?process.nextTick(function(){return cb(err)}):cb(err)})),""===str.toString().trim())return this.emit("end",null),!0;try{return this.saxParser.write(bom.stripBOM(str.toString())).close()}catch(_error){if(err=_error,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",err),this.saxParser.errThrown=!0}},Parser}(events.EventEmitter),exports.parseString=function(str,a,b){var cb,options,parser;return null!=b?("function"==typeof b&&(cb=b),"object"==typeof a&&(options=a)):("function"==typeof a&&(cb=a),options={}),parser=new exports.Parser(options),parser.parseString(str,cb)}}).call(this)}).call(this,require("_process"))},{"./bom":23,"./processors":24,_process:8,events:5,sax:26,xmlbuilder:43}],26:[function(require,module,exports){(function(Buffer){!function(sax){function SAXParser(strict,opt){if(!(this instanceof SAXParser))return new SAXParser(strict,opt);var parser=this;clearBuffers(parser),parser.q=parser.c="",parser.bufferCheckPosition=sax.MAX_BUFFER_LENGTH,parser.opt=opt||{},parser.opt.lowercase=parser.opt.lowercase||parser.opt.lowercasetags,parser.looseCase=parser.opt.lowercase?"toLowerCase":"toUpperCase",parser.tags=[],parser.closed=parser.closedRoot=parser.sawRoot=!1,parser.tag=parser.error=null,parser.strict=!!strict,parser.noscript=!(!strict&&!parser.opt.noscript),parser.state=S.BEGIN,parser.ENTITIES=Object.create(sax.ENTITIES),parser.attribList=[],parser.opt.xmlns&&(parser.ns=Object.create(rootNS)),parser.trackPosition=parser.opt.position!==!1,parser.trackPosition&&(parser.position=parser.line=parser.column=0),emit(parser,"onready")}function checkBufferLength(parser){for(var maxAllowed=Math.max(sax.MAX_BUFFER_LENGTH,10),maxActual=0,i=0,l=buffers.length;l>i;i++){var len=parser[buffers[i]].length;if(len>maxAllowed)switch(buffers[i]){case"textNode":closeText(parser);break;case"cdata":emitNode(parser,"oncdata",parser.cdata),parser.cdata="";break;case"script":emitNode(parser,"onscript",parser.script),parser.script="";break;default:error(parser,"Max buffer length exceeded: "+buffers[i])}maxActual=Math.max(maxActual,len)}parser.bufferCheckPosition=sax.MAX_BUFFER_LENGTH-maxActual+parser.position}function clearBuffers(parser){for(var i=0,l=buffers.length;l>i;i++)parser[buffers[i]]=""}function flushBuffers(parser){closeText(parser),""!==parser.cdata&&(emitNode(parser,"oncdata",parser.cdata),parser.cdata=""),""!==parser.script&&(emitNode(parser,"onscript",parser.script),parser.script="")}function createStream(strict,opt){return new SAXStream(strict,opt)}function SAXStream(strict,opt){if(!(this instanceof SAXStream))return new SAXStream(strict,opt);Stream.apply(this),this._parser=new SAXParser(strict,opt),this.writable=!0,this.readable=!0;var me=this;this._parser.onend=function(){me.emit("end")},this._parser.onerror=function(er){me.emit("error",er),me._parser.error=null},this._decoder=null,streamWraps.forEach(function(ev){Object.defineProperty(me,"on"+ev,{get:function(){return me._parser["on"+ev]},set:function(h){return h?void me.on(ev,h):(me.removeAllListeners(ev),me._parser["on"+ev]=h)},enumerable:!0,configurable:!1})})}function charClass(str){return str.split("").reduce(function(s,c){return s[c]=!0,s},{})}function isRegExp(c){return"[object RegExp]"===Object.prototype.toString.call(c)}function is(charclass,c){return isRegExp(charclass)?!!c.match(charclass):charclass[c]}function not(charclass,c){return!is(charclass,c)}function emit(parser,event,data){parser[event]&&parser[event](data)}function emitNode(parser,nodeType,data){parser.textNode&&closeText(parser),emit(parser,nodeType,data)}function closeText(parser){parser.textNode=textopts(parser.opt,parser.textNode),parser.textNode&&emit(parser,"ontext",parser.textNode),parser.textNode=""}function textopts(opt,text){return opt.trim&&(text=text.trim()),opt.normalize&&(text=text.replace(/\s+/g," ")),text}function error(parser,er){return closeText(parser),parser.trackPosition&&(er+="\nLine: "+parser.line+"\nColumn: "+parser.column+"\nChar: "+parser.c),er=new Error(er),parser.error=er,emit(parser,"onerror",er),parser}function end(parser){return parser.closedRoot||strictFail(parser,"Unclosed root tag"),parser.state!==S.BEGIN&&parser.state!==S.TEXT&&error(parser,"Unexpected end"),closeText(parser),parser.c="",parser.closed=!0,emit(parser,"onend"),SAXParser.call(parser,parser.strict,parser.opt),parser}function strictFail(parser,message){if("object"!=typeof parser||!(parser instanceof SAXParser))throw new Error("bad call to strictFail");parser.strict&&error(parser,message)}function newTag(parser){parser.strict||(parser.tagName=parser.tagName[parser.looseCase]());var parent=parser.tags[parser.tags.length-1]||parser,tag=parser.tag={name:parser.tagName,attributes:{}};parser.opt.xmlns&&(tag.ns=parent.ns),parser.attribList.length=0}function qname(name,attribute){var i=name.indexOf(":"),qualName=0>i?["",name]:name.split(":"),prefix=qualName[0],local=qualName[1];return attribute&&"xmlns"===name&&(prefix="xmlns",local=""),{prefix:prefix,local:local}}function attrib(parser){if(parser.strict||(parser.attribName=parser.attribName[parser.looseCase]()),-1!==parser.attribList.indexOf(parser.attribName)||parser.tag.attributes.hasOwnProperty(parser.attribName))return parser.attribName=parser.attribValue="";if(parser.opt.xmlns){var qn=qname(parser.attribName,!0),prefix=qn.prefix,local=qn.local;if("xmlns"===prefix)if("xml"===local&&parser.attribValue!==XML_NAMESPACE)strictFail(parser,"xml: prefix must be bound to "+XML_NAMESPACE+"\nActual: "+parser.attribValue);else if("xmlns"===local&&parser.attribValue!==XMLNS_NAMESPACE)strictFail(parser,"xmlns: prefix must be bound to "+XMLNS_NAMESPACE+"\nActual: "+parser.attribValue);else{var tag=parser.tag,parent=parser.tags[parser.tags.length-1]||parser;tag.ns===parent.ns&&(tag.ns=Object.create(parent.ns)),tag.ns[local]=parser.attribValue}parser.attribList.push([parser.attribName,parser.attribValue])}else parser.tag.attributes[parser.attribName]=parser.attribValue,emitNode(parser,"onattribute",{name:parser.attribName,value:parser.attribValue});parser.attribName=parser.attribValue=""}function openTag(parser,selfClosing){if(parser.opt.xmlns){var tag=parser.tag,qn=qname(parser.tagName);tag.prefix=qn.prefix,tag.local=qn.local,tag.uri=tag.ns[qn.prefix]||"",tag.prefix&&!tag.uri&&(strictFail(parser,"Unbound namespace prefix: "+JSON.stringify(parser.tagName)),tag.uri=qn.prefix);var parent=parser.tags[parser.tags.length-1]||parser;tag.ns&&parent.ns!==tag.ns&&Object.keys(tag.ns).forEach(function(p){emitNode(parser,"onopennamespace",{prefix:p,uri:tag.ns[p]})});for(var i=0,l=parser.attribList.length;l>i;i++){var nv=parser.attribList[i],name=nv[0],value=nv[1],qualName=qname(name,!0),prefix=qualName.prefix,local=qualName.local,uri=""==prefix?"":tag.ns[prefix]||"",a={name:name,value:value,prefix:prefix,local:local,uri:uri};prefix&&"xmlns"!=prefix&&!uri&&(strictFail(parser,"Unbound namespace prefix: "+JSON.stringify(prefix)),a.uri=prefix),parser.tag.attributes[name]=a,emitNode(parser,"onattribute",a)}parser.attribList.length=0}parser.tag.isSelfClosing=!!selfClosing,parser.sawRoot=!0,parser.tags.push(parser.tag),emitNode(parser,"onopentag",parser.tag),selfClosing||(parser.state=parser.noscript||"script"!==parser.tagName.toLowerCase()?S.TEXT:S.SCRIPT,parser.tag=null,parser.tagName=""),parser.attribName=parser.attribValue="",parser.attribList.length=0}function closeTag(parser){if(!parser.tagName)return strictFail(parser,"Weird empty close tag."),parser.textNode+="",void(parser.state=S.TEXT);if(parser.script){if("script"!==parser.tagName)return parser.script+="",parser.tagName="",void(parser.state=S.SCRIPT); emitNode(parser,"onscript",parser.script),parser.script=""}var t=parser.tags.length,tagName=parser.tagName;parser.strict||(tagName=tagName[parser.looseCase]());for(var closeTo=tagName;t--;){var close=parser.tags[t];if(close.name===closeTo)break;strictFail(parser,"Unexpected close tag")}if(0>t)return strictFail(parser,"Unmatched closing tag: "+parser.tagName),parser.textNode+="",void(parser.state=S.TEXT);parser.tagName=tagName;for(var s=parser.tags.length;s-->t;){var tag=parser.tag=parser.tags.pop();parser.tagName=parser.tag.name,emitNode(parser,"onclosetag",parser.tagName);var x={};for(var i in tag.ns)x[i]=tag.ns[i];var parent=parser.tags[parser.tags.length-1]||parser;parser.opt.xmlns&&tag.ns!==parent.ns&&Object.keys(tag.ns).forEach(function(p){var n=tag.ns[p];emitNode(parser,"onclosenamespace",{prefix:p,uri:n})})}0===t&&(parser.closedRoot=!0),parser.tagName=parser.attribValue=parser.attribName="",parser.attribList.length=0,parser.state=S.TEXT}function parseEntity(parser){var num,entity=parser.entity,entityLC=entity.toLowerCase(),numStr="";return parser.ENTITIES[entity]?parser.ENTITIES[entity]:parser.ENTITIES[entityLC]?parser.ENTITIES[entityLC]:(entity=entityLC,"#"===entity.charAt(0)&&("x"===entity.charAt(1)?(entity=entity.slice(2),num=parseInt(entity,16),numStr=num.toString(16)):(entity=entity.slice(1),num=parseInt(entity,10),numStr=num.toString(10))),entity=entity.replace(/^0+/,""),numStr.toLowerCase()!==entity?(strictFail(parser,"Invalid character entity"),"&"+parser.entity+";"):String.fromCodePoint(num))}function write(chunk){var parser=this;if(this.error)throw this.error;if(parser.closed)return error(parser,"Cannot write after close. Assign an onready handler.");if(null===chunk)return end(parser);for(var i=0,c="";parser.c=c=chunk.charAt(i++);)switch(parser.trackPosition&&(parser.position++,"\n"===c?(parser.line++,parser.column=0):parser.column++),parser.state){case S.BEGIN:"<"===c?(parser.state=S.OPEN_WAKA,parser.startTagPosition=parser.position):not(whitespace,c)&&(strictFail(parser,"Non-whitespace before first tag."),parser.textNode=c,parser.state=S.TEXT);continue;case S.TEXT:if(parser.sawRoot&&!parser.closedRoot){for(var starti=i-1;c&&"<"!==c&&"&"!==c;)c=chunk.charAt(i++),c&&parser.trackPosition&&(parser.position++,"\n"===c?(parser.line++,parser.column=0):parser.column++);parser.textNode+=chunk.substring(starti,i-1)}"<"===c?(parser.state=S.OPEN_WAKA,parser.startTagPosition=parser.position):(!not(whitespace,c)||parser.sawRoot&&!parser.closedRoot||strictFail(parser,"Text data outside of root node."),"&"===c?parser.state=S.TEXT_ENTITY:parser.textNode+=c);continue;case S.SCRIPT:"<"===c?parser.state=S.SCRIPT_ENDING:parser.script+=c;continue;case S.SCRIPT_ENDING:"/"===c?parser.state=S.CLOSE_TAG:(parser.script+="<"+c,parser.state=S.SCRIPT);continue;case S.OPEN_WAKA:if("!"===c)parser.state=S.SGML_DECL,parser.sgmlDecl="";else if(is(whitespace,c));else if(is(nameStart,c))parser.state=S.OPEN_TAG,parser.tagName=c;else if("/"===c)parser.state=S.CLOSE_TAG,parser.tagName="";else if("?"===c)parser.state=S.PROC_INST,parser.procInstName=parser.procInstBody="";else{if(strictFail(parser,"Unencoded <"),parser.startTagPosition+1"===c?(emitNode(parser,"onsgmldeclaration",parser.sgmlDecl),parser.sgmlDecl="",parser.state=S.TEXT):is(quote,c)?(parser.state=S.SGML_DECL_QUOTED,parser.sgmlDecl+=c):parser.sgmlDecl+=c;continue;case S.SGML_DECL_QUOTED:c===parser.q&&(parser.state=S.SGML_DECL,parser.q=""),parser.sgmlDecl+=c;continue;case S.DOCTYPE:">"===c?(parser.state=S.TEXT,emitNode(parser,"ondoctype",parser.doctype),parser.doctype=!0):(parser.doctype+=c,"["===c?parser.state=S.DOCTYPE_DTD:is(quote,c)&&(parser.state=S.DOCTYPE_QUOTED,parser.q=c));continue;case S.DOCTYPE_QUOTED:parser.doctype+=c,c===parser.q&&(parser.q="",parser.state=S.DOCTYPE);continue;case S.DOCTYPE_DTD:parser.doctype+=c,"]"===c?parser.state=S.DOCTYPE:is(quote,c)&&(parser.state=S.DOCTYPE_DTD_QUOTED,parser.q=c);continue;case S.DOCTYPE_DTD_QUOTED:parser.doctype+=c,c===parser.q&&(parser.state=S.DOCTYPE_DTD,parser.q="");continue;case S.COMMENT:"-"===c?parser.state=S.COMMENT_ENDING:parser.comment+=c;continue;case S.COMMENT_ENDING:"-"===c?(parser.state=S.COMMENT_ENDED,parser.comment=textopts(parser.opt,parser.comment),parser.comment&&emitNode(parser,"oncomment",parser.comment),parser.comment=""):(parser.comment+="-"+c,parser.state=S.COMMENT);continue;case S.COMMENT_ENDED:">"!==c?(strictFail(parser,"Malformed comment"),parser.comment+="--"+c,parser.state=S.COMMENT):parser.state=S.TEXT;continue;case S.CDATA:"]"===c?parser.state=S.CDATA_ENDING:parser.cdata+=c;continue;case S.CDATA_ENDING:"]"===c?parser.state=S.CDATA_ENDING_2:(parser.cdata+="]"+c,parser.state=S.CDATA);continue;case S.CDATA_ENDING_2:">"===c?(parser.cdata&&emitNode(parser,"oncdata",parser.cdata),emitNode(parser,"onclosecdata"),parser.cdata="",parser.state=S.TEXT):"]"===c?parser.cdata+="]":(parser.cdata+="]]"+c,parser.state=S.CDATA);continue;case S.PROC_INST:"?"===c?parser.state=S.PROC_INST_ENDING:is(whitespace,c)?parser.state=S.PROC_INST_BODY:parser.procInstName+=c;continue;case S.PROC_INST_BODY:if(!parser.procInstBody&&is(whitespace,c))continue;"?"===c?parser.state=S.PROC_INST_ENDING:parser.procInstBody+=c;continue;case S.PROC_INST_ENDING:">"===c?(emitNode(parser,"onprocessinginstruction",{name:parser.procInstName,body:parser.procInstBody}),parser.procInstName=parser.procInstBody="",parser.state=S.TEXT):(parser.procInstBody+="?"+c,parser.state=S.PROC_INST_BODY);continue;case S.OPEN_TAG:is(nameBody,c)?parser.tagName+=c:(newTag(parser),">"===c?openTag(parser):"/"===c?parser.state=S.OPEN_TAG_SLASH:(not(whitespace,c)&&strictFail(parser,"Invalid character in tag name"),parser.state=S.ATTRIB));continue;case S.OPEN_TAG_SLASH:">"===c?(openTag(parser,!0),closeTag(parser)):(strictFail(parser,"Forward-slash in opening tag not followed by >"),parser.state=S.ATTRIB);continue;case S.ATTRIB:if(is(whitespace,c))continue;">"===c?openTag(parser):"/"===c?parser.state=S.OPEN_TAG_SLASH:is(nameStart,c)?(parser.attribName=c,parser.attribValue="",parser.state=S.ATTRIB_NAME):strictFail(parser,"Invalid attribute name");continue;case S.ATTRIB_NAME:"="===c?parser.state=S.ATTRIB_VALUE:">"===c?(strictFail(parser,"Attribute without value"),parser.attribValue=parser.attribName,attrib(parser),openTag(parser)):is(whitespace,c)?parser.state=S.ATTRIB_NAME_SAW_WHITE:is(nameBody,c)?parser.attribName+=c:strictFail(parser,"Invalid attribute name");continue;case S.ATTRIB_NAME_SAW_WHITE:if("="===c)parser.state=S.ATTRIB_VALUE;else{if(is(whitespace,c))continue;strictFail(parser,"Attribute without value"),parser.tag.attributes[parser.attribName]="",parser.attribValue="",emitNode(parser,"onattribute",{name:parser.attribName,value:""}),parser.attribName="",">"===c?openTag(parser):is(nameStart,c)?(parser.attribName=c,parser.state=S.ATTRIB_NAME):(strictFail(parser,"Invalid attribute name"),parser.state=S.ATTRIB)}continue;case S.ATTRIB_VALUE:if(is(whitespace,c))continue;is(quote,c)?(parser.q=c,parser.state=S.ATTRIB_VALUE_QUOTED):(strictFail(parser,"Unquoted attribute value"),parser.state=S.ATTRIB_VALUE_UNQUOTED,parser.attribValue=c);continue;case S.ATTRIB_VALUE_QUOTED:if(c!==parser.q){"&"===c?parser.state=S.ATTRIB_VALUE_ENTITY_Q:parser.attribValue+=c;continue}attrib(parser),parser.q="",parser.state=S.ATTRIB_VALUE_CLOSED;continue;case S.ATTRIB_VALUE_CLOSED:is(whitespace,c)?parser.state=S.ATTRIB:">"===c?openTag(parser):"/"===c?parser.state=S.OPEN_TAG_SLASH:is(nameStart,c)?(strictFail(parser,"No whitespace between attributes"),parser.attribName=c,parser.attribValue="",parser.state=S.ATTRIB_NAME):strictFail(parser,"Invalid attribute name");continue;case S.ATTRIB_VALUE_UNQUOTED:if(not(attribEnd,c)){"&"===c?parser.state=S.ATTRIB_VALUE_ENTITY_U:parser.attribValue+=c;continue}attrib(parser),">"===c?openTag(parser):parser.state=S.ATTRIB;continue;case S.CLOSE_TAG:if(parser.tagName)">"===c?closeTag(parser):is(nameBody,c)?parser.tagName+=c:parser.script?(parser.script+=""===c?closeTag(parser):strictFail(parser,"Invalid characters in closing tag");continue;case S.TEXT_ENTITY:case S.ATTRIB_VALUE_ENTITY_Q:case S.ATTRIB_VALUE_ENTITY_U:switch(parser.state){case S.TEXT_ENTITY:var returnState=S.TEXT,buffer="textNode";break;case S.ATTRIB_VALUE_ENTITY_Q:var returnState=S.ATTRIB_VALUE_QUOTED,buffer="attribValue";break;case S.ATTRIB_VALUE_ENTITY_U:var returnState=S.ATTRIB_VALUE_UNQUOTED,buffer="attribValue"}";"===c?(parser[buffer]+=parseEntity(parser),parser.entity="",parser.state=returnState):is(entity,c)?parser.entity+=c:(strictFail(parser,"Invalid character entity"),parser[buffer]+="&"+parser.entity+c,parser.entity="",parser.state=returnState);continue;default:throw new Error(parser,"Unknown state: "+parser.state)}return parser.position>=parser.bufferCheckPosition&&checkBufferLength(parser),parser}sax.parser=function(strict,opt){return new SAXParser(strict,opt)},sax.SAXParser=SAXParser,sax.SAXStream=SAXStream,sax.createStream=createStream,sax.MAX_BUFFER_LENGTH=65536;var buffers=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];sax.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(o){function f(){this.__proto__=o}return f.prototype=o,new f}),Object.getPrototypeOf||(Object.getPrototypeOf=function(o){return o.__proto__}),Object.keys||(Object.keys=function(o){var a=[];for(var i in o)o.hasOwnProperty(i)&&a.push(i);return a}),SAXParser.prototype={end:function(){end(this)},write:write,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){flushBuffers(this)}};try{var Stream=require("stream").Stream}catch(ex){var Stream=function(){}}var streamWraps=sax.EVENTS.filter(function(ev){return"error"!==ev&&"end"!==ev});SAXStream.prototype=Object.create(Stream.prototype,{constructor:{value:SAXStream}}),SAXStream.prototype.write=function(data){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(data)){if(!this._decoder){var SD=require("string_decoder").StringDecoder;this._decoder=new SD("utf8")}data=this._decoder.write(data)}return this._parser.write(data.toString()),this.emit("data",data),!0},SAXStream.prototype.end=function(chunk){return chunk&&chunk.length&&this.write(chunk),this._parser.end(),!0},SAXStream.prototype.on=function(ev,handler){var me=this;return me._parser["on"+ev]||-1===streamWraps.indexOf(ev)||(me._parser["on"+ev]=function(){var args=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);args.splice(0,0,ev),me.emit.apply(me,args)}),Stream.prototype.on.call(me,ev,handler)};var whitespace="\r\n ",number="0124356789",letter="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",quote="'\"",entity=number+letter+"#",attribEnd=whitespace+">",CDATA="[CDATA[",DOCTYPE="DOCTYPE",XML_NAMESPACE="http://www.w3.org/XML/1998/namespace",XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/",rootNS={xml:XML_NAMESPACE,xmlns:XMLNS_NAMESPACE};whitespace=charClass(whitespace),number=charClass(number),letter=charClass(letter);var nameStart=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,nameBody=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;quote=charClass(quote),entity=charClass(entity),attribEnd=charClass(attribEnd);var S=0;sax.STATE={BEGIN:S++,TEXT:S++,TEXT_ENTITY:S++,OPEN_WAKA:S++,SGML_DECL:S++,SGML_DECL_QUOTED:S++,DOCTYPE:S++,DOCTYPE_QUOTED:S++,DOCTYPE_DTD:S++,DOCTYPE_DTD_QUOTED:S++,COMMENT_STARTING:S++,COMMENT:S++,COMMENT_ENDING:S++,COMMENT_ENDED:S++,CDATA:S++,CDATA_ENDING:S++,CDATA_ENDING_2:S++,PROC_INST:S++,PROC_INST_BODY:S++,PROC_INST_ENDING:S++,OPEN_TAG:S++,OPEN_TAG_SLASH:S++,ATTRIB:S++,ATTRIB_NAME:S++,ATTRIB_NAME_SAW_WHITE:S++,ATTRIB_VALUE:S++,ATTRIB_VALUE_QUOTED:S++,ATTRIB_VALUE_CLOSED:S++,ATTRIB_VALUE_UNQUOTED:S++,ATTRIB_VALUE_ENTITY_Q:S++,ATTRIB_VALUE_ENTITY_U:S++,CLOSE_TAG:S++,CLOSE_TAG_SAW_WHITE:S++,SCRIPT:S++,SCRIPT_ENDING:S++},sax.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(sax.ENTITIES).forEach(function(key){var e=sax.ENTITIES[key],s="number"==typeof e?String.fromCharCode(e):e;sax.ENTITIES[key]=s});for(var S in sax.STATE)sax.STATE[sax.STATE[S]]=S;S=sax.STATE,String.fromCodePoint||!function(){var stringFromCharCode=String.fromCharCode,floor=Math.floor,fromCodePoint=function(){var highSurrogate,lowSurrogate,MAX_SIZE=16384,codeUnits=[],index=-1,length=arguments.length;if(!length)return"";for(var result="";++indexcodePoint||codePoint>1114111||floor(codePoint)!=codePoint)throw RangeError("Invalid code point: "+codePoint);65535>=codePoint?codeUnits.push(codePoint):(codePoint-=65536,highSurrogate=(codePoint>>10)+55296,lowSurrogate=codePoint%1024+56320,codeUnits.push(highSurrogate,lowSurrogate)),(index+1==length||codeUnits.length>MAX_SIZE)&&(result+=stringFromCharCode.apply(null,codeUnits),codeUnits.length=0)}return result};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:!0,writable:!0}):String.fromCodePoint=fromCodePoint}()}("undefined"==typeof exports?sax={}:exports)}).call(this,require("buffer").Buffer)},{buffer:1,stream:20,string_decoder:21}],27:[function(require,module){(function(){var XMLAttribute,create;create=require("lodash-node/modern/objects/create"),module.exports=XMLAttribute=function(){function XMLAttribute(parent,name,value){if(this.stringify=parent.stringify,null==name)throw new Error("Missing attribute name");if(null==value)throw new Error("Missing attribute value");this.name=this.stringify.attName(name),this.value=this.stringify.attValue(value)}return XMLAttribute.prototype.clone=function(){return create(XMLAttribute.prototype,this)},XMLAttribute.prototype.toString=function(){return" "+this.name+'="'+this.value+'"'},XMLAttribute}()}).call(this)},{"lodash-node/modern/objects/create":56}],28:[function(require,module){(function(){var XMLBuilder,XMLDeclaration,XMLDocType,XMLElement,XMLStringifier;XMLStringifier=require("./XMLStringifier"),XMLDeclaration=require("./XMLDeclaration"),XMLDocType=require("./XMLDocType"),XMLElement=require("./XMLElement"),module.exports=XMLBuilder=function(){function XMLBuilder(name,options){var root,temp;if(null==name)throw new Error("Root element needs a name");null==options&&(options={}),this.options=options,this.stringify=new XMLStringifier(options),temp=new XMLElement(this,"doc"),root=temp.element(name),root.isRoot=!0,root.documentObject=this,this.rootObject=root,options.headless||(root.declaration(options),(null!=options.pubID||null!=options.sysID)&&root.doctype(options))}return XMLBuilder.prototype.root=function(){return this.rootObject},XMLBuilder.prototype.end=function(options){return this.toString(options)},XMLBuilder.prototype.toString=function(options){var indent,newline,offset,pretty,r,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",r="",null!=this.xmldec&&(r+=this.xmldec.toString(options)),null!=this.doctype&&(r+=this.doctype.toString(options)),r+=this.rootObject.toString(options),pretty&&r.slice(-newline.length)===newline&&(r=r.slice(0,-newline.length)),r},XMLBuilder}()}).call(this)},{"./XMLDeclaration":35,"./XMLDocType":36,"./XMLElement":37,"./XMLStringifier":41}],29:[function(require,module){(function(){var XMLCData,XMLNode,create,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};create=require("lodash-node/modern/objects/create"),XMLNode=require("./XMLNode"),module.exports=XMLCData=function(_super){function XMLCData(parent,text){if(XMLCData.__super__.constructor.call(this,parent),null==text)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(text)}return __extends(XMLCData,_super),XMLCData.prototype.clone=function(){return create(XMLCData.prototype,this)},XMLCData.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="",pretty&&(r+=newline),r},XMLCData}(XMLNode)}).call(this)},{"./XMLNode":38,"lodash-node/modern/objects/create":56}],30:[function(require,module){(function(){var XMLComment,XMLNode,create,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};create=require("lodash-node/modern/objects/create"),XMLNode=require("./XMLNode"),module.exports=XMLComment=function(_super){function XMLComment(parent,text){if(XMLComment.__super__.constructor.call(this,parent),null==text)throw new Error("Missing comment text");this.text=this.stringify.comment(text)}return __extends(XMLComment,_super),XMLComment.prototype.clone=function(){return create(XMLComment.prototype,this)},XMLComment.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="",pretty&&(r+=newline),r},XMLComment}(XMLNode)}).call(this)},{"./XMLNode":38,"lodash-node/modern/objects/create":56}],31:[function(require,module){(function(){var XMLDTDAttList,create;create=require("lodash-node/modern/objects/create"),module.exports=XMLDTDAttList=function(){function XMLDTDAttList(parent,elementName,attributeName,attributeType,defaultValueType,defaultValue){if(this.stringify=parent.stringify,null==elementName)throw new Error("Missing DTD element name");if(null==attributeName)throw new Error("Missing DTD attribute name");if(!attributeType)throw new Error("Missing DTD attribute type");if(!defaultValueType)throw new Error("Missing DTD attribute default");if(0!==defaultValueType.indexOf("#")&&(defaultValueType="#"+defaultValueType),!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(defaultValue&&!defaultValueType.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(elementName),this.attributeName=this.stringify.attName(attributeName),this.attributeType=this.stringify.dtdAttType(attributeType),this.defaultValue=this.stringify.dtdAttDefault(defaultValue),this.defaultValueType=defaultValueType}return XMLDTDAttList.prototype.clone=function(){return create(XMLDTDAttList.prototype,this)},XMLDTDAttList.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="",pretty&&(r+=newline),r},XMLDTDAttList}()}).call(this)},{"lodash-node/modern/objects/create":56}],32:[function(require,module){(function(){var XMLDTDElement,create,isArray;create=require("lodash-node/modern/objects/create"),isArray=require("lodash-node/modern/objects/isArray"),module.exports=XMLDTDElement=function(){function XMLDTDElement(parent,name,value){if(this.stringify=parent.stringify,null==name)throw new Error("Missing DTD element name");value||(value="(#PCDATA)"),isArray(value)&&(value="("+value.join(",")+")"),this.name=this.stringify.eleName(name),this.value=this.stringify.dtdElementValue(value)}return XMLDTDElement.prototype.clone=function(){return create(XMLDTDElement.prototype,this)},XMLDTDElement.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="",pretty&&(r+=newline),r},XMLDTDElement}()}).call(this)},{"lodash-node/modern/objects/create":56,"lodash-node/modern/objects/isArray":58}],33:[function(require,module){(function(){var XMLDTDEntity,create,isObject;create=require("lodash-node/modern/objects/create"),isObject=require("lodash-node/modern/objects/isObject"),module.exports=XMLDTDEntity=function(){function XMLDTDEntity(parent,pe,name,value){if(this.stringify=parent.stringify,null==name)throw new Error("Missing entity name");if(null==value)throw new Error("Missing entity value");if(this.pe=!!pe,this.name=this.stringify.eleName(name),isObject(value)){if(!value.pubID&&!value.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(value.pubID&&!value.sysID)throw new Error("System identifier is required for a public external entity");if(null!=value.pubID&&(this.pubID=this.stringify.dtdPubID(value.pubID)),null!=value.sysID&&(this.sysID=this.stringify.dtdSysID(value.sysID)),null!=value.nData&&(this.nData=this.stringify.dtdNData(value.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(value)}return XMLDTDEntity.prototype.clone=function(){return create(XMLDTDEntity.prototype,this)},XMLDTDEntity.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="",pretty&&(r+=newline),r},XMLDTDEntity}()}).call(this)},{"lodash-node/modern/objects/create":56,"lodash-node/modern/objects/isObject":61}],34:[function(require,module){(function(){var XMLDTDNotation,create;create=require("lodash-node/modern/objects/create"),module.exports=XMLDTDNotation=function(){function XMLDTDNotation(parent,name,value){if(this.stringify=parent.stringify,null==name)throw new Error("Missing notation name");if(!value.pubID&&!value.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(name),null!=value.pubID&&(this.pubID=this.stringify.dtdPubID(value.pubID)),null!=value.sysID&&(this.sysID=this.stringify.dtdSysID(value.sysID))}return XMLDTDNotation.prototype.clone=function(){return create(XMLDTDNotation.prototype,this)},XMLDTDNotation.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="",pretty&&(r+=newline),r},XMLDTDNotation}()}).call(this)},{"lodash-node/modern/objects/create":56}],35:[function(require,module){(function(){var XMLDeclaration,XMLNode,create,isObject,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};create=require("lodash-node/modern/objects/create"),isObject=require("lodash-node/modern/objects/isObject"),XMLNode=require("./XMLNode"),module.exports=XMLDeclaration=function(_super){function XMLDeclaration(parent,version,encoding,standalone){var _ref;XMLDeclaration.__super__.constructor.call(this,parent),isObject(version)&&(_ref=version,version=_ref.version,encoding=_ref.encoding,standalone=_ref.standalone),version||(version="1.0"),null!=version&&(this.version=this.stringify.xmlVersion(version)),null!=encoding&&(this.encoding=this.stringify.xmlEncoding(encoding)),null!=standalone&&(this.standalone=this.stringify.xmlStandalone(standalone))}return __extends(XMLDeclaration,_super),XMLDeclaration.prototype.clone=function(){return create(XMLDeclaration.prototype,this)},XMLDeclaration.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="",pretty&&(r+=newline),r},XMLDeclaration}(XMLNode)}).call(this)},{"./XMLNode":38,"lodash-node/modern/objects/create":56,"lodash-node/modern/objects/isObject":61}],36:[function(require,module){(function(){var XMLDocType,create,isObject;create=require("lodash-node/modern/objects/create"),isObject=require("lodash-node/modern/objects/isObject"),module.exports=XMLDocType=function(){function XMLDocType(parent,pubID,sysID){var _ref,_ref1;this.documentObject=parent,this.stringify=this.documentObject.stringify,this.children=[],isObject(pubID)&&(_ref=pubID,pubID=_ref.pubID,sysID=_ref.sysID),null==sysID&&(_ref1=[pubID,sysID],sysID=_ref1[0],pubID=_ref1[1]),null!=pubID&&(this.pubID=this.stringify.dtdPubID(pubID)),null!=sysID&&(this.sysID=this.stringify.dtdSysID(sysID))}return XMLDocType.prototype.clone=function(){return create(XMLDocType.prototype,this)},XMLDocType.prototype.element=function(name,value){var XMLDTDElement,child;return XMLDTDElement=require("./XMLDTDElement"),child=new XMLDTDElement(this,name,value),this.children.push(child),this},XMLDocType.prototype.attList=function(elementName,attributeName,attributeType,defaultValueType,defaultValue){var XMLDTDAttList,child;return XMLDTDAttList=require("./XMLDTDAttList"),child=new XMLDTDAttList(this,elementName,attributeName,attributeType,defaultValueType,defaultValue),this.children.push(child),this},XMLDocType.prototype.entity=function(name,value){var XMLDTDEntity,child;return XMLDTDEntity=require("./XMLDTDEntity"),child=new XMLDTDEntity(this,!1,name,value),this.children.push(child),this },XMLDocType.prototype.pEntity=function(name,value){var XMLDTDEntity,child;return XMLDTDEntity=require("./XMLDTDEntity"),child=new XMLDTDEntity(this,!0,name,value),this.children.push(child),this},XMLDocType.prototype.notation=function(name,value){var XMLDTDNotation,child;return XMLDTDNotation=require("./XMLDTDNotation"),child=new XMLDTDNotation(this,name,value),this.children.push(child),this},XMLDocType.prototype.cdata=function(value){var XMLCData,child;return XMLCData=require("./XMLCData"),child=new XMLCData(this,value),this.children.push(child),this},XMLDocType.prototype.comment=function(value){var XMLComment,child;return XMLComment=require("./XMLComment"),child=new XMLComment(this,value),this.children.push(child),this},XMLDocType.prototype.instruction=function(target,value){var XMLProcessingInstruction,child;return XMLProcessingInstruction=require("./XMLProcessingInstruction"),child=new XMLProcessingInstruction(this,target,value),this.children.push(child),this},XMLDocType.prototype.root=function(){return this.documentObject.root()},XMLDocType.prototype.document=function(){return this.documentObject},XMLDocType.prototype.toString=function(options,level){var child,indent,newline,offset,pretty,r,space,_i,_len,_ref,_ref1,_ref2,_ref3;if(pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="0){for(r+=" [",pretty&&(r+=newline),_ref3=this.children,_i=0,_len=_ref3.length;_len>_i;_i++)child=_ref3[_i],r+=child.toString(options,level+1);r+="]"}return r+=">",pretty&&(r+=newline),r},XMLDocType.prototype.ele=function(name,value){return this.element(name,value)},XMLDocType.prototype.att=function(elementName,attributeName,attributeType,defaultValueType,defaultValue){return this.attList(elementName,attributeName,attributeType,defaultValueType,defaultValue)},XMLDocType.prototype.ent=function(name,value){return this.entity(name,value)},XMLDocType.prototype.pent=function(name,value){return this.pEntity(name,value)},XMLDocType.prototype.not=function(name,value){return this.notation(name,value)},XMLDocType.prototype.dat=function(value){return this.cdata(value)},XMLDocType.prototype.com=function(value){return this.comment(value)},XMLDocType.prototype.ins=function(target,value){return this.instruction(target,value)},XMLDocType.prototype.up=function(){return this.root()},XMLDocType.prototype.doc=function(){return this.document()},XMLDocType}()}).call(this)},{"./XMLCData":29,"./XMLComment":30,"./XMLDTDAttList":31,"./XMLDTDElement":32,"./XMLDTDEntity":33,"./XMLDTDNotation":34,"./XMLProcessingInstruction":39,"lodash-node/modern/objects/create":56,"lodash-node/modern/objects/isObject":61}],37:[function(require,module){(function(){var XMLAttribute,XMLElement,XMLNode,XMLProcessingInstruction,create,isArray,isFunction,isObject,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};create=require("lodash-node/modern/objects/create"),isObject=require("lodash-node/modern/objects/isObject"),isArray=require("lodash-node/modern/objects/isArray"),isFunction=require("lodash-node/modern/objects/isFunction"),XMLNode=require("./XMLNode"),XMLAttribute=require("./XMLAttribute"),XMLProcessingInstruction=require("./XMLProcessingInstruction"),module.exports=XMLElement=function(_super){function XMLElement(parent,name,attributes){if(XMLElement.__super__.constructor.call(this,parent),null==name)throw new Error("Missing element name");this.name=this.stringify.eleName(name),this.children=[],this.instructions=[],this.attributes={},null!=attributes&&this.attribute(attributes)}return __extends(XMLElement,_super),XMLElement.prototype.clone=function(){var att,attName,clonedSelf,pi,_i,_len,_ref,_ref1;clonedSelf=create(XMLElement.prototype,this),clonedSelf.attributes={},_ref=this.attributes;for(attName in _ref)__hasProp.call(_ref,attName)&&(att=_ref[attName],clonedSelf.attributes[attName]=att.clone());for(clonedSelf.instructions=[],_ref1=this.instructions,_i=0,_len=_ref1.length;_len>_i;_i++)pi=_ref1[_i],clonedSelf.instructions.push(pi.clone());return clonedSelf.children=[],this.children.forEach(function(child){var clonedChild;return clonedChild=child.clone(),clonedChild.parent=clonedSelf,clonedSelf.children.push(clonedChild)}),clonedSelf},XMLElement.prototype.attribute=function(name,value){var attName,attValue;if(null!=name&&(name=name.valueOf()),isObject(name))for(attName in name)__hasProp.call(name,attName)&&(attValue=name[attName],this.attribute(attName,attValue));else isFunction(value)&&(value=value.apply()),this.options.skipNullAttributes&&null==value||(this.attributes[name]=new XMLAttribute(this,name,value));return this},XMLElement.prototype.removeAttribute=function(name){var attName,_i,_len;if(null==name)throw new Error("Missing attribute name");if(name=name.valueOf(),isArray(name))for(_i=0,_len=name.length;_len>_i;_i++)attName=name[_i],delete this.attributes[attName];else delete this.attributes[name];return this},XMLElement.prototype.instruction=function(target,value){var insTarget,insValue,instruction,_i,_len;if(null!=target&&(target=target.valueOf()),null!=value&&(value=value.valueOf()),isArray(target))for(_i=0,_len=target.length;_len>_i;_i++)insTarget=target[_i],this.instruction(insTarget);else if(isObject(target))for(insTarget in target)__hasProp.call(target,insTarget)&&(insValue=target[insTarget],this.instruction(insTarget,insValue));else isFunction(value)&&(value=value.apply()),instruction=new XMLProcessingInstruction(this,target,value),this.instructions.push(instruction);return this},XMLElement.prototype.toString=function(options,level){var att,child,indent,instruction,name,newline,offset,pretty,r,space,_i,_j,_len,_len1,_ref,_ref1,_ref2,_ref3,_ref4,_ref5;for(pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",_ref3=this.instructions,_i=0,_len=_ref3.length;_len>_i;_i++)instruction=_ref3[_i],r+=instruction.toString(options,level+1);pretty&&(r+=space),r+="<"+this.name,_ref4=this.attributes;for(name in _ref4)__hasProp.call(_ref4,name)&&(att=_ref4[name],r+=att.toString(options));if(0===this.children.length)r+="/>",pretty&&(r+=newline);else if(pretty&&1===this.children.length&&null!=this.children[0].value)r+=">",r+=this.children[0].value,r+="",r+=newline;else{for(r+=">",pretty&&(r+=newline),_ref5=this.children,_j=0,_len1=_ref5.length;_len1>_j;_j++)child=_ref5[_j],r+=child.toString(options,level+1);pretty&&(r+=space),r+="",pretty&&(r+=newline)}return r},XMLElement.prototype.att=function(name,value){return this.attribute(name,value)},XMLElement.prototype.ins=function(target,value){return this.instruction(target,value)},XMLElement.prototype.a=function(name,value){return this.attribute(name,value)},XMLElement.prototype.i=function(target,value){return this.instruction(target,value)},XMLElement}(XMLNode)}).call(this)},{"./XMLAttribute":27,"./XMLNode":38,"./XMLProcessingInstruction":39,"lodash-node/modern/objects/create":56,"lodash-node/modern/objects/isArray":58,"lodash-node/modern/objects/isFunction":60,"lodash-node/modern/objects/isObject":61}],38:[function(require,module){(function(){var XMLNode,isArray,isEmpty,isFunction,isObject,__hasProp={}.hasOwnProperty;isObject=require("lodash-node/modern/objects/isObject"),isArray=require("lodash-node/modern/objects/isArray"),isFunction=require("lodash-node/modern/objects/isFunction"),isEmpty=require("lodash-node/modern/objects/isEmpty"),module.exports=XMLNode=function(){function XMLNode(parent){this.parent=parent,this.options=this.parent.options,this.stringify=this.parent.stringify}return XMLNode.prototype.clone=function(){throw new Error("Cannot clone generic XMLNode")},XMLNode.prototype.element=function(name,attributes,text){var item,key,lastChild,val,_i,_len,_ref;if(lastChild=null,null==attributes&&(attributes={}),attributes=attributes.valueOf(),isObject(attributes)||(_ref=[attributes,text],text=_ref[0],attributes=_ref[1]),null!=name&&(name=name.valueOf()),isArray(name))for(_i=0,_len=name.length;_len>_i;_i++)item=name[_i],lastChild=this.element(item);else if(isFunction(name))lastChild=this.element(name.apply());else if(isObject(name))for(key in name)__hasProp.call(name,key)&&(val=name[key],isFunction(val)&&(val=val.apply()),isObject(val)&&isEmpty(val)&&(val=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&0===key.indexOf(this.stringify.convertAttKey)?lastChild=this.attribute(key.substr(this.stringify.convertAttKey.length),val):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&0===key.indexOf(this.stringify.convertPIKey)?lastChild=this.instruction(key.substr(this.stringify.convertPIKey.length),val):isObject(val)?!this.options.ignoreDecorators&&this.stringify.convertListKey&&0===key.indexOf(this.stringify.convertListKey)&&isArray(val)?lastChild=this.element(val):(lastChild=this.element(key),lastChild.element(val)):lastChild=this.element(key,val));else lastChild=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===name.indexOf(this.stringify.convertTextKey)?this.text(text):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&0===name.indexOf(this.stringify.convertCDataKey)?this.cdata(text):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&0===name.indexOf(this.stringify.convertCommentKey)?this.comment(text):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&0===name.indexOf(this.stringify.convertRawKey)?this.raw(text):this.node(name,attributes,text);if(null==lastChild)throw new Error("Could not create any elements with: "+name);return lastChild},XMLNode.prototype.insertBefore=function(name,attributes,text){var child,i,removed;if(this.isRoot)throw new Error("Cannot insert elements at root level");return i=this.parent.children.indexOf(this),removed=this.parent.children.splice(i),child=this.parent.element(name,attributes,text),Array.prototype.push.apply(this.parent.children,removed),child},XMLNode.prototype.insertAfter=function(name,attributes,text){var child,i,removed;if(this.isRoot)throw new Error("Cannot insert elements at root level");return i=this.parent.children.indexOf(this),removed=this.parent.children.splice(i+1),child=this.parent.element(name,attributes,text),Array.prototype.push.apply(this.parent.children,removed),child},XMLNode.prototype.remove=function(){var i,_ref;if(this.isRoot)throw new Error("Cannot remove the root element");return i=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[i,i-i+1].concat(_ref=[])),_ref,this.parent},XMLNode.prototype.node=function(name,attributes,text){var XMLElement,child,_ref;return null!=name&&(name=name.valueOf()),null==attributes&&(attributes={}),attributes=attributes.valueOf(),isObject(attributes)||(_ref=[attributes,text],text=_ref[0],attributes=_ref[1]),XMLElement=require("./XMLElement"),child=new XMLElement(this,name,attributes),null!=text&&child.text(text),this.children.push(child),child},XMLNode.prototype.text=function(value){var XMLText,child;return XMLText=require("./XMLText"),child=new XMLText(this,value),this.children.push(child),this},XMLNode.prototype.cdata=function(value){var XMLCData,child;return XMLCData=require("./XMLCData"),child=new XMLCData(this,value),this.children.push(child),this},XMLNode.prototype.comment=function(value){var XMLComment,child;return XMLComment=require("./XMLComment"),child=new XMLComment(this,value),this.children.push(child),this},XMLNode.prototype.raw=function(value){var XMLRaw,child;return XMLRaw=require("./XMLRaw"),child=new XMLRaw(this,value),this.children.push(child),this},XMLNode.prototype.declaration=function(version,encoding,standalone){var XMLDeclaration,doc,xmldec;return doc=this.document(),XMLDeclaration=require("./XMLDeclaration"),xmldec=new XMLDeclaration(doc,version,encoding,standalone),doc.xmldec=xmldec,doc.root()},XMLNode.prototype.doctype=function(pubID,sysID){var XMLDocType,doc,doctype;return doc=this.document(),XMLDocType=require("./XMLDocType"),doctype=new XMLDocType(doc,pubID,sysID),doc.doctype=doctype,doctype},XMLNode.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},XMLNode.prototype.root=function(){var child;if(this.isRoot)return this;for(child=this.parent;!child.isRoot;)child=child.parent;return child},XMLNode.prototype.document=function(){return this.root().documentObject},XMLNode.prototype.end=function(options){return this.document().toString(options)},XMLNode.prototype.prev=function(){var i;if(this.isRoot)throw new Error("Root node has no siblings");if(i=this.parent.children.indexOf(this),1>i)throw new Error("Already at the first node");return this.parent.children[i-1]},XMLNode.prototype.next=function(){var i;if(this.isRoot)throw new Error("Root node has no siblings");if(i=this.parent.children.indexOf(this),-1===i||i===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[i+1]},XMLNode.prototype.importXMLBuilder=function(xmlbuilder){var clonedRoot;return clonedRoot=xmlbuilder.root().clone(),clonedRoot.parent=this,clonedRoot.isRoot=!1,this.children.push(clonedRoot),this},XMLNode.prototype.ele=function(name,attributes,text){return this.element(name,attributes,text)},XMLNode.prototype.nod=function(name,attributes,text){return this.node(name,attributes,text)},XMLNode.prototype.txt=function(value){return this.text(value)},XMLNode.prototype.dat=function(value){return this.cdata(value)},XMLNode.prototype.com=function(value){return this.comment(value)},XMLNode.prototype.doc=function(){return this.document()},XMLNode.prototype.dec=function(version,encoding,standalone){return this.declaration(version,encoding,standalone)},XMLNode.prototype.dtd=function(pubID,sysID){return this.doctype(pubID,sysID)},XMLNode.prototype.e=function(name,attributes,text){return this.element(name,attributes,text)},XMLNode.prototype.n=function(name,attributes,text){return this.node(name,attributes,text)},XMLNode.prototype.t=function(value){return this.text(value)},XMLNode.prototype.d=function(value){return this.cdata(value)},XMLNode.prototype.c=function(value){return this.comment(value)},XMLNode.prototype.r=function(value){return this.raw(value)},XMLNode.prototype.u=function(){return this.up()},XMLNode}()}).call(this)},{"./XMLCData":29,"./XMLComment":30,"./XMLDeclaration":35,"./XMLDocType":36,"./XMLElement":37,"./XMLRaw":40,"./XMLText":42,"lodash-node/modern/objects/isArray":58,"lodash-node/modern/objects/isEmpty":59,"lodash-node/modern/objects/isFunction":60,"lodash-node/modern/objects/isObject":61}],39:[function(require,module){(function(){var XMLProcessingInstruction,create;create=require("lodash-node/modern/objects/create"),module.exports=XMLProcessingInstruction=function(){function XMLProcessingInstruction(parent,target,value){if(this.stringify=parent.stringify,null==target)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(target),value&&(this.value=this.stringify.insValue(value))}return XMLProcessingInstruction.prototype.clone=function(){return create(XMLProcessingInstruction.prototype,this)},XMLProcessingInstruction.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+="",pretty&&(r+=newline),r},XMLProcessingInstruction}()}).call(this)},{"lodash-node/modern/objects/create":56}],40:[function(require,module){(function(){var XMLNode,XMLRaw,create,__hasProp={}.hasOwnProperty,__extends=function(child,parent){function ctor(){this.constructor=child}for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child};create=require("lodash-node/modern/objects/create"),XMLNode=require("./XMLNode"),module.exports=XMLRaw=function(_super){function XMLRaw(parent,text){if(XMLRaw.__super__.constructor.call(this,parent),null==text)throw new Error("Missing raw text");this.value=this.stringify.raw(text)}return __extends(XMLRaw,_super),XMLRaw.prototype.clone=function(){return create(XMLRaw.prototype,this)},XMLRaw.prototype.toString=function(options,level){var indent,newline,offset,pretty,r,space,_ref,_ref1,_ref2;return pretty=(null!=options?options.pretty:void 0)||!1,indent=null!=(_ref=null!=options?options.indent:void 0)?_ref:" ",offset=null!=(_ref1=null!=options?options.offset:void 0)?_ref1:0,newline=null!=(_ref2=null!=options?options.newline:void 0)?_ref2:"\n",level||(level=0),space=new Array(level+offset+1).join(indent),r="",pretty&&(r+=space),r+=this.value,pretty&&(r+=newline),r},XMLRaw}(XMLNode)}).call(this)},{"./XMLNode":38,"lodash-node/modern/objects/create":56}],41:[function(require,module){(function(){var XMLStringifier,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty;module.exports=XMLStringifier=function(){function XMLStringifier(options){this.assertLegalChar=__bind(this.assertLegalChar,this);var key,value,_ref;this.allowSurrogateChars=null!=options?options.allowSurrogateChars:void 0,_ref=(null!=options?options.stringify:void 0)||{};for(key in _ref)__hasProp.call(_ref,key)&&(value=_ref[key],this[key]=value)}return XMLStringifier.prototype.eleName=function(val){return val=""+val||"",this.assertLegalChar(val)},XMLStringifier.prototype.eleText=function(val){return val=""+val||"",this.assertLegalChar(this.elEscape(val))},XMLStringifier.prototype.cdata=function(val){if(val=""+val||"",val.match(/]]>/))throw new Error("Invalid CDATA text: "+val);return this.assertLegalChar(val)},XMLStringifier.prototype.comment=function(val){if(val=""+val||"",val.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+val);return this.assertLegalChar(val)},XMLStringifier.prototype.raw=function(val){return""+val||""},XMLStringifier.prototype.attName=function(val){return""+val||""},XMLStringifier.prototype.attValue=function(val){return val=""+val||"",this.attEscape(val)},XMLStringifier.prototype.insTarget=function(val){return""+val||""},XMLStringifier.prototype.insValue=function(val){if(val=""+val||"",val.match(/\?>/))throw new Error("Invalid processing instruction value: "+val);return val},XMLStringifier.prototype.xmlVersion=function(val){if(val=""+val||"",!val.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+val);return val},XMLStringifier.prototype.xmlEncoding=function(val){if(val=""+val||"",!val.match(/[A-Za-z](?:[A-Za-z0-9._-]|-)*/))throw new Error("Invalid encoding: "+options.val);return val},XMLStringifier.prototype.xmlStandalone=function(val){return val?"yes":"no"},XMLStringifier.prototype.dtdPubID=function(val){return""+val||""},XMLStringifier.prototype.dtdSysID=function(val){return""+val||""},XMLStringifier.prototype.dtdElementValue=function(val){return""+val||""},XMLStringifier.prototype.dtdAttType=function(val){return""+val||""},XMLStringifier.prototype.dtdAttDefault=function(val){return null!=val?""+val||"":val},XMLStringifier.prototype.dtdEntityValue=function(val){return""+val||""},XMLStringifier.prototype.dtdNData=function(val){return""+val||""},XMLStringifier.prototype.convertAttKey="@",XMLStringifier.prototype.convertPIKey="?",XMLStringifier.prototype.convertTextKey="#text",XMLStringifier.prototype.convertCDataKey="#cdata",XMLStringifier.prototype.convertCommentKey="#comment",XMLStringifier.prototype.convertRawKey="#raw",XMLStringifier.prototype.convertListKey="#list",XMLStringifier.prototype.assertLegalChar=function(str){var chars,chr;if(chars=this.allowSurrogateChars?/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/:/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/,chr=str.match(chars))throw new Error("Invalid character ("+chr+") in string: "+str+" at index "+chr.index);return str},XMLStringifier.prototype.elEscape=function(str){return str.replace(/&/g,"&").replace(//g,">").replace(/\r/g," ")},XMLStringifier.prototype.attEscape=function(str){return str.replace(/&/g,"&").replace(/2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}var createWrapper=require("../internals/createWrapper"),slice=require("../internals/slice");module.exports=bind},{"../internals/createWrapper":49,"../internals/slice":54}],45:[function(require,module){function baseBind(bindData){function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];return setBindData(bound,bindData),bound}var baseCreate=require("./baseCreate"),isObject=require("../objects/isObject"),setBindData=require("./setBindData"),slice=require("./slice"),arrayRef=[],push=arrayRef.push;module.exports=baseBind},{"../objects/isObject":61,"./baseCreate":46,"./setBindData":52,"./slice":54}],46:[function(require,module){(function(global){function baseCreate(prototype){return isObject(prototype)?nativeCreate(prototype):{}}var isNative=require("./isNative"),isObject=require("../objects/isObject"),nativeCreate=(require("../utilities/noop"),isNative(nativeCreate=Object.create)&&nativeCreate);nativeCreate||(baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||global.Object()}}()),module.exports=baseCreate}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../objects/isObject":61,"../utilities/noop":65,"./isNative":50}],47:[function(require,module){function baseCreateCallback(func,thisArg,argCount){if("function"!=typeof func)return identity;if("undefined"==typeof thisArg||!("prototype"in func))return func;var bindData=func.__bindData__;if("undefined"==typeof bindData&&(support.funcNames&&(bindData=!func.name),bindData=bindData||!support.funcDecomp,!bindData)){var source=fnToString.call(func);support.funcNames||(bindData=!reFuncName.test(source)),bindData||(bindData=reThis.test(source),setBindData(func,bindData))}if(bindData===!1||bindData!==!0&&1&bindData[1])return func;switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}var bind=require("../functions/bind"),identity=require("../utilities/identity"),setBindData=require("./setBindData"),support=require("../support"),reFuncName=/^\s*function[ \n\r\t]+\w/,reThis=/\bthis\b/,fnToString=Function.prototype.toString;module.exports=baseCreateCallback},{"../functions/bind":44,"../support":63,"../utilities/identity":64,"./setBindData":52}],48:[function(require,module){function baseCreateWrapper(bindData){function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if((partialRightArgs||isCurry)&&(args||(args=slice(arguments)),partialRightArgs&&push.apply(args,partialRightArgs),isCurry&&args.lengthlength?0:length);++index3&&"function"==typeof args[argsLength-2])var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2);else argsLength>2&&"function"==typeof args[argsLength-1]&&(callback=args[--argsLength]);for(;++argsIndex0))return _this.isRunning=!1;for(startTime=Animate.currentTime(),Animate._animationsDisabled=!1,i=_i=0,_ref=_this.animations.length-1;_ref>=0?_ref>=_i:_i>=_ref;i=_ref>=0?++_i:--_i)_this.animations[i]&&_this.animations[i](startTime,_this.removers[i]);for(Animate._animationsDisabled=!0,_ref1=_this.recalcs,_j=0,_len=_ref1.length;_len>_j;_j++)r=_ref1[_j],r.recalc();return endTime=Animate.currentTime(),_this.isRunning?(calc=Math.max(0,1e3*(1/_this.fpsLimit-(endTime-startTime)/1e3)),setTimeout(_this.run,calc)):void 0}}(this))},Synchronizer}(),Animate.synchronizer=new Animate.Synchronizer,Animate.once=function(recalc,options,code){var endTime,startTime;return startTime=Animate.currentTime(),endTime=startTime+options.duration,Animate.synchronizer.addAnimation(recalc,function(currentTime,stop){var index,result;return index=Math.min(1,(currentTime-startTime)/options.duration),result=code(index),!result||currentTime>=endTime?stop():void 0})},Animate.loop=function(recalc,options,code){var startTime;return startTime=Animate.currentTime(),Animate.synchronizer.addAnimation(recalc,function(currentTime,stop){var index,result;return index=Math.min(1,(currentTime-startTime)%options.duration/options.duration),result=code(index),result?void 0:stop()})},module.exports=Animate},{}],68:[function(require,module){var Canvas,Drawable,Layout,Resources;Drawable=require("./drawable"),Resources=require("./resources"),Layout=require("./layout"),Canvas=function(){function Canvas(element,options){this.element=element,null==options&&(options={}),this.snapElement=Snap(this.element),this.snapElement.attr("bismarck")||options.id&&this.snapElement.attr({id:options.id,bismarck:"canvas"})}return Canvas.prototype.fromLayout=function(xml,callback){return Layout(xml,this,callback)},Canvas.prototype.create=function(options){var drawable;return drawable=new Drawable(this,options),drawable.attachTo(this.snapElement),drawable},Canvas.prototype.find=function(id){var drawable;return drawable=new Drawable(this),drawable.useExisting(this.snapElement.select("#"+id)),drawable},Canvas.prototype.resources=function(){return this._resources?this._resources:(this._resources=new Resources(this),this._resources.attachTo(this.snapElement),this._resources)},Canvas}(),module.exports=Canvas},{"./drawable":69,"./layout":70,"./resources":71}],69:[function(require,module){var Animate,Drawable,__hasProp={}.hasOwnProperty,__slice=[].slice;Animate=require("./animate"),Drawable=function(){function Drawable(canvas,options){var defaults,key,value;this.canvas=canvas,null==options&&(options={}),defaults={centerPoint:"northwest",position:{x:0,y:0},angle:0,scale:1};for(key in defaults)if(__hasProp.call(defaults,key))switch(value=defaults[key],key){case"centerPoint":this.setCenterPoint(value||defaults[key]);break;default:this[key]=value||defaults[key]}for(key in options)if(__hasProp.call(options,key))switch(value=options[key],key){case"centerPoint":this.setCenterPoint(value||defaults[key]);break;default:this[key]=value||defaults[key]}this._resources=this.canvas.resources(),this._children=[]}return Drawable.prototype.resources=function(){return this._resources},Drawable.prototype.snapBBox=function(){return this._scale.getBBox(!0)},Drawable.prototype.create=function(options){var drawable;return drawable=new Drawable(this.canvas,options),drawable.attachTo(this._scale),drawable.parentDrawable=this,this._children.push(drawable),drawable},Drawable.prototype.remove=function(){return this._translateRotate.remove()},Drawable.prototype.attachTo=function(snapElement){return this._translateRotate=snapElement.group().addClass("-translate"),this._scale=this._translateRotate.group().addClass("-scale"),this._translateRotate.attr({id:this.id,bismarck:"drawable"}),this._currentBBox=this.snapBBox(),this.snapElement=this._translateRotate},Drawable.prototype.forceSize=function(w,h){var me;return this._forcedSize&&this._forcedSize.remove(),this._forcedDims={w:w,h:h},this._forcedSize=this._translateRotate.rect(0,0,w,h).attr({fill:"rgba(0,0,0,0)"}),me=this._forcedSize.node,this._translateRotate.node.insertBefore(me,this._translateRotate.node.childNodes[0])},Drawable.prototype.useExisting=function(_translateRotate){var childNodes,currentNode;if(this._translateRotate=_translateRotate,!this._translateRotate.attr("bismarck"))throw"Not a Bismarck element!";for(childNodes=this._translateRotate.node.childNodes,this._scale=Snap(childNodes[0]),childNodes[1]&&(this.centerPointCross=Snap(childNodes[1])),currentNode=this._translateRotate.node.parentNode;currentNode;)switch(currentNode.getAttribute("bismarck")){case"drawable":this.parentDrawable=new Drawable(this.canvas,{}),this.parentDrawable.useExisting(Snap(currentNode)),currentNode=null;break;case"canvas":currentNode=null;break;default:currentNode="svg"===currentNode.nodeName?null:currentNode.parentNode}return angular.extend(this,this._translateRotate.data("settings"))},Drawable.prototype.showCenterPoint=function(){return this.centerPointCross=this._translateRotate.group(),this.centerPointCross.line(0,-5,0,5).attr({stroke:"black"}),this.centerPointCross.line(-5,0,5,0).attr({stroke:"black"}),this.recalc()},Drawable.prototype.moveTo=function(x,y){return this.position={x:x,y:y},this.recalc()},Drawable.prototype.rotateTo=function(angle){return this.angle=angle,this.recalc()},Drawable.prototype.scaleTo=function(scale){return this.scale=scale,this.recalc()},Drawable.prototype.alignTo=function(){var args,how,object;switch(object=arguments[0],how=arguments[1],args=3<=arguments.length?__slice.call(arguments,2):[],null==how&&(how="center"),how){case"center":return this.moveTo.apply(this,[object.position.x,object.position.y].concat(__slice.call(args)));case"horizontal":return this.moveTo.apply(this,[this.position.x,object.position.y].concat(__slice.call(args)));case"vertical":return this.moveTo.apply(this,[object.position.x,this.position.y].concat(__slice.call(args)))}},Drawable.prototype.centerInParent=function(){return this._centerInParent=!0,this.setCenterPoint("center"),this.recalc(!0)},Drawable.prototype.recalc=function(down){var child,matrix,offset,parent,upperLeft,_i,_len,_ref,_results;if(null==down&&(down=!1),Animate._animationsEnabled){if(this._centerInParent&&(parent=this.parentDrawable.getDimensions(),this.position={x:parent.w/2,y:parent.h/2}),this.oldScale!==this.scale&&(matrix=new Snap.Matrix,matrix.scale(this.scale),this._scale.transform(matrix),this.oldScale=this.scale),offset=this.getOffset(),upperLeft=this.upperLeft(),null!=this.centerPointCross&&(matrix=new Snap.Matrix,matrix.translate(offset.x+upperLeft.x,offset.y+upperLeft.y),this.centerPointCross.transform(matrix)),matrix=new Snap.Matrix,matrix.translate(this.position.x,this.position.y),matrix.rotate(this.angle,0,0),this._forcedSize||matrix.translate(-offset.x-upperLeft.x,-offset.y-upperLeft.y),this._translateRotate.transform(matrix),down){for(_ref=this._children,_results=[],_i=0,_len=_ref.length;_len>_i;_i++)child=_ref[_i],_results.push(child.recalc(!0));return _results}if(null!=this.parentDrawable)return this.parentDrawable.recalc()}},Drawable.prototype.moveForward=function(){var i,l,me,parent,_i,_results;for(me=this._translateRotate.node,parent=me.parentNode,l=parent.childNodes.length-1,_results=[],i=_i=0;l>=0?l>=_i:_i>=l;i=l>=0?++_i:--_i)_results.push(parent.childNodes[i]===me&&l>i?parent.insertBefore(parent.childNodes[i+1],me):void 0);return _results},Drawable.prototype.moveBackward=function(){var i,me,parent,_i,_ref,_results;for(me=this._translateRotate.node,parent=me.parentNode,_results=[],i=_i=0,_ref=parent.childNodes.length;_ref>=0?_ref>=_i:_i>=_ref;i=_ref>=0?++_i:--_i)_results.push(parent.childNodes[i]===me&&i>0?parent.insertBefore(me,parent.childNodes[i-1]):void 0);return _results},Drawable.prototype.moveToFront=function(){var me;return me=this._translateRotate.node,me.parent.appendChild(me)},Drawable.prototype.moveToBack=function(){var me;return me=this._translateRotate.node,me.parent.insertBefore(me,me.parent.childNodes[0])},Drawable.prototype.on=function(){var args,code,event,target,targetSelector;return event=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],code=args.pop(),targetSelector=args.shift(),target=this._translateRotate,null!=targetSelector&&(target=target.select(targetSelector)),target[event](code)},Drawable.prototype.draw=function(code){return code(this._scale),this.recalc(),this._currentBBox=this.snapBBox()},Drawable.prototype.scaleAndRotateCoords=function(coords){var cos,newH,newW,pairs,rad2ang,radianAngle,sin;return pairs=null!=coords.w?["w","h"]:["x","y"],coords[pairs[0]]*=this.scale,coords[pairs[1]]*=this.scale,rad2ang=Math.PI/180,radianAngle=rad2ang*this.angle,cos=Math.cos(radianAngle),sin=Math.sin(radianAngle),newW=coords[pairs[0]]*cos+coords[pairs[1]]*sin,newH=coords[pairs[1]]*cos+coords[pairs[0]]*sin,coords[pairs[0]]=newW,coords[pairs[1]]=newh,coords},Drawable.prototype.getOffset=function(){var coordPart,output,source,_i,_len,_ref;for(output={},source=this._children.length>0?this.getDimensions():this._currentBBox,_ref=this.centerPoint,_i=0,_len=_ref.length;_len>_i;_i++)coordPart=_ref[_i],output[coordPart.which]=coordPart.convert(source[coordPart.dim]);return output},Drawable.prototype.upperLeft=function(){var child,furthestUpperLeft,offset,_i,_len,_ref;if(0===this._children.length)return{x:0,y:0};for(furthestUpperLeft={x:null,y:null},_ref=this._children,_i=0,_len=_ref.length;_len>_i;_i++)child=_ref[_i],offset=child.getOffset(),offset.x=-offset.x+child.position.x,offset.y=-offset.y+child.position.y,furthestUpperLeft.x?(furthestUpperLeft.x=Math.min(furthestUpperLeft.x,offset.x),furthestUpperLeft.y=Math.min(furthestUpperLeft.y,offset.y)):(furthestUpperLeft.x=offset.x,furthestUpperLeft.y=offset.y);return furthestUpperLeft},Drawable.prototype.setCenterPoint=function(){var args,coordMap,data;return args=1<=arguments.length?__slice.call(arguments,0):[],1===args.length&&(args=function(){switch(args[0]){case"center":return["50%","50%"];case"northwest":return[0,0]}}()),this.coordinates={},data=[{index:0,which:"x",dim:"w"},{index:1,which:"y",dim:"h"}],coordMap=function(datum){var percent;return datum.value=args[datum.index],null!=datum.value.substr&&"%"===datum.value.substr(-1)?(percent=Number(datum.value.slice(0,-1))/100,datum.convert=function(value){return value*percent}):datum.convert=function(){return datum.value},datum},this.centerPoint=data.map(coordMap)},Drawable.prototype.getDimensions=function(){return this._forcedDims?this._forcedDims:this._children.length>0?this.getDimensionsWithChildren():this._currentBBox},Drawable.prototype.getDimensionsWithChildren=function(){var bbox,child,childBBox,childOffset,_i,_len,_ref;for(bbox={sx:null,sy:null,ex:null,ey:null},_ref=this._children,_i=0,_len=_ref.length;_len>_i;_i++)child=_ref[_i],childBBox=child.getDimensions(),childOffset=child.getOffset(),childBBox.x=child.position.x-childOffset.x,childBBox.y=child.position.y-childOffset.y,null===bbox.sx?(bbox.sx=childBBox.x,bbox.sy=childBBox.y,bbox.ex=childBBox.x+childBBox.w,bbox.ey=childBBox.y+childBBox.h):(bbox.sx=Math.min(bbox.sx,childBBox.x),bbox.sy=Math.min(bbox.sy,childBBox.y),bbox.ex=Math.max(bbox.ex,childBBox.x+childBBox.w),bbox.ey=Math.max(bbox.ey,childBBox.y+childBBox.h));return{w:bbox.ex-bbox.sx,h:bbox.ey-bbox.sy}},Drawable.prototype.append=function(drawable){return this._translateRotate.append(drawable._scaleRotate)},Drawable}(),module.exports=Drawable},{"./animate":67}],70:[function(require,module){var dive,oneOrMore,parseString,svgObjs,xml2js,_,__hasProp={}.hasOwnProperty;xml2js=require("xml2js"),parseString=require("xml2js").parseString,_=require("underscore"),svgObjs={rect:function(options,canvas){var rect;return rect=canvas.rect(options.x,options.y,options.width,options.height),rect.attr(_.omit(options,"x","y","width","height")),rect}},oneOrMore=function(value,code){var node,_i,_len,_results;if(null!=value.push){for(_results=[],_i=0,_len=value.length;_len>_i;_i++)node=value[_i],_results.push(code(node));return _results}return code(value)},dive=function(node,drawable,topLevel){var key,value;null==topLevel&&(topLevel=null);for(key in node)if(__hasProp.call(node,key))switch(value=node[key],key){case"drawable":oneOrMore(value,function(v){var childDrawable;return childDrawable=drawable.create(v.$),topLevel||(topLevel=childDrawable),dive(v,childDrawable,topLevel)});break;case"$":break;default:oneOrMore(value,function(v){return drawable.draw(function(svg){return svgObjs[key](v.$,svg)}),dive(v,drawable,topLevel)})}return topLevel},module.exports=function(xml,canvas,callback){return null==callback&&(callback=null),parseString(xml,function(err,result){var diveResult;if(null!=err)throw err;return diveResult=dive(result,canvas),callback?callback(diveResult):void 0})}},{underscore:22,xml2js:25}],71:[function(require,module){var Resources,__slice=[].slice;Resources=function(){function Resources(canvas){this.canvas=canvas,this.resources={},this.bboxes={}}return Resources.prototype.attachTo=function(snapElement){return this.resourceGroup=snapElement.group().attr({display:"none"})},Resources.prototype.copyIDsFrom=function(){var id,ids,node,snapElement,_i,_len,_results;for(snapElement=arguments[0],ids=2<=arguments.length?__slice.call(arguments,1):[],_results=[],_i=0,_len=ids.length;_len>_i;_i++)id=ids[_i],node=snapElement.select("#"+id),node.transform(""),this.resourceGroup.append(node),_results.push(this.resources[id]=node);return _results},Resources.prototype.clone=function(id){return this.resources[id].use()},Resources.prototype.copy=function(id){return this.resources[id].clone()},Resources.prototype.bbox=function(id){var _base;return(_base=this.bboxes)[id]||(_base[id]=this.resources[id].getBBox())},Resources}(),module.exports=Resources},{}]},{},[66]);