From 96bfcec2ea133920db1a6553e8bae2f5f1e8f101 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 24 Sep 2013 13:24:35 -0700 Subject: [PATCH] Add sender to muc messages --- clientapp/libraries/stanza.io.js | 6 ++-- clientapp/models/me.js | 1 - clientapp/models/message.js | 16 +++++++++++ clientapp/pages/groupchat.js | 6 ++-- clientapp/templates.js | 2 +- clientapp/templates/includes/mucMessage.jade | 5 ++++ clientapp/views/mucMessage.js | 29 ++++++++++++++++++++ public/css/app/chat.styl | 3 ++ public/css/otalk.css | 3 ++ 9 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 clientapp/templates/includes/mucMessage.jade create mode 100644 clientapp/views/mucMessage.js diff --git a/clientapp/libraries/stanza.io.js b/clientapp/libraries/stanza.io.js index fa73809..352948a 100644 --- a/clientapp/libraries/stanza.io.js +++ b/clientapp/libraries/stanza.io.js @@ -3,6 +3,6 @@ i.prototype.resultReply=function(t){return t.to=this.from,t.id=this.id,t.type="r for(o.sort(),a.sort(),i=o.length-1;i>=0;i--)if(o[i]!=a[i])return!1;for(i=o.length-1;i>=0;i--)if(r=o[i],!s(t[r],e[r]))return!1;return!0}function l(t,e){return t&&e?e instanceof RegExp?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function p(t,e,n,r){var i;"string"==typeof n&&(r=n,n=null);try{e()}catch(a){i=a}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&o("Missing expected exception"+r),!t&&l(i,n)&&o("Got unwanted exception"+r),t&&i&&n&&!l(i,n)||!t&&i)throw i}var h=t("util"),d=t("buffer").Buffer,m=Array.prototype.slice,g=e.exports=a;g.AssertionError=function(t){this.name="AssertionError",this.message=t.message,this.actual=t.actual,this.expected=t.expected,this.operator=t.operator;var e=t.stackStartFunction||o;Error.captureStackTrace&&Error.captureStackTrace(this,e)},h.inherits(g.AssertionError,Error),g.AssertionError.prototype.toString=function(){return this.message?[this.name+":",this.message].join(" "):[this.name+":",i(JSON.stringify(this.actual,r),128),this.operator,i(JSON.stringify(this.expected,r),128)].join(" ")},g.fail=o,g.ok=a,g.equal=function(t,e,n){t!=e&&o(t,e,n,"==",g.equal)},g.notEqual=function(t,e,n){t==e&&o(t,e,n,"!=",g.notEqual)},g.deepEqual=function(t,e,n){s(t,e)||o(t,e,n,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,n){s(t,e)&&o(t,e,n,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,n){t!==e&&o(t,e,n,"===",g.strictEqual)},g.notStrictEqual=function(t,e,n){t===e&&o(t,e,n,"!==",g.notStrictEqual)},g.throws=function(){p.apply(this,[!0].concat(m.call(arguments)))},g.doesNotThrow=function(){p.apply(this,[!1].concat(m.call(arguments)))},g.ifError=function(t){if(t)throw t}},{buffer:61,util:59}],58:[function(t,e,n){function r(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;ni;i++)r[i].apply(this,n);return!0}return!1},o.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",t,e),this._events[t])if(a(this._events[t])){if(!this._events[t].warned){var n;n=void 0!==this._events.maxListeners?this._events.maxListeners:s,n&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}this._events[t].push(e)}else this._events[t]=[this._events[t],e];else this._events[t]=e;return this},o.prototype.on=o.prototype.addListener,o.prototype.once=function(t,e){var n=this;return n.on(t,function r(){n.removeListener(t,r),e.apply(this,arguments)}),this},o.prototype.removeListener=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var n=this._events[t];if(a(n)){var i=r(n,e);if(0>i)return this;n.splice(i,1),0==n.length&&delete this._events[t]}else this._events[t]===e&&delete this._events[t];return this},o.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},o.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),a(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]},o.listenerCount=function(t,e){var n;return n=t._events&&t._events[e]?"function"==typeof t._events[e]?1:t._events[e].length:0}},{__browserify_process:69}],59:[function(t,e,n){function r(t){return Array.isArray(t)||"object"==typeof t&&"[object Array]"===Object.prototype.toString.call(t)}function i(t){"object"==typeof t&&"[object RegExp]"===Object.prototype.toString.call(t)}function o(t){return"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}t("events"),n.isArray=r,n.isDate=function(t){return"[object Date]"===Object.prototype.toString.call(t)},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},n.print=function(){},n.puts=function(){},n.debug=function(){},n.inspect=function(t,e,u,c){function f(t,u){if(t&&"function"==typeof t.inspect&&t!==n&&(!t.constructor||t.constructor.prototype!==t))return t.inspect(u);switch(typeof t){case"undefined":return p("undefined","undefined");case"string":var c="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p(c,"string");case"number":return p(""+t,"number");case"boolean":return p(""+t,"boolean")}if(null===t)return p("null","null");var h=a(t),d=e?s(t):h;if("function"==typeof t&&0===d.length){if(i(t))return p(""+t,"regexp");var m=t.name?": "+t.name:"";return p("[Function"+m+"]","special")}if(o(t)&&0===d.length)return p(t.toUTCString(),"date");var g,v,y;if(r(t)?(v="Array",y=["[","]"]):(v="Object",y=["{","}"]),"function"==typeof t){var b=t.name?": "+t.name:"";g=i(t)?" "+t:" [Function"+b+"]"}else g="";if(o(t)&&(g=" "+t.toUTCString()),0===d.length)return y[0]+g+y[1];if(0>u)return i(t)?p(""+t,"regexp"):p("[Object]","special");l.push(t);var x=d.map(function(e){var n,i;if(t.__lookupGetter__&&(t.__lookupGetter__(e)?i=t.__lookupSetter__(e)?p("[Getter/Setter]","special"):p("[Getter]","special"):t.__lookupSetter__(e)&&(i=p("[Setter]","special"))),h.indexOf(e)<0&&(n="["+e+"]"),i||(l.indexOf(t[e])<0?(i=null===u?f(t[e]):f(t[e],u-1),i.indexOf("\n")>-1&&(i=r(t)?i.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+i.split("\n").map(function(t){return" "+t}).join("\n"))):i=p("[Circular]","special")),"undefined"==typeof n){if("Array"===v&&e.match(/^\d+$/))return i;n=JSON.stringify(""+e),n.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=p(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=p(n,"string"))}return n+": "+i});l.pop();var w=0,_=x.reduce(function(t,e){return w++,e.indexOf("\n")>=0&&w++,t+e.length+1},0);return x=_>50?y[0]+(""===g?"":g+"\n ")+" "+x.join(",\n ")+" "+y[1]:y[0]+g+" "+x.join(", ")+" "+y[1]}var l=[],p=function(t,e){var n={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r={special:"cyan",number:"blue","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"}[e];return r?"["+n[r][0]+"m"+t+"["+n[r][1]+"m":t};return c||(p=function(t){return t}),f(t,"undefined"==typeof u?2:u)},n.log=function(){},n.pump=null;var a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e},s=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.hasOwnProperty.call(t,n)&&e.push(n);return e},u=Object.create||function(t,e){var n;if(null===t)n={__proto__:null};else{if("object"!=typeof t)throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var r=function(){};r.prototype=t,n=new r,n.__proto__=t}return"undefined"!=typeof e&&Object.defineProperties&&Object.defineProperties(n,e),n};n.inherits=function(t,e){t.super_=e,t.prototype=u(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})};var c=/%[sdj%]/g;n.format=function(t){if("string"!=typeof t){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":return JSON.stringify(i[r++]);default:return t}}),s=i[r];o>r;s=i[++r])a+=null===s||"object"!=typeof s?" "+s:" "+n.inspect(s);return a}},{events:58}],60:[function(t,e,n){n.readIEEE754=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,f=-7,l=n?0:i-1,p=n?1:-1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},n.writeIEEE754=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?o-1:0,d=r?-1:1,m=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+l>=1?p/u:p*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<0;t[n+h]=255&a,h+=d,a/=256,c-=8);t[n+h-d]|=128*m}},{}],61:[function(t,e,n){function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);this.parent=this,this.offset=0;var o;if("number"==typeof n)this.length=i(e),this.offset=n;else{switch(o=typeof t){case"number":this.length=i(t);break;case"string":this.length=r.byteLength(t,e);break;case"object":this.length=i(t.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(a(t))for(var s=0;st?0:t}function o(t){return(Array.isArray||function(t){return"[object Array]"=={}.toString.apply(t)})(t)}function a(t){return o(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function s(t){return 16>t?"0"+t.toString(16):t.toString(16)}function u(t){for(var e=[],n=0;ni&&!(i+n>=e.length||i>=t.length);)e[i+n]=t[i],i++;return i}function p(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function h(t,e,n,r){var i=0;return r||(I.ok("boolean"==typeof n,"missing or invalid endian"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e+1=t.length?0:(n?(i=t[e]<<8,e+1=t.length?0:(n?(e+1>>0):(e+2>>0)),i)}function m(t,e,n,r){var i,o;return r||(I.ok("boolean"==typeof n,"missing or invalid endian"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e+1=0,"specified a negative value for writing an unsigned value"),I.ok(e>=t,"value is larger than maximum value for type"),I.ok(Math.floor(t)===t,"value has a fractional component")}function x(t,e,n,r,i){i||(I.ok(void 0!==e&&null!==e,"missing value"),I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(void 0!==n&&null!==n,"missing offset"),I.ok(n+1>>8*(r?1-o:o)}function w(t,e,n,r,i){i||(I.ok(void 0!==e&&null!==e,"missing value"),I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(void 0!==n&&null!==n,"missing offset"),I.ok(n+3>>8*(r?3-o:o)}function _(t,e,n){I.ok("number"==typeof t,"cannot write a non-number as a number"),I.ok(e>=t,"value larger than maximum allowed value"),I.ok(t>=n,"value smaller than minimum allowed value"),I.ok(Math.floor(t)===t,"value has a fractional component")}function E(t,e,n){I.ok("number"==typeof t,"cannot write a non-number as a number"),I.ok(e>=t,"value larger than maximum allowed value"),I.ok(t>=n,"value smaller than minimum allowed value")}function S(t,e,n,r,i){i||(I.ok(void 0!==e&&null!==e,"missing value"),I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(void 0!==n&&null!==n,"missing offset"),I.ok(n+1=0?x(t,e,n,r,i):x(t,65535+e+1,n,r,i)}function j(t,e,n,r,i){i||(I.ok(void 0!==e&&null!==e,"missing value"),I.ok("boolean"==typeof r,"missing or invalid endian"),I.ok(void 0!==n&&null!==n,"missing offset"),I.ok(n+3=0?w(t,e,n,r,i):w(t,4294967295+e+1,n,r,i)}function k(e,n,r,i,o){o||(I.ok(void 0!==n&&null!==n,"missing value"),I.ok("boolean"==typeof i,"missing or invalid endian"),I.ok(void 0!==r&&null!==r,"missing offset"),I.ok(r+3t||t>=this.length)throw new Error("oob");return this[t]},r.prototype.set=function(t,e){if(0>t||t>=this.length)throw new Error("oob");return this[t]=e},r.byteLength=function(t,e){switch(e||"utf8"){case"hex":return t.length/2;case"utf8":case"utf-8":return u(t).length;case"ascii":case"binary":return t.length;case"base64":return f(t).length;default:throw new Error("Unknown encoding")}},r.prototype.utf8Write=function(t,e,n){return r._charsWritten=l(u(t),this,e,n)},r.prototype.asciiWrite=function(t,e,n){return r._charsWritten=l(c(t),this,e,n)},r.prototype.binaryWrite=r.prototype.asciiWrite,r.prototype.base64Write=function(t,e,n){return r._charsWritten=l(f(t),this,e,n)},r.prototype.base64Slice=function(){var e=Array.prototype.slice.apply(this,arguments);return t("base64-js").fromByteArray(e)},r.prototype.utf8Slice=function(){for(var t=Array.prototype.slice.apply(this,arguments),e="",n="",r=0;rr;r++)if(t[r]=s(this[r]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return""},r.prototype.hexSlice=function(t,e){var n=this.length;(!t||0>t)&&(t=0),(!e||0>e||e>n)&&(e=n);for(var r="",i=t;e>i;i++)r+=s(this[i]);return r},r.prototype.toString=function(t,e,n){if(t=String(t||"utf8").toLowerCase(),e=+e||0,"undefined"==typeof n&&(n=this.length),+n==e)return"";switch(t){case"hex":return this.hexSlice(e,n);case"utf8":case"utf-8":return this.utf8Slice(e,n);case"ascii":return this.asciiSlice(e,n);case"binary":return this.binarySlice(e,n);case"base64":return this.base64Slice(e,n);case"ucs2":case"ucs-2":return this.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},r.prototype.hexWrite=function(t,e,n){e=+e||0;var i=this.length-e;n?(n=+n,n>i&&(n=i)):n=i;var o=t.length;if(o%2)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;n>a;a++){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");this[e+a]=s}return r._charsWritten=2*a,a},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var i=r;r=e,e=n,n=i}e=+e||0;var o=this.length-e;switch(n?(n=+n,n>o&&(n=o)):n=o,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(t,e,n);case"utf8":case"utf-8":return this.utf8Write(t,e,n);case"ascii":return this.asciiWrite(t,e,n);case"binary":return this.binaryWrite(t,e,n);case"base64":return this.base64Write(t,e,n);case"ucs2":case"ucs-2":return this.ucs2Write(t,e,n);default:throw new Error("Unknown encoding")}},r.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new r(this,e-t,+t)},r.prototype.copy=function(t,e,n,r){var i=this;if(n||(n=0),(void 0===r||isNaN(r))&&(r=this.length),e||(e=0),n>r)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==t.length||0==i.length)return 0;if(0>e||e>=t.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-ea;a++)I.ok("undefined"!=typeof this[a],"copying undefined buffer bytes!"),o.push(this[a]);for(var a=e;an)throw new Error("end < start");if(n===e)return 0;if(0==this.length)return 0;if(0>e||e>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");for(var r=e;n>r;r++)this[r]=t},r.isBuffer=function(t){return t instanceof r||t instanceof r},r.concat=function(t,e){if(!o(t))throw new Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===t.length)return new r(0);if(1===t.length)return t[0];if("number"!=typeof e){e=0;for(var n=0;n=n.length?void 0:n[t]},r.prototype.readUInt16LE=function(t,e){return h(this,t,!1,e)},r.prototype.readUInt16BE=function(t,e){return h(this,t,!0,e)},r.prototype.readUInt32LE=function(t,e){return d(this,t,!1,e)},r.prototype.readUInt32BE=function(t,e){return d(this,t,!0,e)},r.prototype.readInt8=function(t,e){var n,r=this;return e||(I.ok(void 0!==t&&null!==t,"missing offset"),I.ok(t=r.length?void 0:(n=128&r[t],n?-1*(255-r[t]+1):r[t])},r.prototype.readInt16LE=function(t,e){return m(this,t,!1,e)},r.prototype.readInt16BE=function(t,e){return m(this,t,!0,e)},r.prototype.readInt32LE=function(t,e){return g(this,t,!1,e)},r.prototype.readInt32BE=function(t,e){return g(this,t,!0,e)},r.prototype.readFloatLE=function(t,e){return v(this,t,!1,e)},r.prototype.readFloatBE=function(t,e){return v(this,t,!0,e)},r.prototype.readDoubleLE=function(t,e){return y(this,t,!1,e)},r.prototype.readDoubleBE=function(t,e){return y(this,t,!0,e)},r.prototype.writeUInt8=function(t,e,n){var r=this;n||(I.ok(void 0!==t&&null!==t,"missing value"),I.ok(void 0!==e&&null!==e,"missing offset"),I.ok(e=0?r.writeUInt8(t,e,n):r.writeUInt8(255+t+1,e,n)},r.prototype.writeInt16LE=function(t,e,n){S(this,t,e,!1,n)},r.prototype.writeInt16BE=function(t,e,n){S(this,t,e,!0,n)},r.prototype.writeInt32LE=function(t,e,n){j(this,t,e,!1,n)},r.prototype.writeInt32BE=function(t,e,n){j(this,t,e,!0,n)},r.prototype.writeFloatLE=function(t,e,n){k(this,t,e,!1,n)},r.prototype.writeFloatBE=function(t,e,n){k(this,t,e,!0,n)},r.prototype.writeDoubleLE=function(t,e,n){A(this,t,e,!1,n)},r.prototype.writeDoubleBE=function(t,e,n){A(this,t,e,!0,n)}},{"./buffer_ieee754":60,assert:57,"base64-js":62}],62:[function(t,e){!function(){"use strict";function t(t){var e,n,i,o,a,s;if(t.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(a=t.indexOf("="),a=a>0?t.length-a:0,s=[],i=a>0?t.length-4:t.length,e=0,n=0;i>e;e+=4,n+=3)o=r.indexOf(t[e])<<18|r.indexOf(t[e+1])<<12|r.indexOf(t[e+2])<<6|r.indexOf(t[e+3]),s.push((16711680&o)>>16),s.push((65280&o)>>8),s.push(255&o);return 2===a?(o=r.indexOf(t[e])<<2|r.indexOf(t[e+1])>>4,s.push(255&o)):1===a&&(o=r.indexOf(t[e])<<10|r.indexOf(t[e+1])<<4|r.indexOf(t[e+2])>>2,s.push(255&o>>8),s.push(255&o)),s}function n(t){function e(t){return r[63&t>>18]+r[63&t>>12]+r[63&t>>6]+r[63&t]}var n,i,o,a=t.length%3,s="";for(n=0,o=t.length-a;o>n;n+=3)i=(t[n]<<16)+(t[n+1]<<8)+t[n+2],s+=e(i);switch(a){case 1:i=t[t.length-1],s+=r[i>>2],s+=r[63&i<<4],s+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],s+=r[i>>10],s+=r[63&i>>4],s+=r[63&i<<2],s+="="}return s}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports.toByteArray=t,e.exports.fromByteArray=n}()},{}],63:[function(t,e,n){function r(){var t=[].slice.call(arguments).join(" ");throw new Error([t,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function i(t,e){for(var n in t)e(t[n],n)}var o=t("buffer").Buffer,a=t("./sha"),s=t("./sha256"),u=t("./rng"),c=t("./md5"),f={sha1:{hex:a.hex_sha1,base64:a.b64_sha1,binary:a.str_sha1},sha256:{hex:s.hex_sha256,base64:s.b64_sha256,binary:s.str_sha256},md5:{hex:c.hex_md5,base64:c.b64_md5,binary:c.bin_md5}},l={sha1:{hex:a.hex_hmac_sha1,base64:a.b64_hmac_sha1,binary:a.str_hmac_sha1},sha256:{hex:s.hex_hmac_sha256,base64:s.b64_hmac_sha256,binary:s.str_hmac_sha256},md5:{hex:c.hex_hmac_md5,base64:c.b64_hmac_md5,binary:c.bin_hmac_md5}};n.createHash=function(t){t=t||"sha1",f[t]||r("algorithm:",t,"is not yet supported");var e="",n=f[t];return{update:function(t){return e+=t,this},digest:function(i){i=i||"binary";var o;(o=n[i])||r("encoding:",i,"is not yet supported for algorithm",t);var a=o(e);return e=null,a}}},n.createHmac=function(t,e){l[t]||r("algorithm:",t,"is not yet supported"),"string"!=typeof e&&(e=e.toString("binary"));var n="",i=l[t];return{update:function(t){return n+=t,this},digest:function(o){o=o||"binary";var a;(a=i[o])||r("encoding:",o,"is not yet support for algorithm",t);var s=a(e,n);return n=null,s}}},n.randomBytes=function(t,e){if(!e||!e.call)return new o(u(t));try{e.call(this,void 0,new o(u(t)))}catch(n){e(n)}},i(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(t){n[t]=function(){r("sorry,",t,"is not implemented yet")}})},{"./md5":64,"./rng":65,"./sha":66,"./sha256":67,buffer:61}],64:[function(t,e,n){function r(t){return x(c(y(t),t.length*S))}function i(t){return w(c(y(t),t.length*S))}function o(t){return b(c(y(t),t.length*S))}function a(t,e){return x(m(t,e))}function s(t,e){return w(m(t,e))}function u(t,e){return b(m(t,e))}function c(t,e){t[e>>5]|=128<>>9<<4)+14]=e;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,a=0;a16&&(n=c(n,t.length*S));for(var r=Array(16),i=Array(16),o=0;16>o;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=c(r.concat(y(e)),512+e.length*S);return c(i.concat(a),640)}function g(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function v(t,e){return t<>>32-e}function y(t){for(var e=Array(),n=(1<>5]|=(t.charCodeAt(r/S)&n)<>5]>>>r%32&n);return e}function x(t){for(var e=_?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(15&t[r>>2]>>8*(r%4)+4)+e.charAt(15&t[r>>2]>>8*(r%4));return n}function w(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="",r=0;r<4*t.length;r+=3)for(var i=(255&t[r>>2]>>8*(r%4))<<16|(255&t[r+1>>2]>>8*((r+1)%4))<<8|255&t[r+2>>2]>>8*((r+2)%4),o=0;4>o;o++)n+=8*r+6*o>32*t.length?E:e.charAt(63&i>>6*(3-o));return n}var _=0,E="=",S=8;n.hex_md5=r,n.b64_md5=i,n.bin_md5=o,n.hex_hmac_md5=a,n.b64_hmac_md5=s,n.bin_hmac_md5=u},{}],65:[function(t,e){!function(){var t,n,r=this;if(t=function(t){for(var e,e,n=new Array(t),r=0;t>r;r++)0==(3&r)&&(e=4294967296*Math.random()),n[r]=255&e>>>((3&r)<<3);return n},r.crypto&&crypto.getRandomValues){var i=new Uint32Array(4);n=function(t){var e=new Array(t);crypto.getRandomValues(i);for(var n=0;t>n;n++)e[n]=255&i[n>>2]>>>8*(3&n);return e}}e.exports=n||t}()},{}],66:[function(t,e,n){function r(t){return v(c(m(t),t.length*w))}function i(t){return y(c(m(t),t.length*w))}function o(t){return g(c(m(t),t.length*w))}function a(t,e){return v(p(t,e))}function s(t,e){return y(p(t,e))}function u(t,e){return g(p(t,e))}function c(t,e){t[e>>5]|=128<<24-e%32,t[(e+64>>9<<4)+15]=e;for(var n=Array(80),r=1732584193,i=-271733879,o=-1732584194,a=271733878,s=-1009589776,u=0;uy;y++){n[y]=16>y?t[u+y]:d(n[y-3]^n[y-8]^n[y-14]^n[y-16],1);var b=h(h(d(r,5),f(y,i,o,a)),h(h(s,n[y]),l(y)));s=a,a=o,o=d(i,30),i=r,r=b}r=h(r,c),i=h(i,p),o=h(o,m),a=h(a,g),s=h(s,v)}return Array(r,i,o,a,s)}function f(t,e,n,r){return 20>t?e&n|~e&r:40>t?e^n^r:60>t?e&n|e&r|n&r:e^n^r}function l(t){return 20>t?1518500249:40>t?1859775393:60>t?-1894007588:-899497514}function p(t,e){var n=m(t);n.length>16&&(n=c(n,t.length*w));for(var r=Array(16),i=Array(16),o=0;16>o;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=c(r.concat(m(e)),512+e.length*w);return c(i.concat(a),672)}function h(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function d(t,e){return t<>>32-e}function m(t){for(var e=Array(),n=(1<>5]|=(t.charCodeAt(r/w)&n)<<32-w-r%32;return e}function g(t){for(var e="",n=(1<>5]>>>32-w-r%32&n);return e}function v(t){for(var e=b?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(15&t[r>>2]>>8*(3-r%4)+4)+e.charAt(15&t[r>>2]>>8*(3-r%4));return n}function y(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="",r=0;r<4*t.length;r+=3)for(var i=(255&t[r>>2]>>8*(3-r%4))<<16|(255&t[r+1>>2]>>8*(3-(r+1)%4))<<8|255&t[r+2>>2]>>8*(3-(r+2)%4),o=0;4>o;o++)n+=8*r+6*o>32*t.length?x:e.charAt(63&i>>6*(3-o));return n}n.hex_sha1=r,n.b64_sha1=i,n.str_sha1=o,n.hex_hmac_sha1=a,n.b64_hmac_sha1=s,n.str_hmac_sha1=u;var b=0,x="=",w=8},{}],67:[function(t,e,n){function r(t){return E(w(_(t),t.length*l))}function i(t){return S(w(_(t),t.length*l))}function o(t){return c(w(_(t),t.length*l))}function a(t,e){return E(j(t,e))}function s(t,e){return S(j(t,e))}function u(t,e){return c(j(t,e))}function c(t){for(var e="",n=(1<>5]>>>32-l-r%32&n);return e}n.hex_sha256=r,n.b64_sha256=i,n.str_sha256=o,n.hex_hmac_sha256=a,n.b64_hmac_sha256=s,n.str_hmac_sha256=u;var f=0,l=8,p=function(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n},h=function(t,e){return t>>>e|t<<32-e},d=function(t,e){return t>>>e},m=function(t,e,n){return t&e^~t&n},g=function(t,e,n){return t&e^t&n^e&n},v=function(t){return h(t,2)^h(t,13)^h(t,22)},y=function(t){return h(t,6)^h(t,11)^h(t,25)},b=function(t){return h(t,7)^h(t,18)^d(t,3)},x=function(t){return h(t,17)^h(t,19)^d(t,10)},w=function(t,e){var n,r,i,o,a,s,u,c,f,l,h,d,w=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),_=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),E=new Array(64); t[e>>5]|=128<<24-e%32,t[(e+64>>9<<4)+15]=e;for(var f=0;fl;l++)E[l]=16>l?t[l+f]:p(p(p(x(E[l-2]),E[l-7]),b(E[l-15])),E[l-16]),h=p(p(p(p(c,y(a)),m(a,s,u)),w[l]),E[l]),d=p(v(n),g(n,r,i)),c=u,u=s,s=a,a=p(o,h),o=i,i=r,r=n,n=p(h,d);_[0]=p(n,_[0]),_[1]=p(r,_[1]),_[2]=p(i,_[2]),_[3]=p(o,_[3]),_[4]=p(a,_[4]),_[5]=p(s,_[5]),_[6]=p(u,_[6]),_[7]=p(c,_[7])}return _},_=function(t){for(var e=Array(),n=(1<>5]|=(t.charCodeAt(r/l)&n)<<24-r%32;return e},E=function(t){for(var e=f?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(15&t[r>>2]>>8*(3-r%4)+4)+e.charAt(15&t[r>>2]>>8*(3-r%4));return n},S=function(t){var e,n,r,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o="",a=4*t.length,s="=";for(e=0;a>e;e+=3)for(r=(255&t[e>>2]>>8*(3-e%4))<<16|(255&t[e+1>>2]>>8*(3-(e+1)%4))<<8|255&t[e+2>>2]>>8*(3-(e+2)%4),n=0;4>n;n+=1)o+=8*e+6*n<=32*t.length?i.charAt(63&r>>6*(3-n)):s;return o},j=function(t,e){var n=_(t);n.length>16&&(n=w(n,t.length*l));for(var r=Array(16),i=Array(16),o=0;16>o;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var a=w(r.concat(_(e)),512+e.length*l);return w(i.concat(a),768)}},{}],68:[function(t,e){t=function(t,e,n,r){function i(r){if(!n[r]){if(!e[r]){if(t)return t(r);throw new Error("Cannot find module '"+r+"'")}var o=n[r]={exports:{}};e[r][0](function(t){var n=e[r][1][t];return i(n?n:t)},o,o.exports)}return n[r].exports}for(var o=0;o=0;i--)if(o[i]!=a[i])return!1;for(i=o.length-1;i>=0;i--)if(r=o[i],!s(t[r],e[r]))return!1;return!0}function l(t,e){return t&&e?e instanceof RegExp?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function p(t,e,n,r){var i;"string"==typeof n&&(r=n,n=null);try{e()}catch(a){i=a}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&o("Missing expected exception"+r),!t&&l(i,n)&&o("Got unwanted exception"+r),t&&i&&n&&!l(i,n)||!t&&i)throw i}var h=t("util"),d=t("buffer").Buffer,m=Array.prototype.slice,g=e.exports=a;g.AssertionError=function(t){this.name="AssertionError",this.message=t.message,this.actual=t.actual,this.expected=t.expected,this.operator=t.operator;var e=t.stackStartFunction||o;Error.captureStackTrace&&Error.captureStackTrace(this,e)},h.inherits(g.AssertionError,Error),g.AssertionError.prototype.toString=function(){return this.message?[this.name+":",this.message].join(" "):[this.name+":",i(JSON.stringify(this.actual,r),128),this.operator,i(JSON.stringify(this.expected,r),128)].join(" ")},g.AssertionError.__proto__=Error.prototype,g.fail=o,g.ok=a,g.equal=function(t,e,n){t!=e&&o(t,e,n,"==",g.equal)},g.notEqual=function(t,e,n){t==e&&o(t,e,n,"!=",g.notEqual)},g.deepEqual=function(t,e,n){s(t,e)||o(t,e,n,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,n){s(t,e)&&o(t,e,n,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,n){t!==e&&o(t,e,n,"===",g.strictEqual)},g.notStrictEqual=function(t,e,n){t===e&&o(t,e,n,"!==",g.notStrictEqual)},g.throws=function(){p.apply(this,[!0].concat(m.call(arguments)))},g.doesNotThrow=function(){p.apply(this,[!1].concat(m.call(arguments)))},g.ifError=function(t){if(t)throw t}},{util:2,buffer:3}],2:[function(t,e,n){function r(t){return t instanceof Array||Array.isArray(t)||t&&t!==Object.prototype&&r(t.__proto__)}function i(t){return t instanceof RegExp||"object"==typeof t&&"[object RegExp]"===Object.prototype.toString.call(t)}function o(t){if(t instanceof Date)return!0;if("object"!=typeof t)return!1;var e=Date.prototype&&s(Date.prototype),n=t.__proto__&&s(t.__proto__);return JSON.stringify(n)===JSON.stringify(e)}t("events"),n.isArray=r,n.isDate=function(t){return"[object Date]"===Object.prototype.toString.call(t)},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},n.print=function(){},n.puts=function(){},n.debug=function(){},n.inspect=function(t,e,u,c){function f(t,u){if(t&&"function"==typeof t.inspect&&t!==n&&(!t.constructor||t.constructor.prototype!==t))return t.inspect(u);switch(typeof t){case"undefined":return p("undefined","undefined");case"string":var c="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p(c,"string");case"number":return p(""+t,"number");case"boolean":return p(""+t,"boolean")}if(null===t)return p("null","null");var h=a(t),d=e?s(t):h;if("function"==typeof t&&0===d.length){if(i(t))return p(""+t,"regexp");var m=t.name?": "+t.name:"";return p("[Function"+m+"]","special")}if(o(t)&&0===d.length)return p(t.toUTCString(),"date");var g,v,y;if(r(t)?(v="Array",y=["[","]"]):(v="Object",y=["{","}"]),"function"==typeof t){var b=t.name?": "+t.name:"";g=i(t)?" "+t:" [Function"+b+"]"}else g="";if(o(t)&&(g=" "+t.toUTCString()),0===d.length)return y[0]+g+y[1];if(0>u)return i(t)?p(""+t,"regexp"):p("[Object]","special");l.push(t);var x=d.map(function(e){var n,i;if(t.__lookupGetter__&&(t.__lookupGetter__(e)?i=t.__lookupSetter__(e)?p("[Getter/Setter]","special"):p("[Getter]","special"):t.__lookupSetter__(e)&&(i=p("[Setter]","special"))),h.indexOf(e)<0&&(n="["+e+"]"),i||(l.indexOf(t[e])<0?(i=null===u?f(t[e]):f(t[e],u-1),i.indexOf("\n")>-1&&(i=r(t)?i.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+i.split("\n").map(function(t){return" "+t}).join("\n"))):i=p("[Circular]","special")),"undefined"==typeof n){if("Array"===v&&e.match(/^\d+$/))return i;n=JSON.stringify(""+e),n.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=p(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),n=p(n,"string"))}return n+": "+i});l.pop();var w=0,_=x.reduce(function(t,e){return w++,e.indexOf("\n")>=0&&w++,t+e.length+1},0);return x=_>50?y[0]+(""===g?"":g+"\n ")+" "+x.join(",\n ")+" "+y[1]:y[0]+g+" "+x.join(", ")+" "+y[1]}var l=[],p=function(t,e){var n={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r={special:"cyan",number:"blue","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"}[e];return r?"["+n[r][0]+"m"+t+"["+n[r][1]+"m":t};return c||(p=function(t){return t}),f(t,"undefined"==typeof u?2:u)},n.log=function(){},n.pump=null;var a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e},s=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.hasOwnProperty.call(t,n)&&e.push(n);return e},u=Object.create||function(t,e){var n;if(null===t)n={__proto__:null};else{if("object"!=typeof t)throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var r=function(){};r.prototype=t,n=new r,n.__proto__=t}return"undefined"!=typeof e&&Object.defineProperties&&Object.defineProperties(n,e),n};n.inherits=function(t,e){t.super_=e,t.prototype=u(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})};var c=/%[sdj%]/g;n.format=function(t){if("string"!=typeof t){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":return JSON.stringify(i[r++]);default:return t}}),s=i[r];o>r;s=i[++r])a+=null===s||"object"!=typeof s?" "+s:" "+n.inspect(s);return a}},{events:4}],5:[function(t,e,n){n.readIEEE754=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,f=-7,l=n?0:i-1,p=n?1:-1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},n.writeIEEE754=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?o-1:0,d=r?-1:1,m=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+l>=1?p/u:p*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<0;t[n+h]=255&a,h+=d,a/=256,c-=8);t[n+h-d]|=128*m}},{}],6:[function(t,e){var n=e.exports={};n.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){if(t.source===window&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var e=n.shift();e()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e,n){!function(t){function e(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;no;o++)r[o].apply(this,n);return!0}return!1},r.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",t,e),this._events[t])if(i(this._events[t])){if(!this._events[t].warned){var n;n=void 0!==this._events.maxListeners?this._events.maxListeners:o,n&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}this._events[t].push(e)}else this._events[t]=[this._events[t],e];else this._events[t]=e;return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){var n=this;return n.on(t,function r(){n.removeListener(t,r),e.apply(this,arguments)}),this},r.prototype.removeListener=function(t,n){if("function"!=typeof n)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var r=this._events[t];if(i(r)){var o=e(r,n);if(0>o)return this;r.splice(o,1),0==r.length&&delete this._events[t]}else this._events[t]===n&&delete this._events[t];return this},r.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},r.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),i(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]}}(t("__browserify_process"))},{__browserify_process:6}],"buffer-browserify":[function(t,e){e.exports=t("q9TxCC")},{}],q9TxCC:[function(t,e,n){function r(t){this.length=t}function i(t){return 16>t?"0"+t.toString(16):t.toString(16)}function o(t){for(var e=[],n=0;ni&&!(i+n>=e.length||i>=t.length);)e[i+n]=t[i],i++;return i}function c(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function f(t){return t=~~Math.ceil(+t),0>t?0:t}function l(t,e,n){if(!(this instanceof l))return new l(t,e,n);var i;if("number"==typeof n)this.length=f(e),this.parent=t,this.offset=n;else{switch(i=typeof t){case"number":this.length=f(t);break;case"string":this.length=l.byteLength(t,e);break;case"object":this.length=f(t.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(this.length>l.poolSize?(this.parent=new r(this.length),this.offset=0):((!N||N.length-N.used=t.length?0:(n?(i=t.parent[t.offset+e]<<8,e+1=t.length?0:(n?(e+1>>0):(e+2>>0)),i)}function g(t,e,n,r){var i,o;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+1=0,"specified a negative value for writing an unsigned value"),C.ok(e>=t,"value is larger than maximum value for type"),C.ok(Math.floor(t)===t,"value has a fractional component")}function w(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+1>>8*(r?1-o:o)}function _(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+3>>8*(r?3-o:o)}function E(t,e,n){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(e>=t,"value larger than maximum allowed value"),C.ok(t>=n,"value smaller than minimum allowed value"),C.ok(Math.floor(t)===t,"value has a fractional component")}function S(t,e,n){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(e>=t,"value larger than maximum allowed value"),C.ok(t>=n,"value smaller than minimum allowed value")}function j(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+1=0?w(t,e,n,r,i):w(t,65535+e+1,n,r,i)}function k(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+3=0?_(t,e,n,r,i):_(t,4294967295+e+1,n,r,i)}function A(e,n,r,i,o){o||(C.ok(void 0!==n&&null!==n,"missing value"),C.ok("boolean"==typeof i,"missing or invalid endian"),C.ok(void 0!==r&&null!==r,"missing offset"),C.ok(r+3r;r++)if(t[r]=i(this[r]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return""},r.prototype.hexSlice=function(t,e){var n=this.length;(!t||0>t)&&(t=0),(!e||0>e||e>n)&&(e=n);for(var r="",o=t;e>o;o++)r+=i(this[o]);return r},r.prototype.toString=function(t,e,n){if(t=String(t||"utf8").toLowerCase(),e=+e||0,"undefined"==typeof n&&(n=this.length),+n==e)return"";switch(t){case"hex":return this.hexSlice(e,n);case"utf8":case"utf-8":return this.utf8Slice(e,n);case"ascii":return this.asciiSlice(e,n);case"binary":return this.binarySlice(e,n);case"base64":return this.base64Slice(e,n);case"ucs2":case"ucs-2":return this.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},r.prototype.hexWrite=function(t,e,n){e=+e||0;var i=this.length-e;n?(n=+n,n>i&&(n=i)):n=i;var o=t.length;if(o%2)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;n>a;a++){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");this[e+a]=s}return r._charsWritten=2*a,a},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var i=r;r=e,e=n,n=i}e=+e||0;var o=this.length-e;switch(n?(n=+n,n>o&&(n=o)):n=o,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(t,e,n);case"utf8":case"utf-8":return this.utf8Write(t,e,n);case"ascii":return this.asciiWrite(t,e,n);case"binary":return this.binaryWrite(t,e,n);case"base64":return this.base64Write(t,e,n);case"ucs2":case"ucs-2":return this.ucs2Write(t,e,n);default:throw new Error("Unknown encoding")}},r.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new l(this,e-t,+t)},r.prototype.copy=function(t,e,n,r){for(var i=[],o=n;r>o;o++)C.ok("undefined"!=typeof this[o],"copying undefined buffer bytes!"),i.push(this[o]);for(var o=e;othis.length)throw new Error("oob");if(e>n)throw new Error("oob");for(var r=e;n>r;r++)this[r]=t},n.SlowBuffer=r,n.Buffer=l,l.poolSize=8192;var N;l.isBuffer=function(t){return t instanceof l||t instanceof r},l.concat=function(t,e){if(!Array.isArray(t))throw new Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===t.length)return new l(0);if(1===t.length)return t[0];if("number"!=typeof e){e=0;for(var n=0;nr;r++)if(t[r]=i(this.parent[r+this.offset]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return""},l.prototype.get=function(t){if(0>t||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]},l.prototype.set=function(t,e){if(0>t||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]=e},l.prototype.write=function(t,e,n,i){if(isFinite(e))isFinite(n)||(i=n,n=void 0);else{var o=i;i=e,e=n,n=o}e=+e||0;var a=this.length-e;n?(n=+n,n>a&&(n=a)):n=a,i=String(i||"utf8").toLowerCase();var s;switch(i){case"hex":s=this.parent.hexWrite(t,this.offset+e,n);break;case"utf8":case"utf-8":s=this.parent.utf8Write(t,this.offset+e,n);break;case"ascii":s=this.parent.asciiWrite(t,this.offset+e,n);break;case"binary":s=this.parent.binaryWrite(t,this.offset+e,n);break;case"base64":s=this.parent.base64Write(t,this.offset+e,n);break;case"ucs2":case"ucs-2":s=this.parent.ucs2Write(t,this.offset+e,n);break;default:throw new Error("Unknown encoding")}return l._charsWritten=r._charsWritten,s},l.prototype.toString=function(t,e,n){switch(t=String(t||"utf8").toLowerCase(),"undefined"==typeof e||0>e?e=0:e>this.length&&(e=this.length),"undefined"==typeof n||n>this.length?n=this.length:0>n&&(n=0),e+=this.offset,n+=this.offset,t){case"hex":return this.parent.hexSlice(e,n);case"utf8":case"utf-8":return this.parent.utf8Slice(e,n);case"ascii":return this.parent.asciiSlice(e,n);case"binary":return this.parent.binarySlice(e,n);case"base64":return this.parent.base64Slice(e,n);case"ucs2":case"ucs-2":return this.parent.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},l.byteLength=r.byteLength,l.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),"number"!=typeof t||isNaN(t))throw new Error("value is not a number");if(e>n)throw new Error("end < start");if(n===e)return 0;if(0==this.length)return 0;if(0>e||e>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");return this.parent.fill(t,e+this.offset,n+this.offset)},l.prototype.copy=function(t,e,n,r){var i=this;if(n||(n=0),r||(r=this.length),e||(e=0),n>r)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==t.length||0==i.length)return 0;if(0>e||e>=t.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");return r>this.length&&(r=this.length),t.length-ethis.length)throw new Error("oob");if(t>e)throw new Error("oob");return new l(this.parent,e-t,+t+this.offset)},l.prototype.utf8Slice=function(t,e){return this.toString("utf8",t,e)},l.prototype.binarySlice=function(t,e){return this.toString("binary",t,e)},l.prototype.asciiSlice=function(t,e){return this.toString("ascii",t,e)},l.prototype.utf8Write=function(t,e){return this.write(t,e,"utf8")},l.prototype.binaryWrite=function(t,e){return this.write(t,e,"binary")},l.prototype.asciiWrite=function(t,e){return this.write(t,e,"ascii")},l.prototype.readUInt8=function(t,e){var n=this;return e||(C.ok(void 0!==t&&null!==t,"missing offset"),C.ok(t=n.length?void 0:n.parent[n.offset+t]},l.prototype.readUInt16LE=function(t,e){return d(this,t,!1,e)},l.prototype.readUInt16BE=function(t,e){return d(this,t,!0,e)},l.prototype.readUInt32LE=function(t,e){return m(this,t,!1,e)},l.prototype.readUInt32BE=function(t,e){return m(this,t,!0,e)},l.prototype.readInt8=function(t,e){var n,r=this;return e||(C.ok(void 0!==t&&null!==t,"missing offset"),C.ok(t=r.length?void 0:(n=128&r.parent[r.offset+t],n?-1*(255-r.parent[r.offset+t]+1):r.parent[r.offset+t])},l.prototype.readInt16LE=function(t,e){return g(this,t,!1,e)},l.prototype.readInt16BE=function(t,e){return g(this,t,!0,e)},l.prototype.readInt32LE=function(t,e){return v(this,t,!1,e)},l.prototype.readInt32BE=function(t,e){return v(this,t,!0,e)},l.prototype.readFloatLE=function(t,e){return y(this,t,!1,e)},l.prototype.readFloatBE=function(t,e){return y(this,t,!0,e)},l.prototype.readDoubleLE=function(t,e){return b(this,t,!1,e)},l.prototype.readDoubleBE=function(t,e){return b(this,t,!0,e)},l.prototype.writeUInt8=function(t,e,n){var r=this;n||(C.ok(void 0!==t&&null!==t,"missing value"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e=0?r.writeUInt8(t,e,n):r.writeUInt8(255+t+1,e,n)},l.prototype.writeInt16LE=function(t,e,n){j(this,t,e,!1,n)},l.prototype.writeInt16BE=function(t,e,n){j(this,t,e,!0,n)},l.prototype.writeInt32LE=function(t,e,n){k(this,t,e,!1,n)},l.prototype.writeInt32BE=function(t,e,n){k(this,t,e,!0,n)},l.prototype.writeFloatLE=function(t,e,n){A(this,t,e,!1,n)},l.prototype.writeFloatBE=function(t,e,n){A(this,t,e,!0,n)},l.prototype.writeDoubleLE=function(t,e,n){I(this,t,e,!1,n)},l.prototype.writeDoubleBE=function(t,e,n){I(this,t,e,!0,n)},r.prototype.readUInt8=l.prototype.readUInt8,r.prototype.readUInt16LE=l.prototype.readUInt16LE,r.prototype.readUInt16BE=l.prototype.readUInt16BE,r.prototype.readUInt32LE=l.prototype.readUInt32LE,r.prototype.readUInt32BE=l.prototype.readUInt32BE,r.prototype.readInt8=l.prototype.readInt8,r.prototype.readInt16LE=l.prototype.readInt16LE,r.prototype.readInt16BE=l.prototype.readInt16BE,r.prototype.readInt32LE=l.prototype.readInt32LE,r.prototype.readInt32BE=l.prototype.readInt32BE,r.prototype.readFloatLE=l.prototype.readFloatLE,r.prototype.readFloatBE=l.prototype.readFloatBE,r.prototype.readDoubleLE=l.prototype.readDoubleLE,r.prototype.readDoubleBE=l.prototype.readDoubleBE,r.prototype.writeUInt8=l.prototype.writeUInt8,r.prototype.writeUInt16LE=l.prototype.writeUInt16LE,r.prototype.writeUInt16BE=l.prototype.writeUInt16BE,r.prototype.writeUInt32LE=l.prototype.writeUInt32LE,r.prototype.writeUInt32BE=l.prototype.writeUInt32BE,r.prototype.writeInt8=l.prototype.writeInt8,r.prototype.writeInt16LE=l.prototype.writeInt16LE,r.prototype.writeInt16BE=l.prototype.writeInt16BE,r.prototype.writeInt32LE=l.prototype.writeInt32LE,r.prototype.writeInt32BE=l.prototype.writeInt32BE,r.prototype.writeFloatLE=l.prototype.writeFloatLE,r.prototype.writeFloatBE=l.prototype.writeFloatBE,r.prototype.writeDoubleLE=l.prototype.writeDoubleLE,r.prototype.writeDoubleBE=l.prototype.writeDoubleBE},{assert:1,"./buffer_ieee754":5,"base64-js":7}],7:[function(t,e){!function(){"use strict";function t(t){var e,n,i,o,a,s;if(t.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(a=t.indexOf("="),a=a>0?t.length-a:0,s=[],i=a>0?t.length-4:t.length,e=0,n=0;i>e;e+=4,n+=3)o=r.indexOf(t[e])<<18|r.indexOf(t[e+1])<<12|r.indexOf(t[e+2])<<6|r.indexOf(t[e+3]),s.push((16711680&o)>>16),s.push((65280&o)>>8),s.push(255&o);return 2===a?(o=r.indexOf(t[e])<<2|r.indexOf(t[e+1])>>4,s.push(255&o)):1===a&&(o=r.indexOf(t[e])<<10|r.indexOf(t[e+1])<<4|r.indexOf(t[e+2])>>2,s.push(255&o>>8),s.push(255&o)),s}function n(t){function e(t){return r[63&t>>18]+r[63&t>>12]+r[63&t>>6]+r[63&t]}var n,i,o,a=t.length%3,s="";for(n=0,o=t.length-a;o>n;n+=3)i=(t[n]<<16)+(t[n+1]<<8)+t[n+2],s+=e(i);switch(a){case 1:i=t[t.length-1],s+=r[i>>2],s+=r[63&i<<4],s+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],s+=r[i>>10],s+=r[63&i>>4],s+=r[63&i<<2],s+="="}return s}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports.toByteArray=t,e.exports.fromByteArray=n}()},{}],8:[function(t,e,n){n.readIEEE754=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,f=-7,l=n?0:i-1,p=n?1:-1,h=t[e+l];for(l+=p,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[e+l],l+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},n.writeIEEE754=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?o-1:0,d=r?-1:1,m=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+l>=1?p/u:p*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=d,s/=256,i-=8);for(a=a<0;t[n+h]=255&a,h+=d,a/=256,c-=8);t[n+h-d]|=128*m}},{}],3:[function(t,e,n){function r(t){this.length=t}function i(t){return 16>t?"0"+t.toString(16):t.toString(16)}function o(t){for(var e=[],n=0;ni&&!(i+n>=e.length||i>=t.length);)e[i+n]=t[i],i++;return i}function c(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function f(t){return t=~~Math.ceil(+t),0>t?0:t}function l(t,e,n){if(!(this instanceof l))return new l(t,e,n);var i;if("number"==typeof n)this.length=f(e),this.parent=t,this.offset=n;else{switch(i=typeof t){case"number":this.length=f(t);break;case"string":this.length=l.byteLength(t,e);break;case"object":this.length=f(t.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(this.length>l.poolSize?(this.parent=new r(this.length),this.offset=0):((!N||N.length-N.used>>0):(i=t.parent[t.offset+e+2]<<16,i|=t.parent[t.offset+e+1]<<8,i|=t.parent[t.offset+e],i+=t.parent[t.offset+e+3]<<24>>>0),i}function g(t,e,n,r){var i,o;return r||(C.ok("boolean"==typeof n,"missing or invalid endian"),C.ok(void 0!==e&&null!==e,"missing offset"),C.ok(e+1=0,"specified a negative value for writing an unsigned value"),C.ok(e>=t,"value is larger than maximum value for type"),C.ok(Math.floor(t)===t,"value has a fractional component")}function w(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+1>>8,t.parent[t.offset+n+1]=255&e):(t.parent[t.offset+n+1]=(65280&e)>>>8,t.parent[t.offset+n]=255&e)}function _(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+3>>24,t.parent[t.offset+n+1]=255&e>>>16,t.parent[t.offset+n+2]=255&e>>>8,t.parent[t.offset+n+3]=255&e):(t.parent[t.offset+n+3]=255&e>>>24,t.parent[t.offset+n+2]=255&e>>>16,t.parent[t.offset+n+1]=255&e>>>8,t.parent[t.offset+n]=255&e)}function E(t,e,n){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(e>=t,"value larger than maximum allowed value"),C.ok(t>=n,"value smaller than minimum allowed value"),C.ok(Math.floor(t)===t,"value has a fractional component")}function S(t,e,n){C.ok("number"==typeof t,"cannot write a non-number as a number"),C.ok(e>=t,"value larger than maximum allowed value"),C.ok(t>=n,"value smaller than minimum allowed value")}function j(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+1=0?w(t,e,n,r,i):w(t,65535+e+1,n,r,i)}function k(t,e,n,r,i){i||(C.ok(void 0!==e&&null!==e,"missing value"),C.ok("boolean"==typeof r,"missing or invalid endian"),C.ok(void 0!==n&&null!==n,"missing offset"),C.ok(n+3=0?_(t,e,n,r,i):_(t,4294967295+e+1,n,r,i)}function A(e,n,r,i,o){o||(C.ok(void 0!==n&&null!==n,"missing value"),C.ok("boolean"==typeof i,"missing or invalid endian"),C.ok(void 0!==r&&null!==r,"missing offset"),C.ok(r+3r;r++)if(t[r]=i(this[r]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return""},r.prototype.hexSlice=function(t,e){var n=this.length;(!t||0>t)&&(t=0),(!e||0>e||e>n)&&(e=n);for(var r="",o=t;e>o;o++)r+=i(this[o]);return r},r.prototype.toString=function(t,e,n){if(t=String(t||"utf8").toLowerCase(),e=+e||0,"undefined"==typeof n&&(n=this.length),+n==e)return"";switch(t){case"hex":return this.hexSlice(e,n);case"utf8":case"utf-8":return this.utf8Slice(e,n);case"ascii":return this.asciiSlice(e,n);case"binary":return this.binarySlice(e,n);case"base64":return this.base64Slice(e,n);case"ucs2":case"ucs-2":return this.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},r.prototype.hexWrite=function(t,e,n){e=+e||0;var i=this.length-e;n?(n=+n,n>i&&(n=i)):n=i;var o=t.length;if(o%2)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;n>a;a++){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");this[e+a]=s}return r._charsWritten=2*a,a},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var i=r;r=e,e=n,n=i}e=+e||0;var o=this.length-e;switch(n?(n=+n,n>o&&(n=o)):n=o,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(t,e,n);case"utf8":case"utf-8":return this.utf8Write(t,e,n);case"ascii":return this.asciiWrite(t,e,n);case"binary":return this.binaryWrite(t,e,n);case"base64":return this.base64Write(t,e,n);case"ucs2":case"ucs-2":return this.ucs2Write(t,e,n);default:throw new Error("Unknown encoding")}},r.prototype.slice=function(t,e){if(void 0===e&&(e=this.length),e>this.length)throw new Error("oob");if(t>e)throw new Error("oob");return new l(this,e-t,+t)},r.prototype.copy=function(t,e,n,r){for(var i=[],o=n;r>o;o++)C.ok("undefined"!=typeof this[o],"copying undefined buffer bytes!"),i.push(this[o]);for(var o=e;or;r++)if(t[r]=i(this.parent[r+this.offset]),r==n.INSPECT_MAX_BYTES){t[r+1]="...";break}return""},l.prototype.get=function(t){if(0>t||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]},l.prototype.set=function(t,e){if(0>t||t>=this.length)throw new Error("oob");return this.parent[this.offset+t]=e},l.prototype.write=function(t,e,n,i){if(isFinite(e))isFinite(n)||(i=n,n=void 0);else{var o=i;i=e,e=n,n=o}e=+e||0;var a=this.length-e;n?(n=+n,n>a&&(n=a)):n=a,i=String(i||"utf8").toLowerCase();var s;switch(i){case"hex":s=this.parent.hexWrite(t,this.offset+e,n);break;case"utf8":case"utf-8":s=this.parent.utf8Write(t,this.offset+e,n);break;case"ascii":s=this.parent.asciiWrite(t,this.offset+e,n);break;case"binary":s=this.parent.binaryWrite(t,this.offset+e,n);break;case"base64":s=this.parent.base64Write(t,this.offset+e,n);break;case"ucs2":case"ucs-2":s=this.parent.ucs2Write(t,this.offset+e,n);break;default:throw new Error("Unknown encoding")}return l._charsWritten=r._charsWritten,s},l.prototype.toString=function(t,e,n){switch(t=String(t||"utf8").toLowerCase(),"undefined"==typeof e||0>e?e=0:e>this.length&&(e=this.length),"undefined"==typeof n||n>this.length?n=this.length:0>n&&(n=0),e+=this.offset,n+=this.offset,t){case"hex":return this.parent.hexSlice(e,n);case"utf8":case"utf-8":return this.parent.utf8Slice(e,n);case"ascii":return this.parent.asciiSlice(e,n);case"binary":return this.parent.binarySlice(e,n);case"base64":return this.parent.base64Slice(e,n);case"ucs2":case"ucs-2":return this.parent.ucs2Slice(e,n);default:throw new Error("Unknown encoding")}},l.byteLength=r.byteLength,l.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),"number"!=typeof t||isNaN(t))throw new Error("value is not a number");if(e>n)throw new Error("end < start");if(n===e)return 0;if(0==this.length)return 0;if(0>e||e>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");return this.parent.fill(t,e+this.offset,n+this.offset)},l.prototype.copy=function(t,e,n,r){var i=this;if(n||(n=0),r||(r=this.length),e||(e=0),n>r)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==t.length||0==i.length)return 0;if(0>e||e>=t.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");return r>this.length&&(r=this.length),t.length-ethis.length)throw new Error("oob");if(t>e)throw new Error("oob");return new l(this.parent,e-t,+t+this.offset)},l.prototype.utf8Slice=function(t,e){return this.toString("utf8",t,e)},l.prototype.binarySlice=function(t,e){return this.toString("binary",t,e)},l.prototype.asciiSlice=function(t,e){return this.toString("ascii",t,e)},l.prototype.utf8Write=function(t,e){return this.write(t,e,"utf8")},l.prototype.binaryWrite=function(t,e){return this.write(t,e,"binary")},l.prototype.asciiWrite=function(t,e){return this.write(t,e,"ascii")},l.prototype.readUInt8=function(t,e){var n=this;return e||(C.ok(void 0!==t&&null!==t,"missing offset"),C.ok(t=0?r.writeUInt8(t,e,n):r.writeUInt8(255+t+1,e,n)},l.prototype.writeInt16LE=function(t,e,n){j(this,t,e,!1,n)},l.prototype.writeInt16BE=function(t,e,n){j(this,t,e,!0,n)},l.prototype.writeInt32LE=function(t,e,n){k(this,t,e,!1,n)},l.prototype.writeInt32BE=function(t,e,n){k(this,t,e,!0,n)},l.prototype.writeFloatLE=function(t,e,n){A(this,t,e,!1,n)},l.prototype.writeFloatBE=function(t,e,n){A(this,t,e,!0,n)},l.prototype.writeDoubleLE=function(t,e,n){I(this,t,e,!1,n)},l.prototype.writeDoubleBE=function(t,e,n){I(this,t,e,!0,n)},r.prototype.readUInt8=l.prototype.readUInt8,r.prototype.readUInt16LE=l.prototype.readUInt16LE,r.prototype.readUInt16BE=l.prototype.readUInt16BE,r.prototype.readUInt32LE=l.prototype.readUInt32LE,r.prototype.readUInt32BE=l.prototype.readUInt32BE,r.prototype.readInt8=l.prototype.readInt8,r.prototype.readInt16LE=l.prototype.readInt16LE,r.prototype.readInt16BE=l.prototype.readInt16BE,r.prototype.readInt32LE=l.prototype.readInt32LE,r.prototype.readInt32BE=l.prototype.readInt32BE,r.prototype.readFloatLE=l.prototype.readFloatLE,r.prototype.readFloatBE=l.prototype.readFloatBE,r.prototype.readDoubleLE=l.prototype.readDoubleLE,r.prototype.readDoubleBE=l.prototype.readDoubleBE,r.prototype.writeUInt8=l.prototype.writeUInt8,r.prototype.writeUInt16LE=l.prototype.writeUInt16LE,r.prototype.writeUInt16BE=l.prototype.writeUInt16BE,r.prototype.writeUInt32LE=l.prototype.writeUInt32LE,r.prototype.writeUInt32BE=l.prototype.writeUInt32BE,r.prototype.writeInt8=l.prototype.writeInt8,r.prototype.writeInt16LE=l.prototype.writeInt16LE,r.prototype.writeInt16BE=l.prototype.writeInt16BE,r.prototype.writeInt32LE=l.prototype.writeInt32LE,r.prototype.writeInt32BE=l.prototype.writeInt32BE,r.prototype.writeFloatLE=l.prototype.writeFloatLE,r.prototype.writeFloatBE=l.prototype.writeFloatBE,r.prototype.writeDoubleLE=l.prototype.writeDoubleLE,r.prototype.writeDoubleBE=l.prototype.writeDoubleBE},{assert:1,"./buffer_ieee754":8,"base64-js":9}],9:[function(t,e){!function(){"use strict";function t(t){var e,n,i,o,a,s;if(t.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(a=t.indexOf("="),a=a>0?t.length-a:0,s=[],i=a>0?t.length-4:t.length,e=0,n=0;i>e;e+=4,n+=3)o=r.indexOf(t[e])<<18|r.indexOf(t[e+1])<<12|r.indexOf(t[e+2])<<6|r.indexOf(t[e+3]),s.push((16711680&o)>>16),s.push((65280&o)>>8),s.push(255&o);return 2===a?(o=r.indexOf(t[e])<<2|r.indexOf(t[e+1])>>4,s.push(255&o)):1===a&&(o=r.indexOf(t[e])<<10|r.indexOf(t[e+1])<<4|r.indexOf(t[e+2])>>2,s.push(255&o>>8),s.push(255&o)),s}function n(t){function e(t){return r[63&t>>18]+r[63&t>>12]+r[63&t>>6]+r[63&t]}var n,i,o,a=t.length%3,s="";for(n=0,o=t.length-a;o>n;n+=3)i=(t[n]<<16)+(t[n+1]<<8)+t[n+2],s+=e(i);switch(a){case 1:i=t[t.length-1],s+=r[i>>2],s+=r[63&i<<4],s+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],s+=r[i>>10],s+=r[63&i>>4],s+=r[63&i<<2],s+="="}return s}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports.toByteArray=t,e.exports.fromByteArray=n}()},{}]},{},[]),e.exports=t("buffer-browserify")},{}],69:[function(t,e){var n=e.exports={};n.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){if(t.source===window&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var e=n.shift();e()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],70:[function(t,e){function n(t,e){return o.init(this,e,t)}var r=t("./vendor/lodash"),i=t("async"),o=t("jxt"),a=t("xhr"),s=new DOMParser;n.prototype={constructor:{value:n},NS:"http://docs.oasis-open.org/ns/xri/xrd-1.0",EL:"XRD",toString:o.toString,toJSON:o.toJSON,get subject(){return o.getSubText(this.xml,this.NS,"Subject")},get expires(){return new Date(o.getSubText(this.xml,this.NS,"Expires"))},get aliases(){return o.getMultiSubText(this.xml,this.NS,"Alias")},get properties(){var t={},e=o.find(this.xml,this.NS,"Property");return r.each(e,function(e){var n=o.getAttribute(e,"type");t[n]=e.textContent}),t},get links(){var t=[],e=o.find(this.xml,this.NS,"Link");return r.each(e,function(e){var n={rel:o.getAttribute(e,"rel"),href:o.getAttribute(e,"href"),type:o.getAttribute(e,"type"),template:o.getAttribute(e,"template"),titles:o.getSubLangText(e,this.NS,"Title","default"),properties:{}},i=o.find(e,this.NS,"Property");r.each(i,function(t){var e=o.getAttribute(t,"type");n.properties[e]=t.textContent}),t.push(n)}),t}},e.exports=function(t,e){"string"==typeof t&&(t={host:t}),t=r.extend({ssl:!0,json:!0},t);var o=t.ssl?"https://":"http://";i.parallel({json:function(e){return t.json?(a({uri:o+t.host+"/.well-known/host-meta.json"},function(t,n,r){if(t)return e();try{e("completed",JSON.parse(r))}catch(i){e(null,{})}}),void 0):e(null,{})},xrd:function(e){a({uri:o+t.host+"/.well-known/host-meta"},function(t,r){if(t)return e(null,{});try{var i=s.parseFromString(r.body,"application/xml").childNodes[0],o=new n({},i);e("completed",o.toJSON())}catch(a){e(null,{})}})}},function(t,n){if(t){if(Object.keys(n.json).length)return e(!1,n.json);if(Object.keys(n.xrd).length)return e(!1,n.xrd)}e("no-host-meta",{})})}},{"./vendor/lodash":76,async:56,jxt:71,xhr:73}],71:[function(t,e,n){var r=t("./vendor/lodash"),i=new XMLSerializer,o="http://www.w3.org/XML/1998/namespace",a={},s={},u={},c=n.find=function(t,e,n){var i=t.querySelectorAll(n);return r.filter(i,function(n){return n.namespaceURI===e&&n.parentNode==t})};n.findOrCreate=function(t,e,n){var r=c(t,e,n);if(r.length)return r[0];var i=document.createElementNS(e,n);return t.appendChild(i),i},n.init=function(t,e,n){return t.xml=e||document.createElementNS(t.NS,t.EL),t.xml.parentNode&&t.xml.parentNode.namespaceURI===t.NS||t.xml.setAttribute("xmlns",t.NS),t._extensions={},r.each(t.xml.childNodes,function(e){var n=e.namespaceURI+"|"+e.localName,r=s[n];if(void 0!==r){var i=r.prototype._name;t._extensions[i]=new r(null,e),t._extensions[i].parent=t}}),r.extend(t,n),t},n.getSubText=function(t,e,n){var r=c(t,e,n);if(!r)return"";for(var i=0;i=0?Object.keys(r).length>0&&(e[t]=r):i.indexOf("Array")>=0?r.length>0&&(e[t]=r):r&&(e[t]=r)}return e},n.extend=function(t,e){var i=t.prototype.NS+"|"+t.prototype.EL,o=e.prototype._name,a=e.prototype.NS+"|"+e.prototype.EL;s[a]=e,u[a]||(u[a]={}),u[i]||(u[i]={}),u[i][o]=e,t.prototype.__defineGetter__(o,function(){if(!this._extensions[o]){var t=n.find(this.xml,e.prototype.NS,e.prototype.EL);t.length?this._extensions[o]=new e(null,t[0]):(this._extensions[o]=new e,this.xml.appendChild(this._extensions[o].xml)),this._extensions[o].parent=this}return this._extensions[o]}),t.prototype.__defineSetter__(o,function(t){var e=this[o];r.extend(e,t)})},n.topLevel=function(t){var e=t.prototype.NS+"|"+t.prototype.EL;s[e]=t,a[e]=t},n.build=function(t){var e=a[t.namespaceURI+"|"+t.localName];return e?new e(null,t):void 0},n.XML_NS=o,n.TOP_LEVEL_LOOKUP=a,n.LOOKUP_EXT=u,n.LOOKUP=s},{"./vendor/lodash":72}],72:[function(e,n,r){var i=self;!function(e){function o(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function a(t){t.length=0,y.lengthk;k++)r+="m='"+t.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",t.i||(r+="||(!v[m]&&r[m]!==y[m])"),r+="){"+t.f+"}";r+="}"}return(t.b||Y.nonEnumArgs)&&(r+="}"),r+=t.c+";return C",e=e("i,j,l,n,o,q,t,u,y,z,w,G,H,J",n+r+"}"),s(t),e(C,U,D,f,Z,d,ee,u,z,q,K,T,R,J)}function f(t){return J.call(t)==S}function l(t,e,n,r,i,s){var c=n===x;if("function"==typeof n&&!c){n=u.createCallback(n,r,2);var h=n(t,e);if("undefined"!=typeof h)return!!h}if(t===e)return 0!==t||1/t==1/e;var d=typeof t,m=typeof e;if(t===t&&(!t||"function"!=d&&"object"!=d)&&(!e||"function"!=m&&"object"!=m))return!1;if(null==t||null==e)return t===e;if(m=J.call(t),d=J.call(e),m==S&&(m=O),d==S&&(d=O),m!=d)return!1;switch(m){case A:case I:return+t==+e;case N:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case L:case T:return t==e+""}if(d=m==j,!d){if(D.call(t,"__wrapped__")||D.call(e,"__wrapped__"))return l(t.__wrapped__||t,e.__wrapped__||e,n,r,i,s);if(m!=O||!Y.nodeClass&&(o(t)||o(e)))return!1;var m=!Y.argsObject&&f(t)?Object:t.constructor,g=!Y.argsObject&&f(e)?Object:e.constructor;if(!(m==g||p(m)&&m instanceof m&&p(g)&&g instanceof g))return!1}for(g=!i,i||(i=y.pop()||[]),s||(s=y.pop()||[]),m=i.length;m--;)if(i[m]==t)return s[m]==e;var v=0,h=!0;if(i.push(t),s.push(e),d){if(m=t.length,v=e.length,h=v==t.length,!h&&!c)return h;for(;v--;)if(d=m,g=e[v],c)for(;d--&&!(h=l(t[d],g,n,r,i,s)););else if(!(h=l(t[v],g,n,r,i,s)))break;return h}return re(e,function(e,o,a){return D.call(a,o)?(v++,h=D.call(t,o)&&l(t[o],e,n,r,i,s)):void 0}),h&&!c&&re(t,function(t,e,n){return D.call(n,e)?h=-1<--v:void 0}),g&&(a(i),a(s)),h}function p(t){return"function"==typeof t}function h(t){return!(!t||!q[typeof t])}function d(t){return"string"==typeof t||J.call(t)==T}function m(t,e,n){var r=[];if(e=u.createCallback(e,n),Z(t)){n=-1;for(var i=t.length;++n3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),re=c($,F,{i:!1});p(/x/)&&(p=function(t){return"function"==typeof t&&"[object Function]"==J.call(t)}),u.assign=X,u.createCallback=function(t,e,n){if(null==t)return v;var r=typeof t;if("function"!=r){if("object"!=r)return function(e){return e[t]};var i=ee(t);return function(e){for(var n=i.length,r=!1;n--&&(r=l(e[i[n]],t[i[n]],x)););return r}}return"undefined"==typeof e||_&&!_.test(P.call(t))?t:1===n?function(n){return t.call(e,n)}:2===n?function(n,r){return t.call(e,n,r)}:4===n?function(n,r,i,o){return t.call(e,n,r,i,o)}:function(n,r,i){return t.call(e,n,r,i)}},u.filter=m,u.forEach=g,u.forIn=re,u.keys=ee,u.each=g,u.extend=X,u.select=m,u.identity=v,u.isArguments=f,u.isArray=Z,u.isEqual=l,u.isFunction=p,u.isObject=h,u.isString=d,u.VERSION="1.3.1","function"==typeof t&&"object"==typeof t.amd&&t.amd?(e._=u,t(function(){return u})):B&&!B.nodeType?M?(M.exports=u)._=u:B._=u:e._=u}(this)},{}],73:[function(t,e){function n(t,e){function n(){4===f.readyState&&i()}function i(){var t=null,n=f.statusCode=f.status,r=f.body=f.response||f.responseText||f.responseXML;if(0===n||n>=400&&600>n){var i=f.responseText||a[String(f.status).charAt(0)];t=new Error(i),t.statusCode=f.status}if(m)try{r=f.body=JSON.parse(r)}catch(o){}e(t,f,r)}function c(t){e(t,f)}"string"==typeof t&&(t={uri:t}),t=t||{},e=o(e);var f;t.cors?(f=new u,f.withCredentials=!0):f=new s;var l=f.url=t.uri,p=f.method=t.method||"GET",h=t.body||t.data,d=f.headers=t.headers||{},m=!1;return"json"in t&&(m=!0,d["Content-Type"]="application/json",h=JSON.stringify(t.json)),f.onreadystatechange=n,f.onload=i,f.onerror=c,f.onprogress=function(){},f.ontimeout=r,f.open(p,l),f.timeout="timeout"in t?t.timeout:5e3,f.setRequestHeader&&Object.keys(d).forEach(function(t){f.setRequestHeader(t,d[t])}),f.send(h),f}function r(){}var i=t("global/window"),o=t("once"),a={0:"Internal XMLHttpRequest Error",4:"4xx Client Error",5:"5xx Server Error"},s=i.XMLHttpRequest||r,u="withCredentials"in new s?i.XMLHttpRequest:i.XDomainRequest; -e.exports=n},{"global/window":74,once:75}],74:[function(t,e){var n=self;e.exports="undefined"!=typeof window?window:"undefined"!=typeof n?n:{}},{}],75:[function(t,e){function n(t){var e=!1;return function(){return e?void 0:(e=!0,t.apply(this,arguments))}}e.exports=n,n.proto=n(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0})})},{}],76:[function(e,n,r){var i=self;!function(e){function o(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function a(t){t.length=0,v.lengthk;k++)r+="m='"+t.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",t.i||(r+="||(!v[m]&&r[m]!==y[m])"),r+="){"+t.f+"}";r+="}"}return(t.b||K.nonEnumArgs)&&(r+="}"),r+=t.c+";return C",e=e("i,j,l,n,o,q,t,u,y,z,w,G,H,J",n+r+"}"),s(t),e(I,F,P,f,Q,d,te,u,U,T,V,L,z,W)}function f(t){return W.call(t)==E}function l(t,e,n,r,i,s){var c=n===b;if("function"==typeof n&&!c){n=u.createCallback(n,r,2);var h=n(t,e);if("undefined"!=typeof h)return!!h}if(t===e)return 0!==t||1/t==1/e;var d=typeof t,m=typeof e;if(t===t&&(!t||"function"!=d&&"object"!=d)&&(!e||"function"!=m&&"object"!=m))return!1;if(null==t||null==e)return t===e;if(m=W.call(t),d=W.call(e),m==E&&(m=N),d==E&&(d=N),m!=d)return!1;switch(m){case j:case A:return+t==+e;case C:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case O:case L:return t==e+""}if(d=m==S,!d){if(P.call(t,"__wrapped__")||P.call(e,"__wrapped__"))return l(t.__wrapped__||t,e.__wrapped__||e,n,r,i,s);if(m!=N||!K.nodeClass&&(o(t)||o(e)))return!1;var m=!K.argsObject&&f(t)?Object:t.constructor,g=!K.argsObject&&f(e)?Object:e.constructor;if(!(m==g||p(m)&&m instanceof m&&p(g)&&g instanceof g))return!1}for(g=!i,i||(i=v.pop()||[]),s||(s=v.pop()||[]),m=i.length;m--;)if(i[m]==t)return s[m]==e;var y=0,h=!0;if(i.push(t),s.push(e),d){if(m=t.length,y=e.length,h=y==t.length,!h&&!c)return h;for(;y--;)if(d=m,g=e[y],c)for(;d--&&!(h=l(t[d],g,n,r,i,s)););else if(!(h=l(t[y],g,n,r,i,s)))break;return h}return ne(e,function(e,o,a){return P.call(a,o)?(y++,h=P.call(t,o)&&l(t[o],e,n,r,i,s)):void 0}),h&&!c&&ne(t,function(t,e,n){return P.call(n,e)?h=-1<--y:void 0}),g&&(a(i),a(s)),h}function p(t){return"function"==typeof t}function h(t){return!(!t||!T[typeof t])}function d(t){return"string"==typeof t||W.call(t)==L}function m(t,e,n){if(e&&"undefined"==typeof n&&Q(t)){n=-1;for(var r=t.length;++n3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),ne=c(G,M,{i:!1});p(/x/)&&(p=function(t){return"function"==typeof t&&"[object Function]"==W.call(t)}),u.assign=$,u.createCallback=function(t,e,n){if(null==t)return g;var r=typeof t;if("function"!=r){if("object"!=r)return function(e){return e[t]};var i=te(t);return function(e){for(var n=i.length,r=!1;n--&&(r=l(e[i[n]],t[i[n]],b)););return r}}return"undefined"==typeof e||w&&!w.test(R.call(t))?t:1===n?function(n){return t.call(e,n)}:2===n?function(n,r){return t.call(e,n,r)}:4===n?function(n,r,i,o){return t.call(e,n,r,i,o)}:function(n,r,i){return t.call(e,n,r,i)}},u.forEach=m,u.forIn=ne,u.keys=te,u.each=m,u.extend=$,u.identity=g,u.isArguments=f,u.isArray=Q,u.isEqual=l,u.isFunction=p,u.isObject=h,u.isString=d,u.VERSION="1.3.1","function"==typeof t&&"object"==typeof t.amd&&t.amd?(e._=u,t(function(){return u})):q&&!q.nodeType?B?(B.exports=u)._=u:q._=u:e._=u}(this)},{}],77:[function(t,e){"use strict";var n=t("lodash"),r=t("./lib/core"),i=t("./lib/helpers"),o=t("./lib/types");e.exports=n.extend({},r,i,o)},{"./lib/core":78,"./lib/helpers":79,"./lib/types":80,lodash:81}],78:[function(t,e,n){"use strict";function r(t){var e=t.prototype._NS+"|"+t.prototype._EL;c[e]=t,l[e]=t}function i(t){return u.serializeToString(t)}function o(t){var e,n={},r={constructor:!0,_EL:!0,_NS:!0,_extensions:!0,_name:!0,parent:!0,prototype:!0,toJSON:!0,toString:!0,xml:!0};for(e in t._extensions)t._extensions[e].toJSON&&(n[e]=t._extensions[e].toJSON());for(e in t)if(!r[e]&&!(f[t._NS+"|"+t._EL]||{})[e]&&!t._extensions[e]&&"_"!==e[0]){var i=t[e];if("function"==typeof i)continue;var o=Object.prototype.toString.call(i);o.indexOf("Object")>=0?Object.keys(i).length>0&&(n[e]=i):o.indexOf("Array")>=0?i.length>0&&(n[e]=i):i&&(n[e]=i)}return n}var a=t("lodash");t("./helpers").find;var s=t("./types"),u=new XMLSerializer,c={},f={},l={};n.build=function(t){var e=l[t.namespaceURI+"|"+t.localName];return e?new e(null,t):void 0},n.extend=function(t,e,r){var i=t.prototype._NS+"|"+t.prototype._EL,o=e.prototype._name,a=e.prototype._NS+"|"+e.prototype._EL;c[a]=e,f[a]||(f[a]={}),f[i]||(f[i]={}),f[i][o]=e,n.add(t,o,s.extension(e)),r&&n.add(t,r,s.multiExtension(e))},n.add=function(t,e,n){n.get&&t.prototype.__defineGetter__(e,n.get),n.set&&t.prototype.__defineSetter__(e,n.set)},n.define=function(t){var e=function(t,e){var n=this;return n.xml=e||document.createElementNS(n._NS,n._EL),n.xml.parentNode&&n.xml.parentNode.namespaceURI===n._NS||n.xml.setAttribute("xmlns",n._NS),n._extensions={},a.each(n.xml.childNodes,function(t){var e=t.namespaceURI+"|"+t.localName,r=c[e];if(void 0!==r){var i=r.prototype._name;n._extensions[i]=new r(null,t),n._extensions[i].parent=n}}),a.extend(n,t),n};e.prototype={constructor:{value:e},_name:t.name,_eventname:t.eventName,_NS:t.namespace,_EL:t.element,toString:function(){return i(this.xml)},toJSON:function(){return o(this)}};var s=Object.keys(t.fields||{});return s.forEach(function(r){n.add(e,r,t.fields[r])}),t.topLevel&&r(e),e}},{"./helpers":79,"./types":80,lodash:81}],79:[function(t,e,n){"use strict";var r=t("lodash"),i="http://www.w3.org/XML/1998/namespace";n.getParser=function(){return new DOMParser},n.createElement=function(t,e){return document.createElement(t,e)};var o=n.find=function(t,e,n){var i=t.querySelectorAll(n);return r.filter(i,function(n){return n.namespaceURI===e&&n.parentNode==t})};n.findOrCreate=function(t,e,r){var i=n.find(t,e,r);if(i.length)return i[0];var o=document.createElementNS(e,r);return t.appendChild(o),o},n.getAttribute=function(t,e,n){return t.getAttribute(e)||n||""},n.setAttribute=function(t,e,n,r){n||r?t.setAttribute(e,n):t.removeAttribute(e)},n.getBoolAttribute=function(t,e,n){var r=t.getAttribute(e)||n||"";return"true"===r||"1"===r},n.setBoolAttribute=function(t,e,n){n?t.setAttribute(e,"1"):t.removeAttribute(e)},n.getSubAttribute=function(t,e,n,r,i){var a=o(t,e,n);if(!a)return"";for(var s=0;s-1?0:-1:t?0:-1}function a(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:_+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function s(t){return t.charCodeAt(0)}function u(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||"undefined"==typeof n)return 1;if(r>n||"undefined"==typeof r)return-1}return t.index-e.index}function c(t){var e=-1,n=t.length,r=t[0],i=t[0|n/2],o=t[n-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&o&&"object"==typeof o)return!1;var s=p();s["false"]=s["null"]=s["true"]=s.undefined=!1;var u=p();for(u.array=t,u.cache=s,u.push=a;++ei?0:i);++r-1:void 0}),g&&(d(i),d(o)),a}function S(t,e,n,r,i){(Hr(e)?We:ii)(e,function(e,o){var a,s,u=e,c=t[o];if(e&&((s=Hr(e))||oi(e))){for(var f=r.length;f--;)if(a=r[f]==e){c=i[f];break}if(!a){var l;n&&(u=n(c,e),(l="undefined"!=typeof u)&&(c=u)),l||(c=s?Hr(c)?c:[]:oi(c)?c:{}),r.push(e),i.push(c),l||S(c,e,n,r,i)}}else n&&(u=n(c,e),"undefined"==typeof u&&(u=e)),"undefined"!=typeof u&&(c=u);t[o]=c})}function K(t,n,r){var i=-1,a=ie(),s=t?t.length:0,u=[],f=!n&&s>=E&&a===e,p=r||f?l():u;if(f){var h=c(p);h?(a=o,p=h):(f=!1,p=r?p:(d(p),u))}for(;++i3&&"function"==typeof e[n-2])var r=a(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var i=Dr.call(arguments,1,n),o=-1,s=l(),u=l();++on?Ur(0,o+n):n)||0,Hr(t)?a=i(t,e,n)>-1:"number"==typeof o?a=(Ce(t)?t.indexOf(e,n):i(t,e,n))>-1:ii(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function ze(t,e,r){var i=!0;e=n.createCallback(e,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++oo&&(o=c)}else e=!e&&Ce(t)?s:n.createCallback(e,r,3),We(t,function(t,n,r){var a=e(t,n,r);a>i&&(i=a,o=t)});return o}function He(t,e,r){var i=1/0,o=i;if(!e&&Hr(t))for(var a=-1,u=t.length;++ac&&(o=c)}else e=!e&&Ce(t)?s:n.createCallback(e,r,3),We(t,function(t,n,r){var a=e(t,n,r);i>a&&(i=a,o=t)});return o}function Ve(t,e){var n=-1,r=t?t.length:0;if("number"==typeof r)for(var i=ir(r);++n=E&&r===e;if(u){var f=c(a);f?(r=o,a=f):u=!1}for(;++nr?Ur(0,i+r):r||0}else if(r){var o=wn(t,n);return t[o]===n?o:-1}return e(t,n,r)}function hn(t,e,r){var i=0,o=t?t.length:0;if("number"!=typeof e&&null!=e){var a=o;for(e=n.createCallback(e,r,3);a--&&e(t[a],a,t);)i++}else i=null==e||r?1:e||i;return g(t,0,zr(Ur(0,o-i),o))}function dn(t){for(var n=arguments,r=n.length,i=-1,a=l(),s=-1,u=ie(),f=t?t.length:0,p=[],h=l();++i=E&&c(i?n[i]:h)}t:for(;++sn?Ur(0,r+n):zr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function vn(t){for(var e=arguments,n=0,r=e.length,i=t?t.length:0;++no;){var s=o+a>>>1;r(t[s])1?arguments:arguments[0],e=-1,n=t?Xe(Ve(t,"length")):0,r=ir(0>n?0:n);++e2?Z(t,17,Dr.call(arguments,2),null,e):Z(t,1,null,null,e)}function Cn(t){for(var e=arguments.length>1?b(arguments,!0,!1,1):de(t),n=-1,r=e.length;++n2?Z(e,19,Dr.call(arguments,2),null,t):Z(e,3,null,null,t)}function On(){for(var t=arguments,e=t.length;e--;)if(!Ee(t[e]))throw new hr;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function Ln(t,e,n){var r=typeof t;if(null==t||"function"==r)return a(t,e,n);if("object"!=r)return function(e){return e[t]};var i=Kr(t),o=i[0],s=t[o];return 1!=i.length||s!==s||Se(s)?function(e){for(var n=i.length,r=!1;n--&&(r=x(e[i[n]],t[i[n]],null,!0)););return r}:function(t){var e=t[o];return s===e&&(0!==s||1/s==1/e)}}function Tn(t,e){return e="number"==typeof e?e:+e||t.length,Z(t,4,null,null,null,e)}function qn(t,e,n){var r,i,o,a,s,u,c,f=0,l=!1,p=!0;if(!Ee(t))throw new hr;if(e=Ur(0,e)||0,n===!0){var h=!0;p=!1}else Se(n)&&(h=n.leading,l="maxWait"in n&&(Ur(e,n.maxWait)||0),p="trailing"in n?n.trailing:p);var d=function(){var n=e-(Sr()-a);if(0>=n){i&&br(i);var l=c;i=u=c=y,l&&(f=Sr(),o=t.apply(s,r))}else u=Ar(d,n)},m=function(){u&&br(u),i=u=c=y,(p||l!==e)&&(f=Sr(),o=t.apply(s,r))};return function(){if(r=arguments,a=Sr(),s=this,c=p&&(u||!h),l===!1)var n=h&&!u;else{i||h||(f=a);var g=l-(a-f);0>=g?(i&&(i=br(i)),f=a,o=t.apply(s,r)):i||(i=Ar(m,g))}return u||e===l||(u=Ar(d,e)),n&&(o=t.apply(s,r)),o}}function Bn(t){if(!Ee(t))throw new hr;var e=Dr.call(arguments,1);return Ar(function(){t.apply(y,e)},1)}function Mn(t,e){if(!Ee(t))throw new hr;var n=Dr.call(arguments,2);return Ar(function(){t.apply(y,n)},e)}function Fn(t,e){if(!Ee(t))throw new hr;var n=function(){var r=n.cache,i=e?e.apply(this,arguments):_+arguments[0];return Er.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return n.cache={},n}function Un(t){var e,n;if(!Ee(t))throw new hr;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function zn(t){return Z(t,16,Dr.call(arguments,1))}function Rn(t){return Z(t,32,null,Dr.call(arguments,1))}function Pn(t,e,n){var r=!0,i=!0;if(!Ee(t))throw new hr;n===!1?r=!1:Se(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),n=p(),n.leading=r,n.maxWait=e,n.trailing=i;var o=qn(t,e,n);return m(n),o}function Dn(t,e){if(!Ee(e))throw new hr;return function(){var n=[t];return jr.apply(n,arguments),e.apply(this,n)}}function Wn(t){return null==t?"":pr(t).replace(ti,re)}function Jn(t){return t}function Gn(t,e){var i=t,o=!e||Ee(i);e||(i=r,e=t,t=n),We(de(e),function(n){var r=t[n]=e[n];o&&(i.prototype[n]=function(){var e=this.__wrapped__,n=[e]; -jr.apply(n,arguments);var o=r.apply(t,n);return e&&"object"==typeof e&&e===o?this:new i(o)})})}function $n(){return t._=gr,this}function Xn(t,e,n){var r=null==t,i=null==e;null==n&&("boolean"==typeof t&&i?(n=t,t=1):i||"boolean"!=typeof e||(n=e,i=!0)),r&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0;var o=Pr();return n||t%1||e%1?t+zr(o*(e-t+parseFloat("1e-"+((o+"").length-1))),e):t+xr(o*(e-t+1))}function Hn(t,e){if(t){var n=t[e];return Ee(n)?t[e]():n}}function Vn(t,e,r){var i=n.templateSettings;t||(t=""),r=ni({},r,i);var o,a=ni({},r.imports,i.imports),s=Kr(a),u=Me(a),c=0,l=r.interpolate||q,p="__p += '",h=lr((r.escape||q).source+"|"+l.source+"|"+(l===L?C:q).source+"|"+(r.evaluate||q).source+"|$","g");t.replace(h,function(e,n,r,i,a,s){return r||(r=i),p+=t.slice(c,s).replace(M,f),n&&(p+="' +\n__e("+n+") +\n'"),a&&(o=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=s+e.length,e}),p+="';\n";var d=r.variable,m=d;m||(d="obj",p="with ("+d+") {\n"+p+"\n}\n"),p=(o?p.replace(k,""):p).replace(A,"$1").replace(I,"$1;"),p="function("+d+") {\n"+(m?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+U++ +"]")+"\n*/";try{var v=sr(s,"return "+p+g).apply(y,u)}catch(b){throw b.source=p,b}return e?v(e):(v.source=p,v)}function Kn(t,e,n){t=(t=+t)>-1?t:0;var r=-1,i=ir(t);for(e=a(e,n,1);++r/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:L,variable:"",imports:{_:n}};var Xr=Or?function(t,e){var n=p();n.value=e,Or(t,"__bindData__",n),m(n)}:h,Hr=qr||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Cr.call(t)==R||!1},Vr=function(t){var e,n=t,r=[];if(!n)return r;if(!V[typeof t])return r;for(e in n)Er.call(n,e)&&r.push(e);return r},Kr=Fr?function(t){return Se(t)?Fr(t):[]}:Vr,Yr={"&":"&","<":"<",">":">",'"':""","'":"'"},Qr=ge(Yr),Zr=lr("("+Kr(Qr).join("|")+")","g"),ti=lr("["+Kr(Yr).join("")+"]","g"),ei=function(t,e,n){var r,i=t,o=i;if(!i)return o;var s=arguments,u=0,c="number"==typeof n?2:s.length;if(c>3&&"function"==typeof s[c-2])var f=a(s[--c-1],s[c--],2);else c>2&&"function"==typeof s[c-1]&&(f=s[--c]);for(;++u/g,T=RegExp("^["+j+"]*0+(?=.$)"),q=/($^)/,B=/\bthis\b/,M=/['\n\r\t\u2028\u2029\\]/g,F=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setImmediate","setTimeout"],U=0,z="[object Arguments]",R="[object Array]",P="[object Boolean]",D="[object Date]",W="[object Function]",J="[object Number]",G="[object Object]",$="[object RegExp]",X="[object String]",H={};H[W]=!1,H[z]=H[R]=H[P]=H[D]=H[J]=H[G]=H[$]=H[X]=!0;var V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},K={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},Y=V[typeof window]&&window||this,Q=V[typeof r]&&r&&!r.nodeType&&r,Z=V[typeof n]&&n&&!n.nodeType&&n,te=Z&&Z.exports===Q&&Q,ee=V[typeof i]&&i;!ee||ee.global!==ee&&ee.window!==ee||(Y=ee);var ne=v();"function"==typeof t&&"object"==typeof t.amd&&t.amd?(Y._=ne,t(function(){return ne})):Q&&Z?te?(Z.exports=ne)._=ne:Q._=ne:Y._=ne}.call(this)},{}],82:[function(e,n){var r=e("__browserify_Buffer").Buffer;!function(){function i(t,e,n){var r=e&&n||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>i&&(e[r+i++]=g[t])});16>i;)e[r+i++]=0;return e}function o(t,e){var n=e||0,r=m;return r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]}function a(t,e,n){var r=e&&n||0,i=e||[];t=t||{};var a=null!=t.clockseq?t.clockseq:x,s=null!=t.msecs?t.msecs:(new Date).getTime(),u=null!=t.nsecs?t.nsecs:_+1,c=s-w+(u-_)/1e4;if(0>c&&null==t.clockseq&&(a=16383&a+1),(0>c||s>w)&&null==t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");w=s,_=u,x=a,s+=122192928e5;var f=(1e4*(268435455&s)+u)%4294967296;i[r++]=255&f>>>24,i[r++]=255&f>>>16,i[r++]=255&f>>>8,i[r++]=255&f;var l=268435455&1e4*(s/4294967296);i[r++]=255&l>>>8,i[r++]=255&l,i[r++]=16|15&l>>>24,i[r++]=255&l>>>16,i[r++]=128|a>>>8,i[r++]=255&a;for(var p=t.node||b,h=0;6>h;h++)i[r+h]=p[h];return e?e:o(i)}function s(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"==t?new d(16):null,t=null),t=t||{};var i=t.random||(t.rng||u)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],e)for(var a=0;16>a;a++)e[r+a]=i[a];return e||o(i)}var u,c=this;if("function"==typeof e)try{var f=e("crypto").randomBytes;u=f&&function(){return f(16)}}catch(l){}if(!u&&c.crypto&&crypto.getRandomValues){var p=new Uint8Array(16);u=function(){return crypto.getRandomValues(p),p}}if(!u){var h=new Array(16);u=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),h[e]=255&t>>>((3&e)<<3);return h}}for(var d="function"==typeof r?r:Array,m=[],g={},v=0;256>v;v++)m[v]=(v+256).toString(16).substr(1),g[m[v]]=v;var y=u(),b=[1|y[0],y[1],y[2],y[3],y[4],y[5]],x=16383&(y[6]<<8|y[7]),w=0,_=0,E=s;if(E.v1=a,E.v4=s,E.parse=i,E.unparse=o,E.BufferClass=d,c.define&&t.amd)t(function(){return E});else if("undefined"!=typeof n&&n.exports)n.exports=E;else{var S=c.uuid;E.noConflict=function(){return c.uuid=S,E},c.uuid=E}}()},{__browserify_Buffer:68,crypto:63}],83:[function(t,e,n){function r(t){c.call(this),this.registry=new Object,this.insureids=0,this.freq=void 0===t?5:t,this.run=!1,this.start()}function i(t,e,n,r){void 0===r&&(++this.insureids,this.insureids%=65e3,r=this.insureids),expiretime=Date.now()+1e3*e;var i=this,o={paddle:i,error_callback:t,args:n,id:r,timeout:expiretime,done:!1,check_in:function(){return this.paddle.check_in(this.id)}};return this.registry[r]=o,o}function o(t){return void 0!==t.id&&(t=t.id),t in this.registry?(this.emit("check_in",this.registry[t]),this.registry[t].done=!0,delete this.registry[t],!0):!1}function a(){var t=Date.now();for(var e in this.registry)t>this.registry[e].timeout&&(this.registry[e].error_callback.apply(this,this.registry[e].args),this.emit("timeout",this.registry[e]),delete this.registry[e]);this.run&&setTimeout(function(){this.checkEnsures()}.bind(this),1e3*this.freq)}function s(t){return void 0!==t&&(this.freq=t),this.run?!1:(this.run=!0,setTimeout(function(){this.checkEnsures()}.bind(this),1e3*this.freq),!0)}function u(){return this.run?(this.run=!1,!0):!0}var c=t("events").EventEmitter;r.super_=c,r.prototype=Object.create(c.prototype,{constructor:{value:r,enumerable:!1}}),r.prototype.insure=i,r.prototype.check_in=o,r.prototype.checkEnsures=a,r.prototype.start=s,r.prototype.stop=u,n.Paddle=r},{events:58}],84:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="ANONYMOUS",n.prototype.clientFirst=!0,n.prototype.response=function(t){return t.trace||""},n.prototype.challenge=function(){},t=e.exports=n})},{}],85:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":84}],86:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("crypto")):"function"==typeof t&&t.amd&&t(["exports","module","crypto"],o)}(this,function(t,e,n){function r(t){t=t||{},this._genNonce=t.genNonce||o(32)}function i(t){for(var e={},n=t.split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,i=n.length;i>r;r++){var o=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);o&&(e[o[1]]=o[2])}return e}function o(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;return function(){for(var r=[],i=0;t>i;++i)r.push(e[0|Math.random()*n]);return r.join("")}}function a(t,e){return n.createHash("md5").update(t).digest(e||"hex")}r.prototype.name="DIGEST-MD5",r.prototype.clientFirst=!1,r.prototype.response=function(t){var e=t.serviceType+"/"+t.host;t.serviceName&&t.host!==t.serviceName&&(e+="/"+serviceName);var n,r,i,o=t.realm||this._realm||"",s=this._genNonce(),u="00000001",c="auth",f="";return f+='username="'+t.username+'"',o&&(f+=',realm="'+o+'"'),f+=',nonce="'+this._nonce+'"',f+=',cnonce="'+s+'"',f+=",nc="+u,f+=",qop="+c,f+=',digest-uri="'+e+'"',n=t.authzid?a(a(t.username+":"+o+":"+t.password,"binary")+":"+this._nonce+":"+s+":"+t.authzid):a(a(t.username+":"+o+":"+t.password,"binary")+":"+this._nonce+":"+s),"auth"==c?r=a("AUTHENTICATE:"+e):("auth-int"==c||"auth-conf"==c)&&(r=a("AUTHENTICATE:"+e+":00000000000000000000000000000000")),i=a(n+":"+this._nonce+":"+u+":"+s+":"+c+":"+r),f+=",response="+i,"utf-8"==this._charset&&(f+=",charset=utf-8"),t.authzid&&(f+='authzid="'+t.authzid+'"'),f},r.prototype.challenge=function(t){var e=i(t);return this._realm=e.realm,this._nonce=e.nonce,this._qop=(e.qop||"auth").split(","),this._stale=e.stale,this._maxbuf=parseInt(e.maxbuf)||65536,this._charset=e.charset,this._algo=e.algorithm,this._cipher=e.cipher,this._cipher&&this._cipher.split(","),this},t=e.exports=r})},{crypto:63}],87:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":86}],88:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="EXTERNAL",n.prototype.clientFirst=!0,n.prototype.response=function(t){return t.authzid||""},n.prototype.challenge=function(){},t=e.exports=n})},{}],89:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":88}],90:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="PLAIN",n.prototype.clientFirst=!0,n.prototype.response=function(t){var e="";return e+=t.authzid||"",e+="\0",e+=t.username,e+="\0",e+=t.password},n.prototype.challenge=function(){return this},t=e.exports=n})},{}],91:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":90}],92:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("crypto"),e("buffer")):"function"==typeof t&&t.amd&&t(["exports","module","crypto","buffer"],o)}(this,function(t,e,n,r){function i(t){t=t||{},this._genNonce=t.genNonce||l(32),this._stage=0}function o(t,e){return n.createHmac("sha1",t).update(e).digest("binary")}function a(t,e,n){for(var r=o(t,e+"\0\0\0"),i=r,a=0;n-1>a;a++)r=o(t,r),i=u(i,r);return i}function s(t){return n.createHash("sha1").update(t).digest("binary")}function u(t,e){t=new p(t,"binary"),e=new p(e,"binary");var n=Math.min(t.length,e.length);result=[];for(var r=0;n>r;r++)result.push(t[r]^e[r]);return result=new p(result,"binary"),result.toString("binary")}function c(t){for(var e=[],n="",r=0;rr;r++){var o=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);o&&(e[o[1]]=o[2])}return e}function l(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;return function(){for(var r=[],i=0;t>i;++i)r.push(e[0|Math.random()*n]);return r.join("")}}var p=r.Buffer;i.prototype.name="SCRAM-SHA-1",i.prototype.clientFirst=!0,i.prototype.response=function(t){return h[this._stage](this,t)},i.prototype.challenge=function(t){var e=f(t);return this._salt=new p(e.s||"","base64").toString("binary"),this._iterationCount=parseInt(e.i,10),this._nonce=e.r,this._verifier=e.v,this._error=e.e,this._challenge=t,this};var h={};h[0]=function(t,e){t._cnonce=t._genNonce();var n="";e.authzid&&(n="a="+c(e.authzid)),t._gs2Header="n,"+n+",";var r="r="+t._cnonce,i="n="+c(e.username);t._clientFirstMessageBare=i+","+r;var o=t._gs2Header+t._clientFirstMessageBare;return t._stage=1,o},h[1]=function(t,e){var n=new p(t._gs2Header).toString("base64");t._clientFinalMessageWithoutProof="c="+n+",r="+t._nonce;var r,i,c;e.clientKey&&e.serverKey?(i=e.clientKey,c=e.serverKey):(r=e.saltedPassword||a(e.password,t._salt,t._iterationCount),i=o(r,"Client Key"),c=o(r,"Server Key"));var f=s(i),l=t._clientFirstMessageBare+","+t._challenge+","+t._clientFinalMessageWithoutProof,h=o(f,l),d=u(i,h),m=new p(d,"binary").toString("base64");t._serverSignature=o(c,l);var g=t._clientFinalMessageWithoutProof+",p="+m;return t._stage=2,t.cache={saltedPassword:r,clientKey:i,serverKey:c},g},h[2]=function(){return""},t=e.exports=i})},{buffer:61,crypto:63}],93:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":92}],94:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){this._mechs=[]}n.prototype.use=function(t,e){return e||(e=t,t=e.prototype.name),this._mechs.push({name:t,mech:e}),this},n.prototype.create=function(t){for(var e=0,n=this._mechs.length;n>e;e++)for(var r=0,i=t.length;i>r;r++){var o=this._mechs[e];if(o.name==t[r])return new o.mech}return null},t=e.exports=n})},{}],95:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/factory")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/factory"],o)}(this,function(t,e,n){t=e.exports=n,t.Factory=n})},{"./lib/factory":94}],96:[function(t,e,n){!function(){var t=this,r=t._,i={},o=Array.prototype,a=Object.prototype,s=Function.prototype,u=o.push,c=o.slice,f=o.concat,l=a.toString,p=a.hasOwnProperty,h=o.forEach,d=o.map,m=o.reduce,g=o.reduceRight,v=o.filter,y=o.every,b=o.some,x=o.indexOf,w=o.lastIndexOf,_=Array.isArray,E=Object.keys,S=s.bind,j=function(t){return t instanceof j?t:this instanceof j?(this._wrapped=t,void 0):new j(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=j),n._=j):t._=j,j.VERSION="1.5.2";var k=j.each=j.forEach=function(t,e,n){if(null!=t)if(h&&t.forEach===h)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(e.call(n,t[r],r,t)===i)return}else for(var a=j.keys(t),r=0,o=a.length;o>r;r++)if(e.call(n,t[a[r]],a[r],t)===i)return};j.map=j.collect=function(t,e,n){var r=[];return null==t?r:d&&t.map===d?t.map(e,n):(k(t,function(t,i,o){r.push(e.call(n,t,i,o))}),r)};var A="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),m&&t.reduce===m)return r&&(e=j.bind(e,r)),i?t.reduce(e,n):t.reduce(e);if(k(t,function(t,o,a){i?n=e.call(r,n,t,o,a):(n=t,i=!0)}),!i)throw new TypeError(A);return n},j.reduceRight=j.foldr=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),g&&t.reduceRight===g)return r&&(e=j.bind(e,r)),i?t.reduceRight(e,n):t.reduceRight(e);var o=t.length;if(o!==+o){var a=j.keys(t);o=a.length}if(k(t,function(s,u,c){u=a?a[--o]:--o,i?n=e.call(r,n,t[u],u,c):(n=t[u],i=!0)}),!i)throw new TypeError(A);return n},j.find=j.detect=function(t,e,n){var r;return I(t,function(t,i,o){return e.call(n,t,i,o)?(r=t,!0):void 0}),r},j.filter=j.select=function(t,e,n){var r=[];return null==t?r:v&&t.filter===v?t.filter(e,n):(k(t,function(t,i,o){e.call(n,t,i,o)&&r.push(t)}),r)},j.reject=function(t,e,n){return j.filter(t,function(t,r,i){return!e.call(n,t,r,i)},n)},j.every=j.all=function(t,e,n){e||(e=j.identity);var r=!0;return null==t?r:y&&t.every===y?t.every(e,n):(k(t,function(t,o,a){return(r=r&&e.call(n,t,o,a))?void 0:i}),!!r)};var I=j.some=j.any=function(t,e,n){e||(e=j.identity);var r=!1;return null==t?r:b&&t.some===b?t.some(e,n):(k(t,function(t,o,a){return r||(r=e.call(n,t,o,a))?i:void 0}),!!r)};j.contains=j.include=function(t,e){return null==t?!1:x&&t.indexOf===x?-1!=t.indexOf(e):I(t,function(t){return t===e})},j.invoke=function(t,e){var n=c.call(arguments,2),r=j.isFunction(e);return j.map(t,function(t){return(r?e:t[e]).apply(t,n)})},j.pluck=function(t,e){return j.map(t,function(t){return t[e]})},j.where=function(t,e,n){return j.isEmpty(e)?n?void 0:[]:j[n?"find":"filter"](t,function(t){for(var n in e)if(e[n]!==t[n])return!1;return!0})},j.findWhere=function(t,e){return j.where(t,e,!0)},j.max=function(t,e,n){if(!e&&j.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&j.isEmpty(t))return-1/0;var r={computed:-1/0,value:-1/0};return k(t,function(t,i,o){var a=e?e.call(n,t,i,o):t;a>r.computed&&(r={value:t,computed:a})}),r.value},j.min=function(t,e,n){if(!e&&j.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&j.isEmpty(t))return 1/0;var r={computed:1/0,value:1/0};return k(t,function(t,i,o){var a=e?e.call(n,t,i,o):t;ar||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var N=function(t){return function(e,n,r){var i={},o=null==n?j.identity:C(n);return k(e,function(n,a){var s=o.call(r,n,a,e);t(i,s,n)}),i}};j.groupBy=N(function(t,e,n){(j.has(t,e)?t[e]:t[e]=[]).push(n)}),j.indexBy=N(function(t,e,n){t[e]=n}),j.countBy=N(function(t,e){j.has(t,e)?t[e]++:t[e]=1}),j.sortedIndex=function(t,e,n,r){n=null==n?j.identity:C(n);for(var i=n.call(r,e),o=0,a=t.length;a>o;){var s=o+a>>>1;n.call(r,t[s])=0})})},j.difference=function(t){var e=f.apply(o,c.call(arguments,1));return j.filter(t,function(t){return!j.contains(e,t)})},j.zip=function(){for(var t=j.max(j.pluck(arguments,"length").concat(0)),e=new Array(t),n=0;t>n;n++)e[n]=j.pluck(arguments,""+n);return e},j.object=function(t,e){if(null==t)return{};for(var n={},r=0,i=t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},j.indexOf=function(t,e,n){if(null==t)return-1;var r=0,i=t.length;if(n){if("number"!=typeof n)return r=j.sortedIndex(t,e),t[r]===e?r:-1;r=0>n?Math.max(0,i+n):n}if(x&&t.indexOf===x)return t.indexOf(e,n);for(;i>r;r++)if(t[r]===e)return r;return-1},j.lastIndexOf=function(t,e,n){if(null==t)return-1;var r=null!=n;if(w&&t.lastIndexOf===w)return r?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var i=r?n:t.length;i--;)if(t[i]===e)return i;return-1},j.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=0,o=new Array(r);r>i;)o[i++]=t,t+=n;return o};var L=function(){};j.bind=function(t,e){var n,r;if(S&&t.bind===S)return S.apply(t,c.call(arguments,1));if(!j.isFunction(t))throw new TypeError;return n=c.call(arguments,2),r=function(){if(!(this instanceof r))return t.apply(e,n.concat(c.call(arguments)));L.prototype=t.prototype;var i=new L;L.prototype=null;var o=t.apply(i,n.concat(c.call(arguments)));return Object(o)===o?o:i}},j.partial=function(t){var e=c.call(arguments,1);return function(){return t.apply(this,e.concat(c.call(arguments)))}},j.bindAll=function(t){var e=c.call(arguments,1);if(0===e.length)throw new Error("bindAll must be passed function names");return k(e,function(e){t[e]=j.bind(t[e],t)}),t},j.memoize=function(t,e){var n={};return e||(e=j.identity),function(){var r=e.apply(this,arguments);return j.has(n,r)?n[r]:n[r]=t.apply(this,arguments)}},j.delay=function(t,e){var n=c.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},j.defer=function(t){return j.delay.apply(j,[t,1].concat(c.call(arguments,1)))},j.throttle=function(t,e,n){var r,i,o,a=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:new Date,a=null,o=t.apply(r,i)};return function(){var c=new Date;s||n.leading!==!1||(s=c);var f=e-(c-s);return r=this,i=arguments,0>=f?(clearTimeout(a),a=null,s=c,o=t.apply(r,i)):a||n.trailing===!1||(a=setTimeout(u,f)),o}},j.debounce=function(t,e,n){var r,i,o,a,s;return function(){o=this,i=arguments,a=new Date;var u=function(){var c=new Date-a;e>c?r=setTimeout(u,e-c):(r=null,n||(s=t.apply(o,i)))},c=n&&!r;return r||(r=setTimeout(u,e)),c&&(s=t.apply(o,i)),s}},j.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},j.wrap=function(t,e){return function(){var n=[t];return u.apply(n,arguments),e.apply(this,n)}},j.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},j.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},j.keys=E||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var n in t)j.has(t,n)&&e.push(n);return e},j.values=function(t){for(var e=j.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=t[e[i]];return r},j.pairs=function(t){for(var e=j.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=[e[i],t[e[i]]];return r},j.invert=function(t){for(var e={},n=j.keys(t),r=0,i=n.length;i>r;r++)e[t[n[r]]]=n[r];return e},j.functions=j.methods=function(t){var e=[];for(var n in t)j.isFunction(t[n])&&e.push(n);return e.sort()},j.extend=function(t){return k(c.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},j.pick=function(t){var e={},n=f.apply(o,c.call(arguments,1));return k(n,function(n){n in t&&(e[n]=t[n])}),e},j.omit=function(t){var e={},n=f.apply(o,c.call(arguments,1));for(var r in t)j.contains(n,r)||(e[r]=t[r]);return e},j.defaults=function(t){return k(c.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t},j.clone=function(t){return j.isObject(t)?j.isArray(t)?t.slice():j.extend({},t):t},j.tap=function(t,e){return e(t),t};var T=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof j&&(t=t._wrapped),e instanceof j&&(e=e._wrapped);var i=l.call(t);if(i!=l.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=n.length;o--;)if(n[o]==t)return r[o]==e;var a=t.constructor,s=e.constructor;if(a!==s&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(s)&&s instanceof s))return!1;n.push(t),r.push(e);var u=0,c=!0;if("[object Array]"==i){if(u=t.length,c=u==e.length)for(;u--&&(c=T(t[u],e[u],n,r)););}else{for(var f in t)if(j.has(t,f)&&(u++,!(c=j.has(e,f)&&T(t[f],e[f],n,r))))break;if(c){for(f in e)if(j.has(e,f)&&!u--)break;c=!u}}return n.pop(),r.pop(),c};j.isEqual=function(t,e){return T(t,e,[],[])},j.isEmpty=function(t){if(null==t)return!0;if(j.isArray(t)||j.isString(t))return 0===t.length;for(var e in t)if(j.has(t,e))return!1;return!0},j.isElement=function(t){return!(!t||1!==t.nodeType)},j.isArray=_||function(t){return"[object Array]"==l.call(t)},j.isObject=function(t){return t===Object(t)},k(["Arguments","Function","String","Number","Date","RegExp"],function(t){j["is"+t]=function(e){return l.call(e)=="[object "+t+"]"}}),j.isArguments(arguments)||(j.isArguments=function(t){return!(!t||!j.has(t,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(t){return"function"==typeof t}),j.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},j.isNaN=function(t){return j.isNumber(t)&&t!=+t},j.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==l.call(t)},j.isNull=function(t){return null===t},j.isUndefined=function(t){return void 0===t},j.has=function(t,e){return p.call(t,e)},j.noConflict=function(){return t._=r,this},j.identity=function(t){return t},j.times=function(t,e,n){for(var r=Array(Math.max(0,t)),i=0;t>i;i++)r[i]=e.call(n,i);return r},j.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))};var q={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};q.unescape=j.invert(q.escape);var B={escape:new RegExp("["+j.keys(q.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(q.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(t){j[t]=function(e){return null==e?"":(""+e).replace(B[t],function(e){return q[t][e]})}}),j.result=function(t,e){if(null==t)return void 0;var n=t[e];return j.isFunction(n)?n.call(t):n},j.mixin=function(t){k(j.functions(t),function(e){var n=j[e]=t[e];j.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),R.call(this,n.apply(j,t))}})};var M=0;j.uniqueId=function(t){var e=++M+"";return t?t+e:e},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g}; -var F=/(.)^/,U={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(t,e,n){var r;n=j.defaults({},n,j.templateSettings);var i=new RegExp([(n.escape||F).source,(n.interpolate||F).source,(n.evaluate||F).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,n,r,i,s){return a+=t.slice(o,s).replace(z,function(t){return"\\"+U[t]}),n&&(a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(a+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),o=s+e.length,e}),a+="';\n",n.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(n.variable||"obj","_",a)}catch(s){throw s.source=a,s}if(e)return r(e,j);var u=function(t){return r.call(this,t,j)};return u.source="function("+(n.variable||"obj")+"){\n"+a+"}",u},j.chain=function(t){return j(t).chain()};var R=function(t){return this._chain?j(t).chain():t};j.mixin(j),k(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];j.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],R.call(this,n)}}),k(["concat","join","slice"],function(t){var e=o[t];j.prototype[t]=function(){return R.call(this,e.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this)},{}],97:[function(t,e){function n(){this.callbacks={}}e.exports=n,n.prototype.on=function(t){var e=3===arguments.length,n=e?arguments[1]:void 0,r=e?arguments[2]:arguments[1];return r._groupName=n,(this.callbacks[t]=this.callbacks[t]||[]).push(r),this},n.prototype.once=function(t){function e(){n.off(t,e),o.apply(this,arguments)}var n=this,r=3===arguments.length,i=r?arguments[1]:void 0,o=r?arguments[2]:arguments[1];return this.on(t,i,e),this},n.prototype.releaseGroup=function(t){var e,n,r,i;for(e in this.callbacks)for(i=this.callbacks[e],n=0,r=i.length;r>n;n++)i[n]._groupName===t&&(i.splice(n,1),n--,r--);return this},n.prototype.off=function(t,e){var n,r=this.callbacks[t];return r?1===arguments.length?(delete this.callbacks[t],this):(n=r.indexOf(e),r.splice(n,1),this):this},n.prototype.emit=function(t){var e,n,r=[].slice.call(arguments,1),i=this.callbacks[t],o=this.getWildcardCallbacks(t);if(i)for(e=0,n=i.length;n>e&&i[e];++e)i[e].apply(this,r);if(o)for(e=0,n=o.length;n>e&&o[e];++e)o[e].apply(this,[t].concat(r));return this},n.prototype.getWildcardCallbacks=function(t){var e,n,r=[];for(e in this.callbacks)n=e.split("*"),("*"===e||2===n.length&&t.slice(0,n[1].length)===n[1])&&(r=r.concat(this.callbacks[e]));return r}},{}]},{},[1])(1)}); \ No newline at end of file +e.exports=n},{"global/window":74,once:75}],74:[function(t,e){var n=self;e.exports="undefined"!=typeof window?window:"undefined"!=typeof n?n:{}},{}],75:[function(t,e){function n(t){var e=!1;return function(){return e?void 0:(e=!0,t.apply(this,arguments))}}e.exports=n,n.proto=n(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0})})},{}],76:[function(e,n,r){var i=self;!function(e){function o(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function a(t){t.length=0,v.lengthk;k++)r+="m='"+t.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",t.i||(r+="||(!v[m]&&r[m]!==y[m])"),r+="){"+t.f+"}";r+="}"}return(t.b||K.nonEnumArgs)&&(r+="}"),r+=t.c+";return C",e=e("i,j,l,n,o,q,t,u,y,z,w,G,H,J",n+r+"}"),s(t),e(I,F,P,f,Q,d,te,u,U,T,V,L,z,W)}function f(t){return W.call(t)==E}function l(t,e,n,r,i,s){var c=n===b;if("function"==typeof n&&!c){n=u.createCallback(n,r,2);var h=n(t,e);if("undefined"!=typeof h)return!!h}if(t===e)return 0!==t||1/t==1/e;var d=typeof t,m=typeof e;if(t===t&&(!t||"function"!=d&&"object"!=d)&&(!e||"function"!=m&&"object"!=m))return!1;if(null==t||null==e)return t===e;if(m=W.call(t),d=W.call(e),m==E&&(m=N),d==E&&(d=N),m!=d)return!1;switch(m){case j:case A:return+t==+e;case C:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case O:case L:return t==e+""}if(d=m==S,!d){if(P.call(t,"__wrapped__")||P.call(e,"__wrapped__"))return l(t.__wrapped__||t,e.__wrapped__||e,n,r,i,s);if(m!=N||!K.nodeClass&&(o(t)||o(e)))return!1;var m=!K.argsObject&&f(t)?Object:t.constructor,g=!K.argsObject&&f(e)?Object:e.constructor;if(!(m==g||p(m)&&m instanceof m&&p(g)&&g instanceof g))return!1}for(g=!i,i||(i=v.pop()||[]),s||(s=v.pop()||[]),m=i.length;m--;)if(i[m]==t)return s[m]==e;var y=0,h=!0;if(i.push(t),s.push(e),d){if(m=t.length,y=e.length,h=y==t.length,!h&&!c)return h;for(;y--;)if(d=m,g=e[y],c)for(;d--&&!(h=l(t[d],g,n,r,i,s)););else if(!(h=l(t[y],g,n,r,i,s)))break;return h}return ne(e,function(e,o,a){return P.call(a,o)?(y++,h=P.call(t,o)&&l(t[o],e,n,r,i,s)):void 0}),h&&!c&&ne(t,function(t,e,n){return P.call(n,e)?h=-1<--y:void 0}),g&&(a(i),a(s)),h}function p(t){return"function"==typeof t}function h(t){return!(!t||!T[typeof t])}function d(t){return"string"==typeof t||W.call(t)==L}function m(t,e,n){if(e&&"undefined"==typeof n&&Q(t)){n=-1;for(var r=t.length;++n3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),ne=c(G,M,{i:!1});p(/x/)&&(p=function(t){return"function"==typeof t&&"[object Function]"==W.call(t)}),u.assign=$,u.createCallback=function(t,e,n){if(null==t)return g;var r=typeof t;if("function"!=r){if("object"!=r)return function(e){return e[t]};var i=te(t);return function(e){for(var n=i.length,r=!1;n--&&(r=l(e[i[n]],t[i[n]],b)););return r}}return"undefined"==typeof e||w&&!w.test(R.call(t))?t:1===n?function(n){return t.call(e,n)}:2===n?function(n,r){return t.call(e,n,r)}:4===n?function(n,r,i,o){return t.call(e,n,r,i,o)}:function(n,r,i){return t.call(e,n,r,i)}},u.forEach=m,u.forIn=ne,u.keys=te,u.each=m,u.extend=$,u.identity=g,u.isArguments=f,u.isArray=Q,u.isEqual=l,u.isFunction=p,u.isObject=h,u.isString=d,u.VERSION="1.3.1","function"==typeof t&&"object"==typeof t.amd&&t.amd?(e._=u,t(function(){return u})):q&&!q.nodeType?B?(B.exports=u)._=u:q._=u:e._=u}(this)},{}],77:[function(t,e){"use strict";var n=t("lodash"),r=t("./lib/core"),i=t("./lib/helpers"),o=t("./lib/types");e.exports=n.extend({},r,i,o)},{"./lib/core":78,"./lib/helpers":79,"./lib/types":80,lodash:81}],78:[function(t,e,n){"use strict";function r(t){var e=t.prototype._NS+"|"+t.prototype._EL;c[e]=t,l[e]=t}function i(t){return u.serializeToString(t)}function o(t){var e,n={},r={constructor:!0,_EL:!0,_NS:!0,_extensions:!0,_name:!0,parent:!0,prototype:!0,toJSON:!0,toString:!0,xml:!0};for(e in t._extensions)t._extensions[e].toJSON&&(n[e]=t._extensions[e].toJSON());for(e in t)if(!r[e]&&!(f[t._NS+"|"+t._EL]||{})[e]&&!t._extensions[e]&&"_"!==e[0]){var i=t[e];if("function"==typeof i)continue;var o=Object.prototype.toString.call(i);o.indexOf("Object")>=0?Object.keys(i).length>0&&(n[e]=i):o.indexOf("Array")>=0?i.length>0&&(n[e]=i):i&&(n[e]=i)}return n}var a=t("underscore");t("./helpers").find;var s=t("./types"),u=new XMLSerializer,c={},f={},l={};n.build=function(t){var e=l[t.namespaceURI+"|"+t.localName];return e?new e(null,t):void 0},n.extend=function(t,e,r){var i=t.prototype._NS+"|"+t.prototype._EL,o=e.prototype._name,a=e.prototype._NS+"|"+e.prototype._EL;c[a]=e,f[a]||(f[a]={}),f[i]||(f[i]={}),f[i][o]=e,n.add(t,o,s.extension(e)),r&&n.add(t,r,s.multiExtension(e))},n.add=function(t,e,n){n.get&&t.prototype.__defineGetter__(e,n.get),n.set&&t.prototype.__defineSetter__(e,n.set)},n.define=function(t){var e=function(e,n){var r=this;return r.xml=n||document.createElementNS(r._NS,r._EL),r.xml.parentNode&&r.xml.parentNode.namespaceURI===r._NS||r.xml.setAttribute("xmlns",r._NS),r._extensions={},a.each(r.xml.childNodes,function(t){var e=t.namespaceURI+"|"+t.localName,n=c[e];if(void 0!==n){var i=n.prototype._name;r._extensions[i]=new n(null,t),r._extensions[i].parent=r}}),a.extend(r,e),t.init&&t.init(e),r};e.prototype={constructor:{value:e},_name:t.name,_eventname:t.eventName,_NS:t.namespace,_EL:t.element,toString:function(){return i(this.xml)},toJSON:function(){return o(this)}};var s=Object.keys(t.fields||{});return s.forEach(function(r){n.add(e,r,t.fields[r])}),t.topLevel&&r(e),e}},{"./helpers":79,"./types":80,underscore:96}],79:[function(t,e,n){"use strict";var r=t("underscore"),i="http://www.w3.org/XML/1998/namespace";n.getParser=function(){return new DOMParser},n.createElement=function(t,e){return document.createElement(t,e)};var o=n.find=function(t,e,n){var i=t.querySelectorAll(n);return r.filter(i,function(n){return n.namespaceURI===e&&n.parentNode==t})};n.findOrCreate=function(t,e,r){var i=n.find(t,e,r);if(i.length)return i[0];var o=document.createElementNS(e,r);return t.appendChild(o),o},n.getAttribute=function(t,e,n){return t.getAttribute(e)||n||""},n.setAttribute=function(t,e,n,r){n||r?t.setAttribute(e,n):t.removeAttribute(e)},n.getBoolAttribute=function(t,e,n){var r=t.getAttribute(e)||n||"";return"true"===r||"1"===r},n.setBoolAttribute=function(t,e,n){n?t.setAttribute(e,"1"):t.removeAttribute(e)},n.getSubAttribute=function(t,e,n,r,i){var a=o(t,e,n);if(!a)return"";for(var s=0;s-1?0:-1:t?0:-1}function a(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:_+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function s(t){return t.charCodeAt(0)}function u(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||"undefined"==typeof n)return 1;if(r>n||"undefined"==typeof r)return-1}return t.index-e.index}function c(t){var e=-1,n=t.length,r=t[0],i=t[0|n/2],o=t[n-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&o&&"object"==typeof o)return!1;var s=p();s["false"]=s["null"]=s["true"]=s.undefined=!1;var u=p();for(u.array=t,u.cache=s,u.push=a;++ei?0:i);++r-1:void 0}),g&&(d(i),d(o)),a}function S(t,e,n,r,i){(Hr(e)?We:ii)(e,function(e,o){var a,s,u=e,c=t[o];if(e&&((s=Hr(e))||oi(e))){for(var f=r.length;f--;)if(a=r[f]==e){c=i[f];break}if(!a){var l;n&&(u=n(c,e),(l="undefined"!=typeof u)&&(c=u)),l||(c=s?Hr(c)?c:[]:oi(c)?c:{}),r.push(e),i.push(c),l||S(c,e,n,r,i)}}else n&&(u=n(c,e),"undefined"==typeof u&&(u=e)),"undefined"!=typeof u&&(c=u);t[o]=c})}function K(t,n,r){var i=-1,a=ie(),s=t?t.length:0,u=[],f=!n&&s>=E&&a===e,p=r||f?l():u;if(f){var h=c(p);h?(a=o,p=h):(f=!1,p=r?p:(d(p),u))}for(;++i3&&"function"==typeof e[n-2])var r=a(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var i=Dr.call(arguments,1,n),o=-1,s=l(),u=l();++on?Ur(0,o+n):n)||0,Hr(t)?a=i(t,e,n)>-1:"number"==typeof o?a=(Ce(t)?t.indexOf(e,n):i(t,e,n))>-1:ii(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function ze(t,e,r){var i=!0;e=n.createCallback(e,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++oo&&(o=c)}else e=!e&&Ce(t)?s:n.createCallback(e,r,3),We(t,function(t,n,r){var a=e(t,n,r);a>i&&(i=a,o=t)});return o}function He(t,e,r){var i=1/0,o=i;if(!e&&Hr(t))for(var a=-1,u=t.length;++ac&&(o=c)}else e=!e&&Ce(t)?s:n.createCallback(e,r,3),We(t,function(t,n,r){var a=e(t,n,r);i>a&&(i=a,o=t)});return o}function Ve(t,e){var n=-1,r=t?t.length:0;if("number"==typeof r)for(var i=ir(r);++n=E&&r===e;if(u){var f=c(a);f?(r=o,a=f):u=!1}for(;++nr?Ur(0,i+r):r||0}else if(r){var o=wn(t,n);return t[o]===n?o:-1}return e(t,n,r)}function hn(t,e,r){var i=0,o=t?t.length:0;if("number"!=typeof e&&null!=e){var a=o;for(e=n.createCallback(e,r,3);a--&&e(t[a],a,t);)i++}else i=null==e||r?1:e||i;return g(t,0,zr(Ur(0,o-i),o))}function dn(t){for(var n=arguments,r=n.length,i=-1,a=l(),s=-1,u=ie(),f=t?t.length:0,p=[],h=l();++i=E&&c(i?n[i]:h)}t:for(;++sn?Ur(0,r+n):zr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function vn(t){for(var e=arguments,n=0,r=e.length,i=t?t.length:0;++no;){var s=o+a>>>1;r(t[s])1?arguments:arguments[0],e=-1,n=t?Xe(Ve(t,"length")):0,r=ir(0>n?0:n);++e2?Z(t,17,Dr.call(arguments,2),null,e):Z(t,1,null,null,e)}function Cn(t){for(var e=arguments.length>1?b(arguments,!0,!1,1):de(t),n=-1,r=e.length;++n2?Z(e,19,Dr.call(arguments,2),null,t):Z(e,3,null,null,t)}function On(){for(var t=arguments,e=t.length;e--;)if(!Ee(t[e]))throw new hr;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function Ln(t,e,n){var r=typeof t;if(null==t||"function"==r)return a(t,e,n);if("object"!=r)return function(e){return e[t]};var i=Kr(t),o=i[0],s=t[o];return 1!=i.length||s!==s||Se(s)?function(e){for(var n=i.length,r=!1;n--&&(r=x(e[i[n]],t[i[n]],null,!0)););return r}:function(t){var e=t[o];return s===e&&(0!==s||1/s==1/e)}}function Tn(t,e){return e="number"==typeof e?e:+e||t.length,Z(t,4,null,null,null,e)}function qn(t,e,n){var r,i,o,a,s,u,c,f=0,l=!1,p=!0;if(!Ee(t))throw new hr;if(e=Ur(0,e)||0,n===!0){var h=!0;p=!1}else Se(n)&&(h=n.leading,l="maxWait"in n&&(Ur(e,n.maxWait)||0),p="trailing"in n?n.trailing:p);var d=function(){var n=e-(Sr()-a);if(0>=n){i&&br(i);var l=c;i=u=c=y,l&&(f=Sr(),o=t.apply(s,r))}else u=Ar(d,n)},m=function(){u&&br(u),i=u=c=y,(p||l!==e)&&(f=Sr(),o=t.apply(s,r))};return function(){if(r=arguments,a=Sr(),s=this,c=p&&(u||!h),l===!1)var n=h&&!u;else{i||h||(f=a);var g=l-(a-f);0>=g?(i&&(i=br(i)),f=a,o=t.apply(s,r)):i||(i=Ar(m,g))}return u||e===l||(u=Ar(d,e)),n&&(o=t.apply(s,r)),o}}function Bn(t){if(!Ee(t))throw new hr;var e=Dr.call(arguments,1);return Ar(function(){t.apply(y,e)},1)}function Mn(t,e){if(!Ee(t))throw new hr;var n=Dr.call(arguments,2);return Ar(function(){t.apply(y,n)},e)}function Fn(t,e){if(!Ee(t))throw new hr;var n=function(){var r=n.cache,i=e?e.apply(this,arguments):_+arguments[0];return Er.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return n.cache={},n}function Un(t){var e,n;if(!Ee(t))throw new hr;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function zn(t){return Z(t,16,Dr.call(arguments,1))}function Rn(t){return Z(t,32,null,Dr.call(arguments,1))}function Pn(t,e,n){var r=!0,i=!0;if(!Ee(t))throw new hr;n===!1?r=!1:Se(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),n=p(),n.leading=r,n.maxWait=e,n.trailing=i;var o=qn(t,e,n);return m(n),o}function Dn(t,e){if(!Ee(e))throw new hr;return function(){var n=[t];return jr.apply(n,arguments),e.apply(this,n)}}function Wn(t){return null==t?"":pr(t).replace(ti,re) +}function Jn(t){return t}function Gn(t,e){var i=t,o=!e||Ee(i);e||(i=r,e=t,t=n),We(de(e),function(n){var r=t[n]=e[n];o&&(i.prototype[n]=function(){var e=this.__wrapped__,n=[e];jr.apply(n,arguments);var o=r.apply(t,n);return e&&"object"==typeof e&&e===o?this:new i(o)})})}function $n(){return t._=gr,this}function Xn(t,e,n){var r=null==t,i=null==e;null==n&&("boolean"==typeof t&&i?(n=t,t=1):i||"boolean"!=typeof e||(n=e,i=!0)),r&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0;var o=Pr();return n||t%1||e%1?t+zr(o*(e-t+parseFloat("1e-"+((o+"").length-1))),e):t+xr(o*(e-t+1))}function Hn(t,e){if(t){var n=t[e];return Ee(n)?t[e]():n}}function Vn(t,e,r){var i=n.templateSettings;t||(t=""),r=ni({},r,i);var o,a=ni({},r.imports,i.imports),s=Kr(a),u=Me(a),c=0,l=r.interpolate||q,p="__p += '",h=lr((r.escape||q).source+"|"+l.source+"|"+(l===L?C:q).source+"|"+(r.evaluate||q).source+"|$","g");t.replace(h,function(e,n,r,i,a,s){return r||(r=i),p+=t.slice(c,s).replace(M,f),n&&(p+="' +\n__e("+n+") +\n'"),a&&(o=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=s+e.length,e}),p+="';\n";var d=r.variable,m=d;m||(d="obj",p="with ("+d+") {\n"+p+"\n}\n"),p=(o?p.replace(k,""):p).replace(A,"$1").replace(I,"$1;"),p="function("+d+") {\n"+(m?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+U++ +"]")+"\n*/";try{var v=sr(s,"return "+p+g).apply(y,u)}catch(b){throw b.source=p,b}return e?v(e):(v.source=p,v)}function Kn(t,e,n){t=(t=+t)>-1?t:0;var r=-1,i=ir(t);for(e=a(e,n,1);++r/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:L,variable:"",imports:{_:n}};var Xr=Or?function(t,e){var n=p();n.value=e,Or(t,"__bindData__",n),m(n)}:h,Hr=qr||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Cr.call(t)==R||!1},Vr=function(t){var e,n=t,r=[];if(!n)return r;if(!V[typeof t])return r;for(e in n)Er.call(n,e)&&r.push(e);return r},Kr=Fr?function(t){return Se(t)?Fr(t):[]}:Vr,Yr={"&":"&","<":"<",">":">",'"':""","'":"'"},Qr=ge(Yr),Zr=lr("("+Kr(Qr).join("|")+")","g"),ti=lr("["+Kr(Yr).join("")+"]","g"),ei=function(t,e,n){var r,i=t,o=i;if(!i)return o;var s=arguments,u=0,c="number"==typeof n?2:s.length;if(c>3&&"function"==typeof s[c-2])var f=a(s[--c-1],s[c--],2);else c>2&&"function"==typeof s[c-1]&&(f=s[--c]);for(;++u/g,T=RegExp("^["+j+"]*0+(?=.$)"),q=/($^)/,B=/\bthis\b/,M=/['\n\r\t\u2028\u2029\\]/g,F=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setImmediate","setTimeout"],U=0,z="[object Arguments]",R="[object Array]",P="[object Boolean]",D="[object Date]",W="[object Function]",J="[object Number]",G="[object Object]",$="[object RegExp]",X="[object String]",H={};H[W]=!1,H[z]=H[R]=H[P]=H[D]=H[J]=H[G]=H[$]=H[X]=!0;var V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},K={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},Y=V[typeof window]&&window||this,Q=V[typeof r]&&r&&!r.nodeType&&r,Z=V[typeof n]&&n&&!n.nodeType&&n,te=Z&&Z.exports===Q&&Q,ee=V[typeof i]&&i;!ee||ee.global!==ee&&ee.window!==ee||(Y=ee);var ne=v();"function"==typeof t&&"object"==typeof t.amd&&t.amd?(Y._=ne,t(function(){return ne})):Q&&Z?te?(Z.exports=ne)._=ne:Q._=ne:Y._=ne}.call(this)},{}],82:[function(e,n){var r=e("__browserify_Buffer").Buffer;!function(){function i(t,e,n){var r=e&&n||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){16>i&&(e[r+i++]=g[t])});16>i;)e[r+i++]=0;return e}function o(t,e){var n=e||0,r=m;return r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]}function a(t,e,n){var r=e&&n||0,i=e||[];t=t||{};var a=null!=t.clockseq?t.clockseq:x,s=null!=t.msecs?t.msecs:(new Date).getTime(),u=null!=t.nsecs?t.nsecs:_+1,c=s-w+(u-_)/1e4;if(0>c&&null==t.clockseq&&(a=16383&a+1),(0>c||s>w)&&null==t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");w=s,_=u,x=a,s+=122192928e5;var f=(1e4*(268435455&s)+u)%4294967296;i[r++]=255&f>>>24,i[r++]=255&f>>>16,i[r++]=255&f>>>8,i[r++]=255&f;var l=268435455&1e4*(s/4294967296);i[r++]=255&l>>>8,i[r++]=255&l,i[r++]=16|15&l>>>24,i[r++]=255&l>>>16,i[r++]=128|a>>>8,i[r++]=255&a;for(var p=t.node||b,h=0;6>h;h++)i[r+h]=p[h];return e?e:o(i)}function s(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"==t?new d(16):null,t=null),t=t||{};var i=t.random||(t.rng||u)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],e)for(var a=0;16>a;a++)e[r+a]=i[a];return e||o(i)}var u,c=this;if("function"==typeof e)try{var f=e("crypto").randomBytes;u=f&&function(){return f(16)}}catch(l){}if(!u&&c.crypto&&crypto.getRandomValues){var p=new Uint8Array(16);u=function(){return crypto.getRandomValues(p),p}}if(!u){var h=new Array(16);u=function(){for(var t,e=0;16>e;e++)0===(3&e)&&(t=4294967296*Math.random()),h[e]=255&t>>>((3&e)<<3);return h}}for(var d="function"==typeof r?r:Array,m=[],g={},v=0;256>v;v++)m[v]=(v+256).toString(16).substr(1),g[m[v]]=v;var y=u(),b=[1|y[0],y[1],y[2],y[3],y[4],y[5]],x=16383&(y[6]<<8|y[7]),w=0,_=0,E=s;if(E.v1=a,E.v4=s,E.parse=i,E.unparse=o,E.BufferClass=d,c.define&&t.amd)t(function(){return E});else if("undefined"!=typeof n&&n.exports)n.exports=E;else{var S=c.uuid;E.noConflict=function(){return c.uuid=S,E},c.uuid=E}}()},{__browserify_Buffer:68,crypto:63}],83:[function(t,e,n){function r(t){c.call(this),this.registry=new Object,this.insureids=0,this.freq=void 0===t?5:t,this.run=!1,this.start()}function i(t,e,n,r){void 0===r&&(++this.insureids,this.insureids%=65e3,r=this.insureids),expiretime=Date.now()+1e3*e;var i=this,o={paddle:i,error_callback:t,args:n,id:r,timeout:expiretime,done:!1,check_in:function(){return this.paddle.check_in(this.id)}};return this.registry[r]=o,o}function o(t){return void 0!==t.id&&(t=t.id),t in this.registry?(this.emit("check_in",this.registry[t]),this.registry[t].done=!0,delete this.registry[t],!0):!1}function a(){var t=Date.now();for(var e in this.registry)t>this.registry[e].timeout&&(this.registry[e].error_callback.apply(this,this.registry[e].args),this.emit("timeout",this.registry[e]),delete this.registry[e]);this.run&&setTimeout(function(){this.checkEnsures()}.bind(this),1e3*this.freq)}function s(t){return void 0!==t&&(this.freq=t),this.run?!1:(this.run=!0,setTimeout(function(){this.checkEnsures()}.bind(this),1e3*this.freq),!0)}function u(){return this.run?(this.run=!1,!0):!0}var c=t("events").EventEmitter;r.super_=c,r.prototype=Object.create(c.prototype,{constructor:{value:r,enumerable:!1}}),r.prototype.insure=i,r.prototype.check_in=o,r.prototype.checkEnsures=a,r.prototype.start=s,r.prototype.stop=u,n.Paddle=r},{events:58}],84:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="ANONYMOUS",n.prototype.clientFirst=!0,n.prototype.response=function(t){return t.trace||""},n.prototype.challenge=function(){},t=e.exports=n})},{}],85:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":84}],86:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("crypto")):"function"==typeof t&&t.amd&&t(["exports","module","crypto"],o)}(this,function(t,e,n){function r(t){t=t||{},this._genNonce=t.genNonce||o(32)}function i(t){for(var e={},n=t.split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,i=n.length;i>r;r++){var o=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);o&&(e[o[1]]=o[2])}return e}function o(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;return function(){for(var r=[],i=0;t>i;++i)r.push(e[0|Math.random()*n]);return r.join("")}}function a(t,e){return n.createHash("md5").update(t).digest(e||"hex")}r.prototype.name="DIGEST-MD5",r.prototype.clientFirst=!1,r.prototype.response=function(t){var e=t.serviceType+"/"+t.host;t.serviceName&&t.host!==t.serviceName&&(e+="/"+serviceName);var n,r,i,o=t.realm||this._realm||"",s=this._genNonce(),u="00000001",c="auth",f="";return f+='username="'+t.username+'"',o&&(f+=',realm="'+o+'"'),f+=',nonce="'+this._nonce+'"',f+=',cnonce="'+s+'"',f+=",nc="+u,f+=",qop="+c,f+=',digest-uri="'+e+'"',n=t.authzid?a(a(t.username+":"+o+":"+t.password,"binary")+":"+this._nonce+":"+s+":"+t.authzid):a(a(t.username+":"+o+":"+t.password,"binary")+":"+this._nonce+":"+s),"auth"==c?r=a("AUTHENTICATE:"+e):("auth-int"==c||"auth-conf"==c)&&(r=a("AUTHENTICATE:"+e+":00000000000000000000000000000000")),i=a(n+":"+this._nonce+":"+u+":"+s+":"+c+":"+r),f+=",response="+i,"utf-8"==this._charset&&(f+=",charset=utf-8"),t.authzid&&(f+='authzid="'+t.authzid+'"'),f},r.prototype.challenge=function(t){var e=i(t);return this._realm=e.realm,this._nonce=e.nonce,this._qop=(e.qop||"auth").split(","),this._stale=e.stale,this._maxbuf=parseInt(e.maxbuf)||65536,this._charset=e.charset,this._algo=e.algorithm,this._cipher=e.cipher,this._cipher&&this._cipher.split(","),this},t=e.exports=r})},{crypto:63}],87:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":86}],88:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="EXTERNAL",n.prototype.clientFirst=!0,n.prototype.response=function(t){return t.authzid||""},n.prototype.challenge=function(){},t=e.exports=n})},{}],89:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":88}],90:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){}n.prototype.name="PLAIN",n.prototype.clientFirst=!0,n.prototype.response=function(t){var e="";return e+=t.authzid||"",e+="\0",e+=t.username,e+="\0",e+=t.password},n.prototype.challenge=function(){return this},t=e.exports=n})},{}],91:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":90}],92:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("crypto"),e("buffer")):"function"==typeof t&&t.amd&&t(["exports","module","crypto","buffer"],o)}(this,function(t,e,n,r){function i(t){t=t||{},this._genNonce=t.genNonce||l(32),this._stage=0}function o(t,e){return n.createHmac("sha1",t).update(e).digest("binary")}function a(t,e,n){for(var r=o(t,e+"\0\0\0"),i=r,a=0;n-1>a;a++)r=o(t,r),i=u(i,r);return i}function s(t){return n.createHash("sha1").update(t).digest("binary")}function u(t,e){t=new p(t,"binary"),e=new p(e,"binary");var n=Math.min(t.length,e.length);result=[];for(var r=0;n>r;r++)result.push(t[r]^e[r]);return result=new p(result,"binary"),result.toString("binary")}function c(t){for(var e=[],n="",r=0;rr;r++){var o=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);o&&(e[o[1]]=o[2])}return e}function l(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;return function(){for(var r=[],i=0;t>i;++i)r.push(e[0|Math.random()*n]);return r.join("")}}var p=r.Buffer;i.prototype.name="SCRAM-SHA-1",i.prototype.clientFirst=!0,i.prototype.response=function(t){return h[this._stage](this,t)},i.prototype.challenge=function(t){var e=f(t);return this._salt=new p(e.s||"","base64").toString("binary"),this._iterationCount=parseInt(e.i,10),this._nonce=e.r,this._verifier=e.v,this._error=e.e,this._challenge=t,this};var h={};h[0]=function(t,e){t._cnonce=t._genNonce();var n="";e.authzid&&(n="a="+c(e.authzid)),t._gs2Header="n,"+n+",";var r="r="+t._cnonce,i="n="+c(e.username);t._clientFirstMessageBare=i+","+r;var o=t._gs2Header+t._clientFirstMessageBare;return t._stage=1,o},h[1]=function(t,e){var n=new p(t._gs2Header).toString("base64");t._clientFinalMessageWithoutProof="c="+n+",r="+t._nonce;var r,i,c;e.clientKey&&e.serverKey?(i=e.clientKey,c=e.serverKey):(r=e.saltedPassword||a(e.password,t._salt,t._iterationCount),i=o(r,"Client Key"),c=o(r,"Server Key"));var f=s(i),l=t._clientFirstMessageBare+","+t._challenge+","+t._clientFinalMessageWithoutProof,h=o(f,l),d=u(i,h),m=new p(d,"binary").toString("base64");t._serverSignature=o(c,l);var g=t._clientFinalMessageWithoutProof+",p="+m;return t._stage=2,t.cache={saltedPassword:r,clientKey:i,serverKey:c},g},h[2]=function(){return""},t=e.exports=i})},{buffer:61,crypto:63}],93:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/mechanism")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/mechanism"],o)}(this,function(t,e,n){t=e.exports=n,t.Mechanism=n})},{"./lib/mechanism":92}],94:[function(e,n,r){!function(e,i){"object"==typeof r?i(r,n):"function"==typeof t&&t.amd&&t(["exports","module"],i)}(this,function(t,e){function n(){this._mechs=[]}n.prototype.use=function(t,e){return e||(e=t,t=e.prototype.name),this._mechs.push({name:t,mech:e}),this},n.prototype.create=function(t){for(var e=0,n=this._mechs.length;n>e;e++)for(var r=0,i=t.length;i>r;r++){var o=this._mechs[e];if(o.name==t[r])return new o.mech}return null},t=e.exports=n})},{}],95:[function(e,n,r){!function(i,o){"object"==typeof r?o(r,n,e("./lib/factory")):"function"==typeof t&&t.amd&&t(["exports","module","./lib/factory"],o)}(this,function(t,e,n){t=e.exports=n,t.Factory=n})},{"./lib/factory":94}],96:[function(t,e,n){!function(){var t=this,r=t._,i={},o=Array.prototype,a=Object.prototype,s=Function.prototype,u=o.push,c=o.slice,f=o.concat,l=a.toString,p=a.hasOwnProperty,h=o.forEach,d=o.map,m=o.reduce,g=o.reduceRight,v=o.filter,y=o.every,b=o.some,x=o.indexOf,w=o.lastIndexOf,_=Array.isArray,E=Object.keys,S=s.bind,j=function(t){return t instanceof j?t:this instanceof j?(this._wrapped=t,void 0):new j(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=j),n._=j):t._=j,j.VERSION="1.5.2";var k=j.each=j.forEach=function(t,e,n){if(null!=t)if(h&&t.forEach===h)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(e.call(n,t[r],r,t)===i)return}else for(var a=j.keys(t),r=0,o=a.length;o>r;r++)if(e.call(n,t[a[r]],a[r],t)===i)return};j.map=j.collect=function(t,e,n){var r=[];return null==t?r:d&&t.map===d?t.map(e,n):(k(t,function(t,i,o){r.push(e.call(n,t,i,o))}),r)};var A="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),m&&t.reduce===m)return r&&(e=j.bind(e,r)),i?t.reduce(e,n):t.reduce(e);if(k(t,function(t,o,a){i?n=e.call(r,n,t,o,a):(n=t,i=!0)}),!i)throw new TypeError(A);return n},j.reduceRight=j.foldr=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),g&&t.reduceRight===g)return r&&(e=j.bind(e,r)),i?t.reduceRight(e,n):t.reduceRight(e);var o=t.length;if(o!==+o){var a=j.keys(t);o=a.length}if(k(t,function(s,u,c){u=a?a[--o]:--o,i?n=e.call(r,n,t[u],u,c):(n=t[u],i=!0)}),!i)throw new TypeError(A);return n},j.find=j.detect=function(t,e,n){var r;return I(t,function(t,i,o){return e.call(n,t,i,o)?(r=t,!0):void 0}),r},j.filter=j.select=function(t,e,n){var r=[];return null==t?r:v&&t.filter===v?t.filter(e,n):(k(t,function(t,i,o){e.call(n,t,i,o)&&r.push(t)}),r)},j.reject=function(t,e,n){return j.filter(t,function(t,r,i){return!e.call(n,t,r,i)},n)},j.every=j.all=function(t,e,n){e||(e=j.identity);var r=!0;return null==t?r:y&&t.every===y?t.every(e,n):(k(t,function(t,o,a){return(r=r&&e.call(n,t,o,a))?void 0:i}),!!r)};var I=j.some=j.any=function(t,e,n){e||(e=j.identity);var r=!1;return null==t?r:b&&t.some===b?t.some(e,n):(k(t,function(t,o,a){return r||(r=e.call(n,t,o,a))?i:void 0}),!!r)};j.contains=j.include=function(t,e){return null==t?!1:x&&t.indexOf===x?-1!=t.indexOf(e):I(t,function(t){return t===e})},j.invoke=function(t,e){var n=c.call(arguments,2),r=j.isFunction(e);return j.map(t,function(t){return(r?e:t[e]).apply(t,n)})},j.pluck=function(t,e){return j.map(t,function(t){return t[e]})},j.where=function(t,e,n){return j.isEmpty(e)?n?void 0:[]:j[n?"find":"filter"](t,function(t){for(var n in e)if(e[n]!==t[n])return!1;return!0})},j.findWhere=function(t,e){return j.where(t,e,!0)},j.max=function(t,e,n){if(!e&&j.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&j.isEmpty(t))return-1/0;var r={computed:-1/0,value:-1/0};return k(t,function(t,i,o){var a=e?e.call(n,t,i,o):t;a>r.computed&&(r={value:t,computed:a})}),r.value},j.min=function(t,e,n){if(!e&&j.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&j.isEmpty(t))return 1/0;var r={computed:1/0,value:1/0};return k(t,function(t,i,o){var a=e?e.call(n,t,i,o):t;ar||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var N=function(t){return function(e,n,r){var i={},o=null==n?j.identity:C(n);return k(e,function(n,a){var s=o.call(r,n,a,e);t(i,s,n)}),i}};j.groupBy=N(function(t,e,n){(j.has(t,e)?t[e]:t[e]=[]).push(n)}),j.indexBy=N(function(t,e,n){t[e]=n}),j.countBy=N(function(t,e){j.has(t,e)?t[e]++:t[e]=1}),j.sortedIndex=function(t,e,n,r){n=null==n?j.identity:C(n);for(var i=n.call(r,e),o=0,a=t.length;a>o;){var s=o+a>>>1;n.call(r,t[s])=0})})},j.difference=function(t){var e=f.apply(o,c.call(arguments,1));return j.filter(t,function(t){return!j.contains(e,t)})},j.zip=function(){for(var t=j.max(j.pluck(arguments,"length").concat(0)),e=new Array(t),n=0;t>n;n++)e[n]=j.pluck(arguments,""+n);return e},j.object=function(t,e){if(null==t)return{};for(var n={},r=0,i=t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},j.indexOf=function(t,e,n){if(null==t)return-1;var r=0,i=t.length;if(n){if("number"!=typeof n)return r=j.sortedIndex(t,e),t[r]===e?r:-1;r=0>n?Math.max(0,i+n):n}if(x&&t.indexOf===x)return t.indexOf(e,n);for(;i>r;r++)if(t[r]===e)return r;return-1},j.lastIndexOf=function(t,e,n){if(null==t)return-1;var r=null!=n;if(w&&t.lastIndexOf===w)return r?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var i=r?n:t.length;i--;)if(t[i]===e)return i;return-1},j.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=0,o=new Array(r);r>i;)o[i++]=t,t+=n;return o};var L=function(){};j.bind=function(t,e){var n,r;if(S&&t.bind===S)return S.apply(t,c.call(arguments,1));if(!j.isFunction(t))throw new TypeError;return n=c.call(arguments,2),r=function(){if(!(this instanceof r))return t.apply(e,n.concat(c.call(arguments)));L.prototype=t.prototype;var i=new L;L.prototype=null;var o=t.apply(i,n.concat(c.call(arguments)));return Object(o)===o?o:i}},j.partial=function(t){var e=c.call(arguments,1);return function(){return t.apply(this,e.concat(c.call(arguments)))}},j.bindAll=function(t){var e=c.call(arguments,1);if(0===e.length)throw new Error("bindAll must be passed function names");return k(e,function(e){t[e]=j.bind(t[e],t)}),t},j.memoize=function(t,e){var n={};return e||(e=j.identity),function(){var r=e.apply(this,arguments);return j.has(n,r)?n[r]:n[r]=t.apply(this,arguments)}},j.delay=function(t,e){var n=c.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},j.defer=function(t){return j.delay.apply(j,[t,1].concat(c.call(arguments,1)))},j.throttle=function(t,e,n){var r,i,o,a=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:new Date,a=null,o=t.apply(r,i)};return function(){var c=new Date;s||n.leading!==!1||(s=c);var f=e-(c-s);return r=this,i=arguments,0>=f?(clearTimeout(a),a=null,s=c,o=t.apply(r,i)):a||n.trailing===!1||(a=setTimeout(u,f)),o}},j.debounce=function(t,e,n){var r,i,o,a,s;return function(){o=this,i=arguments,a=new Date;var u=function(){var c=new Date-a;e>c?r=setTimeout(u,e-c):(r=null,n||(s=t.apply(o,i)))},c=n&&!r;return r||(r=setTimeout(u,e)),c&&(s=t.apply(o,i)),s}},j.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},j.wrap=function(t,e){return function(){var n=[t];return u.apply(n,arguments),e.apply(this,n)}},j.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},j.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},j.keys=E||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var n in t)j.has(t,n)&&e.push(n);return e},j.values=function(t){for(var e=j.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=t[e[i]];return r},j.pairs=function(t){for(var e=j.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=[e[i],t[e[i]]];return r},j.invert=function(t){for(var e={},n=j.keys(t),r=0,i=n.length;i>r;r++)e[t[n[r]]]=n[r];return e},j.functions=j.methods=function(t){var e=[];for(var n in t)j.isFunction(t[n])&&e.push(n);return e.sort()},j.extend=function(t){return k(c.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},j.pick=function(t){var e={},n=f.apply(o,c.call(arguments,1));return k(n,function(n){n in t&&(e[n]=t[n])}),e},j.omit=function(t){var e={},n=f.apply(o,c.call(arguments,1));for(var r in t)j.contains(n,r)||(e[r]=t[r]);return e},j.defaults=function(t){return k(c.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t},j.clone=function(t){return j.isObject(t)?j.isArray(t)?t.slice():j.extend({},t):t},j.tap=function(t,e){return e(t),t};var T=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof j&&(t=t._wrapped),e instanceof j&&(e=e._wrapped);var i=l.call(t);if(i!=l.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=n.length;o--;)if(n[o]==t)return r[o]==e;var a=t.constructor,s=e.constructor;if(a!==s&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(s)&&s instanceof s))return!1;n.push(t),r.push(e);var u=0,c=!0;if("[object Array]"==i){if(u=t.length,c=u==e.length)for(;u--&&(c=T(t[u],e[u],n,r)););}else{for(var f in t)if(j.has(t,f)&&(u++,!(c=j.has(e,f)&&T(t[f],e[f],n,r))))break;if(c){for(f in e)if(j.has(e,f)&&!u--)break;c=!u}}return n.pop(),r.pop(),c};j.isEqual=function(t,e){return T(t,e,[],[])},j.isEmpty=function(t){if(null==t)return!0;if(j.isArray(t)||j.isString(t))return 0===t.length;for(var e in t)if(j.has(t,e))return!1;return!0},j.isElement=function(t){return!(!t||1!==t.nodeType)},j.isArray=_||function(t){return"[object Array]"==l.call(t)},j.isObject=function(t){return t===Object(t)},k(["Arguments","Function","String","Number","Date","RegExp"],function(t){j["is"+t]=function(e){return l.call(e)=="[object "+t+"]"}}),j.isArguments(arguments)||(j.isArguments=function(t){return!(!t||!j.has(t,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(t){return"function"==typeof t}),j.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},j.isNaN=function(t){return j.isNumber(t)&&t!=+t},j.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==l.call(t)},j.isNull=function(t){return null===t},j.isUndefined=function(t){return void 0===t},j.has=function(t,e){return p.call(t,e)},j.noConflict=function(){return t._=r,this},j.identity=function(t){return t},j.times=function(t,e,n){for(var r=Array(Math.max(0,t)),i=0;t>i;i++)r[i]=e.call(n,i);return r},j.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))};var q={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};q.unescape=j.invert(q.escape);var B={escape:new RegExp("["+j.keys(q.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(q.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(t){j[t]=function(e){return null==e?"":(""+e).replace(B[t],function(e){return q[t][e]})}}),j.result=function(t,e){if(null==t)return void 0;var n=t[e];return j.isFunction(n)?n.call(t):n},j.mixin=function(t){k(j.functions(t),function(e){var n=j[e]=t[e];j.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),R.call(this,n.apply(j,t)) +}})};var M=0;j.uniqueId=function(t){var e=++M+"";return t?t+e:e},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,U={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(t,e,n){var r;n=j.defaults({},n,j.templateSettings);var i=new RegExp([(n.escape||F).source,(n.interpolate||F).source,(n.evaluate||F).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,n,r,i,s){return a+=t.slice(o,s).replace(z,function(t){return"\\"+U[t]}),n&&(a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(a+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),o=s+e.length,e}),a+="';\n",n.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(n.variable||"obj","_",a)}catch(s){throw s.source=a,s}if(e)return r(e,j);var u=function(t){return r.call(this,t,j)};return u.source="function("+(n.variable||"obj")+"){\n"+a+"}",u},j.chain=function(t){return j(t).chain()};var R=function(t){return this._chain?j(t).chain():t};j.mixin(j),k(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];j.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],R.call(this,n)}}),k(["concat","join","slice"],function(t){var e=o[t];j.prototype[t]=function(){return R.call(this,e.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this)},{}],97:[function(t,e){function n(){this.callbacks={}}e.exports=n,n.prototype.on=function(t){var e=3===arguments.length,n=e?arguments[1]:void 0,r=e?arguments[2]:arguments[1];return r._groupName=n,(this.callbacks[t]=this.callbacks[t]||[]).push(r),this},n.prototype.once=function(t){function e(){n.off(t,e),o.apply(this,arguments)}var n=this,r=3===arguments.length,i=r?arguments[1]:void 0,o=r?arguments[2]:arguments[1];return this.on(t,i,e),this},n.prototype.releaseGroup=function(t){var e,n,r,i;for(e in this.callbacks)for(i=this.callbacks[e],n=0,r=i.length;r>n;n++)i[n]._groupName===t&&(i.splice(n,1),n--,r--);return this},n.prototype.off=function(t,e){var n,r=this.callbacks[t];return r?1===arguments.length?(delete this.callbacks[t],this):(n=r.indexOf(e),r.splice(n,1),this):this},n.prototype.emit=function(t){var e,n,r=[].slice.call(arguments,1),i=this.callbacks[t],o=this.getWildcardCallbacks(t);if(i)for(e=0,n=i.length;n>e&&i[e];++e)i[e].apply(this,r);if(o)for(e=0,n=o.length;n>e&&o[e];++e)o[e].apply(this,[t].concat(r));return this},n.prototype.getWildcardCallbacks=function(t){var e,n,r=[];for(e in this.callbacks)n=e.split("*"),("*"===e||2===n.length&&t.slice(0,n[1].length)===n[1])&&(r=r.concat(this.callbacks[e]));return r}},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/clientapp/models/me.js b/clientapp/models/me.js index 1e8751f..2bbdfe9 100644 --- a/clientapp/models/me.js +++ b/clientapp/models/me.js @@ -94,7 +94,6 @@ module.exports = HumanModel.define({ self.contacts.add(contact); }); }); - }, isMe: function (jid) { return jid.bare === this.jid.bare; diff --git a/clientapp/models/message.js b/clientapp/models/message.js index 70944c3..3b84104 100644 --- a/clientapp/models/message.js +++ b/clientapp/models/message.js @@ -66,6 +66,22 @@ module.exports = HumanModel.define({ fn: function () { return !this.acked; } + }, + nick: { + deps: ['mine', 'type'], + fn: function () { + if (this.mine) { + if (this.type === 'groupchat') { + return me.mucs.get(this.to.bare).nick; + } else { + return 'me'; + } + } + if (this.type === 'groupchat') { + return this.from.resource; + } + return me.getContact(this.from.bare).displayName; + } } }, session: { diff --git a/clientapp/pages/groupchat.js b/clientapp/pages/groupchat.js index 6caf04b..ff849dc 100644 --- a/clientapp/pages/groupchat.js +++ b/clientapp/pages/groupchat.js @@ -3,7 +3,7 @@ var BasePage = require('./base'); var templates = require('../templates'); -var Message = require('../views/message'); +var Message = require('../views/mucMessage'); var MessageModel = require('../models/message'); @@ -23,7 +23,7 @@ module.exports = BasePage.extend({ avatar: 'header .avatar' }, textBindings: { - displayName: 'header .name', + displayName: 'header .name' }, show: function (animation) { BasePage.prototype.show.apply(this, [animation]); @@ -124,7 +124,7 @@ module.exports = BasePage.extend({ if (val) { message = { - to: this.model.lockedResource || this.model.jid, + to: this.model.jid, type: 'groupchat', body: val, chatState: 'active' diff --git a/clientapp/templates.js b/clientapp/templates.js index 8d0ca58..78a2063 100644 --- a/clientapp/templates.js +++ b/clientapp/templates.js @@ -77,7 +77,7 @@ exports.includes.mucListItem = function anonymous(locals) { exports.includes.mucMessage = function anonymous(locals) { var buf = []; with (locals || {}) { - buf.push('
  • ' + jade.escape(null == (jade.interp = message.nick) ? "" : jade.interp) + '' + jade.escape(null == (jade.interp = message.created) ? "" : jade.interp) + '

    ' + jade.escape(null == (jade.interp = message.body) ? "" : jade.interp) + "

  • "); + buf.push('
  • ' + jade.escape(null == (jade.interp = message.created) ? "" : jade.interp) + '

    ' + jade.escape(null == (jade.interp = message.body) ? "" : jade.interp) + '

    ' + jade.escape(null == (jade.interp = message.nick) ? "" : jade.interp) + "
  • "); } return buf.join(""); }; diff --git a/clientapp/templates/includes/mucMessage.jade b/clientapp/templates/includes/mucMessage.jade new file mode 100644 index 0000000..e3924a0 --- /dev/null +++ b/clientapp/templates/includes/mucMessage.jade @@ -0,0 +1,5 @@ +li + .message + span.timestamp=message.created + p.body=message.body + span.sender=message.nick diff --git a/clientapp/views/mucMessage.js b/clientapp/views/mucMessage.js new file mode 100644 index 0000000..cde5750 --- /dev/null +++ b/clientapp/views/mucMessage.js @@ -0,0 +1,29 @@ +/*global $*/ +"use strict"; + +var _ = require('underscore'); +var HumanView = require('human-view'); +var templates = require('../templates'); + + +module.exports = HumanView.extend({ + template: templates.includes.mucMessage, + initialize: function (opts) { + this.render(); + }, + classBindings: { + mine: '.message', + acked: '.message', + delayed: '.message', + edited: '.message' + }, + textBindings: { + body: '.body', + nick: '.nick', + formattedTime: '.timestamp' + }, + render: function () { + this.renderAndBind({message: this.model}); + return this; + } +}); diff --git a/public/css/app/chat.styl b/public/css/app/chat.styl index c0d8416..d453648 100644 --- a/public/css/app/chat.styl +++ b/public/css/app/chat.styl @@ -124,6 +124,9 @@ float: right display: block + .sender + display: block + .chatBox borderbox() border-top: 1px solid $grayOutline diff --git a/public/css/otalk.css b/public/css/otalk.css index affe90b..07a719d 100644 --- a/public/css/otalk.css +++ b/public/css/otalk.css @@ -738,6 +738,9 @@ h4 { float: right; display: block; } +.messages .message .sender { + display: block; +} .chatBox { -moz-box-sizing: border-box; -webkit-box-sizing: border-box;